UNPKG

react-svg-credit-card-payment-icons

Version:

React components library with 6 styles, 108 icons, TypeScript support, and a variety of types and formats for easy integration into React applications.

1,077 lines (1,073 loc) 42.1 kB
import { CARD_METADATA, detectCardType, formatCardNumber, getCardLengthRange, getCardType, getCardsByCountry, isCardNumberPotentiallyValid, maskCardNumber, sanitizeCardNumber, validateCardForType, validateCardNumber } from "./chunk-DEJVU3HJ.mjs"; import { flat_exports } from "./chunk-HTIEA7YJ.mjs"; import "./chunk-GNEGZYYX.mjs"; import "./chunk-LWCWLIBM.mjs"; import "./chunk-QYT3BOJP.mjs"; import "./chunk-GTIMUMFJ.mjs"; import "./chunk-36222L3I.mjs"; import "./chunk-OQZAOLQ7.mjs"; import "./chunk-KRFH3HZM.mjs"; import "./chunk-ZNEDOZF2.mjs"; import "./chunk-F4RFNX3F.mjs"; import "./chunk-GDQFHXNT.mjs"; import "./chunk-6ATJSAGR.mjs"; import "./chunk-QXYJ6APU.mjs"; import "./chunk-6UNYQSFQ.mjs"; import "./chunk-IVFK6DMG.mjs"; import "./chunk-7LTTSL3D.mjs"; import { flat_rounded_exports } from "./chunk-XKLFOP5A.mjs"; import "./chunk-OUSVIUKS.mjs"; import "./chunk-ETNQQSL6.mjs"; import "./chunk-FTVB3G6G.mjs"; import "./chunk-MMCWMO7W.mjs"; import "./chunk-NSBIVL3U.mjs"; import "./chunk-75I277KW.mjs"; import "./chunk-GX4OKNRO.mjs"; import "./chunk-CGBQROII.mjs"; import { Generic_default } from "./chunk-EWBUKQIC.mjs"; import "./chunk-PEOMZDZ6.mjs"; import "./chunk-XZKRSAM7.mjs"; import "./chunk-SZGHHLED.mjs"; import "./chunk-77S5CXMM.mjs"; import "./chunk-YYQ53S4D.mjs"; import "./chunk-GBKV5FBJ.mjs"; import { logo_exports } from "./chunk-S7JXR3X7.mjs"; import "./chunk-WO4OALM7.mjs"; import "./chunk-SXY3GYU3.mjs"; import "./chunk-V323SG7N.mjs"; import "./chunk-M5NDBWSN.mjs"; import "./chunk-HQ72AIAZ.mjs"; import "./chunk-Q7TLNIJ2.mjs"; import "./chunk-MLHF7Q4K.mjs"; import "./chunk-7WBDA5E2.mjs"; import "./chunk-PU3CFO6A.mjs"; import "./chunk-5YXLNUOB.mjs"; import "./chunk-2ZNHB4JO.mjs"; import "./chunk-L3RPLO4G.mjs"; import "./chunk-OG3WQS74.mjs"; import "./chunk-CAQEOOAE.mjs"; import "./chunk-AHTQX5RA.mjs"; import { logo_border_exports } from "./chunk-ZIDP66DK.mjs"; import "./chunk-BOPMGXCL.mjs"; import "./chunk-HRS327AN.mjs"; import "./chunk-U4Z6WXDX.mjs"; import "./chunk-KGVCRPKM.mjs"; import "./chunk-7DP32GMR.mjs"; import "./chunk-JL2GHJMM.mjs"; import "./chunk-DYMJPGGG.mjs"; import "./chunk-CGJQKOV5.mjs"; import "./chunk-WUJPZPV5.mjs"; import "./chunk-JW7DUJJI.mjs"; import "./chunk-BJGDQB4Y.mjs"; import "./chunk-RHEDVUPP.mjs"; import "./chunk-JSTWVK7U.mjs"; import "./chunk-S5RYIQDY.mjs"; import "./chunk-46LOHM5C.mjs"; import { mono_exports } from "./chunk-PKTZ6EKR.mjs"; import "./chunk-JXF5RHXD.mjs"; import "./chunk-HKKJDJ46.mjs"; import "./chunk-ES4LKV37.mjs"; import "./chunk-5RQZLVBV.mjs"; import "./chunk-WCG6BBNV.mjs"; import "./chunk-VRA4UNZP.mjs"; import "./chunk-BWNYANTM.mjs"; import "./chunk-BZ6BRLXG.mjs"; import "./chunk-A3QNGNBN.mjs"; import "./chunk-DFCPZZ2B.mjs"; import "./chunk-BKGHMCHA.mjs"; import "./chunk-DENL2XDB.mjs"; import "./chunk-5WDIL3A7.mjs"; import "./chunk-VNS3NHB2.mjs"; import "./chunk-YTVTIX4F.mjs"; import { mono_outline_exports } from "./chunk-XXX7HIIJ.mjs"; import "./chunk-ZIAYL2AB.mjs"; import "./chunk-DL3SWNQJ.mjs"; import "./chunk-GONPBFIU.mjs"; import "./chunk-NKYIXTEL.mjs"; import "./chunk-XZTCXOZX.mjs"; import "./chunk-5ATZACFQ.mjs"; import "./chunk-ZXUWEQR4.mjs"; import "./chunk-YBJXLYSI.mjs"; import "./chunk-VYHHFKOW.mjs"; import "./chunk-I5ZE725V.mjs"; import "./chunk-ASSYVZU5.mjs"; import "./chunk-3XSCCRJD.mjs"; import "./chunk-Q2KMOAM4.mjs"; import "./chunk-L53DVCWQ.mjs"; import "./chunk-RGUZQCXA.mjs"; import "./chunk-7P6ASYW6.mjs"; // src/index.tsx import React2 from "react"; // generated/unifiedIcons.tsx import * as React from "react"; var formatMappings = { flat: flat_exports, flatRounded: flat_rounded_exports, logo: logo_exports, logoBorder: logo_border_exports, mono: mono_exports, monoOutline: mono_outline_exports }; var AVAILABLE_FORMATS = ["flat", "flatRounded", "logo", "logoBorder", "mono", "monoOutline"]; function AlipayIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.Alipay; if (!Component) throw new Error(`Alipay not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AlipayFlatIcon(props) { const Component = formatMappings.flat.Alipay; if (!Component) throw new Error(`Alipay not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AlipayFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.Alipay; if (!Component) throw new Error(`Alipay not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AlipayLogoIcon(props) { const Component = formatMappings.logo.Alipay; if (!Component) throw new Error(`Alipay not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AlipayLogoBorderIcon(props) { const Component = formatMappings.logoBorder.Alipay; if (!Component) throw new Error(`Alipay not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AlipayMonoIcon(props) { const Component = formatMappings.mono.Alipay; if (!Component) throw new Error(`Alipay not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AlipayMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.Alipay; if (!Component) throw new Error(`Alipay not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AmericanExpressIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.AmericanExpress; if (!Component) throw new Error(`AmericanExpress not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AmericanExpressFlatIcon(props) { const Component = formatMappings.flat.AmericanExpress; if (!Component) throw new Error(`AmericanExpress not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AmericanExpressFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.AmericanExpress; if (!Component) throw new Error(`AmericanExpress not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AmericanExpressLogoIcon(props) { const Component = formatMappings.logo.AmericanExpress; if (!Component) throw new Error(`AmericanExpress not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AmericanExpressLogoBorderIcon(props) { const Component = formatMappings.logoBorder.AmericanExpress; if (!Component) throw new Error(`AmericanExpress not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AmericanExpressMonoIcon(props) { const Component = formatMappings.mono.AmericanExpress; if (!Component) throw new Error(`AmericanExpress not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AmericanExpressMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.AmericanExpress; if (!Component) throw new Error(`AmericanExpress not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function AmericanexpressIcon(props) { return /* @__PURE__ */ React.createElement(AmericanExpressIcon, { ...props }); } function AmexIcon(props) { return /* @__PURE__ */ React.createElement(AmericanExpressIcon, { ...props }); } function DinersClubIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.DinersClub; if (!Component) throw new Error(`DinersClub not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function DinersClubFlatIcon(props) { const Component = formatMappings.flat.DinersClub; if (!Component) throw new Error(`DinersClub not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function DinersClubFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.DinersClub; if (!Component) throw new Error(`DinersClub not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function DinersClubLogoIcon(props) { const Component = formatMappings.logo.DinersClub; if (!Component) throw new Error(`DinersClub not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function DinersClubLogoBorderIcon(props) { const Component = formatMappings.logoBorder.DinersClub; if (!Component) throw new Error(`DinersClub not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function DinersClubMonoIcon(props) { const Component = formatMappings.mono.DinersClub; if (!Component) throw new Error(`DinersClub not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function DinersClubMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.DinersClub; if (!Component) throw new Error(`DinersClub not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function DinersIcon(props) { return /* @__PURE__ */ React.createElement(DinersClubIcon, { ...props }); } function DiscoverIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.Discover; if (!Component) throw new Error(`Discover not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function DiscoverFlatIcon(props) { const Component = formatMappings.flat.Discover; if (!Component) throw new Error(`Discover not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function DiscoverFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.Discover; if (!Component) throw new Error(`Discover not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function DiscoverLogoIcon(props) { const Component = formatMappings.logo.Discover; if (!Component) throw new Error(`Discover not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function DiscoverLogoBorderIcon(props) { const Component = formatMappings.logoBorder.Discover; if (!Component) throw new Error(`Discover not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function DiscoverMonoIcon(props) { const Component = formatMappings.mono.Discover; if (!Component) throw new Error(`Discover not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function DiscoverMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.Discover; if (!Component) throw new Error(`Discover not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function EloIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.Elo; if (!Component) throw new Error(`Elo not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function EloFlatIcon(props) { const Component = formatMappings.flat.Elo; if (!Component) throw new Error(`Elo not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function EloFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.Elo; if (!Component) throw new Error(`Elo not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function EloLogoIcon(props) { const Component = formatMappings.logo.Elo; if (!Component) throw new Error(`Elo not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function EloLogoBorderIcon(props) { const Component = formatMappings.logoBorder.Elo; if (!Component) throw new Error(`Elo not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function EloMonoIcon(props) { const Component = formatMappings.mono.Elo; if (!Component) throw new Error(`Elo not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function EloMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.Elo; if (!Component) throw new Error(`Elo not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function GenericIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.Generic; if (!Component) throw new Error(`Generic not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function GenericFlatIcon({ variant, ...props }) { const componentKey = variant || "Generic"; const Component = formatMappings.flat[componentKey]; if (!Component) throw new Error(`${componentKey} not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function GenericFlatRoundedIcon({ variant, ...props }) { const componentKey = variant || "Generic"; const Component = formatMappings.flatRounded[componentKey]; if (!Component) throw new Error(`${componentKey} not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function GenericLogoIcon({ variant, ...props }) { const componentKey = variant || "Generic"; const Component = formatMappings.logo[componentKey]; if (!Component) throw new Error(`${componentKey} not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function GenericLogoBorderIcon({ variant, ...props }) { const componentKey = variant || "Generic"; const Component = formatMappings.logoBorder[componentKey]; if (!Component) throw new Error(`${componentKey} not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function GenericMonoIcon({ variant, ...props }) { const componentKey = variant || "Generic"; const Component = formatMappings.mono[componentKey]; if (!Component) throw new Error(`${componentKey} not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function GenericMonoOutlineIcon({ variant, ...props }) { const componentKey = variant || "Generic"; const Component = formatMappings.monoOutline[componentKey]; if (!Component) throw new Error(`${componentKey} not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function GenericCardIcon(props) { return /* @__PURE__ */ React.createElement(GenericIcon, { ...props }); } function GenericCardFrontIcon(props) { return /* @__PURE__ */ React.createElement(GenericIcon, { ...props }); } function CodeIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.Code; if (!Component) throw new Error(`Code not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function CodeFlatIcon(props) { const Component = formatMappings.flat.Code; if (!Component) throw new Error(`Code not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function CodeFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.Code; if (!Component) throw new Error(`Code not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function CodeLogoIcon(props) { const Component = formatMappings.logo.Code; if (!Component) throw new Error(`Code not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function CodeLogoBorderIcon(props) { const Component = formatMappings.logoBorder.Code; if (!Component) throw new Error(`Code not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function CodeMonoIcon(props) { const Component = formatMappings.mono.Code; if (!Component) throw new Error(`Code not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function CodeMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.Code; if (!Component) throw new Error(`Code not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function CodeFrontIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.CodeFront; if (!Component) throw new Error(`CodeFront not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function CodeFrontFlatIcon(props) { const Component = formatMappings.flat.CodeFront; if (!Component) throw new Error(`CodeFront not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function CodeFrontFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.CodeFront; if (!Component) throw new Error(`CodeFront not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function CodeFrontLogoIcon(props) { const Component = formatMappings.logo.CodeFront; if (!Component) throw new Error(`CodeFront not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function CodeFrontLogoBorderIcon(props) { const Component = formatMappings.logoBorder.CodeFront; if (!Component) throw new Error(`CodeFront not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function CodeFrontMonoIcon(props) { const Component = formatMappings.mono.CodeFront; if (!Component) throw new Error(`CodeFront not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function CodeFrontMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.CodeFront; if (!Component) throw new Error(`CodeFront not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HipercardIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.Hipercard; if (!Component) throw new Error(`Hipercard not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HipercardFlatIcon({ variant, ...props }) { const componentKey = variant || "Hipercard"; const Component = formatMappings.flat[componentKey]; if (!Component) throw new Error(`${componentKey} not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HipercardFlatRoundedIcon({ variant, ...props }) { const componentKey = variant || "Hipercard"; const Component = formatMappings.flatRounded[componentKey]; if (!Component) throw new Error(`${componentKey} not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HipercardLogoIcon({ variant, ...props }) { const componentKey = variant || "Hipercard"; const Component = formatMappings.logo[componentKey]; if (!Component) throw new Error(`${componentKey} not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HipercardLogoBorderIcon({ variant, ...props }) { const componentKey = variant || "Hipercard"; const Component = formatMappings.logoBorder[componentKey]; if (!Component) throw new Error(`${componentKey} not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HipercardMonoIcon({ variant, ...props }) { const componentKey = variant || "Hipercard"; const Component = formatMappings.mono[componentKey]; if (!Component) throw new Error(`${componentKey} not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HipercardMonoOutlineIcon({ variant, ...props }) { const componentKey = variant || "Hipercard"; const Component = formatMappings.monoOutline[componentKey]; if (!Component) throw new Error(`${componentKey} not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HiperIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.Hiper; if (!Component) throw new Error(`Hiper not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HiperFlatIcon(props) { const Component = formatMappings.flat.Hiper; if (!Component) throw new Error(`Hiper not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HiperFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.Hiper; if (!Component) throw new Error(`Hiper not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HiperLogoIcon(props) { const Component = formatMappings.logo.Hiper; if (!Component) throw new Error(`Hiper not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HiperLogoBorderIcon(props) { const Component = formatMappings.logoBorder.Hiper; if (!Component) throw new Error(`Hiper not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HiperMonoIcon(props) { const Component = formatMappings.mono.Hiper; if (!Component) throw new Error(`Hiper not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function HiperMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.Hiper; if (!Component) throw new Error(`Hiper not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function JCBIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.JCB; if (!Component) throw new Error(`JCB not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function JCBFlatIcon(props) { const Component = formatMappings.flat.JCB; if (!Component) throw new Error(`JCB not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function JCBFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.JCB; if (!Component) throw new Error(`JCB not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function JCBLogoIcon(props) { const Component = formatMappings.logo.JCB; if (!Component) throw new Error(`JCB not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function JCBLogoBorderIcon(props) { const Component = formatMappings.logoBorder.JCB; if (!Component) throw new Error(`JCB not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function JCBMonoIcon(props) { const Component = formatMappings.mono.JCB; if (!Component) throw new Error(`JCB not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function JCBMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.JCB; if (!Component) throw new Error(`JCB not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function JcbIcon(props) { return /* @__PURE__ */ React.createElement(JCBIcon, { ...props }); } function MaestroIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.Maestro; if (!Component) throw new Error(`Maestro not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MaestroFlatIcon(props) { const Component = formatMappings.flat.Maestro; if (!Component) throw new Error(`Maestro not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MaestroFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.Maestro; if (!Component) throw new Error(`Maestro not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MaestroLogoIcon(props) { const Component = formatMappings.logo.Maestro; if (!Component) throw new Error(`Maestro not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MaestroLogoBorderIcon(props) { const Component = formatMappings.logoBorder.Maestro; if (!Component) throw new Error(`Maestro not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MaestroMonoIcon(props) { const Component = formatMappings.mono.Maestro; if (!Component) throw new Error(`Maestro not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MaestroMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.Maestro; if (!Component) throw new Error(`Maestro not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MastercardIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.Mastercard; if (!Component) throw new Error(`Mastercard not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MastercardFlatIcon(props) { const Component = formatMappings.flat.Mastercard; if (!Component) throw new Error(`Mastercard not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MastercardFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.Mastercard; if (!Component) throw new Error(`Mastercard not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MastercardLogoIcon(props) { const Component = formatMappings.logo.Mastercard; if (!Component) throw new Error(`Mastercard not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MastercardLogoBorderIcon(props) { const Component = formatMappings.logoBorder.Mastercard; if (!Component) throw new Error(`Mastercard not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MastercardMonoIcon(props) { const Component = formatMappings.mono.Mastercard; if (!Component) throw new Error(`Mastercard not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MastercardMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.Mastercard; if (!Component) throw new Error(`Mastercard not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MirIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.Mir; if (!Component) throw new Error(`Mir not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MirFlatIcon(props) { const Component = formatMappings.flat.Mir; if (!Component) throw new Error(`Mir not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MirFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.Mir; if (!Component) throw new Error(`Mir not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MirLogoIcon(props) { const Component = formatMappings.logo.Mir; if (!Component) throw new Error(`Mir not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MirLogoBorderIcon(props) { const Component = formatMappings.logoBorder.Mir; if (!Component) throw new Error(`Mir not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MirMonoIcon(props) { const Component = formatMappings.mono.Mir; if (!Component) throw new Error(`Mir not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function MirMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.Mir; if (!Component) throw new Error(`Mir not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function PayPalIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.PayPal; if (!Component) throw new Error(`PayPal not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function PayPalFlatIcon(props) { const Component = formatMappings.flat.PayPal; if (!Component) throw new Error(`PayPal not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function PayPalFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.PayPal; if (!Component) throw new Error(`PayPal not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function PayPalLogoIcon(props) { const Component = formatMappings.logo.PayPal; if (!Component) throw new Error(`PayPal not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function PayPalLogoBorderIcon(props) { const Component = formatMappings.logoBorder.PayPal; if (!Component) throw new Error(`PayPal not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function PayPalMonoIcon(props) { const Component = formatMappings.mono.PayPal; if (!Component) throw new Error(`PayPal not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function PayPalMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.PayPal; if (!Component) throw new Error(`PayPal not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function PaypalIcon(props) { return /* @__PURE__ */ React.createElement(PayPalIcon, { ...props }); } function SwishIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.Swish; if (!Component) throw new Error(`Swish not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function SwishFlatIcon(props) { const Component = formatMappings.flat.Swish; if (!Component) throw new Error(`Swish not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function SwishFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.Swish; if (!Component) throw new Error(`Swish not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function SwishLogoIcon(props) { const Component = formatMappings.logo.Swish; if (!Component) throw new Error(`Swish not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function SwishLogoBorderIcon(props) { const Component = formatMappings.logoBorder.Swish; if (!Component) throw new Error(`Swish not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function SwishMonoIcon(props) { const Component = formatMappings.mono.Swish; if (!Component) throw new Error(`Swish not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function SwishMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.Swish; if (!Component) throw new Error(`Swish not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function UnionPayIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.UnionPay; if (!Component) throw new Error(`UnionPay not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function UnionPayFlatIcon(props) { const Component = formatMappings.flat.UnionPay; if (!Component) throw new Error(`UnionPay not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function UnionPayFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.UnionPay; if (!Component) throw new Error(`UnionPay not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function UnionPayLogoIcon(props) { const Component = formatMappings.logo.UnionPay; if (!Component) throw new Error(`UnionPay not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function UnionPayLogoBorderIcon(props) { const Component = formatMappings.logoBorder.UnionPay; if (!Component) throw new Error(`UnionPay not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function UnionPayMonoIcon(props) { const Component = formatMappings.mono.UnionPay; if (!Component) throw new Error(`UnionPay not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function UnionPayMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.UnionPay; if (!Component) throw new Error(`UnionPay not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function UnionpayIcon(props) { return /* @__PURE__ */ React.createElement(UnionPayIcon, { ...props }); } function VisaIcon({ format = "flat", ...props }) { const Component = formatMappings[format]?.Visa; if (!Component) throw new Error(`Visa not available in format: ${format}`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function VisaFlatIcon(props) { const Component = formatMappings.flat.Visa; if (!Component) throw new Error(`Visa not available in format: flat`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function VisaFlatRoundedIcon(props) { const Component = formatMappings.flatRounded.Visa; if (!Component) throw new Error(`Visa not available in format: flatRounded`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function VisaLogoIcon(props) { const Component = formatMappings.logo.Visa; if (!Component) throw new Error(`Visa not available in format: logo`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function VisaLogoBorderIcon(props) { const Component = formatMappings.logoBorder.Visa; if (!Component) throw new Error(`Visa not available in format: logoBorder`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function VisaMonoIcon(props) { const Component = formatMappings.mono.Visa; if (!Component) throw new Error(`Visa not available in format: mono`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } function VisaMonoOutlineIcon(props) { const Component = formatMappings.monoOutline.Visa; if (!Component) throw new Error(`Visa not available in format: monoOutline`); return /* @__PURE__ */ React.createElement(Component, { ...props }); } // src/index.tsx var categoryMappings = { flat: flat_exports, flatRounded: flat_rounded_exports, logo: logo_exports, logoBorder: logo_border_exports, mono: mono_exports, monoOutline: mono_outline_exports }; var defaultType = "generic"; var defaultCategory = "flat"; var aspectRatio = 780 / 500; var defaultWidth = 40; function resolveAlias(input) { for (const card of CARD_METADATA) { if (card.type === input) { return { type: card.type }; } if (card.aliases.some((alias) => alias === input)) { return { type: card.type }; } if (card.variants) { for (const [variantAlias, variantDef] of Object.entries(card.variants)) { if (variantAlias === input) { return { type: card.type, variant: variantDef.slug }; } } } } return { type: input }; } function PaymentIcon(props) { const category = props.format || defaultCategory; if (!categoryMappings[category]) throw new Error( `Invalid category: ${category} please use one of ${Object.keys(categoryMappings).join(", ")}` ); const inputType = props.type || defaultType; const resolved = resolveAlias(inputType); const sanitizedType = resolved.type.replace(/[-_]/g, ""); const normalizedType = sanitizedType.charAt(0).toUpperCase() + sanitizedType.slice(1); const categoryComponents = categoryMappings[category]; let Component; if (resolved.variant && !props.variant) { const sanitizedInput = inputType.replace(/[-_]/g, ""); const normalizedInput = sanitizedInput.charAt(0).toUpperCase() + sanitizedInput.slice(1); Component = categoryComponents[normalizedInput]; } else if (props.variant) { const sanitizedVariant = props.variant.replace(/[-_]/g, ""); const normalizedVariant = sanitizedVariant.charAt(0).toUpperCase() + sanitizedVariant.slice(1); const compositeKey = `${normalizedType}${normalizedVariant}`; Component = categoryComponents[compositeKey] ?? categoryComponents[normalizedVariant]; } else { Component = categoryComponents[normalizedType]; } if (!Component) { Component = Generic_default; } const width = props.width ?? (props.height ? props.height * aspectRatio : defaultWidth); const height = props.height ?? width / aspectRatio; return /* @__PURE__ */ React2.createElement(Component, { ...props, width, height, viewBox: "0 0 780 500" }); } export { AVAILABLE_FORMATS, AlipayFlatIcon, AlipayFlatRoundedIcon, AlipayIcon, AlipayLogoBorderIcon, AlipayLogoIcon, AlipayMonoIcon, AlipayMonoOutlineIcon, AmericanExpressFlatIcon, AmericanExpressFlatRoundedIcon, AmericanExpressIcon, AmericanExpressLogoBorderIcon, AmericanExpressLogoIcon, AmericanExpressMonoIcon, AmericanExpressMonoOutlineIcon, AmericanexpressIcon, AmexIcon, CodeFlatIcon, CodeFlatRoundedIcon, CodeFrontFlatIcon, CodeFrontFlatRoundedIcon, CodeFrontIcon, CodeFrontLogoBorderIcon, CodeFrontLogoIcon, CodeFrontMonoIcon, CodeFrontMonoOutlineIcon, CodeIcon, CodeLogoBorderIcon, CodeLogoIcon, CodeMonoIcon, CodeMonoOutlineIcon, DinersClubFlatIcon, DinersClubFlatRoundedIcon, DinersClubIcon, DinersClubLogoBorderIcon, DinersClubLogoIcon, DinersClubMonoIcon, DinersClubMonoOutlineIcon, DinersIcon, DiscoverFlatIcon, DiscoverFlatRoundedIcon, DiscoverIcon, DiscoverLogoBorderIcon, DiscoverLogoIcon, DiscoverMonoIcon, DiscoverMonoOutlineIcon, EloFlatIcon, EloFlatRoundedIcon, EloIcon, EloLogoBorderIcon, EloLogoIcon, EloMonoIcon, EloMonoOutlineIcon, GenericCardFrontIcon, GenericCardIcon, GenericFlatIcon, GenericFlatRoundedIcon, GenericIcon, GenericLogoBorderIcon, GenericLogoIcon, GenericMonoIcon, GenericMonoOutlineIcon, HiperFlatIcon, HiperFlatRoundedIcon, HiperIcon, HiperLogoBorderIcon, HiperLogoIcon, HiperMonoIcon, HiperMonoOutlineIcon, HipercardFlatIcon, HipercardFlatRoundedIcon, HipercardIcon, HipercardLogoBorderIcon, HipercardLogoIcon, HipercardMonoIcon, HipercardMonoOutlineIcon, JCBFlatIcon, JCBFlatRoundedIcon, JCBIcon, JCBLogoBorderIcon, JCBLogoIcon, JCBMonoIcon, JCBMonoOutlineIcon, JcbIcon, MaestroFlatIcon, MaestroFlatRoundedIcon, MaestroIcon, MaestroLogoBorderIcon, MaestroLogoIcon, MaestroMonoIcon, MaestroMonoOutlineIcon, MastercardFlatIcon, MastercardFlatRoundedIcon, MastercardIcon, MastercardLogoBorderIcon, MastercardLogoIcon, MastercardMonoIcon, MastercardMonoOutlineIcon, MirFlatIcon, MirFlatRoundedIcon, MirIcon, MirLogoBorderIcon, MirLogoIcon, MirMonoIcon, MirMonoOutlineIcon, PayPalFlatIcon, PayPalFlatRoundedIcon, PayPalIcon, PayPalLogoBorderIcon, PayPalLogoIcon, PayPalMonoIcon, PayPalMonoOutlineIcon, PaymentIcon, PaypalIcon, SwishFlatIcon, SwishFlatRoundedIcon, SwishIcon, SwishLogoBorderIcon, SwishLogoIcon, SwishMonoIcon, SwishMonoOutlineIcon, UnionPayFlatIcon, UnionPayFlatRoundedIcon, UnionPayIcon, UnionPayLogoBorderIcon, UnionPayLogoIcon, UnionPayMonoIcon, UnionPayMonoOutlineIcon, UnionpayIcon, VisaFlatIcon, VisaFlatRoundedIcon, VisaIcon, VisaLogoBorderIcon, VisaLogoIcon, VisaMonoIcon, VisaMonoOutlineIcon, detectCardType, flat_exports as flat, flat_rounded_exports as flatRounded, formatCardNumber, getCardLengthRange, getCardType, getCardsByCountry, isCardNumberPotentiallyValid, logo_exports as logo, logo_border_exports as logoBorder, maskCardNumber, mono_exports as mono, mono_outline_exports as monoOutline, sanitizeCardNumber, validateCardForType, validateCardNumber };