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,UAAU,gBACZ/B,MAAAA,OAAA,EAAAA,EAAagC,kBACZC,EAAAA,EAAAA,GACEC,KAAKC,MAAMnC,MAAAA,GAAX,UAAWA,EAAagC,sBAAxB,aAAW,EAA6BI,KACxCnC,M,iJC3CGoC,EAAUC,EAAAA,QAAAA,GAAAA,WAAH,8EAAGA,CAAH,kRAmBPC,EAAaD,EAAAA,QAAAA,IAAAA,WAAH,iFAAGA,CAAH,4EAQVE,EAAYF,EAAAA,QAAAA,EAAAA,WAAH,gFAAGA,CAAH","sources":["webpack://commercial-ultramar/./src/components/imageWithHeadingLink/imageWithHeadingLink.js","webpack://commercial-ultramar/./src/components/imageWithHeadingLink/imageWithHeadingLinkStyles.js"],"sourcesContent":["import React from 'react';\nimport * as Styled from './imageWithHeadingLinkStyles';\nimport { BLOCKS, INLINES } from '@contentful/rich-text-types';\nimport { documentToReactComponents } from '@contentful/rich-text-react-renderer';\nimport useContentfulAssets from '../../hooks/useContentfulAssets';\nimport isExternalUrl, { addTrailingSlash, isExternalUrlHref } from '../../utils';\n\nconst ImageWithHeadingLink = ({ sectionData }) => {\n const optionsMainStyle = {\n renderNode: {\n [BLOCKS.HEADING_2]: (node, children) => (\n {children}\n ),\n [INLINES.HYPERLINK]: (node, children) => (\n \n {children}\n \n ),\n [BLOCKS.EMBEDDED_ASSET]: (node) => {\n const asset = useContentfulAssets(node?.data?.target?.sys?.id);\n return asset?.node?.file?.url?.includes('image') ? (\n \n ) : (\n <>\n );\n },\n },\n renderText: (text) =>\n text.split('\\n').flatMap((text, i) => [i > 0 &&
, text]),\n };\n return (\n
\n {sectionData?.contentDetails &&\n documentToReactComponents(\n JSON.parse(sectionData?.contentDetails?.raw),\n optionsMainStyle\n )}\n
\n );\n};\n\nexport default ImageWithHeadingLink;\n","import styled from 'styled-components';\n\nexport const Header2 = styled.h2`\n text-align: center;\n position: relative;\n margin: 0 0 35px 0;\n font-family: 'MrAlex', sans-serif;\n font-size: 45px;\n line-height: 50px;\n color: #00539d;\n @media (max-width: 1439px) {\n font-size: 40px;\n line-height: 45px;\n margin-bottom: 30px;\n }\n @media (max-width: 767px) {\n font-size: 30px;\n line-height: 35px;\n }\n`;\n\nexport const ImageStyle = styled.img`\n border: 0;\n vertical-align: top;\n margin: 0 0 35px 0;\n height: 100px;\n width: auto;\n`;\n\nexport const LinkStyle = styled.a`\n text-decoration: none;\n color: #00a6e8;\n transition: 0.25s ease-out;\n text-align: center;\n position: relative;\n margin: 0 0 35px 0;\n font-family: 'MrAlex', sans-serif;\n font-size: 45px;\n line-height: 50px;\n\n @media (max-width: 1439px) {\n font-size: 40px;\n line-height: 45px;\n margin-bottom: 30px;\n }\n @media (max-width: 767px) {\n font-size: 30px;\n line-height: 35px;\n }\n`;\n"],"names":["sectionData","optionsMainStyle","renderNode","BLOCKS","node","children","INLINES","href","isExternalUrlHref","data","uri","addTrailingSlash","process","target","isExternalUrl","asset","useContentfulAssets","sys","id","file","url","includes","src","alt","title","renderText","text","split","flatMap","i","key","className","contentDetails","documentToReactComponents","JSON","parse","raw","Header2","styled","ImageStyle","LinkStyle"],"sourceRoot":""}