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gB,EAAC,IAASA,IAAAA,SACtDvC,eAAgBuC,IAAAA,KAChBnE,MAAOmE,IAAAA,OACP5F,WAAY4F,IAAAA,MAEhBzH,EAAS0H,aAAe,CACpBtE,SAAU,GACV/B,SAAU,SACV4D,MAAO,EACPC,gBAAgB,EAChB5B,MAAO,GAEX,K","sources":["../node_modules/react-truncate/lib/Truncate.js"],"sourcesContent":["var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nvar Truncate = function (_Component) {\n _inherits(Truncate, _Component);\n\n function Truncate() {\n var _ref;\n\n _classCallCheck(this, Truncate);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var _this = _possibleConstructorReturn(this, (_ref = Truncate.__proto__ || Object.getPrototypeOf(Truncate)).call.apply(_ref, [this].concat(args)));\n\n _this.state = {};\n _this.styles = {\n ellipsis: {\n position: 'fixed',\n visibility: 'hidden',\n top: 0,\n left: 0\n }\n };\n\n\n _this.elements = {};\n\n _this.onResize = _this.onResize.bind(_this);\n _this.onTruncate = _this.onTruncate.bind(_this);\n _this.calcTargetWidth = _this.calcTargetWidth.bind(_this);\n _this.measureWidth = _this.measureWidth.bind(_this);\n _this.getLines = _this.getLines.bind(_this);\n _this.renderLine = _this.renderLine.bind(_this);\n return _this;\n }\n\n _createClass(Truncate, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var text = this.elements.text,\n calcTargetWidth = this.calcTargetWidth,\n onResize = this.onResize;\n\n\n var canvas = document.createElement('canvas');\n this.canvasContext = canvas.getContext('2d');\n\n calcTargetWidth(function () {\n // Node not needed in document tree to read its content\n if (text) {\n text.parentNode.removeChild(text);\n }\n });\n\n window.addEventListener('resize', onResize);\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n // Render was based on outdated refs and needs to be rerun\n if (this.props.children !== prevProps.children) {\n this.forceUpdate();\n }\n\n // If the width prop has changed, recalculate size of contents\n if (this.props.width !== prevProps.width) {\n this.calcTargetWidth();\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n var ellipsis = this.elements.ellipsis,\n onResize = this.onResize,\n timeout = this.timeout;\n\n\n ellipsis.parentNode.removeChild(ellipsis);\n\n window.removeEventListener('resize', onResize);\n\n window.cancelAnimationFrame(timeout);\n }\n\n // Shim innerText to consistently break lines at <br/> but not at \\n\n\n }, {\n key: 'innerText',\n value: function innerText(node) {\n var div = document.createElement('div');\n var contentKey = 'innerText' in window.HTMLElement.prototype ? 'innerText' : 'textContent';\n\n div.innerHTML = node.innerHTML.replace(/\\r\\n|\\r|\\n/g, ' ');\n\n var text = div[contentKey];\n\n var test = document.createElement('div');\n test.innerHTML = 'foo<br/>bar';\n\n if (test[contentKey].replace(/\\r\\n|\\r/g, '\\n') !== 'foo\\nbar') {\n div.innerHTML = div.innerHTML.replace(/<br.*?[\\/]?>/gi, '\\n');\n text = div[contentKey];\n }\n\n return text;\n }\n }, {\n key: 'onResize',\n value: function onResize() {\n this.calcTargetWidth();\n }\n }, {\n key: 'onTruncate',\n value: function onTruncate(didTruncate) {\n var onTruncate = this.props.onTruncate;\n\n\n if (typeof onTruncate === 'function') {\n this.timeout = window.requestAnimationFrame(function () {\n onTruncate(didTruncate);\n });\n }\n }\n }, {\n key: 'calcTargetWidth',\n value: function calcTargetWidth(callback) {\n var target = this.elements.target,\n calcTargetWidth = this.calcTargetWidth,\n canvasContext = this.canvasContext,\n width = this.props.width;\n\n // Calculation is no longer relevant, since node has been removed\n\n if (!target) {\n return;\n }\n\n var targetWidth = width ||\n // Floor the result to deal with browser subpixel precision\n Math.floor(target.parentNode.getBoundingClientRect().width);\n\n // Delay calculation until parent node is inserted to the document\n // Mounting order in React is ChildComponent, ParentComponent\n if (!targetWidth) {\n return window.requestAnimationFrame(function () {\n return calcTargetWidth(callback);\n });\n }\n\n var style = window.getComputedStyle(target);\n\n var font = [style['font-weight'], style['font-style'], style['font-size'], style['font-family']].join(' ');\n\n canvasContext.font = font;\n\n this.setState({\n targetWidth: targetWidth\n }, callback);\n }\n }, {\n key: 'measureWidth',\n value: function measureWidth(text) {\n return this.canvasContext.measureText(text).width;\n }\n }, {\n key: 'ellipsisWidth',\n value: function ellipsisWidth(node) {\n return node.offsetWidth;\n }\n }, {\n key: 'trimRight',\n value: function trimRight(text) {\n return text.replace(/\\s+$/, '');\n }\n }, {\n key: 'getLines',\n value: function getLines() {\n var elements = this.elements,\n _props = this.props,\n numLines = _props.lines,\n ellipsis = _props.ellipsis,\n trimWhitespace = _props.trimWhitespace,\n targetWidth = this.state.targetWidth,\n innerText = this.innerText,\n measureWidth = this.measureWidth,\n onTruncate = this.onTruncate,\n trimRight = this.trimRight;\n\n\n var lines = [];\n var text = innerText(elements.text);\n var textLines = text.split('\\n').map(function (line) {\n return line.split(' ');\n });\n var didTruncate = true;\n var ellipsisWidth = this.ellipsisWidth(this.elements.ellipsis);\n\n for (var line = 1; line <= numLines; line++) {\n var textWords = textLines[0];\n\n // Handle newline\n if (textWords.length === 0) {\n lines.push();\n textLines.shift();\n line--;\n continue;\n }\n\n var resultLine = textWords.join(' ');\n\n if (measureWidth(resultLine) <= targetWidth) {\n if (textLines.length === 1) {\n // Line is end of text and fits without truncating\n didTruncate = false;\n\n lines.push(resultLine);\n break;\n }\n }\n\n if (line === numLines) {\n // Binary search determining the longest possible line inluding truncate string\n var textRest = textWords.join(' ');\n\n var lower = 0;\n var upper = textRest.length - 1;\n\n while (lower <= upper) {\n var middle = Math.floor((lower + upper) / 2);\n\n var testLine = textRest.slice(0, middle + 1);\n\n if (measureWidth(testLine) + ellipsisWidth <= targetWidth) {\n lower = middle + 1;\n } else {\n upper = middle - 1;\n }\n }\n\n var lastLineText = textRest.slice(0, lower);\n\n if (trimWhitespace) {\n lastLineText = trimRight(lastLineText);\n\n // Remove blank lines from the end of text\n while (!lastLineText.length && lines.length) {\n var prevLine = lines.pop();\n\n lastLineText = trimRight(prevLine);\n }\n }\n\n resultLine = React.createElement(\n 'span',\n null,\n lastLineText,\n ellipsis\n );\n } else {\n // Binary search determining when the line breaks\n var _lower = 0;\n var _upper = textWords.length - 1;\n\n while (_lower <= _upper) {\n var _middle = Math.floor((_lower + _upper) / 2);\n\n var _testLine = textWords.slice(0, _middle + 1).join(' ');\n\n if (measureWidth(_testLine) <= targetWidth) {\n _lower = _middle + 1;\n } else {\n _upper = _middle - 1;\n }\n }\n\n // The first word of this line is too long to fit it\n if (_lower === 0) {\n // Jump to processing of last line\n line = numLines - 1;\n continue;\n }\n\n resultLine = textWords.slice(0, _lower).join(' ');\n textLines[0].splice(0, _lower);\n }\n\n lines.push(resultLine);\n }\n\n onTruncate(didTruncate);\n\n return lines;\n }\n }, {\n key: 'renderLine',\n value: function renderLine(line, i, arr) {\n if (i === arr.length - 1) {\n return React.createElement(\n 'span',\n { key: i },\n line\n );\n } else {\n var br = React.createElement('br', { key: i + 'br' });\n\n if (line) {\n return [React.createElement(\n 'span',\n { key: i },\n line\n ), br];\n } else {\n return br;\n }\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var target = this.elements.target,\n _props2 = this.props,\n children = _props2.children,\n ellipsis = _props2.ellipsis,\n lines = _props2.lines,\n spanProps = _objectWithoutProperties(_props2, ['children', 'ellipsis', 'lines']),\n targetWidth = this.state.targetWidth,\n getLines = this.getLines,\n renderLine = this.renderLine,\n onTruncate = this.onTruncate;\n\n var text = void 0;\n\n var mounted = !!(target && targetWidth);\n\n if (typeof window !== 'undefined' && mounted) {\n if (lines > 0) {\n text = getLines().map(renderLine);\n } else {\n text = children;\n\n onTruncate(false);\n }\n }\n\n delete spanProps.onTruncate;\n delete spanProps.trimWhitespace;\n\n return React.createElement(\n 'span',\n _extends({}, spanProps, { ref: function ref(targetEl) {\n _this2.elements.target = targetEl;\n } }),\n React.createElement(\n 'span',\n null,\n text\n ),\n React.createElement(\n 'span',\n { ref: function ref(textEl) {\n _this2.elements.text = textEl;\n } },\n children\n ),\n React.createElement(\n 'span',\n { ref: function ref(ellipsisEl) {\n _this2.elements.ellipsis = ellipsisEl;\n }, style: this.styles.ellipsis },\n ellipsis\n )\n );\n }\n }]);\n\n return Truncate;\n}(Component);\n\nTruncate.propTypes = {\n children: PropTypes.node,\n ellipsis: PropTypes.node,\n lines: PropTypes.oneOfType([PropTypes.oneOf([false]), PropTypes.number]),\n trimWhitespace: PropTypes.bool,\n width: PropTypes.number,\n onTruncate: PropTypes.func\n};\nTruncate.defaultProps = {\n children: '',\n ellipsis: '…',\n lines: 1,\n trimWhitespace: false,\n width: 0\n};\nexport default Truncate;\n;\n"],"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","_createClass","defineProperties","props","descriptor","enumerable","configurable","writable","defineProperty","Constructor","protoProps","staticProps","Truncate","_Component","_ref","instance","TypeError","_classCallCheck","this","_len","args","Array","_key","_this","self","ReferenceError","_possibleConstructorReturn","__proto__","getPrototypeOf","apply","concat","state","styles","ellipsis","position","visibility","top","left","elements","onResize","bind","onTruncate","calcTargetWidth","measureWidth","getLines","renderLine","subClass","superClass","create","constructor","value","setPrototypeOf","_inherits","text","canvas","document","createElement","canvasContext","getContext","parentNode","removeChild","window","addEventListener","prevProps","children","forceUpdate","width","timeout","removeEventListener","cancelAnimationFrame","node","div","contentKey","HTMLElement","innerHTML","replace","test","didTruncate","requestAnimationFrame","callback","targetWidth","Math","floor","getBoundingClientRect","style","getComputedStyle","font","join","setState","measureText","offsetWidth","_props","numLines","lines","trimWhitespace","innerText","trimRight","textLines","split","map","line","ellipsisWidth","textWords","resultLine","push","textRest","lower","upper","middle","slice","lastLineText","pop","React","_lower","_upper","_middle","splice","shift","arr","br","_this2","_props2","spanProps","obj","keys","indexOf","_objectWithoutProperties","ref","targetEl","textEl","ellipsisEl","Component","propTypes","PropTypes","defaultProps"],"sourceRoot":""}