{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "jsx-email/coupons-with-centered-text",
  "title": "Coupons With Centered Text",
  "description": "Marketing coupons variant for email templates",
  "dependencies": [
    "jsx-email"
  ],
  "registryDependencies": [
    "https://emailcn.run/r/jsx-email/default-fonts.json",
    "https://emailcn.run/r/jsx-email/theme-default.json"
  ],
  "files": [
    {
      "path": "registry/bases/jsx-email/components/marketing/coupons/coupons-with-centered-text.tsx",
      "content": "import {\n  Body,\n  Container,\n  Head as EmailHead,\n  Html,\n  Img,\n  Preview,\n  Text,\n  Heading,\n  Section,\n  Row,\n  Column,\n  Link,\n} from \"jsx-email\";\nimport { Fragment } from \"react\";\n\nimport { DefaultFonts } from \"@/components/email/font-default\";\nimport { EmailTailwind } from \"@/components/email/email-theme\";\nimport type { EmailTheme } from \"@/components/email/email-theme\";\nimport { emailAsset } from \"@/components/email/email-assets\";\nimport { defaultTheme } from \"@/components/email/theme-default\";\n\nexport type CouponsWithCenteredTextVariant =\n  | \"impact\"\n  | \"inline\"\n  | \"impact-alt\"\n  | \"impact-background\";\n\nexport interface CouponsWithCenteredTextProps {\n  theme?: EmailTheme;\n  overline?: string;\n  discount?: string;\n  code?: string;\n  expiry?: string;\n  description?: string;\n  backgroundImageSrc?: string;\n  buttonLabel?: string;\n  buttonHref?: string;\n  arrowIconSrc?: string;\n  pageBackgroundColor?: string;\n  backgroundColor?: string;\n  codeBackgroundColor?: string;\n  headingColor?: string;\n  textColor?: string;\n  buttonBackgroundColor?: string;\n  buttonColor?: string;\n  variant?: CouponsWithCenteredTextVariant;\n}\n\nconst fontFamily =\n  'Inter, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif';\n\nconst responsiveStyles = `\n  @media only screen and (max-width: 599px) {\n    .coupon-centered-description { padding-left: 24px !important; padding-right: 24px !important; }\n    .coupon-centered-impact { font-size: 60px !important; }\n    .coupon-centered-inline { font-size: 36px !important; }\n    .coupon-centered-code { margin-top: 16px !important; }\n  }\n`;\n\nconst defaults = {\n  arrowIconSrc: emailAsset(\"icon-arrow-right.png\"),\n  backgroundColor: \"#fffffe\",\n  backgroundImageSrc: emailAsset(\"coupons/pattern.png\"),\n  buttonBackgroundColor: \"#4f46e5\",\n  buttonColor: \"#fffffe\",\n  buttonHref: \"https://example.com\",\n  buttonLabel: \"Shop now\",\n  code: \"WINTER20OFF\",\n  codeBackgroundColor: \"#f3f4f6\",\n  description:\n    \"Use code: WINTER20OFF at checkout, or click the link below to automatically apply the discount to your order.\",\n  discount: \"20% OFF\",\n  expiry: \"until 31/10/2025\",\n  headingColor: \"#030712\",\n  overline: \"Our biggest sale of the year\",\n  pageBackgroundColor: \"#f1f5f9\",\n  textColor: \"#4b5563\",\n};\n\ntype SectionProps = Omit<CouponsWithCenteredTextProps, \"theme\">;\n\ntype ResolvedProps = typeof defaults & SectionProps;\n\nconst Overline = ({\n  light,\n  props,\n}: {\n  light: boolean;\n  props: ResolvedProps;\n}) => (\n  <Text\n    style={{\n      color: light ? \"#fffffe\" : props.headingColor,\n      fontFamily,\n      fontSize: \"16px\",\n      fontWeight: light ? 600 : undefined,\n      lineHeight: \"24px\",\n      margin: 0,\n      textAlign: \"center\",\n      textTransform: \"uppercase\",\n    }}\n  >\n    {props.overline === defaults.overline && !light ? (\n      <>\n        Our <strong>biggest sale</strong> of the year\n      </>\n    ) : (\n      props.overline\n    )}\n  </Text>\n);\n\nconst ImpactHeading = ({\n  alt,\n  light,\n  props,\n}: {\n  alt: boolean;\n  light: boolean;\n  props: ResolvedProps;\n}) => (\n  <Heading\n    className=\"coupon-centered-impact\"\n    style={{\n      color: light ? \"#fffffe\" : props.headingColor,\n      fontFamily,\n      fontSize: \"96px\",\n      fontWeight: 500,\n      lineHeight: \"normal\",\n      margin: 0,\n      textAlign: \"center\",\n    }}\n    as=\"h3\"\n  >\n    {alt && props.discount === defaults.discount ? (\n      <>\n        20%<span style={{ fontWeight: 100 }}>OFF</span>\n      </>\n    ) : (\n      props.discount\n    )}\n  </Heading>\n);\n\nconst Description = ({\n  light,\n  props,\n}: {\n  light: boolean;\n  props: ResolvedProps;\n}) => (\n  <Section width=\"100%\">\n    <Fragment>\n      <Row>\n        <Column\n          className=\"coupon-centered-description\"\n          style={{ padding: \"0 44px\" }}\n        >\n          <Text\n            style={{\n              color: light ? \"#fffffe\" : props.textColor,\n              fontFamily,\n              fontSize: \"16px\",\n              fontWeight: 300,\n              lineHeight: \"24px\",\n              margin: 0,\n              textAlign: \"center\",\n            }}\n          >\n            Use code: <strong>{props.code}</strong> at checkout, or click the\n            link below to automatically apply the discount to your order.\n          </Text>\n        </Column>\n      </Row>\n    </Fragment>\n  </Section>\n);\n\nconst CodeBox = ({ props }: { props: ResolvedProps }) => (\n  <Section\n    align=\"center\"\n    className=\"coupon-centered-code\"\n    style={{ margin: \"0 auto\" }}\n  >\n    <Fragment>\n      <Row>\n        <Column\n          style={{\n            backgroundColor: props.codeBackgroundColor,\n            borderRadius: \"8px\",\n            color: props.headingColor,\n            fontFamily,\n            fontSize: \"16px\",\n            lineHeight: \"24px\",\n            padding: \"8px 16px\",\n          }}\n        >\n          {props.code}\n        </Column>\n      </Row>\n    </Fragment>\n  </Section>\n);\n\nconst CouponButton = ({ props }: { props: ResolvedProps }) => (\n  <Section style={{ textAlign: \"center\" }}>\n    <Link\n      href={props.buttonHref}\n      style={{\n        backgroundColor: props.buttonBackgroundColor,\n        borderRadius: \"8px\",\n        color: props.buttonColor,\n        display: \"inline-block\",\n        fontFamily,\n        fontSize: \"16px\",\n        fontWeight: 500,\n        lineHeight: 1,\n        padding: \"14px 20px\",\n        textDecoration: \"none\",\n      }}\n    >\n      <span style={{ marginRight: \"8px\" }}>{props.buttonLabel}</span>\n      <span>\n        <Img\n          alt=\"\"\n          src={props.arrowIconSrc}\n          style={{\n            display: \"inline\",\n            maxWidth: \"100%\",\n            verticalAlign: \"baseline\",\n          }}\n          width={12}\n        />\n      </span>\n    </Link>\n  </Section>\n);\n\nexport const CouponsWithCenteredTextSection = (props: SectionProps) => {\n  const variant = props.variant ?? \"impact\";\n  const resolved = { ...defaults, ...props } as ResolvedProps;\n  const background = variant === \"impact-background\";\n  const inline = variant === \"inline\";\n  const alt = variant === \"impact-alt\";\n  return (\n    <Section\n      style={{ backgroundColor: resolved.pageBackgroundColor }}\n      width=\"100%\"\n    >\n      <Fragment>\n        <Row>\n          <Column>&zwj;</Column>\n          <Column\n            style={{\n              backgroundColor: background\n                ? \"#030712\"\n                : resolved.backgroundColor,\n              backgroundImage: background\n                ? `url('${resolved.backgroundImageSrc}')`\n                : undefined,\n              backgroundPosition: \"center\",\n              backgroundRepeat: \"no-repeat\",\n              backgroundSize: \"cover\",\n              maxWidth: \"100%\",\n              paddingBottom: background ? undefined : \"44px\",\n              width: \"600px\",\n            }}\n          >\n            <Section style={{ lineHeight: \"44px\" }}>&zwj;</Section>\n            <Overline light={background} props={resolved} />\n            {(() => {\n              if (inline) {\n                return (\n                  <Heading\n                    className=\"coupon-centered-inline\"\n                    style={{\n                      color: resolved.headingColor,\n                      fontFamily,\n                      fontSize: \"48px\",\n                      fontWeight: 500,\n                      lineHeight: \"normal\",\n                      margin: 0,\n                      textAlign: \"center\",\n                    }}\n                    as=\"h3\"\n                  >\n                    {resolved.discount === defaults.discount\n                      ? \"An extra 20% OFF\"\n                      : resolved.discount}\n                  </Heading>\n                );\n              }\n              return (\n                <ImpactHeading\n                  alt={alt || background}\n                  light={background}\n                  props={resolved}\n                />\n              );\n            })()}\n            {alt ? (\n              <Text\n                style={{\n                  color: resolved.headingColor,\n                  fontFamily,\n                  fontSize: \"16px\",\n                  lineHeight: \"24px\",\n                  margin: 0,\n                  textAlign: \"center\",\n                }}\n              >\n                {resolved.expiry}\n              </Text>\n            ) : null}\n            {!inline && !alt && !background ? (\n              <CodeBox props={resolved} />\n            ) : null}\n            <Section style={{ lineHeight: \"24px\" }}>&zwj;</Section>\n            <Description light={background} props={resolved} />\n            <Section style={{ lineHeight: \"44px\" }}>&zwj;</Section>\n            <CouponButton props={resolved} />\n            {background ? (\n              <Section style={{ lineHeight: \"44px\" }}>&zwj;</Section>\n            ) : null}\n          </Column>\n          <Column>&zwj;</Column>\n        </Row>\n      </Fragment>\n    </Section>\n  );\n};\n\nexport const CouponsWithCenteredText = ({\n  pageBackgroundColor = \"#f1f5f9\",\n  theme = defaultTheme,\n  variant = \"impact\",\n  ...props\n}: CouponsWithCenteredTextProps) => (\n  <Html>\n    <EmailHead>\n      <DefaultFonts />\n      <style dangerouslySetInnerHTML={{ __html: responsiveStyles }} />\n    </EmailHead>\n    <Preview>Our biggest sale of the year</Preview>\n    <EmailTailwind theme={theme}>\n      <Body\n        style={{ backgroundColor: pageBackgroundColor, fontFamily }}\n        className=\"m-0\"\n      >\n        <Container className=\"mx-auto max-w-[600px] w-[600px]\">\n          <CouponsWithCenteredTextSection\n            {...props}\n            pageBackgroundColor={pageBackgroundColor}\n            variant={variant}\n          />\n        </Container>\n      </Body>\n    </EmailTailwind>\n  </Html>\n);\n\nCouponsWithCenteredText.PreviewProps = {\n  theme: defaultTheme,\n  variant: \"impact\",\n} satisfies CouponsWithCenteredTextProps;\n",
      "type": "registry:component",
      "target": "components/email/coupons-with-centered-text.tsx"
    },
    {
      "path": "registry/email-assets.ts",
      "content": "const ASSET_ORIGIN = \"https://www.emailcn.run\";\nconst ICONS8_ORIGIN = \"https://img.icons8.com\";\nconst UNSPLASH_ORIGIN = \"https://images.unsplash.com\";\n\nconst portraitIds = [\n  \"photo-1500648767791-00dcc994a43e\",\n  \"photo-1507003211169-0a1dd7228f2d\",\n  \"photo-1494790108377-be9c29b29330\",\n  \"photo-1438761681033-6461ffad8d80\",\n  \"photo-1534528741775-53994a69daeb\",\n  \"photo-1506794778202-cad84cf45f1c\",\n] as const;\n\nconst productIds = [\n  \"photo-1521572163474-6864f9cf17ab\",\n  \"photo-1503341504253-dff4815485f1\",\n  \"photo-1576566588028-4147f3842f27\",\n  \"photo-1562157873-818bc0726f68\",\n] as const;\n\ntype Dimensions = readonly [width: number, height: number];\n\nconst dimensionRules = [\n  [/^bento-grids\\/1-bento-(?:1|4)\\./i, [336, 272]],\n  [/^bento-grids\\/1-bento-(?:2|3)\\./i, [720, 272]],\n  [/^bento-grids\\/2-bento-1\\./i, [336, 232]],\n  [/^bento-grids\\/2-bento-(?:2|7)\\./i, [720, 352]],\n  [/^bento-grids\\/2-bento-3\\./i, [720, 344]],\n  [/^bento-grids\\/2-bento-4\\./i, [336, 224]],\n  [/^bento-grids\\/2-bento-(?:5|6)\\./i, [336, 408]],\n  [/^bento-grids\\/3-bento-lg-\\d-pad\\./i, [304, 576]],\n  [/^bento-grids\\/3-bento-lg-\\d\\./i, [336, 576]],\n  [/^bento-grids\\/3-bento-sm-\\d\\./i, [336, 336]],\n  [/^bento-grids\\/4-bento-lg-(?:1|2)\\./i, [496, 440]],\n  [/^bento-grids\\/4-bento-lg-3\\./i, [688, 242]],\n  [/^bento-grids\\/4-bento-lg-4\\./i, [656, 242]],\n  [/^bento-grids\\/4-bento-sm-[1-4]\\./i, [456, 363]],\n  [/^bento-grids\\/4-bento-sm-5\\./i, [408, 363]],\n  [/^bento-grids\\/bento-1\\./i, [720, 376]],\n  [/^bento-grids\\/bento-[2-5]\\./i, [528, 376]],\n  [/^category-previews\\/landscape-/i, [508, 376]],\n  [/^category-previews\\/portrait-/i, [376, 377]],\n  [/^coupons\\/(?:bg-image-[1-3]|pattern)\\./i, [800, 500]],\n  [/^coupons\\/bg-image-[4-6]\\./i, [1200, 1200]],\n  [/^cta\\/cta-bg-1\\./i, [1200, 772]],\n  [/^cta\\/cta-bg-2\\./i, [1200, 760]],\n  [/^cta\\/cta-bg-3\\./i, [1104, 696]],\n  [/^cta\\/cta-bg-glow\\./i, [1200, 840]],\n  [/^cta\\/cta-collage-(?:1|4)\\./i, [248, 456]],\n  [/^cta\\/(?:cta-collage-(?:2|3)|cta-outwear-\\d)\\./i, [280, 456]],\n  [/^cta\\/cta-split-avatars-\\d\\./i, [280, 338]],\n  [/^cta\\/cta-with-image-\\d\\./i, [944, 606]],\n  [/^cta\\/strip-cut-\\d\\./i, [232, 163]],\n  [/^cta\\/strip-\\d\\./i, [232, 232]],\n  [/^feature\\/feature-1\\./i, [564, 564]],\n  [/^feature\\/feature-2-/i, [432, 432]],\n  [/^feature\\/feature-3-lg-/i, [646, 818]],\n  [/^feature\\/feature-3-sm-/i, [615, 615]],\n  [/^feature\\/stripes-bg-(?:1|2)\\./i, [1035, 1227]],\n  [/^feature\\/stripes-bg-3\\./i, [449, 1227]],\n  [/^feature\\/stripes-bg-(?:4|5)\\./i, [449, 840]],\n  [/^footers\\/bg-image-(?:1|2)\\./i, [1200, 881]],\n  [/^footers\\/bg-image-3\\./i, [1104, 881]],\n  [/^hero\\/aligned-overlay-bg-\\d\\./i, [702, 1200]],\n  [/^hero\\/block-overlay-bg\\./i, [2000, 3000]],\n  [/^hero\\/block-with-bleed-bg\\./i, [2000, 2922]],\n  [/^hero\\/mosaic-\\d\\./i, [240, 240]],\n  [/^hero\\/overlapped-content-bg-(?:1|3)\\./i, [1200, 1258]],\n  [/^hero\\/overlapped-content-bg-2\\./i, [1200, 1374]],\n  [/^hero\\/overlapped-content-bg-4\\./i, [1200, 1410]],\n  [/^hero\\/overlapped-image-\\d-bg\\./i, [2000, 3000]],\n  [/^hero\\/overlapped-image-bg\\./i, [2000, 2995]],\n  [/^hero\\/overlapped-image-2\\./i, [911, 610]],\n  [/^hero\\/overlapped-image-3\\./i, [911, 606]],\n  [/^hero\\/overlapped-image\\./i, [911, 657]],\n  [/^hero\\/(?:overlay-gradient-bg|overlayed-split-bg)\\./i, [2000, 3000]],\n  [/^hero\\/overlayed\\/hero-overlayed-bg\\./i, [1200, 1490]],\n  [/^hero\\/split-contained-bg\\./i, [488, 1104]],\n  [/^hero\\/split-contained-landscape-/i, [488, 376]],\n  [/^hero\\/split-contained-portrait-/i, [488, 680]],\n  [/^hero\\/split-contained-square-/i, [488, 550]],\n  [/^hero\\/split-full-bleed-bg\\./i, [2000, 2666]],\n  [/^hero\\/split-slanted-bg\\./i, [2002, 2534]],\n  [/^image-grids\\/2-col-landscape/i, [528, 372]],\n  [/^image-grids\\/2-col-portrait/i, [528, 792]],\n  [/^image-grids\\/2-col-square/i, [528, 528]],\n  [/^image-grids\\/3-col-masonry-stack/i, [503, 558]],\n  [/^image-grids\\/3-col-masonry/i, [720, 792]],\n  [/^image-grids\\/3-col-portrait/i, [504, 753]],\n  [/^image-grids\\/3-col-square/i, [504, 504]],\n  [/^image-grids\\/full-width\\./i, [1104, 720]],\n  [/^image-grids\\/full-width-\\d\\./i, [1104, 792]],\n  [/^product-detail\\/stacked-\\d\\./i, [508, 358]],\n  [/^product-detail\\/rating-below\\./i, [508, 508]],\n  [/^product-detail\\/single-landscape\\./i, [1104, 776]],\n  [/^product-detail\\/single-portrait\\./i, [508, 764]],\n  [/^product-detail\\/single-portrait-bleed\\./i, [532, 764]],\n  [/^product-detail\\/two-images-\\d\\./i, [528, 776]],\n  [/^product-detail\\/three-images-1\\./i, [528, 776]],\n  [/^product-detail\\/three-images-(?:2|3)\\./i, [528, 364]],\n  [/^product-detail\\/four-images-(?:1|4)\\./i, [528, 488]],\n  [/^product-detail\\/four-images-(?:2|3)\\./i, [528, 240]],\n  [/^stats\\/overlay-1\\./i, [1572, 2268]],\n  [/^stats\\/overlay-2\\./i, [1572, 2716]],\n  [/^stats\\/overlay-(?:3|4)\\./i, [1572, 3256]],\n  [/^stats\\/single-stat\\./i, [1035, 1032]],\n  [/^teams\\/hero\\./i, [1104, 776]],\n  [/^teams\\/member-\\d+-lg\\./i, [528, 376]],\n  [/^teams\\/member-\\d+-md\\./i, [328, 328]],\n  [/^teams\\/member-\\d+\\./i, [256, 256]],\n  [/^timelines\\/cards\\./i, [1072, 600]],\n  [/^testimonials\\/quote\\./i, [72, 62]],\n  [/^testimonials\\/user-\\d+\\./i, [256, 256]],\n  [/^feature\\/logo-north-face\\./i, [278, 128]],\n  [/^feature\\/logo-stripes-1\\./i, [390, 84]],\n  [/^feature\\/logo-stripes-2\\./i, [423, 72]],\n  [/^(?:reviews|testimonials)\\/logo-accentic(?:-light)?\\./i, [423, 72]],\n  [/^reviews\\/logo-amada\\./i, [411, 84]],\n  [/^(?:reviews|testimonials)\\/logo-monarch\\./i, [290, 64]],\n  [/^logos\\/logo-apple-pay\\./i, [180, 72]],\n  [/^logos\\/logo-google-pay\\./i, [177, 72]],\n  [/^logos\\/logo-klarna\\./i, [210, 48]],\n  [/^logos\\/logo-mastercard\\./i, [120, 72]],\n  [/^logos\\/logo-mock-1\\./i, [334, 72]],\n  [/^logos\\/logo-mock-2\\./i, [213, 36]],\n  [/^logos\\/logo-mock-3\\./i, [234, 48]],\n  [/^logos\\/logo-stripe\\./i, [171, 72]],\n  [/^logos\\/logo-visa\\./i, [150, 48]],\n  [/^order-summary\\/logo-fedex\\./i, [156, 48]],\n  [/^emailcn-logo(?:-light)?\\./i, [331, 48]],\n  [/^emailcn-insignia-mono(?:-light)?\\./i, [131, 96]],\n  [/^maizzle-insignia(?:-light)?-lg\\./i, [395, 289]],\n  [/^maizzle-insignia(?:-light)?\\./i, [176, 129]],\n] satisfies readonly (readonly [RegExp, Dimensions])[];\n\nconst socialIconSlugs = {\n  discord: \"discord-logo\",\n  facebook: \"facebook-new\",\n  github: \"github\",\n  instagram: \"instagram-new\",\n  linkedin: \"linkedin\",\n  slack: \"slack-new\",\n  x: \"twitterx--v1\",\n  youtube: \"youtube-play\",\n} as const;\n\nconst brandIconSlugs = [\n  [/(?:btc|bitcoin)/i, \"bitcoin--v1\"],\n  [/(?:eth|ethereum)/i, \"ethereum\"],\n] as const;\n\nconst hashString = (value: string) => {\n  let hash = 7;\n\n  for (const character of value) {\n    hash = (hash * 31 + (character.codePointAt(0) ?? 0)) % 2_147_483_647;\n  }\n\n  return hash;\n};\n\nconst getDimensions = (path: string) => {\n  const matchedRule = dimensionRules.find(([pattern]) => pattern.test(path));\n  if (matchedRule) {\n    return matchedRule[1];\n  }\n  if (/(?:avatar|user|headshot)/i.test(path)) {\n    return [160, 160] as const;\n  }\n  if (/(?:logo|insignia)/i.test(path)) {\n    return [320, 96] as const;\n  }\n  if (/(?:badge-app|badge-google)/i.test(path)) {\n    return [260, 80] as const;\n  }\n  if (/(?:icon|btc|eth)/i.test(path)) {\n    return [64, 64] as const;\n  }\n  if (/(?:portrait|member|team)/i.test(path)) {\n    return [600, 800] as const;\n  }\n  if (/(?:square|product|shopping-cart)/i.test(path)) {\n    return [700, 700] as const;\n  }\n  if (/(?:hero|footer|background|bg-|overlay|full-width)/i.test(path)) {\n    return [1200, 700] as const;\n  }\n  if (/(?:strip|landscape|bento|category-preview)/i.test(path)) {\n    return [800, 520] as const;\n  }\n\n  return [800, 600] as const;\n};\n\nconst getLabel = (path: string) => {\n  if (/insignia/i.test(path)) {\n    return \"EC\";\n  }\n  if (/(?:emailcn|maizzle)/i.test(path)) {\n    return \"emailcn\";\n  }\n\n  const fileName = path.split(\"/\").at(-1) ?? \"emailcn\";\n\n  return fileName\n    .replace(/\\.[^.]+$/, \"\")\n    .replace(/^(?:logo|badge|icon)-/, \"\")\n    .replaceAll(\"-\", \" \")\n    .replaceAll(/\\b\\w/g, (character) => character.toUpperCase());\n};\n\nconst getSeed = (path: string) =>\n  `emailcn-${path\n    .replace(/\\.[^.]+$/, \"\")\n    .replaceAll(/[^a-z0-9]+/gi, \"-\")\n    .replaceAll(/^-|-$/g, \"\")\n    .toLowerCase()}`;\n\nconst getIndexedAsset = (path: string, assets: readonly string[]) => {\n  const explicitIndex = path.match(\n    /(?:member|avatar|product-list|shopping-cart)-(\\d+)/i\n  )?.[1];\n  const index = explicitIndex\n    ? Number.parseInt(explicitIndex, 10) - 1\n    : hashString(path);\n\n  return assets[((index % assets.length) + assets.length) % assets.length];\n};\n\nconst getUnsplashAsset = (id: string, width: number, height: number) =>\n  `${UNSPLASH_ORIGIN}/${id}?auto=format&fit=crop&w=${width}&h=${height}&q=80`;\n\nconst getIcons8Asset = (\n  slug: string,\n  {\n    color,\n    style = \"ios-filled\",\n  }: {\n    color?: string;\n    style?: \"color\" | \"ios\" | \"ios-filled\";\n  } = {}\n) =>\n  color\n    ? `${ICONS8_ORIGIN}/${style}/50/${color}/${slug}.png`\n    : `${ICONS8_ORIGIN}/${style}/50/${slug}.png`;\n\nconst getStoreBadgeAsset = (path: string) => {\n  if (/badge-app-store/i.test(path)) {\n    return \"https://developer.apple.com/assets/elements/badges/download-on-the-app-store.svg\";\n  }\n  if (/badge-google-play/i.test(path)) {\n    return \"https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png\";\n  }\n};\n\nconst getSocialIconAsset = (path: string) => {\n  const isLight = /(?:-light|check-white)/i.test(path);\n  const foreground = isLight ? \"FFFFFF\" : \"111827\";\n\n  for (const [name, slug] of Object.entries(socialIconSlugs)) {\n    if (new RegExp(`(?:^|[-/])${name}(?:[-.]|$)`, \"i\").test(path)) {\n      return getIcons8Asset(slug, { color: foreground });\n    }\n  }\n};\n\nconst getUtilityIconAsset = (path: string) => {\n  const isLight = /(?:-light|check-white)/i.test(path);\n  const foreground = isLight ? \"FFFFFF\" : \"111827\";\n\n  if (/star-half/i.test(path)) {\n    return getIcons8Asset(\"star-half-empty\", { color: \"374151\" });\n  }\n  if (/star-solid/i.test(path)) {\n    return getIcons8Asset(\"star--v1\", { color: \"374151\" });\n  }\n  if (/edit/i.test(path)) {\n    return getIcons8Asset(\"edit--v1\", {\n      color: \"4F46E5\",\n      style: \"ios\",\n    });\n  }\n  if (/arrow-right/i.test(path)) {\n    const color = /(?:brand|indigo)/i.test(path) ? \"4F46E5\" : \"FFFFFF\";\n\n    return getIcons8Asset(\"long-arrow-right--v1\", {\n      color,\n      style: \"ios\",\n    });\n  }\n  if (/chevron-right/i.test(path)) {\n    return getIcons8Asset(\"chevron-right\", {\n      color: \"4F46E5\",\n      style: \"ios\",\n    });\n  }\n  if (/check/i.test(path)) {\n    return getIcons8Asset(\"checkmark--v1\", { color: foreground });\n  }\n};\n\nconst getBrandIconAsset = (path: string) => {\n  const match = brandIconSlugs.find(([pattern]) => pattern.test(path));\n\n  return match\n    ? getIcons8Asset(match[1], {\n        style: \"color\",\n      })\n    : undefined;\n};\n\nconst getWordmarkAsset = (path: string, [width, height]: Dimensions) => {\n  const isLight = /light/i.test(path);\n  const background = isLight ? \"030712\" : \"FFFFFF\";\n  const foreground = isLight ? \"FFFFFF\" : \"111827\";\n\n  return `https://placehold.co/${width}x${height}/${background}/${foreground}.png?text=${encodeURIComponent(\n    getLabel(path)\n  )}`;\n};\n\nconst getIconAsset = (path: string) =>\n  getStoreBadgeAsset(path) ??\n  getSocialIconAsset(path) ??\n  getUtilityIconAsset(path) ??\n  getBrandIconAsset(path);\n\nexport const emailAsset = (path: string) => {\n  const normalizedPath = path.replace(/^\\/+/, \"\");\n\n  if (\n    normalizedPath === \"bento-grids/trend.png\" ||\n    normalizedPath === \"bento-grids/trend-sm.png\"\n  ) {\n    return `${ASSET_ORIGIN}/email-assets/${normalizedPath}`;\n  }\n\n  const iconAsset = getIconAsset(normalizedPath);\n  if (iconAsset) {\n    return iconAsset;\n  }\n\n  const seed = getSeed(normalizedPath);\n  const [width, height] = getDimensions(normalizedPath);\n\n  if (/teams\\/hero/i.test(normalizedPath)) {\n    return getUnsplashAsset(\"photo-1521737711867-e3b97375f902\", width, height);\n  }\n\n  if (/(?:avatar|user|headshot|member|team)/i.test(normalizedPath)) {\n    return getUnsplashAsset(\n      getIndexedAsset(normalizedPath, portraitIds),\n      width,\n      height\n    );\n  }\n\n  if (/products\\/shoe/i.test(normalizedPath)) {\n    return getUnsplashAsset(\"photo-1542291026-7eec264c27ff\", width, height);\n  }\n\n  if (/products\\/phone/i.test(normalizedPath)) {\n    return getUnsplashAsset(\"photo-1511707171634-5f897ff02aa9\", width, height);\n  }\n\n  if (\n    /(?:category-previews|product-detail|product-lists|products\\/product|shopping-cart)/i.test(\n      normalizedPath\n    )\n  ) {\n    return getUnsplashAsset(\n      getIndexedAsset(normalizedPath, productIds),\n      width,\n      height\n    );\n  }\n\n  if (/(?:trend|chart)/i.test(normalizedPath)) {\n    return `${ASSET_ORIGIN}/email-assets/bento-grids/trend.png`;\n  }\n\n  if (/(?:emailcn|maizzle|logo|insignia)/i.test(normalizedPath)) {\n    return getWordmarkAsset(normalizedPath, [width, height]);\n  }\n\n  return `https://picsum.photos/seed/${encodeURIComponent(\n    seed\n  )}/${width}/${height}.jpg`;\n};\n",
      "type": "registry:file",
      "target": "components/email/email-assets.ts"
    }
  ],
  "categories": [
    "email-component"
  ],
  "type": "registry:component"
}