diff --git a/demo/bundle.js b/demo/bundle.js index e471a636..c73bcd46 100644 --- a/demo/bundle.js +++ b/demo/bundle.js @@ -284,7 +284,7 @@ if (document.getElementById('subcomponent-example')) (0, _reactDom.render)(_reac if (document.getElementById('inline-style-example')) (0, _reactDom.render)(_react2.default.createElement(InlineStyleExample, null), document.getElementById('inline-style-example')); if (document.getElementById('snap-to-position-example')) (0, _reactDom.render)(_react2.default.createElement(SnapToPositionExample, null), document.getElementById('snap-to-position-example')); -},{"../lib/SplitPane":4,"react":221,"react-dom":68}],2:[function(require,module,exports){ +},{"../lib/SplitPane":4,"react":227,"react-dom":74}],2:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -317,6 +317,10 @@ var _react = require('react'); var _react2 = _interopRequireDefault(_react); +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + var _inlineStylePrefixer = require('inline-style-prefixer'); var _inlineStylePrefixer2 = _interopRequireDefault(_inlineStylePrefixer); @@ -398,11 +402,11 @@ var Pane = function (_React$Component) { }(_react2.default.Component); Pane.propTypes = { - className: _react2.default.PropTypes.string.isRequired, - children: _react2.default.PropTypes.node.isRequired, - prefixer: _react2.default.PropTypes.instanceOf(_inlineStylePrefixer2.default).isRequired, - size: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.number]), - split: _react2.default.PropTypes.oneOf(['vertical', 'horizontal']), + className: _propTypes2.default.string.isRequired, + children: _propTypes2.default.node.isRequired, + prefixer: _propTypes2.default.instanceOf(_inlineStylePrefixer2.default).isRequired, + size: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), + split: _propTypes2.default.oneOf(['vertical', 'horizontal']), style: _reactStyleProptype2.default }; @@ -413,7 +417,7 @@ Pane.defaultProps = { exports.default = Pane; module.exports = exports['default']; -},{"inline-style-prefixer":34,"react":221,"react-style-proptype":196}],3:[function(require,module,exports){ +},{"inline-style-prefixer":34,"prop-types":72,"react":227,"react-style-proptype":201}],3:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -436,6 +440,10 @@ var _react = require('react'); var _react2 = _interopRequireDefault(_react); +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + var _inlineStylePrefixer = require('inline-style-prefixer'); var _inlineStylePrefixer2 = _interopRequireDefault(_inlineStylePrefixer); @@ -507,9 +515,8 @@ var Resizer = function (_React$Component) { onTouchEnd: function onTouchEnd(event) { event.preventDefault(); _onTouchEnd(event); - } - // eslint-disable-next-line no-static-element-interactions - , onClick: function onClick(event) { + }, + onClick: function onClick(event) { if (_onClick) { event.preventDefault(); _onClick(event); @@ -529,16 +536,16 @@ var Resizer = function (_React$Component) { }(_react2.default.Component); Resizer.propTypes = { - className: _react2.default.PropTypes.string.isRequired, - onClick: _react2.default.PropTypes.func, - onDoubleClick: _react2.default.PropTypes.func, - onMouseDown: _react2.default.PropTypes.func.isRequired, - onTouchStart: _react2.default.PropTypes.func.isRequired, - onTouchEnd: _react2.default.PropTypes.func.isRequired, - prefixer: _react2.default.PropTypes.instanceOf(_inlineStylePrefixer2.default).isRequired, - split: _react2.default.PropTypes.oneOf(['vertical', 'horizontal']), + className: _propTypes2.default.string.isRequired, + onClick: _propTypes2.default.func, + onDoubleClick: _propTypes2.default.func, + onMouseDown: _propTypes2.default.func.isRequired, + onTouchStart: _propTypes2.default.func.isRequired, + onTouchEnd: _propTypes2.default.func.isRequired, + prefixer: _propTypes2.default.instanceOf(_inlineStylePrefixer2.default).isRequired, + split: _propTypes2.default.oneOf(['vertical', 'horizontal']), style: _reactStyleProptype2.default, - resizerClassName: _react2.default.PropTypes.string.isRequired + resizerClassName: _propTypes2.default.string.isRequired }; Resizer.defaultProps = { @@ -549,7 +556,7 @@ Resizer.defaultProps = { exports.default = Resizer; module.exports = exports['default']; -},{"inline-style-prefixer":34,"react":221,"react-style-proptype":196}],4:[function(require,module,exports){ +},{"inline-style-prefixer":34,"prop-types":72,"react":227,"react-style-proptype":201}],4:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; @@ -582,6 +589,10 @@ var _react = require('react'); var _react2 = _interopRequireDefault(_react); +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + var _reactDom = require('react-dom'); var _reactDom2 = _interopRequireDefault(_reactDom); @@ -908,28 +919,28 @@ var SplitPane = function (_React$Component) { }(_react2.default.Component); SplitPane.propTypes = { - allowResize: _react2.default.PropTypes.bool, - children: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.node).isRequired, - className: _react2.default.PropTypes.string, - primary: _react2.default.PropTypes.oneOf(['first', 'second']), - minSize: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.number]), - maxSize: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.number]), + allowResize: _propTypes2.default.bool, + children: _propTypes2.default.arrayOf(_propTypes2.default.node).isRequired, + className: _propTypes2.default.string, + primary: _propTypes2.default.oneOf(['first', 'second']), + minSize: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), + maxSize: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), // eslint-disable-next-line react/no-unused-prop-types - defaultSize: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.number]), - size: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.number]), - split: _react2.default.PropTypes.oneOf(['vertical', 'horizontal']), - onDragStarted: _react2.default.PropTypes.func, - onDragFinished: _react2.default.PropTypes.func, - onChange: _react2.default.PropTypes.func, - onResizerClick: _react2.default.PropTypes.func, - onResizerDoubleClick: _react2.default.PropTypes.func, - prefixer: _react2.default.PropTypes.instanceOf(_inlineStylePrefixer2.default).isRequired, + defaultSize: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), + size: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), + split: _propTypes2.default.oneOf(['vertical', 'horizontal']), + onDragStarted: _propTypes2.default.func, + onDragFinished: _propTypes2.default.func, + onChange: _propTypes2.default.func, + onResizerClick: _propTypes2.default.func, + onResizerDoubleClick: _propTypes2.default.func, + prefixer: _propTypes2.default.instanceOf(_inlineStylePrefixer2.default).isRequired, style: _reactStyleProptype2.default, resizerStyle: _reactStyleProptype2.default, paneStyle: _reactStyleProptype2.default, pane1Style: _reactStyleProptype2.default, pane2Style: _reactStyleProptype2.default, - resizerClassName: _react2.default.PropTypes.string + resizerClassName: _propTypes2.default.string }; SplitPane.defaultProps = { @@ -943,7 +954,7 @@ SplitPane.defaultProps = { exports.default = SplitPane; module.exports = exports['default']; -},{"./Pane":2,"./Resizer":3,"inline-style-prefixer":34,"react":221,"react-dom":68,"react-style-proptype":196}],5:[function(require,module,exports){ +},{"./Pane":2,"./Resizer":3,"inline-style-prefixer":34,"prop-types":72,"react":227,"react-dom":74,"react-style-proptype":201}],5:[function(require,module,exports){ /*! * Bowser - a browser detector * https://github.com/ded/bowser @@ -1554,7 +1565,7 @@ exports.default = isPrefixedValue; var regex = /-webkit-|-moz-|-ms-/; function isPrefixedValue(value) { - return typeof value === 'string' && value.match(regex) !== null; + return typeof value === 'string' && regex.test(value); } module.exports = exports['default']; },{}],8:[function(require,module,exports){ @@ -2120,15 +2131,19 @@ module.exports = focusNode; * * The activeElement will be null only if the document or document body is not * yet defined. + * + * @param {?DOMDocument} doc Defaults to current document. + * @return {?DOMElement} */ -function getActiveElement() /*?DOMElement*/{ - if (typeof document === 'undefined') { +function getActiveElement(doc) /*?DOMElement*/{ + doc = doc || (typeof document !== 'undefined' ? document : undefined); + if (typeof doc === 'undefined') { return null; } try { - return document.activeElement || document.body; + return doc.activeElement || doc.body; } catch (e) { - return document.body; + return doc.body; } } @@ -2257,10 +2272,10 @@ module.exports = getMarkupWrap; */ function getUnboundedScrollPosition(scrollable) { - if (scrollable === window) { + if (scrollable.Window && scrollable instanceof scrollable.Window) { return { - x: window.pageXOffset || document.documentElement.scrollLeft, - y: window.pageYOffset || document.documentElement.scrollTop + x: scrollable.pageXOffset || scrollable.document.documentElement.scrollLeft, + y: scrollable.pageYOffset || scrollable.document.documentElement.scrollTop }; } return { @@ -2420,7 +2435,9 @@ module.exports = invariant; * @return {boolean} Whether or not the object is a DOM node. */ function isNode(object) { - return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string')); + var doc = object ? object.ownerDocument || object : document; + var defaultView = doc.defaultView || window; + return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string')); } module.exports = isNode; @@ -2839,7 +2856,7 @@ function createPrefixer(_ref) { } // add prefixes to properties - if (this._requiresPrefix[property]) { + if (this._requiresPrefix.hasOwnProperty(property)) { style[this._browserInfo.jsPrefix + (0, _capitalizeString2.default)(property)] = value; if (!this._keepUnprefixed) { delete style[property]; @@ -3130,10 +3147,10 @@ function flexboxOld(property, value, style, _ref) { style.WebkitBoxDirection = 'normal'; } } - if (property === 'display' && alternativeValues[value]) { + if (property === 'display' && alternativeValues.hasOwnProperty(value)) { return (0, _getPrefixedValue2.default)(cssPrefix + alternativeValues[value], value, keepUnprefixed); } - if (alternativeProps[property]) { + if (alternativeProps.hasOwnProperty(property)) { style[alternativeProps[property]] = alternativeValues[value] || value; } } @@ -3160,7 +3177,7 @@ function gradient(property, value, style, _ref) { cssPrefix = _ref.cssPrefix, keepUnprefixed = _ref.keepUnprefixed; - if (typeof value === 'string' && value.match(values) !== null && (browserName === 'firefox' && browserVersion < 16 || browserName === 'chrome' && browserVersion < 26 || (browserName === 'safari' || browserName === 'ios_saf') && browserVersion < 7 || (browserName === 'opera' || browserName === 'op_mini') && browserVersion < 12.1 || browserName === 'android' && browserVersion < 4.4 || browserName === 'and_uc')) { + if (typeof value === 'string' && values.test(value) && (browserName === 'firefox' && browserVersion < 16 || browserName === 'chrome' && browserVersion < 26 || (browserName === 'safari' || browserName === 'ios_saf') && browserVersion < 7 || (browserName === 'opera' || browserName === 'op_mini') && browserVersion < 12.1 || browserName === 'android' && browserVersion < 4.4 || browserName === 'and_uc')) { return (0, _getPrefixedValue2.default)(cssPrefix + value, value, keepUnprefixed); } } @@ -3252,7 +3269,7 @@ function sizing(property, value, style, _ref) { // This might change in the future // Keep an eye on it - if (properties[property] && values[value]) { + if (properties.hasOwnProperty(property) && values.hasOwnProperty(value)) { return (0, _getPrefixedValue2.default)(cssPrefix + value, value, keepUnprefixed); } } @@ -3290,7 +3307,7 @@ function transition(property, value, style, _ref) { keepUnprefixed = _ref.keepUnprefixed, requiresPrefix = _ref.requiresPrefix; - if (typeof value === 'string' && properties[property]) { + if (typeof value === 'string' && properties.hasOwnProperty(property)) { var _ret = function () { // memoize the prefix array for later use if (!requiresPrefixDashCased) { @@ -3494,7 +3511,7 @@ var values = { }; function cursor(property, value) { - if (property === 'cursor' && values[value]) { + if (property === 'cursor' && values.hasOwnProperty(value)) { return prefixes.map(function (prefix) { return prefix + value; }); @@ -3538,7 +3555,7 @@ var values = { }; function flex(property, value) { - if (property === 'display' && values[value]) { + if (property === 'display' && values.hasOwnProperty(value)) { return ['-webkit-box', '-moz-box', '-ms-' + value + 'box', '-webkit-' + value, value]; } } @@ -3578,7 +3595,7 @@ function flexboxOld(property, value, style) { style.WebkitBoxDirection = 'normal'; } } - if (alternativeProps[property]) { + if (alternativeProps.hasOwnProperty(property)) { style[alternativeProps[property]] = alternativeValues[value] || value; } } @@ -3602,7 +3619,7 @@ var prefixes = ['-webkit-', '-moz-', '']; var values = /linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/; function gradient(property, value) { - if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && value.match(values) !== null) { + if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && values.test(value)) { return prefixes.map(function (prefix) { return prefix + value; }); @@ -3673,7 +3690,7 @@ var values = { }; function sizing(property, value) { - if (properties[property] && values[value]) { + if (properties.hasOwnProperty(property) && values.hasOwnProperty(value)) { return prefixes.map(function (prefix) { return prefix + value; }); @@ -3749,11 +3766,11 @@ function prefixValue(value, propertyPrefixMap) { function transition(property, value, style, propertyPrefixMap) { // also check for already prefixed transitions - if (typeof value === 'string' && properties[property]) { + if (typeof value === 'string' && properties.hasOwnProperty(property)) { var outputValue = prefixValue(value, propertyPrefixMap); // if the property is already prefixed var webkitOutput = outputValue.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function (val) { - return val.match(/-moz-|-ms-/) === null; + return !/-moz-|-ms-/.test(val); }).join(','); if (property.indexOf('Webkit') > -1) { @@ -3761,7 +3778,7 @@ function transition(property, value, style, propertyPrefixMap) { } var mozOutput = outputValue.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function (val) { - return val.match(/-webkit-|-ms-/) === null; + return !/-webkit-|-ms-/.test(val); }).join(','); if (property.indexOf('Moz') > -1) { @@ -3881,7 +3898,7 @@ function getBrowserName(browserInfo) { } for (var browser in browserByCanIuseAlias) { - if (browserInfo[browser]) { + if (browserInfo.hasOwnProperty(browser)) { return browserByCanIuseAlias[browser]; } } @@ -3896,7 +3913,7 @@ function getBrowserInformation(userAgent) { var browserInfo = _bowser2.default._detect(userAgent); for (var browser in prefixByBrowser) { - if (browserInfo[browser]) { + if (browserInfo.hasOwnProperty(browser)) { var prefix = prefixByBrowser[browser]; browserInfo.jsPrefix = prefix; @@ -4003,9 +4020,8 @@ var _capitalizeString2 = _interopRequireDefault(_capitalizeString); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function prefixProperty(prefixProperties, property, style) { - var requiredPrefixes = prefixProperties[property]; - - if (requiredPrefixes) { + if (prefixProperties.hasOwnProperty(property)) { + var requiredPrefixes = prefixProperties[property]; for (var i = 0, len = requiredPrefixes.length; i < len; ++i) { style[requiredPrefixes[i] + (0, _capitalizeString2.default)(property)] = style[property]; } @@ -4306,11 +4322,690 @@ process.chdir = function (dir) { process.umask = function() { return 0; }; },{}],68:[function(require,module,exports){ +(function (process){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +if (process.env.NODE_ENV !== 'production') { + var invariant = require('fbjs/lib/invariant'); + var warning = require('fbjs/lib/warning'); + var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); + var loggedTypeFailures = {}; +} + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== 'production') { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName); + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); + } + } + } + } +} + +module.exports = checkPropTypes; + +}).call(this,require('_process')) + +},{"./lib/ReactPropTypesSecret":73,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30}],69:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +// React 15.5 references this module, and assumes PropTypes are still callable in production. +// Therefore we re-export development-only version with all the PropTypes checks here. +// However if one is migrating to the `prop-types` npm library, they will go through the +// `index.js` entry point, and it will branch depending on the environment. +var factory = require('./factoryWithTypeCheckers'); +module.exports = function(isValidElement) { + // It is still allowed in 15.5. + var throwOnDirectAccess = false; + return factory(isValidElement, throwOnDirectAccess); +}; + +},{"./factoryWithTypeCheckers":71}],70:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +var emptyFunction = require('fbjs/lib/emptyFunction'); +var invariant = require('fbjs/lib/invariant'); + +module.exports = function() { + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + function shim() { + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use PropTypes.checkPropTypes() to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim + }; + + ReactPropTypes.checkPropTypes = emptyFunction; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + +},{"fbjs/lib/emptyFunction":15,"fbjs/lib/invariant":23}],71:[function(require,module,exports){ +(function (process){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +var emptyFunction = require('fbjs/lib/emptyFunction'); +var invariant = require('fbjs/lib/invariant'); +var warning = require('fbjs/lib/warning'); + +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); +var checkPropTypes = require('./checkPropTypes'); + +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== 'production') { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + warning( + false, + 'You are manually calling a React.PropTypes validation ' + + 'function for the `%s` prop on `%s`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', + propFullName, + componentName + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunction.thatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + +}).call(this,require('_process')) + +},{"./checkPropTypes":68,"./lib/ReactPropTypesSecret":73,"_process":67,"fbjs/lib/emptyFunction":15,"fbjs/lib/invariant":23,"fbjs/lib/warning":30}],72:[function(require,module,exports){ +(function (process){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +if (process.env.NODE_ENV !== 'production') { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess); +} else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = require('./factoryWithThrowingShims')(); +} + +}).call(this,require('_process')) + +},{"./factoryWithThrowingShims":70,"./factoryWithTypeCheckers":71,"_process":67}],73:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + +},{}],74:[function(require,module,exports){ 'use strict'; module.exports = require('./lib/ReactDOM'); -},{"./lib/ReactDOM":98}],69:[function(require,module,exports){ +},{"./lib/ReactDOM":104}],75:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -4384,7 +5079,7 @@ var ARIADOMPropertyConfig = { }; module.exports = ARIADOMPropertyConfig; -},{}],70:[function(require,module,exports){ +},{}],76:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -4408,7 +5103,7 @@ var AutoFocusUtils = { }; module.exports = AutoFocusUtils; -},{"./ReactDOMComponentTree":101,"fbjs/lib/focusNode":17}],71:[function(require,module,exports){ +},{"./ReactDOMComponentTree":107,"fbjs/lib/focusNode":17}],77:[function(require,module,exports){ /** * Copyright 2013-present Facebook, Inc. * All rights reserved. @@ -4793,7 +5488,7 @@ var BeforeInputEventPlugin = { }; module.exports = BeforeInputEventPlugin; -},{"./EventPropagators":87,"./FallbackCompositionState":88,"./SyntheticCompositionEvent":152,"./SyntheticInputEvent":156,"fbjs/lib/ExecutionEnvironment":9}],72:[function(require,module,exports){ +},{"./EventPropagators":93,"./FallbackCompositionState":94,"./SyntheticCompositionEvent":158,"./SyntheticInputEvent":162,"fbjs/lib/ExecutionEnvironment":9}],78:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -4941,7 +5636,7 @@ var CSSProperty = { }; module.exports = CSSProperty; -},{}],73:[function(require,module,exports){ +},{}],79:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -5153,7 +5848,7 @@ var CSSPropertyOperations = { module.exports = CSSPropertyOperations; }).call(this,require('_process')) -},{"./CSSProperty":72,"./ReactInstrumentation":130,"./dangerousStyleValue":169,"_process":67,"fbjs/lib/ExecutionEnvironment":9,"fbjs/lib/camelizeStyleName":11,"fbjs/lib/hyphenateStyleName":22,"fbjs/lib/memoizeStringOnly":26,"fbjs/lib/warning":30}],74:[function(require,module,exports){ +},{"./CSSProperty":78,"./ReactInstrumentation":136,"./dangerousStyleValue":175,"_process":67,"fbjs/lib/ExecutionEnvironment":9,"fbjs/lib/camelizeStyleName":11,"fbjs/lib/hyphenateStyleName":22,"fbjs/lib/memoizeStringOnly":26,"fbjs/lib/warning":30}],80:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -5275,7 +5970,7 @@ var CallbackQueue = function () { module.exports = PooledClass.addPoolingTo(CallbackQueue); }).call(this,require('_process')) -},{"./PooledClass":92,"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23}],75:[function(require,module,exports){ +},{"./PooledClass":98,"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23}],81:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -5543,6 +6238,26 @@ function getTargetInstForClickEvent(topLevelType, targetInst) { } } +function handleControlledInputBlur(inst, node) { + // TODO: In IE, inst is occasionally null. Why? + if (inst == null) { + return; + } + + // Fiber and ReactDOM keep wrapper state in separate places + var state = inst._wrapperState || node._wrapperState; + + if (!state || !state.controlled || node.type !== 'number') { + return; + } + + // If controlled, assign the value attribute to the current value on blur + var value = '' + node.value; + if (node.getAttribute('value') !== value) { + node.setAttribute('value', value); + } +} + /** * This plugin creates an `onChange` event that normalizes change events * across form elements. This event fires at a time when it's possible to @@ -5591,12 +6306,17 @@ var ChangeEventPlugin = { if (handleEventFunc) { handleEventFunc(topLevelType, targetNode, targetInst); } + + // When blurring, set the value attribute for number inputs + if (topLevelType === 'topBlur') { + handleControlledInputBlur(targetInst, targetNode); + } } }; module.exports = ChangeEventPlugin; -},{"./EventPluginHub":84,"./EventPropagators":87,"./ReactDOMComponentTree":101,"./ReactUpdates":145,"./SyntheticEvent":154,"./getEventTarget":177,"./isEventSupported":185,"./isTextInputElement":186,"fbjs/lib/ExecutionEnvironment":9}],76:[function(require,module,exports){ +},{"./EventPluginHub":90,"./EventPropagators":93,"./ReactDOMComponentTree":107,"./ReactUpdates":151,"./SyntheticEvent":160,"./getEventTarget":183,"./isEventSupported":190,"./isTextInputElement":191,"fbjs/lib/ExecutionEnvironment":9}],82:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -5824,7 +6544,7 @@ var DOMChildrenOperations = { module.exports = DOMChildrenOperations; }).call(this,require('_process')) -},{"./DOMLazyTree":77,"./Danger":81,"./ReactDOMComponentTree":101,"./ReactInstrumentation":130,"./createMicrosoftUnsafeLocalFunction":168,"./setInnerHTML":190,"./setTextContent":191,"_process":67}],77:[function(require,module,exports){ +},{"./DOMLazyTree":83,"./Danger":87,"./ReactDOMComponentTree":107,"./ReactInstrumentation":136,"./createMicrosoftUnsafeLocalFunction":174,"./setInnerHTML":195,"./setTextContent":196,"_process":67}],83:[function(require,module,exports){ /** * Copyright 2015-present, Facebook, Inc. * All rights reserved. @@ -5942,7 +6662,7 @@ DOMLazyTree.queueHTML = queueHTML; DOMLazyTree.queueText = queueText; module.exports = DOMLazyTree; -},{"./DOMNamespaces":78,"./createMicrosoftUnsafeLocalFunction":168,"./setInnerHTML":190,"./setTextContent":191}],78:[function(require,module,exports){ +},{"./DOMNamespaces":84,"./createMicrosoftUnsafeLocalFunction":174,"./setInnerHTML":195,"./setTextContent":196}],84:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -5962,7 +6682,7 @@ var DOMNamespaces = { }; module.exports = DOMNamespaces; -},{}],79:[function(require,module,exports){ +},{}],85:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -6175,7 +6895,7 @@ var DOMProperty = { module.exports = DOMProperty; }).call(this,require('_process')) -},{"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23}],80:[function(require,module,exports){ +},{"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23}],86:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -6415,7 +7135,7 @@ var DOMPropertyOperations = { module.exports = DOMPropertyOperations; }).call(this,require('_process')) -},{"./DOMProperty":79,"./ReactDOMComponentTree":101,"./ReactInstrumentation":130,"./quoteAttributeValueForBrowser":187,"_process":67,"fbjs/lib/warning":30}],81:[function(require,module,exports){ +},{"./DOMProperty":85,"./ReactDOMComponentTree":107,"./ReactInstrumentation":136,"./quoteAttributeValueForBrowser":192,"_process":67,"fbjs/lib/warning":30}],87:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -6466,7 +7186,7 @@ var Danger = { module.exports = Danger; }).call(this,require('_process')) -},{"./DOMLazyTree":77,"./reactProdInvariant":188,"_process":67,"fbjs/lib/ExecutionEnvironment":9,"fbjs/lib/createNodesFromMarkup":14,"fbjs/lib/emptyFunction":15,"fbjs/lib/invariant":23}],82:[function(require,module,exports){ +},{"./DOMLazyTree":83,"./reactProdInvariant":193,"_process":67,"fbjs/lib/ExecutionEnvironment":9,"fbjs/lib/createNodesFromMarkup":14,"fbjs/lib/emptyFunction":15,"fbjs/lib/invariant":23}],88:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -6492,7 +7212,7 @@ module.exports = Danger; var DefaultEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin']; module.exports = DefaultEventPluginOrder; -},{}],83:[function(require,module,exports){ +},{}],89:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -6592,7 +7312,7 @@ var EnterLeaveEventPlugin = { }; module.exports = EnterLeaveEventPlugin; -},{"./EventPropagators":87,"./ReactDOMComponentTree":101,"./SyntheticMouseEvent":158}],84:[function(require,module,exports){ +},{"./EventPropagators":93,"./ReactDOMComponentTree":107,"./SyntheticMouseEvent":164}],90:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -6873,7 +7593,7 @@ var EventPluginHub = { module.exports = EventPluginHub; }).call(this,require('_process')) -},{"./EventPluginRegistry":85,"./EventPluginUtils":86,"./ReactErrorUtils":121,"./accumulateInto":165,"./forEachAccumulated":173,"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23}],85:[function(require,module,exports){ +},{"./EventPluginRegistry":91,"./EventPluginUtils":92,"./ReactErrorUtils":127,"./accumulateInto":171,"./forEachAccumulated":179,"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23}],91:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -7131,7 +7851,7 @@ var EventPluginRegistry = { module.exports = EventPluginRegistry; }).call(this,require('_process')) -},{"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23}],86:[function(require,module,exports){ +},{"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23}],92:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -7360,7 +8080,7 @@ var EventPluginUtils = { module.exports = EventPluginUtils; }).call(this,require('_process')) -},{"./ReactErrorUtils":121,"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30}],87:[function(require,module,exports){ +},{"./ReactErrorUtils":127,"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30}],93:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -7497,7 +8217,7 @@ var EventPropagators = { module.exports = EventPropagators; }).call(this,require('_process')) -},{"./EventPluginHub":84,"./EventPluginUtils":86,"./accumulateInto":165,"./forEachAccumulated":173,"_process":67,"fbjs/lib/warning":30}],88:[function(require,module,exports){ +},{"./EventPluginHub":90,"./EventPluginUtils":92,"./accumulateInto":171,"./forEachAccumulated":179,"_process":67,"fbjs/lib/warning":30}],94:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -7592,7 +8312,7 @@ _assign(FallbackCompositionState.prototype, { PooledClass.addPoolingTo(FallbackCompositionState); module.exports = FallbackCompositionState; -},{"./PooledClass":92,"./getTextContentAccessor":182,"object-assign":66}],89:[function(require,module,exports){ +},{"./PooledClass":98,"./getTextContentAccessor":187,"object-assign":66}],95:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -7800,11 +8520,35 @@ var HTMLDOMPropertyConfig = { htmlFor: 'for', httpEquiv: 'http-equiv' }, - DOMPropertyNames: {} + DOMPropertyNames: {}, + DOMMutationMethods: { + value: function (node, value) { + if (value == null) { + return node.removeAttribute('value'); + } + + // Number inputs get special treatment due to some edge cases in + // Chrome. Let everything else assign the value attribute as normal. + // https://github.com/facebook/react/issues/7253#issuecomment-236074326 + if (node.type !== 'number' || node.hasAttribute('value') === false) { + node.setAttribute('value', '' + value); + } else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) { + // Don't assign an attribute if validation reports bad + // input. Chrome will clear the value. Additionally, don't + // operate on inputs that have focus, otherwise Chrome might + // strip off trailing decimal places and cause the user's + // cursor position to jump to the beginning of the input. + // + // In ReactDOMInput, we have an onBlur event that will trigger + // this function again when focus is lost. + node.setAttribute('value', '' + value); + } + } + } }; module.exports = HTMLDOMPropertyConfig; -},{"./DOMProperty":79}],90:[function(require,module,exports){ +},{"./DOMProperty":85}],96:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -7863,7 +8607,7 @@ var KeyEscapeUtils = { }; module.exports = KeyEscapeUtils; -},{}],91:[function(require,module,exports){ +},{}],97:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -7879,8 +8623,11 @@ module.exports = KeyEscapeUtils; var _prodInvariant = require('./reactProdInvariant'); -var React = require('react/lib/React'); var ReactPropTypesSecret = require('./ReactPropTypesSecret'); +var propTypesFactory = require('prop-types/factory'); + +var React = require('react/lib/React'); +var PropTypes = propTypesFactory(React.isValidElement); var invariant = require('fbjs/lib/invariant'); var warning = require('fbjs/lib/warning'); @@ -7921,7 +8668,7 @@ var propTypes = { } return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); }, - onChange: React.PropTypes.func + onChange: PropTypes.func }; var loggedTypeFailures = {}; @@ -8001,7 +8748,7 @@ var LinkedValueUtils = { module.exports = LinkedValueUtils; }).call(this,require('_process')) -},{"./ReactPropTypesSecret":138,"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"react/lib/React":199}],92:[function(require,module,exports){ +},{"./ReactPropTypesSecret":144,"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"prop-types/factory":69,"react/lib/React":204}],98:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -8116,7 +8863,7 @@ var PooledClass = { module.exports = PooledClass; }).call(this,require('_process')) -},{"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23}],93:[function(require,module,exports){ +},{"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23}],99:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -8444,7 +9191,7 @@ var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { }); module.exports = ReactBrowserEventEmitter; -},{"./EventPluginRegistry":85,"./ReactEventEmitterMixin":122,"./ViewportMetrics":164,"./getVendorPrefixedEventName":183,"./isEventSupported":185,"object-assign":66}],94:[function(require,module,exports){ +},{"./EventPluginRegistry":91,"./ReactEventEmitterMixin":128,"./ViewportMetrics":170,"./getVendorPrefixedEventName":188,"./isEventSupported":190,"object-assign":66}],100:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -8601,7 +9348,7 @@ var ReactChildReconciler = { module.exports = ReactChildReconciler; }).call(this,require('_process')) -},{"./KeyEscapeUtils":90,"./ReactReconciler":140,"./instantiateReactComponent":184,"./shouldUpdateReactComponent":192,"./traverseAllChildren":193,"_process":67,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":203}],95:[function(require,module,exports){ +},{"./KeyEscapeUtils":96,"./ReactReconciler":146,"./instantiateReactComponent":189,"./shouldUpdateReactComponent":197,"./traverseAllChildren":198,"_process":67,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":208}],101:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -8631,7 +9378,7 @@ var ReactComponentBrowserEnvironment = { }; module.exports = ReactComponentBrowserEnvironment; -},{"./DOMChildrenOperations":76,"./ReactDOMIDOperations":105}],96:[function(require,module,exports){ +},{"./DOMChildrenOperations":82,"./ReactDOMIDOperations":111}],102:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -8680,7 +9427,7 @@ var ReactComponentEnvironment = { module.exports = ReactComponentEnvironment; }).call(this,require('_process')) -},{"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23}],97:[function(require,module,exports){ +},{"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23}],103:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -9198,7 +9945,7 @@ var ReactCompositeComponent = { if (childContext) { !(typeof Component.childContextTypes === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0; if (process.env.NODE_ENV !== 'production') { - this._checkContextTypes(Component.childContextTypes, childContext, 'childContext'); + this._checkContextTypes(Component.childContextTypes, childContext, 'child context'); } for (var name in childContext) { !(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : _prodInvariant('108', this.getName() || 'ReactCompositeComponent', name) : void 0; @@ -9585,7 +10332,7 @@ var ReactCompositeComponent = { module.exports = ReactCompositeComponent; }).call(this,require('_process')) -},{"./ReactComponentEnvironment":96,"./ReactErrorUtils":121,"./ReactInstanceMap":129,"./ReactInstrumentation":130,"./ReactNodeTypes":135,"./ReactReconciler":140,"./checkReactTypeSpec":167,"./reactProdInvariant":188,"./shouldUpdateReactComponent":192,"_process":67,"fbjs/lib/emptyObject":16,"fbjs/lib/invariant":23,"fbjs/lib/shallowEqual":29,"fbjs/lib/warning":30,"object-assign":66,"react/lib/React":199,"react/lib/ReactCurrentOwner":204}],98:[function(require,module,exports){ +},{"./ReactComponentEnvironment":102,"./ReactErrorUtils":127,"./ReactInstanceMap":135,"./ReactInstrumentation":136,"./ReactNodeTypes":141,"./ReactReconciler":146,"./checkReactTypeSpec":173,"./reactProdInvariant":193,"./shouldUpdateReactComponent":197,"_process":67,"fbjs/lib/emptyObject":16,"fbjs/lib/invariant":23,"fbjs/lib/shallowEqual":29,"fbjs/lib/warning":30,"object-assign":66,"react/lib/React":204,"react/lib/ReactCurrentOwner":209}],104:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -9699,7 +10446,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = ReactDOM; }).call(this,require('_process')) -},{"./ReactDOMComponentTree":101,"./ReactDOMInvalidARIAHook":107,"./ReactDOMNullInputValuePropHook":108,"./ReactDOMUnknownPropertyHook":115,"./ReactDefaultInjection":118,"./ReactInstrumentation":130,"./ReactMount":133,"./ReactReconciler":140,"./ReactUpdates":145,"./ReactVersion":146,"./findDOMNode":171,"./getHostComponentFromComposite":178,"./renderSubtreeIntoContainer":189,"_process":67,"fbjs/lib/ExecutionEnvironment":9,"fbjs/lib/warning":30}],99:[function(require,module,exports){ +},{"./ReactDOMComponentTree":107,"./ReactDOMInvalidARIAHook":113,"./ReactDOMNullInputValuePropHook":114,"./ReactDOMUnknownPropertyHook":121,"./ReactDefaultInjection":124,"./ReactInstrumentation":136,"./ReactMount":139,"./ReactReconciler":146,"./ReactUpdates":151,"./ReactVersion":152,"./findDOMNode":177,"./getHostComponentFromComposite":184,"./renderSubtreeIntoContainer":194,"_process":67,"fbjs/lib/ExecutionEnvironment":9,"fbjs/lib/warning":30}],105:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -10703,7 +11450,7 @@ _assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mi module.exports = ReactDOMComponent; }).call(this,require('_process')) -},{"./AutoFocusUtils":70,"./CSSPropertyOperations":73,"./DOMLazyTree":77,"./DOMNamespaces":78,"./DOMProperty":79,"./DOMPropertyOperations":80,"./EventPluginHub":84,"./EventPluginRegistry":85,"./ReactBrowserEventEmitter":93,"./ReactDOMComponentFlags":100,"./ReactDOMComponentTree":101,"./ReactDOMInput":106,"./ReactDOMOption":109,"./ReactDOMSelect":110,"./ReactDOMTextarea":113,"./ReactInstrumentation":130,"./ReactMultiChild":134,"./ReactServerRenderingTransaction":142,"./escapeTextContentForBrowser":170,"./isEventSupported":185,"./reactProdInvariant":188,"./validateDOMNesting":194,"_process":67,"fbjs/lib/emptyFunction":15,"fbjs/lib/invariant":23,"fbjs/lib/shallowEqual":29,"fbjs/lib/warning":30,"object-assign":66}],100:[function(require,module,exports){ +},{"./AutoFocusUtils":76,"./CSSPropertyOperations":79,"./DOMLazyTree":83,"./DOMNamespaces":84,"./DOMProperty":85,"./DOMPropertyOperations":86,"./EventPluginHub":90,"./EventPluginRegistry":91,"./ReactBrowserEventEmitter":99,"./ReactDOMComponentFlags":106,"./ReactDOMComponentTree":107,"./ReactDOMInput":112,"./ReactDOMOption":115,"./ReactDOMSelect":116,"./ReactDOMTextarea":119,"./ReactInstrumentation":136,"./ReactMultiChild":140,"./ReactServerRenderingTransaction":148,"./escapeTextContentForBrowser":176,"./isEventSupported":190,"./reactProdInvariant":193,"./validateDOMNesting":199,"_process":67,"fbjs/lib/emptyFunction":15,"fbjs/lib/invariant":23,"fbjs/lib/shallowEqual":29,"fbjs/lib/warning":30,"object-assign":66}],106:[function(require,module,exports){ /** * Copyright 2015-present, Facebook, Inc. * All rights reserved. @@ -10721,7 +11468,7 @@ var ReactDOMComponentFlags = { }; module.exports = ReactDOMComponentFlags; -},{}],101:[function(require,module,exports){ +},{}],107:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -10919,7 +11666,7 @@ var ReactDOMComponentTree = { module.exports = ReactDOMComponentTree; }).call(this,require('_process')) -},{"./DOMProperty":79,"./ReactDOMComponentFlags":100,"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23}],102:[function(require,module,exports){ +},{"./DOMProperty":85,"./ReactDOMComponentFlags":106,"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23}],108:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -10955,7 +11702,7 @@ function ReactDOMContainerInfo(topLevelWrapper, node) { module.exports = ReactDOMContainerInfo; }).call(this,require('_process')) -},{"./validateDOMNesting":194,"_process":67}],103:[function(require,module,exports){ +},{"./validateDOMNesting":199,"_process":67}],109:[function(require,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -11015,7 +11762,7 @@ _assign(ReactDOMEmptyComponent.prototype, { }); module.exports = ReactDOMEmptyComponent; -},{"./DOMLazyTree":77,"./ReactDOMComponentTree":101,"object-assign":66}],104:[function(require,module,exports){ +},{"./DOMLazyTree":83,"./ReactDOMComponentTree":107,"object-assign":66}],110:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11034,7 +11781,7 @@ var ReactDOMFeatureFlags = { }; module.exports = ReactDOMFeatureFlags; -},{}],105:[function(require,module,exports){ +},{}],111:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -11068,7 +11815,7 @@ var ReactDOMIDOperations = { }; module.exports = ReactDOMIDOperations; -},{"./DOMChildrenOperations":76,"./ReactDOMComponentTree":101}],106:[function(require,module,exports){ +},{"./DOMChildrenOperations":82,"./ReactDOMComponentTree":107}],112:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -11184,12 +11931,9 @@ var ReactDOMInput = { initialChecked: props.checked != null ? props.checked : props.defaultChecked, initialValue: props.value != null ? props.value : defaultValue, listeners: null, - onChange: _handleChange.bind(inst) + onChange: _handleChange.bind(inst), + controlled: isControlled(props) }; - - if (process.env.NODE_ENV !== 'production') { - inst._wrapperState.controlled = isControlled(props); - } }, updateWrapper: function (inst) { @@ -11218,14 +11962,24 @@ var ReactDOMInput = { var node = ReactDOMComponentTree.getNodeFromInstance(inst); var value = LinkedValueUtils.getValue(props); if (value != null) { - - // Cast `value` to a string to ensure the value is set correctly. While - // browsers typically do this as necessary, jsdom doesn't. - var newValue = '' + value; - - // To avoid side effects (such as losing text selection), only set value if changed - if (newValue !== node.value) { - node.value = newValue; + if (value === 0 && node.value === '') { + node.value = '0'; + // Note: IE9 reports a number inputs as 'text', so check props instead. + } else if (props.type === 'number') { + // Simulate `input.valueAsNumber`. IE9 does not support it + var valueAsNumber = parseFloat(node.value, 10) || 0; + + // eslint-disable-next-line + if (value != valueAsNumber) { + // Cast `value` to a string to ensure the value is set correctly. While + // browsers typically do this as necessary, jsdom doesn't. + node.value = '' + value; + } + // eslint-disable-next-line + } else if (value != node.value) { + // Cast `value` to a string to ensure the value is set correctly. While + // browsers typically do this as necessary, jsdom doesn't. + node.value = '' + value; } } else { if (props.value == null && props.defaultValue != null) { @@ -11349,7 +12103,7 @@ function _handleChange(event) { module.exports = ReactDOMInput; }).call(this,require('_process')) -},{"./DOMPropertyOperations":80,"./LinkedValueUtils":91,"./ReactDOMComponentTree":101,"./ReactUpdates":145,"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"object-assign":66}],107:[function(require,module,exports){ +},{"./DOMPropertyOperations":86,"./LinkedValueUtils":97,"./ReactDOMComponentTree":107,"./ReactUpdates":151,"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"object-assign":66}],113:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -11445,7 +12199,7 @@ var ReactDOMInvalidARIAHook = { module.exports = ReactDOMInvalidARIAHook; }).call(this,require('_process')) -},{"./DOMProperty":79,"_process":67,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":203}],108:[function(require,module,exports){ +},{"./DOMProperty":85,"_process":67,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":208}],114:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -11491,7 +12245,7 @@ var ReactDOMNullInputValuePropHook = { module.exports = ReactDOMNullInputValuePropHook; }).call(this,require('_process')) -},{"_process":67,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":203}],109:[function(require,module,exports){ +},{"_process":67,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":208}],115:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -11617,7 +12371,7 @@ var ReactDOMOption = { module.exports = ReactDOMOption; }).call(this,require('_process')) -},{"./ReactDOMComponentTree":101,"./ReactDOMSelect":110,"_process":67,"fbjs/lib/warning":30,"object-assign":66,"react/lib/React":199}],110:[function(require,module,exports){ +},{"./ReactDOMComponentTree":107,"./ReactDOMSelect":116,"_process":67,"fbjs/lib/warning":30,"object-assign":66,"react/lib/React":204}],116:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -11820,7 +12574,7 @@ function _handleChange(event) { module.exports = ReactDOMSelect; }).call(this,require('_process')) -},{"./LinkedValueUtils":91,"./ReactDOMComponentTree":101,"./ReactUpdates":145,"_process":67,"fbjs/lib/warning":30,"object-assign":66}],111:[function(require,module,exports){ +},{"./LinkedValueUtils":97,"./ReactDOMComponentTree":107,"./ReactUpdates":151,"_process":67,"fbjs/lib/warning":30,"object-assign":66}],117:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -12032,7 +12786,7 @@ var ReactDOMSelection = { }; module.exports = ReactDOMSelection; -},{"./getNodeForCharacterOffset":181,"./getTextContentAccessor":182,"fbjs/lib/ExecutionEnvironment":9}],112:[function(require,module,exports){ +},{"./getNodeForCharacterOffset":186,"./getTextContentAccessor":187,"fbjs/lib/ExecutionEnvironment":9}],118:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -12199,7 +12953,7 @@ _assign(ReactDOMTextComponent.prototype, { module.exports = ReactDOMTextComponent; }).call(this,require('_process')) -},{"./DOMChildrenOperations":76,"./DOMLazyTree":77,"./ReactDOMComponentTree":101,"./escapeTextContentForBrowser":170,"./reactProdInvariant":188,"./validateDOMNesting":194,"_process":67,"fbjs/lib/invariant":23,"object-assign":66}],113:[function(require,module,exports){ +},{"./DOMChildrenOperations":82,"./DOMLazyTree":83,"./ReactDOMComponentTree":107,"./escapeTextContentForBrowser":176,"./reactProdInvariant":193,"./validateDOMNesting":199,"_process":67,"fbjs/lib/invariant":23,"object-assign":66}],119:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -12362,7 +13116,7 @@ function _handleChange(event) { module.exports = ReactDOMTextarea; }).call(this,require('_process')) -},{"./LinkedValueUtils":91,"./ReactDOMComponentTree":101,"./ReactUpdates":145,"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"object-assign":66}],114:[function(require,module,exports){ +},{"./LinkedValueUtils":97,"./ReactDOMComponentTree":107,"./ReactUpdates":151,"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"object-assign":66}],120:[function(require,module,exports){ (function (process){ /** * Copyright 2015-present, Facebook, Inc. @@ -12501,7 +13255,7 @@ module.exports = { }; }).call(this,require('_process')) -},{"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23}],115:[function(require,module,exports){ +},{"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23}],121:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -12616,7 +13370,7 @@ var ReactDOMUnknownPropertyHook = { module.exports = ReactDOMUnknownPropertyHook; }).call(this,require('_process')) -},{"./DOMProperty":79,"./EventPluginRegistry":85,"_process":67,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":203}],116:[function(require,module,exports){ +},{"./DOMProperty":85,"./EventPluginRegistry":91,"_process":67,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":208}],122:[function(require,module,exports){ (function (process){ /** * Copyright 2016-present, Facebook, Inc. @@ -12798,9 +13552,7 @@ function resumeCurrentLifeCycleTimer() { } var lastMarkTimeStamp = 0; -var canUsePerformanceMeasure = -// $FlowFixMe https://github.com/facebook/flow/issues/2345 -typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; +var canUsePerformanceMeasure = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; function shouldMark(debugID) { if (!isProfiling || !canUsePerformanceMeasure) { @@ -12980,7 +13732,7 @@ if (/[?&]react_perf\b/.test(url)) { module.exports = ReactDebugTool; }).call(this,require('_process')) -},{"./ReactHostOperationHistoryHook":126,"./ReactInvalidSetStateWarningHook":131,"_process":67,"fbjs/lib/ExecutionEnvironment":9,"fbjs/lib/performanceNow":28,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":203}],117:[function(require,module,exports){ +},{"./ReactHostOperationHistoryHook":132,"./ReactInvalidSetStateWarningHook":137,"_process":67,"fbjs/lib/ExecutionEnvironment":9,"fbjs/lib/performanceNow":28,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":208}],123:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -13048,7 +13800,7 @@ var ReactDefaultBatchingStrategy = { }; module.exports = ReactDefaultBatchingStrategy; -},{"./ReactUpdates":145,"./Transaction":163,"fbjs/lib/emptyFunction":15,"object-assign":66}],118:[function(require,module,exports){ +},{"./ReactUpdates":151,"./Transaction":169,"fbjs/lib/emptyFunction":15,"object-assign":66}],124:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -13134,7 +13886,7 @@ function inject() { module.exports = { inject: inject }; -},{"./ARIADOMPropertyConfig":69,"./BeforeInputEventPlugin":71,"./ChangeEventPlugin":75,"./DefaultEventPluginOrder":82,"./EnterLeaveEventPlugin":83,"./HTMLDOMPropertyConfig":89,"./ReactComponentBrowserEnvironment":95,"./ReactDOMComponent":99,"./ReactDOMComponentTree":101,"./ReactDOMEmptyComponent":103,"./ReactDOMTextComponent":112,"./ReactDOMTreeTraversal":114,"./ReactDefaultBatchingStrategy":117,"./ReactEventListener":123,"./ReactInjection":127,"./ReactReconcileTransaction":139,"./SVGDOMPropertyConfig":147,"./SelectEventPlugin":148,"./SimpleEventPlugin":149}],119:[function(require,module,exports){ +},{"./ARIADOMPropertyConfig":75,"./BeforeInputEventPlugin":77,"./ChangeEventPlugin":81,"./DefaultEventPluginOrder":88,"./EnterLeaveEventPlugin":89,"./HTMLDOMPropertyConfig":95,"./ReactComponentBrowserEnvironment":101,"./ReactDOMComponent":105,"./ReactDOMComponentTree":107,"./ReactDOMEmptyComponent":109,"./ReactDOMTextComponent":118,"./ReactDOMTreeTraversal":120,"./ReactDefaultBatchingStrategy":123,"./ReactEventListener":129,"./ReactInjection":133,"./ReactReconcileTransaction":145,"./SVGDOMPropertyConfig":153,"./SelectEventPlugin":154,"./SimpleEventPlugin":155}],125:[function(require,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -13154,7 +13906,7 @@ module.exports = { var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; module.exports = REACT_ELEMENT_TYPE; -},{}],120:[function(require,module,exports){ +},{}],126:[function(require,module,exports){ /** * Copyright 2014-present, Facebook, Inc. * All rights reserved. @@ -13184,7 +13936,7 @@ var ReactEmptyComponent = { ReactEmptyComponent.injection = ReactEmptyComponentInjection; module.exports = ReactEmptyComponent; -},{}],121:[function(require,module,exports){ +},{}],127:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -13253,7 +14005,6 @@ if (process.env.NODE_ENV !== 'production') { var evtType = 'react-' + name; fakeNode.addEventListener(evtType, boundFunc, false); var evt = document.createEvent('Event'); - // $FlowFixMe https://github.com/facebook/flow/issues/2336 evt.initEvent(evtType, false, false); fakeNode.dispatchEvent(evt); fakeNode.removeEventListener(evtType, boundFunc, false); @@ -13264,7 +14015,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = ReactErrorUtils; }).call(this,require('_process')) -},{"_process":67}],122:[function(require,module,exports){ +},{"_process":67}],128:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -13297,7 +14048,7 @@ var ReactEventEmitterMixin = { }; module.exports = ReactEventEmitterMixin; -},{"./EventPluginHub":84}],123:[function(require,module,exports){ +},{"./EventPluginHub":90}],129:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -13452,7 +14203,7 @@ var ReactEventListener = { }; module.exports = ReactEventListener; -},{"./PooledClass":92,"./ReactDOMComponentTree":101,"./ReactUpdates":145,"./getEventTarget":177,"fbjs/lib/EventListener":8,"fbjs/lib/ExecutionEnvironment":9,"fbjs/lib/getUnboundedScrollPosition":20,"object-assign":66}],124:[function(require,module,exports){ +},{"./PooledClass":98,"./ReactDOMComponentTree":107,"./ReactUpdates":151,"./getEventTarget":183,"fbjs/lib/EventListener":8,"fbjs/lib/ExecutionEnvironment":9,"fbjs/lib/getUnboundedScrollPosition":20,"object-assign":66}],130:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -13474,7 +14225,7 @@ var ReactFeatureFlags = { }; module.exports = ReactFeatureFlags; -},{}],125:[function(require,module,exports){ +},{}],131:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -13545,7 +14296,7 @@ var ReactHostComponent = { module.exports = ReactHostComponent; }).call(this,require('_process')) -},{"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23}],126:[function(require,module,exports){ +},{"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23}],132:[function(require,module,exports){ /** * Copyright 2016-present, Facebook, Inc. * All rights reserved. @@ -13579,7 +14330,7 @@ var ReactHostOperationHistoryHook = { }; module.exports = ReactHostOperationHistoryHook; -},{}],127:[function(require,module,exports){ +},{}],133:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -13613,7 +14364,7 @@ var ReactInjection = { }; module.exports = ReactInjection; -},{"./DOMProperty":79,"./EventPluginHub":84,"./EventPluginUtils":86,"./ReactBrowserEventEmitter":93,"./ReactComponentEnvironment":96,"./ReactEmptyComponent":120,"./ReactHostComponent":125,"./ReactUpdates":145}],128:[function(require,module,exports){ +},{"./DOMProperty":85,"./EventPluginHub":90,"./EventPluginUtils":92,"./ReactBrowserEventEmitter":99,"./ReactComponentEnvironment":102,"./ReactEmptyComponent":126,"./ReactHostComponent":131,"./ReactUpdates":151}],134:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -13737,7 +14488,7 @@ var ReactInputSelection = { }; module.exports = ReactInputSelection; -},{"./ReactDOMSelection":111,"fbjs/lib/containsNode":12,"fbjs/lib/focusNode":17,"fbjs/lib/getActiveElement":18}],129:[function(require,module,exports){ +},{"./ReactDOMSelection":117,"fbjs/lib/containsNode":12,"fbjs/lib/focusNode":17,"fbjs/lib/getActiveElement":18}],135:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -13785,7 +14536,7 @@ var ReactInstanceMap = { }; module.exports = ReactInstanceMap; -},{}],130:[function(require,module,exports){ +},{}],136:[function(require,module,exports){ (function (process){ /** * Copyright 2016-present, Facebook, Inc. @@ -13812,7 +14563,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = { debugTool: debugTool }; }).call(this,require('_process')) -},{"./ReactDebugTool":116,"_process":67}],131:[function(require,module,exports){ +},{"./ReactDebugTool":122,"_process":67}],137:[function(require,module,exports){ (function (process){ /** * Copyright 2016-present, Facebook, Inc. @@ -13852,7 +14603,7 @@ var ReactInvalidSetStateWarningHook = { module.exports = ReactInvalidSetStateWarningHook; }).call(this,require('_process')) -},{"_process":67,"fbjs/lib/warning":30}],132:[function(require,module,exports){ +},{"_process":67,"fbjs/lib/warning":30}],138:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -13902,7 +14653,7 @@ var ReactMarkupChecksum = { }; module.exports = ReactMarkupChecksum; -},{"./adler32":166}],133:[function(require,module,exports){ +},{"./adler32":172}],139:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -14443,7 +15194,7 @@ var ReactMount = { module.exports = ReactMount; }).call(this,require('_process')) -},{"./DOMLazyTree":77,"./DOMProperty":79,"./ReactBrowserEventEmitter":93,"./ReactDOMComponentTree":101,"./ReactDOMContainerInfo":102,"./ReactDOMFeatureFlags":104,"./ReactFeatureFlags":124,"./ReactInstanceMap":129,"./ReactInstrumentation":130,"./ReactMarkupChecksum":132,"./ReactReconciler":140,"./ReactUpdateQueue":144,"./ReactUpdates":145,"./instantiateReactComponent":184,"./reactProdInvariant":188,"./setInnerHTML":190,"./shouldUpdateReactComponent":192,"_process":67,"fbjs/lib/emptyObject":16,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"react/lib/React":199,"react/lib/ReactCurrentOwner":204}],134:[function(require,module,exports){ +},{"./DOMLazyTree":83,"./DOMProperty":85,"./ReactBrowserEventEmitter":99,"./ReactDOMComponentTree":107,"./ReactDOMContainerInfo":108,"./ReactDOMFeatureFlags":110,"./ReactFeatureFlags":130,"./ReactInstanceMap":135,"./ReactInstrumentation":136,"./ReactMarkupChecksum":138,"./ReactReconciler":146,"./ReactUpdateQueue":150,"./ReactUpdates":151,"./instantiateReactComponent":189,"./reactProdInvariant":193,"./setInnerHTML":195,"./shouldUpdateReactComponent":197,"_process":67,"fbjs/lib/emptyObject":16,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"react/lib/React":204,"react/lib/ReactCurrentOwner":209}],140:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -14896,7 +15647,7 @@ var ReactMultiChild = { module.exports = ReactMultiChild; }).call(this,require('_process')) -},{"./ReactChildReconciler":94,"./ReactComponentEnvironment":96,"./ReactInstanceMap":129,"./ReactInstrumentation":130,"./ReactReconciler":140,"./flattenChildren":172,"./reactProdInvariant":188,"_process":67,"fbjs/lib/emptyFunction":15,"fbjs/lib/invariant":23,"react/lib/ReactCurrentOwner":204}],135:[function(require,module,exports){ +},{"./ReactChildReconciler":100,"./ReactComponentEnvironment":102,"./ReactInstanceMap":135,"./ReactInstrumentation":136,"./ReactReconciler":146,"./flattenChildren":178,"./reactProdInvariant":193,"_process":67,"fbjs/lib/emptyFunction":15,"fbjs/lib/invariant":23,"react/lib/ReactCurrentOwner":209}],141:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -14939,7 +15690,7 @@ var ReactNodeTypes = { module.exports = ReactNodeTypes; }).call(this,require('_process')) -},{"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23,"react/lib/React":199}],136:[function(require,module,exports){ +},{"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23,"react/lib/React":204}],142:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -15036,7 +15787,7 @@ var ReactOwner = { module.exports = ReactOwner; }).call(this,require('_process')) -},{"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23}],137:[function(require,module,exports){ +},{"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23}],143:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -15064,7 +15815,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = ReactPropTypeLocationNames; }).call(this,require('_process')) -},{"_process":67}],138:[function(require,module,exports){ +},{"_process":67}],144:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -15081,7 +15832,7 @@ module.exports = ReactPropTypeLocationNames; var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; -},{}],139:[function(require,module,exports){ +},{}],145:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -15262,7 +16013,7 @@ PooledClass.addPoolingTo(ReactReconcileTransaction); module.exports = ReactReconcileTransaction; }).call(this,require('_process')) -},{"./CallbackQueue":74,"./PooledClass":92,"./ReactBrowserEventEmitter":93,"./ReactInputSelection":128,"./ReactInstrumentation":130,"./ReactUpdateQueue":144,"./Transaction":163,"_process":67,"object-assign":66}],140:[function(require,module,exports){ +},{"./CallbackQueue":80,"./PooledClass":98,"./ReactBrowserEventEmitter":99,"./ReactInputSelection":134,"./ReactInstrumentation":136,"./ReactUpdateQueue":150,"./Transaction":169,"_process":67,"object-assign":66}],146:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -15433,7 +16184,7 @@ var ReactReconciler = { module.exports = ReactReconciler; }).call(this,require('_process')) -},{"./ReactInstrumentation":130,"./ReactRef":141,"_process":67,"fbjs/lib/warning":30}],141:[function(require,module,exports){ +},{"./ReactInstrumentation":136,"./ReactRef":147,"_process":67,"fbjs/lib/warning":30}],147:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -15522,7 +16273,7 @@ ReactRef.detachRefs = function (instance, element) { }; module.exports = ReactRef; -},{"./ReactOwner":136}],142:[function(require,module,exports){ +},{"./ReactOwner":142}],148:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -15615,7 +16366,7 @@ PooledClass.addPoolingTo(ReactServerRenderingTransaction); module.exports = ReactServerRenderingTransaction; }).call(this,require('_process')) -},{"./PooledClass":92,"./ReactInstrumentation":130,"./ReactServerUpdateQueue":143,"./Transaction":163,"_process":67,"object-assign":66}],143:[function(require,module,exports){ +},{"./PooledClass":98,"./ReactInstrumentation":136,"./ReactServerUpdateQueue":149,"./Transaction":169,"_process":67,"object-assign":66}],149:[function(require,module,exports){ (function (process){ /** * Copyright 2015-present, Facebook, Inc. @@ -15757,7 +16508,7 @@ var ReactServerUpdateQueue = function () { module.exports = ReactServerUpdateQueue; }).call(this,require('_process')) -},{"./ReactUpdateQueue":144,"_process":67,"fbjs/lib/warning":30}],144:[function(require,module,exports){ +},{"./ReactUpdateQueue":150,"_process":67,"fbjs/lib/warning":30}],150:[function(require,module,exports){ (function (process){ /** * Copyright 2015-present, Facebook, Inc. @@ -15929,7 +16680,7 @@ var ReactUpdateQueue = { * @param {object} completeState Next state. * @internal */ - enqueueReplaceState: function (publicInstance, completeState) { + enqueueReplaceState: function (publicInstance, completeState, callback) { var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState'); if (!internalInstance) { @@ -15939,6 +16690,16 @@ var ReactUpdateQueue = { internalInstance._pendingStateQueue = [completeState]; internalInstance._pendingReplaceState = true; + // Future-proof 15.5 + if (callback !== undefined && callback !== null) { + ReactUpdateQueue.validateCallback(callback, 'replaceState'); + if (internalInstance._pendingCallbacks) { + internalInstance._pendingCallbacks.push(callback); + } else { + internalInstance._pendingCallbacks = [callback]; + } + } + enqueueUpdate(internalInstance); }, @@ -15986,7 +16747,7 @@ var ReactUpdateQueue = { module.exports = ReactUpdateQueue; }).call(this,require('_process')) -},{"./ReactInstanceMap":129,"./ReactInstrumentation":130,"./ReactUpdates":145,"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"react/lib/ReactCurrentOwner":204}],145:[function(require,module,exports){ +},{"./ReactInstanceMap":135,"./ReactInstrumentation":136,"./ReactUpdates":151,"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"react/lib/ReactCurrentOwner":209}],151:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -16240,7 +17001,7 @@ var ReactUpdates = { module.exports = ReactUpdates; }).call(this,require('_process')) -},{"./CallbackQueue":74,"./PooledClass":92,"./ReactFeatureFlags":124,"./ReactReconciler":140,"./Transaction":163,"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23,"object-assign":66}],146:[function(require,module,exports){ +},{"./CallbackQueue":80,"./PooledClass":98,"./ReactFeatureFlags":130,"./ReactReconciler":146,"./Transaction":169,"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23,"object-assign":66}],152:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -16253,8 +17014,8 @@ module.exports = ReactUpdates; 'use strict'; -module.exports = '15.4.2'; -},{}],147:[function(require,module,exports){ +module.exports = '15.5.4'; +},{}],153:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -16556,7 +17317,7 @@ Object.keys(ATTRS).forEach(function (key) { }); module.exports = SVGDOMPropertyConfig; -},{}],148:[function(require,module,exports){ +},{}],154:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -16747,7 +17508,7 @@ var SelectEventPlugin = { }; module.exports = SelectEventPlugin; -},{"./EventPropagators":87,"./ReactDOMComponentTree":101,"./ReactInputSelection":128,"./SyntheticEvent":154,"./isTextInputElement":186,"fbjs/lib/ExecutionEnvironment":9,"fbjs/lib/getActiveElement":18,"fbjs/lib/shallowEqual":29}],149:[function(require,module,exports){ +},{"./EventPropagators":93,"./ReactDOMComponentTree":107,"./ReactInputSelection":134,"./SyntheticEvent":160,"./isTextInputElement":191,"fbjs/lib/ExecutionEnvironment":9,"fbjs/lib/getActiveElement":18,"fbjs/lib/shallowEqual":29}],155:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -16978,7 +17739,7 @@ var SimpleEventPlugin = { module.exports = SimpleEventPlugin; }).call(this,require('_process')) -},{"./EventPropagators":87,"./ReactDOMComponentTree":101,"./SyntheticAnimationEvent":150,"./SyntheticClipboardEvent":151,"./SyntheticDragEvent":153,"./SyntheticEvent":154,"./SyntheticFocusEvent":155,"./SyntheticKeyboardEvent":157,"./SyntheticMouseEvent":158,"./SyntheticTouchEvent":159,"./SyntheticTransitionEvent":160,"./SyntheticUIEvent":161,"./SyntheticWheelEvent":162,"./getEventCharCode":174,"./reactProdInvariant":188,"_process":67,"fbjs/lib/EventListener":8,"fbjs/lib/emptyFunction":15,"fbjs/lib/invariant":23}],150:[function(require,module,exports){ +},{"./EventPropagators":93,"./ReactDOMComponentTree":107,"./SyntheticAnimationEvent":156,"./SyntheticClipboardEvent":157,"./SyntheticDragEvent":159,"./SyntheticEvent":160,"./SyntheticFocusEvent":161,"./SyntheticKeyboardEvent":163,"./SyntheticMouseEvent":164,"./SyntheticTouchEvent":165,"./SyntheticTransitionEvent":166,"./SyntheticUIEvent":167,"./SyntheticWheelEvent":168,"./getEventCharCode":180,"./reactProdInvariant":193,"_process":67,"fbjs/lib/EventListener":8,"fbjs/lib/emptyFunction":15,"fbjs/lib/invariant":23}],156:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17017,7 +17778,7 @@ function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, na SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface); module.exports = SyntheticAnimationEvent; -},{"./SyntheticEvent":154}],151:[function(require,module,exports){ +},{"./SyntheticEvent":160}],157:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17055,7 +17816,7 @@ function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, na SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface); module.exports = SyntheticClipboardEvent; -},{"./SyntheticEvent":154}],152:[function(require,module,exports){ +},{"./SyntheticEvent":160}],158:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17091,7 +17852,7 @@ function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface); module.exports = SyntheticCompositionEvent; -},{"./SyntheticEvent":154}],153:[function(require,module,exports){ +},{"./SyntheticEvent":160}],159:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17127,7 +17888,7 @@ function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeE SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface); module.exports = SyntheticDragEvent; -},{"./SyntheticMouseEvent":158}],154:[function(require,module,exports){ +},{"./SyntheticMouseEvent":164}],160:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -17398,7 +18159,7 @@ function getPooledWarningPropertyDefinition(propName, getVal) { } }).call(this,require('_process')) -},{"./PooledClass":92,"_process":67,"fbjs/lib/emptyFunction":15,"fbjs/lib/warning":30,"object-assign":66}],155:[function(require,module,exports){ +},{"./PooledClass":98,"_process":67,"fbjs/lib/emptyFunction":15,"fbjs/lib/warning":30,"object-assign":66}],161:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17434,7 +18195,7 @@ function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface); module.exports = SyntheticFocusEvent; -},{"./SyntheticUIEvent":161}],156:[function(require,module,exports){ +},{"./SyntheticUIEvent":167}],162:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17471,7 +18232,7 @@ function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface); module.exports = SyntheticInputEvent; -},{"./SyntheticEvent":154}],157:[function(require,module,exports){ +},{"./SyntheticEvent":160}],163:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17555,7 +18316,7 @@ function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nat SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface); module.exports = SyntheticKeyboardEvent; -},{"./SyntheticUIEvent":161,"./getEventCharCode":174,"./getEventKey":175,"./getEventModifierState":176}],158:[function(require,module,exports){ +},{"./SyntheticUIEvent":167,"./getEventCharCode":180,"./getEventKey":181,"./getEventModifierState":182}],164:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17627,7 +18388,7 @@ function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); module.exports = SyntheticMouseEvent; -},{"./SyntheticUIEvent":161,"./ViewportMetrics":164,"./getEventModifierState":176}],159:[function(require,module,exports){ +},{"./SyntheticUIEvent":167,"./ViewportMetrics":170,"./getEventModifierState":182}],165:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17672,7 +18433,7 @@ function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface); module.exports = SyntheticTouchEvent; -},{"./SyntheticUIEvent":161,"./getEventModifierState":176}],160:[function(require,module,exports){ +},{"./SyntheticUIEvent":167,"./getEventModifierState":182}],166:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17711,7 +18472,7 @@ function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, n SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface); module.exports = SyntheticTransitionEvent; -},{"./SyntheticEvent":154}],161:[function(require,module,exports){ +},{"./SyntheticEvent":160}],167:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17770,7 +18531,7 @@ function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEve SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); module.exports = SyntheticUIEvent; -},{"./SyntheticEvent":154,"./getEventTarget":177}],162:[function(require,module,exports){ +},{"./SyntheticEvent":160,"./getEventTarget":183}],168:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -17824,7 +18585,7 @@ function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, native SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface); module.exports = SyntheticWheelEvent; -},{"./SyntheticMouseEvent":158}],163:[function(require,module,exports){ +},{"./SyntheticMouseEvent":164}],169:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -18052,7 +18813,7 @@ var TransactionImpl = { module.exports = TransactionImpl; }).call(this,require('_process')) -},{"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23}],164:[function(require,module,exports){ +},{"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23}],170:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18079,7 +18840,7 @@ var ViewportMetrics = { }; module.exports = ViewportMetrics; -},{}],165:[function(require,module,exports){ +},{}],171:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -18140,7 +18901,7 @@ function accumulateInto(current, next) { module.exports = accumulateInto; }).call(this,require('_process')) -},{"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23}],166:[function(require,module,exports){ +},{"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23}],172:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18184,7 +18945,7 @@ function adler32(data) { } module.exports = adler32; -},{}],167:[function(require,module,exports){ +},{}],173:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -18274,7 +19035,7 @@ function checkReactTypeSpec(typeSpecs, values, location, componentName, element, module.exports = checkReactTypeSpec; }).call(this,require('_process')) -},{"./ReactPropTypeLocationNames":137,"./ReactPropTypesSecret":138,"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":203}],168:[function(require,module,exports){ +},{"./ReactPropTypeLocationNames":143,"./ReactPropTypesSecret":144,"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":208}],174:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18306,7 +19067,7 @@ var createMicrosoftUnsafeLocalFunction = function (func) { }; module.exports = createMicrosoftUnsafeLocalFunction; -},{}],169:[function(require,module,exports){ +},{}],175:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -18388,7 +19149,7 @@ function dangerousStyleValue(name, value, component) { module.exports = dangerousStyleValue; }).call(this,require('_process')) -},{"./CSSProperty":72,"_process":67,"fbjs/lib/warning":30}],170:[function(require,module,exports){ +},{"./CSSProperty":78,"_process":67,"fbjs/lib/warning":30}],176:[function(require,module,exports){ /** * Copyright 2016-present, Facebook, Inc. * All rights reserved. @@ -18511,7 +19272,7 @@ function escapeTextContentForBrowser(text) { } module.exports = escapeTextContentForBrowser; -},{}],171:[function(require,module,exports){ +},{}],177:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -18574,7 +19335,7 @@ function findDOMNode(componentOrElement) { module.exports = findDOMNode; }).call(this,require('_process')) -},{"./ReactDOMComponentTree":101,"./ReactInstanceMap":129,"./getHostComponentFromComposite":178,"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"react/lib/ReactCurrentOwner":204}],172:[function(require,module,exports){ +},{"./ReactDOMComponentTree":107,"./ReactInstanceMap":135,"./getHostComponentFromComposite":184,"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"react/lib/ReactCurrentOwner":209}],178:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -18653,7 +19414,7 @@ function flattenChildren(children, selfDebugID) { module.exports = flattenChildren; }).call(this,require('_process')) -},{"./KeyEscapeUtils":90,"./traverseAllChildren":193,"_process":67,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":203}],173:[function(require,module,exports){ +},{"./KeyEscapeUtils":96,"./traverseAllChildren":198,"_process":67,"fbjs/lib/warning":30,"react/lib/ReactComponentTreeHook":208}],179:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18684,7 +19445,7 @@ function forEachAccumulated(arr, cb, scope) { } module.exports = forEachAccumulated; -},{}],174:[function(require,module,exports){ +},{}],180:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18734,7 +19495,7 @@ function getEventCharCode(nativeEvent) { } module.exports = getEventCharCode; -},{}],175:[function(require,module,exports){ +},{}],181:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18836,7 +19597,7 @@ function getEventKey(nativeEvent) { } module.exports = getEventKey; -},{"./getEventCharCode":174}],176:[function(require,module,exports){ +},{"./getEventCharCode":180}],182:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18879,7 +19640,7 @@ function getEventModifierState(nativeEvent) { } module.exports = getEventModifierState; -},{}],177:[function(require,module,exports){ +},{}],183:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18914,7 +19675,7 @@ function getEventTarget(nativeEvent) { } module.exports = getEventTarget; -},{}],178:[function(require,module,exports){ +},{}],184:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18944,7 +19705,7 @@ function getHostComponentFromComposite(inst) { } module.exports = getHostComponentFromComposite; -},{"./ReactNodeTypes":135}],179:[function(require,module,exports){ +},{"./ReactNodeTypes":141}],185:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -18972,41 +19733,20 @@ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. * if (iteratorFn) { * var iterator = iteratorFn.call(myIterable); * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ -function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } -} - -module.exports = getIteratorFn; -},{}],180:[function(require,module,exports){ -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * } * - * + * @param {?object} maybeIterable + * @return {?function} */ - -'use strict'; - -var nextDebugID = 1; - -function getNextDebugID() { - return nextDebugID++; +function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } } -module.exports = getNextDebugID; -},{}],181:[function(require,module,exports){ +module.exports = getIteratorFn; +},{}],186:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19080,7 +19820,7 @@ function getNodeForCharacterOffset(root, offset) { } module.exports = getNodeForCharacterOffset; -},{}],182:[function(require,module,exports){ +},{}],187:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19113,7 +19853,7 @@ function getTextContentAccessor() { } module.exports = getTextContentAccessor; -},{"fbjs/lib/ExecutionEnvironment":9}],183:[function(require,module,exports){ +},{"fbjs/lib/ExecutionEnvironment":9}],188:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19214,7 +19954,7 @@ function getVendorPrefixedEventName(eventName) { } module.exports = getVendorPrefixedEventName; -},{"fbjs/lib/ExecutionEnvironment":9}],184:[function(require,module,exports){ +},{"fbjs/lib/ExecutionEnvironment":9}],189:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -19235,7 +19975,7 @@ var ReactCompositeComponent = require('./ReactCompositeComponent'); var ReactEmptyComponent = require('./ReactEmptyComponent'); var ReactHostComponent = require('./ReactHostComponent'); -var getNextDebugID = require('./getNextDebugID'); +var getNextDebugID = require('react/lib/getNextDebugID'); var invariant = require('fbjs/lib/invariant'); var warning = require('fbjs/lib/warning'); @@ -19243,9 +19983,6 @@ var warning = require('fbjs/lib/warning'); var ReactCompositeComponentWrapper = function (element) { this.construct(element); }; -_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, { - _instantiateReactComponent: instantiateReactComponent -}); function getDeclarationErrorAddendum(owner) { if (owner) { @@ -19342,10 +20079,14 @@ function instantiateReactComponent(node, shouldHaveDebugID) { return instance; } +_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, { + _instantiateReactComponent: instantiateReactComponent +}); + module.exports = instantiateReactComponent; }).call(this,require('_process')) -},{"./ReactCompositeComponent":97,"./ReactEmptyComponent":120,"./ReactHostComponent":125,"./getNextDebugID":180,"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"object-assign":66}],185:[function(require,module,exports){ +},{"./ReactCompositeComponent":103,"./ReactEmptyComponent":126,"./ReactHostComponent":131,"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"object-assign":66,"react/lib/getNextDebugID":223}],190:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19405,7 +20146,7 @@ function isEventSupported(eventNameSuffix, capture) { } module.exports = isEventSupported; -},{"fbjs/lib/ExecutionEnvironment":9}],186:[function(require,module,exports){ +},{"fbjs/lib/ExecutionEnvironment":9}],191:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19456,7 +20197,7 @@ function isTextInputElement(elem) { } module.exports = isTextInputElement; -},{}],187:[function(require,module,exports){ +},{}],192:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19482,7 +20223,7 @@ function quoteAttributeValueForBrowser(value) { } module.exports = quoteAttributeValueForBrowser; -},{"./escapeTextContentForBrowser":170}],188:[function(require,module,exports){ +},{"./escapeTextContentForBrowser":176}],193:[function(require,module,exports){ /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. @@ -19521,7 +20262,7 @@ function reactProdInvariant(code) { } module.exports = reactProdInvariant; -},{}],189:[function(require,module,exports){ +},{}],194:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19537,7 +20278,7 @@ module.exports = reactProdInvariant; var ReactMount = require('./ReactMount'); module.exports = ReactMount.renderSubtreeIntoContainer; -},{"./ReactMount":133}],190:[function(require,module,exports){ +},{"./ReactMount":139}],195:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19635,7 +20376,7 @@ if (ExecutionEnvironment.canUseDOM) { } module.exports = setInnerHTML; -},{"./DOMNamespaces":78,"./createMicrosoftUnsafeLocalFunction":168,"fbjs/lib/ExecutionEnvironment":9}],191:[function(require,module,exports){ +},{"./DOMNamespaces":84,"./createMicrosoftUnsafeLocalFunction":174,"fbjs/lib/ExecutionEnvironment":9}],196:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19687,7 +20428,7 @@ if (ExecutionEnvironment.canUseDOM) { } module.exports = setTextContent; -},{"./escapeTextContentForBrowser":170,"./setInnerHTML":190,"fbjs/lib/ExecutionEnvironment":9}],192:[function(require,module,exports){ +},{"./escapeTextContentForBrowser":176,"./setInnerHTML":195,"fbjs/lib/ExecutionEnvironment":9}],197:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -19729,7 +20470,7 @@ function shouldUpdateReactComponent(prevElement, nextElement) { } module.exports = shouldUpdateReactComponent; -},{}],193:[function(require,module,exports){ +},{}],198:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -19908,7 +20649,7 @@ function traverseAllChildren(children, callback, traverseContext) { module.exports = traverseAllChildren; }).call(this,require('_process')) -},{"./KeyEscapeUtils":90,"./ReactElementSymbol":119,"./getIteratorFn":179,"./reactProdInvariant":188,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"react/lib/ReactCurrentOwner":204}],194:[function(require,module,exports){ +},{"./KeyEscapeUtils":96,"./ReactElementSymbol":125,"./getIteratorFn":185,"./reactProdInvariant":193,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"react/lib/ReactCurrentOwner":209}],199:[function(require,module,exports){ (function (process){ /** * Copyright 2015-present, Facebook, Inc. @@ -20136,16 +20877,11 @@ if (process.env.NODE_ENV !== 'production') { case 'section': case 'summary': case 'ul': - case 'pre': case 'listing': - case 'table': - case 'hr': - case 'xmp': - case 'h1': case 'h2': case 'h3': @@ -20293,7 +21029,8 @@ if (process.env.NODE_ENV !== 'production') { module.exports = validateDOMNesting; }).call(this,require('_process')) -},{"_process":67,"fbjs/lib/emptyFunction":15,"fbjs/lib/warning":30,"object-assign":66}],195:[function(require,module,exports){ +},{"_process":67,"fbjs/lib/emptyFunction":15,"fbjs/lib/warning":30,"object-assign":66}],200:[function(require,module,exports){ +// GENERATED DO NOT EDIT module.exports = [ "alignContent", "MozAlignContent", @@ -21290,21 +22027,11 @@ module.exports = [ "WebkitMaskType", "MSMaskType", "OMaskType", - "maxBlockSize", - "MozMaxBlockSize", - "WebkitMaxBlockSize", - "MSMaxBlockSize", - "OMaxBlockSize", "maxHeight", "MozMaxHeight", "WebkitMaxHeight", "MSMaxHeight", "OMaxHeight", - "maxInlineSize", - "MozMaxInlineSize", - "WebkitMaxInlineSize", - "MSMaxInlineSize", - "OMaxInlineSize", "maxWidth", "MozMaxWidth", "WebkitMaxWidth", @@ -21879,10 +22606,15 @@ module.exports = [ "MozFr", "WebkitFr", "MSFr", - "OFr" + "OFr", + "overflowScrolling", + "MozOverflowScrolling", + "WebkitOverflowScrolling", + "MSOverflowScrolling", + "OOverflowScrolling" ] -},{}],196:[function(require,module,exports){ +},{}],201:[function(require,module,exports){ var properties = require('./css-properties.js'); var React = require('react'); @@ -21916,9 +22648,9 @@ module.exports.supportingArrays = React.PropTypes.oneOfType([ ]); -},{"./css-properties.js":195,"react":221}],197:[function(require,module,exports){ -arguments[4][90][0].apply(exports,arguments) -},{"dup":90}],198:[function(require,module,exports){ +},{"./css-properties.js":200,"react":227}],202:[function(require,module,exports){ +arguments[4][96][0].apply(exports,arguments) +},{"dup":96}],203:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -22033,7 +22765,7 @@ var PooledClass = { module.exports = PooledClass; }).call(this,require('_process')) -},{"./reactProdInvariant":219,"_process":67,"fbjs/lib/invariant":23}],199:[function(require,module,exports){ +},{"./reactProdInvariant":225,"_process":67,"fbjs/lib/invariant":23}],204:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -22066,7 +22798,9 @@ var createFactory = ReactElement.createFactory; var cloneElement = ReactElement.cloneElement; if (process.env.NODE_ENV !== 'production') { + var canDefineProperty = require('./canDefineProperty'); var ReactElementValidator = require('./ReactElementValidator'); + var didWarnPropTypesDeprecated = false; createElement = ReactElementValidator.createElement; createFactory = ReactElementValidator.createFactory; cloneElement = ReactElementValidator.cloneElement; @@ -22122,10 +22856,23 @@ var React = { __spread: __spread }; +// TODO: Fix tests so that this deprecation warning doesn't cause failures. +if (process.env.NODE_ENV !== 'production') { + if (canDefineProperty) { + Object.defineProperty(React, 'PropTypes', { + get: function () { + process.env.NODE_ENV !== 'production' ? warning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated. Use ' + 'the prop-types package from npm instead.') : void 0; + didWarnPropTypesDeprecated = true; + return ReactPropTypes; + } + }); + } +} + module.exports = React; }).call(this,require('_process')) -},{"./ReactChildren":200,"./ReactClass":201,"./ReactComponent":202,"./ReactDOMFactories":205,"./ReactElement":206,"./ReactElementValidator":208,"./ReactPropTypes":211,"./ReactPureComponent":213,"./ReactVersion":214,"./onlyChild":218,"_process":67,"fbjs/lib/warning":30,"object-assign":66}],200:[function(require,module,exports){ +},{"./ReactChildren":205,"./ReactClass":206,"./ReactComponent":207,"./ReactDOMFactories":210,"./ReactElement":211,"./ReactElementValidator":213,"./ReactPropTypes":216,"./ReactPureComponent":218,"./ReactVersion":219,"./canDefineProperty":220,"./onlyChild":224,"_process":67,"fbjs/lib/warning":30,"object-assign":66}],205:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -22316,7 +23063,7 @@ var ReactChildren = { }; module.exports = ReactChildren; -},{"./PooledClass":198,"./ReactElement":206,"./traverseAllChildren":220,"fbjs/lib/emptyFunction":15}],201:[function(require,module,exports){ +},{"./PooledClass":203,"./ReactElement":211,"./traverseAllChildren":226,"fbjs/lib/emptyFunction":15}],206:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -22471,7 +23218,6 @@ var ReactClassInterface = { * } * * @return {ReactComponent} - * @nosideeffects * @required */ render: 'DEFINE_ONCE', @@ -22927,6 +23673,8 @@ var ReactClassMixin = { var ReactClassComponent = function () {}; _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin); +var didWarnDeprecated = false; + /** * Module for creating composite components. * @@ -22943,6 +23691,11 @@ var ReactClass = { * @public */ createClass: function (spec) { + if (process.env.NODE_ENV !== 'production') { + process.env.NODE_ENV !== 'production' ? warning(didWarnDeprecated, '%s: React.createClass is deprecated and will be removed in version 16. ' + 'Use plain JavaScript classes instead. If you\'re not yet ready to ' + 'migrate, create-react-class is available on npm as a ' + 'drop-in replacement.', spec && spec.displayName || 'A Component') : void 0; + didWarnDeprecated = true; + } + // To keep our warnings more understandable, we'll use a little hack here to // ensure that Constructor.name !== 'Constructor'. This makes sure we don't // unnecessarily identify a class without displayName as 'Constructor'. @@ -23036,7 +23789,7 @@ var ReactClass = { module.exports = ReactClass; }).call(this,require('_process')) -},{"./ReactComponent":202,"./ReactElement":206,"./ReactNoopUpdateQueue":209,"./ReactPropTypeLocationNames":210,"./reactProdInvariant":219,"_process":67,"fbjs/lib/emptyObject":16,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"object-assign":66}],202:[function(require,module,exports){ +},{"./ReactComponent":207,"./ReactElement":211,"./ReactNoopUpdateQueue":214,"./ReactPropTypeLocationNames":215,"./reactProdInvariant":225,"_process":67,"fbjs/lib/emptyObject":16,"fbjs/lib/invariant":23,"fbjs/lib/warning":30,"object-assign":66}],207:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -23157,7 +23910,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = ReactComponent; }).call(this,require('_process')) -},{"./ReactNoopUpdateQueue":209,"./canDefineProperty":215,"./reactProdInvariant":219,"_process":67,"fbjs/lib/emptyObject":16,"fbjs/lib/invariant":23,"fbjs/lib/warning":30}],203:[function(require,module,exports){ +},{"./ReactNoopUpdateQueue":214,"./canDefineProperty":220,"./reactProdInvariant":225,"_process":67,"fbjs/lib/emptyObject":16,"fbjs/lib/invariant":23,"fbjs/lib/warning":30}],208:[function(require,module,exports){ (function (process){ /** * Copyright 2016-present, Facebook, Inc. @@ -23494,7 +24247,7 @@ var ReactComponentTreeHook = { module.exports = ReactComponentTreeHook; }).call(this,require('_process')) -},{"./ReactCurrentOwner":204,"./reactProdInvariant":219,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30}],204:[function(require,module,exports){ +},{"./ReactCurrentOwner":209,"./reactProdInvariant":225,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30}],209:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -23525,7 +24278,7 @@ var ReactCurrentOwner = { }; module.exports = ReactCurrentOwner; -},{}],205:[function(require,module,exports){ +},{}],210:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -23698,7 +24451,7 @@ var ReactDOMFactories = { module.exports = ReactDOMFactories; }).call(this,require('_process')) -},{"./ReactElement":206,"./ReactElementValidator":208,"_process":67}],206:[function(require,module,exports){ +},{"./ReactElement":211,"./ReactElementValidator":213,"_process":67}],211:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -24042,9 +24795,9 @@ ReactElement.isValidElement = function (object) { module.exports = ReactElement; }).call(this,require('_process')) -},{"./ReactCurrentOwner":204,"./ReactElementSymbol":207,"./canDefineProperty":215,"_process":67,"fbjs/lib/warning":30,"object-assign":66}],207:[function(require,module,exports){ -arguments[4][119][0].apply(exports,arguments) -},{"dup":119}],208:[function(require,module,exports){ +},{"./ReactCurrentOwner":209,"./ReactElementSymbol":212,"./canDefineProperty":220,"_process":67,"fbjs/lib/warning":30,"object-assign":66}],212:[function(require,module,exports){ +arguments[4][125][0].apply(exports,arguments) +},{"dup":125}],213:[function(require,module,exports){ (function (process){ /** * Copyright 2014-present, Facebook, Inc. @@ -24085,6 +24838,16 @@ function getDeclarationErrorAddendum() { return ''; } +function getSourceInfoErrorAddendum(elementProps) { + if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) { + var source = elementProps.__source; + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return ' Check your code at ' + fileName + ':' + lineNumber + '.'; + } + return ''; +} + /** * Warn if there's no key explicitly set on dynamic arrays of children or * object keys are not valid. This allows us to keep track of children between @@ -24215,7 +24978,16 @@ var ReactElementValidator = { if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.'; } - info += getDeclarationErrorAddendum(); + + var sourceInfo = getSourceInfoErrorAddendum(props); + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + info += ReactComponentTreeHook.getCurrentStackAddendum(); + process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0; } } @@ -24281,7 +25053,7 @@ var ReactElementValidator = { module.exports = ReactElementValidator; }).call(this,require('_process')) -},{"./ReactComponentTreeHook":203,"./ReactCurrentOwner":204,"./ReactElement":206,"./canDefineProperty":215,"./checkReactTypeSpec":216,"./getIteratorFn":217,"_process":67,"fbjs/lib/warning":30}],209:[function(require,module,exports){ +},{"./ReactComponentTreeHook":208,"./ReactCurrentOwner":209,"./ReactElement":211,"./canDefineProperty":220,"./checkReactTypeSpec":221,"./getIteratorFn":222,"_process":67,"fbjs/lib/warning":30}],214:[function(require,module,exports){ (function (process){ /** * Copyright 2015-present, Facebook, Inc. @@ -24380,7 +25152,7 @@ var ReactNoopUpdateQueue = { module.exports = ReactNoopUpdateQueue; }).call(this,require('_process')) -},{"_process":67,"fbjs/lib/warning":30}],210:[function(require,module,exports){ +},{"_process":67,"fbjs/lib/warning":30}],215:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -24408,8 +25180,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = ReactPropTypeLocationNames; }).call(this,require('_process')) -},{"_process":67}],211:[function(require,module,exports){ -(function (process){ +},{"_process":67}],216:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -24422,432 +25193,15 @@ module.exports = ReactPropTypeLocationNames; 'use strict'; -var ReactElement = require('./ReactElement'); -var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames'); -var ReactPropTypesSecret = require('./ReactPropTypesSecret'); - -var emptyFunction = require('fbjs/lib/emptyFunction'); -var getIteratorFn = require('./getIteratorFn'); -var warning = require('fbjs/lib/warning'); - -/** - * Collection of methods that allow declaration and validation of props that are - * supplied to React components. Example usage: - * - * var Props = require('ReactPropTypes'); - * var MyArticle = React.createClass({ - * propTypes: { - * // An optional string prop named "description". - * description: Props.string, - * - * // A required enum prop named "category". - * category: Props.oneOf(['News','Photos']).isRequired, - * - * // A prop named "dialog" that requires an instance of Dialog. - * dialog: Props.instanceOf(Dialog).isRequired - * }, - * render: function() { ... } - * }); - * - * A more formal specification of how these methods are used: - * - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) - * decl := ReactPropTypes.{type}(.isRequired)? - * - * Each and every declaration produces a function with the same signature. This - * allows the creation of custom validation functions. For example: - * - * var MyLink = React.createClass({ - * propTypes: { - * // An optional string or URI prop named "href". - * href: function(props, propName, componentName) { - * var propValue = props[propName]; - * if (propValue != null && typeof propValue !== 'string' && - * !(propValue instanceof URI)) { - * return new Error( - * 'Expected a string or an URI for ' + propName + ' in ' + - * componentName - * ); - * } - * } - * }, - * render: function() {...} - * }); - * - * @internal - */ - -var ANONYMOUS = '<>'; - -var ReactPropTypes = { - array: createPrimitiveTypeChecker('array'), - bool: createPrimitiveTypeChecker('boolean'), - func: createPrimitiveTypeChecker('function'), - number: createPrimitiveTypeChecker('number'), - object: createPrimitiveTypeChecker('object'), - string: createPrimitiveTypeChecker('string'), - symbol: createPrimitiveTypeChecker('symbol'), - - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker -}; - -/** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ -/*eslint-disable no-self-compare*/ -function is(x, y) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - return x !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } -} -/*eslint-enable no-self-compare*/ - -/** - * We use an Error-like object for backward compatibility as people may call - * PropTypes directly and inspect their output. However we don't use real - * Errors anymore. We don't inspect their stack anyway, and creating them - * is prohibitively expensive if they are created too often, such as what - * happens in oneOfType() for any type before the one that matched. - */ -function PropTypeError(message) { - this.message = message; - this.stack = ''; -} -// Make `instanceof Error` still work for returned errors. -PropTypeError.prototype = Error.prototype; - -function createChainableTypeChecker(validate) { - if (process.env.NODE_ENV !== 'production') { - var manualPropTypeCallCache = {}; - } - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { - componentName = componentName || ANONYMOUS; - propFullName = propFullName || propName; - if (process.env.NODE_ENV !== 'production') { - if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') { - var cacheKey = componentName + ':' + propName; - if (!manualPropTypeCallCache[cacheKey]) { - process.env.NODE_ENV !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName) : void 0; - manualPropTypeCallCache[cacheKey] = true; - } - } - } - if (props[propName] == null) { - var locationName = ReactPropTypeLocationNames[location]; - if (isRequired) { - if (props[propName] === null) { - return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); - } - return new PropTypeError('The ' + locationName + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); - } - return null; - } else { - return validate(props, propName, componentName, location, propFullName); - } - } - - var chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); - - return chainedCheckType; -} - -function createPrimitiveTypeChecker(expectedType) { - function validate(props, propName, componentName, location, propFullName, secret) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== expectedType) { - var locationName = ReactPropTypeLocationNames[location]; - // `propValue` being instance of, say, date/regexp, pass the 'object' - // check, but we can offer a more precise error message here rather than - // 'of type `object`'. - var preciseType = getPreciseType(propValue); - - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); -} - -function createAnyTypeChecker() { - return createChainableTypeChecker(emptyFunction.thatReturns(null)); -} - -function createArrayOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); - } - var propValue = props[propName]; - if (!Array.isArray(propValue)) { - var locationName = ReactPropTypeLocationNames[location]; - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); - } - for (var i = 0; i < propValue.length; i++) { - var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); -} - -function createElementTypeChecker() { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - if (!ReactElement.isValidElement(propValue)) { - var locationName = ReactPropTypeLocationNames[location]; - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); - } - return null; - } - return createChainableTypeChecker(validate); -} - -function createInstanceTypeChecker(expectedClass) { - function validate(props, propName, componentName, location, propFullName) { - if (!(props[propName] instanceof expectedClass)) { - var locationName = ReactPropTypeLocationNames[location]; - var expectedClassName = expectedClass.name || ANONYMOUS; - var actualClassName = getClassName(props[propName]); - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); -} - -function createEnumTypeChecker(expectedValues) { - if (!Array.isArray(expectedValues)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - for (var i = 0; i < expectedValues.length; i++) { - if (is(propValue, expectedValues[i])) { - return null; - } - } - - var locationName = ReactPropTypeLocationNames[location]; - var valuesString = JSON.stringify(expectedValues); - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); - } - return createChainableTypeChecker(validate); -} - -function createObjectOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); - } - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - var locationName = ReactPropTypeLocationNames[location]; - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); - } - for (var key in propValue) { - if (propValue.hasOwnProperty(key)) { - var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - } - return null; - } - return createChainableTypeChecker(validate); -} - -function createUnionTypeChecker(arrayOfTypeCheckers) { - if (!Array.isArray(arrayOfTypeCheckers)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - function validate(props, propName, componentName, location, propFullName) { - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { - return null; - } - } - - var locationName = ReactPropTypeLocationNames[location]; - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); - } - return createChainableTypeChecker(validate); -} - -function createNodeChecker() { - function validate(props, propName, componentName, location, propFullName) { - if (!isNode(props[propName])) { - var locationName = ReactPropTypeLocationNames[location]; - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); - } - return null; - } - return createChainableTypeChecker(validate); -} - -function createShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - var locationName = ReactPropTypeLocationNames[location]; - return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - for (var key in shapeTypes) { - var checker = shapeTypes[key]; - if (!checker) { - continue; - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); -} - -function isNode(propValue) { - switch (typeof propValue) { - case 'number': - case 'string': - case 'undefined': - return true; - case 'boolean': - return !propValue; - case 'object': - if (Array.isArray(propValue)) { - return propValue.every(isNode); - } - if (propValue === null || ReactElement.isValidElement(propValue)) { - return true; - } - - var iteratorFn = getIteratorFn(propValue); - if (iteratorFn) { - var iterator = iteratorFn.call(propValue); - var step; - if (iteratorFn !== propValue.entries) { - while (!(step = iterator.next()).done) { - if (!isNode(step.value)) { - return false; - } - } - } else { - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - if (!isNode(entry[1])) { - return false; - } - } - } - } - } else { - return false; - } - - return true; - default: - return false; - } -} - -function isSymbol(propType, propValue) { - // Native Symbol. - if (propType === 'symbol') { - return true; - } - - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' - if (propValue['@@toStringTag'] === 'Symbol') { - return true; - } - - // Fallback for non-spec compliant Symbols which are polyfilled. - if (typeof Symbol === 'function' && propValue instanceof Symbol) { - return true; - } - - return false; -} - -// Equivalent of `typeof` but with special handling for array and regexp. -function getPropType(propValue) { - var propType = typeof propValue; - if (Array.isArray(propValue)) { - return 'array'; - } - if (propValue instanceof RegExp) { - // Old webkits (at least until Android 4.0) return 'function' rather than - // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ - // passes PropTypes.object. - return 'object'; - } - if (isSymbol(propType, propValue)) { - return 'symbol'; - } - return propType; -} - -// This handles more types than `getPropType`. Only used for error messages. -// See `createPrimitiveTypeChecker`. -function getPreciseType(propValue) { - var propType = getPropType(propValue); - if (propType === 'object') { - if (propValue instanceof Date) { - return 'date'; - } else if (propValue instanceof RegExp) { - return 'regexp'; - } - } - return propType; -} - -// Returns class name of the object, if any. -function getClassName(propValue) { - if (!propValue.constructor || !propValue.constructor.name) { - return ANONYMOUS; - } - return propValue.constructor.name; -} +var _require = require('./ReactElement'), + isValidElement = _require.isValidElement; -module.exports = ReactPropTypes; -}).call(this,require('_process')) +var factory = require('prop-types/factory'); -},{"./ReactElement":206,"./ReactPropTypeLocationNames":210,"./ReactPropTypesSecret":212,"./getIteratorFn":217,"_process":67,"fbjs/lib/emptyFunction":15,"fbjs/lib/warning":30}],212:[function(require,module,exports){ -arguments[4][138][0].apply(exports,arguments) -},{"dup":138}],213:[function(require,module,exports){ +module.exports = factory(isValidElement); +},{"./ReactElement":211,"prop-types/factory":69}],217:[function(require,module,exports){ +arguments[4][144][0].apply(exports,arguments) +},{"dup":144}],218:[function(require,module,exports){ /** * Copyright 2013-present, Facebook, Inc. * All rights reserved. @@ -24889,9 +25243,9 @@ _assign(ReactPureComponent.prototype, ReactComponent.prototype); ReactPureComponent.prototype.isPureReactComponent = true; module.exports = ReactPureComponent; -},{"./ReactComponent":202,"./ReactNoopUpdateQueue":209,"fbjs/lib/emptyObject":16,"object-assign":66}],214:[function(require,module,exports){ -arguments[4][146][0].apply(exports,arguments) -},{"dup":146}],215:[function(require,module,exports){ +},{"./ReactComponent":207,"./ReactNoopUpdateQueue":214,"fbjs/lib/emptyObject":16,"object-assign":66}],219:[function(require,module,exports){ +arguments[4][152][0].apply(exports,arguments) +},{"dup":152}],220:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -24920,7 +25274,7 @@ if (process.env.NODE_ENV !== 'production') { module.exports = canDefineProperty; }).call(this,require('_process')) -},{"_process":67}],216:[function(require,module,exports){ +},{"_process":67}],221:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -25010,9 +25364,30 @@ function checkReactTypeSpec(typeSpecs, values, location, componentName, element, module.exports = checkReactTypeSpec; }).call(this,require('_process')) -},{"./ReactComponentTreeHook":203,"./ReactPropTypeLocationNames":210,"./ReactPropTypesSecret":212,"./reactProdInvariant":219,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30}],217:[function(require,module,exports){ -arguments[4][179][0].apply(exports,arguments) -},{"dup":179}],218:[function(require,module,exports){ +},{"./ReactComponentTreeHook":208,"./ReactPropTypeLocationNames":215,"./ReactPropTypesSecret":217,"./reactProdInvariant":225,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30}],222:[function(require,module,exports){ +arguments[4][185][0].apply(exports,arguments) +},{"dup":185}],223:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +'use strict'; + +var nextDebugID = 1; + +function getNextDebugID() { + return nextDebugID++; +} + +module.exports = getNextDebugID; +},{}],224:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -25053,9 +25428,9 @@ function onlyChild(children) { module.exports = onlyChild; }).call(this,require('_process')) -},{"./ReactElement":206,"./reactProdInvariant":219,"_process":67,"fbjs/lib/invariant":23}],219:[function(require,module,exports){ -arguments[4][188][0].apply(exports,arguments) -},{"dup":188}],220:[function(require,module,exports){ +},{"./ReactElement":211,"./reactProdInvariant":225,"_process":67,"fbjs/lib/invariant":23}],225:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"dup":193}],226:[function(require,module,exports){ (function (process){ /** * Copyright 2013-present, Facebook, Inc. @@ -25234,10 +25609,10 @@ function traverseAllChildren(children, callback, traverseContext) { module.exports = traverseAllChildren; }).call(this,require('_process')) -},{"./KeyEscapeUtils":197,"./ReactCurrentOwner":204,"./ReactElementSymbol":207,"./getIteratorFn":217,"./reactProdInvariant":219,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30}],221:[function(require,module,exports){ +},{"./KeyEscapeUtils":202,"./ReactCurrentOwner":209,"./ReactElementSymbol":212,"./getIteratorFn":222,"./reactProdInvariant":225,"_process":67,"fbjs/lib/invariant":23,"fbjs/lib/warning":30}],227:[function(require,module,exports){ 'use strict'; module.exports = require('./lib/React'); -},{"./lib/React":199}]},{},[1]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJkZW1vL0V4YW1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KTtcbiAgICAgICAgfSwgMCk7XG4gICAgfVxuXG4gICAgaGFuZGxlRHJhZyh3aWR0aCkge1xuICAgICAgICBpZiAod2lkdGggPj0gMzAwICYmIHdpZHRoIDw9IDQwMCkge1xuICAgICAgICAgICAgdGhpcy5zZXRTdGF0ZSh7IHNpemU6IDMwMCB9KTtcbiAgICAgICAgfSBlbHNlIGlmICh3aWR0aCA+IDQwMCAmJiB3aWR0aCA8PSA1MDApIHtcbiAgICAgICAgICAgIHRoaXMuc2V0U3RhdGUoeyBzaXplOiA1MDAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnNldFN0YXRlKHsgc2l6ZTogdW5kZWZpbmVkIH0pO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmVuZGVyKCkge1xuICAgICAgICBjb25zdCBkcm9wV2FyblN0eWxlID0ge1xuICAgICAgICAgICAgYmFja2dyb3VuZENvbG9yOiAneWVsbG93JyxcbiAgICAgICAgICAgIGxlZnQ6IDMwMCxcbiAgICAgICAgICAgIHdpZHRoOiAyMDAsXG4gICAgICAgIH07XG4gICAgICAgIGNvbnN0IGNlbnRlcmVkVGV4dFN0eWxlID0ge1xuICAgICAgICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXG4gICAgICAgICAgICBhbGlnbkl0ZW1zOiAnY2VudGVyJyxcbiAgICAgICAgICAgIGp1c3RpZnlDb250ZW50OiAnY2VudGVyJyxcbiAgICAgICAgICAgIGhlaWdodDogJzEwMCUnLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgPGRpdiBzdHlsZT17eyBoZWlnaHQ6ICcxMDAlJyB9fT5cbiAgICAgICAgICAgICAgICA8U3BsaXRQYW5lXG4gICAgICAgICAgICAgICAgICAgIHNpemU9e3RoaXMuc3RhdGUuZHJhZ2dpbmcgPyB1bmRlZmluZWQgOiB0aGlzLnN0YXRlLnNpemV9XG4gICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlPXt0aGlzLmhhbmRsZURyYWd9XG4gICAgICAgICAgICAgICAgICAgIG9uRHJhZ1N0YXJ0ZWQ9e3RoaXMuaGFuZGxlRHJhZ1N0YXJ0fVxuICAgICAgICAgICAgICAgICAgICBvbkRyYWdGaW5pc2hlZD17dGhpcy5oYW5kbGVEcmFnRW5kfVxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBzdHlsZT17eyBiYWNrZ3JvdW5kQ29sb3I6ICdibHVlJywgaGVpZ2h0OiAnMTAwJScsIHpJbmRleDogMSwgb3BhY2l0eTogMC4xIH19IC8+XG4gICAgICAgICAgICAgICAgICAgIDxkaXYgLz5cbiAgICAgICAgICAgICAgICA8L1NwbGl0UGFuZT5cbiAgICAgICAgICAgICAgICA8ZGl2IHN0eWxlPXtPYmplY3QuYXNzaWduKHt9LCBjZW50ZXJlZFRleHRTdHlsZSwgeyBsZWZ0OiAwLCB3aWR0aDogMzAwIH0pfT5cbiAgICAgICAgICAgICAgICAgICAgQ2FuIGRyb3AgYW55d2hlcmVcbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICA8ZGl2IHN0eWxlPXtPYmplY3QuYXNzaWduKHt9LCBjZW50ZXJlZFRleHRTdHlsZSwgZHJvcFdhcm5TdHlsZSl9PlxuICAgICAgICAgICAgICAgICAgICBXaWxsIHNuYXAgdG8gZWRnZXNcbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICA8ZGl2IHN0eWxlPXtPYmplY3QuYXNzaWduKHt9LCBjZW50ZXJlZFRleHRTdHlsZSwgeyBsZWZ0OiA1MDAsIHdpZHRoOiAnY2FsYygxMDAlIC0gNTAwcHgpJyB9KX0+XG4gICAgICAgICAgICAgICAgICAgIENhbiBkcm9wIGFueXdoZXJlXG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgIC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JlbixcbiAgICAgICAgICAgICAgICBjbGFzc05hbWUgPSBfcHJvcHMuY2xhc3NOYW1lLFxuICAgICAgICAgICAgICAgIHByZWZpeGVyID0gX3Byb3BzLnByZWZpeGVyLFxuICAgICAgICAgICAgICAgIHNwbGl0ID0gX3Byb3BzLnNwbGl0LFxuICAgICAgICAgICAgICAgIHN0eWxlUHJvcHMgPSBfcHJvcHMuc3R5bGU7XG4gICAgICAgICAgICB2YXIgc2l6ZSA9IHRoaXMuc3RhdGUuc2l6ZTtcblxuICAgICAgICAgICAgdmFyIGNsYXNzZXMgPSBbJ1BhbmUnLCBzcGxpdCwgY2xhc3NOYW1lXTtcblxuICAgICAgICAgICAgdmFyIHN0eWxlID0gX2V4dGVuZHMoe30sIHN0eWxlUHJvcHMgfHwge30sIHtcbiAgICAgICAgICAgICAgICBmbGV4OiAxLFxuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiAncmVsYXRpdmUnLFxuICAgICAgICAgICAgICAgIG91dGxpbmU6ICdub25lJ1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGlmIChzaXplICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICBpZiAoc3BsaXQgPT09ICd2ZXJ0aWNhbCcpIHtcbiAgICAgICAgICAgICAgICAgICAgc3R5bGUud2lkdGggPSBzaXplO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHN0eWxlLmhlaWdodCA9IHNpemU7XG4gICAgICAgICAgICAgICAgICAgIHN0eWxlLmRpc3BsYXkgPSAnZmxleCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHN0eWxlLmZsZXggPSAnbm9uZSc7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBfcmVhY3QyLmRlZmF1bHQuY3JlYXRlRWxlbWVudChcbiAgICAgICAgICAgICAgICAnZGl2JyxcbiAgICAgICAgICAgICAgICB7IGNsYXNzTmFt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seSh0aGlzLCBhcmd1bWVudHMpKTtcbiAgICB9XG5cbiAgICBfY3JlYXRlQ2xhc3MoUmVzaXplciwgW3tcbiAgICAgICAga2V5OiAncmVuZGVyJyxcbiAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIHJlbmRlcigpIHtcbiAgICAgICAgICAgIHZhciBfcHJvcHMgPSB0aGlzLnByb3BzLFxuICAgICAgICAgICAgICAgIGNsYXNzTmFtZSA9IF9wcm9wcy5jbGFzc05hbWUsXG4gICAgICAgICAgICAgICAgX29uQ2xpY2sgPSBfcHJvcHMub25DbGljayxcbiAgICAgICAgICAgICAgICBfb25Eb3VibGVDbGljayA9IF9wcm9wcy5vbkRvdWJsZUNsaWNrLFxuICAgICAgICAgICAgICAgIF9vbk1vdXNlRG93biA9IF9wcm9wcy5vbk1vdXNlRG93bixcbiAgICAgICAgICAgICAgICBfb25Ub3VjaEVuZCA9IF9wcm9wcy5vblRvdWNoRW5kLFxuICAgICAgICAgICAgICAgIF9vblRvdWNoU3RhcnQgPSBfcHJvcHMub25Ub3VjaFN0YXJ0LFxuICAgICAgICAgICAgICAgIHByZWZpeGVyID0gX3Byb3BzLnByZWZpeGVyLFxuICAgICAgICAgICAgICAgIHJlc2l6ZXJDbGFzc05hbWUgPSBfcHJvcHMucmVzaXplckNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICBzcGxpdCA9IF9wcm9wcy5zcGxpdCxcbiAgICAgICAgICAgICAgICBzdHlsZSA9IF9wcm9wcy5zdHlsZTtcblxuICAgICAgICAgICAgdmFyIGNsYXNzZXMgPSBbcmVzaXplckNsYXNzTmFtZSwgc3BsaXQsIGNsYXNzTmFtZV07XG5cbiAgICAgICAgICAgIHJldHVybiBfcmVhY3QyLmRlZmF1bHQuY3JlYXRlRWxlbWVudCgnc3BhbicsIHtcbiAgICAgICAgICAgICAgICBjbGFzc05hbWU6IGNsYXNzZXMuam9pbignICcpLFxuICAgICAgICAgICAgICAgIHN0eWxlOiBwcmVmaXhlci5wcmVmaXgoc3R5bGUpIHx8IHt9LFxuICAgICAgICAgICAgICAgIG9uTW91c2VEb3duOiBmdW5jdGlvbiBvbk1vdXNlRG93bihldmVudCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gX29uTW91c2VEb3duKGV2ZW50KTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG9uVG91Y2hTdGFydDogZnVuY3Rpb24gb25Ub3VjaFN0YXJ0KGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgIF9vblRvdWNoU3RhcnQoZXZlbnQpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgb25Ub3VjaEVuZDogZnVuY3Rpb24gb25Ub3VjaEVuZChldmVudCkge1xuICAgICAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICBfb25Ub3VjaEVuZChldmVudCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zdGF0aWMtZWxlbWVudC1pbnRlcmFjdGlvbnNcbiAgICAgICAgICAgICAgICAsIG9uQ2xpY2s6IGZ1bmN0aW9uIG9uQ2xpY2soZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKF9vbkNsaWNrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgX29uQ2xpY2soZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBvbkRvdWJsZUNsaWNrOiBmdW5jdGlvbiBvbkRvdWJsZUNsaWNrKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChfb25Eb3VibGVD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N0aW9uIG9uTW91c2VEb3duKGV2ZW50KSB7XG4gICAgICAgICAgICB2YXIgZXZlbnRXaXRoVG91Y2hlcyA9IF9leHRlbmRzKHt9LCBldmVudCwgeyB0b3VjaGVzOiBbeyBjbGllbnRYOiBldmVudC5jbGllbnRYLCBjbGllbnRZOiBldmVudC5jbGllbnRZIH1dIH0pO1xuICAgICAgICAgICAgdGhpcy5vblRvdWNoU3RhcnQoZXZlbnRXaXRoVG91Y2hlcyk7XG4gICAgICAgIH1cbiAgICB9LCB7XG4gICAgICAgIGtleTogJ29uVG91Y2hTdGFydCcsXG4gICAgICAgIHZhbHVlOiBmdW5jdGlvbiBvblRvdWNoU3RhcnQoZXZlbnQpIHtcbiAgICAgICAgICAgIHZhciBfcHJvcHMgPSB0aGlzLnByb3BzLFxuICAgICAgICAgICAgICAgIGFsbG93UmVzaXplID0gX3Byb3BzLmFsbG93UmVzaXplLFxuICAgICAgICAgICAgICAgIG9uRHJhZ1N0YXJ0ZWQgPSBfcHJvcHMub25EcmFnU3RhcnRlZCxcbiAgICAgICAgICAgICAgICBzcGxpdCA9IF9wcm9wcy5zcGxpdDtcblxuICAgICAgICAgICAgaWYgKGFsbG93UmVzaXplKSB7XG4gICAgICAgICAgICAgICAgdW5Gb2N1cyhkb2N1bWVudCwgd2luZG93KTtcbiAgICAgICAgICAgICAgICB2YXIgcG9zaXRpb24gPSBzcGxpdCA9PT0gJ3ZlcnRpY2FsJyA/IGV2ZW50LnRvdWNoZXNbMF0uY2xpZW50WCA6IGV2ZW50LnRvdWNoZXNbMF0uY2xpZW50WTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9uRHJhZ1N0YXJ0ZWQgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgb25EcmFnU3RhcnRlZCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLnNldFN0YXRlKHtcbiAgICAgICAgICAgICAgICAgICAgYWN0aXZlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogcG9zaXRpb25cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0sIHtcbiAgICAgICAga2V5OiAnb25Nb3VzZU1vdmUnLFxuICAgICAgICB2YWx1ZTogZnVuY3Rpb24gb25Nb3VzZU1vdmUoZXZlbnQpIHtcbiAgICAgICAgICAgIHZhciBldmVudFdpdGhUb3VjaGVzID0gX2V4dGVuZHMoe30sIGV2ZW50LCB7IHRvdWNoZXM6IFt7IGNsaWVudFg6IGV2ZW50LmNsaWVudFgsIGNsaWVudFk6IGV2ZW50LmNsaWVudFkgfV0gfSk7XG4gICAgICAgICAgICB0aGlzLm9uVG91Y2hNb3ZlKGV2ZW50V2l0aFRvdWNoZXMpO1xuICAgICAgICB9XG4gICAgfSwge1xuICAgICAgICBrZXk6ICdvblRvdWNoTW92ZScsXG4gICAgICAgIHZhbHVlOiBmdW5jdGlvbiBvblRvdWNoTW92ZShldmVudCkge1xuICAgICAgICAgICAgdmFyIF9wcm9wczIgPSB0aGlzLnByb3BzLFxuICAgICAgICAgICAgICAgIGFsbG93UmVzaXplID0gX3Byb3BzMi5hbGxvd1Jlc2l6ZSxcbiAgICAgICAgICAgICAgICBtYXhTaXplID0gX3Byb3BzMi5tYXhTaXplLFxuICAgICAgICAgICAgICAgIG1pblNpemUgPSBfcHJvcHMyLm1pblNpemUsXG4gICAgICAgICAgICAgICAgb25DaGFuZ2UgPSBfcHJvcHMyLm9uQ2hhbmdlLFxuICAgICAgICAgICAgICAgIHNwbGl0ID0gX3Byb3BzMi5zcGxpdDtcbiAgICAgICAgICAgIHZhciBfc3RhdGUgPSB0aGlzLnN0YXRlLFxuICAgICAgICAgICAgICAgIGFjdGl2ZSA9IF9zdGF0ZS5hY3RpdmUsXG4gICAgICAgICAgICAgICAgcG9zaXRpb24gPSBfc3RhdGUucG9zaXRpb247XG5cbiAgICAgICAgICAgIGlmIChh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A9IG1heFNpemU7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF4U2l6ZSAhPT0gdW5kZWZpbmVkICYmIG1heFNpemUgPD0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzcGxQYW5lID0gdGhpcy5zcGxpdFBhbmU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNwbGl0ID09PSAndmVydGljYWwnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld01heFNpemUgPSBzcGxQYW5lLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLndpZHRoICsgbWF4U2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdNYXhTaXplID0gc3BsUGFuZS5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKS5oZWlnaHQgKyBtYXhTaXplO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5ld1NpemUgPSBzaXplIC0gbmV3UG9zaXRpb247XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdTaXplIDwgbWluU2l6ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1NpemUgPSBtaW5TaXplO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtYXhTaXplICE9PSB1bmRlZmluZWQgJiYgbmV3U2l6ZSA+IG5ld01heFNpemUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdTaXplID0gbmV3TWF4U2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRTdGF0ZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBjdXJyZW50LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNpemVkOiB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvbkNoYW5nZSkgb25DaGFuZ2UobmV3U2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFN0YXRlKHsgZHJhZ2dlZFNpemU6IG5ld1NpemUgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZWYuc2V0U3RhdGUoeyBzaXplOiBuZXdTaXplIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSwge1xuICAgICAgICBrZXk6ICdvbk1vdXNlVXAnLFxuICAgICAgICB2YWx1ZTogZnVuY3Rpb24gb25Nb3VzZVVwKCkge1xuICAgICAgICAgICAgdmFyIF9wcm9wczMgPSB0aGlzLnByb3BzLFxuICAgICAgICAgICAgICAgIGFsbG93UmVzaXplID0gX3Byb3BzMy5hbGxvd1Jlc2l6ZSxcbiAgICAgICAgICAgICAgICBvbkRyYWdGaW5pc2hlZCA9IF9wcm9wczMub25EcmFnRmluaXNoZWQ7XG4gICAgICAgICAgICB2YXIgX3N0YXRlMiA9IHRoaXMuc3RhdGUsXG4gICAgICAgICAgICAgICAgYWN0aXZlID0gX3N0YXRlMi5hY3RpdmUsXG4gICAgICAgICAgICAgICAgZHJhZ2dlZFNpemUgPSBfc3RhdGUyLmRyYWdnZWRTaXplO1xuXG4gICAgICAgICAgICBpZiAoYWxsb3dSZXNpemUgJiYgYWN0aXZlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBvbkRyYWdGaW5pc2hlZCA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICBvbkRyYWdGaW5pc2hlZChkcmFnZ2VkU2l6ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuc2V0U3RhdGUoeyBhY3RpdmU6IGZhbHNlIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSwge1xuICAgICAgICBrZXk6ICdzZXRTaXplJyxcbiAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIHNldFNpemUocHJvcHMsIHN0YXRlKSB7XG4gICAgICAgICAgICB2YXIgcHJpbWFyeSA9IHRoaXMucHJvcHMucHJpbWFyeTtcblxuICAgICAgICAgICAgdmFyIHJlZiA9IHByaW1hcnkgPT09ICdmaXJzdCcgPyB0aGlzLnBhbmUxIDogdGhpcy5wYW5lMjtcbiAgICAgICAgICAgIHZhciBuZXdTaXplID0gdm9pZCAwO1xuICAgICAgICAgICAgaWYgKHJlZikge1xuICAgICAgICAgICAgICAgIG5ld1NpemUgPSBwcm9wcy5zaXplIHx8IHN0YXRlICYmIHN0YXRlLmRyYWdnZWRTaXplIHx8IHByb3BzLmRlZmF1bHRTaXplIHx8IHByb3BzLm1pblNpemU7XG4gICAgICAgICAgICAgICAgcmVmLnNldFN0YXRlKHtcbiAgICAgICAgICAgICAgICAgICAgc2l6ZTogbmV3U2l6ZVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGlmIChwcm9wcy5zaXplICE9PSBzdGF0ZS5kcmFnZ2VkU2l6ZSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFN0YXRlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRyYWdnZWRTaXplOiBuZXdTaXplXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0sIHtcbiAgICAgICAga2V5OiAncmVuZGVyJyxcbiAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIHJlbmRlcigpIHtcbiAgICAgICAgICAgIHZhciBfdGhpczIgPSB0aGlzO1xuXG4gICAgICAgICAgICB2YXIgX3Byb3BzNCA9IHRoaXMucHJvcHMsXG4gICAgICAgICAgICAgICAgYWxsb3dSZXNpemUgPSBfcHJvcHM0LmFsbG93UmVzaXplLFxuICAgICAgICAgICAgICAgIGNoaWxkcmVuID0gX3Byb3BzNC5jaGlsZHJlbixcbiAgICAgICAgICAgICAgICBjbGFzc05hbWUgPSBfcHJvcHM0LmNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICBkZWZhdWx0U2l6ZSA9IF9wcm9wczQuZGVmYXVsdFNpemUsXG4gICAgICAgICAgICAgICAgbWluU2l6ZSA9IF9wcm9wczQubWluU2l6ZSxcbiAgICAgICAgICAgICAgICBvblJlc2l6ZXJDbGljayA9IF9wcm9wczQub25SZXNpemVyQ2xpY2ssXG4gICAgICAgICAgICAgICAgb25SZXNpemVyRG91YmxlQ2xpY2sgPSBfcHJvcHM0Lm9uUmVzaXplckRvdWJsZUNsaWNrLFxuICAgICAgICAgICAgICAgIHBhbmVTdHlsZSA9IF9wcm9wczQucGFuZVN0eWxlLFxuICAgICAgICAgICAgICAgIHBhbmUxU3R5bGVQcm9wcyA9IF9wcm9wczQucGFuZTFTdHlsZSxcbiAgICAgICAgICAgICAgICBwYW5lMlN0eWxlUHJvcHMgPSBfcHJvcHM0LnBhbmUyU3R5bGUsXG4gICAgICAgICAgICAgICAgcHJpbWFyeSA9IF9wcm9wczQucHJpbWFyeSxcbiAgICAgICAgICAgICAgICBwcmVmaXhlciA9IF9wcm9wczQucHJlZml4ZXIsXG4gICAgICAgICAgICAgICAgcmVzaXplckNsYXNzTmFtZSA9IF9wcm9wczQucmVzaXplckNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICByZXNpemVyU3R5bGUgPSBfcHJvcHM0LnJlc2l6ZXJTdHlsZSxcbiAgICAgICAgICAgICAgICBzaXplID0gX3Byb3BzNC5zaXplLFxuICAgICAgICAgICAgICAgIHNwbGl0ID0gX3Byb3BzNC5zcGxpdCxcbiAgICAgICAgICAgICAgICBzdHlsZVByb3BzID0gX3Byb3BzNC5zdHlsZTtcblxuICAgICAgICAgICAgdmFyIGRpc2FibGVkQ2xhc3MgPSBhbGxvd1Jlc2l6ZSA/ICcnIDogJ2Rpc2FibGVkJztcblxuICAgICAgICAgICAgdmFyIHN0eWxlID0gX2V4dGVuZHMoe30sIHN0eWxlUHJvcHMgfHwge30sIHtcbiAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXG4gICAgICAgICAgICAgICAgZmxleDogMSxcbiAgICAgICAgICAgICAgICBoZWlnaHQ6ICcxMDAlJyxcbiAgICAgICAgICAgICAgICBwb3NpdGlvbjogJ2Fic29sdXRlJyxcbiAgICAgICAgICAgICAgICBvdXRsaW5lOiAnbm9uZScsXG4gICAgICAgICAgICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgICAgICAgICAgIE1velVzZXJTZWxlY3Q6ICd0ZXh0JyxcbiAgICAgICAgICAgICAgICBXZWJraXRVc2VyU2VsZWN0OiAndGV4dCcsXG4gICAgICAgICAgICAgICAgbXNVc2VyU2VsZWN0OiAndGV4dCcsXG4gICAgICAgICAgICAgICAgdXNlclNlbGVjdDogJ3RleHQnXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgaWYgKHNwbGl0ID09PSAndmVydGljYWwnKSB7XG4gICAgICAgICAgICAgICAgX2V4dGVuZHMoc3R5bGUsIHtcbiAgICAgICAgICAgICAgICAgICAgZmxleERpcmVjdGlvbjogJ3JvdycsXG4gICAgICAgICAgICAgICAgICAgIGxlZnQ6IDAsXG4gICAgICAgICAgICAgICAgICAgIHJpZ2h0OiAwXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIF9leHRlbmRzKHN0eWxlLCB7XG4gICAgICAgICAgICAgICAgICAgIGJvdHRvbTogMCxcbiAgICAgICAgICAgICAgICAgICAgZmxleERpcmVjdGlvbjogJ2NvbHVtbicsXG4gICAgICAgICAgICAgICAgICAgIG1pbkhlaWdodDogJzEwMCUnLFxuICAgICAgICAgICAgICAgICAgICB0b3A6IDAsXG4gICAgICAgICAgICAgICAgICAgIHdpZHRoOiAnMTAwJSdcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIGNsYXNzZXMgPSBbJ1NwbGl0UGFuZScsIGNsYXNzTmFtZSwgc3BsaXQsIGRpc2FibGVkQ2xhc3NdO1xuICAgICAgICAgICAgdmFyIHBhbmUxU3R5bGUgPSBwcmVmaXhlci5wcmVmaXgoX2V4dGVuZHMoe30sIHBhbmVTdHlsZSB8fCB7fSwgcGFuZTFTdHlsZVByb3BzIHx8IHt9KSk7XG4gICAgICAgICAgICB2YXIgcGFuZTJTdHlsZSA9IHByZWZpeGVyLnByZWZpeChfZXh0ZW5kcyh7fSwgcGFuZVN0eWxlIHx8IHt9LCBwYW5lMlN0eWxlUHJvcHMgfHwge30pKTtcblxuICAgICAgICAgICAgcmV0dXJuIF9yZWFjdDIuZGVmYXVsdC5jcmVhdGVFbGVtZW50KFxuICAgICAgICAgICAgICAgICdkaXYnLFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lOiBjbGFzc2VzLmpvaW4oJyAnKSxcbiAgICAgICAgICAgICAgICAgICAgcmVmOiBmdW5jdGlvbiByZWYobm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMyLnNwbGl0UGFuZSA9IG5vZGU7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHN0eWxlOiBwcmVmaXhlci5wcmVmaXgoc3R5bGUpXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBfcmVhY3QyLmRlZmF1bHQuY3JlYXRlRWxlbWVudChcbiAgICAgICAgICAgICAgICAgICAgX1BhbmUyLmRlZmF1bHQsXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZTogJ1BhbmUxJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleTogJ3BhbmUxJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZjogZnVuY3Rpb24gcmVmKG5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpczIucGFuZTEgPSBub2RlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IHByaW1hcnkgPT09ICdmaXJzdCcgPyBzaXplIHx8IGRlZmF1bHRTaXplIHx8IG1pblNpemUgOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBzcGxpdDogc3BsaXQsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdHlsZTogcGFuZTFTdHlsZVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBjaGlsZHJlblswXVxuICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgX3JlYWN0Mi5kZWZhdWx0LmNyZWF0ZUVsZW1lbnQoX1Jlc2l6ZXIyLmRlZmF1bHQsIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lOiBkaXNhYmxlZENsYXNzLFxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBvblJlc2l6ZXJDbGljayxcbiAgICAgICAgICAgICAgICAgICAgb25Eb3VibGVDbGljazogb25SZXNpemVyRG91YmxlQ2xpY2ssXG4gICAgICAgICAgICAgICAgICAgIG9uTW91c2VEb3duOiB0aGlzLm9uTW91c2VEb3duLFxuICAgICAgICAgICAgICAgICAgICBvblRvdWNoU3RhcnQ6IHRoaXMub25Ub3VjaFN0YXJ0LFxuICAgICAgICAgICAgICAgICAgICBvblRvdWNoRW5kOiB0aGlzLm9uTW91c2VVcCxcbiAgICAgICAgICAgICAgICAgICAga2V5OiAncmVzaXplcicsXG4gICAgICAgICAgICAgICAgICAgIHJlZjogZnVuY3Rpb24gcmVmKG5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzMi5yZXNpemVyID0gbm9kZTtcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgcmVzaXplckNsYXNzTmFtZTogcmVzaXplckNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgc3BsaXQ6IHNwbGl0LFxuICAgICAgICAgICAgICAgICAgICBzdHlsZTogcmVzaXplclN0eWxlIHx8IHt9XG4gICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgX3JlYWN0Mi5kZWZhdWx0LmNyZWF0ZUVsZW1lbnQoXG4gICAgICAgICAgICAgICAgICAgIF9QYW5lMi5kZWZhdWx0LFxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU6ICdQYW5lMicsXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk6ICdwYW5lMicsXG4gICAgICAgICAgICAgICAgICAgICAgICByZWY6IGZ1bmN0aW9uIHJlZihub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMyLnBhbmUyID0gbm9kZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBwcmltYXJ5ID09PSAnc2Vjb25kJyA/IHNpemUgfHwgZGVmYXVsdFNpemUgfHwgbWluU2l6ZSA6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNwbGl0OiBzcGxpdCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlOiBwYW5lMlN0eWxlXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuWzFdXG4gICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgIH1d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HJ1bWVudGF0aW9uLmRlYnVnVG9vbC5vbkhvc3RPcGVyYXRpb24oe1xuICAgICAgICAgICAgICBpbnN0YW5jZUlEOiBwYXJlbnROb2RlRGVidWdJRCxcbiAgICAgICAgICAgICAgdHlwZTogJ21vdmUgY2hpbGQnLFxuICAgICAgICAgICAgICBwYXlsb2FkOiB7IGZyb21JbmRleDogdXBkYXRlLmZyb21JbmRleCwgdG9JbmRleDogdXBkYXRlLnRvSW5kZXggfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlICdTRVRfTUFSS1VQJzpcbiAgICAgICAgICBzZXRJbm5lckhUTUwocGFyZW50Tm9kZSwgdXBkYXRlLmNvbnRlbnQpO1xuICAgICAgICAgIGlmIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB7XG4gICAgICAgICAgICBSZWFjdEluc3RydW1lbnRhdGlvbi5kZWJ1Z1Rvb2wub25Ib3N0T3BlcmF0aW9uKHtcbiAgICAgICAgICAgICAgaW5zdGFuY2VJRDogcGFyZW50Tm9kZURlYnVnSUQsXG4gICAgICAgICAgICAgIHR5cGU6ICdyZXBsYWNlIGNoaWxkcmVuJyxcbiAgICAgICAgICAgICAgcGF5bG9hZDogdXBkYXRlLmNvbnRlbnQudG9TdHJpbmcoKVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICBjYXNlICdURVhUX0NPTlRFTlQnOlxuICAgICAgICAgIHNldFRleHRDb250ZW50KHBhcmVudE5vZGUsIHVwZGF0ZS5jb250ZW50KTtcbiAgICAgICAgICBpZiAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykge1xuICAgICAgICAgICAgUmVhY3RJbnN0cnVtZW50YXRpb24uZGVidWdUb29sLm9uSG9zdE9wZXJhdGlvbih7XG4gICAgICAgICAgICAgI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gKlxuICogIC0gVGhlIGBFdmVudFBsdWdpbkh1YmAgdGhlbiBkaXNwYXRjaGVzIHRoZSBldmVudHMuXG4gKlxuICogT3ZlcnZpZXcgb2YgUmVhY3QgYW5kIHRoZSBldmVudCBzeXN0ZW06XG4gKlxuICogKy0tLS0tLS0tLS0tLSsgICAgLlxuICogfCAgICBET00gICAgIHwgICAgLlxuICogKy0tLS0tLS0tLS0tLSsgICAgLlxuICogICAgICAgfCAgICAgICAgICAgLlxuICogICAgICAgdiAgICAgICAgICAgLlxuICogKy0tLS0tLS0tLS0tLSsgICAgLlxuICogfCBSZWFjdEV2ZW50IHwgICAgLlxuICogfCAgTGlzdGVuZXIgIHwgICAgLlxuICogKy0tLS0tLS0tLS0tLSsgICAgLiAgICAgICAgICAgICAgICAgICAgICAgICArLS0tLS0tLS0tLS0rXG4gKiAgICAgICB8ICAgICAgICAgICAuICAgICAgICAgICAgICAgKy0tLS0tLS0tK3xTaW1wbGVFdmVudHxcbiAqICAgICAgIHwgICAgICAgICAgIC4gICAgICAgICAgICAgICB8ICAgICAgICAgfFBsdWdpbiAgICAgfFxuICogKy0tLS0tfC0tLS0tLSsgICAgLiAgICAgICAgICAgICAgIHYgICAgICAgICArLS0tLS0tLS0tLS0rXG4gKiB8ICAgICB8ICAgICAgfCAgICAuICAgICstLS0tLS0tLS0tLS0tLSsgICAgICAgICAgICAgICAgICAgICstLS0tLS0tLS0tLS0rXG4gKiB8ICAgICArLS0tLS0tLS0tLS0uLS0tPnxFdmVudFBsdWdpbkh1YnwgICAgICAgICAgICAgICAgICAgIHwgICAgRXZlbnQgICB8XG4gKiB8ICAgICAgICAgICAgfCAgICAuICAgIHwgICAgICAgICAgICAgIHwgICAgICstLS0tLS0tLS0tLSsgIHwgUHJvcGFnYXRvcnN8XG4gKiB8IFJlYWN0RXZlbnQgfCAgICAuICAgIHwgICAgICAgICAgICAgIHwgICAgIHxUYXBFdmVudCAgIHwgIHwtLS0tLS0tLS0tLS18XG4gKiB8ICBFbWl0dGVyICAgfCAgICAuICAgIHwgICAgICAgICAgICAgIHw8LS0tK3xQbHVnaW4gICAgIHwgIHxvdGhlciBwbHVnaW58XG4gKiB8ICAgICAgICAgICAgfCAgICAuICAgIHwgICAgICAgICAgICAgIHwgICAgICstLS0tLS0tLS0tLSsgIHwgIHV0aWxpdGllcyB8XG4gKiB8ICAgICArLS0tLS0tLS0tLS0uLS0tPnwgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICstLS0tLS0tLS0tLS0rXG4gKiB8ICAgICB8ICAgICAgfCAgICAuICAgICstLS0tLS0tLS0tLS0tLStcbiAqICstLS0tLXwtLS0tLS0rICAgIC4gICAgICAgICAgICAgICAgXiAgICAgICAgKy0tLS0tLS0tLS0tK1xuICogICAgICAgfCAgICAgICAgICAgLiAgICAgICAgICAgICAgICB8ICAgICAgICB8RW50ZXIvTGVhdmV8XG4gKiAgICAgICArICAgICAgICAgICAuICAgICAgICAgICAgICAgICstLS0tLS0tK3xQbHVnaW4gICAgIHxcbiAqICstLS0tLS0tLS0tLS0tKyAgIC4gICAgICAgICAgICAgICAgICAgICAgICAgKy0tLS0tLS0tLS0tK1xuICogfCBhcHBsaWNhdGlvbiB8ICAgLlxuICogfC0tLS0tLS0tLS0tLS18ICAgLlxuICogfCAgICAgICAgICAgICB8ICAgLlxuICogfCAgICAgICAgICAgICB8ICAgLlxuICogKy0tLS0tLS0tLS0tLS0rICAgLlxuICogICAgICAgICAgICAgICAgICAgLlxuICogICAgUmVhY3QgQ29yZSAgICAgLiAgR2VuZXJhbCBQdXJwb3NlIEV2ZW50IFBsdWdpbiBTeXN0ZW1cbiAqL1xuXG52YXIgaGFzRXZlbnRQYWdlWFk7XG52YXIgYWxyZWFkeUxpc3RlbmluZ1RvID0ge307XG52YXIgaXNNb25pdG9yaW5nU2Nyb2xsVmFsdWUgPSBmYWxzZTtcbnZhciByZWFjdFRvcExpc3RlbmVyc0NvdW50ZXIgPSAwO1xuXG4vLyBGb3IgZXZlb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ICAgICAgICArXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgfFxuICogICAgICAgICAgICAgICAgICAgICstLS0tLS0tLS0tLS0tLS0tLXwtLS0tLS0tLXwtLS0tLS0tLS0tLS0tLStcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICB2ICAgICAgICB8ICAgICAgICAgICAgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgICAgICstLS0tLS0tLS0tLS0tLS0rICAgfCAgICAgICAgICAgICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICArLS18ICAgIHdyYXBwZXIxICAgfC0tLXwtLS0tKyAgICAgICAgIHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgfCAgKy0tLS0tLS0tLS0tLS0tLSsgICB2ICAgIHwgICAgICAgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgIHwgICAgICAgICAgKy0tLS0tLS0tLS0tLS0rICB8ICAgICAgICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICB8ICAgICArLS0tLXwgICB3cmFwcGVyMiAgfC0tLS0tLS0tKyAgIHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgfCAgICAgfCAgICArLS0tLS0tLS0tLS0tLSsgIHwgICAgIHwgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgIHwgICAgIHwgICAgICAgICAgICAgICAgICAgICB8ICAgICB8ICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICB2ICAgICB2ICAgICAgICAgICAgICAgICAgICAgdiAgICAgdiAgIHwgd3JhcHBlclxuICogICAgICAgICAgICAgICAgICAgIHwgKy0tLSsgKy0tLSsgICArLS0tLS0tLS0tKyAgICstLS0rICstLS0rIHwgaW52YXJpYW50c1xuICogcGVyZm9ybShhbnlNZXRob2QpIHwgfCAgIHwgfCAgIHwgICB8ICAgICAgICAgfCAgIHwgICB8IHwgICB8IHwgbWFpbnRhaW5lZFxuICogKy0tLS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lzVmFsaWRFbGVtZW50KHByb3BWYWx1ZSkpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9XG5cbiAgICAgIHZhciBpdGVyYXRvckZuID0gZ2V0SXRlcmF0b3JGbihwcm9wVmFsdWUpO1xuICAgICAgaWYgKGl0ZXJhdG9yRm4pIHtcbiAgICAgICAgdmFyIGl0ZXJhdG9yID0gaXRlcmF0b3JGbi5jYWxsKHByb3BWYWx1ZSk7XG4gICAgICAgIHZhciBzdGVwO1xuICAgICAgICBpZiAoaXRlcmF0b3JGbiAhPT0gcHJvcFZhbHVlLmVudHJpZXMpIHtcbiAgICAgICAgICB3aGlsZSAoIShzdGVwID0gaXRlcmF0b3IubmV4dCgpKS5kb25lKSB7XG4gICAgICAgICAgICBpZiAoIWlzTm9kZShzdGVwLnZhbHVlKSkge1xuICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIEl0ZXJhdG9yIHdpbGwgcHJvdmlkZSBlbnRyeSBbayx2XSB0dXBsZXMgcmF0aGVyIHRoYW4gdmFsdWVzLlxuICAgICAgICAgIHdoaWxlICghKHN0ZXAgPSBpdGVyYXRvci5uZXh0KCkpLmRvbmUpIHtcbiAgICAgICAgICAgIHZhciBlbnRyeSA9IHN0ZXAudmFsdWU7XG4gICAgICAgICAgICBpZiAoZW50cnkpIHtcbiAgICAgICAgICAgICAgaWYgKCFpc05vZGUoZW50cnlbMV0pKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB0cnVlO1xuICAgIGRlZmF1bHQ6XG4gICAgICByZXR1cm4gZmFsc2U7XG4g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luZyA/IHVuZGVmaW5lZCA6IHRoaXMuc3RhdGUuc2l6ZX1cbiAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U9e3RoaXMuaGFuZGxlRHJhZ31cbiAgICAgICAgICAgICAgICAgICAgb25EcmFnU3RhcnRlZD17dGhpcy5oYW5kbGVEcmFnU3RhcnR9XG4gICAgICAgICAgICAgICAgICAgIG9uRHJhZ0ZpbmlzaGVkPXt0aGlzLmhhbmRsZURyYWdFbmR9XG4gICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICA8ZGl2IHN0eWxlPXt7IGJhY2tncm91bmRDb2xvcjogJ2JsdWUnLCBoZWlnaHQ6ICcxMDAlJywgekluZGV4OiAxLCBvcGFjaXR5OiAwLjEgfX0gLz5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiAvPlxuICAgICAgICAgICAgICAgIDwvU3BsaXRQYW5lPlxuICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9e09iamVjdC5hc3NpZ24oe30sIGNlbnRlcmVkVGV4dFN0eWxlLCB7IGxlZnQ6IDAsIHdpZHRoOiAzMDAgfSl9PlxuICAgICAgICAgICAgICAgICAgICBDYW4gZHJvcCBhbnl3aGVyZVxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9e09iamVjdC5hc3NpZ24oe30sIGNlbnRlcmVkVGV4dFN0eWxlLCBkcm9wV2FyblN0eWxlKX0+XG4gICAgICAgICAgICAgICAgICAgIFdpbGwgc25hcCB0byBlZGdlc1xuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9e09iamVjdC5hc3NpZ24oe30sIGNlbnRlcmVkVGV4dFN0eWxlLCB7IGxlZnQ6IDUwMCwgd2lkdGg6ICdjYWxjKDEwMCUgLSA1MDBweCknIH0pfT5cbiAgICAgICAgICAgICAgICAgICAgQ2FuIGRyb3AgYW55d2hlcmVcbiAgICAgICAgIC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4gICAgICAgICAgICB2YXIgX3Byb3BzID0gdGhpcy5wcm9wcyxcbiAgICAgICAgICAgICAgICBjaGlsZHJlbiA9IF9wcm9wcy5jaGlsZHJlbixcbiAgICAgICAgICAgICAgICBjbGFzc05hbWUgPSBfcHJvcHMuY2xhc3NOYW1lLFxuICAgICAgICAgICAgICAgIHByZWZpeGVyID0gX3Byb3BzLnByZWZpeGVyLFxuICAgICAgICAgICAgICAgIHNwbGl0ID0gX3Byb3BzLnNwbGl0LFxuICAgICAgICAgICAgICAgIHN0eWxlUHJvcHMgPSBfcHJvcHMuc3R5bGU7XG4gICAgICAgICAgICB2YXIgc2l6ZSA9IHRoaXMuc3RhdGUuc2l6ZTtcblxuICAgICAgICAgICAgdmFyIGNsYXNzZXMgPSBbJ1BhbmUnLCBzcGxpdCwgY2xhc3NOYW1lXTtcblxuICAgICAgICAgICAgdmFyIHN0eWxlID0gX2V4dGVuZHMoe30sIHN0eWxlUHJvcHMgfHwge30sIHtcbiAgICAgICAgICAgICAgICBmbGV4OiAxLFxuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiAncmVsYXRpdmUnLFxuICAgICAgICAgICAgICAgIG91dGxpbmU6ICdub25lJ1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGlmIChzaXplICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICBpZiAoc3BsaXQgPT09ICd2ZXJ0aWNhbCcpIHtcbiAgICAgICAgICAgICAgICAgICAgc3R5bGUud2lkdGggPSBzaXplO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHN0eWxlLmhlaWdodCA9IHNpemU7XG4gICAgICAgICAgICAgICAgICAgIHN0eWxlLmRpc3BsYXkgPSAnZmxleCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHN0eWxlLmZsZXggPSAnbm9uZSc7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBfcm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G4gICAgICAgICAgICByZXR1cm4gX3JlYWN0Mi5kZWZhdWx0LmNyZWF0ZUVsZW1lbnQoJ3NwYW4nLCB7XG4gICAgICAgICAgICAgICAgY2xhc3NOYW1lOiBjbGFzc2VzLmpvaW4oJyAnKSxcbiAgICAgICAgICAgICAgICBzdHlsZTogcHJlZml4ZXIucHJlZml4KHN0eWxlKSB8fCB7fSxcbiAgICAgICAgICAgICAgICBvbk1vdXNlRG93bjogZnVuY3Rpb24gb25Nb3VzZURvd24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF9vbk1vdXNlRG93bihldmVudCk7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBvblRvdWNoU3RhcnQ6IGZ1bmN0aW9uIG9uVG91Y2hTdGFydChldmVudCkge1xuICAgICAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICBfb25Ub3VjaFN0YXJ0KGV2ZW50KTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG9uVG91Y2hFbmQ6IGZ1bmN0aW9uIG9uVG91Y2hFbmQoZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICAgICAgX29uVG91Y2hFbmQoZXZlbnQpO1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgb25DbGljazogZnVuY3Rpb24gb25DbGljayhldmVudCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoX29uQ2xpY2spIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBfb25DbGljayhldmVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG9uRG91YmxlQ2xpY2s6IGZ1bm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25EcmFnU3RhcnRlZCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLnNldFN0YXRlKHtcbiAgICAgICAgICAgICAgICAgICAgYWN0aXZlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbjogcG9zaXRpb25cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0sIHtcbiAgICAgICAga2V5OiAnb25Nb3VzZU1vdmUnLFxuICAgICAgICB2YWx1ZTogZnVuY3Rpb24gb25Nb3VzZU1vdmUoZXZlbnQpIHtcbiAgICAgICAgICAgIHZhciBldmVudFdpdGhUb3VjaGVzID0gX2V4dGVuZHMoe30sIGV2ZW50LCB7IHRvdWNoZXM6IFt7IGNsaWVudFg6IGV2ZW50LmNsaWVudFgsIGNsaWVudFk6IGV2ZW50LmNsaWVudFkgfV0gfSk7XG4gICAgICAgICAgICB0aGlzLm9uVG91Y2hNb3ZlKGV2ZW50V2l0aFRvdWNoZXMpO1xuICAgICAgICB9XG4gICAgfSwge1xuICAgICAgICBrZXk6ICdvblRvdWNoTW92ZScsXG4gICAgICAgIHZhbHVlOiBmdW5jdGlvbiBvblRvdWNoTW92ZShldmVudCkge1xuICAgICAgICAgICAgdmFyIF9wcm9wczIgPSB0aGlzLnByb3BzLFxuICAgICAgICAgICAgICAgIGFsbG93UmVzaXplID0gX3Byb3BzMi5hbGxvd1Jlc2l6ZSxcbiAgICAgICAgICAgICAgICBtYXhTaXplID0gX3Byb3BzMi5tYXhTaXplLFxuICAgICAgICAgICAgICAgIG1pblNpemUgPSBfcHJvcHMyLm1pblNpemUsXG4gICAgICAgICAgICAgICAgb25DaGFuZ2UgPSBfcHJvcHMyLm9uQ2hhbmdlLFxuICAgICAgICAgICAgICAgIHNwbGl0ID0gX3Byb3BzMi5zcGxpdDtcbiAgICAgICAgICAgIHZhciBfc3RhdGUgPSB0aGlzLnN0YXRlLFxuICAgICAgICAgICA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WFyeUZpcnN0ID8gcG9zaXRpb24gLSBjdXJyZW50IDogY3VycmVudCAtIHBvc2l0aW9uO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbmV3TWF4U2l6ZSA9IG1heFNpemU7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF4U2l6ZSAhPT0gdW5kZWZpbmVkICYmIG1heFNpemUgPD0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzcGxQYW5lID0gdGhpcy5zcGxpdFBhbmU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNwbGl0ID09PSAndmVydGljYWwnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld01heFNpemUgPSBzcGxQYW5lLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLndpZHRoICsgbWF4U2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdNYXhTaXplID0gc3BsUGFuZS5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKS5oZWlnaHQgKyBtYXhTaXplO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5ld1NpemUgPSBzaXplIC0gbmV3UG9zaXRpb247XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdTaXplIDwgbWluU2l6ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1NpemUgPSBtaW5TaXplO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtYXhTaXplICE9PSB1bmRlZmluZWQgJiYgbmV3U2l6ZSA+IG5ld01heFNpemUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdTaXplID0gbmV3TWF4U2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRTdGF0ZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBjdXJyZW50LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNpemVkOiB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvbkNoYW5nZSkgb25DaGFuZ2UobmV3U2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFN0YXRlKHsgZHJhZ2dlZFNpemU6IG5ld1NpemUgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZWYuc2V0U3RhdGUoeyBzaXplOiBuZXdTaXplIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSwge1xuICAgICAgICBrZXk6ICdvbk1vdXNlVXAnLFxuICAgICAgICB2YWx1ZTogZnVuY3Rpb24gb25Nb3VzZVVwKCkge1xuICAgICAgICAgICAgdmFyIF9wcm9wczMgPSB0aGlzLnByb3BzLFxuICAgICAgICAgICAgICAgIGFsbG93UmVzaXplID0gX3Byb3BzMy5hbGxvd1Jlc2l6ZSxcbiAgICAgICAgICAgICAgICBvbkRyYWdGaW5pc2hlZCA9IF9wcm9wczMub25EcmFnRmluaXNoZWQ7XG4gICAgICAgICAgICB2YXIgX3N0YXRlMiA9IHRoaXMuc3RhdGUsXG4gICAgICAgICAgICAgICAgYWN0aXZlID0gX3N0YXRlMi5hY3RpdmUsXG4gICAgICAgICAgICAgICAgZHJhZ2dlZFNpemUgPSBfc3RhdGUyLmRyYWdnZWRTaXplO1xuXG4gICAgICAgICAgICBpZiAoYWxsb3dSZXNpemUgJiYgYWN0aXZlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBvbkRyYWdGaW5pc2hlZCA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICBvbkRyYWdGaW5pc2hlZChkcmFnZ2VkU2l6ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMuc2V0U3RhdGUoeyBhY3RpdmU6IGZhbHNlIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSwge1xuICAgICAgICBrZXk6ICdzZXRTaXplJyxcbiAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIHNldFNpemUocHJvcHMsIHN0YXRlKSB7XG4gICAgICAgICAgICB2YXIgcHJpbWFyeSA9IHRoaXMucHJvcHMucHJpbWFyeTtcblxuICAgICAgICAgICAgdmFyIHJlZiA9IHByaW1hcnkgPT09ICdmaXJzdCcgPyB0aGlzLnBhbmUxIDogdGhpcy5wYW5lMjtcbiAgICAgICAgICAgIHZhciBuZXdTaXplID0gdm9pZCAwO1xuICAgICAgICAgICAgaWYgKHJlZikge1xuICAgICAgICAgICAgICAgIG5ld1NpemUgPSBwcm9wcy5zaXplIHx8IHN0YXRlICYmIHN0YXRlLmRyYWdnZWRTaXplIHx8IHByb3BzLmRlZmF1bHRTaXplIHx8IHByb3BzLm1pblNpemU7XG4gICAgICAgICAgICAgICAgcmVmLnNldFN0YXRlKHtcbiAgICAgICAgICAgICAgICAgICAgc2l6ZTogbmV3U2l6ZVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGlmIChwcm9wcy5zaXplICE9PSBzdGF0ZS5kcmFnZ2VkU2l6ZSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFN0YXRlKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRyYWdnZWRTaXplOiBuZXdTaXplXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0sIHtcbiAgICAgICAga2V5OiAncmVuZGVyJyxcbiAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIHJlbmRlcigpIHtcbiAgICAgICAgICAgIHZhciBfdGhpczIgPSB0aGlzO1xuXG4gICAgICAgICAgICB2YXIgX3Byb3BzNCA9IHRoaXMucHJvcHMsXG4gICAgICAgICAgICAgICAgYWxsb3dSZXNpemUgPSBfcHJvcHM0LmFsbG93UmVzaXplLFxuICAgICAgICAgICAgICAgIGNoaWxkcmVuID0gX3Byb3BzNC5jaGlsZHJlbixcbiAgICAgICAgICAgICAgICBjbGFzc05hbWUgPSBfcHJvcHM0LmNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICBkZWZhdWx0U2l6ZSA9IF9wcm9wczQuZGVmYXVsdFNpemUsXG4gICAgICAgICAgICAgICAgbWluU2l6ZSA9IF9wcm9wczQubWluU2l6ZSxcbiAgICAgICAgICAgICAgICBvblJlc2l6ZXJDbGljayA9IF9wcm9wczQub25SZXNpemVyQ2xpY2ssXG4gICAgICAgICAgICAgICAgb25SZXNpemVyRG91YmxlQ2xpY2sgPSBfcHJvcHM0Lm9uUmVzaXplckRvdWJsZUNsaWNrLFxuICAgICAgICAgICAgICAgIHBhbmVTdHlsZSA9IF9wcm9wczQucGFuZVN0eWxlLFxuICAgICAgICAgICAgICAgIHBhbmUxU3R5bGVQcm9wcyA9IF9wcm9wczQucGFuZTFTdHlsZSxcbiAgICAgICAgICAgICAgICBwYW5lMlN0eWxlUHJvcHMgPSBfcHJvcHM0LnBhbmUyU3R5bGUsXG4gICAgICAgICAgICAgICAgcHJpbWFyeSA9IF9wcm9wczQucHJpbWFyeSxcbiAgICAgICAgICAgICAgICBwcmVmaXhlciA9IF9wcm9wczQucHJlZml4ZXIsXG4gICAgICAgICAgICAgICAgcmVzaXplckNsYXNzTmFtZSA9IF9wcm9wczQucmVzaXplckNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICByZXNpemVyU3R5bGUgPSBfcHJvcHM0LnJlc2l6ZXJTdHlsZSxcbiAgICAgICAgICAgICAgICBzaXplID0gX3Byb3BzNC5zaXplLFxuICAgICAgICAgICAgICAgIHNwbGl0ID0gX3Byb3BzNC5zcGxpdCxcbiAgICAgICAgICAgICAgICBzdHlsZVByb3BzID0gX3Byb3BzNC5zdHlsZTtcblxuICAgICAgICAgICAgdmFyIGRpc2FibGVkQ2xhc3MgPSBhbGxvd1Jlc2l6ZSA/ICcnIDogJ2Rpc2FibGVkJztcblxuICAgICAgICAgICAgdmFyIHN0eWxlID0gX2V4dGVuZHMoe30sIHN0eWxlUHJvcHMgfHwge30sIHtcbiAgICAgICAgICAgICAgICBkaXNwbGF5OiAnZmxleCcsXG4gICAgICAgICAgICAgICAgZmxleDogMSxcbiAgICAgICAgICAgICAgICBoZWlnaHQ6ICcxMDAlJyxcbiAgICAgICAgICAgICAgICBwb3NpdGlvbjogJ2Fic29sdXRlJyxcbiAgICAgICAgICAgICAgICBvdXRsaW5lOiAnbm9uZScsXG4gICAgICAgICAgICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgICAgICAgICAgIE1velVzZXJTZWxlY3Q6ICd0ZXh0JyxcbiAgICAgICAgICAgICAgICBXZWJraXRVc2VyU2VsZWN0OiAndGV4dCcsXG4gICAgICAgICAgICAgICAgbXNVc2VyU2VsZWN0OiAndGV4dCcsXG4gICAgICAgICAgICAgICAgdXNlclNlbGVjdDogJ3RleHQnXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgaWYgKHNwbGl0ID09PSAndmVydGljYWwnKSB7XG4gICAgICAgICAgICAgICAgX2V4dGVuZHMoc3R5bGUsIHtcbiAgICAgICAgICAgICAgICAgICAgZmxleERpcmVjdGlvbjogJ3JvdycsXG4gICAgICAgICAgICAgICAgICAgIGxlZnQ6IDAsXG4gICAgICAgICAgICAgICAgICAgIHJpZ2h0OiAwXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIF9leHRlbmRzKHN0eWxlLCB7XG4gICAgICAgICAgICAgICAgICAgIGJvdHRvbTogMCxcbiAgICAgICAgICAgICAgICAgICAgZmxleERpcmVjdGlvbjogJ2NvbHVtbicsXG4gICAgICAgICAgICAgICAgICAgIG1pbkhlaWdodDogJzEwMCUnLFxuICAgICAgICAgICAgICAgICAgICB0b3A6IDAsXG4gICAgICAgICAgICAgICAgICAgIHdpZHRoOiAnMTAwJSdcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIGNsYXNzZXMgPSBbJ1NwbGl0UGFuZScsIGNsYXNzTmFtZSwgc3BsaXQsIGRpc2FibGVkQ2xhc3NdO1xuICAgICAgICAgICAgdmFyIHBhbmUxU3R5bGUgPSBwcmVmaXhlci5wcmVmaXgoX2V4dGVuZHMoe30sIHBhbmVTdHlsZSB8fCB7fSwgcGFuZTFTdHlsZVByb3BzIHx8IHt9KSk7XG4gICAgICAgICAgICB2YXIgcGFuZTJTdHlsZSA9IHByZWZpeGVyLnByZWZpeChfZXh0ZW5kcyh7fSwgcGFuZVN0eWxlIHx8IHt9LCBwYW5lMlN0eWxlUHJvcHMgfHwge30pKTtcblxuICAgICAgICAgICAgcmV0dXJuIF9yZWFjdDIuZGVmYXVsdC5jcmVhdGVFbGVtZW50KFxuICAgICAgICAgICAgICAgICdkaXYnLFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lOiBjbGFzc2VzLmpvaW4oJyAnKSxcbiAgICAgICAgICAgICAgICAgICAgcmVmOiBmdW5jdGlvbiByZWYobm9kZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMyLnNwbGl0UGFuZSA9IG5vZGU7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIHN0eWxlOiBwcmVmaXhlci5wcmVmaXgoc3R5bGUpXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBfcmVhY3QyLmRlZmF1bHQuY3JlYXRlRWxlbWVudChcbiAgICAgICAgICAgICAgICAgICAgX1BhbmUyLmRlZmF1bHQsXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZTogJ1BhbmUxJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleTogJ3BhbmUxJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZjogZnVuY3Rpb24gcmVmKG5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpczIucGFuZTEgPSBub2RlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IHByaW1hcnkgPT09ICdmaXJzdCcgPyBzaXplIHx8IGRlZmF1bHRTaXplIHx8IG1pblNpemUgOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBzcGxpdDogc3BsaXQsXG4gICAgICAgICAgICAgICAgICAgICAgICBzdHlsZTogcGFuZTFTdHlsZVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBjaGlsZHJlblswXVxuICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgX3JlYWN0Mi5kZWZhdWx0LmNyZWF0ZUVsZW1lbnQoX1Jlc2l6ZXIyLmRlZmF1bHQsIHtcbiAgICAgICAgICAgICAgICAgICAgY2xhc3NOYW1lOiBkaXNhYmxlZENsYXNzLFxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBvblJlc2l6ZXJDbGljayxcbiAgICAgICAgICAgICAgICAgICAgb25Eb3VibGVDbGljazogb25SZXNpemVyRG91YmxlQ2xpY2ssXG4gICAgICAgICAgICAgICAgICAgIG9uTW91c2VEb3duOiB0aGlzLm9uTW91c2VEb3duLFxuICAgICAgICAgICAgICAgICAgICBvblRvdWNoU3RhcnQ6IHRoaXMub25Ub3VjaFN0YXJ0LFxuICAgICAgICAgICAgICAgICAgICBvblRvdWNoRW5kOiB0aGlzLm9uTW91c2VVcCxcbiAgICAgICAgICAgICAgICAgICAga2V5OiAncmVzaXplcicsXG4gICAgICAgICAgICAgICAgICAgIHJlZjogZnVuY3Rpb24gcmVmKG5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzMi5yZXNpemVyID0gbm9kZTtcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgcmVzaXplckNsYXNzTmFtZTogcmVzaXplckNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgc3BsaXQ6IHNwbGl0LFxuICAgICAgICAgICAgICAgICAgICBzdHlsZTogcmVzaXplclN0eWxlIHx8IHt9XG4gICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgX3JlYWN0Mi5kZWZhdWx0LmNyZWF0ZUVsZW1lbnQoXG4gICAgICAgICAgICAgICAgICAgIF9QYW5lMi5kZWZhdWx0LFxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU6ICdQYW5lMicsXG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk6ICdwYW5lMicsXG4gICAgICAgICAgICAgICAgICAgICAgICByZWY6IGZ1bmN0aW9uIHJlZihub2RlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMyLnBhbmUyID0gbm9kZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBwcmltYXJ5ID09PSAnc2Vjb25kJyA/IHNpemUgfHwgZGVmYXVsdFNpemUgfHwgbWluU2l6ZSA6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNwbGl0OiBzcGxpdCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlOiBwYW5lMlN0eWxlXG4gICAgICAgIC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wb25lbnROYW1lXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgbWFudWFsUHJvcFR5cGVDYWxsQ2FjaGVbY2FjaGVLZXldID0gdHJ1ZTtcbiAgICAgICAgICAgIG1hbnVhbFByb3BUeXBlV2FybmluZ0NvdW50Kys7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAocHJvcHNbcHJvcE5hbWVdID09IG51bGwpIHtcbiAgICAgICAgaWYgKGlzUmVxdWlyZWQpIHtcbiAgICAgICAgICBpZiAocHJvcHNbcHJvcE5hbWVdID09PSBudWxsKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb3BUeXBlRXJyb3IoJ1RoZSAnICsgbG9jYXRpb24gKyAnIGAnICsgcHJvcEZ1bGxOYW1lICsgJ2AgaXMgbWFya2VkIGFzIHJlcXVpcmVkICcgKyAoJ2luIGAnICsgY29tcG9uZW50TmFtZSArICdgLCBidXQgaXRzIHZhbHVlIGlzIGBudWxsYC4nKSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiBuZXcgUHJvcFR5cGVFcnJvcignVGhlICcgKyBsb2NhdGlvbiArICcgYCcgKyBwcm9wRnVsbE5hbWUgKyAnYCBpcyBtYXJrZWQgYXMgcmVxdWlyZWQgaW4gJyArICgnYCcgKyBjb21wb25lbnROYW1lICsgJ2AsIGJ1dCBpdHMgdmFsdWUgaXMgYHVuZGVmaW5lZGAuJykpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcmV0dXJuIHZhbGlkYXRlKHByb3BzLCBwcm9wTmFtZSwgY29tcG9uZW50TmFtZSwgbG9jYXRpb24sIHByb3BGdWxsTmFtZSk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgdmFyIGNoYWluZWRDaGVja1R5cGUgPSBjaGVja1R5cGUuYmluZChudWxsLCBmYWxzZSk7XG4gICAgY2hhaW5lZENoZWNrVHlwZS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FuJzpcbiAgICAgICAgcmV0dXJuICFwcm9wVmFsdWU7XG4gICAgICBjYXNlICdvYmplY3QnOlxuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShwcm9wVmFsdWUpKSB7XG4gICAgICAgICAgcmV0dXJuIHByb3BWYWx1ZS5ldmVyeShpc05vZGUpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChwcm9wVmFsdWUgPT09IG51bGwgfHwgaXNWYWxpZEVsZW1lbnQocHJvcFZhbHVlKSkge1xuICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGl0ZXJhdG9yRm4gPSBnZXRJdGVyYXRvckZuKHByb3BWYWx1ZSk7XG4gICAgICAgIGlmIChpdGVyYXRvckZuKSB7XG4gICAgICAgICAgdmFyIGl0ZXJhdG9yID0gaXRlcmF0b3JGbi5jYWxsKHByb3BWYWx1ZSk7XG4gICAgICAgICAgdmFyIHN0ZXA7XG4gICAgICAgICAgaWYgKGl0ZXJhdG9yRm4gIT09IHByb3BWYWx1ZS5lbnRyaWVzKSB7XG4gICAgICAgICAgICB3aGlsZSAoIShzdGVwID0gaXRlcmF0b3IubmV4dCgpKS5kb25lKSB7XG4gICAgICAgICAgICAgIGlmICghaXNOb2RlKHN0ZXAudmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIEl0ZXJhdG9yIHdpbGwgcHJvdmlkZSBlbnRyeSBbayx2XSB0dXBsZXMgcmF0aGVyIHRoYW4gdmFsdWVzLlxuICAgICAgICAgICAgd2hpbGUgKCEoc3RlcCA9IGl0ZXJhdG9yLm5leHQoKSkuZG9uZSkge1xuICAgICAgICAgICAgICB2YXIgZW50cnkgPSBzdGVwLnZhbHVlO1xuICAgICAgICAgICAgICBpZiAoZW50cnkpIHtcbiAgICAgICAgICAgIC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wgZ2V0Tm9kZUFmdGVyKHBhcmVudE5vZGUsIHVwZGF0ZS5hZnRlck5vZGUpKTtcbiAgICAgICAgICBpZiAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykge1xuICAgICAgICAgICAgUmVhY3RJbnN0cnVtZW50YXRpb24uZGVidWdUb29sLm9uSG9zdE9wZXJhdGlvbih7XG4gICAgICAgICAgICAgIGluc3RhbmNlSUQ6IHBhcmVudE5vZGVEZWJ1Z0lELFxuICAgICAgICAgICAgICB0eXBlOiAnbW92ZSBjaGlsZCcsXG4gICAgICAgICAgICAgIHBheWxvYWQ6IHsgZnJvbUluZGV4OiB1cGRhdGUuZnJvbUluZGV4LCB0b0luZGV4OiB1cGRhdGUudG9JbmRleCB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgJ1NFVF9NQVJLVVAnOlxuICAgICAgICAgIHNldElubmVySFRNTChwYXJlbnROb2RlLCB1cGRhdGUuY29udGVudCk7XG4gICAgICAgICAgaWYgKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpIHtcbiAgICAgICAgICAgIFJlYWN0SW5zdHJ1bWVudGF0aW9uLmRlYnVnVG9vbC5vbkhvc3RPcGVyYXRpb24oe1xuICAgICAgICAgICAgICBpbnN0YW5jZUlEOiBwYXJlbnROb2RlRGVidWdJRCxcbiAgICAgICAgICAgICAgdHlwZTogJ3JlcGxhY2UgY2hpbGRyZW4nLFxuICAgICAgICAgICAgICBwYXlsb2FkOiB1cGRhdGUuY29udGVudC50b1N0cmluZygpXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIGNhc2UgJ1RFWFRfQ09OVEVOVCc6XG4gICAgICAgICAgc2V0VGV4dENvbnRlbnQocGFyZW50Tm9kZSwgdXBkYXRlLmNvbnRlbnQpO1xuICA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LS0tLS0tLS0tLS0rICAgIC4gICAgICAgICAgICAgICAgICAgICAgICAgKy0tLS0tLS0tLS0tK1xuICogICAgICAgfCAgICAgICAgICAgLiAgICAgICAgICAgICAgICstLS0tLS0tLSt8U2ltcGxlRXZlbnR8XG4gKiAgICAgICB8ICAgICAgICAgICAuICAgICAgICAgICAgICAgfCAgICAgICAgIHxQbHVnaW4gICAgIHxcbiAqICstLS0tLXwtLS0tLS0rICAgIC4gICAgICAgICAgICAgICB2ICAgICAgICAgKy0tLS0tLS0tLS0tK1xuICogfCAgICAgfCAgICAgIHwgICAgLiAgICArLS0tLS0tLS0tLS0tLS0rICAgICAgICAgICAgICAgICAgICArLS0tLS0tLS0tLS0tK1xuICogfCAgICAgKy0tLS0tLS0tLS0tLi0tLT58RXZlbnRQbHVnaW5IdWJ8ICAgICAgICAgICAgICAgICAgICB8ICAgIEV2ZW50ICAgfFxuICogfCAgICAgICAgICAgIHwgICAgLiAgICB8ICAgICAgICAgICAgICB8ICAgICArLS0tLS0tLS0tLS0rICB8IFByb3BhZ2F0b3JzfFxuICogfCBSZWFjdEV2ZW50IHwgICAgLiAgICB8ICAgICAgICAgICAgICB8ICAgICB8VGFwRXZlbnQgICB8ICB8LS0tLS0tLS0tLS0tfFxuICogfCAgRW1pdHRlciAgIHwgICAgLiAgICB8ICAgICAgICAgICAgICB8PC0tLSt8UGx1Z2luICAgICB8ICB8b3RoZXIgcGx1Z2lufFxuICogfCAgICAgICAgICAgIHwgICAgLiAgICB8ICAgICAgICAgICAgICB8ICAgICArLS0tLS0tLS0tLS0rICB8ICB1dGlsaXRpZXMgfFxuICogfCAgICAgKy0tLS0tLS0tLS0tLi0tLT58ICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICArLS0tLS0tLS0tLS0tK1xuICogfCAgICAgfCAgICAgIHwgICAgLiAgICArLS0tLS0tLS0tLS0tLS0rXG4gKiArLS0tLS18LS0tLS0tKyAgICAuICAgICAgICAgICAgICAgIF4gICAgICAgICst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3aWxsIHN1cHBseSBvbmUgYWRkaXRpb25hbFxuICogYXV0b21hdGljIGludmFyaWFudCBmb3IgeW91IC0gdGhlIGludmFyaWFudCB0aGF0IGFueSB0cmFuc2FjdGlvbiBpbnN0YW5jZVxuICogc2hvdWxkIG5vdCBiZSBydW4gd2hpbGUgaXQgaXMgYWxyZWFkeSBiZWluZyBydW4uIFlvdSB3b3VsZCB0eXBpY2FsbHkgY3JlYXRlIGFcbiAqIHNpbmdsZSBpbnN0YW5jZSBvZiBhIGBUcmFuc2FjdGlvbmAgZm9yIHJldXNlIG11bHRpcGxlIHRpbWVzLCB0aGF0IHBvdGVudGlhbGx5XG4gKiBpcyB1c2VkIHRvIHdyYXAgc2V2ZXJhbCBkaWZmZXJlbnQgbWV0aG9kcy4gV3JhcHBlcnMgYXJlIGV4dHJlbWVseSBzaW1wbGUgLVxuICogdGhleSBvbmx5IHJlcXVpcmUgaW1wbGVtZW50aW5nIHR3byBtZXRob2RzLlxuICpcbiAqIDxwcmU+XG4gKiAgICAgICAgICAgICAgICAgICAgICAgd3JhcHBlcnMgKGluamVjdGVkIGF0IGNyZWF0aW9uIHRpbWUpXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAgICAgICAgK1xuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgIHxcbiAqICAgICAgICAgICAgICAgICAgICArLS0tLS0tLS0tLS0tLS0tLS18LS0tLS0tLS18LS0tLS0tLS0tLS0tLS0rXG4gKiAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgdiAgICAgICAgfCAgICAgICAgICAgICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICAgICArLS0tLS0tLS0tLS0tLS0tKyAgIHwgICAgICAgICAgICAgIHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgKy0tfCAgICB3cmFwcGVyMSAgIHwtLS18LS0tLSsgICAgICAgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgIHwgICstLS0tLS0tLS0tLS0tLS0rICAgdiAgICB8ICAgICAgICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICB8ICAgICAgICAgICstLS0tLS0tLS0tLS0tKyAgfCAgICAgICAgIHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgfCAgICAgKy0tLS18ICAgd3JhcHBlcjIgIHwtLS0tLS0tLSsgICB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCAgIHwgICAgIHwgICAgKy0tLS0tLS0tLS0tLS0rICB8ICAgICB8ICAgfFxuICogICAgICAgICAgICAgICAgICAgIHwgICB8ICAgICB8ICAgICAgICAgICAgICAgICAgICAgfCAgICAgfCAgIHxcbiAqICAgICAgICAgICAgICAgICAgICB8ICAgdiAgICAgdiAgICAgICAgICAgICAgICAgICAgIHYgICAgIHYgICB8IHdyYXBwZXJcbiAqICAgICAgICAgICAgICAgICAgICB8ICstLS0rICstLS0rICAgKy0tLS0tLS0tLSsgICArLS0tKyArLS0tKyB8IGludmFyaWFudHNcbiAqIHBlcmZvcm0oYW55TWV0aG9kKSB8IHwgICB8IHwgICB8ICAgfCAgICAgICAgIHwgICB8ICAgfCB8ICAgfCB8IG1haW50YWluZWRcbiAqICstLS0tLS0tLS0tLS0tLS0tLT58LXwtLS18LXwtLS18LS0+fGFueU1ldGhvZHwtLS18LS0tfC18LS0tfC18LS0tLS0tLS0+XG4gKiAgICAgICAgICAgICAgICAgICAgfCB8ICAgfCB8ICAgfCAgIHwgICAgICAgICB8ICAgfCAgIHwgfCAgIHwgfFxuICogICAgICAgICAgICAgICAgICAgIHwgfCAgIHwgfCAgIHwgICB8ICAgICAgICAgfCAgIHwgICB8IHwgICB8IHxcbiAqICAgICAgICAgICAgICAgICAgICB8IHwgICB8IHwgICB8ICAgfCAgICAgICAgIHwgICB8ICAgfCB8ICAgfCB8XG4gKiAgICAgICAgICAgICAgICAgICAgfCArLS0tKyArLS0tKyAgICstLS0tLS0tLS0rICAgKy0tLSsgK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ndXNlIHN0cmljdCc7XG5cbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9saWIvUmVhY3QnKTtcbiJdfQ== diff --git a/package.json b/package.json index 426142f2..32af2f99 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ ], "dependencies": { "inline-style-prefixer": "^3.0.2", + "prop-types": "^15.5.8", "react-style-proptype": "^3.0.0" }, "devDependencies": { diff --git a/src/Pane.js b/src/Pane.js index 5b9e253d..513015db 100644 --- a/src/Pane.js +++ b/src/Pane.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import Prefixer from 'inline-style-prefixer'; import stylePropType from 'react-style-proptype'; @@ -37,11 +38,11 @@ class Pane extends React.Component { } Pane.propTypes = { - className: React.PropTypes.string.isRequired, - children: React.PropTypes.node.isRequired, - prefixer: React.PropTypes.instanceOf(Prefixer).isRequired, - size: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]), - split: React.PropTypes.oneOf(['vertical', 'horizontal']), + className: PropTypes.string.isRequired, + children: PropTypes.node.isRequired, + prefixer: PropTypes.instanceOf(Prefixer).isRequired, + size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + split: PropTypes.oneOf(['vertical', 'horizontal']), style: stylePropType, }; diff --git a/src/Resizer.js b/src/Resizer.js index 8943a527..c2242081 100644 --- a/src/Resizer.js +++ b/src/Resizer.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import Prefixer from 'inline-style-prefixer'; import stylePropType from 'react-style-proptype'; @@ -23,7 +24,6 @@ class Resizer extends React.Component { event.preventDefault(); onTouchEnd(event); }} - // eslint-disable-next-line no-static-element-interactions onClick={(event) => { if (onClick) { event.preventDefault(); @@ -42,16 +42,16 @@ class Resizer extends React.Component { } Resizer.propTypes = { - className: React.PropTypes.string.isRequired, - onClick: React.PropTypes.func, - onDoubleClick: React.PropTypes.func, - onMouseDown: React.PropTypes.func.isRequired, - onTouchStart: React.PropTypes.func.isRequired, - onTouchEnd: React.PropTypes.func.isRequired, - prefixer: React.PropTypes.instanceOf(Prefixer).isRequired, - split: React.PropTypes.oneOf(['vertical', 'horizontal']), + className: PropTypes.string.isRequired, + onClick: PropTypes.func, + onDoubleClick: PropTypes.func, + onMouseDown: PropTypes.func.isRequired, + onTouchStart: PropTypes.func.isRequired, + onTouchEnd: PropTypes.func.isRequired, + prefixer: PropTypes.instanceOf(Prefixer).isRequired, + split: PropTypes.oneOf(['vertical', 'horizontal']), style: stylePropType, - resizerClassName: React.PropTypes.string.isRequired, + resizerClassName: PropTypes.string.isRequired, }; Resizer.defaultProps = { diff --git a/src/SplitPane.js b/src/SplitPane.js index f7e7d1da..aa6ba8f1 100644 --- a/src/SplitPane.js +++ b/src/SplitPane.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import ReactDOM from 'react-dom'; import Prefixer from 'inline-style-prefixer'; import stylePropType from 'react-style-proptype'; @@ -246,28 +247,28 @@ class SplitPane extends React.Component { } SplitPane.propTypes = { - allowResize: React.PropTypes.bool, - children: React.PropTypes.arrayOf(React.PropTypes.node).isRequired, - className: React.PropTypes.string, - primary: React.PropTypes.oneOf(['first', 'second']), - minSize: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]), - maxSize: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]), + allowResize: PropTypes.bool, + children: PropTypes.arrayOf(PropTypes.node).isRequired, + className: PropTypes.string, + primary: PropTypes.oneOf(['first', 'second']), + minSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + maxSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), // eslint-disable-next-line react/no-unused-prop-types - defaultSize: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]), - size: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.number]), - split: React.PropTypes.oneOf(['vertical', 'horizontal']), - onDragStarted: React.PropTypes.func, - onDragFinished: React.PropTypes.func, - onChange: React.PropTypes.func, - onResizerClick: React.PropTypes.func, - onResizerDoubleClick: React.PropTypes.func, - prefixer: React.PropTypes.instanceOf(Prefixer).isRequired, + defaultSize: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + split: PropTypes.oneOf(['vertical', 'horizontal']), + onDragStarted: PropTypes.func, + onDragFinished: PropTypes.func, + onChange: PropTypes.func, + onResizerClick: PropTypes.func, + onResizerDoubleClick: PropTypes.func, + prefixer: PropTypes.instanceOf(Prefixer).isRequired, style: stylePropType, resizerStyle: stylePropType, paneStyle: stylePropType, pane1Style: stylePropType, pane2Style: stylePropType, - resizerClassName: React.PropTypes.string, + resizerClassName: PropTypes.string, }; SplitPane.defaultProps = {