{"version":3,"sources":["webpack:///./src/components/CtaBanner/CtaBanner.tsx","webpack:///./src/modules/CtaBannerModule/CtaBannerModule.tsx","webpack:///./src/modules/CtaBannerModule/index.ts","webpack:///./src/utils/gtag.ts","webpack:///./node_modules/prop-types/index.js","webpack:///./src/utils/dom.ts","webpack:///./node_modules/@babel/runtime/helpers/esm/extends.js","webpack:///./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack:///./node_modules/prop-types/factoryWithThrowingShims.js","webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack:///./src/utils/image-utils.ts","webpack:///./node_modules/react-measure/dist/index.esm.js"],"names":["CtaBanner","_ref","image","heading","text","cta","eventMeta","event","eventData","link","label","React","className","concat","styles","ctaBanner","noImage","textWrapper","Heading","level","ctaTitle","Paragraph","weight","marginBottom","ctaText","Button","Object","assign","version","darkBg","icon","imageWrapper","Image","contain","displayName","defaultProps","CtaBannerModule","_React$Component","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","id","this","props","_defineProperty","ONLY_SERVER","global","trackEvent","eventLabel","window","gtmEvent","site_section","dataLayer","push","module","exports","truncateString","string","length","substring","Error","_extends","bind","n","e","t","r","hasOwnProperty","call","apply","_inheritsLoose","o","prototype","create","constructor","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","propName","componentName","location","propFullName","secret","err","name","getShim","isRequired","ReactPropTypes","array","bigint","bool","func","number","object","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","DIMENSION_NAMES","aspectRatios","mobile","desktop","defaultBreakpoints","hd","breakpoints","xs","sm","md","lg","generateSizes","imageBreaks","undefined","maxWidth","queries","reduce","acc","breakpoint","index","breakpointSize","types","getTypes","allowedTypes","forEach","type","getContentRect","calculations","indexOf","client","top","clientTop","left","clientLeft","width","clientWidth","height","clientHeight","offset","offsetTop","offsetLeft","offsetWidth","offsetHeight","scroll","scrollTop","scrollLeft","scrollWidth","scrollHeight","rect","getBoundingClientRect","bounds","right","bottom","getComputedStyle","margin","parseInt","marginTop","marginRight","marginLeft","getWindowOf","target","ownerDocument","defaultView","Measure","WrappedComponent","_class","_temp","_Component","WithContentRect","_this","_len","args","Array","_key","state","contentRect","entry","_animationFrameID","_resizeObserver","_node","_window","measure","entries","requestAnimationFrame","setState","onResize","_handleRef","unobserve","innerRef","current","observe","_proto","componentDidMount","ResizeObserver","componentWillUnmount","cancelAnimationFrame","disconnect","render","_this$props","measureRef","propTypes","withContentRect","children"],"mappings":"oSASA,SAASA,EAASC,GAAuC,IAApCC,EAAKD,EAALC,MAAOC,EAAOF,EAAPE,QAASC,EAAIH,EAAJG,KAAMC,EAAGJ,EAAHI,IAGnCC,EAAY,CAChBC,MAHYF,EAAM,MAAQ,GAI1BG,UAHgBH,GAAOA,EAAII,KAAOJ,EAAII,KAAKC,MAAQ,IAMrD,OACEC,gBAAA,OAAKC,UAAS,GAAAC,OAAKC,IAAOC,UAAS,KAAAF,OAAKX,EAAyB,GAAjBY,IAAOE,UACrDL,gBAAA,OAAKC,UAAWE,IAAOG,aACpBd,GACCQ,gBAACO,IAAO,CAACC,MAAO,EAAGP,UAAWE,IAAOM,UAClCjB,GAGJC,GACCO,gBAACU,IAAS,CAACC,OAAO,QAAQC,aAAa,QAAQX,UAAWE,IAAOU,SAC9DpB,GAGJC,GACCM,gBAACc,IAAMC,OAAAC,OAAA,GACDtB,EAAII,KAAI,CACZmB,QAASvB,EAAIuB,QACbC,QAAM,EACNvB,UAAWA,EACXwB,KAAMzB,EAAIyB,SAIf5B,GACCS,gBAAA,OAAKC,UAAWE,IAAOiB,cACrBpB,gBAACqB,IAAKN,OAAAC,OAAA,GAAKzB,EAAK,CAAE+B,SAAO,OAOnCjC,EAAUkC,YAAc,YACxBlC,EAAUmC,aAAe,GACVnC,QC5CToC,EAAe,SAAAC,GAAA,SAAAD,IAAA,OAAAE,YAAA,KAAAF,GAAAG,YAAA,KAAAH,EAAAI,W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AAU/C,KAClBwD,OAAQ,IAAUxD,KAClB6D,OAAQ,IAAU7D,KAClBoE,OAAQ,IAAUpE,KAClBwE,OAAQ,IAAUxE,KAClB0G,SAAU,IAAU7F,UAAU,CAAC,IAAUV,OAAQ,IAAUF,OAC3DsG,SAAU,IAAUtG,MACnBmF,GAIOmC,IAAkB,SAAUtN,GACxC,IAAIkM,EAAUlM,EAAKkM,QACfkB,EAAapN,EAAKoN,WAClBxB,EAAc5L,EAAK4L,YAEvB,OAAO2B,EADQvN,EAAKuN,UACJ,CACdrB,QAASA,EACTkB,WAAYA,EACZxB,YAAaA,OAGjBZ,EAAQ/I,YAAc,UACtB+I,EAAQqC,UAAUE,SAAW,IAAUvH,KAExB","file":"static/scripts/30-dbb5f6eb6dd2484b2977.js","sourcesContent":["import * as React from 'react'\nimport styles from './ctaBanner-style.css'\nimport Heading from '../Heading/Heading'\nimport Paragraph from '../Paragraph/Paragraph'\nimport Image from '../Image/Image'\nimport Button from '../Button/Button'\nimport type { CtaBannerViewModel } from '../../view-models/CtaBannerViewModel'\ntype Props = CtaBannerViewModel\n\nfunction CtaBanner({ image, heading, text, cta }: Props) {\n const event = cta ? 'cta' : ''\n const eventData = cta && cta.link ? cta.link.label : ''\n const eventMeta = {\n event,\n eventData,\n }\n\n return (\n
\n
\n {heading && (\n \n {heading}\n \n )}\n {text && (\n \n {text}\n \n )}\n {cta && (\n \n )}\n
\n {image && (\n
\n \n
\n )}\n
\n )\n}\n\nCtaBanner.displayName = 'CtaBanner'\nCtaBanner.defaultProps = {}\nexport default CtaBanner","import * as React from 'react'\n\nimport CtaBanner from '../../components/CtaBanner/CtaBanner'\nimport type { CtaBannerViewModel } from '../../view-models/CtaBannerViewModel'\ntype Props = CtaBannerViewModel\ntype State = {}\n\nclass CtaBannerModule extends React.Component {\n static displayName = 'CtaBannerModule'\n static defaultProps = {}\n\n render() {\n return (\n
\n \n
\n )\n }\n}\n\nexport default CtaBannerModule","export { default } from './CtaBannerModule'\n\n/**\n * Should the component only render server side?\n * You can set this to true if the component is a pure static component.\n */\nexport const ONLY_SERVER = false","global.dataLayer = global.dataLayer || []\nexport type GtagEvent = {\n event?: string\n eventData?: string\n eventLabel?: string\n}\n\n/**\n * Track an event\n * Supply a callback, that gets triggered after the event is tracked\n */\nexport function trackEvent({ event, eventData, eventLabel }: GtagEvent) {\n if (typeof window === 'undefined') return\n const eventName = event ? `${window.site_section || 'pensam'}-${event}` : ''\n const gtmEvent = {\n event: eventName,\n 'event-data': eventData || '',\n 'event-label': eventLabel || '',\n }\n\n if (global.dataLayer && gtmEvent.event) {\n global.dataLayer.push(gtmEvent)\n } //\n // if (\n // process.env.NODE_ENV === 'development' &&\n // global.dataLayer &&\n // gtmEvent.event\n // ) {\n // console.log('dataLayer', global.dataLayer)\n // }\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","export function scrollOffset(element, offset = 0, alignment = 'top') {\n const body = document.body\n const html = document.documentElement\n const elemRect = element.getBoundingClientRect()\n const clientHeight = html.clientHeight\n const documentHeight = Math.max(\n body.scrollHeight,\n body.offsetHeight,\n html.clientHeight,\n html.scrollHeight,\n html.offsetHeight,\n )\n let scrollPosition\n\n if (alignment === 'bottom') {\n scrollPosition = elemRect.bottom - clientHeight\n } else if (alignment === 'middle') {\n scrollPosition = elemRect.bottom - clientHeight / 2 - elemRect.height / 2\n } else {\n // top and default\n scrollPosition = elemRect.top\n }\n\n const maxScrollPosition = documentHeight - clientHeight\n return Math.min(scrollPosition + offset + window.pageYOffset, maxScrollPosition)\n}\n\n/**\n * Return true if child is contained in parent\n * @param parent {HTMLElement}\n * @param child {HTMLElement}\n * @returns {boolean}\n */\nexport function isDescendant(parent, child) {\n if (!child || !child.parentNode) return false\n let node = child.parentNode\n\n while (node != null) {\n if (node === parent) {\n return true\n }\n\n node = node.parentNode\n }\n\n return false\n}\nlet matchesFn\n\n/**\n * Find the closest element that matches the selector\n * @param el {HTMLElement}\n * @param selector {string}\n * @returns {HTMLElement}\n */\nexport function closest(el, selector) {\n if (!matchesFn) {\n // find vendor prefix\n ;[\n 'matches',\n 'webkitMatchesSelector',\n 'mozMatchesSelector',\n 'msMatchesSelector',\n 'oMatchesSelector',\n ].some((fn) => {\n if (typeof document.body[fn] === 'function') {\n matchesFn = fn\n return true\n }\n\n return false\n })\n }\n\n // traverse parents\n let parent\n let element = el\n\n while (element !== null) {\n parent = element.parentElement\n\n if (parent !== null && parent[matchesFn](selector)) {\n return parent\n }\n\n element = parent\n }\n\n return null\n}\n\n/**\n * Get the previous sibling DOM node to an element\n * @param node {HTMLElement}\n * @returns {HTMLElement}\n */\nexport function previousSibling(node) {\n if (!node) return null\n let element = node\n\n do {\n element = element.previousSibling\n if (!isIgnorable(element)) return element\n } while (element)\n\n return null\n}\n\n/**\n * Get the next sibling DOM node to an element\n * @param node {HTMLElement}\n * @returns {HTMLElement}\n */\nexport function nextSibling(node) {\n if (!node) return null\n let element = node\n\n do {\n element = element.nextSibling\n if (element && !isIgnorable(element)) return element\n } while (element)\n\n return null\n}\n\n/**\n * Ignore commment and text nodes.\n * @param node\n * @returns {*}\n */\nfunction isIgnorable(node) {\n if (!node) return null\n return node.nodeType === 8 || (node.nodeType === 3 && isAllWs(node))\n}\n\n/**\n * Ignore all whitespace nodes\n * @param node\n * @returns {*}\n */\nfunction isAllWs(node) {\n if (!node) return null\n // Use ECMA-262 Edition 3 String and RegExp features\n return !/[^\\t\\n\\r ]/.test(node.textContent)\n}\n\nexport function getNodePath(node) {\n if (!node) return null\n let currentNode = node\n let path\n\n while (currentNode.parentNode) {\n const tag = currentNode.tagName.toLowerCase()\n const classes = currentNode.getAttribute('class')\n const className = classes ? `.${classes.trim().split(' ').join('.')}` : ''\n\n if (path) {\n path = `${tag}${className} > ${path}`\n } else {\n path = `${tag}${className}`\n }\n\n // Move up in the tree\n currentNode = currentNode.parentNode\n }\n\n return path\n}\nexport function insertAfter(newNode, referenceNode) {\n referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)\n}\nexport function truncateString(string, length) {\n if (string.length > length) {\n if (typeof string === 'string' && typeof length === 'number') {\n return string.substring(0, length) + '\\u2026'\n } else {\n throw new Error('Function truncateString take args @string, @number')\n }\n } else return string\n}\nexport default {\n closest,\n isDescendant,\n previousSibling,\n nextSibling,\n scrollOffset,\n getNodePath,\n insertAfter,\n truncateString,\n}","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","export type ImageRatio = 'original' | 'dim16_9' | 'dim3_2'\nexport const DIMENSION_NAMES = ['xs', 'sm', 'md', 'lg', 'hd']\nexport const aspectRatios = {\n mobile: 10 / 23,\n desktop: 10 / 27,\n}\n\n/** Max image width at a given breakpoint. */\nexport type ImageBreakpoints = {\n xs?: string\n sm?: string\n md?: string\n lg?: string\n hd?: string\n}\nexport const IMAGE_WIDTHS = [150, 300, 560, 660, 750, 880, 1024, 1350, 1440, 1720, 1920, 2048, 2700]\nexport type ImageSizes = {\n breakpoints?: ImageBreakpoints\n maxWidth: string | number\n}\n// If image breaks are undefined, make sure the width tops out 100 viewport width\nconst defaultBreakpoints = {\n hd: '100vw',\n}\nconst breakpoints = {\n xs: 0,\n sm: 48,\n // 48*16 = 768px\n md: 64,\n // 64*16 = 1024px\n lg: 75,\n // 75*16 = 1200px\n hd: 90, // 88*16 = 1408px\n}\n\n/**\n * Converts a string number with a known unit type, to a unitless number in px size\n **/\nexport function sizeToNumber(size: string | number): number {\n if (!size) return 0\n if (typeof size === 'number') return size\n if (size.endsWith('px')) return parseInt(size.substr(0, size.length - 2), 10)\n if (size.endsWith('em')) return parseInt(size.substr(0, size.length - 2), 10) * 16\n if (size.endsWith('vw')) return (parseInt(size.substr(0, size.length - 2), 10) * 1440) / 100\n if (size.endsWith('rem')) return parseInt(size.substr(0, size.length - 3), 10) * 16\n return parseInt(size, 10)\n}\n\n/**\n * Generate the actual ratio for the the known Image ratios\n **/\nexport function calculateRatio(width: number = 16, height: number = 9, aspect: number) {\n return Math.min(aspect, height === 0 ? 1 : height / width === 0 ? 1 : width) // switch (aspect) {\n // case 'dim3_2':\n // return 2 / 3\n // case 'dim16_9':\n // return 9 / 16\n // default:\n // return height / width\n // }\n}\n\n/**\n * Generate sizes for images, while respecting Breakpoints\n **/\nexport function generateSizes(\n imageBreaks: ImageBreakpoints = defaultBreakpoints,\n maxWidth: string | number = '1440px',\n) {\n const queries = DIMENSION_NAMES.reduce((acc, breakpoint, index) => {\n // If the breakpoint is 0, or undefined, take the next dimension\n const maxWidth = breakpoints[breakpoint] || breakpoints[DIMENSION_NAMES[index + 1]]\n const breakpointSize = imageBreaks[breakpoint]\n\n if (breakpointSize) {\n return `${acc}(max-width: ${maxWidth}em) ${breakpointSize}, `\n }\n\n return acc\n }, '')\n return queries + (typeof maxWidth === 'number' ? `${maxWidth}px` : maxWidth)\n}","import _extends from '@babel/runtime/helpers/esm/extends';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport { Component, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport ResizeObserver from 'resize-observer-polyfill';\n\nvar types = ['client', 'offset', 'scroll', 'bounds', 'margin'];\nfunction getTypes(props) {\n var allowedTypes = [];\n types.forEach(function (type) {\n if (props[type]) {\n allowedTypes.push(type);\n }\n });\n return allowedTypes;\n}\n\nfunction getContentRect(node, types) {\n var calculations = {};\n\n if (types.indexOf('client') > -1) {\n calculations.client = {\n top: node.clientTop,\n left: node.clientLeft,\n width: node.clientWidth,\n height: node.clientHeight\n };\n }\n\n if (types.indexOf('offset') > -1) {\n calculations.offset = {\n top: node.offsetTop,\n left: node.offsetLeft,\n width: node.offsetWidth,\n height: node.offsetHeight\n };\n }\n\n if (types.indexOf('scroll') > -1) {\n calculations.scroll = {\n top: node.scrollTop,\n left: node.scrollLeft,\n width: node.scrollWidth,\n height: node.scrollHeight\n };\n }\n\n if (types.indexOf('bounds') > -1) {\n var rect = node.getBoundingClientRect();\n calculations.bounds = {\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n width: rect.width,\n height: rect.height\n };\n }\n\n if (types.indexOf('margin') > -1) {\n var styles = getComputedStyle(node);\n calculations.margin = {\n top: styles ? parseInt(styles.marginTop) : 0,\n right: styles ? parseInt(styles.marginRight) : 0,\n bottom: styles ? parseInt(styles.marginBottom) : 0,\n left: styles ? parseInt(styles.marginLeft) : 0\n };\n }\n\n return calculations;\n}\n\n/**\n * Returns the global window object associated with provided element.\n */\nfunction getWindowOf(target) {\n // Assume that the element is an instance of Node, which means that it\n // has the \"ownerDocument\" property from which we can retrieve a\n // corresponding global object.\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView; // Return the local window object if it's not possible extract one from\n // provided element.\n\n return ownerGlobal || window;\n}\n\nfunction withContentRect(types) {\n return function (WrappedComponent) {\n var _class, _temp;\n\n return _temp = _class =\n /*#__PURE__*/\n function (_Component) {\n _inheritsLoose(WithContentRect, _Component);\n\n function WithContentRect() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _Component.call.apply(_Component, [this].concat(args)) || this;\n _this.state = {\n contentRect: {\n entry: {},\n client: {},\n offset: {},\n scroll: {},\n bounds: {},\n margin: {}\n }\n };\n _this._animationFrameID = null;\n _this._resizeObserver = null;\n _this._node = null;\n _this._window = null;\n\n _this.measure = function (entries) {\n var contentRect = getContentRect(_this._node, types || getTypes(_this.props));\n\n if (entries) {\n contentRect.entry = entries[0].contentRect;\n }\n\n _this._animationFrameID = _this._window.requestAnimationFrame(function () {\n if (_this._resizeObserver !== null) {\n _this.setState({\n contentRect: contentRect\n });\n\n if (typeof _this.props.onResize === 'function') {\n _this.props.onResize(contentRect);\n }\n }\n });\n };\n\n _this._handleRef = function (node) {\n if (_this._resizeObserver !== null && _this._node !== null) {\n _this._resizeObserver.unobserve(_this._node);\n }\n\n _this._node = node;\n _this._window = getWindowOf(_this._node);\n var innerRef = _this.props.innerRef;\n\n if (innerRef) {\n if (typeof innerRef === 'function') {\n innerRef(_this._node);\n } else {\n innerRef.current = _this._node;\n }\n }\n\n if (_this._resizeObserver !== null && _this._node !== null) {\n _this._resizeObserver.observe(_this._node);\n }\n };\n\n return _this;\n }\n\n var _proto = WithContentRect.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this._resizeObserver = this._window !== null && this._window.ResizeObserver ? new this._window.ResizeObserver(this.measure) : new ResizeObserver(this.measure);\n\n if (this._node !== null) {\n this._resizeObserver.observe(this._node);\n\n if (typeof this.props.onResize === 'function') {\n this.props.onResize(getContentRect(this._node, types || getTypes(this.props)));\n }\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n if (this._window !== null) {\n this._window.cancelAnimationFrame(this._animationFrameID);\n }\n\n if (this._resizeObserver !== null) {\n this._resizeObserver.disconnect();\n\n this._resizeObserver = null;\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n innerRef = _this$props.innerRef,\n onResize = _this$props.onResize,\n props = _objectWithoutPropertiesLoose(_this$props, [\"innerRef\", \"onResize\"]);\n\n return createElement(WrappedComponent, _extends({}, props, {\n measureRef: this._handleRef,\n measure: this.measure,\n contentRect: this.state.contentRect\n }));\n };\n\n return WithContentRect;\n }(Component), _class.propTypes = {\n client: PropTypes.bool,\n offset: PropTypes.bool,\n scroll: PropTypes.bool,\n bounds: PropTypes.bool,\n margin: PropTypes.bool,\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n onResize: PropTypes.func\n }, _temp;\n };\n}\n\nvar Measure = withContentRect()(function (_ref) {\n var measure = _ref.measure,\n measureRef = _ref.measureRef,\n contentRect = _ref.contentRect,\n children = _ref.children;\n return children({\n measure: measure,\n measureRef: measureRef,\n contentRect: contentRect\n });\n});\nMeasure.displayName = 'Measure';\nMeasure.propTypes.children = PropTypes.func;\n\nexport default Measure;\nexport { withContentRect };\n"],"sourceRoot":""}