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A,CACA,CAGA,EAAK,CAAA3E,EAAA,EAEL,IAAAmG,EAAAvC,OAAAC,MAAA,CAAAD,OAAAC,MAAA,IAAyDpC,GAAA,CAAYzB,OAAA8E,EAAAE,SAAAA,GAAAvD,CAAAA,MAAAA,EAAA,OAAAA,EAAAuD,QAAA,IACrEE,GAAAhC,IACAiD,EAAAC,UAAA,WAA8CnG,EAAS,KAAKsD,EAAA,CAAQ,EAAEH,EAAM,IAE5E3B,CAAAA,MAAAA,EAAA,OAAAA,EAAA2E,UAAA,GACAD,CAAAA,EAAAC,UAAA,IAA2C3E,EAAA2E,UAAA,CAAiB,IAAID,EAAAC,UAAA,CAA0B,GAG1FD,EAAAE,gBAAA,CAAAF,EAAAC,UAAA,EAEA,IAAAE,EAAA,GACArD,IACAqD,EAAAF,UAAA,YAA6CnG,EAAS,KAAKsD,EAAA,CAAQ,EAAEH,EAAM,IAE3EkD,EAAAD,gBAAA,CAAAC,EAAAF,UAAA,CACA,IAAAtB,GACAwB,CAAAA,EAAAC,OAAA,KAKA,IAAAC,EAAAC,KADA,IAAA9C,CAAA,gBAEAA,CAAA,gBACA3D,IAAAA,EACA,OAAY6C,EAAA6D,aAAmB,OAAA9C,OAAAC,MAAA,IAAwBF,EAAA,CAAc,cAAA6C,EAAA3G,UAAA,GAAyCuF,EAAA,CAA0B,EAAEvF,EAAU,EAAA4B,MAAA0E,EAAAnD,IAAAA,CAAA,GAC5IH,EAAA6D,aAAmB,QAAU7G,UAAAsD,EAAA1B,MAAA6E,EAAAtD,IAAA,IACrCkB,EAAAS,OAAA,CAAAgC,EACAjD,GACAA,CAAAA,EAAAiB,OAAA,CAAAgC,CAAA,CAEA,GAAejF,GACf,EACAkF,CAAAA,EAAAC,CAAA,CAAe9G","sources":["webpack://_N_E/./components/RawHtml/RawHtml.js","webpack://_N_E/./components/RawHtml/index.js","webpack://_N_E/./components/RichText/RichText.js","webpack://_N_E/./components/RichText/index.js","webpack://_N_E/./components/RawHtml/RawHtml.module.scss","webpack://_N_E/./components/RichText/RichText.module.scss","webpack://_N_E/./node_modules/react-animate-height/dist/esm/index.js"],"sourcesContent":["import { useTranslation } from 'next-i18next';\nimport React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport AnimateHeight from 'react-animate-height';\nimport RichText from '../RichText';\nimport styles from './RawHtml.module.scss';\n\nconst RawHtml = ({\n html = '',\n isExpandable = false,\n modifier,\n untranslatedModifiers = [],\n facts = '',\n colors = null,\n}) => {\n const { t } = useTranslation('common');\n const [isOpen, setIsOpen] = useState(false);\n\n const expand = () => {\n setIsOpen(true);\n };\n\n const classes = classNames(\n styles['RawHtml'],\n {\n [styles['RawHtml--Expandable']]: isExpandable & !isOpen,\n [styles[`RawHtml--${modifier}`]]: typeof modifier !== 'undefined',\n },\n untranslatedModifiers.map((x) => styles[x])\n );\n\n return (\n <div className={classes}>\n <AnimateHeight\n height={!isExpandable || isOpen ? 'auto' : 200}\n duration={450}>\n <div className={styles['RawHtml__Html']}>\n <RichText colors={colors} html={html} />\n </div>\n </AnimateHeight>\n {isExpandable && !isOpen && (\n <button onClick={expand} className={styles['RawHtml__Expand']}>\n {t('rawHtml.expand')}\n </button>\n )}\n {facts && (\n <div\n className={styles['RawHtml__Facts']}\n dangerouslySetInnerHTML={{ __html: facts }}\n />\n )}\n </div>\n );\n};\n\nRawHtml.propTypes = {\n html: PropTypes.string,\n isExpandable: PropTypes.bool,\n modifier: PropTypes.string,\n facts: PropTypes.string,\n untranslatedModifiers: PropTypes.arrayOf(PropTypes.string),\n};\n\nexport default RawHtml;\n","import RawHtml from './RawHtml';\n\nexport default RawHtml;\n","import React from 'react';\nimport classNames from 'classnames';\nimport styles from './RichText.module.scss';\n\nconst RichText = ({ html = '', colors = null }) => {\n const classes = classNames(styles['RichText'], {\n [styles[`RichText--${colors}`]]: colors,\n });\n\n return (\n <div dangerouslySetInnerHTML={{ __html: html }} className={classes} />\n );\n};\n\nexport default RichText;\n","import RichText from './RichText';\n\nexport default RichText;\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"RawHtml\":\"RawHtml_RawHtml__MCDEy\",\"RawHtml__Facts\":\"RawHtml_RawHtml__Facts__ALkxY\",\"RawHtml__Expand\":\"RawHtml_RawHtml__Expand__tpYny\",\"RawHtml--Inner\":\"RawHtml_RawHtml--Inner__TY3Ql\",\"RawHtml--Expandable\":\"RawHtml_RawHtml--Expandable__WlNjD\",\"RawHtml__Html\":\"RawHtml_RawHtml__Html__51USH\",\"RawHtml--InCampaignText\":\"RawHtml_RawHtml--InCampaignText__AnzBk\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"RichText\":\"RichText_RichText___2Oh_\",\"RichText--WhiteOnBlue\":\"RichText_RichText--WhiteOnBlue__eeBFJ\"};","import React, { useEffect, useRef, useState } from 'react';\n// ------------------ Helpers\nfunction isNumber(n) {\n const number = parseFloat(n);\n return !isNaN(number) && isFinite(number);\n}\nfunction isPercentage(height) {\n // Percentage height\n return (typeof height === 'string' &&\n height[height.length - 1] === '%' &&\n isNumber(height.substring(0, height.length - 1)));\n}\nfunction hideContent(element, height, disableDisplayNone) {\n // Check for element?.style is added cause this would fail in tests (react-test-renderer)\n // Read more here: https://github.com/Stanko/react-animate-height/issues/17\n if (height === 0 &&\n !disableDisplayNone &&\n (element === null || element === void 0 ? void 0 : element.style) &&\n (element === null || element === void 0 ? void 0 : element.children.length) > 0) {\n element.style.display = 'none';\n }\n}\nfunction showContent(element, height) {\n // Check for element?.style is added cause this would fail in tests (react-test-renderer)\n // Read more here: https://github.com/Stanko/react-animate-height/issues/17\n if (height === 0 && (element === null || element === void 0 ? void 0 : element.style)) {\n element.style.display = '';\n }\n}\nconst ANIMATION_STATE_CLASSES = {\n animating: 'rah-animating',\n animatingUp: 'rah-animating--up',\n animatingDown: 'rah-animating--down',\n animatingToHeightZero: 'rah-animating--to-height-zero',\n animatingToHeightAuto: 'rah-animating--to-height-auto',\n animatingToHeightSpecific: 'rah-animating--to-height-specific',\n static: 'rah-static',\n staticHeightZero: 'rah-static--height-zero',\n staticHeightAuto: 'rah-static--height-auto',\n staticHeightSpecific: 'rah-static--height-specific',\n};\nfunction getStaticStateClasses(animationStateClasses, height) {\n return [\n animationStateClasses.static,\n height === 0 && animationStateClasses.staticHeightZero,\n typeof height === 'number' && height > 0\n ? animationStateClasses.staticHeightSpecific\n : null,\n height === 'auto' && animationStateClasses.staticHeightAuto,\n ]\n .filter((v) => v)\n .join(' ');\n}\n// ------------------ Component\nconst propsToOmitFromDiv = [\n 'animateOpacity',\n 'animationStateClasses',\n 'applyInlineTransitions',\n 'children',\n 'className',\n 'contentClassName',\n 'contentRef',\n 'delay',\n 'duration',\n 'easing',\n 'height',\n 'onHeightAnimationEnd',\n 'onHeightAnimationStart',\n 'style',\n 'disableDisplayNone',\n];\nconst AnimateHeight = React.forwardRef((componentProps, ref) => {\n // const AnimateHeight = forwardRef((componentProps: AnimateHeightProps, ref) => {\n // const AnimateHeight: React.FC<AnimateHeightProps> = (componentProps) => {\n const { animateOpacity = false, animationStateClasses = {}, applyInlineTransitions = true, children, className = '', contentClassName, delay: userDelay = 0, disableDisplayNone = false, duration: userDuration = 500, easing = 'ease', height, onHeightAnimationEnd, onHeightAnimationStart, style, contentRef, } = componentProps;\n const divProps = Object.assign({}, componentProps);\n propsToOmitFromDiv.forEach((propKey) => {\n delete divProps[propKey];\n });\n // ------------------ Initialization\n const prevHeight = useRef(height);\n const contentElement = useRef(null);\n const animationClassesTimeoutID = useRef();\n const timeoutID = useRef();\n const stateClasses = useRef(Object.assign(Object.assign({}, ANIMATION_STATE_CLASSES), animationStateClasses));\n const isBrowser = typeof window !== 'undefined';\n const prefersReducedMotion = useRef(isBrowser && window.matchMedia\n ? window.matchMedia('(prefers-reduced-motion)').matches\n : false);\n const delay = prefersReducedMotion.current ? 0 : userDelay;\n const duration = prefersReducedMotion.current ? 0 : userDuration;\n let initHeight = height;\n let initOverflow = 'visible';\n if (typeof height === 'number') {\n // Reset negative height to 0\n initHeight = height < 0 ? 0 : height;\n initOverflow = 'hidden';\n }\n else if (isPercentage(initHeight)) {\n // If value is string \"0%\" make sure we convert it to number 0\n initHeight = height === '0%' ? 0 : height;\n initOverflow = 'hidden';\n }\n const [currentHeight, setCurrentHeight] = useState(initHeight);\n const [overflow, setOverflow] = useState(initOverflow);\n const [useTransitions, setUseTransitions] = useState(false);\n const [animationStateClassNames, setAnimationStateClassNames] = useState(getStaticStateClasses(stateClasses.current, height));\n // ------------------ Did mount\n useEffect(() => {\n // Hide content if height is 0 (to prevent tabbing into it)\n hideContent(contentElement.current, currentHeight, disableDisplayNone);\n // This should be explicitly run only on mount\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n // ------------------ Height update\n useEffect(() => {\n if (height !== prevHeight.current && contentElement.current) {\n showContent(contentElement.current, prevHeight.current);\n // Cache content height\n contentElement.current.style.overflow = 'hidden';\n const contentHeight = contentElement.current.offsetHeight;\n contentElement.current.style.overflow = '';\n // set total animation time\n const totalDuration = duration + delay;\n let newHeight;\n let timeoutHeight;\n let timeoutOverflow = 'hidden';\n let timeoutUseTransitions;\n const isCurrentHeightAuto = prevHeight.current === 'auto';\n if (typeof height === 'number') {\n // Reset negative height to 0\n newHeight = height < 0 ? 0 : height;\n timeoutHeight = newHeight;\n }\n else if (isPercentage(height)) {\n // If value is string \"0%\" make sure we convert it to number 0\n newHeight = height === '0%' ? 0 : height;\n timeoutHeight = newHeight;\n }\n else {\n // If not, animate to content height\n // and then reset to auto\n newHeight = contentHeight; // TODO solve contentHeight = 0\n timeoutHeight = 'auto';\n timeoutOverflow = undefined;\n }\n if (isCurrentHeightAuto) {\n // This is the height to be animated to\n timeoutHeight = newHeight;\n // If previous height was 'auto'\n // set starting height explicitly to be able to use transition\n newHeight = contentHeight;\n }\n // Animation classes\n const newAnimationStateClassNames = [\n stateClasses.current.animating,\n (prevHeight.current === 'auto' || height < prevHeight.current) &&\n stateClasses.current.animatingUp,\n (height === 'auto' || height > prevHeight.current) &&\n stateClasses.current.animatingDown,\n timeoutHeight === 0 && stateClasses.current.animatingToHeightZero,\n timeoutHeight === 'auto' &&\n stateClasses.current.animatingToHeightAuto,\n typeof timeoutHeight === 'number' && timeoutHeight > 0\n ? stateClasses.current.animatingToHeightSpecific\n : null,\n ]\n .filter((v) => v)\n .join(' ');\n // Animation classes to be put after animation is complete\n const timeoutAnimationStateClasses = getStaticStateClasses(stateClasses.current, timeoutHeight);\n // Set starting height and animating classes\n // When animating from 'auto' we first need to set fixed height\n // that change should be animated\n setCurrentHeight(newHeight);\n setOverflow('hidden');\n setUseTransitions(!isCurrentHeightAuto);\n setAnimationStateClassNames(newAnimationStateClassNames);\n // Clear timeouts\n clearTimeout(timeoutID.current);\n clearTimeout(animationClassesTimeoutID.current);\n if (isCurrentHeightAuto) {\n // When animating from 'auto' we use a short timeout to start animation\n // after setting fixed height above\n timeoutUseTransitions = true;\n // Short timeout to allow rendering of the initial animation state first\n timeoutID.current = setTimeout(() => {\n setCurrentHeight(timeoutHeight);\n setOverflow(timeoutOverflow);\n setUseTransitions(timeoutUseTransitions);\n // ANIMATION STARTS, run a callback if it exists\n onHeightAnimationStart === null || onHeightAnimationStart === void 0 ? void 0 : onHeightAnimationStart(timeoutHeight);\n }, 50);\n // Set static classes and remove transitions when animation ends\n animationClassesTimeoutID.current = setTimeout(() => {\n setUseTransitions(false);\n setAnimationStateClassNames(timeoutAnimationStateClasses);\n // ANIMATION ENDS\n // Hide content if height is 0 (to prevent tabbing into it)\n hideContent(contentElement.current, timeoutHeight, disableDisplayNone);\n // Run a callback if it exists\n onHeightAnimationEnd === null || onHeightAnimationEnd === void 0 ? void 0 : onHeightAnimationEnd(timeoutHeight);\n }, totalDuration);\n }\n else {\n // ANIMATION STARTS, run a callback if it exists\n onHeightAnimationStart === null || onHeightAnimationStart === void 0 ? void 0 : onHeightAnimationStart(newHeight);\n // Set end height, classes and remove transitions when animation is complete\n timeoutID.current = setTimeout(() => {\n setCurrentHeight(timeoutHeight);\n setOverflow(timeoutOverflow);\n setUseTransitions(false);\n setAnimationStateClassNames(timeoutAnimationStateClasses);\n // ANIMATION ENDS\n // If height is auto, don't hide the content\n // (case when element is empty, therefore height is 0)\n if (height !== 'auto') {\n // Hide content if height is 0 (to prevent tabbing into it)\n hideContent(contentElement.current, newHeight, disableDisplayNone); // TODO solve newHeight = 0\n }\n // Run a callback if it exists\n onHeightAnimationEnd === null || onHeightAnimationEnd === void 0 ? void 0 : onHeightAnimationEnd(newHeight);\n }, totalDuration);\n }\n }\n prevHeight.current = height;\n return () => {\n clearTimeout(timeoutID.current);\n clearTimeout(animationClassesTimeoutID.current);\n };\n // This should be explicitly run only on height change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [height]);\n // ------------------ Render\n const componentStyle = Object.assign(Object.assign({}, style), { height: currentHeight, overflow: overflow || (style === null || style === void 0 ? void 0 : style.overflow) });\n if (useTransitions && applyInlineTransitions) {\n componentStyle.transition = `height ${duration}ms ${easing} ${delay}ms`;\n // Include transition passed through styles\n if (style === null || style === void 0 ? void 0 : style.transition) {\n componentStyle.transition = `${style.transition}, ${componentStyle.transition}`;\n }\n // Add webkit vendor prefix still used by opera, blackberry...\n componentStyle.WebkitTransition = componentStyle.transition;\n }\n const contentStyle = {};\n if (animateOpacity) {\n contentStyle.transition = `opacity ${duration}ms ${easing} ${delay}ms`;\n // Add webkit vendor prefix still used by opera, blackberry...\n contentStyle.WebkitTransition = contentStyle.transition;\n if (currentHeight === 0) {\n contentStyle.opacity = 0;\n }\n }\n // Check if user passed aria-hidden prop\n const hasAriaHiddenProp = typeof divProps['aria-hidden'] !== 'undefined';\n const ariaHidden = hasAriaHiddenProp\n ? divProps['aria-hidden']\n : height === 0;\n return (React.createElement(\"div\", Object.assign({}, divProps, { \"aria-hidden\": ariaHidden, className: `${animationStateClassNames} ${className}`, style: componentStyle, ref: ref }),\n React.createElement(\"div\", { className: contentClassName, style: contentStyle, ref: (el) => {\n contentElement.current = el;\n if (contentRef) {\n contentRef.current = el;\n }\n } }, children)));\n});\nexport default AnimateHeight;\n"],"names":["RawHtml","html","isExpandable","modifier","untranslatedModifiers","facts","colors","param","t","useTranslation","isOpen","setIsOpen","useState","classes","classNames","styles","concat","map","x","jsx_runtime","jsxs","div","className","jsx","AnimateHeight","height","duration","RichText","button","onClick","dangerouslySetInnerHTML","__html","propTypes","PropTypes","components_RawHtml","components_RichText","module","exports","isPercentage","length","isNumber","n","number","parseFloat","isNaN","isFinite","substring","hideContent","element","disableDisplayNone","style","children","display","ANIMATION_STATE_CLASSES","animating","animatingUp","animatingDown","animatingToHeightZero","animatingToHeightAuto","animatingToHeightSpecific","static","staticHeightZero","staticHeightAuto","staticHeightSpecific","getStaticStateClasses","animationStateClasses","filter","v","join","propsToOmitFromDiv","react__WEBPACK_IMPORTED_MODULE_0__","forwardRef","componentProps","ref","animateOpacity","applyInlineTransitions","contentClassName","delay","userDelay","userDuration","easing","onHeightAnimationEnd","onHeightAnimationStart","contentRef","divProps","Object","assign","forEach","propKey","prevHeight","useRef","contentElement","animationClassesTimeoutID","timeoutID","stateClasses","isBrowser","window","prefersReducedMotion","matchMedia","matches","current","initHeight","initOverflow","currentHeight","setCurrentHeight","overflow","setOverflow","useTransitions","setUseTransitions","animationStateClassNames","setAnimationStateClassNames","useEffect","newHeight","timeoutHeight","contentHeight","offsetHeight","totalDuration","timeoutOverflow","isCurrentHeightAuto","undefined","newAnimationStateClassNames","timeoutAnimationStateClasses","clearTimeout","setTimeout","componentStyle","transition","WebkitTransition","contentStyle","opacity","ariaHidden","hasAriaHiddenProp","createElement","el","__webpack_exports__","Z"],"sourceRoot":""}