UNPKG

react-devtools-core

Version:

Use react-devtools outside of the browser

947 lines 789 kB
module.exports = function(modules) { function __webpack_require__(moduleId) { if (installedModules[moduleId]) return installedModules[moduleId].exports; var module = installedModules[moduleId] = { exports: {}, id: moduleId, loaded: !1 }; return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.loaded = !0, module.exports; } var installedModules = {}; return __webpack_require__.m = modules, __webpack_require__.c = installedModules, __webpack_require__.p = "", __webpack_require__(0); }([ function(module, exports, __webpack_require__) { "use strict"; function reload() { ReactDOM.unmountComponentAtNode(node), node.innerHTML = "", setTimeout(function() { ReactDOM.render(React.createElement(Panel, config), node); }, 100); } function onDisconnected() { ReactDOM.unmountComponentAtNode(node), node.innerHTML = '<div id="waiting"><h2>Waiting for React to connect…</h2></div>'; } function onError(e) { ReactDOM.unmountComponentAtNode(node); var message; message = "EADDRINUSE" === e.code ? "Another instance of DevTools is running" : "Unknown error (" + e.message + ")", node.innerHTML = '<div id="waiting"><h2>' + message + "</h2></div>"; } function initialize(socket) { var listeners = [], isLegacyRN = !1; socket.onmessage = function(evt) { if ("attach:agent" === evt.data) return void (isLegacyRN || (isLegacyRN = !0, socket.send("eval:" + fs.readFileSync(path.join(__dirname, "../vendor/backend-1.0.6.js"))))); var data = JSON.parse(evt.data); listeners.forEach(function(fn) { return fn(data); }); }, wall = { listen: function(fn) { listeners.push(fn); }, send: function(data) { socket.readyState === socket.OPEN && socket.send(JSON.stringify(data)); }, disconnect: function() { socket.close(); } }, log("Connected"), reload(); } function startServer() { var port = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 8097, httpServer = __webpack_require__(266).createServer(), server = new ws.Server({ server: httpServer }), connected = !1; server.on("connection", function(socket) { connected && (connected.close(), log.warn("Only one connection allowed at a time.", "Closing the previous connection")), connected = socket, socket.onerror = function(err) { connected = !1, onDisconnected(), log.error("Error with websocket connection", err); }, socket.onclose = function() { connected = !1, onDisconnected(), log("Connection to RN closed"); }, initialize(socket); }), server.on("error", function(e) { onError(e), log.error("Failed to start the DevTools server", e), restartTimeout = setTimeout(function() { return startServer(port); }, 1e3); }); var backendFile = fs.readFileSync(path.join(__dirname, "../build/backend.js")); return httpServer.on("request", function(req, res) { res.end(backendFile + "\n;ReactDevToolsBackend.connectToDevTools();"); }), httpServer.on("error", function(e) { onError(e), onStatusChange("Failed to start the server."), restartTimeout = setTimeout(function() { return startServer(port); }, 1e3); }), httpServer.listen(port, function() { onStatusChange("The server is listening on the port " + port + "."); }), { close: function() { connected = !1, onDisconnected(), clearTimeout(restartTimeout), server.close(), httpServer.close(); } }; } var ws = __webpack_require__(1), fs = __webpack_require__(2), path = __webpack_require__(3), installGlobalHook = __webpack_require__(4); installGlobalHook(window); var Panel = __webpack_require__(5), launchEditor = __webpack_require__(257), React = __webpack_require__(6), ReactDOM = __webpack_require__(41), node = null, onStatusChange = function() {}, projectRoots = [], wall = null, config = { reload: reload, alreadyFoundReact: !0, inject: function(done) { done(wall); }, showElementSource: function(source) { launchEditor(source.fileName, source.lineNumber, projectRoots); } }, log = function() { for (var _console, _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; return (_console = console).log.apply(_console, [ "[React DevTools]" ].concat(args)); }; log.warn = function() { for (var _console2, _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2]; return (_console2 = console).warn.apply(_console2, [ "[React DevTools]" ].concat(args)); }, log.error = function() { for (var _console3, _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) args[_key3] = arguments[_key3]; return (_console3 = console).error.apply(_console3, [ "[React DevTools]" ].concat(args)); }; var restartTimeout = null, DevtoolsUI = { setContentDOMNode: function(_node) { return node = _node, DevtoolsUI; }, setProjectRoots: function(_projectRoots) { projectRoots = _projectRoots; }, setStatusListener: function(_listener) { return onStatusChange = _listener, DevtoolsUI; }, startServer: startServer }; module.exports = DevtoolsUI; }, function(module, exports) { module.exports = require("ws"); }, function(module, exports) { module.exports = require("fs"); }, function(module, exports) { module.exports = require("path"); }, function(module, exports) { "use strict"; function installGlobalHook(window) { function detectReactBuildType(renderer) { try { var toString = Function.prototype.toString; if ("string" == typeof renderer.version) { if (renderer.bundleType > 0) return "development"; var findFiberCode = toString.call(renderer.findFiberByHostInstance); return 0 !== findFiberCode.indexOf("function") ? "production" : findFiberCode.indexOf("getClosestInstanceFromNode") !== -1 ? "unminified" : "production"; } if (renderer.Mount && renderer.Mount._renderNewRootComponent) { var renderRootCode = toString.call(renderer.Mount._renderNewRootComponent); return 0 !== renderRootCode.indexOf("function") ? "production" : renderRootCode.indexOf("storedMeasure") !== -1 ? "development" : renderRootCode.indexOf("should be a pure function") !== -1 ? renderRootCode.indexOf("NODE_ENV") !== -1 ? "development" : renderRootCode.indexOf("development") !== -1 ? "development" : renderRootCode.indexOf("true") !== -1 ? "development" : renderRootCode.indexOf("nextElement") !== -1 || renderRootCode.indexOf("nextComponent") !== -1 ? "unminified" : "development" : renderRootCode.indexOf("nextElement") !== -1 || renderRootCode.indexOf("nextComponent") !== -1 ? "unminified" : renderRootCode.indexOf("._registerComponent") !== -1 ? "outdated" : "production"; } } catch (err) {} return "production"; } if (!window.__REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook = { _renderers: {}, helpers: {}, inject: function(renderer) { var id = Math.random().toString(16).slice(2); hook._renderers[id] = renderer; var reactBuildType = detectReactBuildType(renderer); return hook.emit("renderer", { id: id, renderer: renderer, reactBuildType: reactBuildType }), id; }, _listeners: {}, sub: function(evt, fn) { return hook.on(evt, fn), function() { return hook.off(evt, fn); }; }, on: function(evt, fn) { hook._listeners[evt] || (hook._listeners[evt] = []), hook._listeners[evt].push(fn); }, off: function(evt, fn) { if (hook._listeners[evt]) { var ix = hook._listeners[evt].indexOf(fn); ix !== -1 && hook._listeners[evt].splice(ix, 1), hook._listeners[evt].length || (hook._listeners[evt] = null); } }, emit: function(evt, data) { hook._listeners[evt] && hook._listeners[evt].map(function(fn) { return fn(data); }); }, supportsFiber: !0, _fiberRoots: {}, getFiberRoots: function(rendererID) { var roots = hook._fiberRoots; return roots[rendererID] || (roots[rendererID] = new Set()), roots[rendererID]; }, onCommitFiberUnmount: function(rendererID, fiber) { hook.helpers[rendererID] && hook.helpers[rendererID].handleCommitFiberUnmount(fiber); }, onCommitFiberRoot: function(rendererID, root) { var mountedRoots = hook.getFiberRoots(rendererID), current = root.current, isKnownRoot = mountedRoots.has(root), isUnmounting = null == current.memoizedState || null == current.memoizedState.element; isKnownRoot || isUnmounting ? isKnownRoot && isUnmounting && mountedRoots["delete"](root) : mountedRoots.add(root), hook.helpers[rendererID] && hook.helpers[rendererID].handleCommitFiberRoot(root); } }; Object.defineProperty(window, "__REACT_DEVTOOLS_GLOBAL_HOOK__", { value: hook }); } } module.exports = installGlobalHook; }, function(module, exports, __webpack_require__) { "use strict"; function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } return Array.from(arr); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } function _possibleConstructorReturn(self, call) { if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !call || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: !1, writable: !0, configurable: !0 } }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { return protoProps && defineProperties(Constructor.prototype, protoProps), staticProps && defineProperties(Constructor, staticProps), Constructor; }; }(), React = __webpack_require__(6), Container = __webpack_require__(39), Store = __webpack_require__(232), keyboardNav = __webpack_require__(235), invariant = __webpack_require__(217), assign = __webpack_require__(184), Bridge = __webpack_require__(237), NativeStyler = __webpack_require__(244), RelayPlugin = __webpack_require__(248), consts = __webpack_require__(192), Panel = function(_React$Component) { function Panel(props) { _classCallCheck(this, Panel); var _this = _possibleConstructorReturn(this, (Panel.__proto__ || Object.getPrototypeOf(Panel)).call(this, props)); return _this.state = { loading: !0, isReact: _this.props.alreadyFoundReact }, _this._unMounted = !1, window.panel = _this, _this.plugins = [], _this; } return _inherits(Panel, _React$Component), _createClass(Panel, [ { key: "getChildContext", value: function() { return { store: this._store }; } }, { key: "componentDidMount", value: function() { var _this2 = this; this.props.alreadyFoundReact ? this.inject() : this.lookForReact(), this.props.reloadSubscribe && (this._unsub = this.props.reloadSubscribe(function() { return _this2.reload(); })); } }, { key: "componentWillUnmount", value: function() { this._unMounted = !0, this._unsub && this._unsub(), this.teardown(); } }, { key: "pauseTransfer", value: function() { this._bridge && this._bridge.pause(); } }, { key: "resumeTransfer", value: function() { this._bridge && this._bridge.resume(); } }, { key: "reload", value: function() { this._unsub && this._unsub(), this.teardown(), this._unMounted || this.setState({ loading: !0 }, this.props.reload); } }, { key: "getNewSelection", value: function() { this._bridge && this.props.getNewSelection && this.props.getNewSelection(this._bridge); } }, { key: "hideHighlight", value: function() { this._store.hideHighlight(); } }, { key: "sendSelection", value: function(id) { this._bridge && (id || this._store.selected) && (invariant(this.props.selectElement, "cannot send selection if props.selectElement is not defined"), this.props.selectElement(id || this._store.selected, this._bridge)); } }, { key: "viewComponentSource", value: function(id) { var _this3 = this; this._bridge && (this._bridge.send("putSelectedInstance", id), setTimeout(function() { invariant(_this3.props.showComponentSource, "cannot view source if props.showComponentSource is not supplied"), _this3.props.showComponentSource("__REACT_DEVTOOLS_GLOBAL_HOOK__.$inst", "__REACT_DEVTOOLS_GLOBAL_HOOK__.$type"); }, 100)); } }, { key: "viewElementSource", value: function(id, source) { var _this4 = this; this._bridge && (this._bridge.send("putSelectedInstance", id), setTimeout(function() { invariant(_this4.props.showElementSource, "cannot view source if props.showElementSource is not supplied"), _this4.props.showElementSource(source); }, 100)); } }, { key: "teardown", value: function() { this.plugins.forEach(function(p) { return p.teardown(); }), this.plugins = [], this._keyListener && (window.removeEventListener("keydown", this._keyListener), this._keyListener = null), this._bridge && this._bridge.send("shutdown"), this._teardownWall && (this._teardownWall(), this._teardownWall = null); } }, { key: "inject", value: function() { var _this5 = this; this.props.inject(function(wall, teardown) { _this5._teardownWall = teardown, _this5._bridge = new Bridge(wall), _this5._store = new Store(_this5._bridge); var refresh = function() { return _this5.forceUpdate(); }; _this5.plugins = [ new RelayPlugin(_this5._store, _this5._bridge, refresh) ], _this5._keyListener = keyboardNav(_this5._store, window), window.addEventListener("keydown", _this5._keyListener), _this5._store.on("connected", function() { _this5.setState({ loading: !1 }), _this5.getNewSelection(); }); }); } }, { key: "componentDidUpdate", value: function() { var _this6 = this; this.state.isReact || this._checkTimeout || (this._checkTimeout = setTimeout(function() { _this6._checkTimeout = null, _this6.lookForReact(); }, 200)); } }, { key: "lookForReact", value: function() { var _this7 = this; "function" == typeof this.props.checkForReact && this.props.checkForReact(function(isReact) { isReact ? (_this7.setState({ isReact: !0, loading: !0 }), _this7.inject()) : (console.log("still looking..."), _this7.setState({ isReact: !1, loading: !1 })); }); } }, { key: "render", value: function() { var _ref, _this8 = this; if (this.state.loading) return React.createElement("div", { style: styles.loading }, React.createElement("h2", null, "Connecting to React…")); if (!this.state.isReact) return React.createElement("div", { style: styles.loading }, React.createElement("h2", null, "Looking for React…")); var extraTabs = assign.apply(null, [ {} ].concat(this.plugins.map(function(p) { return p.tabs(); }))), extraPanes = (_ref = []).concat.apply(_ref, _toConsumableArray(this.plugins.map(function(p) { return p.panes(); }))); return this._store.capabilities.rnStyle && extraPanes.push(panelRNStyle(this._bridge, this._store.capabilities.rnStyleMeasure)), React.createElement(Container, { reload: this.props.reload && this.reload.bind(this), menuItems: { attr: function(id, node, val, path) { if (val && "Composite" === node.get("nodeType") && "function" === val[consts.type]) return [ _this8.props.showAttrSource && { key: "showSource", title: "Show function source", action: function() { return _this8.props.showAttrSource(path); } }, _this8.props.executeFn && { key: "executeFunction", title: "Execute function", action: function() { return _this8.props.executeFn(path); } } ]; }, tree: function(id, node) { return [ _this8.props.selectElement && _this8._store.capabilities.dom && { key: "findDOMNode", title: "Find the DOM node", action: function() { return _this8.sendSelection(id); } }, _this8.props.showComponentSource && "Composite" === node.get("nodeType") && { key: "showComponentSource", title: "Show " + node.get("name") + " source", action: function() { return _this8.viewComponentSource(id); } }, _this8.props.showElementSource && node.get("source") && { key: "showElementSource", title: "Show <" + node.get("name") + " /> in source", action: function() { return _this8.viewElementSource(id, node.get("source")); } } ]; } }, extraPanes: extraPanes, extraTabs: extraTabs, onViewElementSource: this.props.showElementSource ? this.viewElementSource.bind(this) : null }); } } ]), Panel; }(React.Component); Panel.childContextTypes = { store: React.PropTypes.object }; var panelRNStyle = function(bridge, supportsMeasure) { return function(node, id) { var props = node.get("props"); return props && props.style ? React.createElement("div", { key: "rnstyle", style: styles.container }, React.createElement("strong", null, "React Native Style Editor"), React.createElement(NativeStyler, { id: id, bridge: bridge, supportsMeasure: supportsMeasure })) : React.createElement("div", { key: "rnstyle", style: styles.container }, React.createElement("strong", null, "No style")); }; }, styles = { chromePane: { display: "flex" }, stretch: { flex: 1 }, container: { borderTop: "1px solid #eee", padding: 5, marginBottom: 5, flexShrink: 0 }, loading: { textAlign: "center", color: "#888", padding: 30, flex: 1 } }; module.exports = Panel; }, function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(7); }, function(module, exports, __webpack_require__) { "use strict"; var _assign = __webpack_require__(8), ReactChildren = __webpack_require__(9), ReactComponent = __webpack_require__(22), ReactPureComponent = __webpack_require__(25), ReactClass = __webpack_require__(26), ReactDOMFactories = __webpack_require__(28), ReactElement = __webpack_require__(13), ReactPropTypes = __webpack_require__(29), ReactVersion = __webpack_require__(37), onlyChild = __webpack_require__(38), createElement = (__webpack_require__(15), ReactElement.createElement), createFactory = ReactElement.createFactory, cloneElement = ReactElement.cloneElement, __spread = _assign, React = { Children: { map: ReactChildren.map, forEach: ReactChildren.forEach, count: ReactChildren.count, toArray: ReactChildren.toArray, only: onlyChild }, Component: ReactComponent, PureComponent: ReactPureComponent, createElement: createElement, cloneElement: cloneElement, isValidElement: ReactElement.isValidElement, PropTypes: ReactPropTypes, createClass: ReactClass.createClass, createFactory: createFactory, createMixin: function(mixin) { return mixin; }, DOM: ReactDOMFactories, version: ReactVersion, __spread: __spread }; module.exports = React; }, function(module, exports) { /* object-assign (c) Sindre Sorhus @license MIT */ "use strict"; function toObject(val) { if (null === val || void 0 === val) throw new TypeError("Object.assign cannot be called with null or undefined"); return Object(val); } function shouldUseNative() { try { if (!Object.assign) return !1; var test1 = new String("abc"); if (test1[5] = "de", "5" === Object.getOwnPropertyNames(test1)[0]) return !1; for (var test2 = {}, i = 0; i < 10; i++) test2["_" + String.fromCharCode(i)] = i; var order2 = Object.getOwnPropertyNames(test2).map(function(n) { return test2[n]; }); if ("0123456789" !== order2.join("")) return !1; var test3 = {}; return "abcdefghijklmnopqrst".split("").forEach(function(letter) { test3[letter] = letter; }), "abcdefghijklmnopqrst" === Object.keys(Object.assign({}, test3)).join(""); } catch (err) { return !1; } } var getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty, propIsEnumerable = Object.prototype.propertyIsEnumerable; module.exports = shouldUseNative() ? Object.assign : function(target, source) { for (var from, symbols, to = toObject(target), s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) hasOwnProperty.call(from, key) && (to[key] = from[key]); if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) propIsEnumerable.call(from, symbols[i]) && (to[symbols[i]] = from[symbols[i]]); } } return to; }; }, function(module, exports, __webpack_require__) { "use strict"; function escapeUserProvidedKey(text) { return ("" + text).replace(userProvidedKeyEscapeRegex, "$&/"); } function ForEachBookKeeping(forEachFunction, forEachContext) { this.func = forEachFunction, this.context = forEachContext, this.count = 0; } function forEachSingleChild(bookKeeping, child, name) { var func = bookKeeping.func, context = bookKeeping.context; func.call(context, child, bookKeeping.count++); } function forEachChildren(children, forEachFunc, forEachContext) { if (null == children) return children; var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); traverseAllChildren(children, forEachSingleChild, traverseContext), ForEachBookKeeping.release(traverseContext); } function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) { this.result = mapResult, this.keyPrefix = keyPrefix, this.func = mapFunction, this.context = mapContext, this.count = 0; } function mapSingleChildIntoContext(bookKeeping, child, childKey) { var result = bookKeeping.result, keyPrefix = bookKeeping.keyPrefix, func = bookKeeping.func, context = bookKeeping.context, mappedChild = func.call(context, child, bookKeeping.count++); Array.isArray(mappedChild) ? mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument) : null != mappedChild && (ReactElement.isValidElement(mappedChild) && (mappedChild = ReactElement.cloneAndReplaceKey(mappedChild, keyPrefix + (!mappedChild.key || child && child.key === mappedChild.key ? "" : escapeUserProvidedKey(mappedChild.key) + "/") + childKey)), result.push(mappedChild)); } function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { var escapedPrefix = ""; null != prefix && (escapedPrefix = escapeUserProvidedKey(prefix) + "/"); var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context); traverseAllChildren(children, mapSingleChildIntoContext, traverseContext), MapBookKeeping.release(traverseContext); } function mapChildren(children, func, context) { if (null == children) return children; var result = []; return mapIntoWithKeyPrefixInternal(children, result, null, func, context), result; } function forEachSingleChildDummy(traverseContext, child, name) { return null; } function countChildren(children, context) { return traverseAllChildren(children, forEachSingleChildDummy, null); } function toArray(children) { var result = []; return mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument), result; } var PooledClass = __webpack_require__(10), ReactElement = __webpack_require__(13), emptyFunction = __webpack_require__(16), traverseAllChildren = __webpack_require__(19), twoArgumentPooler = PooledClass.twoArgumentPooler, fourArgumentPooler = PooledClass.fourArgumentPooler, userProvidedKeyEscapeRegex = /\/+/g; ForEachBookKeeping.prototype.destructor = function() { this.func = null, this.context = null, this.count = 0; }, PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler), MapBookKeeping.prototype.destructor = function() { this.result = null, this.keyPrefix = null, this.func = null, this.context = null, this.count = 0; }, PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); var ReactChildren = { forEach: forEachChildren, map: mapChildren, mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal, count: countChildren, toArray: toArray }; module.exports = ReactChildren; }, function(module, exports, __webpack_require__) { "use strict"; var _prodInvariant = __webpack_require__(11), oneArgumentPooler = (__webpack_require__(12), function(copyFieldsFrom) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); return Klass.call(instance, copyFieldsFrom), instance; } return new Klass(copyFieldsFrom); }), twoArgumentPooler = function(a1, a2) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); return Klass.call(instance, a1, a2), instance; } return new Klass(a1, a2); }, threeArgumentPooler = function(a1, a2, a3) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); return Klass.call(instance, a1, a2, a3), instance; } return new Klass(a1, a2, a3); }, fourArgumentPooler = function(a1, a2, a3, a4) { var Klass = this; if (Klass.instancePool.length) { var instance = Klass.instancePool.pop(); return Klass.call(instance, a1, a2, a3, a4), instance; } return new Klass(a1, a2, a3, a4); }, standardReleaser = function(instance) { var Klass = this; instance instanceof Klass ? void 0 : _prodInvariant("25"), instance.destructor(), Klass.instancePool.length < Klass.poolSize && Klass.instancePool.push(instance); }, DEFAULT_POOL_SIZE = 10, DEFAULT_POOLER = oneArgumentPooler, addPoolingTo = function(CopyConstructor, pooler) { var NewKlass = CopyConstructor; return NewKlass.instancePool = [], NewKlass.getPooled = pooler || DEFAULT_POOLER, NewKlass.poolSize || (NewKlass.poolSize = DEFAULT_POOL_SIZE), NewKlass.release = standardReleaser, NewKlass; }, PooledClass = { addPoolingTo: addPoolingTo, oneArgumentPooler: oneArgumentPooler, twoArgumentPooler: twoArgumentPooler, threeArgumentPooler: threeArgumentPooler, fourArgumentPooler: fourArgumentPooler }; module.exports = PooledClass; }, function(module, exports) { "use strict"; function reactProdInvariant(code) { for (var argCount = arguments.length - 1, message = "Minified React error #" + code + "; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=" + code, argIdx = 0; argIdx < argCount; argIdx++) message += "&args[]=" + encodeURIComponent(arguments[argIdx + 1]); message += " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; var error = new Error(message); throw error.name = "Invariant Violation", error.framesToPop = 1, error; } module.exports = reactProdInvariant; }, function(module, exports, __webpack_require__) { "use strict"; function invariant(condition, format, a, b, c, d, e, f) { if (validateFormat(format), !condition) { var error; if (void 0 === format) error = new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."); else { var args = [ a, b, c, d, e, f ], argIndex = 0; error = new Error(format.replace(/%s/g, function() { return args[argIndex++]; })), error.name = "Invariant Violation"; } throw error.framesToPop = 1, error; } } var validateFormat = function(format) {}; module.exports = invariant; }, function(module, exports, __webpack_require__) { "use strict"; function hasValidRef(config) { return void 0 !== config.ref; } function hasValidKey(config) { return void 0 !== config.key; } var _assign = __webpack_require__(8), ReactCurrentOwner = __webpack_require__(14), hasOwnProperty = (__webpack_require__(15), __webpack_require__(17), Object.prototype.hasOwnProperty), REACT_ELEMENT_TYPE = __webpack_require__(18), RESERVED_PROPS = { key: !0, ref: !0, __self: !0, __source: !0 }, ReactElement = function(type, key, ref, self, source, owner, props) { var element = { $$typeof: REACT_ELEMENT_TYPE, type: type, key: key, ref: ref, props: props, _owner: owner }; return element; }; ReactElement.createElement = function(type, config, children) { var propName, props = {}, key = null, ref = null, self = null, source = null; if (null != config) { hasValidRef(config) && (ref = config.ref), hasValidKey(config) && (key = "" + config.key), self = void 0 === config.__self ? null : config.__self, source = void 0 === config.__source ? null : config.__source; for (propName in config) hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName) && (props[propName] = config[propName]); } var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; else if (childrenLength > 1) { for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++) childArray[i] = arguments[i + 2]; props.children = childArray; } if (type && type.defaultProps) { var defaultProps = type.defaultProps; for (propName in defaultProps) void 0 === props[propName] && (props[propName] = defaultProps[propName]); } return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); }, ReactElement.createFactory = function(type) { var factory = ReactElement.createElement.bind(null, type); return factory.type = type, factory; }, ReactElement.cloneAndReplaceKey = function(oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); return newElement; }, ReactElement.cloneElement = function(element, config, children) { var propName, props = _assign({}, element.props), key = element.key, ref = element.ref, self = element._self, source = element._source, owner = element._owner; if (null != config) { hasValidRef(config) && (ref = config.ref, owner = ReactCurrentOwner.current), hasValidKey(config) && (key = "" + config.key); var defaultProps; element.type && element.type.defaultProps && (defaultProps = element.type.defaultProps); for (propName in config) hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName) && (void 0 === config[propName] && void 0 !== defaultProps ? props[propName] = defaultProps[propName] : props[propName] = config[propName]); } var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; else if (childrenLength > 1) { for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++) childArray[i] = arguments[i + 2]; props.children = childArray; } return ReactElement(element.type, key, ref, self, source, owner, props); }, ReactElement.isValidElement = function(object) { return "object" == typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE; }, module.exports = ReactElement; }, function(module, exports) { "use strict"; var ReactCurrentOwner = { current: null }; module.exports = ReactCurrentOwner; }, function(module, exports, __webpack_require__) { "use strict"; var emptyFunction = __webpack_require__(16), warning = emptyFunction; module.exports = warning; }, function(module, exports) { "use strict"; function makeEmptyFunction(arg) { return function() { return arg; }; } var emptyFunction = function() {}; emptyFunction.thatReturns = makeEmptyFunction, emptyFunction.thatReturnsFalse = makeEmptyFunction(!1), emptyFunction.thatReturnsTrue = makeEmptyFunction(!0), emptyFunction.thatReturnsNull = makeEmptyFunction(null), emptyFunction.thatReturnsThis = function() { return this; }, emptyFunction.thatReturnsArgument = function(arg) { return arg; }, module.exports = emptyFunction; }, function(module, exports, __webpack_require__) { "use strict"; var canDefineProperty = !1; module.exports = canDefineProperty; }, function(module, exports) { "use strict"; var REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol["for"] && Symbol["for"]("react.element") || 60103; module.exports = REACT_ELEMENT_TYPE; }, function(module, exports, __webpack_require__) { "use strict"; function getComponentKey(component, index) { return component && "object" == typeof component && null != component.key ? KeyEscapeUtils.escape(component.key) : index.toString(36); } function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { var type = typeof children; if ("undefined" !== type && "boolean" !== type || (children = null), null === children || "string" === type || "number" === type || "object" === type && children.$$typeof === REACT_ELEMENT_TYPE) return callback(traverseContext, children, "" === nameSoFar ? SEPARATOR + getComponentKey(children, 0) : nameSoFar), 1; var child, nextName, subtreeCount = 0, nextNamePrefix = "" === nameSoFar ? SEPARATOR : nameSoFar + SUBSEPARATOR; if (Array.isArray(children)) for (var i = 0; i < children.length; i++) child = children[i], nextName = nextNamePrefix + getComponentKey(child, i), subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); else { var iteratorFn = getIteratorFn(children); if (iteratorFn) { var step, iterator = iteratorFn.call(children); if (iteratorFn !== children.entries) for (var ii = 0; !(step = iterator.next()).done; ) child = step.value, nextName = nextNamePrefix + getComponentKey(child, ii++), subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); else for (;!(step = iterator.next()).done; ) { var entry = step.value; entry && (child = entry[1], nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0), subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext)); } } else if ("object" === type) { var addendum = "", childrenString = String(children); _prodInvariant("31", "[object Object]" === childrenString ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString, addendum); } } return subtreeCount; } function traverseAllChildren(children, callback, traverseContext) { return null == children ? 0 : traverseAllChildrenImpl(children, "", callback, traverseContext); } var _prodInvariant = __webpack_require__(11), REACT_ELEMENT_TYPE = (__webpack_require__(14), __webpack_require__(18)), getIteratorFn = __webpack_require__(20), KeyEscapeUtils = (__webpack_require__(12), __webpack_require__(21)), SEPARATOR = (__webpack_require__(15), "."), SUBSEPARATOR = ":"; module.exports = traverseAllChildren; }, function(module, exports) { "use strict"; function getIteratorFn(maybeIterable) { var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); if ("function" == typeof iteratorFn) return iteratorFn; } var ITERATOR_SYMBOL = "function" == typeof Symbol && Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator"; module.exports = getIteratorFn; }, function(module, exports) { "use strict"; function escape(key) { var escapeRegex = /[=:]/g, escaperLookup = { "=": "=0", ":": "=2" }, escapedString = ("" + key).replace(escapeRegex, function(match) { return escaperLookup[match]; }); return "$" + escapedString; } function unescape(key) { var unescapeRegex = /(=0|=2)/g, unescaperLookup = { "=0": "=", "=2": ":" }, keySubstring = "." === key[0] && "$" === key[1] ? key.substring(2) : key.substring(1); return ("" + keySubstring).replace(unescapeRegex, function(match) { return unescaperLookup[match]; }); } var KeyEscapeUtils = { escape: escape, unescape: unescape }; module.exports = KeyEscapeUtils; }, function(module, exports, __webpack_require__) { "use strict"; function ReactComponent(props, context, updater) { this.props = props, this.context = context, this.refs = emptyObject, this.updater = updater || ReactNoopUpdateQueue; } var _prodInvariant = __webpack_require__(11), ReactNoopUpdateQueue = __webpack_require__(23), emptyObject = (__webpack_require__(17), __webpack_require__(24)); __webpack_require__(12), __webpack_require__(15); ReactComponent.prototype.isReactComponent = {}, ReactComponent.prototype.setState = function(partialState, callback) { "object" != typeof partialState && "function" != typeof partialState && null != partialState ? _prodInvariant("85") : void 0, this.updater.enqueueSetState(this, partialState), callback && this.updater.enqueueCallback(this, callback, "setState"); }, ReactComponent.prototype.forceUpdate = function(callback) { this.updater.enqueueForceUpdate(this), callback && this.updater.enqueueCallback(this, callback, "forceUpdate"); }; module.exports = ReactComponent; }, function(module, exports, __webpack_require__) { "use strict"; function warnNoop(publicInstance, callerName) { } var ReactNoopUpdateQueue = (__webpack_require__(15), { isMounted: function(publicInstance) { return !1; }, enqueueCallback: function(publicInstance, callback) {}, enqueueForceUpdate: function(publicInstance) { warnNoop(publicInstance, "forceUpdate"); }, enqueueReplaceState: function(publicInstance, completeState) { warnNoop(publicInstance, "replaceState"); }, enqueueSetState: function(publicInstance, partialState) { warnNoop(publicInstance, "setState"); } }); module.exports = ReactNoopUpdateQueue; }, function(module, exports, __webpack_require__) { "use strict"; var emptyObject = {}; module.exports = emptyObject; }, function(module, exports, __webpack_require__) { "use strict"; function ReactPureComponent(props, context, updater) { this.props = props, this.context = context, this.refs = emptyObject, this.updater = updater || ReactNoopUpdateQueue; } function ComponentDummy() {} var _assign = __webpack_require__(8), ReactComponent = __webpack_require__(22), ReactNoopUpdateQueue = __webpack_require__(23), emptyObject = __webpack_require__(24); ComponentDummy.prototype = ReactComponent.prototype, ReactPureComponent.prototype = new ComponentDummy(), ReactPureComponent.prototype.constructor = ReactPureComponent, _assign(ReactPureComponent.prototype, ReactComponent.prototype), ReactPureComponent.prototype.isPureReactComponent = !0, module.exports = ReactPureComponent; }, function(module, exports, __webpack_require__) { "use strict"; function identity(fn) { return fn; } function validateMethodOverride(isAlreadyDefined, name) { var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; ReactClassMixin.hasOwnProperty(name) && ("OVERRIDE_BASE" !== specPolicy ? _prodInvariant("73", name) : void 0), isAlreadyDefined && ("DEFINE_MANY" !== specPolicy && "DEFINE_MANY_MERGED" !== specPolicy ? _prodInvariant("74", name) : void 0); } function mixSpecIntoComponent(Constructor, spec) { if (spec) { "function" == typeof spec ? _prodInvariant("75") : void 0, ReactElement.isValidElement(spec) ? _prodInvariant("76") : void 0; var proto = Constructor.prototype, autoBindPairs = proto.__reactAutoBindPairs; spec.hasOwnProperty(MIXINS_KEY) && RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); for (var name in spec) if (spec.hasOwnProperty(name) && name !== MIXINS_KEY) { var property = spec[name], isAlreadyDefined = proto.hasOwnProperty(name); if (validateMethodOverride(isAlreadyDefined, name), RESERVED_SPEC_KEYS.hasOwnProperty(name)) RESERVED_SPEC_KEYS[name](Constructor, property); else { var isReactClassMethod = ReactClassInterface.hasOwnProperty(name), isFunction = "function" == typeof property, shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== !1; if (shouldAutoBind) autoBindPairs.push(name, property), proto[name] = property; else if (isAlreadyDefined) { var specPolicy = ReactClassInterface[name]; !isReactClassMethod || "DEFINE_MANY_MERGED" !== specPolicy && "DEFINE_MANY" !== specPolicy ? _prodInvariant("77", specPolicy, name) : void 0, "DEFINE_MANY_MERGED" === specPolicy ? proto[name] = createMergedResultFunction(proto[name], property) : "DEFINE_MANY" === specPolicy && (proto[name] = createChainedFunction(proto[name], property)); } else proto[name] = property; } } } else ; } function mixStaticSpecIntoComponent(Constructor, statics) { if (statics) for (var name in statics) { var property = statics[name]; if (statics.hasOwnProperty(name)) { var isReserved = name in RESERVED_SPEC_KEYS; isReserved ? _prodInvariant("78", name) : void 0; var isInherited = name in Constructor; isInherited ? _prodInvariant("79", name) : void 0, Constructor[name] = property; } } } function mergeIntoWithNoDuplicateKeys(one, two) { one && two && "object" == typeof one && "object" == typeof two ? void 0 : _prodInvariant("80"); for (var key in two) two.hasOwnProperty(key) && (void 0 !== one[key] ? _prodInvariant("81", key) : void 0, one[key] = two[key]); return one; } function createMergedResultFunction(one, two) { return function() { var a = one.apply(this, arguments), b = two.apply(this, arguments); if (null == a) return b; if (null == b) return a; var c = {}; return mergeIntoWithNoDuplicateKeys(c, a), mergeIntoWithNoDuplicateKeys(c, b), c; }; } function createChainedFunction(one, two) { return function() { one.apply(this, arguments), two.apply(this, arguments); }; } function bin