Mypal/devtools/client/shared/vendor/react-proxy.js
2019-03-11 13:26:37 +03:00

1910 lines
52 KiB
JavaScript

(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define(factory);
else if(typeof exports === 'object')
exports["ReactProxy"] = factory();
else
root["ReactProxy"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; }
var _createClassProxy = __webpack_require__(12);
exports.createProxy = _interopRequire(_createClassProxy);
var _reactDeepForceUpdate = __webpack_require__(39);
exports.getForceUpdate = _interopRequire(_reactDeepForceUpdate);
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
/**
* Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
* (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(1);
* // => false
*/
function isObject(value) {
// Avoid a V8 JIT bug in Chrome 19-20.
// See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
}
module.exports = isObject;
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
var getLength = __webpack_require__(30),
isLength = __webpack_require__(5);
/**
* Checks if `value` is array-like.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
*/
function isArrayLike(value) {
return value != null && isLength(getLength(value));
}
module.exports = isArrayLike;
/***/ },
/* 3 */
/***/ function(module, exports, __webpack_require__) {
/**
* Checks if `value` is object-like.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
*/
function isObjectLike(value) {
return !!value && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
var isNative = __webpack_require__(35);
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = object == null ? undefined : object[key];
return isNative(value) ? value : undefined;
}
module.exports = getNative;
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
/**
* Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
* of an array-like value.
*/
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Checks if `value` is a valid array-like length.
*
* **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
*/
function isLength(value) {
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
module.exports = isLength;
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
/** Used to detect unsigned integer values. */
var reIsUint = /^\d+$/;
/**
* Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
* of an array-like value.
*/
var MAX_SAFE_INTEGER = 9007199254740991;
/**
* Checks if `value` is a valid array-like index.
*
* @private
* @param {*} value The value to check.
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
*/
function isIndex(value, length) {
value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
length = length == null ? MAX_SAFE_INTEGER : length;
return value > -1 && value % 1 == 0 && value < length;
}
module.exports = isIndex;
/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(2),
isObjectLike = __webpack_require__(3);
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Native method references. */
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
/**
* Checks if `value` is classified as an `arguments` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isArguments(function() { return arguments; }());
* // => true
*
* _.isArguments([1, 2, 3]);
* // => false
*/
function isArguments(value) {
return isObjectLike(value) && isArrayLike(value) &&
hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
}
module.exports = isArguments;
/***/ },
/* 8 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(4),
isLength = __webpack_require__(5),
isObjectLike = __webpack_require__(3);
/** `Object#toString` result references. */
var arrayTag = '[object Array]';
/** Used for native method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objToString = objectProto.toString;
/* Native method references for those with the same name as other `lodash` methods. */
var nativeIsArray = getNative(Array, 'isArray');
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(function() { return arguments; }());
* // => false
*/
var isArray = nativeIsArray || function(value) {
return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
};
module.exports = isArray;
/***/ },
/* 9 */
/***/ function(module, exports, __webpack_require__) {
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/* Native method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* Creates a function that invokes `func` with the `this` binding of the
* created function and arguments from `start` and beyond provided as an array.
*
* **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.restParam(function(what, names) {
* return what + ' ' + _.initial(names).join(', ') +
* (_.size(names) > 1 ? ', & ' : '') + _.last(names);
* });
*
* say('hello', 'fred', 'barney', 'pebbles');
* // => 'hello fred, barney, & pebbles'
*/
function restParam(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
rest = Array(length);
while (++index < length) {
rest[index] = args[start + index];
}
switch (start) {
case 0: return func.call(this, rest);
case 1: return func.call(this, args[0], rest);
case 2: return func.call(this, args[0], args[1], rest);
}
var otherArgs = Array(start + 1);
index = -1;
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = rest;
return func.apply(this, otherArgs);
};
}
module.exports = restParam;
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(4),
isArrayLike = __webpack_require__(2),
isObject = __webpack_require__(1),
shimKeys = __webpack_require__(33);
/* Native method references for those with the same name as other `lodash` methods. */
var nativeKeys = getNative(Object, 'keys');
/**
* Creates an array of the own enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects. See the
* [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
* for more details.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keys(new Foo);
* // => ['a', 'b'] (iteration order is not guaranteed)
*
* _.keys('hi');
* // => ['0', '1']
*/
var keys = !nativeKeys ? shimKeys : function(object) {
var Ctor = object == null ? undefined : object.constructor;
if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
(typeof object != 'function' && isArrayLike(object))) {
return shimKeys(object);
}
return isObject(object) ? nativeKeys(object) : [];
};
module.exports = keys;
/***/ },
/* 11 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of React source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* Original:
* https://github.com/facebook/react/blob/6508b1ad273a6f371e8d90ae676e5390199461b4/src/isomorphic/classic/class/ReactClass.js#L650-L713
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = bindAutoBindMethods;
function bindAutoBindMethod(component, method) {
var boundMethod = method.bind(component);
boundMethod.__reactBoundContext = component;
boundMethod.__reactBoundMethod = method;
boundMethod.__reactBoundArguments = null;
var componentName = component.constructor.displayName,
_bind = boundMethod.bind;
boundMethod.bind = function (newThis) {
var args = Array.prototype.slice.call(arguments, 1);
if (newThis !== component && newThis !== null) {
console.warn('bind(): React component methods may only be bound to the ' + 'component instance. See ' + componentName);
} else if (!args.length) {
console.warn('bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See ' + componentName);
return boundMethod;
}
var reboundMethod = _bind.apply(boundMethod, arguments);
reboundMethod.__reactBoundContext = component;
reboundMethod.__reactBoundMethod = method;
reboundMethod.__reactBoundArguments = args;
return reboundMethod;
};
return boundMethod;
}
function bindAutoBindMethods(component) {
for (var autoBindKey in component.__reactAutoBindMap) {
if (!component.__reactAutoBindMap.hasOwnProperty(autoBindKey)) {
return;
}
// Tweak: skip methods that are already bound.
// This is to preserve method reference in case it is used
// as a subscription handler that needs to be detached later.
if (component.hasOwnProperty(autoBindKey) && component[autoBindKey].__reactBoundContext === component) {
continue;
}
var method = component.__reactAutoBindMap[autoBindKey];
component[autoBindKey] = bindAutoBindMethod(component, method);
}
}
;
module.exports = exports['default'];
/***/ },
/* 12 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
exports['default'] = proxyClass;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _createPrototypeProxy = __webpack_require__(13);
var _createPrototypeProxy2 = _interopRequireDefault(_createPrototypeProxy);
var _bindAutoBindMethods = __webpack_require__(11);
var _bindAutoBindMethods2 = _interopRequireDefault(_bindAutoBindMethods);
var _deleteUnknownAutoBindMethods = __webpack_require__(14);
var _deleteUnknownAutoBindMethods2 = _interopRequireDefault(_deleteUnknownAutoBindMethods);
var RESERVED_STATICS = ['length', 'name', 'arguments', 'caller', 'prototype', 'toString'];
function isEqualDescriptor(a, b) {
if (!a && !b) {
return true;
}
if (!a || !b) {
return false;
}
for (var key in a) {
if (a[key] !== b[key]) {
return false;
}
}
return true;
}
function proxyClass(InitialClass) {
// Prevent double wrapping.
// Given a proxy class, return the existing proxy managing it.
if (Object.prototype.hasOwnProperty.call(InitialClass, '__reactPatchProxy')) {
return InitialClass.__reactPatchProxy;
}
var prototypeProxy = (0, _createPrototypeProxy2['default'])();
var CurrentClass = undefined;
var staticDescriptors = {};
function wasStaticModifiedByUser(key) {
// Compare the descriptor with the one we previously set ourselves.
var currentDescriptor = Object.getOwnPropertyDescriptor(ProxyClass, key);
return !isEqualDescriptor(staticDescriptors[key], currentDescriptor);
}
var ProxyClass = undefined;
try {
// Create a proxy constructor with matching name
ProxyClass = new Function('getCurrentClass', 'return function ' + (InitialClass.name || 'ProxyClass') + '() {\n return getCurrentClass().apply(this, arguments);\n }')(function () {
return CurrentClass;
});
} catch (err) {
// Some environments may forbid dynamic evaluation
ProxyClass = function () {
return CurrentClass.apply(this, arguments);
};
}
// Point proxy constructor to the proxy prototype
ProxyClass.prototype = prototypeProxy.get();
// Proxy toString() to the current constructor
ProxyClass.toString = function toString() {
return CurrentClass.toString();
};
function update(_x) {
var _again = true;
_function: while (_again) {
var NextClass = _x;
mountedInstances = undefined;
_again = false;
if (typeof NextClass !== 'function') {
throw new Error('Expected a constructor.');
}
// Prevent proxy cycles
if (Object.prototype.hasOwnProperty.call(NextClass, '__reactPatchProxy')) {
_x = NextClass.__reactPatchProxy.__getCurrent();
_again = true;
continue _function;
}
// Save the next constructor so we call it
CurrentClass = NextClass;
// Update the prototype proxy with new methods
var mountedInstances = prototypeProxy.update(NextClass.prototype);
// Set up the constructor property so accessing the statics work
ProxyClass.prototype.constructor = ProxyClass;
// Set up the same prototype for inherited statics
ProxyClass.__proto__ = NextClass.__proto__;
// Copy static methods and properties
Object.getOwnPropertyNames(NextClass).forEach(function (key) {
if (RESERVED_STATICS.indexOf(key) > -1) {
return;
}
var staticDescriptor = _extends({}, Object.getOwnPropertyDescriptor(NextClass, key), {
configurable: true
});
// Copy static unless user has redefined it at runtime
if (!wasStaticModifiedByUser(key)) {
Object.defineProperty(ProxyClass, key, staticDescriptor);
staticDescriptors[key] = staticDescriptor;
}
});
// Remove old static methods and properties
Object.getOwnPropertyNames(ProxyClass).forEach(function (key) {
if (RESERVED_STATICS.indexOf(key) > -1) {
return;
}
// Skip statics that exist on the next class
if (NextClass.hasOwnProperty(key)) {
return;
}
// Skip non-configurable statics
var descriptor = Object.getOwnPropertyDescriptor(ProxyClass, key);
if (descriptor && !descriptor.configurable) {
return;
}
// Delete static unless user has redefined it at runtime
if (!wasStaticModifiedByUser(key)) {
delete ProxyClass[key];
delete staticDescriptors[key];
}
});
// Try to infer displayName
ProxyClass.displayName = NextClass.displayName || NextClass.name;
// We might have added new methods that need to be auto-bound
mountedInstances.forEach(_bindAutoBindMethods2['default']);
mountedInstances.forEach(_deleteUnknownAutoBindMethods2['default']);
// Let the user take care of redrawing
return mountedInstances;
}
};
function get() {
return ProxyClass;
}
function getCurrent() {
return CurrentClass;
}
update(InitialClass);
var proxy = { get: get, update: update };
Object.defineProperty(proxy, '__getCurrent', {
configurable: false,
writable: false,
enumerable: false,
value: getCurrent
});
Object.defineProperty(ProxyClass, '__reactPatchProxy', {
configurable: false,
writable: false,
enumerable: false,
value: proxy
});
return proxy;
}
module.exports = exports['default'];
/***/ },
/* 13 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = createPrototypeProxy;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _lodashObjectAssign = __webpack_require__(36);
var _lodashObjectAssign2 = _interopRequireDefault(_lodashObjectAssign);
var _lodashArrayDifference = __webpack_require__(15);
var _lodashArrayDifference2 = _interopRequireDefault(_lodashArrayDifference);
function createPrototypeProxy() {
var proxy = {};
var current = null;
var mountedInstances = [];
/**
* Creates a proxied toString() method pointing to the current version's toString().
*/
function proxyToString(name) {
// Wrap to always call the current version
return function toString() {
if (typeof current[name] === 'function') {
return current[name].toString();
} else {
return '<method was deleted>';
}
};
}
/**
* Creates a proxied method that calls the current version, whenever available.
*/
function proxyMethod(name) {
// Wrap to always call the current version
var proxiedMethod = function proxiedMethod() {
if (typeof current[name] === 'function') {
return current[name].apply(this, arguments);
}
};
// Copy properties of the original function, if any
(0, _lodashObjectAssign2['default'])(proxiedMethod, current[name]);
proxiedMethod.toString = proxyToString(name);
return proxiedMethod;
}
/**
* Augments the original componentDidMount with instance tracking.
*/
function proxiedComponentDidMount() {
mountedInstances.push(this);
if (typeof current.componentDidMount === 'function') {
return current.componentDidMount.apply(this, arguments);
}
}
proxiedComponentDidMount.toString = proxyToString('componentDidMount');
/**
* Augments the original componentWillUnmount with instance tracking.
*/
function proxiedComponentWillUnmount() {
var index = mountedInstances.indexOf(this);
// Unless we're in a weird environment without componentDidMount
if (index !== -1) {
mountedInstances.splice(index, 1);
}
if (typeof current.componentWillUnmount === 'function') {
return current.componentWillUnmount.apply(this, arguments);
}
}
proxiedComponentWillUnmount.toString = proxyToString('componentWillUnmount');
/**
* Defines a property on the proxy.
*/
function defineProxyProperty(name, descriptor) {
Object.defineProperty(proxy, name, descriptor);
}
/**
* Defines a property, attempting to keep the original descriptor configuration.
*/
function defineProxyPropertyWithValue(name, value) {
var _ref = Object.getOwnPropertyDescriptor(current, name) || {};
var _ref$enumerable = _ref.enumerable;
var enumerable = _ref$enumerable === undefined ? false : _ref$enumerable;
var _ref$writable = _ref.writable;
var writable = _ref$writable === undefined ? true : _ref$writable;
defineProxyProperty(name, {
configurable: true,
enumerable: enumerable,
writable: writable,
value: value
});
}
/**
* Creates an auto-bind map mimicking the original map, but directed at proxy.
*/
function createAutoBindMap() {
if (!current.__reactAutoBindMap) {
return;
}
var __reactAutoBindMap = {};
for (var _name in current.__reactAutoBindMap) {
if (current.__reactAutoBindMap.hasOwnProperty(_name)) {
__reactAutoBindMap[_name] = proxy[_name];
}
}
return __reactAutoBindMap;
}
/**
* Applies the updated prototype.
*/
function update(next) {
// Save current source of truth
current = next;
// Find changed property names
var currentNames = Object.getOwnPropertyNames(current);
var previousName = Object.getOwnPropertyNames(proxy);
var addedNames = (0, _lodashArrayDifference2['default'])(currentNames, previousName);
var removedNames = (0, _lodashArrayDifference2['default'])(previousName, currentNames);
// Remove properties and methods that are no longer there
removedNames.forEach(function (name) {
delete proxy[name];
});
// Copy every descriptor
currentNames.forEach(function (name) {
var descriptor = Object.getOwnPropertyDescriptor(current, name);
if (typeof descriptor.value === 'function') {
// Functions require additional wrapping so they can be bound later
defineProxyPropertyWithValue(name, proxyMethod(name));
} else {
// Other values can be copied directly
defineProxyProperty(name, descriptor);
}
});
// Track mounting and unmounting
defineProxyPropertyWithValue('componentDidMount', proxiedComponentDidMount);
defineProxyPropertyWithValue('componentWillUnmount', proxiedComponentWillUnmount);
defineProxyPropertyWithValue('__reactAutoBindMap', createAutoBindMap());
// Set up the prototype chain
proxy.__proto__ = next;
return mountedInstances;
}
/**
* Returns the up-to-date proxy prototype.
*/
function get() {
return proxy;
}
return {
update: update,
get: get
};
}
;
module.exports = exports['default'];
/***/ },
/* 14 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = deleteUnknownAutoBindMethods;
function shouldDeleteClassicInstanceMethod(component, name) {
if (component.__reactAutoBindMap.hasOwnProperty(name)) {
// It's a known autobound function, keep it
return false;
}
if (component[name].__reactBoundArguments !== null) {
// It's a function bound to specific args, keep it
return false;
}
// It's a cached bound method for a function
// that was deleted by user, so we delete it from component.
return true;
}
function shouldDeleteModernInstanceMethod(component, name) {
var prototype = component.constructor.prototype;
var prototypeDescriptor = Object.getOwnPropertyDescriptor(prototype, name);
if (!prototypeDescriptor || !prototypeDescriptor.get) {
// This is definitely not an autobinding getter
return false;
}
if (prototypeDescriptor.get().length !== component[name].length) {
// The length doesn't match, bail out
return false;
}
// This seems like a method bound using an autobinding getter on the prototype
// Hopefully we won't run into too many false positives.
return true;
}
function shouldDeleteInstanceMethod(component, name) {
var descriptor = Object.getOwnPropertyDescriptor(component, name);
if (typeof descriptor.value !== 'function') {
// Not a function, or something fancy: bail out
return;
}
if (component.__reactAutoBindMap) {
// Classic
return shouldDeleteClassicInstanceMethod(component, name);
} else {
// Modern
return shouldDeleteModernInstanceMethod(component, name);
}
}
/**
* Deletes autobound methods from the instance.
*
* For classic React classes, we only delete the methods that no longer exist in map.
* This means the user actually deleted them in code.
*
* For modern classes, we delete methods that exist on prototype with the same length,
* and which have getters on prototype, but are normal values on the instance.
* This is usually an indication that an autobinding decorator is being used,
* and the getter will re-generate the memoized handler on next access.
*/
function deleteUnknownAutoBindMethods(component) {
var names = Object.getOwnPropertyNames(component);
names.forEach(function (name) {
if (shouldDeleteInstanceMethod(component, name)) {
delete component[name];
}
});
}
module.exports = exports['default'];
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
var baseDifference = __webpack_require__(21),
baseFlatten = __webpack_require__(22),
isArrayLike = __webpack_require__(2),
isObjectLike = __webpack_require__(3),
restParam = __webpack_require__(9);
/**
* Creates an array of unique `array` values not included in the other
* provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @category Array
* @param {Array} array The array to inspect.
* @param {...Array} [values] The arrays of values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @example
*
* _.difference([1, 2, 3], [4, 2]);
* // => [1, 3]
*/
var difference = restParam(function(array, values) {
return (isObjectLike(array) && isArrayLike(array))
? baseDifference(array, baseFlatten(values, false, true))
: [];
});
module.exports = difference;
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var cachePush = __webpack_require__(27),
getNative = __webpack_require__(4);
/** Native method references. */
var Set = getNative(global, 'Set');
/* Native method references for those with the same name as other `lodash` methods. */
var nativeCreate = getNative(Object, 'create');
/**
*
* Creates a cache object to store unique values.
*
* @private
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var length = values ? values.length : 0;
this.data = { 'hash': nativeCreate(null), 'set': new Set };
while (length--) {
this.push(values[length]);
}
}
// Add functions to the `Set` cache.
SetCache.prototype.push = cachePush;
module.exports = SetCache;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 17 */
/***/ function(module, exports, __webpack_require__) {
/**
* Appends the elements of `values` to `array`.
*
* @private
* @param {Array} array The array to modify.
* @param {Array} values The values to append.
* @returns {Array} Returns `array`.
*/
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
module.exports = arrayPush;
/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {
var keys = __webpack_require__(10);
/**
* A specialized version of `_.assign` for customizing assigned values without
* support for argument juggling, multiple sources, and `this` binding `customizer`
* functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {Function} customizer The function to customize assigned values.
* @returns {Object} Returns `object`.
*/
function assignWith(object, source, customizer) {
var index = -1,
props = keys(source),
length = props.length;
while (++index < length) {
var key = props[index],
value = object[key],
result = customizer(value, source[key], key, object, source);
if ((result === result ? (result !== value) : (value === value)) ||
(value === undefined && !(key in object))) {
object[key] = result;
}
}
return object;
}
module.exports = assignWith;
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
var baseCopy = __webpack_require__(20),
keys = __webpack_require__(10);
/**
* The base implementation of `_.assign` without support for argument juggling,
* multiple sources, and `customizer` functions.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @returns {Object} Returns `object`.
*/
function baseAssign(object, source) {
return source == null
? object
: baseCopy(source, keys(source), object);
}
module.exports = baseAssign;
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property names to copy.
* @param {Object} [object={}] The object to copy properties to.
* @returns {Object} Returns `object`.
*/
function baseCopy(source, props, object) {
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
object[key] = source[key];
}
return object;
}
module.exports = baseCopy;
/***/ },
/* 21 */
/***/ function(module, exports, __webpack_require__) {
var baseIndexOf = __webpack_require__(23),
cacheIndexOf = __webpack_require__(26),
createCache = __webpack_require__(29);
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* The base implementation of `_.difference` which accepts a single array
* of values to exclude.
*
* @private
* @param {Array} array The array to inspect.
* @param {Array} values The values to exclude.
* @returns {Array} Returns the new array of filtered values.
*/
function baseDifference(array, values) {
var length = array ? array.length : 0,
result = [];
if (!length) {
return result;
}
var index = -1,
indexOf = baseIndexOf,
isCommon = true,
cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
valuesLength = values.length;
if (cache) {
indexOf = cacheIndexOf;
isCommon = false;
values = cache;
}
outer:
while (++index < length) {
var value = array[index];
if (isCommon && value === value) {
var valuesIndex = valuesLength;
while (valuesIndex--) {
if (values[valuesIndex] === value) {
continue outer;
}
}
result.push(value);
}
else if (indexOf(values, value, 0) < 0) {
result.push(value);
}
}
return result;
}
module.exports = baseDifference;
/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(17),
isArguments = __webpack_require__(7),
isArray = __webpack_require__(8),
isArrayLike = __webpack_require__(2),
isObjectLike = __webpack_require__(3);
/**
* The base implementation of `_.flatten` with added support for restricting
* flattening and specifying the start index.
*
* @private
* @param {Array} array The array to flatten.
* @param {boolean} [isDeep] Specify a deep flatten.
* @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
* @param {Array} [result=[]] The initial result value.
* @returns {Array} Returns the new flattened array.
*/
function baseFlatten(array, isDeep, isStrict, result) {
result || (result = []);
var index = -1,
length = array.length;
while (++index < length) {
var value = array[index];
if (isObjectLike(value) && isArrayLike(value) &&
(isStrict || isArray(value) || isArguments(value))) {
if (isDeep) {
// Recursively flatten arrays (susceptible to call stack limits).
baseFlatten(value, isDeep, isStrict, result);
} else {
arrayPush(result, value);
}
} else if (!isStrict) {
result[result.length] = value;
}
}
return result;
}
module.exports = baseFlatten;
/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {
var indexOfNaN = __webpack_require__(31);
/**
* The base implementation of `_.indexOf` without support for binary searches.
*
* @private
* @param {Array} array The array to search.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
if (value !== value) {
return indexOfNaN(array, fromIndex);
}
var index = fromIndex - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
module.exports = baseIndexOf;
/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {
/**
* The base implementation of `_.property` without support for deep paths.
*
* @private
* @param {string} key The key of the property to get.
* @returns {Function} Returns the new function.
*/
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
}
module.exports = baseProperty;
/***/ },
/* 25 */
/***/ function(module, exports, __webpack_require__) {
var identity = __webpack_require__(38);
/**
* A specialized version of `baseCallback` which only supports `this` binding
* and specifying the number of arguments to provide to `func`.
*
* @private
* @param {Function} func The function to bind.
* @param {*} thisArg The `this` binding of `func`.
* @param {number} [argCount] The number of arguments to provide to `func`.
* @returns {Function} Returns the callback.
*/
function bindCallback(func, thisArg, argCount) {
if (typeof func != 'function') {
return identity;
}
if (thisArg === undefined) {
return func;
}
switch (argCount) {
case 1: return function(value) {
return func.call(thisArg, value);
};
case 3: return function(value, index, collection) {
return func.call(thisArg, value, index, collection);
};
case 4: return function(accumulator, value, index, collection) {
return func.call(thisArg, accumulator, value, index, collection);
};
case 5: return function(value, other, key, object, source) {
return func.call(thisArg, value, other, key, object, source);
};
}
return function() {
return func.apply(thisArg, arguments);
};
}
module.exports = bindCallback;
/***/ },
/* 26 */
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(1);
/**
* Checks if `value` is in `cache` mimicking the return signature of
* `_.indexOf` by returning `0` if the value is found, else `-1`.
*
* @private
* @param {Object} cache The cache to search.
* @param {*} value The value to search for.
* @returns {number} Returns `0` if `value` is found, else `-1`.
*/
function cacheIndexOf(cache, value) {
var data = cache.data,
result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];
return result ? 0 : -1;
}
module.exports = cacheIndexOf;
/***/ },
/* 27 */
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(1);
/**
* Adds `value` to the cache.
*
* @private
* @name push
* @memberOf SetCache
* @param {*} value The value to cache.
*/
function cachePush(value) {
var data = this.data;
if (typeof value == 'string' || isObject(value)) {
data.set.add(value);
} else {
data.hash[value] = true;
}
}
module.exports = cachePush;
/***/ },
/* 28 */
/***/ function(module, exports, __webpack_require__) {
var bindCallback = __webpack_require__(25),
isIterateeCall = __webpack_require__(32),
restParam = __webpack_require__(9);
/**
* Creates a `_.assign`, `_.defaults`, or `_.merge` function.
*
* @private
* @param {Function} assigner The function to assign values.
* @returns {Function} Returns the new assigner function.
*/
function createAssigner(assigner) {
return restParam(function(object, sources) {
var index = -1,
length = object == null ? 0 : sources.length,
customizer = length > 2 ? sources[length - 2] : undefined,
guard = length > 2 ? sources[2] : undefined,
thisArg = length > 1 ? sources[length - 1] : undefined;
if (typeof customizer == 'function') {
customizer = bindCallback(customizer, thisArg, 5);
length -= 2;
} else {
customizer = typeof thisArg == 'function' ? thisArg : undefined;
length -= (customizer ? 1 : 0);
}
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
customizer = length < 3 ? undefined : customizer;
length = 1;
}
while (++index < length) {
var source = sources[index];
if (source) {
assigner(object, source, customizer);
}
}
return object;
});
}
module.exports = createAssigner;
/***/ },
/* 29 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var SetCache = __webpack_require__(16),
getNative = __webpack_require__(4);
/** Native method references. */
var Set = getNative(global, 'Set');
/* Native method references for those with the same name as other `lodash` methods. */
var nativeCreate = getNative(Object, 'create');
/**
* Creates a `Set` cache object to optimize linear searches of large arrays.
*
* @private
* @param {Array} [values] The values to cache.
* @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
*/
function createCache(values) {
return (nativeCreate && Set) ? new SetCache(values) : null;
}
module.exports = createCache;
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
/***/ },
/* 30 */
/***/ function(module, exports, __webpack_require__) {
var baseProperty = __webpack_require__(24);
/**
* Gets the "length" property value of `object`.
*
* **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
* that affects Safari on at least iOS 8.1-8.3 ARM64.
*
* @private
* @param {Object} object The object to query.
* @returns {*} Returns the "length" value.
*/
var getLength = baseProperty('length');
module.exports = getLength;
/***/ },
/* 31 */
/***/ function(module, exports, __webpack_require__) {
/**
* Gets the index at which the first occurrence of `NaN` is found in `array`.
*
* @private
* @param {Array} array The array to search.
* @param {number} fromIndex The index to search from.
* @param {boolean} [fromRight] Specify iterating from right to left.
* @returns {number} Returns the index of the matched `NaN`, else `-1`.
*/
function indexOfNaN(array, fromIndex, fromRight) {
var length = array.length,
index = fromIndex + (fromRight ? 0 : -1);
while ((fromRight ? index-- : ++index < length)) {
var other = array[index];
if (other !== other) {
return index;
}
}
return -1;
}
module.exports = indexOfNaN;
/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {
var isArrayLike = __webpack_require__(2),
isIndex = __webpack_require__(6),
isObject = __webpack_require__(1);
/**
* Checks if the provided arguments are from an iteratee call.
*
* @private
* @param {*} value The potential iteratee value argument.
* @param {*} index The potential iteratee index or key argument.
* @param {*} object The potential iteratee object argument.
* @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
*/
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)) {
var other = object[index];
return value === value ? (value === other) : (other !== other);
}
return false;
}
module.exports = isIterateeCall;
/***/ },
/* 33 */
/***/ function(module, exports, __webpack_require__) {
var isArguments = __webpack_require__(7),
isArray = __webpack_require__(8),
isIndex = __webpack_require__(6),
isLength = __webpack_require__(5),
keysIn = __webpack_require__(37);
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* A fallback implementation of `Object.keys` which creates an array of the
* own enumerable property names of `object`.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function shimKeys(object) {
var props = keysIn(object),
propsLength = props.length,
length = propsLength && object.length;
var allowIndexes = !!length && isLength(length) &&
(isArray(object) || isArguments(object));
var index = -1,
result = [];
while (++index < propsLength) {
var key = props[index];
if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
result.push(key);
}
}
return result;
}
module.exports = shimKeys;
/***/ },
/* 34 */
/***/ function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(1);
/** `Object#toString` result references. */
var funcTag = '[object Function]';
/** Used for native method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
* of values.
*/
var objToString = objectProto.toString;
/**
* Checks if `value` is classified as a `Function` object.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
* @example
*
* _.isFunction(_);
* // => true
*
* _.isFunction(/abc/);
* // => false
*/
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in older versions of Chrome and Safari which return 'function' for regexes
// and Safari 8 which returns 'object' for typed array constructors.
return isObject(value) && objToString.call(value) == funcTag;
}
module.exports = isFunction;
/***/ },
/* 35 */
/***/ function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(34),
isObjectLike = __webpack_require__(3);
/** Used to detect host constructors (Safari > 5). */
var reIsHostCtor = /^\[object .+?Constructor\]$/;
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to resolve the decompiled source of functions. */
var fnToString = Function.prototype.toString;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/** Used to detect if a method is native. */
var reIsNative = RegExp('^' +
fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
);
/**
* Checks if `value` is a native function.
*
* @static
* @memberOf _
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a native function, else `false`.
* @example
*
* _.isNative(Array.prototype.push);
* // => true
*
* _.isNative(_);
* // => false
*/
function isNative(value) {
if (value == null) {
return false;
}
if (isFunction(value)) {
return reIsNative.test(fnToString.call(value));
}
return isObjectLike(value) && reIsHostCtor.test(value);
}
module.exports = isNative;
/***/ },
/* 36 */
/***/ function(module, exports, __webpack_require__) {
var assignWith = __webpack_require__(18),
baseAssign = __webpack_require__(19),
createAssigner = __webpack_require__(28);
/**
* Assigns own enumerable properties of source object(s) to the destination
* object. Subsequent sources overwrite property assignments of previous sources.
* If `customizer` is provided it's invoked to produce the assigned values.
* The `customizer` is bound to `thisArg` and invoked with five arguments:
* (objectValue, sourceValue, key, object, source).
*
* **Note:** This method mutates `object` and is based on
* [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
*
* @static
* @memberOf _
* @alias extend
* @category Object
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @param {*} [thisArg] The `this` binding of `customizer`.
* @returns {Object} Returns `object`.
* @example
*
* _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
* // => { 'user': 'fred', 'age': 40 }
*
* // using a customizer callback
* var defaults = _.partialRight(_.assign, function(value, other) {
* return _.isUndefined(value) ? other : value;
* });
*
* defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
* // => { 'user': 'barney', 'age': 36 }
*/
var assign = createAssigner(function(object, source, customizer) {
return customizer
? assignWith(object, source, customizer)
: baseAssign(object, source);
});
module.exports = assign;
/***/ },
/* 37 */
/***/ function(module, exports, __webpack_require__) {
var isArguments = __webpack_require__(7),
isArray = __webpack_require__(8),
isIndex = __webpack_require__(6),
isLength = __webpack_require__(5),
isObject = __webpack_require__(1);
/** Used for native method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
if (object == null) {
return [];
}
if (!isObject(object)) {
object = Object(object);
}
var length = object.length;
length = (length && isLength(length) &&
(isArray(object) || isArguments(object)) && length) || 0;
var Ctor = object.constructor,
index = -1,
isProto = typeof Ctor == 'function' && Ctor.prototype === object,
result = Array(length),
skipIndexes = length > 0;
while (++index < length) {
result[index] = (index + '');
}
for (var key in object) {
if (!(skipIndexes && isIndex(key, length)) &&
!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
result.push(key);
}
}
return result;
}
module.exports = keysIn;
/***/ },
/* 38 */
/***/ function(module, exports, __webpack_require__) {
/**
* This method returns the first argument provided to it.
*
* @static
* @memberOf _
* @category Utility
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'user': 'fred' };
*
* _.identity(object) === object;
* // => true
*/
function identity(value) {
return value;
}
module.exports = identity;
/***/ },
/* 39 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
exports["default"] = getForceUpdate;
function traverseRenderedChildren(internalInstance, callback, argument) {
callback(internalInstance, argument);
if (internalInstance._renderedComponent) {
traverseRenderedChildren(internalInstance._renderedComponent, callback, argument);
} else {
for (var key in internalInstance._renderedChildren) {
if (internalInstance._renderedChildren.hasOwnProperty(key)) {
traverseRenderedChildren(internalInstance._renderedChildren[key], callback, argument);
}
}
}
}
function setPendingForceUpdate(internalInstance) {
if (internalInstance._pendingForceUpdate === false) {
internalInstance._pendingForceUpdate = true;
}
}
function forceUpdateIfPending(internalInstance, React) {
if (internalInstance._pendingForceUpdate === true) {
var publicInstance = internalInstance._instance;
React.Component.prototype.forceUpdate.call(publicInstance);
}
}
function getForceUpdate(React) {
return function (instance) {
var internalInstance = instance._reactInternalInstance;
traverseRenderedChildren(internalInstance, setPendingForceUpdate);
traverseRenderedChildren(internalInstance, forceUpdateIfPending, React);
};
}
module.exports = exports["default"];
/***/ }
/******/ ])
});