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KAACrC,EAAQ,CAACmD,IAAKxB,EAAWa,UACtBH,EAAAA,EAAAA,KAACU,EAAAA,EAAS,CACNC,QAAStC,EACTuC,SAAS,gBACTjE,MAAOA,EACP6B,aAAcA,EACdC,YAAaA,EACboC,eAAe,OAGvBb,EAAAA,EAAAA,KAACjC,EAAqB,CAAAoC,UAClBH,EAAAA,EAAAA,KAAChC,EAAuB,CAAAmC,UACpBH,EAAAA,EAAAA,KAACe,EAAAA,QAAM,CACHC,QAAUC,GAhEzBA,KACjBA,EAAMC,iBACN1B,EAAc,CACVyB,MAAO,qBACPE,WAAYhC,EACZiC,iBAAkBlD,GAAW,cAEjCc,GAAaD,EAAS,EAyD8BsC,CAAYJ,GAChC,gBAAelC,EACfuC,KACIvC,EACM,eACA,iBAEVN,YAAaA,EACb8C,UAAU,EACVC,QAAQ,SAAQrB,SAEfhB,aArDTb,MA6Dd,EAIlB,MAAemD,EAAAA,KAAWxD,E","sources":["components/EditorialSection/EditorialSection.styled.ts","components/EditorialSection/EditorialSection.tsx"],"sourcesContent":["import { styled, css } from \"styled-components\";\nimport theme from \"styled-theming\";\n\nimport { Container as GridContainer } from \"style/components/Page\";\nimport { styleBodyLAlt, styleHeadingXL } from \"style/components/Typography\";\nimport { columnGap } from \"style/grid\";\nimport { MQ } from \"style/mediaQueries\";\n\nexport const Container = styled(GridContainer)`\n ${columnGap}\n grid-template-columns: repeat(4, [col-start] 1fr);\n padding: ${theme(\"blockInBlock\", {\n true: \"0\",\n })};\n padding-bottom: 4.375rem;\n\n ${theme(\"blockInBlock\", {\n true: css`\n padding-bottom: 2.1875rem;\n `,\n })}\n\n ${MQ.FROM_M} {\n display: grid;\n grid-auto-rows: auto;\n grid-template-columns: repeat(12, [col-start] 1fr);\n padding-bottom: 6.125rem;\n\n ${theme(\"blockInBlock\", {\n true: css`\n padding-bottom: 3.5rem;\n `,\n })}\n }\n\n ${MQ.FROM_L} {\n ${theme(\"blockInBlock\", {\n true: css`\n grid-template-columns: repeat(7, [col-start] 1fr);\n `,\n })}\n }\n\n ${MQ.FROM_XL} {\n padding-bottom: 8.75rem;\n ${theme(\"blockInBlock\", {\n true: css`\n grid-template-columns: repeat(8, [col-start] 1fr);\n padding-bottom: 4.375rem;\n `,\n })}\n }\n`;\n\nexport const Heading = styled.h2`\n ${styleHeadingXL};\n grid-column: col-start 1 / span 4;\n margin-bottom: 2.625rem;\n margin-top: 0;\n\n ${theme(\"displayOption\", {\n Right: css`\n grid-column: col-start 1 / span 12;\n text-align: right;\n `,\n })};\n\n ${theme(\"headingRight\", {\n true: css`\n text-align: right;\n `,\n })};\n\n ${MQ.FROM_M} {\n grid-column: col-start 1 / span 12;\n grid-column: ${theme(\"blockInBlock\", {\n true: \"col-start 1 / span 7\",\n })};\n ${theme(\"displayOption\", {\n Right: css`\n grid-column: col-start 4 / span 12;\n `,\n })}\n margin-bottom: 4.375rem;\n }\n\n ${MQ.FROM_XL} {\n grid-column: col-start 1 / span 9;\n grid-column: ${theme(\"blockInBlock\", {\n true: \"col-start 1 / span 8\",\n })};\n ${theme(\"displayOption\", {\n Right: css`\n grid-column: col-start 4 / span 9;\n `,\n })}\n margin-bottom: 6.125rem;\n }\n`;\n\nexport const Introduction = styled.p`\n ${styleBodyLAlt};\n grid-column: col-start 1 / span 4;\n margin-bottom: 1.625rem;\n margin-top: 0;\n\n ${MQ.FROM_M} {\n grid-column: col-start 5 / span 8;\n ${theme(\"displayOption\", {\n Right: css`\n grid-column: col-start 2 / span 8;\n `,\n })}\n }\n\n ${MQ.FROM_L} {\n grid-column: col-start 5 / span 7;\n grid-column: ${theme(\"blockInBlock\", {\n true: \"col-start 2 / span 6\",\n })};\n ${theme(\"displayOption\", {\n Right: css`\n grid-column: col-start 2 / span 7;\n `,\n })}\n }\n\n ${MQ.FROM_XL} {\n grid-column: col-start 6 / span 6;\n grid-column: ${theme(\"blockInBlock\", {\n true: \"col-start 2 / span 6\",\n })};\n ${theme(\"displayOption\", {\n Right: css`\n grid-column: col-start 2 / span 6;\n `,\n })}\n }\n`;\n\nexport const Text = styled.div`\n grid-column: col-start 1 / span 4;\n\n ${MQ.FROM_M} {\n grid-column: col-start 5 / span 8;\n ${theme(\"displayOption\", {\n Right: css`\n grid-column: col-start 2 / span 8;\n `,\n })}\n }\n\n ${MQ.FROM_L} {\n grid-column: ${theme(\"blockInBlock\", {\n true: \"col-start 2 / span 6\",\n })};\n }\n\n ${MQ.FROM_XL} {\n grid-column: col-start 6 / span 7;\n grid-column: ${theme(\"blockInBlock\", {\n true: \"col-start 2 / span 5\",\n })};\n ${theme(\"displayOption\", {\n Right: css`\n grid-column: col-start 2 / span 7;\n `,\n })}\n }\n`;\n\nexport const ReadMore = styled.div`\n margin-bottom: 1.625rem;\n margin-top: 1.625rem;\n overflow: hidden;\n transition: all ease-in-out 0.2s;\n\n ${theme(\"readMore\", {\n true: css`\n height: ${(props) => props.theme.readMoreHeight}px;\n `,\n })}\n\n ${theme(\"readMore\", {\n false: css`\n height: 14rem;\n mask-image: linear-gradient(to bottom, black 70%, transparent);\n mask-position: 0 100%;\n mask-size: 100% 200%;\n `,\n })}\n`;\n\nexport const ReadMoreButtonWrapper = styled.div`\n display: grid;\n grid-auto-rows: auto;\n grid-template-columns: repeat(4, [col-start] 1fr);\n text-align: center;\n\n ${MQ.FROM_M} {\n grid-template-columns: repeat(8, [col-start] 1fr);\n }\n\n ${MQ.FROM_XL} {\n grid-template-columns: repeat(7, [col-start] 1fr);\n }\n`;\n\nexport const ReadMoreButtonContainer = styled.div`\n grid-column: 1 / span 4;\n\n ${MQ.FROM_M} {\n grid-column: 1 / span 8;\n }\n\n ${MQ.FROM_L} {\n grid-column: 1 / span 6;\n grid-column: ${theme(\"blockInBlock\", {\n true: \"1 / span 8\",\n })};\n }\n\n ${MQ.FROM_XL} {\n grid-column: 1 / span 5;\n grid-column: ${theme(\"blockInBlock\", {\n true: \"1 / span 7\",\n })};\n }\n`;\n","import { useGTMDispatch } from \"@elgorditosalsero/react-gtm-hook\";\nimport React, {\n ReactElement,\n useContext,\n useState,\n useRef,\n useEffect,\n} from \"react\";\nimport { ThemeContext, ThemeProvider } from \"styled-components\";\n\nimport Button from \"components/Button/Button\";\nimport Section from \"components/Section\";\nimport TextBlock from \"components/TextBlock\";\nimport useIsInEditMode from \"hooks/useIsInEditMode\";\nimport { addEditAttributes } from \"utils/episerver\";\n\nimport {\n Container,\n Introduction,\n Heading,\n Text,\n ReadMore,\n ReadMoreButtonWrapper,\n ReadMoreButtonContainer,\n} from \"./EditorialSection.styled\";\nimport EditorialSectionProps from \"./EditorialSectionProps\";\n\nconst EditorialSection = ({\n heading,\n introduction,\n mainBody,\n secondaryBody,\n identifier,\n anchorName,\n theme,\n contentTheme = \"black\",\n actionTheme,\n displayOption = \"Left\",\n l18n,\n}: EditorialSectionProps): ReactElement => {\n const isInEditMode = useIsInEditMode();\n\n const [readMore, setReadMore] = useState(false);\n const [readMoreHeight, setReadMoreHeight] = useState(0);\n const readMoreButtonText = readMore\n ? l18n?.showLessText\n : l18n?.showMoreText;\n const contentRef = useRef(null);\n const sendDataToGTM = useGTMDispatch();\n\n useEffect(() => {\n if (contentRef.current) {\n setReadMoreHeight(contentRef.current.scrollHeight);\n }\n }, [contentRef.current?.scrollHeight]);\n\n const handleClick = (event: React.MouseEvent): void => {\n event.preventDefault();\n sendDataToGTM({\n event: \"editorial_showmore\",\n click_text: readMoreButtonText,\n editorialHeading: heading || \"undefined\",\n });\n setReadMore(!readMore); // eslint-disable-line\n };\n\n const themeContext = useContext(ThemeContext);\n if (!theme) theme = (themeContext && themeContext.theme) || \"lightgray\";\n\n return (\n
\n \n \n {(isInEditMode || heading) && (\n \n )}\n {(isInEditMode || introduction) && (\n \n )}\n {(isInEditMode || mainBody) && (\n \n \n \n )}\n {(isInEditMode || (mainBody && secondaryBody)) && (\n \n \n \n \n \n \n handleClick(event)}\n aria-expanded={readMore}\n icon={\n readMore\n ? \"bigArrowUp28\"\n : \"bigArrowDown28\"\n }\n actionTheme={actionTheme}\n isExpand={true}\n variant=\"simple\"\n >\n {readMoreButtonText}\n \n \n \n \n )}\n \n \n
\n );\n};\n\nexport default React.memo(EditorialSection);\n"],"names":["Container","styled","GridContainer","withConfig","componentId","columnGap","theme","true","css","MQ","FROM_M","FROM_L","FROM_XL","Heading","h2","styleHeadingXL","Right","Introduction","p","styleBodyLAlt","Text","div","ReadMore","props","readMoreHeight","false","ReadMoreButtonWrapper","ReadMoreButtonContainer","EditorialSection","heading","introduction","mainBody","secondaryBody","identifier","anchorName","contentTheme","actionTheme","displayOption","l18n","_contentRef$current","isInEditMode","useIsInEditMode","readMore","setReadMore","useState","setReadMoreHeight","readMoreButtonText","showLessText","showMoreText","contentRef","useRef","sendDataToGTM","useGTMDispatch","useEffect","current","scrollHeight","themeContext","useContext","ThemeContext","_jsx","Section","alignItems","children","ThemeProvider","_jsxs","id","addEditAttributes","dangerouslySetInnerHTML","__html","TextBlock","content","areaName","editorialGrid","ref","Button","onClick","event","preventDefault","click_text","editorialHeading","handleClick","icon","isExpand","variant","React"],"sourceRoot":""}