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,GAAAA,WAAH,wEAAGA,CAAH,uQAML,SAACK,GAAD,OAAYA,EAAMC,WAAa,SAAW,UAY7CC,EAAYP,EAAAA,QAAAA,EAAAA,WAAH,yEAAGA,CAAH,kKAUTQ,EAAiBR,EAAAA,QAAAA,IAAAA,WAAH,8EAAGA,CAAH,2EAOdS,EAAST,EAAAA,QAAAA,OAAAA,WAAH,sEAAGA,CAAH","sources":["webpack://commercial-ultramar/./src/components/imageWithPath/imageWithPath.js","webpack://commercial-ultramar/./src/components/imageWithPath/imageWithPathStyles.js"],"sourcesContent":["import React from 'react';\nimport useContentfulAssets from '../../hooks/useContentfulAssets';\nimport * as Styled from './imageWithPathStyles';\nimport { BLOCKS, INLINES } from '@contentful/rich-text-types';\nimport { documentToReactComponents } from '@contentful/rich-text-react-renderer';\nimport isExternalUrl, { addTrailingSlash, isExternalUrlHref, isYoutubeLink } from '../../utils';\n\nconst ImageWithPath = ({ sectionData, location }) => {\n React.useEffect(async () => {\n if (sectionData?.elementId === location?.hash?.replace('#', '')) {\n const waitedID = await new Promise((resolve) => {\n document?.getElementById(sectionData?.elementId) && resolve(true);\n });\n\n if (waitedID) {\n setTimeout(() => {\n window.location.href = `#${sectionData?.elementId}`;\n }, 500);\n }\n }\n }, [sectionData?.elementId]);\n\n const optionsMainStyle = {\n renderNode: {\n [BLOCKS.PARAGRAPH]: (node, children) => (\n {children}\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 [INLINES.HYPERLINK]: (node, children) => {\n return isYoutubeLink(node.data.uri) ? (\n \n \n \n ) : (\n \n {children}\n \n );\n },\n },\n renderText: (text) =>\n text.split('\\n').flatMap((text, i) => [i > 0 &&
, text]),\n };\n return (\n \n {sectionData?.elementId?.trim() && (\n \n )}\n {sectionData?.header?.trim() && (\n {sectionData?.header}\n )}\n {sectionData?.contentDetails &&\n documentToReactComponents(\n JSON.parse(sectionData?.contentDetails?.raw),\n optionsMainStyle\n )}\n \n );\n};\n\nexport default ImageWithPath;\n","import styled from 'styled-components';\n\nexport const ImageStyle = styled.img`\n border: 0;\n vertical-align: top;\n margin: 0 0 40px 0;\n width: 100%;\n height: auto;\n @media (max-width: 1399px) {\n margin-bottom: 30px;\n }\n`;\n\nexport const SpanStyle = styled.span`\n position: absolute;\n top: -200px;\n @media (max-width: 991px) {\n top: -50px;\n }\n`;\n\nexport const HeaderH2 = 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: 1399px) {\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 ParaText = styled.p`\n margin-bottom: 40px;\n @media (max-width: 1399px) {\n margin-bottom: 30px;\n }\n i {\n font-style: italic;\n margin-bottom: 0;\n font-size: 16px;\n line-height: 24px;\n @media (max-width: 1399px) {\n font-size: 15px;\n line-height: 22px;\n }\n @media (max-width: 767px) {\n font-size: 13px;\n line-height: 20px;\n }\n }\n`;\n\nexport const HeaderH3 = styled.h3`\n margin: 0 0 35px 0;\n font-family: 'HelveticaNeue-Light', sans-serif;\n font-size: 32px;\n line-height: 37px;\n color: #00a6e8;\n text-align: ${(props) => (props.$textAlign ? 'center' : 'left')};\n @media (max-width: 1399px) {\n font-size: 28px;\n line-height: 32px;\n margin-bottom: 0;\n }\n @media (max-width: 767px) {\n font-size: 25px;\n line-height: 30px;\n }\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 margin: 0 0 35px 0;\n font-family: 'HelveticaNeue-Light', sans-serif;\n\n color: #00a6e8;\n`;\nexport const VideoContainer = styled.div`\n position: relative;\n width: 100%;\n padding-bottom: 56%;\n margin: 40px 0 40px 0;\n`;\n\nexport const Iframe = styled.iframe`\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n height: 100%;\n box-shadow: 0 1px 3px #969696;\n`;\n"],"names":["sectionData","location","React","elementId","hash","replace","Promise","resolve","document","getElementById","setTimeout","window","href","optionsMainStyle","renderNode","BLOCKS","node","children","asset","useContentfulAssets","data","target","sys","id","file","url","includes","src","alt","title","INLINES","isYoutubeLink","uri","frameborder","isExternalUrlHref","addTrailingSlash","process","isExternalUrl","renderText","text","split","flatMap","i","key","trim","header","contentDetails","documentToReactComponents","JSON","parse","raw","ImageStyle","styled","SpanStyle","HeaderH2","ParaText","HeaderH3","props","$textAlign","LinkStyle","VideoContainer","Iframe"],"sourceRoot":""}