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BySideContainer/SideBySideContainer.js"],"sourcesContent":["import React, { useState, useEffect, useLayoutEffect } from 'react';\n\n// https://github.com/streamich/react-use/blob/master/docs/useIsomorphicLayoutEffect.md\nexport const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport function useMatchMedia(mediaQueryString, initialValue = null) {\n const [match, setMatch] = useState(initialValue);\n\n useEffect(\n () => {\n if (!window.matchMedia) {\n return;\n }\n\n function handleMatch(event) {\n setMatch(event.matches);\n }\n\n const matchMedia = window.matchMedia(mediaQueryString);\n\n setMatch(matchMedia.matches);\n matchMedia.addListener(handleMatch);\n\n return () => {\n matchMedia.removeListener(handleMatch);\n };\n },\n [mediaQueryString]\n );\n return match;\n}\n\nexport const mediaQueryHOC = (Component) => {\n function MediaQueryHOC(props) {\n const isXSmall = useMatchMedia('(max-width: 375px)');\n const isSmall = useMatchMedia('(max-width: 479px)');\n const isMedium = useMatchMedia('(max-width: 767px)');\n const isLarge = useMatchMedia('(max-width: 991px)');\n const isXLarge = useMatchMedia('(max-width: 1023px)');\n return (\n \n );\n }\n return MediaQueryHOC;\n};\n\nlet listeners = [];\nlet state = { currentProductIndex: 0 };\n\nconst setState = (newState) => {\n state = { ...state, ...newState };\n listeners.forEach((listener) => {\n listener(state);\n });\n};\n\nexport const updateCurrentProductIndex = () => {\n const newListener = useState()[1];\n useEffect(() => {\n listeners.push(newListener);\n }, []);\n return [state, setState];\n};\n","import React, { Component, Suspense } from 'react';\nimport Block from '../../adapters/helpers/Block';\nimport PropTypes from 'prop-types';\nimport { SideBySideContainerConstants } from '../../adapters/helpers/Constants';\nimport { createHtmlFriendlyId } from '../../adapters/helpers/Utils';\nimport { mediaQueryHOC } from '../../adapters/helpers/Hooks';\nimport dynamic from 'next/dynamic';\nimport Loader from '../../adapters/helpers/Loader';\nimport LazyLoad from 'react-lazy-load';\nconst Heading = dynamic(() => import('../Heading/Heading'));\nconst Disclaimer = dynamic(() => import('../Disclaimer/Disclaimer'));\n\nclass SideBySideContainer extends Component {\n constructor(props) {\n super(props);\n this.block = new Block(props);\n }\n\n renderTile(block, index) {\n const blockObj = new Block(block);\n const tileId = this.getTileId(blockObj);\n blockObj.setFieldValue(SideBySideContainerConstants.anchorId, tileId);\n const sideIndicator = (index % 2 == 0) ? SideBySideContainerConstants.left : SideBySideContainerConstants.right;\n\n return (\n
\n {blockObj.renderBlockFromDocument()}\n
\n );\n }\n\n getTileId(blockObj) {\n return SideBySideContainerConstants.sideBySide + blockObj.getAnchorId();\n }\n\n render() {\n let className = 'ob-side-by-side ' + this.props.className;\n const containerBlocks = this.block.getFieldValue(SideBySideContainerConstants.blocks);\n const title = this.block.getFieldValue(SideBySideContainerConstants.title);\n const disclaimer = this.block.getFieldValue(SideBySideContainerConstants.disclaimer);\n const name = this.block.getFieldValue(SideBySideContainerConstants.name);\n const hasDivider = this.block.getFieldValue(SideBySideContainerConstants.hasDivider);\n const anchorId = this.block.getFieldValue(SideBySideContainerConstants.anchorId) || createHtmlFriendlyId(name);\n const flipOnMobile = this.block.getFieldValue(SideBySideContainerConstants.flipOnMobile) || false;\n let containerBlocksCopyMobile = [...containerBlocks];\n if (flipOnMobile && containerBlocksCopyMobile.length >= 2) {\n // this works best with side by sides that only have 2 elements\n for (let i = 0; i < containerBlocksCopyMobile.length; i++) {\n // if element is on the right, swap with previous element\n if (i % 2 === 1) {\n [containerBlocksCopyMobile[i - 1], containerBlocksCopyMobile[i]] = [containerBlocksCopyMobile[i], containerBlocksCopyMobile[i - 1]];\n }\n }\n }\n\n return (\n \n }>\n
\n {title &&\n
\n {title}\n

{this.block.getFieldValue(SideBySideContainerConstants.description)}

\n
\n }\n
\n {flipOnMobile ?\n this.props.isMedium ?\n containerBlocksCopyMobile && containerBlocksCopyMobile.map((block, index) => {\n return this.renderTile(block, index);\n }) :\n containerBlocks && containerBlocks.map((block, index) => {\n return this.renderTile(block, index);\n }) :\n containerBlocks && containerBlocks.map((block, index) => {\n return this.renderTile(block, index);\n })\n }\n
\n {disclaimer &&\n \n }\n
\n
\n
\n );\n }\n}\n\nSideBySideContainer.propTypes = {\n className: PropTypes.string,\n isMedium: PropTypes.bool\n};\n\nexport default mediaQueryHOC(SideBySideContainer)\n// This export is for unit testing (do not remove) :\nexport const SideBySideContainerTest = SideBySideContainer;\n"],"names":["useIsomorphicLayoutEffect","useLayoutEffect","useMatchMedia","mediaQueryString","initialValue","arguments","length","undefined","_useState","useState","match","setMatch","useEffect","window","matchMedia","matches","addListener","handleMatch","removeListener","event","mediaQueryHOC","Component","props","isXSmall","isSmall","isMedium","isLarge","isXLarge","_jsx","_objectSpread","listeners","state","currentProductIndex","setState","newState","forEach","listener","updateCurrentProductIndex","newListener","push","Heading","dynamic","__webpack_require__","e","then","bind","loadableGenerated","webpack","Disclaimer","SideBySideContainer","_Component","_inherits","_super","_this","_classCallCheck","call","block","Block","_createClass","key","value","index","blockObj","tileId","getTileId","setFieldValue","SideBySideContainerConstants","anchorId","sideIndicator","left","right","className","concat","children","renderBlockFromDocument","sideBySide","getAnchorId","_this2","containerBlocks","getFieldValue","blocks","title","disclaimer","name","hasDivider","createHtmlFriendlyId","flipOnMobile","containerBlocksCopyMobile","_toConsumableArray","i","_ref","LazyLoad","offset","Suspense","fallback","Loader","_jsxs","id","tag","description","map","renderTile","document","__webpack_exports__","SideBySideContainerTest"],"sourceRoot":""}