@welldone-software/why-did-you-render
Advanced tools
Comparing version 2.3.1 to 2.3.2
@@ -578,3 +578,3 @@ 'use strict'; | ||
function createPatchedComponent(componentsMapping, Component, displayName, React, options) { | ||
function createPatchedComponent(componentsMap, Component, displayName, React, options) { | ||
if (Component.prototype && Component.prototype.isReactComponent) { | ||
@@ -587,9 +587,9 @@ return patchClassComponent(Component, displayName, React, options); | ||
function getPatchedComponent(componentsMapping, Component, displayName, React, options) { | ||
if (componentsMapping.has(Component)) { | ||
return componentsMapping.get(Component); | ||
function getPatchedComponent(componentsMap, Component, displayName, React, options) { | ||
if (componentsMap.has(Component)) { | ||
return componentsMap.get(Component); | ||
} | ||
var WDYRPatchedComponent = createPatchedComponent(componentsMapping, Component, displayName, React, options); | ||
componentsMapping.set(Component, WDYRPatchedComponent); | ||
var WDYRPatchedComponent = createPatchedComponent(componentsMap, Component, displayName, React, options); | ||
componentsMap.set(Component, WDYRPatchedComponent); | ||
return WDYRPatchedComponent; | ||
@@ -601,3 +601,3 @@ } | ||
var origCreateElement = React.createElement; | ||
var componentsMapping = new Map(); | ||
var componentsMap = new WeakMap(); | ||
@@ -616,3 +616,3 @@ React.createElement = function (componentNameOrComponent) { | ||
var displayName = componentNameOrComponent && componentNameOrComponent.whyDidYouRender && componentNameOrComponent.whyDidYouRender.customName || getDisplayName(componentNameOrComponent); | ||
var WDYRPatchedComponent = getPatchedComponent(componentsMapping, componentNameOrComponent, displayName, React, options); | ||
var WDYRPatchedComponent = getPatchedComponent(componentsMap, componentNameOrComponent, displayName, React, options); | ||
return origCreateElement.apply(React, [WDYRPatchedComponent].concat(rest)); | ||
@@ -623,4 +623,4 @@ }; | ||
React.createElement = origCreateElement; | ||
componentsMap = null; | ||
delete React.__REVERT_WHY_DID_YOU_RENDER__; | ||
componentsMapping.clear(); | ||
}; | ||
@@ -627,0 +627,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var _isString=_interopDefault(require("lodash/isString")),_reduce=_interopDefault(require("lodash/reduce")),_has=_interopDefault(require("lodash/has")),_keys=_interopDefault(require("lodash/keys")),_isFunction=_interopDefault(require("lodash/isFunction")),_isRegExp=_interopDefault(require("lodash/isRegExp")),_isDate=_interopDefault(require("lodash/isDate")),_isPlainObject=_interopDefault(require("lodash/isPlainObject")),_isArray=_interopDefault(require("lodash/isArray"));function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_defineProperty(e,t,r[t])})}return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(e,t,r){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=_superPropBase(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var _diffTypesDescription,diffTypes={different:"different",deepEquals:"deepEquals",date:"date",regex:"regex",reactElement:"reactElement",function:"function"},moreInfoUrl="http://bit.ly/wdyr02",diffTypesDescriptions=(_defineProperty(_diffTypesDescription={},diffTypes.different,"different objects."),_defineProperty(_diffTypesDescription,diffTypes.deepEquals,"different objects that are equal by value."),_defineProperty(_diffTypesDescription,diffTypes.date,"different date objects with the same value."),_defineProperty(_diffTypesDescription,diffTypes.regex,"different regular expressions with the same value."),_defineProperty(_diffTypesDescription,diffTypes.reactElement,"different React elements with the same displayName."),_defineProperty(_diffTypesDescription,diffTypes.function,"different functions with the same name."),_diffTypesDescription),inHotReload=!1;function shouldLog(e,t,r){return!inHotReload&&(!!r.logOnDifferentValues||(!(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)||!(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===diffTypes.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===diffTypes.different}))))}function logDifference(e,t,r,n,o,i,f){o&&o.length>0?(f.consoleLog(_defineProperty({},t,e),"".concat(r," of ").concat(n," changes:")),o.forEach(function(e){var t=e.pathString,r=e.diffType,o=e.prevValue,i=e.nextValue;f.consoleGroup("%c".concat(n,".%c").concat(t,"%c"),"color:blue;","color:red;","color:black;"),f.consoleLog("".concat(diffTypesDescriptions[r]," (more info at ").concat(moreInfoUrl,")")),f.consoleLog(_defineProperty({},"prev ".concat(t),o),"!==",_defineProperty({},"next ".concat(t),i)),f.consoleGroupEnd()})):o&&(f.consoleLog(_defineProperty({},t,e),"".concat(r," the ").concat(n," object itself changed but it's values are all equal."),"props"===n?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(moreInfoUrl)),f.consoleLog("prev ".concat(n,":"),i.prev," !== ",i.next,":next ".concat(n)))}function defaultNotifier(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,i=e.nextProps,f=e.nextState,a=e.reason,s=e.options;if(shouldLog(a,t,s)){s.consoleGroup("%c".concat(r),"color: #058;");var c="Re-rendered because";a.propsDifferences&&(logDifference(t,r,c,"props",a.propsDifferences,{prev:n,next:i},s),c="And because"),a.stateDifferences&&logDifference(t,r,c,"state",a.stateDifferences,{prev:o,next:f},s),a.propsDifferences||a.stateDifferences||s.consoleLog(_defineProperty({},r,t),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat(moreInfoUrl)),s.consoleGroupEnd()}}function createDefaultNotifier(e){return e&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(inHotReload=!0,setTimeout(function(){inHotReload=!1},e))}),defaultNotifier}var emptyFn=function(){};function normalizeOptions(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=console.group,r=console.groupEnd;return e.collapseGroups?t=console.groupCollapsed:e.onlyLogs&&(t=console.log,r=emptyFn),_objectSpread({include:null,exclude:null,notifier:e.notifier||createDefaultNotifier(e.hasOwnProperty("hotReloadBufferMs")?e.hotReloadBufferMs:500),onlyLogs:!1,consoleLog:console.log,consoleGroup:t,consoleGroupEnd:r,logOnDifferentValues:!1},e)}function getDisplayName(e){return e.displayName||e.name||(_isString(e)?e:void 0)}var hasElementType="undefined"!=typeof Element,hasSymbol="function"==typeof Symbol&&Symbol.for,REACT_ELEMENT_TYPE$1=hasSymbol?Symbol.for("react.element"):60103,isReactElement=function(e){return e.$$typeof===REACT_ELEMENT_TYPE$1};function trackDiff(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==diffTypes.different}function accumulateDeepEqualDiffs(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(e===t)return!0;if(!e||!t)return trackDiff(e,t,r,n,diffTypes.different);if(_isArray(e)&&_isArray(t)){var o=e.length;if(o!==t.length)return trackDiff(e,t,r,n,diffTypes.different);for(var i=!0,f=o;0!=f--;)accumulateDeepEqualDiffs(e[f],t[f],r,"".concat(n,"[").concat(f,"]"))||(i=!1);return trackDiff(e,t,r,n,i?diffTypes.deepEquals:diffTypes.different)}if(_isDate(e)&&_isDate(t))return e.getTime()===t.getTime()?trackDiff(e,t,r,n,diffTypes.date):trackDiff(e,t,r,n,diffTypes.different);if(_isRegExp(e)&&_isRegExp(t))return e.toString()===t.toString()?trackDiff(e,t,r,n,diffTypes.regex):trackDiff(e,t,r,n,diffTypes.different);if(hasElementType&&e instanceof Element&&t instanceof Element)return trackDiff(e,t,r,n,diffTypes.different);if(isReactElement(e)&&isReactElement(t))return e.type===t.type?trackDiff(e,t,r,n,diffTypes.reactElement):trackDiff(e,t,r,n,diffTypes.different);if(_isFunction(e)&&_isFunction(t))return e.name===t.name?trackDiff(e,t,r,n,diffTypes.function):trackDiff(e,t,r,n,diffTypes.different);if(_isPlainObject(e)&&_isPlainObject(t)){var a=_keys(e),s=a.length;if(s!==_keys(t).length)return trackDiff(e,t,r,n,diffTypes.different);for(var c=s;0!=c--;)if(!_has(t,a[c]))return trackDiff(e,t,r,n,diffTypes.different);for(var p=!0,u=s;0!=u--;){var l=a[u];accumulateDeepEqualDiffs(e[l],t[l],r,"".concat(n,".").concat(l))||(p=!1)}return trackDiff(e,t,r,n,p?diffTypes.deepEquals:diffTypes.different)}return trackDiff(e,t,r,n,diffTypes.different)}function calculateDeepEqualDiffs(e,t,r){try{var n=[];return accumulateDeepEqualDiffs(e,t,n,r),n}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var emptyObject={};function findObjectsDifferences(e,t){if(e===t)return!1;var r=e||emptyObject,n=t||emptyObject,o=_keys(_objectSpread({},r,n));return _reduce(o,function(e,t){var o=calculateDeepEqualDiffs(r[t],n[t],t);return o&&(e=_toConsumableArray(e||[]).concat(_toConsumableArray(o))),e},[])}function getUpdateReason(e,t,r,n){return{propsDifferences:findObjectsDifferences(e,r,"props"),stateDifferences:findObjectsDifferences(t,n,"state")}}function getUpdateInfo(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,i=e.nextProps,f=e.nextState;return{Component:t,displayName:r,prevProps:n,prevState:o,nextProps:i,nextState:f,options:e.options,reason:getUpdateReason(n,o,i,f)}}function shouldInclude(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}function shouldExclude(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}function shouldTrack(e,t,r){return!shouldExclude(t,r)&&!(!e.whyDidYouRender&&!shouldInclude(t,r))}function patchClassComponent(e,t,r,n){var o=function(r){function o(t,r){var n;if(_classCallCheck(this,o),(n=_possibleConstructorReturn(this,_getPrototypeOf(o).call(this,t,r))).render&&!e.prototype.render){var i=n.render;n.render=function(){return o.prototype.render.apply(_assertThisInitialized(_assertThisInitialized(n))),i()}}return n}return _inherits(o,e),_createClass(o,[{key:"render",value:function(){return this._prevProps&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:n})),this._prevProps=this.props,this._prevState=this.state,_get(_getPrototypeOf(o.prototype),"render",this)&&_get(_getPrototypeOf(o.prototype),"render",this).call(this)}}]),o}();return Object.assign(o,e,{displayName:t}),o}function patchFunctionalComponent(e,t,r,n){var o=void 0;function i(r){return o&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:o,nextProps:r,options:n})),o=r,e(r)}return Object.assign(i,e,{displayName:t}),i}function createPatchedComponent(e,t,r,n,o){return t.prototype&&t.prototype.isReactComponent?patchClassComponent(t,r,n,o):patchFunctionalComponent(t,r,n,o)}function getPatchedComponent(e,t,r,n,o){if(e.has(t))return e.get(t);var i=createPatchedComponent(e,t,r,n,o);return e.set(t,i),i}function whyDidYouRender(e,t){var r=normalizeOptions(t),n=e.createElement,o=new Map;return e.createElement=function(t){for(var i="function"==typeof t&&shouldTrack(t,getDisplayName(t),r),f=arguments.length,a=new Array(f>1?f-1:0),s=1;s<f;s++)a[s-1]=arguments[s];if(!i)return n.apply(e,[t].concat(a));var c=t&&t.whyDidYouRender&&t.whyDidYouRender.customName||getDisplayName(t),p=getPatchedComponent(o,t,c,e,r);return n.apply(e,[p].concat(a))},e.__REVERT_WHY_DID_YOU_RENDER__=function(){e.createElement=n,delete e.__REVERT_WHY_DID_YOU_RENDER__,o.clear()},e}module.exports=whyDidYouRender; | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var _isString=_interopDefault(require("lodash/isString")),_reduce=_interopDefault(require("lodash/reduce")),_has=_interopDefault(require("lodash/has")),_keys=_interopDefault(require("lodash/keys")),_isFunction=_interopDefault(require("lodash/isFunction")),_isRegExp=_interopDefault(require("lodash/isRegExp")),_isDate=_interopDefault(require("lodash/isDate")),_isPlainObject=_interopDefault(require("lodash/isPlainObject")),_isArray=_interopDefault(require("lodash/isArray"));function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_defineProperty(e,t,r[t])})}return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(e,t,r){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=_superPropBase(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var _diffTypesDescription,diffTypes={different:"different",deepEquals:"deepEquals",date:"date",regex:"regex",reactElement:"reactElement",function:"function"},moreInfoUrl="http://bit.ly/wdyr02",diffTypesDescriptions=(_defineProperty(_diffTypesDescription={},diffTypes.different,"different objects."),_defineProperty(_diffTypesDescription,diffTypes.deepEquals,"different objects that are equal by value."),_defineProperty(_diffTypesDescription,diffTypes.date,"different date objects with the same value."),_defineProperty(_diffTypesDescription,diffTypes.regex,"different regular expressions with the same value."),_defineProperty(_diffTypesDescription,diffTypes.reactElement,"different React elements with the same displayName."),_defineProperty(_diffTypesDescription,diffTypes.function,"different functions with the same name."),_diffTypesDescription),inHotReload=!1;function shouldLog(e,t,r){return!inHotReload&&(!!r.logOnDifferentValues||(!(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)||!(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===diffTypes.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===diffTypes.different}))))}function logDifference(e,t,r,n,o,i,f){o&&o.length>0?(f.consoleLog(_defineProperty({},t,e),"".concat(r," of ").concat(n," changes:")),o.forEach(function(e){var t=e.pathString,r=e.diffType,o=e.prevValue,i=e.nextValue;f.consoleGroup("%c".concat(n,".%c").concat(t,"%c"),"color:blue;","color:red;","color:black;"),f.consoleLog("".concat(diffTypesDescriptions[r]," (more info at ").concat(moreInfoUrl,")")),f.consoleLog(_defineProperty({},"prev ".concat(t),o),"!==",_defineProperty({},"next ".concat(t),i)),f.consoleGroupEnd()})):o&&(f.consoleLog(_defineProperty({},t,e),"".concat(r," the ").concat(n," object itself changed but it's values are all equal."),"props"===n?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(moreInfoUrl)),f.consoleLog("prev ".concat(n,":"),i.prev," !== ",i.next,":next ".concat(n)))}function defaultNotifier(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,i=e.nextProps,f=e.nextState,a=e.reason,s=e.options;if(shouldLog(a,t,s)){s.consoleGroup("%c".concat(r),"color: #058;");var c="Re-rendered because";a.propsDifferences&&(logDifference(t,r,c,"props",a.propsDifferences,{prev:n,next:i},s),c="And because"),a.stateDifferences&&logDifference(t,r,c,"state",a.stateDifferences,{prev:o,next:f},s),a.propsDifferences||a.stateDifferences||s.consoleLog(_defineProperty({},r,t),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat(moreInfoUrl)),s.consoleGroupEnd()}}function createDefaultNotifier(e){return e&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(inHotReload=!0,setTimeout(function(){inHotReload=!1},e))}),defaultNotifier}var emptyFn=function(){};function normalizeOptions(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=console.group,r=console.groupEnd;return e.collapseGroups?t=console.groupCollapsed:e.onlyLogs&&(t=console.log,r=emptyFn),_objectSpread({include:null,exclude:null,notifier:e.notifier||createDefaultNotifier(e.hasOwnProperty("hotReloadBufferMs")?e.hotReloadBufferMs:500),onlyLogs:!1,consoleLog:console.log,consoleGroup:t,consoleGroupEnd:r,logOnDifferentValues:!1},e)}function getDisplayName(e){return e.displayName||e.name||(_isString(e)?e:void 0)}var hasElementType="undefined"!=typeof Element,hasSymbol="function"==typeof Symbol&&Symbol.for,REACT_ELEMENT_TYPE$1=hasSymbol?Symbol.for("react.element"):60103,isReactElement=function(e){return e.$$typeof===REACT_ELEMENT_TYPE$1};function trackDiff(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==diffTypes.different}function accumulateDeepEqualDiffs(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(e===t)return!0;if(!e||!t)return trackDiff(e,t,r,n,diffTypes.different);if(_isArray(e)&&_isArray(t)){var o=e.length;if(o!==t.length)return trackDiff(e,t,r,n,diffTypes.different);for(var i=!0,f=o;0!=f--;)accumulateDeepEqualDiffs(e[f],t[f],r,"".concat(n,"[").concat(f,"]"))||(i=!1);return trackDiff(e,t,r,n,i?diffTypes.deepEquals:diffTypes.different)}if(_isDate(e)&&_isDate(t))return e.getTime()===t.getTime()?trackDiff(e,t,r,n,diffTypes.date):trackDiff(e,t,r,n,diffTypes.different);if(_isRegExp(e)&&_isRegExp(t))return e.toString()===t.toString()?trackDiff(e,t,r,n,diffTypes.regex):trackDiff(e,t,r,n,diffTypes.different);if(hasElementType&&e instanceof Element&&t instanceof Element)return trackDiff(e,t,r,n,diffTypes.different);if(isReactElement(e)&&isReactElement(t))return e.type===t.type?trackDiff(e,t,r,n,diffTypes.reactElement):trackDiff(e,t,r,n,diffTypes.different);if(_isFunction(e)&&_isFunction(t))return e.name===t.name?trackDiff(e,t,r,n,diffTypes.function):trackDiff(e,t,r,n,diffTypes.different);if(_isPlainObject(e)&&_isPlainObject(t)){var a=_keys(e),s=a.length;if(s!==_keys(t).length)return trackDiff(e,t,r,n,diffTypes.different);for(var c=s;0!=c--;)if(!_has(t,a[c]))return trackDiff(e,t,r,n,diffTypes.different);for(var p=!0,u=s;0!=u--;){var l=a[u];accumulateDeepEqualDiffs(e[l],t[l],r,"".concat(n,".").concat(l))||(p=!1)}return trackDiff(e,t,r,n,p?diffTypes.deepEquals:diffTypes.different)}return trackDiff(e,t,r,n,diffTypes.different)}function calculateDeepEqualDiffs(e,t,r){try{var n=[];return accumulateDeepEqualDiffs(e,t,n,r),n}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var emptyObject={};function findObjectsDifferences(e,t){if(e===t)return!1;var r=e||emptyObject,n=t||emptyObject,o=_keys(_objectSpread({},r,n));return _reduce(o,function(e,t){var o=calculateDeepEqualDiffs(r[t],n[t],t);return o&&(e=_toConsumableArray(e||[]).concat(_toConsumableArray(o))),e},[])}function getUpdateReason(e,t,r,n){return{propsDifferences:findObjectsDifferences(e,r,"props"),stateDifferences:findObjectsDifferences(t,n,"state")}}function getUpdateInfo(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,i=e.nextProps,f=e.nextState;return{Component:t,displayName:r,prevProps:n,prevState:o,nextProps:i,nextState:f,options:e.options,reason:getUpdateReason(n,o,i,f)}}function shouldInclude(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}function shouldExclude(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}function shouldTrack(e,t,r){return!shouldExclude(t,r)&&!(!e.whyDidYouRender&&!shouldInclude(t,r))}function patchClassComponent(e,t,r,n){var o=function(r){function o(t,r){var n;if(_classCallCheck(this,o),(n=_possibleConstructorReturn(this,_getPrototypeOf(o).call(this,t,r))).render&&!e.prototype.render){var i=n.render;n.render=function(){return o.prototype.render.apply(_assertThisInitialized(_assertThisInitialized(n))),i()}}return n}return _inherits(o,e),_createClass(o,[{key:"render",value:function(){return this._prevProps&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:n})),this._prevProps=this.props,this._prevState=this.state,_get(_getPrototypeOf(o.prototype),"render",this)&&_get(_getPrototypeOf(o.prototype),"render",this).call(this)}}]),o}();return Object.assign(o,e,{displayName:t}),o}function patchFunctionalComponent(e,t,r,n){var o=void 0;function i(r){return o&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:o,nextProps:r,options:n})),o=r,e(r)}return Object.assign(i,e,{displayName:t}),i}function createPatchedComponent(e,t,r,n,o){return t.prototype&&t.prototype.isReactComponent?patchClassComponent(t,r,n,o):patchFunctionalComponent(t,r,n,o)}function getPatchedComponent(e,t,r,n,o){if(e.has(t))return e.get(t);var i=createPatchedComponent(e,t,r,n,o);return e.set(t,i),i}function whyDidYouRender(e,t){var r=normalizeOptions(t),n=e.createElement,o=new WeakMap;return e.createElement=function(t){for(var i="function"==typeof t&&shouldTrack(t,getDisplayName(t),r),f=arguments.length,a=new Array(f>1?f-1:0),s=1;s<f;s++)a[s-1]=arguments[s];if(!i)return n.apply(e,[t].concat(a));var c=t&&t.whyDidYouRender&&t.whyDidYouRender.customName||getDisplayName(t),p=getPatchedComponent(o,t,c,e,r);return n.apply(e,[p].concat(a))},e.__REVERT_WHY_DID_YOU_RENDER__=function(){e.createElement=n,o=null,delete e.__REVERT_WHY_DID_YOU_RENDER__},e}module.exports=whyDidYouRender; | ||
//# sourceMappingURL=whyDidYouRender.min.js.map |
@@ -574,3 +574,3 @@ import _isString from 'lodash/isString'; | ||
function createPatchedComponent(componentsMapping, Component, displayName, React, options) { | ||
function createPatchedComponent(componentsMap, Component, displayName, React, options) { | ||
if (Component.prototype && Component.prototype.isReactComponent) { | ||
@@ -583,9 +583,9 @@ return patchClassComponent(Component, displayName, React, options); | ||
function getPatchedComponent(componentsMapping, Component, displayName, React, options) { | ||
if (componentsMapping.has(Component)) { | ||
return componentsMapping.get(Component); | ||
function getPatchedComponent(componentsMap, Component, displayName, React, options) { | ||
if (componentsMap.has(Component)) { | ||
return componentsMap.get(Component); | ||
} | ||
var WDYRPatchedComponent = createPatchedComponent(componentsMapping, Component, displayName, React, options); | ||
componentsMapping.set(Component, WDYRPatchedComponent); | ||
var WDYRPatchedComponent = createPatchedComponent(componentsMap, Component, displayName, React, options); | ||
componentsMap.set(Component, WDYRPatchedComponent); | ||
return WDYRPatchedComponent; | ||
@@ -597,3 +597,3 @@ } | ||
var origCreateElement = React.createElement; | ||
var componentsMapping = new Map(); | ||
var componentsMap = new WeakMap(); | ||
@@ -612,3 +612,3 @@ React.createElement = function (componentNameOrComponent) { | ||
var displayName = componentNameOrComponent && componentNameOrComponent.whyDidYouRender && componentNameOrComponent.whyDidYouRender.customName || getDisplayName(componentNameOrComponent); | ||
var WDYRPatchedComponent = getPatchedComponent(componentsMapping, componentNameOrComponent, displayName, React, options); | ||
var WDYRPatchedComponent = getPatchedComponent(componentsMap, componentNameOrComponent, displayName, React, options); | ||
return origCreateElement.apply(React, [WDYRPatchedComponent].concat(rest)); | ||
@@ -619,4 +619,4 @@ }; | ||
React.createElement = origCreateElement; | ||
componentsMap = null; | ||
delete React.__REVERT_WHY_DID_YOU_RENDER__; | ||
componentsMapping.clear(); | ||
}; | ||
@@ -623,0 +623,0 @@ |
@@ -1,2 +0,2 @@ | ||
import _isString from"lodash/isString";import _reduce from"lodash/reduce";import _has from"lodash/has";import _keys from"lodash/keys";import _isFunction from"lodash/isFunction";import _isRegExp from"lodash/isRegExp";import _isDate from"lodash/isDate";import _isPlainObject from"lodash/isPlainObject";import _isArray from"lodash/isArray";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_defineProperty(e,t,r[t])})}return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(e,t,r){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=_superPropBase(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var _diffTypesDescription,diffTypes={different:"different",deepEquals:"deepEquals",date:"date",regex:"regex",reactElement:"reactElement",function:"function"},moreInfoUrl="http://bit.ly/wdyr02",diffTypesDescriptions=(_defineProperty(_diffTypesDescription={},diffTypes.different,"different objects."),_defineProperty(_diffTypesDescription,diffTypes.deepEquals,"different objects that are equal by value."),_defineProperty(_diffTypesDescription,diffTypes.date,"different date objects with the same value."),_defineProperty(_diffTypesDescription,diffTypes.regex,"different regular expressions with the same value."),_defineProperty(_diffTypesDescription,diffTypes.reactElement,"different React elements with the same displayName."),_defineProperty(_diffTypesDescription,diffTypes.function,"different functions with the same name."),_diffTypesDescription),inHotReload=!1;function shouldLog(e,t,r){return!inHotReload&&(!!r.logOnDifferentValues||(!(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)||!(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===diffTypes.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===diffTypes.different}))))}function logDifference(e,t,r,n,o,i,f){o&&o.length>0?(f.consoleLog(_defineProperty({},t,e),"".concat(r," of ").concat(n," changes:")),o.forEach(function(e){var t=e.pathString,r=e.diffType,o=e.prevValue,i=e.nextValue;f.consoleGroup("%c".concat(n,".%c").concat(t,"%c"),"color:blue;","color:red;","color:black;"),f.consoleLog("".concat(diffTypesDescriptions[r]," (more info at ").concat(moreInfoUrl,")")),f.consoleLog(_defineProperty({},"prev ".concat(t),o),"!==",_defineProperty({},"next ".concat(t),i)),f.consoleGroupEnd()})):o&&(f.consoleLog(_defineProperty({},t,e),"".concat(r," the ").concat(n," object itself changed but it's values are all equal."),"props"===n?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(moreInfoUrl)),f.consoleLog("prev ".concat(n,":"),i.prev," !== ",i.next,":next ".concat(n)))}function defaultNotifier(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,i=e.nextProps,f=e.nextState,a=e.reason,s=e.options;if(shouldLog(a,t,s)){s.consoleGroup("%c".concat(r),"color: #058;");var c="Re-rendered because";a.propsDifferences&&(logDifference(t,r,c,"props",a.propsDifferences,{prev:n,next:i},s),c="And because"),a.stateDifferences&&logDifference(t,r,c,"state",a.stateDifferences,{prev:o,next:f},s),a.propsDifferences||a.stateDifferences||s.consoleLog(_defineProperty({},r,t),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat(moreInfoUrl)),s.consoleGroupEnd()}}function createDefaultNotifier(e){return e&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(inHotReload=!0,setTimeout(function(){inHotReload=!1},e))}),defaultNotifier}var emptyFn=function(){};function normalizeOptions(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=console.group,r=console.groupEnd;return e.collapseGroups?t=console.groupCollapsed:e.onlyLogs&&(t=console.log,r=emptyFn),_objectSpread({include:null,exclude:null,notifier:e.notifier||createDefaultNotifier(e.hasOwnProperty("hotReloadBufferMs")?e.hotReloadBufferMs:500),onlyLogs:!1,consoleLog:console.log,consoleGroup:t,consoleGroupEnd:r,logOnDifferentValues:!1},e)}function getDisplayName(e){return e.displayName||e.name||(_isString(e)?e:void 0)}var hasElementType="undefined"!=typeof Element,hasSymbol="function"==typeof Symbol&&Symbol.for,REACT_ELEMENT_TYPE$1=hasSymbol?Symbol.for("react.element"):60103,isReactElement=function(e){return e.$$typeof===REACT_ELEMENT_TYPE$1};function trackDiff(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==diffTypes.different}function accumulateDeepEqualDiffs(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(e===t)return!0;if(!e||!t)return trackDiff(e,t,r,n,diffTypes.different);if(_isArray(e)&&_isArray(t)){var o=e.length;if(o!==t.length)return trackDiff(e,t,r,n,diffTypes.different);for(var i=!0,f=o;0!=f--;)accumulateDeepEqualDiffs(e[f],t[f],r,"".concat(n,"[").concat(f,"]"))||(i=!1);return trackDiff(e,t,r,n,i?diffTypes.deepEquals:diffTypes.different)}if(_isDate(e)&&_isDate(t))return e.getTime()===t.getTime()?trackDiff(e,t,r,n,diffTypes.date):trackDiff(e,t,r,n,diffTypes.different);if(_isRegExp(e)&&_isRegExp(t))return e.toString()===t.toString()?trackDiff(e,t,r,n,diffTypes.regex):trackDiff(e,t,r,n,diffTypes.different);if(hasElementType&&e instanceof Element&&t instanceof Element)return trackDiff(e,t,r,n,diffTypes.different);if(isReactElement(e)&&isReactElement(t))return e.type===t.type?trackDiff(e,t,r,n,diffTypes.reactElement):trackDiff(e,t,r,n,diffTypes.different);if(_isFunction(e)&&_isFunction(t))return e.name===t.name?trackDiff(e,t,r,n,diffTypes.function):trackDiff(e,t,r,n,diffTypes.different);if(_isPlainObject(e)&&_isPlainObject(t)){var a=_keys(e),s=a.length;if(s!==_keys(t).length)return trackDiff(e,t,r,n,diffTypes.different);for(var c=s;0!=c--;)if(!_has(t,a[c]))return trackDiff(e,t,r,n,diffTypes.different);for(var p=!0,u=s;0!=u--;){var l=a[u];accumulateDeepEqualDiffs(e[l],t[l],r,"".concat(n,".").concat(l))||(p=!1)}return trackDiff(e,t,r,n,p?diffTypes.deepEquals:diffTypes.different)}return trackDiff(e,t,r,n,diffTypes.different)}function calculateDeepEqualDiffs(e,t,r){try{var n=[];return accumulateDeepEqualDiffs(e,t,n,r),n}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var emptyObject={};function findObjectsDifferences(e,t){if(e===t)return!1;var r=e||emptyObject,n=t||emptyObject,o=_keys(_objectSpread({},r,n));return _reduce(o,function(e,t){var o=calculateDeepEqualDiffs(r[t],n[t],t);return o&&(e=_toConsumableArray(e||[]).concat(_toConsumableArray(o))),e},[])}function getUpdateReason(e,t,r,n){return{propsDifferences:findObjectsDifferences(e,r,"props"),stateDifferences:findObjectsDifferences(t,n,"state")}}function getUpdateInfo(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,i=e.nextProps,f=e.nextState;return{Component:t,displayName:r,prevProps:n,prevState:o,nextProps:i,nextState:f,options:e.options,reason:getUpdateReason(n,o,i,f)}}function shouldInclude(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}function shouldExclude(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}function shouldTrack(e,t,r){return!shouldExclude(t,r)&&!(!e.whyDidYouRender&&!shouldInclude(t,r))}function patchClassComponent(e,t,r,n){var o=function(r){function o(t,r){var n;if(_classCallCheck(this,o),(n=_possibleConstructorReturn(this,_getPrototypeOf(o).call(this,t,r))).render&&!e.prototype.render){var i=n.render;n.render=function(){return o.prototype.render.apply(_assertThisInitialized(_assertThisInitialized(n))),i()}}return n}return _inherits(o,e),_createClass(o,[{key:"render",value:function(){return this._prevProps&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:n})),this._prevProps=this.props,this._prevState=this.state,_get(_getPrototypeOf(o.prototype),"render",this)&&_get(_getPrototypeOf(o.prototype),"render",this).call(this)}}]),o}();return Object.assign(o,e,{displayName:t}),o}function patchFunctionalComponent(e,t,r,n){var o=void 0;function i(r){return o&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:o,nextProps:r,options:n})),o=r,e(r)}return Object.assign(i,e,{displayName:t}),i}function createPatchedComponent(e,t,r,n,o){return t.prototype&&t.prototype.isReactComponent?patchClassComponent(t,r,n,o):patchFunctionalComponent(t,r,n,o)}function getPatchedComponent(e,t,r,n,o){if(e.has(t))return e.get(t);var i=createPatchedComponent(e,t,r,n,o);return e.set(t,i),i}function whyDidYouRender(e,t){var r=normalizeOptions(t),n=e.createElement,o=new Map;return e.createElement=function(t){for(var i="function"==typeof t&&shouldTrack(t,getDisplayName(t),r),f=arguments.length,a=new Array(f>1?f-1:0),s=1;s<f;s++)a[s-1]=arguments[s];if(!i)return n.apply(e,[t].concat(a));var c=t&&t.whyDidYouRender&&t.whyDidYouRender.customName||getDisplayName(t),p=getPatchedComponent(o,t,c,e,r);return n.apply(e,[p].concat(a))},e.__REVERT_WHY_DID_YOU_RENDER__=function(){e.createElement=n,delete e.__REVERT_WHY_DID_YOU_RENDER__,o.clear()},e}export default whyDidYouRender; | ||
import _isString from"lodash/isString";import _reduce from"lodash/reduce";import _has from"lodash/has";import _keys from"lodash/keys";import _isFunction from"lodash/isFunction";import _isRegExp from"lodash/isRegExp";import _isDate from"lodash/isDate";import _isPlainObject from"lodash/isPlainObject";import _isArray from"lodash/isArray";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){_defineProperty(e,t,r[t])})}return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(e,t,r){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=_superPropBase(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var _diffTypesDescription,diffTypes={different:"different",deepEquals:"deepEquals",date:"date",regex:"regex",reactElement:"reactElement",function:"function"},moreInfoUrl="http://bit.ly/wdyr02",diffTypesDescriptions=(_defineProperty(_diffTypesDescription={},diffTypes.different,"different objects."),_defineProperty(_diffTypesDescription,diffTypes.deepEquals,"different objects that are equal by value."),_defineProperty(_diffTypesDescription,diffTypes.date,"different date objects with the same value."),_defineProperty(_diffTypesDescription,diffTypes.regex,"different regular expressions with the same value."),_defineProperty(_diffTypesDescription,diffTypes.reactElement,"different React elements with the same displayName."),_defineProperty(_diffTypesDescription,diffTypes.function,"different functions with the same name."),_diffTypesDescription),inHotReload=!1;function shouldLog(e,t,r){return!inHotReload&&(!!r.logOnDifferentValues||(!(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)||!(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===diffTypes.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===diffTypes.different}))))}function logDifference(e,t,r,n,o,i,f){o&&o.length>0?(f.consoleLog(_defineProperty({},t,e),"".concat(r," of ").concat(n," changes:")),o.forEach(function(e){var t=e.pathString,r=e.diffType,o=e.prevValue,i=e.nextValue;f.consoleGroup("%c".concat(n,".%c").concat(t,"%c"),"color:blue;","color:red;","color:black;"),f.consoleLog("".concat(diffTypesDescriptions[r]," (more info at ").concat(moreInfoUrl,")")),f.consoleLog(_defineProperty({},"prev ".concat(t),o),"!==",_defineProperty({},"next ".concat(t),i)),f.consoleGroupEnd()})):o&&(f.consoleLog(_defineProperty({},t,e),"".concat(r," the ").concat(n," object itself changed but it's values are all equal."),"props"===n?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(moreInfoUrl)),f.consoleLog("prev ".concat(n,":"),i.prev," !== ",i.next,":next ".concat(n)))}function defaultNotifier(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,i=e.nextProps,f=e.nextState,a=e.reason,s=e.options;if(shouldLog(a,t,s)){s.consoleGroup("%c".concat(r),"color: #058;");var c="Re-rendered because";a.propsDifferences&&(logDifference(t,r,c,"props",a.propsDifferences,{prev:n,next:i},s),c="And because"),a.stateDifferences&&logDifference(t,r,c,"state",a.stateDifferences,{prev:o,next:f},s),a.propsDifferences||a.stateDifferences||s.consoleLog(_defineProperty({},r,t),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat(moreInfoUrl)),s.consoleGroupEnd()}}function createDefaultNotifier(e){return e&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(inHotReload=!0,setTimeout(function(){inHotReload=!1},e))}),defaultNotifier}var emptyFn=function(){};function normalizeOptions(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=console.group,r=console.groupEnd;return e.collapseGroups?t=console.groupCollapsed:e.onlyLogs&&(t=console.log,r=emptyFn),_objectSpread({include:null,exclude:null,notifier:e.notifier||createDefaultNotifier(e.hasOwnProperty("hotReloadBufferMs")?e.hotReloadBufferMs:500),onlyLogs:!1,consoleLog:console.log,consoleGroup:t,consoleGroupEnd:r,logOnDifferentValues:!1},e)}function getDisplayName(e){return e.displayName||e.name||(_isString(e)?e:void 0)}var hasElementType="undefined"!=typeof Element,hasSymbol="function"==typeof Symbol&&Symbol.for,REACT_ELEMENT_TYPE$1=hasSymbol?Symbol.for("react.element"):60103,isReactElement=function(e){return e.$$typeof===REACT_ELEMENT_TYPE$1};function trackDiff(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==diffTypes.different}function accumulateDeepEqualDiffs(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(e===t)return!0;if(!e||!t)return trackDiff(e,t,r,n,diffTypes.different);if(_isArray(e)&&_isArray(t)){var o=e.length;if(o!==t.length)return trackDiff(e,t,r,n,diffTypes.different);for(var i=!0,f=o;0!=f--;)accumulateDeepEqualDiffs(e[f],t[f],r,"".concat(n,"[").concat(f,"]"))||(i=!1);return trackDiff(e,t,r,n,i?diffTypes.deepEquals:diffTypes.different)}if(_isDate(e)&&_isDate(t))return e.getTime()===t.getTime()?trackDiff(e,t,r,n,diffTypes.date):trackDiff(e,t,r,n,diffTypes.different);if(_isRegExp(e)&&_isRegExp(t))return e.toString()===t.toString()?trackDiff(e,t,r,n,diffTypes.regex):trackDiff(e,t,r,n,diffTypes.different);if(hasElementType&&e instanceof Element&&t instanceof Element)return trackDiff(e,t,r,n,diffTypes.different);if(isReactElement(e)&&isReactElement(t))return e.type===t.type?trackDiff(e,t,r,n,diffTypes.reactElement):trackDiff(e,t,r,n,diffTypes.different);if(_isFunction(e)&&_isFunction(t))return e.name===t.name?trackDiff(e,t,r,n,diffTypes.function):trackDiff(e,t,r,n,diffTypes.different);if(_isPlainObject(e)&&_isPlainObject(t)){var a=_keys(e),s=a.length;if(s!==_keys(t).length)return trackDiff(e,t,r,n,diffTypes.different);for(var c=s;0!=c--;)if(!_has(t,a[c]))return trackDiff(e,t,r,n,diffTypes.different);for(var p=!0,u=s;0!=u--;){var l=a[u];accumulateDeepEqualDiffs(e[l],t[l],r,"".concat(n,".").concat(l))||(p=!1)}return trackDiff(e,t,r,n,p?diffTypes.deepEquals:diffTypes.different)}return trackDiff(e,t,r,n,diffTypes.different)}function calculateDeepEqualDiffs(e,t,r){try{var n=[];return accumulateDeepEqualDiffs(e,t,n,r),n}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var emptyObject={};function findObjectsDifferences(e,t){if(e===t)return!1;var r=e||emptyObject,n=t||emptyObject,o=_keys(_objectSpread({},r,n));return _reduce(o,function(e,t){var o=calculateDeepEqualDiffs(r[t],n[t],t);return o&&(e=_toConsumableArray(e||[]).concat(_toConsumableArray(o))),e},[])}function getUpdateReason(e,t,r,n){return{propsDifferences:findObjectsDifferences(e,r,"props"),stateDifferences:findObjectsDifferences(t,n,"state")}}function getUpdateInfo(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,i=e.nextProps,f=e.nextState;return{Component:t,displayName:r,prevProps:n,prevState:o,nextProps:i,nextState:f,options:e.options,reason:getUpdateReason(n,o,i,f)}}function shouldInclude(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}function shouldExclude(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}function shouldTrack(e,t,r){return!shouldExclude(t,r)&&!(!e.whyDidYouRender&&!shouldInclude(t,r))}function patchClassComponent(e,t,r,n){var o=function(r){function o(t,r){var n;if(_classCallCheck(this,o),(n=_possibleConstructorReturn(this,_getPrototypeOf(o).call(this,t,r))).render&&!e.prototype.render){var i=n.render;n.render=function(){return o.prototype.render.apply(_assertThisInitialized(_assertThisInitialized(n))),i()}}return n}return _inherits(o,e),_createClass(o,[{key:"render",value:function(){return this._prevProps&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:n})),this._prevProps=this.props,this._prevState=this.state,_get(_getPrototypeOf(o.prototype),"render",this)&&_get(_getPrototypeOf(o.prototype),"render",this).call(this)}}]),o}();return Object.assign(o,e,{displayName:t}),o}function patchFunctionalComponent(e,t,r,n){var o=void 0;function i(r){return o&&n.notifier(getUpdateInfo({Component:e,displayName:t,prevProps:o,nextProps:r,options:n})),o=r,e(r)}return Object.assign(i,e,{displayName:t}),i}function createPatchedComponent(e,t,r,n,o){return t.prototype&&t.prototype.isReactComponent?patchClassComponent(t,r,n,o):patchFunctionalComponent(t,r,n,o)}function getPatchedComponent(e,t,r,n,o){if(e.has(t))return e.get(t);var i=createPatchedComponent(e,t,r,n,o);return e.set(t,i),i}function whyDidYouRender(e,t){var r=normalizeOptions(t),n=e.createElement,o=new WeakMap;return e.createElement=function(t){for(var i="function"==typeof t&&shouldTrack(t,getDisplayName(t),r),f=arguments.length,a=new Array(f>1?f-1:0),s=1;s<f;s++)a[s-1]=arguments[s];if(!i)return n.apply(e,[t].concat(a));var c=t&&t.whyDidYouRender&&t.whyDidYouRender.customName||getDisplayName(t),p=getPatchedComponent(o,t,c,e,r);return n.apply(e,[p].concat(a))},e.__REVERT_WHY_DID_YOU_RENDER__=function(){e.createElement=n,o=null,delete e.__REVERT_WHY_DID_YOU_RENDER__},e}export default whyDidYouRender; | ||
//# sourceMappingURL=whyDidYouRender.min.js.map |
/** | ||
* @welldone-software/why-did-you-render 2.3.1 | ||
* @welldone-software/why-did-you-render 2.3.2 | ||
* MIT Licensed | ||
@@ -8,3 +8,3 @@ * Generated by Vitali Zaidman <vzaidman@gmail.com> (https://github.com/vzaidman) | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.whyDidYouRender=t()}(this,function(){"use strict";function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(r){t(e,r,n[r])})}return e}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t,r){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e}(e,t);if(o){var a=Object.getOwnPropertyDescriptor(o,t);return a.get?a.get.call(r):a.value}})(e,t,r||e)}function u(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var c,f={different:"different",deepEquals:"deepEquals",date:"date",regex:"regex",reactElement:"reactElement",function:"function"},s="http://bit.ly/wdyr02",l=(t(c={},f.different,"different objects."),t(c,f.deepEquals,"different objects that are equal by value."),t(c,f.date,"different date objects with the same value."),t(c,f.regex,"different regular expressions with the same value."),t(c,f.reactElement,"different React elements with the same displayName."),t(c,f.function,"different functions with the same name."),c),p=!1;function v(e,r,n,o,a,i,u){a&&a.length>0?(u.consoleLog(t({},r,e),"".concat(n," of ").concat(o," changes:")),a.forEach(function(e){var r=e.pathString,n=e.diffType,a=e.prevValue,i=e.nextValue;u.consoleGroup("%c".concat(o,".%c").concat(r,"%c"),"color:blue;","color:red;","color:black;"),u.consoleLog("".concat(l[n]," (more info at ").concat(s,")")),u.consoleLog(t({},"prev ".concat(r),a),"!==",t({},"next ".concat(r),i)),u.consoleGroupEnd()})):a&&(u.consoleLog(t({},r,e),"".concat(n," the ").concat(o," object itself changed but it's values are all equal."),"props"===o?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(s)),u.consoleLog("prev ".concat(o,":"),i.prev," !== ",i.next,":next ".concat(o)))}function h(e){var r=e.Component,n=e.displayName,o=e.prevProps,a=e.prevState,i=e.nextProps,u=e.nextState,c=e.reason,l=e.options;if(function(e,t,r){return!(p||!r.logOnDifferentValues&&(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)&&(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===f.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===f.different})))}(c,r,l)){l.consoleGroup("%c".concat(n),"color: #058;");var h="Re-rendered because";c.propsDifferences&&(v(r,n,h,"props",c.propsDifferences,{prev:o,next:i},l),h="And because"),c.stateDifferences&&v(r,n,h,"state",c.stateDifferences,{prev:a,next:u},l),c.propsDifferences||c.stateDifferences||l.consoleLog(t({},n,r),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat(s)),l.consoleGroupEnd()}}var d=function(){};function y(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=console.group,o=console.groupEnd;return t.collapseGroups?n=console.groupCollapsed:t.onlyLogs&&(n=console.log,o=d),r({include:null,exclude:null,notifier:t.notifier||((e=t.hasOwnProperty("hotReloadBufferMs")?t.hotReloadBufferMs:500)&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(p=!0,setTimeout(function(){p=!1},e))}),h),onlyLogs:!1,consoleLog:console.log,consoleGroup:n,consoleGroupEnd:o,logOnDifferentValues:!1},t)}var b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function g(e,t){return e(t={exports:{}},t.exports),t.exports}var _="object"==typeof b&&b&&b.Object===Object&&b,j="object"==typeof self&&self&&self.Object===Object&&self,m=_||j||Function("return this")(),O=m.Symbol,w=Object.prototype,E=w.hasOwnProperty,S=w.toString,P=O?O.toStringTag:void 0;var x=function(e){var t=E.call(e,P),r=e[P];try{e[P]=void 0}catch(e){}var n=S.call(e);return t?e[P]=r:delete e[P],n},D=Object.prototype.toString;var A=function(e){return D.call(e)},R="[object Null]",z="[object Undefined]",T=O?O.toStringTag:void 0;var k=function(e){return null==e?void 0===e?z:R:T&&T in Object(e)?x(e):A(e)},N=Array.isArray;var L=function(e){return null!=e&&"object"==typeof e},V="[object String]";var C=function(e){return"string"==typeof e||!N(e)&&L(e)&&k(e)==V};function M(e){return e.displayName||e.name||(C(e)?e:void 0)}var $=function(e,t,r,n){var o=-1,a=null==e?0:e.length;for(n&&a&&(r=e[++o]);++o<a;)r=t(r,e[o],o,e);return r};var F=function(e){return function(t,r,n){for(var o=-1,a=Object(t),i=n(t),u=i.length;u--;){var c=i[e?u:++o];if(!1===r(a[c],c,a))break}return t}}();var Y=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n},q="[object Arguments]";var B=function(e){return L(e)&&k(e)==q},I=Object.prototype,U=I.hasOwnProperty,G=I.propertyIsEnumerable,W=B(function(){return arguments}())?B:function(e){return L(e)&&U.call(e,"callee")&&!G.call(e,"callee")};var H=function(){return!1},J=g(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?m.Buffer:void 0,a=(o?o.isBuffer:void 0)||H;e.exports=a}),K=9007199254740991,Q=/^(?:0|[1-9]\d*)$/;var X=function(e,t){var r=typeof e;return!!(t=null==t?K:t)&&("number"==r||"symbol"!=r&&Q.test(e))&&e>-1&&e%1==0&&e<t},Z=9007199254740991;var ee=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Z},te={};te["[object Float32Array]"]=te["[object Float64Array]"]=te["[object Int8Array]"]=te["[object Int16Array]"]=te["[object Int32Array]"]=te["[object Uint8Array]"]=te["[object Uint8ClampedArray]"]=te["[object Uint16Array]"]=te["[object Uint32Array]"]=!0,te["[object Arguments]"]=te["[object Array]"]=te["[object ArrayBuffer]"]=te["[object Boolean]"]=te["[object DataView]"]=te["[object Date]"]=te["[object Error]"]=te["[object Function]"]=te["[object Map]"]=te["[object Number]"]=te["[object Object]"]=te["[object RegExp]"]=te["[object Set]"]=te["[object String]"]=te["[object WeakMap]"]=!1;var re=function(e){return L(e)&&ee(e.length)&&!!te[k(e)]};var ne=function(e){return function(t){return e(t)}},oe=g(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&_.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}),ae=oe&&oe.isTypedArray,ie=ae?ne(ae):re,ue=Object.prototype.hasOwnProperty;var ce=function(e,t){var r=N(e),n=!r&&W(e),o=!r&&!n&&J(e),a=!r&&!n&&!o&&ie(e),i=r||n||o||a,u=i?Y(e.length,String):[],c=u.length;for(var f in e)!t&&!ue.call(e,f)||i&&("length"==f||o&&("offset"==f||"parent"==f)||a&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||X(f,c))||u.push(f);return u},fe=Object.prototype;var se=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||fe)};var le=function(e,t){return function(r){return e(t(r))}},pe=le(Object.keys,Object),ve=Object.prototype.hasOwnProperty;var he=function(e){if(!se(e))return pe(e);var t=[];for(var r in Object(e))ve.call(e,r)&&"constructor"!=r&&t.push(r);return t};var de=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ye="[object AsyncFunction]",be="[object Function]",ge="[object GeneratorFunction]",_e="[object Proxy]";var je=function(e){if(!de(e))return!1;var t=k(e);return t==be||t==ge||t==ye||t==_e};var me=function(e){return null!=e&&ee(e.length)&&!je(e)};var Oe=function(e){return me(e)?ce(e):he(e)};var we=function(e,t){return function(r,n){if(null==r)return r;if(!me(r))return e(r,n);for(var o=r.length,a=t?o:-1,i=Object(r);(t?a--:++a<o)&&!1!==n(i[a],a,i););return r}}(function(e,t){return e&&F(e,t,Oe)});var Ee=function(){this.__data__=[],this.size=0};var Se=function(e,t){return e===t||e!=e&&t!=t};var Pe=function(e,t){for(var r=e.length;r--;)if(Se(e[r][0],t))return r;return-1},xe=Array.prototype.splice;var De=function(e){var t=this.__data__,r=Pe(t,e);return!(r<0||(r==t.length-1?t.pop():xe.call(t,r,1),--this.size,0))};var Ae=function(e){var t=this.__data__,r=Pe(t,e);return r<0?void 0:t[r][1]};var Re=function(e){return Pe(this.__data__,e)>-1};var ze=function(e,t){var r=this.__data__,n=Pe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Te(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Te.prototype.clear=Ee,Te.prototype.delete=De,Te.prototype.get=Ae,Te.prototype.has=Re,Te.prototype.set=ze;var ke=Te;var Ne=function(){this.__data__=new ke,this.size=0};var Le=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var Ve=function(e){return this.__data__.get(e)};var Ce,Me=function(e){return this.__data__.has(e)},$e=m["__core-js_shared__"],Fe=(Ce=/[^.]+$/.exec($e&&$e.keys&&$e.keys.IE_PROTO||""))?"Symbol(src)_1."+Ce:"";var Ye=function(e){return!!Fe&&Fe in e},qe=Function.prototype.toString;var Be=function(e){if(null!=e){try{return qe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ie=/^\[object .+?Constructor\]$/,Ue=Function.prototype,Ge=Object.prototype,We=Ue.toString,He=Ge.hasOwnProperty,Je=RegExp("^"+We.call(He).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ke=function(e){return!(!de(e)||Ye(e))&&(je(e)?Je:Ie).test(Be(e))};var Qe=function(e,t){return null==e?void 0:e[t]};var Xe=function(e,t){var r=Qe(e,t);return Ke(r)?r:void 0},Ze=Xe(m,"Map"),et=Xe(Object,"create");var tt=function(){this.__data__=et?et(null):{},this.size=0};var rt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},nt="__lodash_hash_undefined__",ot=Object.prototype.hasOwnProperty;var at=function(e){var t=this.__data__;if(et){var r=t[e];return r===nt?void 0:r}return ot.call(t,e)?t[e]:void 0},it=Object.prototype.hasOwnProperty;var ut=function(e){var t=this.__data__;return et?void 0!==t[e]:it.call(t,e)},ct="__lodash_hash_undefined__";var ft=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=et&&void 0===t?ct:t,this};function st(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}st.prototype.clear=tt,st.prototype.delete=rt,st.prototype.get=at,st.prototype.has=ut,st.prototype.set=ft;var lt=st;var pt=function(){this.size=0,this.__data__={hash:new lt,map:new(Ze||ke),string:new lt}};var vt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ht=function(e,t){var r=e.__data__;return vt(t)?r["string"==typeof t?"string":"hash"]:r.map};var dt=function(e){var t=ht(this,e).delete(e);return this.size-=t?1:0,t};var yt=function(e){return ht(this,e).get(e)};var bt=function(e){return ht(this,e).has(e)};var gt=function(e,t){var r=ht(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function _t(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}_t.prototype.clear=pt,_t.prototype.delete=dt,_t.prototype.get=yt,_t.prototype.has=bt,_t.prototype.set=gt;var jt=_t,mt=200;var Ot=function(e,t){var r=this.__data__;if(r instanceof ke){var n=r.__data__;if(!Ze||n.length<mt-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new jt(n)}return r.set(e,t),this.size=r.size,this};function wt(e){var t=this.__data__=new ke(e);this.size=t.size}wt.prototype.clear=Ne,wt.prototype.delete=Le,wt.prototype.get=Ve,wt.prototype.has=Me,wt.prototype.set=Ot;var Et=wt,St="__lodash_hash_undefined__";var Pt=function(e){return this.__data__.set(e,St),this};var xt=function(e){return this.__data__.has(e)};function Dt(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new jt;++t<r;)this.add(e[t])}Dt.prototype.add=Dt.prototype.push=Pt,Dt.prototype.has=xt;var At=Dt;var Rt=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1};var zt=function(e,t){return e.has(t)},Tt=1,kt=2;var Nt=function(e,t,r,n,o,a){var i=r&Tt,u=e.length,c=t.length;if(u!=c&&!(i&&c>u))return!1;var f=a.get(e);if(f&&a.get(t))return f==t;var s=-1,l=!0,p=r&kt?new At:void 0;for(a.set(e,t),a.set(t,e);++s<u;){var v=e[s],h=t[s];if(n)var d=i?n(h,v,s,t,e,a):n(v,h,s,e,t,a);if(void 0!==d){if(d)continue;l=!1;break}if(p){if(!Rt(t,function(e,t){if(!zt(p,t)&&(v===e||o(v,e,r,n,a)))return p.push(t)})){l=!1;break}}else if(v!==h&&!o(v,h,r,n,a)){l=!1;break}}return a.delete(e),a.delete(t),l},Lt=m.Uint8Array;var Vt=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r};var Ct=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r},Mt=1,$t=2,Ft="[object Boolean]",Yt="[object Date]",qt="[object Error]",Bt="[object Map]",It="[object Number]",Ut="[object RegExp]",Gt="[object Set]",Wt="[object String]",Ht="[object Symbol]",Jt="[object ArrayBuffer]",Kt="[object DataView]",Qt=O?O.prototype:void 0,Xt=Qt?Qt.valueOf:void 0;var Zt=function(e,t,r,n,o,a,i){switch(r){case Kt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Jt:return!(e.byteLength!=t.byteLength||!a(new Lt(e),new Lt(t)));case Ft:case Yt:case It:return Se(+e,+t);case qt:return e.name==t.name&&e.message==t.message;case Ut:case Wt:return e==t+"";case Bt:var u=Vt;case Gt:var c=n&Mt;if(u||(u=Ct),e.size!=t.size&&!c)return!1;var f=i.get(e);if(f)return f==t;n|=$t,i.set(e,t);var s=Nt(u(e),u(t),n,o,a,i);return i.delete(e),s;case Ht:if(Xt)return Xt.call(e)==Xt.call(t)}return!1};var er=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e};var tr=function(e,t,r){var n=t(e);return N(e)?n:er(n,r(e))};var rr=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,a=[];++r<n;){var i=e[r];t(i,r,e)&&(a[o++]=i)}return a};var nr=function(){return[]},or=Object.prototype.propertyIsEnumerable,ar=Object.getOwnPropertySymbols,ir=ar?function(e){return null==e?[]:(e=Object(e),rr(ar(e),function(t){return or.call(e,t)}))}:nr;var ur=function(e){return tr(e,Oe,ir)},cr=1,fr=Object.prototype.hasOwnProperty;var sr=function(e,t,r,n,o,a){var i=r&cr,u=ur(e),c=u.length;if(c!=ur(t).length&&!i)return!1;for(var f=c;f--;){var s=u[f];if(!(i?s in t:fr.call(t,s)))return!1}var l=a.get(e);if(l&&a.get(t))return l==t;var p=!0;a.set(e,t),a.set(t,e);for(var v=i;++f<c;){var h=e[s=u[f]],d=t[s];if(n)var y=i?n(d,h,s,t,e,a):n(h,d,s,e,t,a);if(!(void 0===y?h===d||o(h,d,r,n,a):y)){p=!1;break}v||(v="constructor"==s)}if(p&&!v){var b=e.constructor,g=t.constructor;b!=g&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof g&&g instanceof g)&&(p=!1)}return a.delete(e),a.delete(t),p},lr=Xe(m,"DataView"),pr=Xe(m,"Promise"),vr=Xe(m,"Set"),hr=Xe(m,"WeakMap"),dr=Be(lr),yr=Be(Ze),br=Be(pr),gr=Be(vr),_r=Be(hr),jr=k;(lr&&"[object DataView]"!=jr(new lr(new ArrayBuffer(1)))||Ze&&"[object Map]"!=jr(new Ze)||pr&&"[object Promise]"!=jr(pr.resolve())||vr&&"[object Set]"!=jr(new vr)||hr&&"[object WeakMap]"!=jr(new hr))&&(jr=function(e){var t=k(e),r="[object Object]"==t?e.constructor:void 0,n=r?Be(r):"";if(n)switch(n){case dr:return"[object DataView]";case yr:return"[object Map]";case br:return"[object Promise]";case gr:return"[object Set]";case _r:return"[object WeakMap]"}return t});var mr=jr,Or=1,wr="[object Arguments]",Er="[object Array]",Sr="[object Object]",Pr=Object.prototype.hasOwnProperty;var xr=function(e,t,r,n,o,a){var i=N(e),u=N(t),c=i?Er:mr(e),f=u?Er:mr(t),s=(c=c==wr?Sr:c)==Sr,l=(f=f==wr?Sr:f)==Sr,p=c==f;if(p&&J(e)){if(!J(t))return!1;i=!0,s=!1}if(p&&!s)return a||(a=new Et),i||ie(e)?Nt(e,t,r,n,o,a):Zt(e,t,c,r,n,o,a);if(!(r&Or)){var v=s&&Pr.call(e,"__wrapped__"),h=l&&Pr.call(t,"__wrapped__");if(v||h){var d=v?e.value():e,y=h?t.value():t;return a||(a=new Et),o(d,y,r,n,a)}}return!!p&&(a||(a=new Et),sr(e,t,r,n,o,a))};var Dr=function e(t,r,n,o,a){return t===r||(null==t||null==r||!L(t)&&!L(r)?t!=t&&r!=r:xr(t,r,n,o,e,a))},Ar=1,Rr=2;var zr=function(e,t,r,n){var o=r.length,a=o,i=!n;if(null==e)return!a;for(e=Object(e);o--;){var u=r[o];if(i&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<a;){var c=(u=r[o])[0],f=e[c],s=u[1];if(i&&u[2]){if(void 0===f&&!(c in e))return!1}else{var l=new Et;if(n)var p=n(f,s,c,e,t,l);if(!(void 0===p?Dr(s,f,Ar|Rr,n,l):p))return!1}}return!0};var Tr=function(e){return e==e&&!de(e)};var kr=function(e){for(var t=Oe(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,Tr(o)]}return t};var Nr=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}};var Lr=function(e){var t=kr(e);return 1==t.length&&t[0][2]?Nr(t[0][0],t[0][1]):function(r){return r===e||zr(r,e,t)}},Vr="[object Symbol]";var Cr=function(e){return"symbol"==typeof e||L(e)&&k(e)==Vr},Mr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$r=/^\w*$/;var Fr=function(e,t){if(N(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Cr(e))||$r.test(e)||!Mr.test(e)||null!=t&&e in Object(t)},Yr="Expected a function";function qr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Yr);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(qr.Cache||jt),r}qr.Cache=jt;var Br=qr,Ir=500;var Ur=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gr=/\\(\\)?/g,Wr=function(e){var t=Br(e,function(e){return r.size===Ir&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ur,function(e,r,n,o){t.push(n?o.replace(Gr,"$1"):r||e)}),t});var Hr=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},Jr=1/0,Kr=O?O.prototype:void 0,Qr=Kr?Kr.toString:void 0;var Xr=function e(t){if("string"==typeof t)return t;if(N(t))return Hr(t,e)+"";if(Cr(t))return Qr?Qr.call(t):"";var r=t+"";return"0"==r&&1/t==-Jr?"-0":r};var Zr=function(e){return null==e?"":Xr(e)};var en=function(e,t){return N(e)?e:Fr(e,t)?[e]:Wr(Zr(e))},tn=1/0;var rn=function(e){if("string"==typeof e||Cr(e))return e;var t=e+"";return"0"==t&&1/e==-tn?"-0":t};var nn=function(e,t){for(var r=0,n=(t=en(t,e)).length;null!=e&&r<n;)e=e[rn(t[r++])];return r&&r==n?e:void 0};var on=function(e,t,r){var n=null==e?void 0:nn(e,t);return void 0===n?r:n};var an=function(e,t){return null!=e&&t in Object(e)};var un=function(e,t,r){for(var n=-1,o=(t=en(t,e)).length,a=!1;++n<o;){var i=rn(t[n]);if(!(a=null!=e&&r(e,i)))break;e=e[i]}return a||++n!=o?a:!!(o=null==e?0:e.length)&&ee(o)&&X(i,o)&&(N(e)||W(e))};var cn=function(e,t){return null!=e&&un(e,t,an)},fn=1,sn=2;var ln=function(e,t){return Fr(e)&&Tr(t)?Nr(rn(e),t):function(r){var n=on(r,e);return void 0===n&&n===t?cn(r,e):Dr(t,n,fn|sn)}};var pn=function(e){return e};var vn=function(e){return function(t){return null==t?void 0:t[e]}};var hn=function(e){return function(t){return nn(t,e)}};var dn=function(e){return Fr(e)?vn(rn(e)):hn(e)};var yn=function(e){return"function"==typeof e?e:null==e?pn:"object"==typeof e?N(e)?ln(e[0],e[1]):Lr(e):dn(e)};var bn=function(e,t,r,n,o){return o(e,function(e,o,a){r=n?(n=!1,e):t(r,e,o,a)}),r};var gn=function(e,t,r){var n=N(e)?$:bn,o=arguments.length<3;return n(e,yn(t,4),r,o,we)},_n=Object.prototype.hasOwnProperty;var jn=function(e,t){return null!=e&&_n.call(e,t)};var mn=function(e,t){return null!=e&&un(e,t,jn)},On="[object RegExp]";var wn=function(e){return L(e)&&k(e)==On},En=oe&&oe.isRegExp,Sn=En?ne(En):wn,Pn="[object Date]";var xn=function(e){return L(e)&&k(e)==Pn},Dn=oe&&oe.isDate,An=Dn?ne(Dn):xn,Rn=le(Object.getPrototypeOf,Object),zn="[object Object]",Tn=Function.prototype,kn=Object.prototype,Nn=Tn.toString,Ln=kn.hasOwnProperty,Vn=Nn.call(Object);var Cn=function(e){if(!L(e)||k(e)!=zn)return!1;var t=Rn(e);if(null===t)return!0;var r=Ln.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Nn.call(r)==Vn},Mn="undefined"!=typeof Element,$n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,Fn=function(e){return e.$$typeof===$n};function Yn(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==f.different}function qn(e,t,r){try{var n=[];return function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(t===r)return!0;if(!t||!r)return Yn(t,r,n,o,f.different);if(N(t)&&N(r)){var a=t.length;if(a!==r.length)return Yn(t,r,n,o,f.different);for(var i=!0,u=a;0!=u--;)e(t[u],r[u],n,"".concat(o,"[").concat(u,"]"))||(i=!1);return Yn(t,r,n,o,i?f.deepEquals:f.different)}if(An(t)&&An(r))return t.getTime()===r.getTime()?Yn(t,r,n,o,f.date):Yn(t,r,n,o,f.different);if(Sn(t)&&Sn(r))return t.toString()===r.toString()?Yn(t,r,n,o,f.regex):Yn(t,r,n,o,f.different);if(Mn&&t instanceof Element&&r instanceof Element)return Yn(t,r,n,o,f.different);if(Fn(t)&&Fn(r))return t.type===r.type?Yn(t,r,n,o,f.reactElement):Yn(t,r,n,o,f.different);if(je(t)&&je(r))return t.name===r.name?Yn(t,r,n,o,f.function):Yn(t,r,n,o,f.different);if(Cn(t)&&Cn(r)){var c=Oe(t),s=c.length;if(s!==Oe(r).length)return Yn(t,r,n,o,f.different);for(var l=s;0!=l--;)if(!mn(r,c[l]))return Yn(t,r,n,o,f.different);for(var p=!0,v=s;0!=v--;){var h=c[v];e(t[h],r[h],n,"".concat(o,".").concat(h))||(p=!1)}return Yn(t,r,n,o,p?f.deepEquals:f.different)}return Yn(t,r,n,o,f.different)}(e,t,n,r),n}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var Bn={};function In(e,t){if(e===t)return!1;var n=e||Bn,o=t||Bn,a=Oe(r({},n,o));return gn(a,function(e,t){var r=qn(n[t],o[t],t);return r&&(e=u(e||[]).concat(u(r))),e},[])}function Un(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,a=e.nextProps,i=e.nextState;return{Component:t,displayName:r,prevProps:n,prevState:o,nextProps:a,nextState:i,options:e.options,reason:function(e,t,r,n){return{propsDifferences:In(e,r),stateDifferences:In(t,n)}}(n,o,a,i)}}function Gn(t,r,u,c){var f=function(u){function f(e,r){var o,i,u;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),i=this,u=n(f).call(this,e,r),(o=!u||"object"!=typeof u&&"function"!=typeof u?a(i):u).render&&!t.prototype.render){var c=o.render;o.render=function(){return f.prototype.render.apply(a(a(o))),c()}}return o}var s,l,p;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(f,t),s=f,(l=[{key:"render",value:function(){return this._prevProps&&c.notifier(Un({Component:t,displayName:r,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:c})),this._prevProps=this.props,this._prevState=this.state,i(n(f.prototype),"render",this)&&i(n(f.prototype),"render",this).call(this)}}])&&e(s.prototype,l),p&&e(s,p),f}();return Object.assign(f,t,{displayName:r}),f}function Wn(e,t,r,n,o){return t.prototype&&t.prototype.isReactComponent?Gn(t,r,0,o):function(e,t,r,n){var o=void 0;function a(r){return o&&n.notifier(Un({Component:e,displayName:t,prevProps:o,nextProps:r,options:n})),o=r,e(r)}return Object.assign(a,e,{displayName:t}),a}(t,r,0,o)}return function(e,t){var r=y(t),n=e.createElement,o=new Map;return e.createElement=function(t){for(var a="function"==typeof t&&function(e,t,r){return!(function(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}(t,r)||!e.whyDidYouRender&&!function(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}(t,r))}(t,M(t),r),i=arguments.length,u=new Array(i>1?i-1:0),c=1;c<i;c++)u[c-1]=arguments[c];if(!a)return n.apply(e,[t].concat(u));var f=t&&t.whyDidYouRender&&t.whyDidYouRender.customName||M(t),s=function(e,t,r,n,o){if(e.has(t))return e.get(t);var a=Wn(0,t,r,0,o);return e.set(t,a),a}(o,t,f,0,r);return n.apply(e,[s].concat(u))},e.__REVERT_WHY_DID_YOU_RENDER__=function(){e.createElement=n,delete e.__REVERT_WHY_DID_YOU_RENDER__,o.clear()},e}}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.whyDidYouRender=t()}(this,function(){"use strict";function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(r){t(e,r,n[r])})}return e}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t,r){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e}(e,t);if(o){var a=Object.getOwnPropertyDescriptor(o,t);return a.get?a.get.call(r):a.value}})(e,t,r||e)}function u(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var c,f={different:"different",deepEquals:"deepEquals",date:"date",regex:"regex",reactElement:"reactElement",function:"function"},s="http://bit.ly/wdyr02",l=(t(c={},f.different,"different objects."),t(c,f.deepEquals,"different objects that are equal by value."),t(c,f.date,"different date objects with the same value."),t(c,f.regex,"different regular expressions with the same value."),t(c,f.reactElement,"different React elements with the same displayName."),t(c,f.function,"different functions with the same name."),c),p=!1;function v(e,r,n,o,a,i,u){a&&a.length>0?(u.consoleLog(t({},r,e),"".concat(n," of ").concat(o," changes:")),a.forEach(function(e){var r=e.pathString,n=e.diffType,a=e.prevValue,i=e.nextValue;u.consoleGroup("%c".concat(o,".%c").concat(r,"%c"),"color:blue;","color:red;","color:black;"),u.consoleLog("".concat(l[n]," (more info at ").concat(s,")")),u.consoleLog(t({},"prev ".concat(r),a),"!==",t({},"next ".concat(r),i)),u.consoleGroupEnd()})):a&&(u.consoleLog(t({},r,e),"".concat(n," the ").concat(o," object itself changed but it's values are all equal."),"props"===o?"This could of been avoided by making the component pure, or by preventing it's father from re-rendering.":"This usually means this component called setState when no changes in it's state actually occurred.","more info at ".concat(s)),u.consoleLog("prev ".concat(o,":"),i.prev," !== ",i.next,":next ".concat(o)))}function h(e){var r=e.Component,n=e.displayName,o=e.prevProps,a=e.prevState,i=e.nextProps,u=e.nextState,c=e.reason,l=e.options;if(function(e,t,r){return!(p||!r.logOnDifferentValues&&(!t.whyDidYouRender||!t.whyDidYouRender.logOnDifferentValues)&&(e.propsDifferences&&e.propsDifferences.some(function(e){return e.diffType===f.different})||e.stateDifferences&&e.stateDifferences.some(function(e){return e.diffType===f.different})))}(c,r,l)){l.consoleGroup("%c".concat(n),"color: #058;");var h="Re-rendered because";c.propsDifferences&&(v(r,n,h,"props",c.propsDifferences,{prev:o,next:i},l),h="And because"),c.stateDifferences&&v(r,n,h,"state",c.stateDifferences,{prev:a,next:u},l),c.propsDifferences||c.stateDifferences||l.consoleLog(t({},n,r),"Re-rendered although props and state objects are the same.","This usually means there was a call to this.forceUpdate() inside the component.","more info at ".concat(s)),l.consoleGroupEnd()}}var d=function(){};function y(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=console.group,o=console.groupEnd;return t.collapseGroups?n=console.groupCollapsed:t.onlyLogs&&(n=console.log,o=d),r({include:null,exclude:null,notifier:t.notifier||((e=t.hasOwnProperty("hotReloadBufferMs")?t.hotReloadBufferMs:500)&&module&&module.hot&&module.hot.addStatusHandler&&module.hot.addStatusHandler(function(t){"idle"===t&&(p=!0,setTimeout(function(){p=!1},e))}),h),onlyLogs:!1,consoleLog:console.log,consoleGroup:n,consoleGroupEnd:o,logOnDifferentValues:!1},t)}var b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function g(e,t){return e(t={exports:{}},t.exports),t.exports}var _="object"==typeof b&&b&&b.Object===Object&&b,j="object"==typeof self&&self&&self.Object===Object&&self,m=_||j||Function("return this")(),O=m.Symbol,w=Object.prototype,E=w.hasOwnProperty,S=w.toString,P=O?O.toStringTag:void 0;var x=function(e){var t=E.call(e,P),r=e[P];try{e[P]=void 0}catch(e){}var n=S.call(e);return t?e[P]=r:delete e[P],n},D=Object.prototype.toString;var A=function(e){return D.call(e)},R="[object Null]",z="[object Undefined]",T=O?O.toStringTag:void 0;var k=function(e){return null==e?void 0===e?z:R:T&&T in Object(e)?x(e):A(e)},N=Array.isArray;var L=function(e){return null!=e&&"object"==typeof e},V="[object String]";var C=function(e){return"string"==typeof e||!N(e)&&L(e)&&k(e)==V};function M(e){return e.displayName||e.name||(C(e)?e:void 0)}var $=function(e,t,r,n){var o=-1,a=null==e?0:e.length;for(n&&a&&(r=e[++o]);++o<a;)r=t(r,e[o],o,e);return r};var F=function(e){return function(t,r,n){for(var o=-1,a=Object(t),i=n(t),u=i.length;u--;){var c=i[e?u:++o];if(!1===r(a[c],c,a))break}return t}}();var Y=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n},q="[object Arguments]";var B=function(e){return L(e)&&k(e)==q},I=Object.prototype,U=I.hasOwnProperty,G=I.propertyIsEnumerable,W=B(function(){return arguments}())?B:function(e){return L(e)&&U.call(e,"callee")&&!G.call(e,"callee")};var H=function(){return!1},J=g(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r?m.Buffer:void 0,a=(o?o.isBuffer:void 0)||H;e.exports=a}),K=9007199254740991,Q=/^(?:0|[1-9]\d*)$/;var X=function(e,t){var r=typeof e;return!!(t=null==t?K:t)&&("number"==r||"symbol"!=r&&Q.test(e))&&e>-1&&e%1==0&&e<t},Z=9007199254740991;var ee=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Z},te={};te["[object Float32Array]"]=te["[object Float64Array]"]=te["[object Int8Array]"]=te["[object Int16Array]"]=te["[object Int32Array]"]=te["[object Uint8Array]"]=te["[object Uint8ClampedArray]"]=te["[object Uint16Array]"]=te["[object Uint32Array]"]=!0,te["[object Arguments]"]=te["[object Array]"]=te["[object ArrayBuffer]"]=te["[object Boolean]"]=te["[object DataView]"]=te["[object Date]"]=te["[object Error]"]=te["[object Function]"]=te["[object Map]"]=te["[object Number]"]=te["[object Object]"]=te["[object RegExp]"]=te["[object Set]"]=te["[object String]"]=te["[object WeakMap]"]=!1;var re=function(e){return L(e)&&ee(e.length)&&!!te[k(e)]};var ne=function(e){return function(t){return e(t)}},oe=g(function(e,t){var r=t&&!t.nodeType&&t,n=r&&e&&!e.nodeType&&e,o=n&&n.exports===r&&_.process,a=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=a}),ae=oe&&oe.isTypedArray,ie=ae?ne(ae):re,ue=Object.prototype.hasOwnProperty;var ce=function(e,t){var r=N(e),n=!r&&W(e),o=!r&&!n&&J(e),a=!r&&!n&&!o&&ie(e),i=r||n||o||a,u=i?Y(e.length,String):[],c=u.length;for(var f in e)!t&&!ue.call(e,f)||i&&("length"==f||o&&("offset"==f||"parent"==f)||a&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||X(f,c))||u.push(f);return u},fe=Object.prototype;var se=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||fe)};var le=function(e,t){return function(r){return e(t(r))}},pe=le(Object.keys,Object),ve=Object.prototype.hasOwnProperty;var he=function(e){if(!se(e))return pe(e);var t=[];for(var r in Object(e))ve.call(e,r)&&"constructor"!=r&&t.push(r);return t};var de=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ye="[object AsyncFunction]",be="[object Function]",ge="[object GeneratorFunction]",_e="[object Proxy]";var je=function(e){if(!de(e))return!1;var t=k(e);return t==be||t==ge||t==ye||t==_e};var me=function(e){return null!=e&&ee(e.length)&&!je(e)};var Oe=function(e){return me(e)?ce(e):he(e)};var we=function(e,t){return function(r,n){if(null==r)return r;if(!me(r))return e(r,n);for(var o=r.length,a=t?o:-1,i=Object(r);(t?a--:++a<o)&&!1!==n(i[a],a,i););return r}}(function(e,t){return e&&F(e,t,Oe)});var Ee=function(){this.__data__=[],this.size=0};var Se=function(e,t){return e===t||e!=e&&t!=t};var Pe=function(e,t){for(var r=e.length;r--;)if(Se(e[r][0],t))return r;return-1},xe=Array.prototype.splice;var De=function(e){var t=this.__data__,r=Pe(t,e);return!(r<0||(r==t.length-1?t.pop():xe.call(t,r,1),--this.size,0))};var Ae=function(e){var t=this.__data__,r=Pe(t,e);return r<0?void 0:t[r][1]};var Re=function(e){return Pe(this.__data__,e)>-1};var ze=function(e,t){var r=this.__data__,n=Pe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Te(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Te.prototype.clear=Ee,Te.prototype.delete=De,Te.prototype.get=Ae,Te.prototype.has=Re,Te.prototype.set=ze;var ke=Te;var Ne=function(){this.__data__=new ke,this.size=0};var Le=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var Ve=function(e){return this.__data__.get(e)};var Ce,Me=function(e){return this.__data__.has(e)},$e=m["__core-js_shared__"],Fe=(Ce=/[^.]+$/.exec($e&&$e.keys&&$e.keys.IE_PROTO||""))?"Symbol(src)_1."+Ce:"";var Ye=function(e){return!!Fe&&Fe in e},qe=Function.prototype.toString;var Be=function(e){if(null!=e){try{return qe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ie=/^\[object .+?Constructor\]$/,Ue=Function.prototype,Ge=Object.prototype,We=Ue.toString,He=Ge.hasOwnProperty,Je=RegExp("^"+We.call(He).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ke=function(e){return!(!de(e)||Ye(e))&&(je(e)?Je:Ie).test(Be(e))};var Qe=function(e,t){return null==e?void 0:e[t]};var Xe=function(e,t){var r=Qe(e,t);return Ke(r)?r:void 0},Ze=Xe(m,"Map"),et=Xe(Object,"create");var tt=function(){this.__data__=et?et(null):{},this.size=0};var rt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},nt="__lodash_hash_undefined__",ot=Object.prototype.hasOwnProperty;var at=function(e){var t=this.__data__;if(et){var r=t[e];return r===nt?void 0:r}return ot.call(t,e)?t[e]:void 0},it=Object.prototype.hasOwnProperty;var ut=function(e){var t=this.__data__;return et?void 0!==t[e]:it.call(t,e)},ct="__lodash_hash_undefined__";var ft=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=et&&void 0===t?ct:t,this};function st(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}st.prototype.clear=tt,st.prototype.delete=rt,st.prototype.get=at,st.prototype.has=ut,st.prototype.set=ft;var lt=st;var pt=function(){this.size=0,this.__data__={hash:new lt,map:new(Ze||ke),string:new lt}};var vt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ht=function(e,t){var r=e.__data__;return vt(t)?r["string"==typeof t?"string":"hash"]:r.map};var dt=function(e){var t=ht(this,e).delete(e);return this.size-=t?1:0,t};var yt=function(e){return ht(this,e).get(e)};var bt=function(e){return ht(this,e).has(e)};var gt=function(e,t){var r=ht(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function _t(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}_t.prototype.clear=pt,_t.prototype.delete=dt,_t.prototype.get=yt,_t.prototype.has=bt,_t.prototype.set=gt;var jt=_t,mt=200;var Ot=function(e,t){var r=this.__data__;if(r instanceof ke){var n=r.__data__;if(!Ze||n.length<mt-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new jt(n)}return r.set(e,t),this.size=r.size,this};function wt(e){var t=this.__data__=new ke(e);this.size=t.size}wt.prototype.clear=Ne,wt.prototype.delete=Le,wt.prototype.get=Ve,wt.prototype.has=Me,wt.prototype.set=Ot;var Et=wt,St="__lodash_hash_undefined__";var Pt=function(e){return this.__data__.set(e,St),this};var xt=function(e){return this.__data__.has(e)};function Dt(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new jt;++t<r;)this.add(e[t])}Dt.prototype.add=Dt.prototype.push=Pt,Dt.prototype.has=xt;var At=Dt;var Rt=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1};var zt=function(e,t){return e.has(t)},Tt=1,kt=2;var Nt=function(e,t,r,n,o,a){var i=r&Tt,u=e.length,c=t.length;if(u!=c&&!(i&&c>u))return!1;var f=a.get(e);if(f&&a.get(t))return f==t;var s=-1,l=!0,p=r&kt?new At:void 0;for(a.set(e,t),a.set(t,e);++s<u;){var v=e[s],h=t[s];if(n)var d=i?n(h,v,s,t,e,a):n(v,h,s,e,t,a);if(void 0!==d){if(d)continue;l=!1;break}if(p){if(!Rt(t,function(e,t){if(!zt(p,t)&&(v===e||o(v,e,r,n,a)))return p.push(t)})){l=!1;break}}else if(v!==h&&!o(v,h,r,n,a)){l=!1;break}}return a.delete(e),a.delete(t),l},Lt=m.Uint8Array;var Vt=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r};var Ct=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r},Mt=1,$t=2,Ft="[object Boolean]",Yt="[object Date]",qt="[object Error]",Bt="[object Map]",It="[object Number]",Ut="[object RegExp]",Gt="[object Set]",Wt="[object String]",Ht="[object Symbol]",Jt="[object ArrayBuffer]",Kt="[object DataView]",Qt=O?O.prototype:void 0,Xt=Qt?Qt.valueOf:void 0;var Zt=function(e,t,r,n,o,a,i){switch(r){case Kt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Jt:return!(e.byteLength!=t.byteLength||!a(new Lt(e),new Lt(t)));case Ft:case Yt:case It:return Se(+e,+t);case qt:return e.name==t.name&&e.message==t.message;case Ut:case Wt:return e==t+"";case Bt:var u=Vt;case Gt:var c=n&Mt;if(u||(u=Ct),e.size!=t.size&&!c)return!1;var f=i.get(e);if(f)return f==t;n|=$t,i.set(e,t);var s=Nt(u(e),u(t),n,o,a,i);return i.delete(e),s;case Ht:if(Xt)return Xt.call(e)==Xt.call(t)}return!1};var er=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e};var tr=function(e,t,r){var n=t(e);return N(e)?n:er(n,r(e))};var rr=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,a=[];++r<n;){var i=e[r];t(i,r,e)&&(a[o++]=i)}return a};var nr=function(){return[]},or=Object.prototype.propertyIsEnumerable,ar=Object.getOwnPropertySymbols,ir=ar?function(e){return null==e?[]:(e=Object(e),rr(ar(e),function(t){return or.call(e,t)}))}:nr;var ur=function(e){return tr(e,Oe,ir)},cr=1,fr=Object.prototype.hasOwnProperty;var sr=function(e,t,r,n,o,a){var i=r&cr,u=ur(e),c=u.length;if(c!=ur(t).length&&!i)return!1;for(var f=c;f--;){var s=u[f];if(!(i?s in t:fr.call(t,s)))return!1}var l=a.get(e);if(l&&a.get(t))return l==t;var p=!0;a.set(e,t),a.set(t,e);for(var v=i;++f<c;){var h=e[s=u[f]],d=t[s];if(n)var y=i?n(d,h,s,t,e,a):n(h,d,s,e,t,a);if(!(void 0===y?h===d||o(h,d,r,n,a):y)){p=!1;break}v||(v="constructor"==s)}if(p&&!v){var b=e.constructor,g=t.constructor;b!=g&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof g&&g instanceof g)&&(p=!1)}return a.delete(e),a.delete(t),p},lr=Xe(m,"DataView"),pr=Xe(m,"Promise"),vr=Xe(m,"Set"),hr=Xe(m,"WeakMap"),dr=Be(lr),yr=Be(Ze),br=Be(pr),gr=Be(vr),_r=Be(hr),jr=k;(lr&&"[object DataView]"!=jr(new lr(new ArrayBuffer(1)))||Ze&&"[object Map]"!=jr(new Ze)||pr&&"[object Promise]"!=jr(pr.resolve())||vr&&"[object Set]"!=jr(new vr)||hr&&"[object WeakMap]"!=jr(new hr))&&(jr=function(e){var t=k(e),r="[object Object]"==t?e.constructor:void 0,n=r?Be(r):"";if(n)switch(n){case dr:return"[object DataView]";case yr:return"[object Map]";case br:return"[object Promise]";case gr:return"[object Set]";case _r:return"[object WeakMap]"}return t});var mr=jr,Or=1,wr="[object Arguments]",Er="[object Array]",Sr="[object Object]",Pr=Object.prototype.hasOwnProperty;var xr=function(e,t,r,n,o,a){var i=N(e),u=N(t),c=i?Er:mr(e),f=u?Er:mr(t),s=(c=c==wr?Sr:c)==Sr,l=(f=f==wr?Sr:f)==Sr,p=c==f;if(p&&J(e)){if(!J(t))return!1;i=!0,s=!1}if(p&&!s)return a||(a=new Et),i||ie(e)?Nt(e,t,r,n,o,a):Zt(e,t,c,r,n,o,a);if(!(r&Or)){var v=s&&Pr.call(e,"__wrapped__"),h=l&&Pr.call(t,"__wrapped__");if(v||h){var d=v?e.value():e,y=h?t.value():t;return a||(a=new Et),o(d,y,r,n,a)}}return!!p&&(a||(a=new Et),sr(e,t,r,n,o,a))};var Dr=function e(t,r,n,o,a){return t===r||(null==t||null==r||!L(t)&&!L(r)?t!=t&&r!=r:xr(t,r,n,o,e,a))},Ar=1,Rr=2;var zr=function(e,t,r,n){var o=r.length,a=o,i=!n;if(null==e)return!a;for(e=Object(e);o--;){var u=r[o];if(i&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<a;){var c=(u=r[o])[0],f=e[c],s=u[1];if(i&&u[2]){if(void 0===f&&!(c in e))return!1}else{var l=new Et;if(n)var p=n(f,s,c,e,t,l);if(!(void 0===p?Dr(s,f,Ar|Rr,n,l):p))return!1}}return!0};var Tr=function(e){return e==e&&!de(e)};var kr=function(e){for(var t=Oe(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,Tr(o)]}return t};var Nr=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}};var Lr=function(e){var t=kr(e);return 1==t.length&&t[0][2]?Nr(t[0][0],t[0][1]):function(r){return r===e||zr(r,e,t)}},Vr="[object Symbol]";var Cr=function(e){return"symbol"==typeof e||L(e)&&k(e)==Vr},Mr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$r=/^\w*$/;var Fr=function(e,t){if(N(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Cr(e))||$r.test(e)||!Mr.test(e)||null!=t&&e in Object(t)},Yr="Expected a function";function qr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Yr);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(qr.Cache||jt),r}qr.Cache=jt;var Br=qr,Ir=500;var Ur=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gr=/\\(\\)?/g,Wr=function(e){var t=Br(e,function(e){return r.size===Ir&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ur,function(e,r,n,o){t.push(n?o.replace(Gr,"$1"):r||e)}),t});var Hr=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},Jr=1/0,Kr=O?O.prototype:void 0,Qr=Kr?Kr.toString:void 0;var Xr=function e(t){if("string"==typeof t)return t;if(N(t))return Hr(t,e)+"";if(Cr(t))return Qr?Qr.call(t):"";var r=t+"";return"0"==r&&1/t==-Jr?"-0":r};var Zr=function(e){return null==e?"":Xr(e)};var en=function(e,t){return N(e)?e:Fr(e,t)?[e]:Wr(Zr(e))},tn=1/0;var rn=function(e){if("string"==typeof e||Cr(e))return e;var t=e+"";return"0"==t&&1/e==-tn?"-0":t};var nn=function(e,t){for(var r=0,n=(t=en(t,e)).length;null!=e&&r<n;)e=e[rn(t[r++])];return r&&r==n?e:void 0};var on=function(e,t,r){var n=null==e?void 0:nn(e,t);return void 0===n?r:n};var an=function(e,t){return null!=e&&t in Object(e)};var un=function(e,t,r){for(var n=-1,o=(t=en(t,e)).length,a=!1;++n<o;){var i=rn(t[n]);if(!(a=null!=e&&r(e,i)))break;e=e[i]}return a||++n!=o?a:!!(o=null==e?0:e.length)&&ee(o)&&X(i,o)&&(N(e)||W(e))};var cn=function(e,t){return null!=e&&un(e,t,an)},fn=1,sn=2;var ln=function(e,t){return Fr(e)&&Tr(t)?Nr(rn(e),t):function(r){var n=on(r,e);return void 0===n&&n===t?cn(r,e):Dr(t,n,fn|sn)}};var pn=function(e){return e};var vn=function(e){return function(t){return null==t?void 0:t[e]}};var hn=function(e){return function(t){return nn(t,e)}};var dn=function(e){return Fr(e)?vn(rn(e)):hn(e)};var yn=function(e){return"function"==typeof e?e:null==e?pn:"object"==typeof e?N(e)?ln(e[0],e[1]):Lr(e):dn(e)};var bn=function(e,t,r,n,o){return o(e,function(e,o,a){r=n?(n=!1,e):t(r,e,o,a)}),r};var gn=function(e,t,r){var n=N(e)?$:bn,o=arguments.length<3;return n(e,yn(t,4),r,o,we)},_n=Object.prototype.hasOwnProperty;var jn=function(e,t){return null!=e&&_n.call(e,t)};var mn=function(e,t){return null!=e&&un(e,t,jn)},On="[object RegExp]";var wn=function(e){return L(e)&&k(e)==On},En=oe&&oe.isRegExp,Sn=En?ne(En):wn,Pn="[object Date]";var xn=function(e){return L(e)&&k(e)==Pn},Dn=oe&&oe.isDate,An=Dn?ne(Dn):xn,Rn=le(Object.getPrototypeOf,Object),zn="[object Object]",Tn=Function.prototype,kn=Object.prototype,Nn=Tn.toString,Ln=kn.hasOwnProperty,Vn=Nn.call(Object);var Cn=function(e){if(!L(e)||k(e)!=zn)return!1;var t=Rn(e);if(null===t)return!0;var r=Ln.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Nn.call(r)==Vn},Mn="undefined"!=typeof Element,$n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,Fn=function(e){return e.$$typeof===$n};function Yn(e,t,r,n,o){return r.push({diffType:o,pathString:n,prevValue:e,nextValue:t}),o!==f.different}function qn(e,t,r){try{var n=[];return function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(t===r)return!0;if(!t||!r)return Yn(t,r,n,o,f.different);if(N(t)&&N(r)){var a=t.length;if(a!==r.length)return Yn(t,r,n,o,f.different);for(var i=!0,u=a;0!=u--;)e(t[u],r[u],n,"".concat(o,"[").concat(u,"]"))||(i=!1);return Yn(t,r,n,o,i?f.deepEquals:f.different)}if(An(t)&&An(r))return t.getTime()===r.getTime()?Yn(t,r,n,o,f.date):Yn(t,r,n,o,f.different);if(Sn(t)&&Sn(r))return t.toString()===r.toString()?Yn(t,r,n,o,f.regex):Yn(t,r,n,o,f.different);if(Mn&&t instanceof Element&&r instanceof Element)return Yn(t,r,n,o,f.different);if(Fn(t)&&Fn(r))return t.type===r.type?Yn(t,r,n,o,f.reactElement):Yn(t,r,n,o,f.different);if(je(t)&&je(r))return t.name===r.name?Yn(t,r,n,o,f.function):Yn(t,r,n,o,f.different);if(Cn(t)&&Cn(r)){var c=Oe(t),s=c.length;if(s!==Oe(r).length)return Yn(t,r,n,o,f.different);for(var l=s;0!=l--;)if(!mn(r,c[l]))return Yn(t,r,n,o,f.different);for(var p=!0,v=s;0!=v--;){var h=c[v];e(t[h],r[h],n,"".concat(o,".").concat(h))||(p=!1)}return Yn(t,r,n,o,p?f.deepEquals:f.different)}return Yn(t,r,n,o,f.different)}(e,t,n,r),n}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: why-did-you-render couldn't handle circular references in props.",e.name,e.message),!1;throw e}}var Bn={};function In(e,t){if(e===t)return!1;var n=e||Bn,o=t||Bn,a=Oe(r({},n,o));return gn(a,function(e,t){var r=qn(n[t],o[t],t);return r&&(e=u(e||[]).concat(u(r))),e},[])}function Un(e){var t=e.Component,r=e.displayName,n=e.prevProps,o=e.prevState,a=e.nextProps,i=e.nextState;return{Component:t,displayName:r,prevProps:n,prevState:o,nextProps:a,nextState:i,options:e.options,reason:function(e,t,r,n){return{propsDifferences:In(e,r),stateDifferences:In(t,n)}}(n,o,a,i)}}function Gn(t,r,u,c){var f=function(u){function f(e,r){var o,i,u;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),i=this,u=n(f).call(this,e,r),(o=!u||"object"!=typeof u&&"function"!=typeof u?a(i):u).render&&!t.prototype.render){var c=o.render;o.render=function(){return f.prototype.render.apply(a(a(o))),c()}}return o}var s,l,p;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(f,t),s=f,(l=[{key:"render",value:function(){return this._prevProps&&c.notifier(Un({Component:t,displayName:r,prevProps:this._prevProps,prevState:this._prevState,nextProps:this.props,nextState:this.state,options:c})),this._prevProps=this.props,this._prevState=this.state,i(n(f.prototype),"render",this)&&i(n(f.prototype),"render",this).call(this)}}])&&e(s.prototype,l),p&&e(s,p),f}();return Object.assign(f,t,{displayName:r}),f}function Wn(e,t,r,n,o){return t.prototype&&t.prototype.isReactComponent?Gn(t,r,0,o):function(e,t,r,n){var o=void 0;function a(r){return o&&n.notifier(Un({Component:e,displayName:t,prevProps:o,nextProps:r,options:n})),o=r,e(r)}return Object.assign(a,e,{displayName:t}),a}(t,r,0,o)}return function(e,t){var r=y(t),n=e.createElement,o=new WeakMap;return e.createElement=function(t){for(var a="function"==typeof t&&function(e,t,r){return!(function(e,t){return t.exclude&&t.exclude.length>0&&t.exclude.some(function(t){return t.test(e)})}(t,r)||!e.whyDidYouRender&&!function(e,t){return t.include&&t.include.length>0&&t.include.some(function(t){return t.test(e)})}(t,r))}(t,M(t),r),i=arguments.length,u=new Array(i>1?i-1:0),c=1;c<i;c++)u[c-1]=arguments[c];if(!a)return n.apply(e,[t].concat(u));var f=t&&t.whyDidYouRender&&t.whyDidYouRender.customName||M(t),s=function(e,t,r,n,o){if(e.has(t))return e.get(t);var a=Wn(0,t,r,0,o);return e.set(t,a),a}(o,t,f,0,r);return n.apply(e,[s].concat(u))},e.__REVERT_WHY_DID_YOU_RENDER__=function(){e.createElement=n,o=null,delete e.__REVERT_WHY_DID_YOU_RENDER__},e}}); | ||
//# sourceMappingURL=whyDidYouRender.min.js.map |
{ | ||
"name": "@welldone-software/why-did-you-render", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "Monkey patches React to notify you about avoidable re-renders.", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/whyDidYouRender.min.js", |
@@ -68,3 +68,3 @@ import normalizeOptions from './normalizeOptions' | ||
function createPatchedComponent(componentsMapping, Component, displayName, React, options){ | ||
function createPatchedComponent(componentsMap, Component, displayName, React, options){ | ||
if(Component.prototype && Component.prototype.isReactComponent){ | ||
@@ -77,10 +77,10 @@ return patchClassComponent(Component, displayName, React, options) | ||
function getPatchedComponent(componentsMapping, Component, displayName, React, options){ | ||
if(componentsMapping.has(Component)){ | ||
return componentsMapping.get(Component) | ||
function getPatchedComponent(componentsMap, Component, displayName, React, options){ | ||
if(componentsMap.has(Component)){ | ||
return componentsMap.get(Component) | ||
} | ||
const WDYRPatchedComponent = createPatchedComponent(componentsMapping, Component, displayName, React, options) | ||
const WDYRPatchedComponent = createPatchedComponent(componentsMap, Component, displayName, React, options) | ||
componentsMapping.set(Component, WDYRPatchedComponent) | ||
componentsMap.set(Component, WDYRPatchedComponent) | ||
return WDYRPatchedComponent | ||
@@ -94,3 +94,3 @@ } | ||
const componentsMapping = new Map() | ||
let componentsMap = new WeakMap() | ||
@@ -114,3 +114,3 @@ React.createElement = function(componentNameOrComponent, ...rest){ | ||
const WDYRPatchedComponent = getPatchedComponent(componentsMapping, componentNameOrComponent, displayName, React, options) | ||
const WDYRPatchedComponent = getPatchedComponent(componentsMap, componentNameOrComponent, displayName, React, options) | ||
return origCreateElement.apply(React, [WDYRPatchedComponent, ...rest]) | ||
@@ -121,4 +121,4 @@ } | ||
React.createElement = origCreateElement | ||
componentsMap = null | ||
delete React.__REVERT_WHY_DID_YOU_RENDER__ | ||
componentsMapping.clear() | ||
} | ||
@@ -125,0 +125,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
478845