UNPKG

695 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["index"] = factory();
8 else
9 root["index"] = factory();
10})(this, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId])
20/******/ return installedModules[moduleId].exports;
21
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ exports: {},
25/******/ id: moduleId,
26/******/ loaded: false
27/******/ };
28
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
32/******/ // Flag the module as loaded
33/******/ module.loaded = true;
34
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38
39
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45
46/******/ // __webpack_public_path__
47/******/ __webpack_require__.p = "";
48
49/******/ // Load entry module and return exports
50/******/ return __webpack_require__(0);
51/******/ })
52/************************************************************************/
53/******/ ([
54/* 0 */
55/***/ (function(module, exports, __webpack_require__) {
56
57 __webpack_require__(1);
58 module.exports = __webpack_require__(1);
59
60
61/***/ }),
62/* 1 */
63/***/ (function(module, exports, __webpack_require__) {
64
65 'use strict';
66
67 Object.defineProperty(exports, "__esModule", {
68 value: true
69 });
70 exports.removeResizeListener = exports.addResizeListener = undefined;
71
72 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* eslint-disable */
73
74
75 exports.clearToolTipDom = clearToolTipDom;
76 exports.uid = uid;
77 exports.judgeBrowser = judgeBrowser;
78 exports.judgeSys = judgeSys;
79 exports.contains = contains;
80 exports.createDom = createDom;
81 exports.getHeightLight = getHeightLight;
82 exports.deepClone = deepClone;
83 exports.transferData = transferData;
84 exports.encode = encode;
85 exports.decode = decode;
86
87 var _react = __webpack_require__(2);
88
89 var _react2 = _interopRequireDefault(_react);
90
91 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
92
93 function clearToolTipDom() {
94 var dom_1 = document.getElementsByClassName('tooltip')[0];
95 var dom_2 = document.getElementsByClassName('tooltip-arrow')[0];
96 if (dom_1 && dom_2) {
97 var parNode = dom_1.parentNode;
98 parNode.removeChild(dom_1);
99 parNode.removeChild(dom_2);
100 }
101 }
102
103 function uid(flag) {
104 var now = +new Date();
105 return flag + ('-' + now);
106 }
107
108 function judgeBrowser() {
109 var userAgent = navigator.userAgent;
110 var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
111 reIE.test(userAgent);
112 var fIEVersion = parseFloat(RegExp["$1"]);
113 var browser = {
114 isEdge: /Edge/.test(userAgent),
115 isOpera: /Opera/.test(userAgent),
116 isFirefox: /Firefox/.test(userAgent),
117 isBaidu: /bidubrowser/.test(userAgent),
118 isSougo: /metasr/.test(userAgent),
119 is360: /360se/.test(userAgent),
120 isUc: /ucweb/.test(userAgent),
121 isLB: /lbbrowser/.test(userAgent),
122 isWX: /micromessenger/.test(userAgent),
123 isQQ: /qqbrowser/.test(userAgent),
124 isChrome: userAgent.indexOf("Chrome") > -1 && userAgent.indexOf("Safari") > -1,
125 isSafari: userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") == -1,
126 isIe: !!window.ActiveXObject || "ActiveXObject" in window,
127 isIe7: fIEVersion == 7,
128 isIe8: fIEVersion == 8,
129 isIe9: fIEVersion == 9,
130 ieIe10: fIEVersion == 10,
131 ieIe11: fIEVersion == 11
132 };
133 return browser;
134 }
135
136 function judgeSys() {
137 var userAgent = navigator.userAgent;
138 var browser = {
139 isMac: /Mac OS/.test(userAgent),
140 isIpad: /ipad/.test(userAgent),
141 isIphone: /iphone os/.test(userAgent),
142 isAndroid: /android/.test(userAgent),
143 isWindowsCe: /windows ce/.test(userAgent),
144 isWindowsMobile: /windows mobile/.test(userAgent),
145 isWin2K: /windows nt 5.0/.test(userAgent),
146 isXP: /windows nt 5.1/.test(userAgent),
147 isVista: /windows nt 6.0/.test(userAgent),
148 isWin7: /windows nt 6.1/.test(userAgent),
149 isWin8: /windows nt 6.2/.test(userAgent),
150 isWin81: /windows nt 6.3/.test(userAgent),
151 isWin10: /"Windows NT 10.0/.test(userAgent)
152 };
153 return browser;
154 }
155
156 // 判断n 元素是否是 root中的子元素
157 function contains(root, n) {
158 var node = n;
159 while (node) {
160 if (node === root) {
161 return true;
162 }
163 node = node.parentNode;
164 }
165
166 return false;
167 }
168
169 /* Modified from https://github.com/sdecima/javascript-detect-element-resize
170 * version: 0.5.3
171 *
172 * The MIT License (MIT)
173 *
174 * Copyright (c) 2013 Sebastián Décima
175 *
176 * Permission is hereby granted, free of charge, to any person obtaining a copy of
177 * this software and associated documentation files (the "Software"), to deal in
178 * the Software without restriction, including without limitation the rights to
179 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
180 * the Software, and to permit persons to whom the Software is furnished to do so,
181 * subject to the following conditions:
182 *
183 * The above copyright notice and this permission notice shall be included in all
184 * copies or substantial portions of the Software.
185 *
186 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
187 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
188 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
189 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
190 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
191 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
192 *
193 */
194 /* eslint-disable */
195 var isServer = typeof window === 'undefined';
196
197 /* istanbul ignore next */
198 var requestFrame = function () {
199 if (isServer) return;
200 var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (fn) {
201 return window.setTimeout(fn, 20);
202 };
203 return function (fn) {
204 return raf(fn);
205 };
206 }();
207
208 /* istanbul ignore next */
209 var cancelFrame = function () {
210 if (isServer) return;
211 var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout;
212 return function (id) {
213 return cancel(id);
214 };
215 }();
216
217 /* istanbul ignore next */
218 var resetTrigger = function resetTrigger(element) {
219 var trigger = element.__resizeTrigger__;
220 var expand = trigger.firstElementChild;
221 var contract = trigger.lastElementChild;
222 var expandChild = expand.firstElementChild;
223
224 contract.scrollLeft = contract.scrollWidth;
225 contract.scrollTop = contract.scrollHeight;
226 expandChild.style.width = expand.offsetWidth + 1 + 'px';
227 expandChild.style.height = expand.offsetHeight + 1 + 'px';
228 expand.scrollLeft = expand.scrollWidth;
229 expand.scrollTop = expand.scrollHeight;
230 };
231
232 /* istanbul ignore next */
233 var checkTriggers = function checkTriggers(element) {
234 return element.offsetWidth !== element.__resizeLast__.width || element.offsetHeight !== element.__resizeLast__.height;
235 };
236
237 /* istanbul ignore next */
238 var scrollListener = function scrollListener(event) {
239 var _this = this;
240
241 resetTrigger(this);
242 if (this.__resizeRAF__) cancelFrame(this.__resizeRAF__);
243 this.__resizeRAF__ = requestFrame(function () {
244 if (checkTriggers(_this)) {
245 _this.__resizeLast__.width = _this.offsetWidth;
246 _this.__resizeLast__.height = _this.offsetHeight;
247 _this.__resizeListeners__.forEach(function (fn) {
248 fn.call(_this, event);
249 });
250 }
251 });
252 };
253
254 /* Detect CSS Animations support to detect element display/re-attach */
255 var attachEvent = isServer ? {} : document.attachEvent;
256 var DOM_PREFIXES = 'Webkit Moz O ms'.split(' ');
257 var START_EVENTS = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' ');
258 var RESIZE_ANIMATION_NAME = 'resizeanim';
259 var animation = false;
260 var keyFramePrefix = '';
261 var animationStartEvent = 'animationstart';
262
263 /* istanbul ignore next */
264 if (!attachEvent && !isServer) {
265 var testElement = document.createElement('fakeelement');
266 if (testElement.style.animationName !== undefined) {
267 animation = true;
268 }
269
270 if (animation === false) {
271 var prefix = '';
272 for (var i = 0; i < DOM_PREFIXES.length; i++) {
273 if (testElement.style[DOM_PREFIXES[i] + 'AnimationName'] !== undefined) {
274 prefix = DOM_PREFIXES[i];
275 keyFramePrefix = '-' + prefix.toLowerCase() + '-';
276 animationStartEvent = START_EVENTS[i];
277 animation = true;
278 break;
279 }
280 }
281 }
282 }
283
284 var stylesCreated = false;
285 /* istanbul ignore next */
286 var createStyles = function createStyles() {
287 if (!stylesCreated && !isServer) {
288 var animationKeyframes = '@' + keyFramePrefix + 'keyframes ' + RESIZE_ANIMATION_NAME + ' { from { opacity: 0; } to { opacity: 0; } } ';
289 var animationStyle = keyFramePrefix + 'animation: 1ms ' + RESIZE_ANIMATION_NAME + ';';
290
291 // opacity: 0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360
292 var css = animationKeyframes + '\n .resize-triggers { ' + animationStyle + ' visibility: hidden; opacity: 0; }\n .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1 }\n .resize-triggers > div { background: #eee; overflow: auto; }\n .contract-trigger:before { width: 200%; height: 200%; }';
293
294 var head = document.head || document.getElementsByTagName('head')[0];
295 var style = document.createElement('style');
296
297 style.type = 'text/css';
298 if (style.styleSheet) {
299 style.styleSheet.cssText = css;
300 } else {
301 style.appendChild(document.createTextNode(css));
302 }
303
304 head.appendChild(style);
305 stylesCreated = true;
306 }
307 };
308
309 /* istanbul ignore next */
310 var addResizeListener = exports.addResizeListener = function addResizeListener(element, fn) {
311 if (isServer) return;
312 if (attachEvent) {
313 element.attachEvent('onresize', fn);
314 } else {
315 if (!element.__resizeTrigger__) {
316 if (getComputedStyle(element).position === 'static') {
317 element.style.position = 'relative';
318 }
319 createStyles();
320 element.__resizeLast__ = {};
321 element.__resizeListeners__ = [];
322
323 var resizeTrigger = element.__resizeTrigger__ = document.createElement('div');
324 resizeTrigger.className = 'resize-triggers';
325 resizeTrigger.innerHTML = '<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>';
326 element.appendChild(resizeTrigger);
327
328 resetTrigger(element);
329 element.addEventListener('scroll', scrollListener, true);
330
331 /* Listen for a css animation to detect element display/re-attach */
332 if (animationStartEvent) {
333 resizeTrigger.addEventListener(animationStartEvent, function (event) {
334 if (event.animationName === RESIZE_ANIMATION_NAME) {
335 resetTrigger(element);
336 }
337 });
338 }
339 }
340 element.__resizeListeners__.push(fn);
341 }
342 };
343
344 /* istanbul ignore next */
345 var removeResizeListener = exports.removeResizeListener = function removeResizeListener(element, fn) {
346 if (attachEvent) {
347 element.detachEvent('onresize', fn);
348 } else {
349 element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
350 if (!element.__resizeListeners__.length) {
351 element.removeEventListener('scroll', scrollListener);
352 element.__resizeTrigger__ = !element.removeChild(element.__resizeTrigger__);
353 }
354 }
355 };
356
357 // 创建挂载容器
358 function createDom(id) {
359 if (document.getElementById(id)) return;
360 var oDiv = document.createElement('div');
361 oDiv.id = id;
362 document.body.appendChild(oDiv);
363 }
364
365 function getHeightLight(searchval, text) {
366 var str = [];
367 if (searchval.length > 0) {
368 //获取搜索字符在字段中的位置,分两种 1.首位(index==0) 2.非首位
369 var index = text.indexOf(searchval);
370 var valueLength = searchval.length;
371
372 if (index == 0) {
373 str.beforeText = "";
374 var subValue = text.substring(index, valueLength);
375 str.searchContent = _react2.default.createElement(
376 'em',
377 null,
378 subValue
379 );
380 str.lastext = text.substring(valueLength, text.length);
381 } else if (index > 0) {
382 str.beforeText = text.substring(0, index);
383 var _subValue = text.substring(index, valueLength + index);
384 str.searchContent = _react2.default.createElement(
385 'em',
386 null,
387 _subValue
388 );
389 str.lastext = text.substring(valueLength + index, text.length);
390 }
391 } else {
392 str.beforeText = "";
393 str.searchContent = "";
394 str.lastext = text;
395 }
396 return str;
397 }
398
399 function deepClone(item) {
400 if (!item) return item;
401 var types = [Number, String, Boolean],
402 result;
403 types.forEach(function (type) {
404 if (item instanceof type) {
405 result = type(item);
406 }
407 });
408
409 if (typeof result == "undefined") {
410 if (Object.prototype.toString.call(item) === "[object Array]") {
411 result = [];
412 item.forEach(function (child, index, array) {
413 result[index] = deepClone(child);
414 });
415 } else if ((typeof item === 'undefined' ? 'undefined' : _typeof(item)) == "object") {
416 if (item.nodeType && typeof item.cloneNode == "function") {
417 result = item.cloneNode(true);
418 } else if (!item.prototype) {
419 if (item instanceof Date) {
420 result = new Date(item);
421 } else {
422 result = {};
423 for (var i in item) {
424 result[i] = deepClone(item[i]);
425 }
426 }
427 } else {
428 result = item;
429 }
430 } else {
431 result = item;
432 }
433 }
434 return result;
435 }
436
437 function transferData(data) {
438 var filter = [],
439 getData = {},
440 self = this;
441
442 for (var _i in data) {
443 if (data[_i] != undefined) getData[data[_i]["id"]] = data[_i];
444 }
445 for (var j in data) {
446 if (data[j]) {
447 var item = data[j],
448 temp = getData[item["pid"]];
449 if (temp && temp.id != temp.pid) {
450 !temp["li"] && (temp["li"] = []);
451 temp["li"].push(item);
452 } else {
453 filter.push(item);
454 }
455 }
456 }
457 return filter;
458 }
459
460 function encode(str) {
461 if (!str) {
462 return str;
463 }
464 str = str.toString();
465 return str.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
466 }
467
468 function decode(str) {
469 if (!str) {
470 return str;
471 }
472 return str.replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&');
473 }
474
475/***/ }),
476/* 2 */
477/***/ (function(module, exports, __webpack_require__) {
478
479 'use strict';
480
481 module.exports = __webpack_require__(3);
482
483
484/***/ }),
485/* 3 */
486/***/ (function(module, exports, __webpack_require__) {
487
488 /**
489 * Copyright 2013-2015, Facebook, Inc.
490 * All rights reserved.
491 *
492 * This source code is licensed under the BSD-style license found in the
493 * LICENSE file in the root directory of this source tree. An additional grant
494 * of patent rights can be found in the PATENTS file in the same directory.
495 *
496 * @providesModule React
497 */
498
499 'use strict';
500
501 var ReactDOM = __webpack_require__(4);
502 var ReactDOMServer = __webpack_require__(149);
503 var ReactIsomorphic = __webpack_require__(153);
504
505 var assign = __webpack_require__(40);
506 var deprecated = __webpack_require__(158);
507
508 // `version` will be added here by ReactIsomorphic.
509 var React = {};
510
511 assign(React, ReactIsomorphic);
512
513 assign(React, {
514 // ReactDOM
515 findDOMNode: deprecated('findDOMNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.findDOMNode),
516 render: deprecated('render', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.render),
517 unmountComponentAtNode: deprecated('unmountComponentAtNode', 'ReactDOM', 'react-dom', ReactDOM, ReactDOM.unmountComponentAtNode),
518
519 // ReactDOMServer
520 renderToString: deprecated('renderToString', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToString),
521 renderToStaticMarkup: deprecated('renderToStaticMarkup', 'ReactDOMServer', 'react-dom/server', ReactDOMServer, ReactDOMServer.renderToStaticMarkup)
522 });
523
524 React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOM;
525 React.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactDOMServer;
526
527 module.exports = React;
528
529/***/ }),
530/* 4 */
531/***/ (function(module, exports, __webpack_require__) {
532
533 /* WEBPACK VAR INJECTION */(function(process) {/**
534 * Copyright 2013-2015, Facebook, Inc.
535 * All rights reserved.
536 *
537 * This source code is licensed under the BSD-style license found in the
538 * LICENSE file in the root directory of this source tree. An additional grant
539 * of patent rights can be found in the PATENTS file in the same directory.
540 *
541 * @providesModule ReactDOM
542 */
543
544 /* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
545
546 'use strict';
547
548 var ReactCurrentOwner = __webpack_require__(6);
549 var ReactDOMTextComponent = __webpack_require__(7);
550 var ReactDefaultInjection = __webpack_require__(72);
551 var ReactInstanceHandles = __webpack_require__(46);
552 var ReactMount = __webpack_require__(29);
553 var ReactPerf = __webpack_require__(19);
554 var ReactReconciler = __webpack_require__(51);
555 var ReactUpdates = __webpack_require__(55);
556 var ReactVersion = __webpack_require__(147);
557
558 var findDOMNode = __webpack_require__(92);
559 var renderSubtreeIntoContainer = __webpack_require__(148);
560 var warning = __webpack_require__(26);
561
562 ReactDefaultInjection.inject();
563
564 var render = ReactPerf.measure('React', 'render', ReactMount.render);
565
566 var React = {
567 findDOMNode: findDOMNode,
568 render: render,
569 unmountComponentAtNode: ReactMount.unmountComponentAtNode,
570 version: ReactVersion,
571
572 /* eslint-disable camelcase */
573 unstable_batchedUpdates: ReactUpdates.batchedUpdates,
574 unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
575 };
576
577 // Inject the runtime into a devtools global hook regardless of browser.
578 // Allows for debugging when the hook is injected on the page.
579 /* eslint-enable camelcase */
580 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
581 __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
582 CurrentOwner: ReactCurrentOwner,
583 InstanceHandles: ReactInstanceHandles,
584 Mount: ReactMount,
585 Reconciler: ReactReconciler,
586 TextComponent: ReactDOMTextComponent
587 });
588 }
589
590 if (process.env.NODE_ENV !== 'production') {
591 var ExecutionEnvironment = __webpack_require__(10);
592 if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
593
594 // First check if devtools is not installed
595 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
596 // If we're in Chrome or Firefox, provide a download link if not installed.
597 if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
598 console.debug('Download the React DevTools for a better development experience: ' + 'https://fb.me/react-devtools');
599 }
600 }
601
602 // If we're in IE8, check to see if we are in compatibility mode and provide
603 // information on preventing compatibility mode
604 var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
605
606 process.env.NODE_ENV !== 'production' ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : undefined;
607
608 var expectedFeatures = [
609 // shims
610 Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.split, String.prototype.trim,
611
612 // shams
613 Object.create, Object.freeze];
614
615 for (var i = 0; i < expectedFeatures.length; i++) {
616 if (!expectedFeatures[i]) {
617 console.error('One or more ES5 shim/shams expected by React are not available: ' + 'https://fb.me/react-warning-polyfills');
618 break;
619 }
620 }
621 }
622 }
623
624 module.exports = React;
625 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
626
627/***/ }),
628/* 5 */
629/***/ (function(module, exports) {
630
631 // shim for using process in browser
632 var process = module.exports = {};
633
634 // cached from whatever global is present so that test runners that stub it
635 // don't break things. But we need to wrap it in a try catch in case it is
636 // wrapped in strict mode code which doesn't define any globals. It's inside a
637 // function because try/catches deoptimize in certain engines.
638
639 var cachedSetTimeout;
640 var cachedClearTimeout;
641
642 function defaultSetTimout() {
643 throw new Error('setTimeout has not been defined');
644 }
645 function defaultClearTimeout () {
646 throw new Error('clearTimeout has not been defined');
647 }
648 (function () {
649 try {
650 if (typeof setTimeout === 'function') {
651 cachedSetTimeout = setTimeout;
652 } else {
653 cachedSetTimeout = defaultSetTimout;
654 }
655 } catch (e) {
656 cachedSetTimeout = defaultSetTimout;
657 }
658 try {
659 if (typeof clearTimeout === 'function') {
660 cachedClearTimeout = clearTimeout;
661 } else {
662 cachedClearTimeout = defaultClearTimeout;
663 }
664 } catch (e) {
665 cachedClearTimeout = defaultClearTimeout;
666 }
667 } ())
668 function runTimeout(fun) {
669 if (cachedSetTimeout === setTimeout) {
670 //normal enviroments in sane situations
671 return setTimeout(fun, 0);
672 }
673 // if setTimeout wasn't available but was latter defined
674 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
675 cachedSetTimeout = setTimeout;
676 return setTimeout(fun, 0);
677 }
678 try {
679 // when when somebody has screwed with setTimeout but no I.E. maddness
680 return cachedSetTimeout(fun, 0);
681 } catch(e){
682 try {
683 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
684 return cachedSetTimeout.call(null, fun, 0);
685 } catch(e){
686 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
687 return cachedSetTimeout.call(this, fun, 0);
688 }
689 }
690
691
692 }
693 function runClearTimeout(marker) {
694 if (cachedClearTimeout === clearTimeout) {
695 //normal enviroments in sane situations
696 return clearTimeout(marker);
697 }
698 // if clearTimeout wasn't available but was latter defined
699 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
700 cachedClearTimeout = clearTimeout;
701 return clearTimeout(marker);
702 }
703 try {
704 // when when somebody has screwed with setTimeout but no I.E. maddness
705 return cachedClearTimeout(marker);
706 } catch (e){
707 try {
708 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
709 return cachedClearTimeout.call(null, marker);
710 } catch (e){
711 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
712 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
713 return cachedClearTimeout.call(this, marker);
714 }
715 }
716
717
718
719 }
720 var queue = [];
721 var draining = false;
722 var currentQueue;
723 var queueIndex = -1;
724
725 function cleanUpNextTick() {
726 if (!draining || !currentQueue) {
727 return;
728 }
729 draining = false;
730 if (currentQueue.length) {
731 queue = currentQueue.concat(queue);
732 } else {
733 queueIndex = -1;
734 }
735 if (queue.length) {
736 drainQueue();
737 }
738 }
739
740 function drainQueue() {
741 if (draining) {
742 return;
743 }
744 var timeout = runTimeout(cleanUpNextTick);
745 draining = true;
746
747 var len = queue.length;
748 while(len) {
749 currentQueue = queue;
750 queue = [];
751 while (++queueIndex < len) {
752 if (currentQueue) {
753 currentQueue[queueIndex].run();
754 }
755 }
756 queueIndex = -1;
757 len = queue.length;
758 }
759 currentQueue = null;
760 draining = false;
761 runClearTimeout(timeout);
762 }
763
764 process.nextTick = function (fun) {
765 var args = new Array(arguments.length - 1);
766 if (arguments.length > 1) {
767 for (var i = 1; i < arguments.length; i++) {
768 args[i - 1] = arguments[i];
769 }
770 }
771 queue.push(new Item(fun, args));
772 if (queue.length === 1 && !draining) {
773 runTimeout(drainQueue);
774 }
775 };
776
777 // v8 likes predictible objects
778 function Item(fun, array) {
779 this.fun = fun;
780 this.array = array;
781 }
782 Item.prototype.run = function () {
783 this.fun.apply(null, this.array);
784 };
785 process.title = 'browser';
786 process.browser = true;
787 process.env = {};
788 process.argv = [];
789 process.version = ''; // empty string to avoid regexp issues
790 process.versions = {};
791
792 function noop() {}
793
794 process.on = noop;
795 process.addListener = noop;
796 process.once = noop;
797 process.off = noop;
798 process.removeListener = noop;
799 process.removeAllListeners = noop;
800 process.emit = noop;
801 process.prependListener = noop;
802 process.prependOnceListener = noop;
803
804 process.listeners = function (name) { return [] }
805
806 process.binding = function (name) {
807 throw new Error('process.binding is not supported');
808 };
809
810 process.cwd = function () { return '/' };
811 process.chdir = function (dir) {
812 throw new Error('process.chdir is not supported');
813 };
814 process.umask = function() { return 0; };
815
816
817/***/ }),
818/* 6 */
819/***/ (function(module, exports) {
820
821 /**
822 * Copyright 2013-2015, Facebook, Inc.
823 * All rights reserved.
824 *
825 * This source code is licensed under the BSD-style license found in the
826 * LICENSE file in the root directory of this source tree. An additional grant
827 * of patent rights can be found in the PATENTS file in the same directory.
828 *
829 * @providesModule ReactCurrentOwner
830 */
831
832 'use strict';
833
834 /**
835 * Keeps track of the current owner.
836 *
837 * The current owner is the component who should own any components that are
838 * currently being constructed.
839 */
840 var ReactCurrentOwner = {
841
842 /**
843 * @internal
844 * @type {ReactComponent}
845 */
846 current: null
847
848 };
849
850 module.exports = ReactCurrentOwner;
851
852/***/ }),
853/* 7 */
854/***/ (function(module, exports, __webpack_require__) {
855
856 /* WEBPACK VAR INJECTION */(function(process) {/**
857 * Copyright 2013-2015, Facebook, Inc.
858 * All rights reserved.
859 *
860 * This source code is licensed under the BSD-style license found in the
861 * LICENSE file in the root directory of this source tree. An additional grant
862 * of patent rights can be found in the PATENTS file in the same directory.
863 *
864 * @providesModule ReactDOMTextComponent
865 * @typechecks static-only
866 */
867
868 'use strict';
869
870 var DOMChildrenOperations = __webpack_require__(8);
871 var DOMPropertyOperations = __webpack_require__(23);
872 var ReactComponentBrowserEnvironment = __webpack_require__(27);
873 var ReactMount = __webpack_require__(29);
874
875 var assign = __webpack_require__(40);
876 var escapeTextContentForBrowser = __webpack_require__(22);
877 var setTextContent = __webpack_require__(21);
878 var validateDOMNesting = __webpack_require__(71);
879
880 /**
881 * Text nodes violate a couple assumptions that React makes about components:
882 *
883 * - When mounting text into the DOM, adjacent text nodes are merged.
884 * - Text nodes cannot be assigned a React root ID.
885 *
886 * This component is used to wrap strings in elements so that they can undergo
887 * the same reconciliation that is applied to elements.
888 *
889 * TODO: Investigate representing React components in the DOM with text nodes.
890 *
891 * @class ReactDOMTextComponent
892 * @extends ReactComponent
893 * @internal
894 */
895 var ReactDOMTextComponent = function (props) {
896 // This constructor and its argument is currently used by mocks.
897 };
898
899 assign(ReactDOMTextComponent.prototype, {
900
901 /**
902 * @param {ReactText} text
903 * @internal
904 */
905 construct: function (text) {
906 // TODO: This is really a ReactText (ReactNode), not a ReactElement
907 this._currentElement = text;
908 this._stringText = '' + text;
909
910 // Properties
911 this._rootNodeID = null;
912 this._mountIndex = 0;
913 },
914
915 /**
916 * Creates the markup for this text node. This node is not intended to have
917 * any features besides containing text content.
918 *
919 * @param {string} rootID DOM ID of the root node.
920 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
921 * @return {string} Markup for this text node.
922 * @internal
923 */
924 mountComponent: function (rootID, transaction, context) {
925 if (process.env.NODE_ENV !== 'production') {
926 if (context[validateDOMNesting.ancestorInfoContextKey]) {
927 validateDOMNesting('span', null, context[validateDOMNesting.ancestorInfoContextKey]);
928 }
929 }
930
931 this._rootNodeID = rootID;
932 if (transaction.useCreateElement) {
933 var ownerDocument = context[ReactMount.ownerDocumentContextKey];
934 var el = ownerDocument.createElement('span');
935 DOMPropertyOperations.setAttributeForID(el, rootID);
936 // Populate node cache
937 ReactMount.getID(el);
938 setTextContent(el, this._stringText);
939 return el;
940 } else {
941 var escapedText = escapeTextContentForBrowser(this._stringText);
942
943 if (transaction.renderToStaticMarkup) {
944 // Normally we'd wrap this in a `span` for the reasons stated above, but
945 // since this is a situation where React won't take over (static pages),
946 // we can simply return the text as it is.
947 return escapedText;
948 }
949
950 return '<span ' + DOMPropertyOperations.createMarkupForID(rootID) + '>' + escapedText + '</span>';
951 }
952 },
953
954 /**
955 * Updates this component by updating the text content.
956 *
957 * @param {ReactText} nextText The next text content
958 * @param {ReactReconcileTransaction} transaction
959 * @internal
960 */
961 receiveComponent: function (nextText, transaction) {
962 if (nextText !== this._currentElement) {
963 this._currentElement = nextText;
964 var nextStringText = '' + nextText;
965 if (nextStringText !== this._stringText) {
966 // TODO: Save this as pending props and use performUpdateIfNecessary
967 // and/or updateComponent to do the actual update for consistency with
968 // other component types?
969 this._stringText = nextStringText;
970 var node = ReactMount.getNode(this._rootNodeID);
971 DOMChildrenOperations.updateTextContent(node, nextStringText);
972 }
973 }
974 },
975
976 unmountComponent: function () {
977 ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
978 }
979
980 });
981
982 module.exports = ReactDOMTextComponent;
983 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
984
985/***/ }),
986/* 8 */
987/***/ (function(module, exports, __webpack_require__) {
988
989 /* WEBPACK VAR INJECTION */(function(process) {/**
990 * Copyright 2013-2015, Facebook, Inc.
991 * All rights reserved.
992 *
993 * This source code is licensed under the BSD-style license found in the
994 * LICENSE file in the root directory of this source tree. An additional grant
995 * of patent rights can be found in the PATENTS file in the same directory.
996 *
997 * @providesModule DOMChildrenOperations
998 * @typechecks static-only
999 */
1000
1001 'use strict';
1002
1003 var Danger = __webpack_require__(9);
1004 var ReactMultiChildUpdateTypes = __webpack_require__(17);
1005 var ReactPerf = __webpack_require__(19);
1006
1007 var setInnerHTML = __webpack_require__(20);
1008 var setTextContent = __webpack_require__(21);
1009 var invariant = __webpack_require__(14);
1010
1011 /**
1012 * Inserts `childNode` as a child of `parentNode` at the `index`.
1013 *
1014 * @param {DOMElement} parentNode Parent node in which to insert.
1015 * @param {DOMElement} childNode Child node to insert.
1016 * @param {number} index Index at which to insert the child.
1017 * @internal
1018 */
1019 function insertChildAt(parentNode, childNode, index) {
1020 // By exploiting arrays returning `undefined` for an undefined index, we can
1021 // rely exclusively on `insertBefore(node, null)` instead of also using
1022 // `appendChild(node)`. However, using `undefined` is not allowed by all
1023 // browsers so we must replace it with `null`.
1024
1025 // fix render order error in safari
1026 // IE8 will throw error when index out of list size.
1027 var beforeChild = index >= parentNode.childNodes.length ? null : parentNode.childNodes.item(index);
1028
1029 parentNode.insertBefore(childNode, beforeChild);
1030 }
1031
1032 /**
1033 * Operations for updating with DOM children.
1034 */
1035 var DOMChildrenOperations = {
1036
1037 dangerouslyReplaceNodeWithMarkup: Danger.dangerouslyReplaceNodeWithMarkup,
1038
1039 updateTextContent: setTextContent,
1040
1041 /**
1042 * Updates a component's children by processing a series of updates. The
1043 * update configurations are each expected to have a `parentNode` property.
1044 *
1045 * @param {array<object>} updates List of update configurations.
1046 * @param {array<string>} markupList List of markup strings.
1047 * @internal
1048 */
1049 processUpdates: function (updates, markupList) {
1050 var update;
1051 // Mapping from parent IDs to initial child orderings.
1052 var initialChildren = null;
1053 // List of children that will be moved or removed.
1054 var updatedChildren = null;
1055
1056 for (var i = 0; i < updates.length; i++) {
1057 update = updates[i];
1058 if (update.type === ReactMultiChildUpdateTypes.MOVE_EXISTING || update.type === ReactMultiChildUpdateTypes.REMOVE_NODE) {
1059 var updatedIndex = update.fromIndex;
1060 var updatedChild = update.parentNode.childNodes[updatedIndex];
1061 var parentID = update.parentID;
1062
1063 !updatedChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processUpdates(): Unable to find child %s of element. This ' + 'probably means the DOM was unexpectedly mutated (e.g., by the ' + 'browser), usually due to forgetting a <tbody> when using tables, ' + 'nesting tags like <form>, <p>, or <a>, or using non-SVG elements ' + 'in an <svg> parent. Try inspecting the child nodes of the element ' + 'with React ID `%s`.', updatedIndex, parentID) : invariant(false) : undefined;
1064
1065 initialChildren = initialChildren || {};
1066 initialChildren[parentID] = initialChildren[parentID] || [];
1067 initialChildren[parentID][updatedIndex] = updatedChild;
1068
1069 updatedChildren = updatedChildren || [];
1070 updatedChildren.push(updatedChild);
1071 }
1072 }
1073
1074 var renderedMarkup;
1075 // markupList is either a list of markup or just a list of elements
1076 if (markupList.length && typeof markupList[0] === 'string') {
1077 renderedMarkup = Danger.dangerouslyRenderMarkup(markupList);
1078 } else {
1079 renderedMarkup = markupList;
1080 }
1081
1082 // Remove updated children first so that `toIndex` is consistent.
1083 if (updatedChildren) {
1084 for (var j = 0; j < updatedChildren.length; j++) {
1085 updatedChildren[j].parentNode.removeChild(updatedChildren[j]);
1086 }
1087 }
1088
1089 for (var k = 0; k < updates.length; k++) {
1090 update = updates[k];
1091 switch (update.type) {
1092 case ReactMultiChildUpdateTypes.INSERT_MARKUP:
1093 insertChildAt(update.parentNode, renderedMarkup[update.markupIndex], update.toIndex);
1094 break;
1095 case ReactMultiChildUpdateTypes.MOVE_EXISTING:
1096 insertChildAt(update.parentNode, initialChildren[update.parentID][update.fromIndex], update.toIndex);
1097 break;
1098 case ReactMultiChildUpdateTypes.SET_MARKUP:
1099 setInnerHTML(update.parentNode, update.content);
1100 break;
1101 case ReactMultiChildUpdateTypes.TEXT_CONTENT:
1102 setTextContent(update.parentNode, update.content);
1103 break;
1104 case ReactMultiChildUpdateTypes.REMOVE_NODE:
1105 // Already removed by the for-loop above.
1106 break;
1107 }
1108 }
1109 }
1110
1111 };
1112
1113 ReactPerf.measureMethods(DOMChildrenOperations, 'DOMChildrenOperations', {
1114 updateTextContent: 'updateTextContent'
1115 });
1116
1117 module.exports = DOMChildrenOperations;
1118 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
1119
1120/***/ }),
1121/* 9 */
1122/***/ (function(module, exports, __webpack_require__) {
1123
1124 /* WEBPACK VAR INJECTION */(function(process) {/**
1125 * Copyright 2013-2015, Facebook, Inc.
1126 * All rights reserved.
1127 *
1128 * This source code is licensed under the BSD-style license found in the
1129 * LICENSE file in the root directory of this source tree. An additional grant
1130 * of patent rights can be found in the PATENTS file in the same directory.
1131 *
1132 * @providesModule Danger
1133 * @typechecks static-only
1134 */
1135
1136 'use strict';
1137
1138 var ExecutionEnvironment = __webpack_require__(10);
1139
1140 var createNodesFromMarkup = __webpack_require__(11);
1141 var emptyFunction = __webpack_require__(16);
1142 var getMarkupWrap = __webpack_require__(15);
1143 var invariant = __webpack_require__(14);
1144
1145 var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
1146 var RESULT_INDEX_ATTR = 'data-danger-index';
1147
1148 /**
1149 * Extracts the `nodeName` from a string of markup.
1150 *
1151 * NOTE: Extracting the `nodeName` does not require a regular expression match
1152 * because we make assumptions about React-generated markup (i.e. there are no
1153 * spaces surrounding the opening tag and there is at least one attribute).
1154 *
1155 * @param {string} markup String of markup.
1156 * @return {string} Node name of the supplied markup.
1157 * @see http://jsperf.com/extract-nodename
1158 */
1159 function getNodeName(markup) {
1160 return markup.substring(1, markup.indexOf(' '));
1161 }
1162
1163 var Danger = {
1164
1165 /**
1166 * Renders markup into an array of nodes. The markup is expected to render
1167 * into a list of root nodes. Also, the length of `resultList` and
1168 * `markupList` should be the same.
1169 *
1170 * @param {array<string>} markupList List of markup strings to render.
1171 * @return {array<DOMElement>} List of rendered nodes.
1172 * @internal
1173 */
1174 dangerouslyRenderMarkup: function (markupList) {
1175 !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Cannot render markup in a worker ' + 'thread. Make sure `window` and `document` are available globally ' + 'before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString for server rendering.') : invariant(false) : undefined;
1176 var nodeName;
1177 var markupByNodeName = {};
1178 // Group markup by `nodeName` if a wrap is necessary, else by '*'.
1179 for (var i = 0; i < markupList.length; i++) {
1180 !markupList[i] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(false) : undefined;
1181 nodeName = getNodeName(markupList[i]);
1182 nodeName = getMarkupWrap(nodeName) ? nodeName : '*';
1183 markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];
1184 markupByNodeName[nodeName][i] = markupList[i];
1185 }
1186 var resultList = [];
1187 var resultListAssignmentCount = 0;
1188 for (nodeName in markupByNodeName) {
1189 if (!markupByNodeName.hasOwnProperty(nodeName)) {
1190 continue;
1191 }
1192 var markupListByNodeName = markupByNodeName[nodeName];
1193
1194 // This for-in loop skips the holes of the sparse array. The order of
1195 // iteration should follow the order of assignment, which happens to match
1196 // numerical index order, but we don't rely on that.
1197 var resultIndex;
1198 for (resultIndex in markupListByNodeName) {
1199 if (markupListByNodeName.hasOwnProperty(resultIndex)) {
1200 var markup = markupListByNodeName[resultIndex];
1201
1202 // Push the requested markup with an additional RESULT_INDEX_ATTR
1203 // attribute. If the markup does not start with a < character, it
1204 // will be discarded below (with an appropriate console.error).
1205 markupListByNodeName[resultIndex] = markup.replace(OPEN_TAG_NAME_EXP,
1206 // This index will be parsed back out below.
1207 '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" ');
1208 }
1209 }
1210
1211 // Render each group of markup with similar wrapping `nodeName`.
1212 var renderNodes = createNodesFromMarkup(markupListByNodeName.join(''), emptyFunction // Do nothing special with <script> tags.
1213 );
1214
1215 for (var j = 0; j < renderNodes.length; ++j) {
1216 var renderNode = renderNodes[j];
1217 if (renderNode.hasAttribute && renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
1218
1219 resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);
1220 renderNode.removeAttribute(RESULT_INDEX_ATTR);
1221
1222 !!resultList.hasOwnProperty(resultIndex) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Assigning to an already-occupied result index.') : invariant(false) : undefined;
1223
1224 resultList[resultIndex] = renderNode;
1225
1226 // This should match resultList.length and markupList.length when
1227 // we're done.
1228 resultListAssignmentCount += 1;
1229 } else if (process.env.NODE_ENV !== 'production') {
1230 console.error('Danger: Discarding unexpected node:', renderNode);
1231 }
1232 }
1233 }
1234
1235 // Although resultList was populated out of order, it should now be a dense
1236 // array.
1237 !(resultListAssignmentCount === resultList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Did not assign to every index of resultList.') : invariant(false) : undefined;
1238
1239 !(resultList.length === markupList.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length) : invariant(false) : undefined;
1240
1241 return resultList;
1242 },
1243
1244 /**
1245 * Replaces a node with a string of markup at its current position within its
1246 * parent. The markup must render into a single root node.
1247 *
1248 * @param {DOMElement} oldChild Child node to replace.
1249 * @param {string} markup Markup to render in place of the child node.
1250 * @internal
1251 */
1252 dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
1253 !ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a ' + 'worker thread. Make sure `window` and `document` are available ' + 'globally before requiring React when unit testing or use ' + 'ReactDOMServer.renderToString() for server rendering.') : invariant(false) : undefined;
1254 !markup ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(false) : undefined;
1255 !(oldChild.tagName.toLowerCase() !== 'html') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the ' + '<html> node. This is because browser quirks make this unreliable ' + 'and/or slow. If you want to render to the root you must use ' + 'server rendering. See ReactDOMServer.renderToString().') : invariant(false) : undefined;
1256
1257 var newChild;
1258 if (typeof markup === 'string') {
1259 newChild = createNodesFromMarkup(markup, emptyFunction)[0];
1260 } else {
1261 newChild = markup;
1262 }
1263 oldChild.parentNode.replaceChild(newChild, oldChild);
1264 }
1265
1266 };
1267
1268 module.exports = Danger;
1269 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
1270
1271/***/ }),
1272/* 10 */
1273/***/ (function(module, exports) {
1274
1275 /**
1276 * Copyright 2013-2015, Facebook, Inc.
1277 * All rights reserved.
1278 *
1279 * This source code is licensed under the BSD-style license found in the
1280 * LICENSE file in the root directory of this source tree. An additional grant
1281 * of patent rights can be found in the PATENTS file in the same directory.
1282 *
1283 * @providesModule ExecutionEnvironment
1284 */
1285
1286 'use strict';
1287
1288 var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
1289
1290 /**
1291 * Simple, lightweight module assisting with the detection and context of
1292 * Worker. Helps avoid circular dependencies and allows code to reason about
1293 * whether or not they are in a Worker, even if they never include the main
1294 * `ReactWorker` dependency.
1295 */
1296 var ExecutionEnvironment = {
1297
1298 canUseDOM: canUseDOM,
1299
1300 canUseWorkers: typeof Worker !== 'undefined',
1301
1302 canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
1303
1304 canUseViewport: canUseDOM && !!window.screen,
1305
1306 isInWorker: !canUseDOM // For now, this is true - might change in the future.
1307
1308 };
1309
1310 module.exports = ExecutionEnvironment;
1311
1312/***/ }),
1313/* 11 */
1314/***/ (function(module, exports, __webpack_require__) {
1315
1316 /* WEBPACK VAR INJECTION */(function(process) {/**
1317 * Copyright 2013-2015, Facebook, Inc.
1318 * All rights reserved.
1319 *
1320 * This source code is licensed under the BSD-style license found in the
1321 * LICENSE file in the root directory of this source tree. An additional grant
1322 * of patent rights can be found in the PATENTS file in the same directory.
1323 *
1324 * @providesModule createNodesFromMarkup
1325 * @typechecks
1326 */
1327
1328 /*eslint-disable fb-www/unsafe-html*/
1329
1330 'use strict';
1331
1332 var ExecutionEnvironment = __webpack_require__(10);
1333
1334 var createArrayFromMixed = __webpack_require__(12);
1335 var getMarkupWrap = __webpack_require__(15);
1336 var invariant = __webpack_require__(14);
1337
1338 /**
1339 * Dummy container used to render all markup.
1340 */
1341 var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
1342
1343 /**
1344 * Pattern used by `getNodeName`.
1345 */
1346 var nodeNamePattern = /^\s*<(\w+)/;
1347
1348 /**
1349 * Extracts the `nodeName` of the first element in a string of markup.
1350 *
1351 * @param {string} markup String of markup.
1352 * @return {?string} Node name of the supplied markup.
1353 */
1354 function getNodeName(markup) {
1355 var nodeNameMatch = markup.match(nodeNamePattern);
1356 return nodeNameMatch && nodeNameMatch[1].toLowerCase();
1357 }
1358
1359 /**
1360 * Creates an array containing the nodes rendered from the supplied markup. The
1361 * optionally supplied `handleScript` function will be invoked once for each
1362 * <script> element that is rendered. If no `handleScript` function is supplied,
1363 * an exception is thrown if any <script> elements are rendered.
1364 *
1365 * @param {string} markup A string of valid HTML markup.
1366 * @param {?function} handleScript Invoked once for each rendered <script>.
1367 * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
1368 */
1369 function createNodesFromMarkup(markup, handleScript) {
1370 var node = dummyNode;
1371 !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : undefined;
1372 var nodeName = getNodeName(markup);
1373
1374 var wrap = nodeName && getMarkupWrap(nodeName);
1375 if (wrap) {
1376 node.innerHTML = wrap[1] + markup + wrap[2];
1377
1378 var wrapDepth = wrap[0];
1379 while (wrapDepth--) {
1380 node = node.lastChild;
1381 }
1382 } else {
1383 node.innerHTML = markup;
1384 }
1385
1386 var scripts = node.getElementsByTagName('script');
1387 if (scripts.length) {
1388 !handleScript ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : undefined;
1389 createArrayFromMixed(scripts).forEach(handleScript);
1390 }
1391
1392 var nodes = createArrayFromMixed(node.childNodes);
1393 while (node.lastChild) {
1394 node.removeChild(node.lastChild);
1395 }
1396 return nodes;
1397 }
1398
1399 module.exports = createNodesFromMarkup;
1400 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
1401
1402/***/ }),
1403/* 12 */
1404/***/ (function(module, exports, __webpack_require__) {
1405
1406 /**
1407 * Copyright 2013-2015, Facebook, Inc.
1408 * All rights reserved.
1409 *
1410 * This source code is licensed under the BSD-style license found in the
1411 * LICENSE file in the root directory of this source tree. An additional grant
1412 * of patent rights can be found in the PATENTS file in the same directory.
1413 *
1414 * @providesModule createArrayFromMixed
1415 * @typechecks
1416 */
1417
1418 'use strict';
1419
1420 var toArray = __webpack_require__(13);
1421
1422 /**
1423 * Perform a heuristic test to determine if an object is "array-like".
1424 *
1425 * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
1426 * Joshu replied: "Mu."
1427 *
1428 * This function determines if its argument has "array nature": it returns
1429 * true if the argument is an actual array, an `arguments' object, or an
1430 * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
1431 *
1432 * It will return false for other array-like objects like Filelist.
1433 *
1434 * @param {*} obj
1435 * @return {boolean}
1436 */
1437 function hasArrayNature(obj) {
1438 return(
1439 // not null/false
1440 !!obj && (
1441 // arrays are objects, NodeLists are functions in Safari
1442 typeof obj == 'object' || typeof obj == 'function') &&
1443 // quacks like an array
1444 'length' in obj &&
1445 // not window
1446 !('setInterval' in obj) &&
1447 // no DOM node should be considered an array-like
1448 // a 'select' element has 'length' and 'item' properties on IE8
1449 typeof obj.nodeType != 'number' && (
1450 // a real array
1451 Array.isArray(obj) ||
1452 // arguments
1453 'callee' in obj ||
1454 // HTMLCollection/NodeList
1455 'item' in obj)
1456 );
1457 }
1458
1459 /**
1460 * Ensure that the argument is an array by wrapping it in an array if it is not.
1461 * Creates a copy of the argument if it is already an array.
1462 *
1463 * This is mostly useful idiomatically:
1464 *
1465 * var createArrayFromMixed = require('createArrayFromMixed');
1466 *
1467 * function takesOneOrMoreThings(things) {
1468 * things = createArrayFromMixed(things);
1469 * ...
1470 * }
1471 *
1472 * This allows you to treat `things' as an array, but accept scalars in the API.
1473 *
1474 * If you need to convert an array-like object, like `arguments`, into an array
1475 * use toArray instead.
1476 *
1477 * @param {*} obj
1478 * @return {array}
1479 */
1480 function createArrayFromMixed(obj) {
1481 if (!hasArrayNature(obj)) {
1482 return [obj];
1483 } else if (Array.isArray(obj)) {
1484 return obj.slice();
1485 } else {
1486 return toArray(obj);
1487 }
1488 }
1489
1490 module.exports = createArrayFromMixed;
1491
1492/***/ }),
1493/* 13 */
1494/***/ (function(module, exports, __webpack_require__) {
1495
1496 /* WEBPACK VAR INJECTION */(function(process) {/**
1497 * Copyright 2013-2015, Facebook, Inc.
1498 * All rights reserved.
1499 *
1500 * This source code is licensed under the BSD-style license found in the
1501 * LICENSE file in the root directory of this source tree. An additional grant
1502 * of patent rights can be found in the PATENTS file in the same directory.
1503 *
1504 * @providesModule toArray
1505 * @typechecks
1506 */
1507
1508 'use strict';
1509
1510 var invariant = __webpack_require__(14);
1511
1512 /**
1513 * Convert array-like objects to arrays.
1514 *
1515 * This API assumes the caller knows the contents of the data type. For less
1516 * well defined inputs use createArrayFromMixed.
1517 *
1518 * @param {object|function|filelist} obj
1519 * @return {array}
1520 */
1521 function toArray(obj) {
1522 var length = obj.length;
1523
1524 // Some browse builtin objects can report typeof 'function' (e.g. NodeList in
1525 // old versions of Safari).
1526 !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : undefined;
1527
1528 !(typeof length === 'number') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : undefined;
1529
1530 !(length === 0 || length - 1 in obj) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : undefined;
1531
1532 // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
1533 // without method will throw during the slice call and skip straight to the
1534 // fallback.
1535 if (obj.hasOwnProperty) {
1536 try {
1537 return Array.prototype.slice.call(obj);
1538 } catch (e) {
1539 // IE < 9 does not support Array#slice on collections objects
1540 }
1541 }
1542
1543 // Fall back to copying key by key. This assumes all keys have a value,
1544 // so will not preserve sparsely populated inputs.
1545 var ret = Array(length);
1546 for (var ii = 0; ii < length; ii++) {
1547 ret[ii] = obj[ii];
1548 }
1549 return ret;
1550 }
1551
1552 module.exports = toArray;
1553 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
1554
1555/***/ }),
1556/* 14 */
1557/***/ (function(module, exports, __webpack_require__) {
1558
1559 /* WEBPACK VAR INJECTION */(function(process) {/**
1560 * Copyright 2013-2015, Facebook, Inc.
1561 * All rights reserved.
1562 *
1563 * This source code is licensed under the BSD-style license found in the
1564 * LICENSE file in the root directory of this source tree. An additional grant
1565 * of patent rights can be found in the PATENTS file in the same directory.
1566 *
1567 * @providesModule invariant
1568 */
1569
1570 'use strict';
1571
1572 /**
1573 * Use invariant() to assert state which your program assumes to be true.
1574 *
1575 * Provide sprintf-style format (only %s is supported) and arguments
1576 * to provide information about what broke and what you were
1577 * expecting.
1578 *
1579 * The invariant message will be stripped in production, but the invariant
1580 * will remain to ensure logic does not differ in production.
1581 */
1582
1583 function invariant(condition, format, a, b, c, d, e, f) {
1584 if (process.env.NODE_ENV !== 'production') {
1585 if (format === undefined) {
1586 throw new Error('invariant requires an error message argument');
1587 }
1588 }
1589
1590 if (!condition) {
1591 var error;
1592 if (format === undefined) {
1593 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
1594 } else {
1595 var args = [a, b, c, d, e, f];
1596 var argIndex = 0;
1597 error = new Error(format.replace(/%s/g, function () {
1598 return args[argIndex++];
1599 }));
1600 error.name = 'Invariant Violation';
1601 }
1602
1603 error.framesToPop = 1; // we don't care about invariant's own frame
1604 throw error;
1605 }
1606 }
1607
1608 module.exports = invariant;
1609 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
1610
1611/***/ }),
1612/* 15 */
1613/***/ (function(module, exports, __webpack_require__) {
1614
1615 /* WEBPACK VAR INJECTION */(function(process) {/**
1616 * Copyright 2013-2015, Facebook, Inc.
1617 * All rights reserved.
1618 *
1619 * This source code is licensed under the BSD-style license found in the
1620 * LICENSE file in the root directory of this source tree. An additional grant
1621 * of patent rights can be found in the PATENTS file in the same directory.
1622 *
1623 * @providesModule getMarkupWrap
1624 */
1625
1626 /*eslint-disable fb-www/unsafe-html */
1627
1628 'use strict';
1629
1630 var ExecutionEnvironment = __webpack_require__(10);
1631
1632 var invariant = __webpack_require__(14);
1633
1634 /**
1635 * Dummy container used to detect which wraps are necessary.
1636 */
1637 var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
1638
1639 /**
1640 * Some browsers cannot use `innerHTML` to render certain elements standalone,
1641 * so we wrap them, render the wrapped nodes, then extract the desired node.
1642 *
1643 * In IE8, certain elements cannot render alone, so wrap all elements ('*').
1644 */
1645
1646 var shouldWrap = {};
1647
1648 var selectWrap = [1, '<select multiple="true">', '</select>'];
1649 var tableWrap = [1, '<table>', '</table>'];
1650 var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
1651
1652 var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
1653
1654 var markupWrap = {
1655 '*': [1, '?<div>', '</div>'],
1656
1657 'area': [1, '<map>', '</map>'],
1658 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
1659 'legend': [1, '<fieldset>', '</fieldset>'],
1660 'param': [1, '<object>', '</object>'],
1661 'tr': [2, '<table><tbody>', '</tbody></table>'],
1662
1663 'optgroup': selectWrap,
1664 'option': selectWrap,
1665
1666 'caption': tableWrap,
1667 'colgroup': tableWrap,
1668 'tbody': tableWrap,
1669 'tfoot': tableWrap,
1670 'thead': tableWrap,
1671
1672 'td': trWrap,
1673 'th': trWrap
1674 };
1675
1676 // Initialize the SVG elements since we know they'll always need to be wrapped
1677 // consistently. If they are created inside a <div> they will be initialized in
1678 // the wrong namespace (and will not display).
1679 var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
1680 svgElements.forEach(function (nodeName) {
1681 markupWrap[nodeName] = svgWrap;
1682 shouldWrap[nodeName] = true;
1683 });
1684
1685 /**
1686 * Gets the markup wrap configuration for the supplied `nodeName`.
1687 *
1688 * NOTE: This lazily detects which wraps are necessary for the current browser.
1689 *
1690 * @param {string} nodeName Lowercase `nodeName`.
1691 * @return {?array} Markup wrap configuration, if applicable.
1692 */
1693 function getMarkupWrap(nodeName) {
1694 !!!dummyNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : undefined;
1695 if (!markupWrap.hasOwnProperty(nodeName)) {
1696 nodeName = '*';
1697 }
1698 if (!shouldWrap.hasOwnProperty(nodeName)) {
1699 if (nodeName === '*') {
1700 dummyNode.innerHTML = '<link />';
1701 } else {
1702 dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
1703 }
1704 shouldWrap[nodeName] = !dummyNode.firstChild;
1705 }
1706 return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
1707 }
1708
1709 module.exports = getMarkupWrap;
1710 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
1711
1712/***/ }),
1713/* 16 */
1714/***/ (function(module, exports) {
1715
1716 /**
1717 * Copyright 2013-2015, Facebook, Inc.
1718 * All rights reserved.
1719 *
1720 * This source code is licensed under the BSD-style license found in the
1721 * LICENSE file in the root directory of this source tree. An additional grant
1722 * of patent rights can be found in the PATENTS file in the same directory.
1723 *
1724 * @providesModule emptyFunction
1725 */
1726
1727 "use strict";
1728
1729 function makeEmptyFunction(arg) {
1730 return function () {
1731 return arg;
1732 };
1733 }
1734
1735 /**
1736 * This function accepts and discards inputs; it has no side effects. This is
1737 * primarily useful idiomatically for overridable function endpoints which
1738 * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
1739 */
1740 function emptyFunction() {}
1741
1742 emptyFunction.thatReturns = makeEmptyFunction;
1743 emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
1744 emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
1745 emptyFunction.thatReturnsNull = makeEmptyFunction(null);
1746 emptyFunction.thatReturnsThis = function () {
1747 return this;
1748 };
1749 emptyFunction.thatReturnsArgument = function (arg) {
1750 return arg;
1751 };
1752
1753 module.exports = emptyFunction;
1754
1755/***/ }),
1756/* 17 */
1757/***/ (function(module, exports, __webpack_require__) {
1758
1759 /**
1760 * Copyright 2013-2015, Facebook, Inc.
1761 * All rights reserved.
1762 *
1763 * This source code is licensed under the BSD-style license found in the
1764 * LICENSE file in the root directory of this source tree. An additional grant
1765 * of patent rights can be found in the PATENTS file in the same directory.
1766 *
1767 * @providesModule ReactMultiChildUpdateTypes
1768 */
1769
1770 'use strict';
1771
1772 var keyMirror = __webpack_require__(18);
1773
1774 /**
1775 * When a component's children are updated, a series of update configuration
1776 * objects are created in order to batch and serialize the required changes.
1777 *
1778 * Enumerates all the possible types of update configurations.
1779 *
1780 * @internal
1781 */
1782 var ReactMultiChildUpdateTypes = keyMirror({
1783 INSERT_MARKUP: null,
1784 MOVE_EXISTING: null,
1785 REMOVE_NODE: null,
1786 SET_MARKUP: null,
1787 TEXT_CONTENT: null
1788 });
1789
1790 module.exports = ReactMultiChildUpdateTypes;
1791
1792/***/ }),
1793/* 18 */
1794/***/ (function(module, exports, __webpack_require__) {
1795
1796 /* WEBPACK VAR INJECTION */(function(process) {/**
1797 * Copyright 2013-2015, Facebook, Inc.
1798 * All rights reserved.
1799 *
1800 * This source code is licensed under the BSD-style license found in the
1801 * LICENSE file in the root directory of this source tree. An additional grant
1802 * of patent rights can be found in the PATENTS file in the same directory.
1803 *
1804 * @providesModule keyMirror
1805 * @typechecks static-only
1806 */
1807
1808 'use strict';
1809
1810 var invariant = __webpack_require__(14);
1811
1812 /**
1813 * Constructs an enumeration with keys equal to their value.
1814 *
1815 * For example:
1816 *
1817 * var COLORS = keyMirror({blue: null, red: null});
1818 * var myColor = COLORS.blue;
1819 * var isColorValid = !!COLORS[myColor];
1820 *
1821 * The last line could not be performed if the values of the generated enum were
1822 * not equal to their keys.
1823 *
1824 * Input: {key1: val1, key2: val2}
1825 * Output: {key1: key1, key2: key2}
1826 *
1827 * @param {object} obj
1828 * @return {object}
1829 */
1830 var keyMirror = function (obj) {
1831 var ret = {};
1832 var key;
1833 !(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : undefined;
1834 for (key in obj) {
1835 if (!obj.hasOwnProperty(key)) {
1836 continue;
1837 }
1838 ret[key] = key;
1839 }
1840 return ret;
1841 };
1842
1843 module.exports = keyMirror;
1844 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
1845
1846/***/ }),
1847/* 19 */
1848/***/ (function(module, exports, __webpack_require__) {
1849
1850 /* WEBPACK VAR INJECTION */(function(process) {/**
1851 * Copyright 2013-2015, Facebook, Inc.
1852 * All rights reserved.
1853 *
1854 * This source code is licensed under the BSD-style license found in the
1855 * LICENSE file in the root directory of this source tree. An additional grant
1856 * of patent rights can be found in the PATENTS file in the same directory.
1857 *
1858 * @providesModule ReactPerf
1859 * @typechecks static-only
1860 */
1861
1862 'use strict';
1863
1864 /**
1865 * ReactPerf is a general AOP system designed to measure performance. This
1866 * module only has the hooks: see ReactDefaultPerf for the analysis tool.
1867 */
1868 var ReactPerf = {
1869 /**
1870 * Boolean to enable/disable measurement. Set to false by default to prevent
1871 * accidental logging and perf loss.
1872 */
1873 enableMeasure: false,
1874
1875 /**
1876 * Holds onto the measure function in use. By default, don't measure
1877 * anything, but we'll override this if we inject a measure function.
1878 */
1879 storedMeasure: _noMeasure,
1880
1881 /**
1882 * @param {object} object
1883 * @param {string} objectName
1884 * @param {object<string>} methodNames
1885 */
1886 measureMethods: function (object, objectName, methodNames) {
1887 if (process.env.NODE_ENV !== 'production') {
1888 for (var key in methodNames) {
1889 if (!methodNames.hasOwnProperty(key)) {
1890 continue;
1891 }
1892 object[key] = ReactPerf.measure(objectName, methodNames[key], object[key]);
1893 }
1894 }
1895 },
1896
1897 /**
1898 * Use this to wrap methods you want to measure. Zero overhead in production.
1899 *
1900 * @param {string} objName
1901 * @param {string} fnName
1902 * @param {function} func
1903 * @return {function}
1904 */
1905 measure: function (objName, fnName, func) {
1906 if (process.env.NODE_ENV !== 'production') {
1907 var measuredFunc = null;
1908 var wrapper = function () {
1909 if (ReactPerf.enableMeasure) {
1910 if (!measuredFunc) {
1911 measuredFunc = ReactPerf.storedMeasure(objName, fnName, func);
1912 }
1913 return measuredFunc.apply(this, arguments);
1914 }
1915 return func.apply(this, arguments);
1916 };
1917 wrapper.displayName = objName + '_' + fnName;
1918 return wrapper;
1919 }
1920 return func;
1921 },
1922
1923 injection: {
1924 /**
1925 * @param {function} measure
1926 */
1927 injectMeasure: function (measure) {
1928 ReactPerf.storedMeasure = measure;
1929 }
1930 }
1931 };
1932
1933 /**
1934 * Simply passes through the measured function, without measuring it.
1935 *
1936 * @param {string} objName
1937 * @param {string} fnName
1938 * @param {function} func
1939 * @return {function}
1940 */
1941 function _noMeasure(objName, fnName, func) {
1942 return func;
1943 }
1944
1945 module.exports = ReactPerf;
1946 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
1947
1948/***/ }),
1949/* 20 */
1950/***/ (function(module, exports, __webpack_require__) {
1951
1952 /**
1953 * Copyright 2013-2015, Facebook, Inc.
1954 * All rights reserved.
1955 *
1956 * This source code is licensed under the BSD-style license found in the
1957 * LICENSE file in the root directory of this source tree. An additional grant
1958 * of patent rights can be found in the PATENTS file in the same directory.
1959 *
1960 * @providesModule setInnerHTML
1961 */
1962
1963 /* globals MSApp */
1964
1965 'use strict';
1966
1967 var ExecutionEnvironment = __webpack_require__(10);
1968
1969 var WHITESPACE_TEST = /^[ \r\n\t\f]/;
1970 var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
1971
1972 /**
1973 * Set the innerHTML property of a node, ensuring that whitespace is preserved
1974 * even in IE8.
1975 *
1976 * @param {DOMElement} node
1977 * @param {string} html
1978 * @internal
1979 */
1980 var setInnerHTML = function (node, html) {
1981 node.innerHTML = html;
1982 };
1983
1984 // Win8 apps: Allow all html to be inserted
1985 if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
1986 setInnerHTML = function (node, html) {
1987 MSApp.execUnsafeLocalFunction(function () {
1988 node.innerHTML = html;
1989 });
1990 };
1991 }
1992
1993 if (ExecutionEnvironment.canUseDOM) {
1994 // IE8: When updating a just created node with innerHTML only leading
1995 // whitespace is removed. When updating an existing node with innerHTML
1996 // whitespace in root TextNodes is also collapsed.
1997 // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
1998
1999 // Feature detection; only IE8 is known to behave improperly like this.
2000 var testElement = document.createElement('div');
2001 testElement.innerHTML = ' ';
2002 if (testElement.innerHTML === '') {
2003 setInnerHTML = function (node, html) {
2004 // Magic theory: IE8 supposedly differentiates between added and updated
2005 // nodes when processing innerHTML, innerHTML on updated nodes suffers
2006 // from worse whitespace behavior. Re-adding a node like this triggers
2007 // the initial and more favorable whitespace behavior.
2008 // TODO: What to do on a detached node?
2009 if (node.parentNode) {
2010 node.parentNode.replaceChild(node, node);
2011 }
2012
2013 // We also implement a workaround for non-visible tags disappearing into
2014 // thin air on IE8, this only happens if there is no visible text
2015 // in-front of the non-visible tags. Piggyback on the whitespace fix
2016 // and simply check if any non-visible tags appear in the source.
2017 if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
2018 // Recover leading whitespace by temporarily prepending any character.
2019 // \uFEFF has the potential advantage of being zero-width/invisible.
2020 // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
2021 // in hopes that this is preserved even if "\uFEFF" is transformed to
2022 // the actual Unicode character (by Babel, for example).
2023 // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
2024 node.innerHTML = String.fromCharCode(0xFEFF) + html;
2025
2026 // deleteData leaves an empty `TextNode` which offsets the index of all
2027 // children. Definitely want to avoid this.
2028 var textNode = node.firstChild;
2029 if (textNode.data.length === 1) {
2030 node.removeChild(textNode);
2031 } else {
2032 textNode.deleteData(0, 1);
2033 }
2034 } else {
2035 node.innerHTML = html;
2036 }
2037 };
2038 }
2039 }
2040
2041 module.exports = setInnerHTML;
2042
2043/***/ }),
2044/* 21 */
2045/***/ (function(module, exports, __webpack_require__) {
2046
2047 /**
2048 * Copyright 2013-2015, Facebook, Inc.
2049 * All rights reserved.
2050 *
2051 * This source code is licensed under the BSD-style license found in the
2052 * LICENSE file in the root directory of this source tree. An additional grant
2053 * of patent rights can be found in the PATENTS file in the same directory.
2054 *
2055 * @providesModule setTextContent
2056 */
2057
2058 'use strict';
2059
2060 var ExecutionEnvironment = __webpack_require__(10);
2061 var escapeTextContentForBrowser = __webpack_require__(22);
2062 var setInnerHTML = __webpack_require__(20);
2063
2064 /**
2065 * Set the textContent property of a node, ensuring that whitespace is preserved
2066 * even in IE8. innerText is a poor substitute for textContent and, among many
2067 * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
2068 * as it should.
2069 *
2070 * @param {DOMElement} node
2071 * @param {string} text
2072 * @internal
2073 */
2074 var setTextContent = function (node, text) {
2075 node.textContent = text;
2076 };
2077
2078 if (ExecutionEnvironment.canUseDOM) {
2079 if (!('textContent' in document.documentElement)) {
2080 setTextContent = function (node, text) {
2081 setInnerHTML(node, escapeTextContentForBrowser(text));
2082 };
2083 }
2084 }
2085
2086 module.exports = setTextContent;
2087
2088/***/ }),
2089/* 22 */
2090/***/ (function(module, exports) {
2091
2092 /**
2093 * Copyright 2013-2015, Facebook, Inc.
2094 * All rights reserved.
2095 *
2096 * This source code is licensed under the BSD-style license found in the
2097 * LICENSE file in the root directory of this source tree. An additional grant
2098 * of patent rights can be found in the PATENTS file in the same directory.
2099 *
2100 * @providesModule escapeTextContentForBrowser
2101 */
2102
2103 'use strict';
2104
2105 var ESCAPE_LOOKUP = {
2106 '&': '&amp;',
2107 '>': '&gt;',
2108 '<': '&lt;',
2109 '"': '&quot;',
2110 '\'': '&#x27;'
2111 };
2112
2113 var ESCAPE_REGEX = /[&><"']/g;
2114
2115 function escaper(match) {
2116 return ESCAPE_LOOKUP[match];
2117 }
2118
2119 /**
2120 * Escapes text to prevent scripting attacks.
2121 *
2122 * @param {*} text Text value to escape.
2123 * @return {string} An escaped string.
2124 */
2125 function escapeTextContentForBrowser(text) {
2126 return ('' + text).replace(ESCAPE_REGEX, escaper);
2127 }
2128
2129 module.exports = escapeTextContentForBrowser;
2130
2131/***/ }),
2132/* 23 */
2133/***/ (function(module, exports, __webpack_require__) {
2134
2135 /* WEBPACK VAR INJECTION */(function(process) {/**
2136 * Copyright 2013-2015, Facebook, Inc.
2137 * All rights reserved.
2138 *
2139 * This source code is licensed under the BSD-style license found in the
2140 * LICENSE file in the root directory of this source tree. An additional grant
2141 * of patent rights can be found in the PATENTS file in the same directory.
2142 *
2143 * @providesModule DOMPropertyOperations
2144 * @typechecks static-only
2145 */
2146
2147 'use strict';
2148
2149 var DOMProperty = __webpack_require__(24);
2150 var ReactPerf = __webpack_require__(19);
2151
2152 var quoteAttributeValueForBrowser = __webpack_require__(25);
2153 var warning = __webpack_require__(26);
2154
2155 // Simplified subset
2156 var VALID_ATTRIBUTE_NAME_REGEX = /^[a-zA-Z_][\w\.\-]*$/;
2157 var illegalAttributeNameCache = {};
2158 var validatedAttributeNameCache = {};
2159
2160 function isAttributeNameSafe(attributeName) {
2161 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
2162 return true;
2163 }
2164 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
2165 return false;
2166 }
2167 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
2168 validatedAttributeNameCache[attributeName] = true;
2169 return true;
2170 }
2171 illegalAttributeNameCache[attributeName] = true;
2172 process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : undefined;
2173 return false;
2174 }
2175
2176 function shouldIgnoreValue(propertyInfo, value) {
2177 return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
2178 }
2179
2180 if (process.env.NODE_ENV !== 'production') {
2181 var reactProps = {
2182 children: true,
2183 dangerouslySetInnerHTML: true,
2184 key: true,
2185 ref: true
2186 };
2187 var warnedProperties = {};
2188
2189 var warnUnknownProperty = function (name) {
2190 if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
2191 return;
2192 }
2193
2194 warnedProperties[name] = true;
2195 var lowerCasedName = name.toLowerCase();
2196
2197 // data-* attributes should be lowercase; suggest the lowercase version
2198 var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
2199
2200 // For now, only warn when we have a suggested correction. This prevents
2201 // logging too much when using transferPropsTo.
2202 process.env.NODE_ENV !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : undefined;
2203 };
2204 }
2205
2206 /**
2207 * Operations for dealing with DOM properties.
2208 */
2209 var DOMPropertyOperations = {
2210
2211 /**
2212 * Creates markup for the ID property.
2213 *
2214 * @param {string} id Unescaped ID.
2215 * @return {string} Markup string.
2216 */
2217 createMarkupForID: function (id) {
2218 return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
2219 },
2220
2221 setAttributeForID: function (node, id) {
2222 node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
2223 },
2224
2225 /**
2226 * Creates markup for a property.
2227 *
2228 * @param {string} name
2229 * @param {*} value
2230 * @return {?string} Markup string, or null if the property was invalid.
2231 */
2232 createMarkupForProperty: function (name, value) {
2233 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
2234 if (propertyInfo) {
2235 if (shouldIgnoreValue(propertyInfo, value)) {
2236 return '';
2237 }
2238 var attributeName = propertyInfo.attributeName;
2239 if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
2240 return attributeName + '=""';
2241 }
2242 return attributeName + '=' + quoteAttributeValueForBrowser(value);
2243 } else if (DOMProperty.isCustomAttribute(name)) {
2244 if (value == null) {
2245 return '';
2246 }
2247 return name + '=' + quoteAttributeValueForBrowser(value);
2248 } else if (process.env.NODE_ENV !== 'production') {
2249 warnUnknownProperty(name);
2250 }
2251 return null;
2252 },
2253
2254 /**
2255 * Creates markup for a custom property.
2256 *
2257 * @param {string} name
2258 * @param {*} value
2259 * @return {string} Markup string, or empty string if the property was invalid.
2260 */
2261 createMarkupForCustomAttribute: function (name, value) {
2262 if (!isAttributeNameSafe(name) || value == null) {
2263 return '';
2264 }
2265 return name + '=' + quoteAttributeValueForBrowser(value);
2266 },
2267
2268 /**
2269 * Sets the value for a property on a node.
2270 *
2271 * @param {DOMElement} node
2272 * @param {string} name
2273 * @param {*} value
2274 */
2275 setValueForProperty: function (node, name, value) {
2276 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
2277 if (propertyInfo) {
2278 var mutationMethod = propertyInfo.mutationMethod;
2279 if (mutationMethod) {
2280 mutationMethod(node, value);
2281 } else if (shouldIgnoreValue(propertyInfo, value)) {
2282 this.deleteValueForProperty(node, name);
2283 } else if (propertyInfo.mustUseAttribute) {
2284 var attributeName = propertyInfo.attributeName;
2285 var namespace = propertyInfo.attributeNamespace;
2286 // `setAttribute` with objects becomes only `[object]` in IE8/9,
2287 // ('' + value) makes it output the correct toString()-value.
2288 if (namespace) {
2289 node.setAttributeNS(namespace, attributeName, '' + value);
2290 } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
2291 node.setAttribute(attributeName, '');
2292 } else {
2293 node.setAttribute(attributeName, '' + value);
2294 }
2295 } else {
2296 var propName = propertyInfo.propertyName;
2297 // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the
2298 // property type before comparing; only `value` does and is string.
2299 if (!propertyInfo.hasSideEffects || '' + node[propName] !== '' + value) {
2300 // Contrary to `setAttribute`, object properties are properly
2301 // `toString`ed by IE8/9.
2302 node[propName] = value;
2303 }
2304 }
2305 } else if (DOMProperty.isCustomAttribute(name)) {
2306 DOMPropertyOperations.setValueForAttribute(node, name, value);
2307 } else if (process.env.NODE_ENV !== 'production') {
2308 warnUnknownProperty(name);
2309 }
2310 },
2311
2312 setValueForAttribute: function (node, name, value) {
2313 if (!isAttributeNameSafe(name)) {
2314 return;
2315 }
2316 if (value == null) {
2317 node.removeAttribute(name);
2318 } else {
2319 node.setAttribute(name, '' + value);
2320 }
2321 },
2322
2323 /**
2324 * Deletes the value for a property on a node.
2325 *
2326 * @param {DOMElement} node
2327 * @param {string} name
2328 */
2329 deleteValueForProperty: function (node, name) {
2330 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
2331 if (propertyInfo) {
2332 var mutationMethod = propertyInfo.mutationMethod;
2333 if (mutationMethod) {
2334 mutationMethod(node, undefined);
2335 } else if (propertyInfo.mustUseAttribute) {
2336 node.removeAttribute(propertyInfo.attributeName);
2337 } else {
2338 var propName = propertyInfo.propertyName;
2339 var defaultValue = DOMProperty.getDefaultValueForProperty(node.nodeName, propName);
2340 if (!propertyInfo.hasSideEffects || '' + node[propName] !== defaultValue) {
2341 node[propName] = defaultValue;
2342 }
2343 }
2344 } else if (DOMProperty.isCustomAttribute(name)) {
2345 node.removeAttribute(name);
2346 } else if (process.env.NODE_ENV !== 'production') {
2347 warnUnknownProperty(name);
2348 }
2349 }
2350
2351 };
2352
2353 ReactPerf.measureMethods(DOMPropertyOperations, 'DOMPropertyOperations', {
2354 setValueForProperty: 'setValueForProperty',
2355 setValueForAttribute: 'setValueForAttribute',
2356 deleteValueForProperty: 'deleteValueForProperty'
2357 });
2358
2359 module.exports = DOMPropertyOperations;
2360 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
2361
2362/***/ }),
2363/* 24 */
2364/***/ (function(module, exports, __webpack_require__) {
2365
2366 /* WEBPACK VAR INJECTION */(function(process) {/**
2367 * Copyright 2013-2015, Facebook, Inc.
2368 * All rights reserved.
2369 *
2370 * This source code is licensed under the BSD-style license found in the
2371 * LICENSE file in the root directory of this source tree. An additional grant
2372 * of patent rights can be found in the PATENTS file in the same directory.
2373 *
2374 * @providesModule DOMProperty
2375 * @typechecks static-only
2376 */
2377
2378 'use strict';
2379
2380 var invariant = __webpack_require__(14);
2381
2382 function checkMask(value, bitmask) {
2383 return (value & bitmask) === bitmask;
2384 }
2385
2386 var DOMPropertyInjection = {
2387 /**
2388 * Mapping from normalized, camelcased property names to a configuration that
2389 * specifies how the associated DOM property should be accessed or rendered.
2390 */
2391 MUST_USE_ATTRIBUTE: 0x1,
2392 MUST_USE_PROPERTY: 0x2,
2393 HAS_SIDE_EFFECTS: 0x4,
2394 HAS_BOOLEAN_VALUE: 0x8,
2395 HAS_NUMERIC_VALUE: 0x10,
2396 HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10,
2397 HAS_OVERLOADED_BOOLEAN_VALUE: 0x40,
2398
2399 /**
2400 * Inject some specialized knowledge about the DOM. This takes a config object
2401 * with the following properties:
2402 *
2403 * isCustomAttribute: function that given an attribute name will return true
2404 * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
2405 * attributes where it's impossible to enumerate all of the possible
2406 * attribute names,
2407 *
2408 * Properties: object mapping DOM property name to one of the
2409 * DOMPropertyInjection constants or null. If your attribute isn't in here,
2410 * it won't get written to the DOM.
2411 *
2412 * DOMAttributeNames: object mapping React attribute name to the DOM
2413 * attribute name. Attribute names not specified use the **lowercase**
2414 * normalized name.
2415 *
2416 * DOMAttributeNamespaces: object mapping React attribute name to the DOM
2417 * attribute namespace URL. (Attribute names not specified use no namespace.)
2418 *
2419 * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
2420 * Property names not specified use the normalized name.
2421 *
2422 * DOMMutationMethods: Properties that require special mutation methods. If
2423 * `value` is undefined, the mutation method should unset the property.
2424 *
2425 * @param {object} domPropertyConfig the config as described above.
2426 */
2427 injectDOMPropertyConfig: function (domPropertyConfig) {
2428 var Injection = DOMPropertyInjection;
2429 var Properties = domPropertyConfig.Properties || {};
2430 var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
2431 var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
2432 var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
2433 var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
2434
2435 if (domPropertyConfig.isCustomAttribute) {
2436 DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
2437 }
2438
2439 for (var propName in Properties) {
2440 !!DOMProperty.properties.hasOwnProperty(propName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + '\'%s\' which has already been injected. You may be accidentally ' + 'injecting the same DOM property config twice, or you may be ' + 'injecting two configs that have conflicting property names.', propName) : invariant(false) : undefined;
2441
2442 var lowerCased = propName.toLowerCase();
2443 var propConfig = Properties[propName];
2444
2445 var propertyInfo = {
2446 attributeName: lowerCased,
2447 attributeNamespace: null,
2448 propertyName: propName,
2449 mutationMethod: null,
2450
2451 mustUseAttribute: checkMask(propConfig, Injection.MUST_USE_ATTRIBUTE),
2452 mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
2453 hasSideEffects: checkMask(propConfig, Injection.HAS_SIDE_EFFECTS),
2454 hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
2455 hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
2456 hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
2457 hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
2458 };
2459
2460 !(!propertyInfo.mustUseAttribute || !propertyInfo.mustUseProperty) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Cannot require using both attribute and property: %s', propName) : invariant(false) : undefined;
2461 !(propertyInfo.mustUseProperty || !propertyInfo.hasSideEffects) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Properties that have side effects must use property: %s', propName) : invariant(false) : undefined;
2462 !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + 'numeric value, but not a combination: %s', propName) : invariant(false) : undefined;
2463
2464 if (process.env.NODE_ENV !== 'production') {
2465 DOMProperty.getPossibleStandardName[lowerCased] = propName;
2466 }
2467
2468 if (DOMAttributeNames.hasOwnProperty(propName)) {
2469 var attributeName = DOMAttributeNames[propName];
2470 propertyInfo.attributeName = attributeName;
2471 if (process.env.NODE_ENV !== 'production') {
2472 DOMProperty.getPossibleStandardName[attributeName] = propName;
2473 }
2474 }
2475
2476 if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
2477 propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
2478 }
2479
2480 if (DOMPropertyNames.hasOwnProperty(propName)) {
2481 propertyInfo.propertyName = DOMPropertyNames[propName];
2482 }
2483
2484 if (DOMMutationMethods.hasOwnProperty(propName)) {
2485 propertyInfo.mutationMethod = DOMMutationMethods[propName];
2486 }
2487
2488 DOMProperty.properties[propName] = propertyInfo;
2489 }
2490 }
2491 };
2492 var defaultValueCache = {};
2493
2494 /**
2495 * DOMProperty exports lookup objects that can be used like functions:
2496 *
2497 * > DOMProperty.isValid['id']
2498 * true
2499 * > DOMProperty.isValid['foobar']
2500 * undefined
2501 *
2502 * Although this may be confusing, it performs better in general.
2503 *
2504 * @see http://jsperf.com/key-exists
2505 * @see http://jsperf.com/key-missing
2506 */
2507 var DOMProperty = {
2508
2509 ID_ATTRIBUTE_NAME: 'data-reactid',
2510
2511 /**
2512 * Map from property "standard name" to an object with info about how to set
2513 * the property in the DOM. Each object contains:
2514 *
2515 * attributeName:
2516 * Used when rendering markup or with `*Attribute()`.
2517 * attributeNamespace
2518 * propertyName:
2519 * Used on DOM node instances. (This includes properties that mutate due to
2520 * external factors.)
2521 * mutationMethod:
2522 * If non-null, used instead of the property or `setAttribute()` after
2523 * initial render.
2524 * mustUseAttribute:
2525 * Whether the property must be accessed and mutated using `*Attribute()`.
2526 * (This includes anything that fails `<propName> in <element>`.)
2527 * mustUseProperty:
2528 * Whether the property must be accessed and mutated as an object property.
2529 * hasSideEffects:
2530 * Whether or not setting a value causes side effects such as triggering
2531 * resources to be loaded or text selection changes. If true, we read from
2532 * the DOM before updating to ensure that the value is only set if it has
2533 * changed.
2534 * hasBooleanValue:
2535 * Whether the property should be removed when set to a falsey value.
2536 * hasNumericValue:
2537 * Whether the property must be numeric or parse as a numeric and should be
2538 * removed when set to a falsey value.
2539 * hasPositiveNumericValue:
2540 * Whether the property must be positive numeric or parse as a positive
2541 * numeric and should be removed when set to a falsey value.
2542 * hasOverloadedBooleanValue:
2543 * Whether the property can be used as a flag as well as with a value.
2544 * Removed when strictly equal to false; present without a value when
2545 * strictly equal to true; present with a value otherwise.
2546 */
2547 properties: {},
2548
2549 /**
2550 * Mapping from lowercase property names to the properly cased version, used
2551 * to warn in the case of missing properties. Available only in __DEV__.
2552 * @type {Object}
2553 */
2554 getPossibleStandardName: process.env.NODE_ENV !== 'production' ? {} : null,
2555
2556 /**
2557 * All of the isCustomAttribute() functions that have been injected.
2558 */
2559 _isCustomAttributeFunctions: [],
2560
2561 /**
2562 * Checks whether a property name is a custom attribute.
2563 * @method
2564 */
2565 isCustomAttribute: function (attributeName) {
2566 for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
2567 var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
2568 if (isCustomAttributeFn(attributeName)) {
2569 return true;
2570 }
2571 }
2572 return false;
2573 },
2574
2575 /**
2576 * Returns the default property value for a DOM property (i.e., not an
2577 * attribute). Most default values are '' or false, but not all. Worse yet,
2578 * some (in particular, `type`) vary depending on the type of element.
2579 *
2580 * TODO: Is it better to grab all the possible properties when creating an
2581 * element to avoid having to create the same element twice?
2582 */
2583 getDefaultValueForProperty: function (nodeName, prop) {
2584 var nodeDefaults = defaultValueCache[nodeName];
2585 var testElement;
2586 if (!nodeDefaults) {
2587 defaultValueCache[nodeName] = nodeDefaults = {};
2588 }
2589 if (!(prop in nodeDefaults)) {
2590 testElement = document.createElement(nodeName);
2591 nodeDefaults[prop] = testElement[prop];
2592 }
2593 return nodeDefaults[prop];
2594 },
2595
2596 injection: DOMPropertyInjection
2597 };
2598
2599 module.exports = DOMProperty;
2600 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
2601
2602/***/ }),
2603/* 25 */
2604/***/ (function(module, exports, __webpack_require__) {
2605
2606 /**
2607 * Copyright 2013-2015, Facebook, Inc.
2608 * All rights reserved.
2609 *
2610 * This source code is licensed under the BSD-style license found in the
2611 * LICENSE file in the root directory of this source tree. An additional grant
2612 * of patent rights can be found in the PATENTS file in the same directory.
2613 *
2614 * @providesModule quoteAttributeValueForBrowser
2615 */
2616
2617 'use strict';
2618
2619 var escapeTextContentForBrowser = __webpack_require__(22);
2620
2621 /**
2622 * Escapes attribute value to prevent scripting attacks.
2623 *
2624 * @param {*} value Value to escape.
2625 * @return {string} An escaped string.
2626 */
2627 function quoteAttributeValueForBrowser(value) {
2628 return '"' + escapeTextContentForBrowser(value) + '"';
2629 }
2630
2631 module.exports = quoteAttributeValueForBrowser;
2632
2633/***/ }),
2634/* 26 */
2635/***/ (function(module, exports, __webpack_require__) {
2636
2637 /* WEBPACK VAR INJECTION */(function(process) {/**
2638 * Copyright 2014-2015, Facebook, Inc.
2639 * All rights reserved.
2640 *
2641 * This source code is licensed under the BSD-style license found in the
2642 * LICENSE file in the root directory of this source tree. An additional grant
2643 * of patent rights can be found in the PATENTS file in the same directory.
2644 *
2645 * @providesModule warning
2646 */
2647
2648 'use strict';
2649
2650 var emptyFunction = __webpack_require__(16);
2651
2652 /**
2653 * Similar to invariant but only logs a warning if the condition is not met.
2654 * This can be used to log issues in development environments in critical
2655 * paths. Removing the logging code for production environments will keep the
2656 * same logic and follow the same code paths.
2657 */
2658
2659 var warning = emptyFunction;
2660
2661 if (process.env.NODE_ENV !== 'production') {
2662 warning = function (condition, format) {
2663 for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
2664 args[_key - 2] = arguments[_key];
2665 }
2666
2667 if (format === undefined) {
2668 throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
2669 }
2670
2671 if (format.indexOf('Failed Composite propType: ') === 0) {
2672 return; // Ignore CompositeComponent proptype check.
2673 }
2674
2675 if (!condition) {
2676 var argIndex = 0;
2677 var message = 'Warning: ' + format.replace(/%s/g, function () {
2678 return args[argIndex++];
2679 });
2680 if (typeof console !== 'undefined') {
2681 console.error(message);
2682 }
2683 try {
2684 // --- Welcome to debugging React ---
2685 // This error was thrown as a convenience so that you can use this stack
2686 // to find the callsite that caused this warning to fire.
2687 throw new Error(message);
2688 } catch (x) {}
2689 }
2690 };
2691 }
2692
2693 module.exports = warning;
2694 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
2695
2696/***/ }),
2697/* 27 */
2698/***/ (function(module, exports, __webpack_require__) {
2699
2700 /**
2701 * Copyright 2013-2015, Facebook, Inc.
2702 * All rights reserved.
2703 *
2704 * This source code is licensed under the BSD-style license found in the
2705 * LICENSE file in the root directory of this source tree. An additional grant
2706 * of patent rights can be found in the PATENTS file in the same directory.
2707 *
2708 * @providesModule ReactComponentBrowserEnvironment
2709 */
2710
2711 'use strict';
2712
2713 var ReactDOMIDOperations = __webpack_require__(28);
2714 var ReactMount = __webpack_require__(29);
2715
2716 /**
2717 * Abstracts away all functionality of the reconciler that requires knowledge of
2718 * the browser context. TODO: These callers should be refactored to avoid the
2719 * need for this injection.
2720 */
2721 var ReactComponentBrowserEnvironment = {
2722
2723 processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
2724
2725 replaceNodeWithMarkupByID: ReactDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID,
2726
2727 /**
2728 * If a particular environment requires that some resources be cleaned up,
2729 * specify this in the injected Mixin. In the DOM, we would likely want to
2730 * purge any cached node ID lookups.
2731 *
2732 * @private
2733 */
2734 unmountIDFromEnvironment: function (rootNodeID) {
2735 ReactMount.purgeID(rootNodeID);
2736 }
2737
2738 };
2739
2740 module.exports = ReactComponentBrowserEnvironment;
2741
2742/***/ }),
2743/* 28 */
2744/***/ (function(module, exports, __webpack_require__) {
2745
2746 /* WEBPACK VAR INJECTION */(function(process) {/**
2747 * Copyright 2013-2015, Facebook, Inc.
2748 * All rights reserved.
2749 *
2750 * This source code is licensed under the BSD-style license found in the
2751 * LICENSE file in the root directory of this source tree. An additional grant
2752 * of patent rights can be found in the PATENTS file in the same directory.
2753 *
2754 * @providesModule ReactDOMIDOperations
2755 * @typechecks static-only
2756 */
2757
2758 'use strict';
2759
2760 var DOMChildrenOperations = __webpack_require__(8);
2761 var DOMPropertyOperations = __webpack_require__(23);
2762 var ReactMount = __webpack_require__(29);
2763 var ReactPerf = __webpack_require__(19);
2764
2765 var invariant = __webpack_require__(14);
2766
2767 /**
2768 * Errors for properties that should not be updated with `updatePropertyByID()`.
2769 *
2770 * @type {object}
2771 * @private
2772 */
2773 var INVALID_PROPERTY_ERRORS = {
2774 dangerouslySetInnerHTML: '`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.',
2775 style: '`style` must be set using `updateStylesByID()`.'
2776 };
2777
2778 /**
2779 * Operations used to process updates to DOM nodes.
2780 */
2781 var ReactDOMIDOperations = {
2782
2783 /**
2784 * Updates a DOM node with new property values. This should only be used to
2785 * update DOM properties in `DOMProperty`.
2786 *
2787 * @param {string} id ID of the node to update.
2788 * @param {string} name A valid property name, see `DOMProperty`.
2789 * @param {*} value New value of the property.
2790 * @internal
2791 */
2792 updatePropertyByID: function (id, name, value) {
2793 var node = ReactMount.getNode(id);
2794 !!INVALID_PROPERTY_ERRORS.hasOwnProperty(name) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'updatePropertyByID(...): %s', INVALID_PROPERTY_ERRORS[name]) : invariant(false) : undefined;
2795
2796 // If we're updating to null or undefined, we should remove the property
2797 // from the DOM node instead of inadvertantly setting to a string. This
2798 // brings us in line with the same behavior we have on initial render.
2799 if (value != null) {
2800 DOMPropertyOperations.setValueForProperty(node, name, value);
2801 } else {
2802 DOMPropertyOperations.deleteValueForProperty(node, name);
2803 }
2804 },
2805
2806 /**
2807 * Replaces a DOM node that exists in the document with markup.
2808 *
2809 * @param {string} id ID of child to be replaced.
2810 * @param {string} markup Dangerous markup to inject in place of child.
2811 * @internal
2812 * @see {Danger.dangerouslyReplaceNodeWithMarkup}
2813 */
2814 dangerouslyReplaceNodeWithMarkupByID: function (id, markup) {
2815 var node = ReactMount.getNode(id);
2816 DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup);
2817 },
2818
2819 /**
2820 * Updates a component's children by processing a series of updates.
2821 *
2822 * @param {array<object>} updates List of update configurations.
2823 * @param {array<string>} markup List of markup strings.
2824 * @internal
2825 */
2826 dangerouslyProcessChildrenUpdates: function (updates, markup) {
2827 for (var i = 0; i < updates.length; i++) {
2828 updates[i].parentNode = ReactMount.getNode(updates[i].parentID);
2829 }
2830 DOMChildrenOperations.processUpdates(updates, markup);
2831 }
2832 };
2833
2834 ReactPerf.measureMethods(ReactDOMIDOperations, 'ReactDOMIDOperations', {
2835 dangerouslyReplaceNodeWithMarkupByID: 'dangerouslyReplaceNodeWithMarkupByID',
2836 dangerouslyProcessChildrenUpdates: 'dangerouslyProcessChildrenUpdates'
2837 });
2838
2839 module.exports = ReactDOMIDOperations;
2840 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
2841
2842/***/ }),
2843/* 29 */
2844/***/ (function(module, exports, __webpack_require__) {
2845
2846 /* WEBPACK VAR INJECTION */(function(process) {/**
2847 * Copyright 2013-2015, Facebook, Inc.
2848 * All rights reserved.
2849 *
2850 * This source code is licensed under the BSD-style license found in the
2851 * LICENSE file in the root directory of this source tree. An additional grant
2852 * of patent rights can be found in the PATENTS file in the same directory.
2853 *
2854 * @providesModule ReactMount
2855 */
2856
2857 'use strict';
2858
2859 var DOMProperty = __webpack_require__(24);
2860 var ReactBrowserEventEmitter = __webpack_require__(30);
2861 var ReactCurrentOwner = __webpack_require__(6);
2862 var ReactDOMFeatureFlags = __webpack_require__(42);
2863 var ReactElement = __webpack_require__(43);
2864 var ReactEmptyComponentRegistry = __webpack_require__(45);
2865 var ReactInstanceHandles = __webpack_require__(46);
2866 var ReactInstanceMap = __webpack_require__(48);
2867 var ReactMarkupChecksum = __webpack_require__(49);
2868 var ReactPerf = __webpack_require__(19);
2869 var ReactReconciler = __webpack_require__(51);
2870 var ReactUpdateQueue = __webpack_require__(54);
2871 var ReactUpdates = __webpack_require__(55);
2872
2873 var assign = __webpack_require__(40);
2874 var emptyObject = __webpack_require__(59);
2875 var containsNode = __webpack_require__(60);
2876 var instantiateReactComponent = __webpack_require__(63);
2877 var invariant = __webpack_require__(14);
2878 var setInnerHTML = __webpack_require__(20);
2879 var shouldUpdateReactComponent = __webpack_require__(68);
2880 var validateDOMNesting = __webpack_require__(71);
2881 var warning = __webpack_require__(26);
2882
2883 var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
2884 var nodeCache = {};
2885
2886 var ELEMENT_NODE_TYPE = 1;
2887 var DOC_NODE_TYPE = 9;
2888 var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
2889
2890 var ownerDocumentContextKey = '__ReactMount_ownerDocument$' + Math.random().toString(36).slice(2);
2891
2892 /** Mapping from reactRootID to React component instance. */
2893 var instancesByReactRootID = {};
2894
2895 /** Mapping from reactRootID to `container` nodes. */
2896 var containersByReactRootID = {};
2897
2898 if (process.env.NODE_ENV !== 'production') {
2899 /** __DEV__-only mapping from reactRootID to root elements. */
2900 var rootElementsByReactRootID = {};
2901 }
2902
2903 // Used to store breadth-first search state in findComponentRoot.
2904 var findComponentRootReusableArray = [];
2905
2906 /**
2907 * Finds the index of the first character
2908 * that's not common between the two given strings.
2909 *
2910 * @return {number} the index of the character where the strings diverge
2911 */
2912 function firstDifferenceIndex(string1, string2) {
2913 var minLen = Math.min(string1.length, string2.length);
2914 for (var i = 0; i < minLen; i++) {
2915 if (string1.charAt(i) !== string2.charAt(i)) {
2916 return i;
2917 }
2918 }
2919 return string1.length === string2.length ? -1 : minLen;
2920 }
2921
2922 /**
2923 * @param {DOMElement|DOMDocument} container DOM element that may contain
2924 * a React component
2925 * @return {?*} DOM element that may have the reactRoot ID, or null.
2926 */
2927 function getReactRootElementInContainer(container) {
2928 if (!container) {
2929 return null;
2930 }
2931
2932 if (container.nodeType === DOC_NODE_TYPE) {
2933 return container.documentElement;
2934 } else {
2935 return container.firstChild;
2936 }
2937 }
2938
2939 /**
2940 * @param {DOMElement} container DOM element that may contain a React component.
2941 * @return {?string} A "reactRoot" ID, if a React component is rendered.
2942 */
2943 function getReactRootID(container) {
2944 var rootElement = getReactRootElementInContainer(container);
2945 return rootElement && ReactMount.getID(rootElement);
2946 }
2947
2948 /**
2949 * Accessing node[ATTR_NAME] or calling getAttribute(ATTR_NAME) on a form
2950 * element can return its control whose name or ID equals ATTR_NAME. All
2951 * DOM nodes support `getAttributeNode` but this can also get called on
2952 * other objects so just return '' if we're given something other than a
2953 * DOM node (such as window).
2954 *
2955 * @param {?DOMElement|DOMWindow|DOMDocument|DOMTextNode} node DOM node.
2956 * @return {string} ID of the supplied `domNode`.
2957 */
2958 function getID(node) {
2959 var id = internalGetID(node);
2960 if (id) {
2961 if (nodeCache.hasOwnProperty(id)) {
2962 var cached = nodeCache[id];
2963 if (cached !== node) {
2964 !!isValid(cached, id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Two valid but unequal nodes with the same `%s`: %s', ATTR_NAME, id) : invariant(false) : undefined;
2965
2966 nodeCache[id] = node;
2967 }
2968 } else {
2969 nodeCache[id] = node;
2970 }
2971 }
2972
2973 return id;
2974 }
2975
2976 function internalGetID(node) {
2977 // If node is something like a window, document, or text node, none of
2978 // which support attributes or a .getAttribute method, gracefully return
2979 // the empty string, as if the attribute were missing.
2980 return node && node.getAttribute && node.getAttribute(ATTR_NAME) || '';
2981 }
2982
2983 /**
2984 * Sets the React-specific ID of the given node.
2985 *
2986 * @param {DOMElement} node The DOM node whose ID will be set.
2987 * @param {string} id The value of the ID attribute.
2988 */
2989 function setID(node, id) {
2990 var oldID = internalGetID(node);
2991 if (oldID !== id) {
2992 delete nodeCache[oldID];
2993 }
2994 node.setAttribute(ATTR_NAME, id);
2995 nodeCache[id] = node;
2996 }
2997
2998 /**
2999 * Finds the node with the supplied React-generated DOM ID.
3000 *
3001 * @param {string} id A React-generated DOM ID.
3002 * @return {DOMElement} DOM node with the suppled `id`.
3003 * @internal
3004 */
3005 function getNode(id) {
3006 if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) {
3007 nodeCache[id] = ReactMount.findReactNodeByID(id);
3008 }
3009 return nodeCache[id];
3010 }
3011
3012 /**
3013 * Finds the node with the supplied public React instance.
3014 *
3015 * @param {*} instance A public React instance.
3016 * @return {?DOMElement} DOM node with the suppled `id`.
3017 * @internal
3018 */
3019 function getNodeFromInstance(instance) {
3020 var id = ReactInstanceMap.get(instance)._rootNodeID;
3021 if (ReactEmptyComponentRegistry.isNullComponentID(id)) {
3022 return null;
3023 }
3024 if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) {
3025 nodeCache[id] = ReactMount.findReactNodeByID(id);
3026 }
3027 return nodeCache[id];
3028 }
3029
3030 /**
3031 * A node is "valid" if it is contained by a currently mounted container.
3032 *
3033 * This means that the node does not have to be contained by a document in
3034 * order to be considered valid.
3035 *
3036 * @param {?DOMElement} node The candidate DOM node.
3037 * @param {string} id The expected ID of the node.
3038 * @return {boolean} Whether the node is contained by a mounted container.
3039 */
3040 function isValid(node, id) {
3041 if (node) {
3042 !(internalGetID(node) === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Unexpected modification of `%s`', ATTR_NAME) : invariant(false) : undefined;
3043
3044 var container = ReactMount.findReactContainerForID(id);
3045 if (container && containsNode(container, node)) {
3046 return true;
3047 }
3048 }
3049
3050 return false;
3051 }
3052
3053 /**
3054 * Causes the cache to forget about one React-specific ID.
3055 *
3056 * @param {string} id The ID to forget.
3057 */
3058 function purgeID(id) {
3059 delete nodeCache[id];
3060 }
3061
3062 var deepestNodeSoFar = null;
3063 function findDeepestCachedAncestorImpl(ancestorID) {
3064 var ancestor = nodeCache[ancestorID];
3065 if (ancestor && isValid(ancestor, ancestorID)) {
3066 deepestNodeSoFar = ancestor;
3067 } else {
3068 // This node isn't populated in the cache, so presumably none of its
3069 // descendants are. Break out of the loop.
3070 return false;
3071 }
3072 }
3073
3074 /**
3075 * Return the deepest cached node whose ID is a prefix of `targetID`.
3076 */
3077 function findDeepestCachedAncestor(targetID) {
3078 deepestNodeSoFar = null;
3079 ReactInstanceHandles.traverseAncestors(targetID, findDeepestCachedAncestorImpl);
3080
3081 var foundNode = deepestNodeSoFar;
3082 deepestNodeSoFar = null;
3083 return foundNode;
3084 }
3085
3086 /**
3087 * Mounts this component and inserts it into the DOM.
3088 *
3089 * @param {ReactComponent} componentInstance The instance to mount.
3090 * @param {string} rootID DOM ID of the root node.
3091 * @param {DOMElement} container DOM element to mount into.
3092 * @param {ReactReconcileTransaction} transaction
3093 * @param {boolean} shouldReuseMarkup If true, do not insert markup
3094 */
3095 function mountComponentIntoNode(componentInstance, rootID, container, transaction, shouldReuseMarkup, context) {
3096 if (ReactDOMFeatureFlags.useCreateElement) {
3097 context = assign({}, context);
3098 if (container.nodeType === DOC_NODE_TYPE) {
3099 context[ownerDocumentContextKey] = container;
3100 } else {
3101 context[ownerDocumentContextKey] = container.ownerDocument;
3102 }
3103 }
3104 if (process.env.NODE_ENV !== 'production') {
3105 if (context === emptyObject) {
3106 context = {};
3107 }
3108 var tag = container.nodeName.toLowerCase();
3109 context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(null, tag, null);
3110 }
3111 var markup = ReactReconciler.mountComponent(componentInstance, rootID, transaction, context);
3112 componentInstance._renderedComponent._topLevelWrapper = componentInstance;
3113 ReactMount._mountImageIntoNode(markup, container, shouldReuseMarkup, transaction);
3114 }
3115
3116 /**
3117 * Batched mount.
3118 *
3119 * @param {ReactComponent} componentInstance The instance to mount.
3120 * @param {string} rootID DOM ID of the root node.
3121 * @param {DOMElement} container DOM element to mount into.
3122 * @param {boolean} shouldReuseMarkup If true, do not insert markup
3123 */
3124 function batchedMountComponentIntoNode(componentInstance, rootID, container, shouldReuseMarkup, context) {
3125 var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
3126 /* forceHTML */shouldReuseMarkup);
3127 transaction.perform(mountComponentIntoNode, null, componentInstance, rootID, container, transaction, shouldReuseMarkup, context);
3128 ReactUpdates.ReactReconcileTransaction.release(transaction);
3129 }
3130
3131 /**
3132 * Unmounts a component and removes it from the DOM.
3133 *
3134 * @param {ReactComponent} instance React component instance.
3135 * @param {DOMElement} container DOM element to unmount from.
3136 * @final
3137 * @internal
3138 * @see {ReactMount.unmountComponentAtNode}
3139 */
3140 function unmountComponentFromNode(instance, container) {
3141 ReactReconciler.unmountComponent(instance);
3142
3143 if (container.nodeType === DOC_NODE_TYPE) {
3144 container = container.documentElement;
3145 }
3146
3147 // http://jsperf.com/emptying-a-node
3148 while (container.lastChild) {
3149 container.removeChild(container.lastChild);
3150 }
3151 }
3152
3153 /**
3154 * True if the supplied DOM node has a direct React-rendered child that is
3155 * not a React root element. Useful for warning in `render`,
3156 * `unmountComponentAtNode`, etc.
3157 *
3158 * @param {?DOMElement} node The candidate DOM node.
3159 * @return {boolean} True if the DOM element contains a direct child that was
3160 * rendered by React but is not a root element.
3161 * @internal
3162 */
3163 function hasNonRootReactChild(node) {
3164 var reactRootID = getReactRootID(node);
3165 return reactRootID ? reactRootID !== ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID) : false;
3166 }
3167
3168 /**
3169 * Returns the first (deepest) ancestor of a node which is rendered by this copy
3170 * of React.
3171 */
3172 function findFirstReactDOMImpl(node) {
3173 // This node might be from another React instance, so we make sure not to
3174 // examine the node cache here
3175 for (; node && node.parentNode !== node; node = node.parentNode) {
3176 if (node.nodeType !== 1) {
3177 // Not a DOMElement, therefore not a React component
3178 continue;
3179 }
3180 var nodeID = internalGetID(node);
3181 if (!nodeID) {
3182 continue;
3183 }
3184 var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
3185
3186 // If containersByReactRootID contains the container we find by crawling up
3187 // the tree, we know that this instance of React rendered the node.
3188 // nb. isValid's strategy (with containsNode) does not work because render
3189 // trees may be nested and we don't want a false positive in that case.
3190 var current = node;
3191 var lastID;
3192 do {
3193 lastID = internalGetID(current);
3194 current = current.parentNode;
3195 if (current == null) {
3196 // The passed-in node has been detached from the container it was
3197 // originally rendered into.
3198 return null;
3199 }
3200 } while (lastID !== reactRootID);
3201
3202 if (current === containersByReactRootID[reactRootID]) {
3203 return node;
3204 }
3205 }
3206 return null;
3207 }
3208
3209 /**
3210 * Temporary (?) hack so that we can store all top-level pending updates on
3211 * composites instead of having to worry about different types of components
3212 * here.
3213 */
3214 var TopLevelWrapper = function () {};
3215 TopLevelWrapper.prototype.isReactComponent = {};
3216 if (process.env.NODE_ENV !== 'production') {
3217 TopLevelWrapper.displayName = 'TopLevelWrapper';
3218 }
3219 TopLevelWrapper.prototype.render = function () {
3220 // this.props is actually a ReactElement
3221 return this.props;
3222 };
3223
3224 /**
3225 * Mounting is the process of initializing a React component by creating its
3226 * representative DOM elements and inserting them into a supplied `container`.
3227 * Any prior content inside `container` is destroyed in the process.
3228 *
3229 * ReactMount.render(
3230 * component,
3231 * document.getElementById('container')
3232 * );
3233 *
3234 * <div id="container"> <-- Supplied `container`.
3235 * <div data-reactid=".3"> <-- Rendered reactRoot of React
3236 * // ... component.
3237 * </div>
3238 * </div>
3239 *
3240 * Inside of `container`, the first element rendered is the "reactRoot".
3241 */
3242 var ReactMount = {
3243
3244 TopLevelWrapper: TopLevelWrapper,
3245
3246 /** Exposed for debugging purposes **/
3247 _instancesByReactRootID: instancesByReactRootID,
3248
3249 /**
3250 * This is a hook provided to support rendering React components while
3251 * ensuring that the apparent scroll position of its `container` does not
3252 * change.
3253 *
3254 * @param {DOMElement} container The `container` being rendered into.
3255 * @param {function} renderCallback This must be called once to do the render.
3256 */
3257 scrollMonitor: function (container, renderCallback) {
3258 renderCallback();
3259 },
3260
3261 /**
3262 * Take a component that's already mounted into the DOM and replace its props
3263 * @param {ReactComponent} prevComponent component instance already in the DOM
3264 * @param {ReactElement} nextElement component instance to render
3265 * @param {DOMElement} container container to render into
3266 * @param {?function} callback function triggered on completion
3267 */
3268 _updateRootComponent: function (prevComponent, nextElement, container, callback) {
3269 ReactMount.scrollMonitor(container, function () {
3270 ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement);
3271 if (callback) {
3272 ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
3273 }
3274 });
3275
3276 if (process.env.NODE_ENV !== 'production') {
3277 // Record the root element in case it later gets transplanted.
3278 rootElementsByReactRootID[getReactRootID(container)] = getReactRootElementInContainer(container);
3279 }
3280
3281 return prevComponent;
3282 },
3283
3284 /**
3285 * Register a component into the instance map and starts scroll value
3286 * monitoring
3287 * @param {ReactComponent} nextComponent component instance to render
3288 * @param {DOMElement} container container to render into
3289 * @return {string} reactRoot ID prefix
3290 */
3291 _registerComponent: function (nextComponent, container) {
3292 !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : invariant(false) : undefined;
3293
3294 ReactBrowserEventEmitter.ensureScrollValueMonitoring();
3295
3296 var reactRootID = ReactMount.registerContainer(container);
3297 instancesByReactRootID[reactRootID] = nextComponent;
3298 return reactRootID;
3299 },
3300
3301 /**
3302 * Render a new component into the DOM.
3303 * @param {ReactElement} nextElement element to render
3304 * @param {DOMElement} container container to render into
3305 * @param {boolean} shouldReuseMarkup if we should skip the markup insertion
3306 * @return {ReactComponent} nextComponent
3307 */
3308 _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
3309 // Various parts of our code (such as ReactCompositeComponent's
3310 // _renderValidatedComponent) assume that calls to render aren't nested;
3311 // verify that that's the case.
3312 process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined;
3313
3314 var componentInstance = instantiateReactComponent(nextElement, null);
3315 var reactRootID = ReactMount._registerComponent(componentInstance, container);
3316
3317 // The initial render is synchronous but any updates that happen during
3318 // rendering, in componentWillMount or componentDidMount, will be batched
3319 // according to the current batching strategy.
3320
3321 ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, reactRootID, container, shouldReuseMarkup, context);
3322
3323 if (process.env.NODE_ENV !== 'production') {
3324 // Record the root element in case it later gets transplanted.
3325 rootElementsByReactRootID[reactRootID] = getReactRootElementInContainer(container);
3326 }
3327
3328 return componentInstance;
3329 },
3330
3331 /**
3332 * Renders a React component into the DOM in the supplied `container`.
3333 *
3334 * If the React component was previously rendered into `container`, this will
3335 * perform an update on it and only mutate the DOM as necessary to reflect the
3336 * latest React component.
3337 *
3338 * @param {ReactComponent} parentComponent The conceptual parent of this render tree.
3339 * @param {ReactElement} nextElement Component element to render.
3340 * @param {DOMElement} container DOM element to render into.
3341 * @param {?function} callback function triggered on completion
3342 * @return {ReactComponent} Component instance rendered in `container`.
3343 */
3344 renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
3345 !(parentComponent != null && parentComponent._reactInternalInstance != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : invariant(false) : undefined;
3346 return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
3347 },
3348
3349 _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
3350 !ReactElement.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing an element string, make sure to instantiate ' + 'it by passing it to React.createElement.' : typeof nextElement === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' :
3351 // Check if it quacks like an element
3352 nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : undefined;
3353
3354 process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : undefined;
3355
3356 var nextWrappedElement = new ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
3357
3358 var prevComponent = instancesByReactRootID[getReactRootID(container)];
3359
3360 if (prevComponent) {
3361 var prevWrappedElement = prevComponent._currentElement;
3362 var prevElement = prevWrappedElement.props;
3363 if (shouldUpdateReactComponent(prevElement, nextElement)) {
3364 var publicInst = prevComponent._renderedComponent.getPublicInstance();
3365 var updatedCallback = callback && function () {
3366 callback.call(publicInst);
3367 };
3368 ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, updatedCallback);
3369 return publicInst;
3370 } else {
3371 ReactMount.unmountComponentAtNode(container);
3372 }
3373 }
3374
3375 var reactRootElement = getReactRootElementInContainer(container);
3376 var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
3377 var containerHasNonRootReactChild = hasNonRootReactChild(container);
3378
3379 if (process.env.NODE_ENV !== 'production') {
3380 process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : undefined;
3381
3382 if (!containerHasReactMarkup || reactRootElement.nextSibling) {
3383 var rootElementSibling = reactRootElement;
3384 while (rootElementSibling) {
3385 if (internalGetID(rootElementSibling)) {
3386 process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : undefined;
3387 break;
3388 }
3389 rootElementSibling = rootElementSibling.nextSibling;
3390 }
3391 }
3392 }
3393
3394 var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
3395 var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject)._renderedComponent.getPublicInstance();
3396 if (callback) {
3397 callback.call(component);
3398 }
3399 return component;
3400 },
3401
3402 /**
3403 * Renders a React component into the DOM in the supplied `container`.
3404 *
3405 * If the React component was previously rendered into `container`, this will
3406 * perform an update on it and only mutate the DOM as necessary to reflect the
3407 * latest React component.
3408 *
3409 * @param {ReactElement} nextElement Component element to render.
3410 * @param {DOMElement} container DOM element to render into.
3411 * @param {?function} callback function triggered on completion
3412 * @return {ReactComponent} Component instance rendered in `container`.
3413 */
3414 render: function (nextElement, container, callback) {
3415 return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
3416 },
3417
3418 /**
3419 * Registers a container node into which React components will be rendered.
3420 * This also creates the "reactRoot" ID that will be assigned to the element
3421 * rendered within.
3422 *
3423 * @param {DOMElement} container DOM element to register as a container.
3424 * @return {string} The "reactRoot" ID of elements rendered within.
3425 */
3426 registerContainer: function (container) {
3427 var reactRootID = getReactRootID(container);
3428 if (reactRootID) {
3429 // If one exists, make sure it is a valid "reactRoot" ID.
3430 reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID);
3431 }
3432 if (!reactRootID) {
3433 // No valid "reactRoot" ID found, create one.
3434 reactRootID = ReactInstanceHandles.createReactRootID();
3435 }
3436 containersByReactRootID[reactRootID] = container;
3437 return reactRootID;
3438 },
3439
3440 /**
3441 * Unmounts and destroys the React component rendered in the `container`.
3442 *
3443 * @param {DOMElement} container DOM element containing a React component.
3444 * @return {boolean} True if a component was found in and unmounted from
3445 * `container`
3446 */
3447 unmountComponentAtNode: function (container) {
3448 // Various parts of our code (such as ReactCompositeComponent's
3449 // _renderValidatedComponent) assume that calls to render aren't nested;
3450 // verify that that's the case. (Strictly speaking, unmounting won't cause a
3451 // render but we still don't expect to be in a render call here.)
3452 process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined;
3453
3454 !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(false) : undefined;
3455
3456 var reactRootID = getReactRootID(container);
3457 var component = instancesByReactRootID[reactRootID];
3458 if (!component) {
3459 // Check if the node being unmounted was rendered by React, but isn't a
3460 // root node.
3461 var containerHasNonRootReactChild = hasNonRootReactChild(container);
3462
3463 // Check if the container itself is a React root node.
3464 var containerID = internalGetID(container);
3465 var isContainerReactRoot = containerID && containerID === ReactInstanceHandles.getReactRootIDFromNodeID(containerID);
3466
3467 if (process.env.NODE_ENV !== 'production') {
3468 process.env.NODE_ENV !== 'production' ? warning(!containerHasNonRootReactChild, 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : undefined;
3469 }
3470
3471 return false;
3472 }
3473 ReactUpdates.batchedUpdates(unmountComponentFromNode, component, container);
3474 delete instancesByReactRootID[reactRootID];
3475 delete containersByReactRootID[reactRootID];
3476 if (process.env.NODE_ENV !== 'production') {
3477 delete rootElementsByReactRootID[reactRootID];
3478 }
3479 return true;
3480 },
3481
3482 /**
3483 * Finds the container DOM element that contains React component to which the
3484 * supplied DOM `id` belongs.
3485 *
3486 * @param {string} id The ID of an element rendered by a React component.
3487 * @return {?DOMElement} DOM element that contains the `id`.
3488 */
3489 findReactContainerForID: function (id) {
3490 var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(id);
3491 var container = containersByReactRootID[reactRootID];
3492
3493 if (process.env.NODE_ENV !== 'production') {
3494 var rootElement = rootElementsByReactRootID[reactRootID];
3495 if (rootElement && rootElement.parentNode !== container) {
3496 process.env.NODE_ENV !== 'production' ? warning(
3497 // Call internalGetID here because getID calls isValid which calls
3498 // findReactContainerForID (this function).
3499 internalGetID(rootElement) === reactRootID, 'ReactMount: Root element ID differed from reactRootID.') : undefined;
3500 var containerChild = container.firstChild;
3501 if (containerChild && reactRootID === internalGetID(containerChild)) {
3502 // If the container has a new child with the same ID as the old
3503 // root element, then rootElementsByReactRootID[reactRootID] is
3504 // just stale and needs to be updated. The case that deserves a
3505 // warning is when the container is empty.
3506 rootElementsByReactRootID[reactRootID] = containerChild;
3507 } else {
3508 process.env.NODE_ENV !== 'production' ? warning(false, 'ReactMount: Root element has been removed from its original ' + 'container. New container: %s', rootElement.parentNode) : undefined;
3509 }
3510 }
3511 }
3512
3513 return container;
3514 },
3515
3516 /**
3517 * Finds an element rendered by React with the supplied ID.
3518 *
3519 * @param {string} id ID of a DOM node in the React component.
3520 * @return {DOMElement} Root DOM node of the React component.
3521 */
3522 findReactNodeByID: function (id) {
3523 var reactRoot = ReactMount.findReactContainerForID(id);
3524 return ReactMount.findComponentRoot(reactRoot, id);
3525 },
3526
3527 /**
3528 * Traverses up the ancestors of the supplied node to find a node that is a
3529 * DOM representation of a React component rendered by this copy of React.
3530 *
3531 * @param {*} node
3532 * @return {?DOMEventTarget}
3533 * @internal
3534 */
3535 getFirstReactDOM: function (node) {
3536 return findFirstReactDOMImpl(node);
3537 },
3538
3539 /**
3540 * Finds a node with the supplied `targetID` inside of the supplied
3541 * `ancestorNode`. Exploits the ID naming scheme to perform the search
3542 * quickly.
3543 *
3544 * @param {DOMEventTarget} ancestorNode Search from this root.
3545 * @pararm {string} targetID ID of the DOM representation of the component.
3546 * @return {DOMEventTarget} DOM node with the supplied `targetID`.
3547 * @internal
3548 */
3549 findComponentRoot: function (ancestorNode, targetID) {
3550 var firstChildren = findComponentRootReusableArray;
3551 var childIndex = 0;
3552
3553 var deepestAncestor = findDeepestCachedAncestor(targetID) || ancestorNode;
3554
3555 if (process.env.NODE_ENV !== 'production') {
3556 // This will throw on the next line; give an early warning
3557 process.env.NODE_ENV !== 'production' ? warning(deepestAncestor != null, 'React can\'t find the root component node for data-reactid value ' + '`%s`. If you\'re seeing this message, it probably means that ' + 'you\'ve loaded two copies of React on the page. At this time, only ' + 'a single copy of React can be loaded at a time.', targetID) : undefined;
3558 }
3559
3560 firstChildren[0] = deepestAncestor.firstChild;
3561 firstChildren.length = 1;
3562
3563 while (childIndex < firstChildren.length) {
3564 var child = firstChildren[childIndex++];
3565 var targetChild;
3566
3567 while (child) {
3568 var childID = ReactMount.getID(child);
3569 if (childID) {
3570 // Even if we find the node we're looking for, we finish looping
3571 // through its siblings to ensure they're cached so that we don't have
3572 // to revisit this node again. Otherwise, we make n^2 calls to getID
3573 // when visiting the many children of a single node in order.
3574
3575 if (targetID === childID) {
3576 targetChild = child;
3577 } else if (ReactInstanceHandles.isAncestorIDOf(childID, targetID)) {
3578 // If we find a child whose ID is an ancestor of the given ID,
3579 // then we can be sure that we only want to search the subtree
3580 // rooted at this child, so we can throw out the rest of the
3581 // search state.
3582 firstChildren.length = childIndex = 0;
3583 firstChildren.push(child.firstChild);
3584 }
3585 } else {
3586 // If this child had no ID, then there's a chance that it was
3587 // injected automatically by the browser, as when a `<table>`
3588 // element sprouts an extra `<tbody>` child as a side effect of
3589 // `.innerHTML` parsing. Optimistically continue down this
3590 // branch, but not before examining the other siblings.
3591 firstChildren.push(child.firstChild);
3592 }
3593
3594 child = child.nextSibling;
3595 }
3596
3597 if (targetChild) {
3598 // Emptying firstChildren/findComponentRootReusableArray is
3599 // not necessary for correctness, but it helps the GC reclaim
3600 // any nodes that were left at the end of the search.
3601 firstChildren.length = 0;
3602
3603 return targetChild;
3604 }
3605 }
3606
3607 firstChildren.length = 0;
3608
3609 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findComponentRoot(..., %s): Unable to find element. This probably ' + 'means the DOM was unexpectedly mutated (e.g., by the browser), ' + 'usually due to forgetting a <tbody> when using tables, nesting tags ' + 'like <form>, <p>, or <a>, or using non-SVG elements in an <svg> ' + 'parent. ' + 'Try inspecting the child nodes of the element with React ID `%s`.', targetID, ReactMount.getID(ancestorNode)) : invariant(false) : undefined;
3610 },
3611
3612 _mountImageIntoNode: function (markup, container, shouldReuseMarkup, transaction) {
3613 !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : invariant(false) : undefined;
3614
3615 if (shouldReuseMarkup) {
3616 var rootElement = getReactRootElementInContainer(container);
3617 if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
3618 return;
3619 } else {
3620 var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
3621 rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
3622
3623 var rootMarkup = rootElement.outerHTML;
3624 rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
3625
3626 var normalizedMarkup = markup;
3627 if (process.env.NODE_ENV !== 'production') {
3628 // because rootMarkup is retrieved from the DOM, various normalizations
3629 // will have occurred which will not be present in `markup`. Here,
3630 // insert markup into a <div> or <iframe> depending on the container
3631 // type to perform the same normalizations before comparing.
3632 var normalizer;
3633 if (container.nodeType === ELEMENT_NODE_TYPE) {
3634 normalizer = document.createElement('div');
3635 normalizer.innerHTML = markup;
3636 normalizedMarkup = normalizer.innerHTML;
3637 } else {
3638 normalizer = document.createElement('iframe');
3639 document.body.appendChild(normalizer);
3640 normalizer.contentDocument.write(markup);
3641 normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
3642 document.body.removeChild(normalizer);
3643 }
3644 }
3645
3646 var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
3647 var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
3648
3649 !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using ' + 'server rendering but the checksum was invalid. This usually ' + 'means you rendered a different component type or props on ' + 'the client from the one on the server, or your render() ' + 'methods are impure. React cannot handle this case due to ' + 'cross-browser quirks by rendering at the document root. You ' + 'should look for environment dependent code in your components ' + 'and ensure the props are the same client and server side:\n%s', difference) : invariant(false) : undefined;
3650
3651 if (process.env.NODE_ENV !== 'production') {
3652 process.env.NODE_ENV !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : undefined;
3653 }
3654 }
3655 }
3656
3657 !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but ' + 'you didn\'t use server rendering. We can\'t do this ' + 'without using server rendering due to cross-browser quirks. ' + 'See ReactDOMServer.renderToString() for server rendering.') : invariant(false) : undefined;
3658
3659 if (transaction.useCreateElement) {
3660 while (container.lastChild) {
3661 container.removeChild(container.lastChild);
3662 }
3663 container.appendChild(markup);
3664 } else {
3665 setInnerHTML(container, markup);
3666 }
3667 },
3668
3669 ownerDocumentContextKey: ownerDocumentContextKey,
3670
3671 /**
3672 * React ID utilities.
3673 */
3674
3675 getReactRootID: getReactRootID,
3676
3677 getID: getID,
3678
3679 setID: setID,
3680
3681 getNode: getNode,
3682
3683 getNodeFromInstance: getNodeFromInstance,
3684
3685 isValid: isValid,
3686
3687 purgeID: purgeID
3688 };
3689
3690 ReactPerf.measureMethods(ReactMount, 'ReactMount', {
3691 _renderNewRootComponent: '_renderNewRootComponent',
3692 _mountImageIntoNode: '_mountImageIntoNode'
3693 });
3694
3695 module.exports = ReactMount;
3696 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
3697
3698/***/ }),
3699/* 30 */
3700/***/ (function(module, exports, __webpack_require__) {
3701
3702 /**
3703 * Copyright 2013-2015, Facebook, Inc.
3704 * All rights reserved.
3705 *
3706 * This source code is licensed under the BSD-style license found in the
3707 * LICENSE file in the root directory of this source tree. An additional grant
3708 * of patent rights can be found in the PATENTS file in the same directory.
3709 *
3710 * @providesModule ReactBrowserEventEmitter
3711 * @typechecks static-only
3712 */
3713
3714 'use strict';
3715
3716 var EventConstants = __webpack_require__(31);
3717 var EventPluginHub = __webpack_require__(32);
3718 var EventPluginRegistry = __webpack_require__(33);
3719 var ReactEventEmitterMixin = __webpack_require__(38);
3720 var ReactPerf = __webpack_require__(19);
3721 var ViewportMetrics = __webpack_require__(39);
3722
3723 var assign = __webpack_require__(40);
3724 var isEventSupported = __webpack_require__(41);
3725
3726 /**
3727 * Summary of `ReactBrowserEventEmitter` event handling:
3728 *
3729 * - Top-level delegation is used to trap most native browser events. This
3730 * may only occur in the main thread and is the responsibility of
3731 * ReactEventListener, which is injected and can therefore support pluggable
3732 * event sources. This is the only work that occurs in the main thread.
3733 *
3734 * - We normalize and de-duplicate events to account for browser quirks. This
3735 * may be done in the worker thread.
3736 *
3737 * - Forward these native events (with the associated top-level type used to
3738 * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
3739 * to extract any synthetic events.
3740 *
3741 * - The `EventPluginHub` will then process each event by annotating them with
3742 * "dispatches", a sequence of listeners and IDs that care about that event.
3743 *
3744 * - The `EventPluginHub` then dispatches the events.
3745 *
3746 * Overview of React and the event system:
3747 *
3748 * +------------+ .
3749 * | DOM | .
3750 * +------------+ .
3751 * | .
3752 * v .
3753 * +------------+ .
3754 * | ReactEvent | .
3755 * | Listener | .
3756 * +------------+ . +-----------+
3757 * | . +--------+|SimpleEvent|
3758 * | . | |Plugin |
3759 * +-----|------+ . v +-----------+
3760 * | | | . +--------------+ +------------+
3761 * | +-----------.--->|EventPluginHub| | Event |
3762 * | | . | | +-----------+ | Propagators|
3763 * | ReactEvent | . | | |TapEvent | |------------|
3764 * | Emitter | . | |<---+|Plugin | |other plugin|
3765 * | | . | | +-----------+ | utilities |
3766 * | +-----------.--->| | +------------+
3767 * | | | . +--------------+
3768 * +-----|------+ . ^ +-----------+
3769 * | . | |Enter/Leave|
3770 * + . +-------+|Plugin |
3771 * +-------------+ . +-----------+
3772 * | application | .
3773 * |-------------| .
3774 * | | .
3775 * | | .
3776 * +-------------+ .
3777 * .
3778 * React Core . General Purpose Event Plugin System
3779 */
3780
3781 var alreadyListeningTo = {};
3782 var isMonitoringScrollValue = false;
3783 var reactTopListenersCounter = 0;
3784
3785 // For events like 'submit' which don't consistently bubble (which we trap at a
3786 // lower node than `document`), binding at `document` would cause duplicate
3787 // events so we don't include them here
3788 var topEventMapping = {
3789 topAbort: 'abort',
3790 topBlur: 'blur',
3791 topCanPlay: 'canplay',
3792 topCanPlayThrough: 'canplaythrough',
3793 topChange: 'change',
3794 topClick: 'click',
3795 topCompositionEnd: 'compositionend',
3796 topCompositionStart: 'compositionstart',
3797 topCompositionUpdate: 'compositionupdate',
3798 topContextMenu: 'contextmenu',
3799 topCopy: 'copy',
3800 topCut: 'cut',
3801 topDoubleClick: 'dblclick',
3802 topDrag: 'drag',
3803 topDragEnd: 'dragend',
3804 topDragEnter: 'dragenter',
3805 topDragExit: 'dragexit',
3806 topDragLeave: 'dragleave',
3807 topDragOver: 'dragover',
3808 topDragStart: 'dragstart',
3809 topDrop: 'drop',
3810 topDurationChange: 'durationchange',
3811 topEmptied: 'emptied',
3812 topEncrypted: 'encrypted',
3813 topEnded: 'ended',
3814 topError: 'error',
3815 topFocus: 'focus',
3816 topInput: 'input',
3817 topKeyDown: 'keydown',
3818 topKeyPress: 'keypress',
3819 topKeyUp: 'keyup',
3820 topLoadedData: 'loadeddata',
3821 topLoadedMetadata: 'loadedmetadata',
3822 topLoadStart: 'loadstart',
3823 topMouseDown: 'mousedown',
3824 topMouseMove: 'mousemove',
3825 topMouseOut: 'mouseout',
3826 topMouseOver: 'mouseover',
3827 topMouseUp: 'mouseup',
3828 topPaste: 'paste',
3829 topPause: 'pause',
3830 topPlay: 'play',
3831 topPlaying: 'playing',
3832 topProgress: 'progress',
3833 topRateChange: 'ratechange',
3834 topScroll: 'scroll',
3835 topSeeked: 'seeked',
3836 topSeeking: 'seeking',
3837 topSelectionChange: 'selectionchange',
3838 topStalled: 'stalled',
3839 topSuspend: 'suspend',
3840 topTextInput: 'textInput',
3841 topTimeUpdate: 'timeupdate',
3842 topTouchCancel: 'touchcancel',
3843 topTouchEnd: 'touchend',
3844 topTouchMove: 'touchmove',
3845 topTouchStart: 'touchstart',
3846 topVolumeChange: 'volumechange',
3847 topWaiting: 'waiting',
3848 topWheel: 'wheel'
3849 };
3850
3851 /**
3852 * To ensure no conflicts with other potential React instances on the page
3853 */
3854 var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
3855
3856 function getListeningForDocument(mountAt) {
3857 // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
3858 // directly.
3859 if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
3860 mountAt[topListenersIDKey] = reactTopListenersCounter++;
3861 alreadyListeningTo[mountAt[topListenersIDKey]] = {};
3862 }
3863 return alreadyListeningTo[mountAt[topListenersIDKey]];
3864 }
3865
3866 /**
3867 * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
3868 * example:
3869 *
3870 * ReactBrowserEventEmitter.putListener('myID', 'onClick', myFunction);
3871 *
3872 * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
3873 *
3874 * @internal
3875 */
3876 var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, {
3877
3878 /**
3879 * Injectable event backend
3880 */
3881 ReactEventListener: null,
3882
3883 injection: {
3884 /**
3885 * @param {object} ReactEventListener
3886 */
3887 injectReactEventListener: function (ReactEventListener) {
3888 ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
3889 ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
3890 }
3891 },
3892
3893 /**
3894 * Sets whether or not any created callbacks should be enabled.
3895 *
3896 * @param {boolean} enabled True if callbacks should be enabled.
3897 */
3898 setEnabled: function (enabled) {
3899 if (ReactBrowserEventEmitter.ReactEventListener) {
3900 ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
3901 }
3902 },
3903
3904 /**
3905 * @return {boolean} True if callbacks are enabled.
3906 */
3907 isEnabled: function () {
3908 return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
3909 },
3910
3911 /**
3912 * We listen for bubbled touch events on the document object.
3913 *
3914 * Firefox v8.01 (and possibly others) exhibited strange behavior when
3915 * mounting `onmousemove` events at some node that was not the document
3916 * element. The symptoms were that if your mouse is not moving over something
3917 * contained within that mount point (for example on the background) the
3918 * top-level listeners for `onmousemove` won't be called. However, if you
3919 * register the `mousemove` on the document object, then it will of course
3920 * catch all `mousemove`s. This along with iOS quirks, justifies restricting
3921 * top-level listeners to the document object only, at least for these
3922 * movement types of events and possibly all events.
3923 *
3924 * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
3925 *
3926 * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
3927 * they bubble to document.
3928 *
3929 * @param {string} registrationName Name of listener (e.g. `onClick`).
3930 * @param {object} contentDocumentHandle Document which owns the container
3931 */
3932 listenTo: function (registrationName, contentDocumentHandle) {
3933 var mountAt = contentDocumentHandle;
3934 var isListening = getListeningForDocument(mountAt);
3935 var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
3936
3937 var topLevelTypes = EventConstants.topLevelTypes;
3938 for (var i = 0; i < dependencies.length; i++) {
3939 var dependency = dependencies[i];
3940 if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
3941 if (dependency === topLevelTypes.topWheel) {
3942 if (isEventSupported('wheel')) {
3943 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);
3944 } else if (isEventSupported('mousewheel')) {
3945 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);
3946 } else {
3947 // Firefox needs to capture a different mouse scroll event.
3948 // @see http://www.quirksmode.org/dom/events/tests/scroll.html
3949 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
3950 }
3951 } else if (dependency === topLevelTypes.topScroll) {
3952
3953 if (isEventSupported('scroll', true)) {
3954 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);
3955 } else {
3956 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
3957 }
3958 } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {
3959
3960 if (isEventSupported('focus', true)) {
3961 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);
3962 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);
3963 } else if (isEventSupported('focusin')) {
3964 // IE has `focusin` and `focusout` events which bubble.
3965 // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
3966 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);
3967 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);
3968 }
3969
3970 // to make sure blur and focus event listeners are only attached once
3971 isListening[topLevelTypes.topBlur] = true;
3972 isListening[topLevelTypes.topFocus] = true;
3973 } else if (topEventMapping.hasOwnProperty(dependency)) {
3974 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
3975 }
3976
3977 isListening[dependency] = true;
3978 }
3979 }
3980 },
3981
3982 trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
3983 return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
3984 },
3985
3986 trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
3987 return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
3988 },
3989
3990 /**
3991 * Listens to window scroll and resize events. We cache scroll values so that
3992 * application code can access them without triggering reflows.
3993 *
3994 * NOTE: Scroll events do not bubble.
3995 *
3996 * @see http://www.quirksmode.org/dom/events/scroll.html
3997 */
3998 ensureScrollValueMonitoring: function () {
3999 if (!isMonitoringScrollValue) {
4000 var refresh = ViewportMetrics.refreshScrollValues;
4001 ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
4002 isMonitoringScrollValue = true;
4003 }
4004 },
4005
4006 eventNameDispatchConfigs: EventPluginHub.eventNameDispatchConfigs,
4007
4008 registrationNameModules: EventPluginHub.registrationNameModules,
4009
4010 putListener: EventPluginHub.putListener,
4011
4012 getListener: EventPluginHub.getListener,
4013
4014 deleteListener: EventPluginHub.deleteListener,
4015
4016 deleteAllListeners: EventPluginHub.deleteAllListeners
4017
4018 });
4019
4020 ReactPerf.measureMethods(ReactBrowserEventEmitter, 'ReactBrowserEventEmitter', {
4021 putListener: 'putListener',
4022 deleteListener: 'deleteListener'
4023 });
4024
4025 module.exports = ReactBrowserEventEmitter;
4026
4027/***/ }),
4028/* 31 */
4029/***/ (function(module, exports, __webpack_require__) {
4030
4031 /**
4032 * Copyright 2013-2015, Facebook, Inc.
4033 * All rights reserved.
4034 *
4035 * This source code is licensed under the BSD-style license found in the
4036 * LICENSE file in the root directory of this source tree. An additional grant
4037 * of patent rights can be found in the PATENTS file in the same directory.
4038 *
4039 * @providesModule EventConstants
4040 */
4041
4042 'use strict';
4043
4044 var keyMirror = __webpack_require__(18);
4045
4046 var PropagationPhases = keyMirror({ bubbled: null, captured: null });
4047
4048 /**
4049 * Types of raw signals from the browser caught at the top level.
4050 */
4051 var topLevelTypes = keyMirror({
4052 topAbort: null,
4053 topBlur: null,
4054 topCanPlay: null,
4055 topCanPlayThrough: null,
4056 topChange: null,
4057 topClick: null,
4058 topCompositionEnd: null,
4059 topCompositionStart: null,
4060 topCompositionUpdate: null,
4061 topContextMenu: null,
4062 topCopy: null,
4063 topCut: null,
4064 topDoubleClick: null,
4065 topDrag: null,
4066 topDragEnd: null,
4067 topDragEnter: null,
4068 topDragExit: null,
4069 topDragLeave: null,
4070 topDragOver: null,
4071 topDragStart: null,
4072 topDrop: null,
4073 topDurationChange: null,
4074 topEmptied: null,
4075 topEncrypted: null,
4076 topEnded: null,
4077 topError: null,
4078 topFocus: null,
4079 topInput: null,
4080 topKeyDown: null,
4081 topKeyPress: null,
4082 topKeyUp: null,
4083 topLoad: null,
4084 topLoadedData: null,
4085 topLoadedMetadata: null,
4086 topLoadStart: null,
4087 topMouseDown: null,
4088 topMouseMove: null,
4089 topMouseOut: null,
4090 topMouseOver: null,
4091 topMouseUp: null,
4092 topPaste: null,
4093 topPause: null,
4094 topPlay: null,
4095 topPlaying: null,
4096 topProgress: null,
4097 topRateChange: null,
4098 topReset: null,
4099 topScroll: null,
4100 topSeeked: null,
4101 topSeeking: null,
4102 topSelectionChange: null,
4103 topStalled: null,
4104 topSubmit: null,
4105 topSuspend: null,
4106 topTextInput: null,
4107 topTimeUpdate: null,
4108 topTouchCancel: null,
4109 topTouchEnd: null,
4110 topTouchMove: null,
4111 topTouchStart: null,
4112 topVolumeChange: null,
4113 topWaiting: null,
4114 topWheel: null
4115 });
4116
4117 var EventConstants = {
4118 topLevelTypes: topLevelTypes,
4119 PropagationPhases: PropagationPhases
4120 };
4121
4122 module.exports = EventConstants;
4123
4124/***/ }),
4125/* 32 */
4126/***/ (function(module, exports, __webpack_require__) {
4127
4128 /* WEBPACK VAR INJECTION */(function(process) {/**
4129 * Copyright 2013-2015, Facebook, Inc.
4130 * All rights reserved.
4131 *
4132 * This source code is licensed under the BSD-style license found in the
4133 * LICENSE file in the root directory of this source tree. An additional grant
4134 * of patent rights can be found in the PATENTS file in the same directory.
4135 *
4136 * @providesModule EventPluginHub
4137 */
4138
4139 'use strict';
4140
4141 var EventPluginRegistry = __webpack_require__(33);
4142 var EventPluginUtils = __webpack_require__(34);
4143 var ReactErrorUtils = __webpack_require__(35);
4144
4145 var accumulateInto = __webpack_require__(36);
4146 var forEachAccumulated = __webpack_require__(37);
4147 var invariant = __webpack_require__(14);
4148 var warning = __webpack_require__(26);
4149
4150 /**
4151 * Internal store for event listeners
4152 */
4153 var listenerBank = {};
4154
4155 /**
4156 * Internal queue of events that have accumulated their dispatches and are
4157 * waiting to have their dispatches executed.
4158 */
4159 var eventQueue = null;
4160
4161 /**
4162 * Dispatches an event and releases it back into the pool, unless persistent.
4163 *
4164 * @param {?object} event Synthetic event to be dispatched.
4165 * @param {boolean} simulated If the event is simulated (changes exn behavior)
4166 * @private
4167 */
4168 var executeDispatchesAndRelease = function (event, simulated) {
4169 if (event) {
4170 EventPluginUtils.executeDispatchesInOrder(event, simulated);
4171
4172 if (!event.isPersistent()) {
4173 event.constructor.release(event);
4174 }
4175 }
4176 };
4177 var executeDispatchesAndReleaseSimulated = function (e) {
4178 return executeDispatchesAndRelease(e, true);
4179 };
4180 var executeDispatchesAndReleaseTopLevel = function (e) {
4181 return executeDispatchesAndRelease(e, false);
4182 };
4183
4184 /**
4185 * - `InstanceHandle`: [required] Module that performs logical traversals of DOM
4186 * hierarchy given ids of the logical DOM elements involved.
4187 */
4188 var InstanceHandle = null;
4189
4190 function validateInstanceHandle() {
4191 var valid = InstanceHandle && InstanceHandle.traverseTwoPhase && InstanceHandle.traverseEnterLeave;
4192 process.env.NODE_ENV !== 'production' ? warning(valid, 'InstanceHandle not injected before use!') : undefined;
4193 }
4194
4195 /**
4196 * This is a unified interface for event plugins to be installed and configured.
4197 *
4198 * Event plugins can implement the following properties:
4199 *
4200 * `extractEvents` {function(string, DOMEventTarget, string, object): *}
4201 * Required. When a top-level event is fired, this method is expected to
4202 * extract synthetic events that will in turn be queued and dispatched.
4203 *
4204 * `eventTypes` {object}
4205 * Optional, plugins that fire events must publish a mapping of registration
4206 * names that are used to register listeners. Values of this mapping must
4207 * be objects that contain `registrationName` or `phasedRegistrationNames`.
4208 *
4209 * `executeDispatch` {function(object, function, string)}
4210 * Optional, allows plugins to override how an event gets dispatched. By
4211 * default, the listener is simply invoked.
4212 *
4213 * Each plugin that is injected into `EventsPluginHub` is immediately operable.
4214 *
4215 * @public
4216 */
4217 var EventPluginHub = {
4218
4219 /**
4220 * Methods for injecting dependencies.
4221 */
4222 injection: {
4223
4224 /**
4225 * @param {object} InjectedMount
4226 * @public
4227 */
4228 injectMount: EventPluginUtils.injection.injectMount,
4229
4230 /**
4231 * @param {object} InjectedInstanceHandle
4232 * @public
4233 */
4234 injectInstanceHandle: function (InjectedInstanceHandle) {
4235 InstanceHandle = InjectedInstanceHandle;
4236 if (process.env.NODE_ENV !== 'production') {
4237 validateInstanceHandle();
4238 }
4239 },
4240
4241 getInstanceHandle: function () {
4242 if (process.env.NODE_ENV !== 'production') {
4243 validateInstanceHandle();
4244 }
4245 return InstanceHandle;
4246 },
4247
4248 /**
4249 * @param {array} InjectedEventPluginOrder
4250 * @public
4251 */
4252 injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
4253
4254 /**
4255 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
4256 */
4257 injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
4258
4259 },
4260
4261 eventNameDispatchConfigs: EventPluginRegistry.eventNameDispatchConfigs,
4262
4263 registrationNameModules: EventPluginRegistry.registrationNameModules,
4264
4265 /**
4266 * Stores `listener` at `listenerBank[registrationName][id]`. Is idempotent.
4267 *
4268 * @param {string} id ID of the DOM element.
4269 * @param {string} registrationName Name of listener (e.g. `onClick`).
4270 * @param {?function} listener The callback to store.
4271 */
4272 putListener: function (id, registrationName, listener) {
4273 !(typeof listener === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : undefined;
4274
4275 var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
4276 bankForRegistrationName[id] = listener;
4277
4278 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
4279 if (PluginModule && PluginModule.didPutListener) {
4280 PluginModule.didPutListener(id, registrationName, listener);
4281 }
4282 },
4283
4284 /**
4285 * @param {string} id ID of the DOM element.
4286 * @param {string} registrationName Name of listener (e.g. `onClick`).
4287 * @return {?function} The stored callback.
4288 */
4289 getListener: function (id, registrationName) {
4290 var bankForRegistrationName = listenerBank[registrationName];
4291 return bankForRegistrationName && bankForRegistrationName[id];
4292 },
4293
4294 /**
4295 * Deletes a listener from the registration bank.
4296 *
4297 * @param {string} id ID of the DOM element.
4298 * @param {string} registrationName Name of listener (e.g. `onClick`).
4299 */
4300 deleteListener: function (id, registrationName) {
4301 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
4302 if (PluginModule && PluginModule.willDeleteListener) {
4303 PluginModule.willDeleteListener(id, registrationName);
4304 }
4305
4306 var bankForRegistrationName = listenerBank[registrationName];
4307 // TODO: This should never be null -- when is it?
4308 if (bankForRegistrationName) {
4309 delete bankForRegistrationName[id];
4310 }
4311 },
4312
4313 /**
4314 * Deletes all listeners for the DOM element with the supplied ID.
4315 *
4316 * @param {string} id ID of the DOM element.
4317 */
4318 deleteAllListeners: function (id) {
4319 for (var registrationName in listenerBank) {
4320 if (!listenerBank[registrationName][id]) {
4321 continue;
4322 }
4323
4324 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
4325 if (PluginModule && PluginModule.willDeleteListener) {
4326 PluginModule.willDeleteListener(id, registrationName);
4327 }
4328
4329 delete listenerBank[registrationName][id];
4330 }
4331 },
4332
4333 /**
4334 * Allows registered plugins an opportunity to extract events from top-level
4335 * native browser events.
4336 *
4337 * @param {string} topLevelType Record from `EventConstants`.
4338 * @param {DOMEventTarget} topLevelTarget The listening component root node.
4339 * @param {string} topLevelTargetID ID of `topLevelTarget`.
4340 * @param {object} nativeEvent Native browser event.
4341 * @return {*} An accumulation of synthetic events.
4342 * @internal
4343 */
4344 extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
4345 var events;
4346 var plugins = EventPluginRegistry.plugins;
4347 for (var i = 0; i < plugins.length; i++) {
4348 // Not every plugin in the ordering may be loaded at runtime.
4349 var possiblePlugin = plugins[i];
4350 if (possiblePlugin) {
4351 var extractedEvents = possiblePlugin.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget);
4352 if (extractedEvents) {
4353 events = accumulateInto(events, extractedEvents);
4354 }
4355 }
4356 }
4357 return events;
4358 },
4359
4360 /**
4361 * Enqueues a synthetic event that should be dispatched when
4362 * `processEventQueue` is invoked.
4363 *
4364 * @param {*} events An accumulation of synthetic events.
4365 * @internal
4366 */
4367 enqueueEvents: function (events) {
4368 if (events) {
4369 eventQueue = accumulateInto(eventQueue, events);
4370 }
4371 },
4372
4373 /**
4374 * Dispatches all synthetic events on the event queue.
4375 *
4376 * @internal
4377 */
4378 processEventQueue: function (simulated) {
4379 // Set `eventQueue` to null before processing it so that we can tell if more
4380 // events get enqueued while processing.
4381 var processingEventQueue = eventQueue;
4382 eventQueue = null;
4383 if (simulated) {
4384 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
4385 } else {
4386 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
4387 }
4388 !!eventQueue ? process.env.NODE_ENV !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : undefined;
4389 // This would be a good time to rethrow if any of the event handlers threw.
4390 ReactErrorUtils.rethrowCaughtError();
4391 },
4392
4393 /**
4394 * These are needed for tests only. Do not use!
4395 */
4396 __purge: function () {
4397 listenerBank = {};
4398 },
4399
4400 __getListenerBank: function () {
4401 return listenerBank;
4402 }
4403
4404 };
4405
4406 module.exports = EventPluginHub;
4407 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
4408
4409/***/ }),
4410/* 33 */
4411/***/ (function(module, exports, __webpack_require__) {
4412
4413 /* WEBPACK VAR INJECTION */(function(process) {/**
4414 * Copyright 2013-2015, Facebook, Inc.
4415 * All rights reserved.
4416 *
4417 * This source code is licensed under the BSD-style license found in the
4418 * LICENSE file in the root directory of this source tree. An additional grant
4419 * of patent rights can be found in the PATENTS file in the same directory.
4420 *
4421 * @providesModule EventPluginRegistry
4422 * @typechecks static-only
4423 */
4424
4425 'use strict';
4426
4427 var invariant = __webpack_require__(14);
4428
4429 /**
4430 * Injectable ordering of event plugins.
4431 */
4432 var EventPluginOrder = null;
4433
4434 /**
4435 * Injectable mapping from names to event plugin modules.
4436 */
4437 var namesToPlugins = {};
4438
4439 /**
4440 * Recomputes the plugin list using the injected plugins and plugin ordering.
4441 *
4442 * @private
4443 */
4444 function recomputePluginOrdering() {
4445 if (!EventPluginOrder) {
4446 // Wait until an `EventPluginOrder` is injected.
4447 return;
4448 }
4449 for (var pluginName in namesToPlugins) {
4450 var PluginModule = namesToPlugins[pluginName];
4451 var pluginIndex = EventPluginOrder.indexOf(pluginName);
4452 !(pluginIndex > -1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : undefined;
4453 if (EventPluginRegistry.plugins[pluginIndex]) {
4454 continue;
4455 }
4456 !PluginModule.extractEvents ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : undefined;
4457 EventPluginRegistry.plugins[pluginIndex] = PluginModule;
4458 var publishedEvents = PluginModule.eventTypes;
4459 for (var eventName in publishedEvents) {
4460 !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : undefined;
4461 }
4462 }
4463 }
4464
4465 /**
4466 * Publishes an event so that it can be dispatched by the supplied plugin.
4467 *
4468 * @param {object} dispatchConfig Dispatch configuration for the event.
4469 * @param {object} PluginModule Plugin publishing the event.
4470 * @return {boolean} True if the event was successfully published.
4471 * @private
4472 */
4473 function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
4474 !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : undefined;
4475 EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
4476
4477 var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
4478 if (phasedRegistrationNames) {
4479 for (var phaseName in phasedRegistrationNames) {
4480 if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
4481 var phasedRegistrationName = phasedRegistrationNames[phaseName];
4482 publishRegistrationName(phasedRegistrationName, PluginModule, eventName);
4483 }
4484 }
4485 return true;
4486 } else if (dispatchConfig.registrationName) {
4487 publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName);
4488 return true;
4489 }
4490 return false;
4491 }
4492
4493 /**
4494 * Publishes a registration name that is used to identify dispatched events and
4495 * can be used with `EventPluginHub.putListener` to register listeners.
4496 *
4497 * @param {string} registrationName Registration name to add.
4498 * @param {object} PluginModule Plugin publishing the event.
4499 * @private
4500 */
4501 function publishRegistrationName(registrationName, PluginModule, eventName) {
4502 !!EventPluginRegistry.registrationNameModules[registrationName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : undefined;
4503 EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
4504 EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
4505 }
4506
4507 /**
4508 * Registers plugins so that they can extract and dispatch events.
4509 *
4510 * @see {EventPluginHub}
4511 */
4512 var EventPluginRegistry = {
4513
4514 /**
4515 * Ordered list of injected plugins.
4516 */
4517 plugins: [],
4518
4519 /**
4520 * Mapping from event name to dispatch config
4521 */
4522 eventNameDispatchConfigs: {},
4523
4524 /**
4525 * Mapping from registration name to plugin module
4526 */
4527 registrationNameModules: {},
4528
4529 /**
4530 * Mapping from registration name to event name
4531 */
4532 registrationNameDependencies: {},
4533
4534 /**
4535 * Injects an ordering of plugins (by plugin name). This allows the ordering
4536 * to be decoupled from injection of the actual plugins so that ordering is
4537 * always deterministic regardless of packaging, on-the-fly injection, etc.
4538 *
4539 * @param {array} InjectedEventPluginOrder
4540 * @internal
4541 * @see {EventPluginHub.injection.injectEventPluginOrder}
4542 */
4543 injectEventPluginOrder: function (InjectedEventPluginOrder) {
4544 !!EventPluginOrder ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than ' + 'once. You are likely trying to load more than one copy of React.') : invariant(false) : undefined;
4545 // Clone the ordering so it cannot be dynamically mutated.
4546 EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
4547 recomputePluginOrdering();
4548 },
4549
4550 /**
4551 * Injects plugins to be used by `EventPluginHub`. The plugin names must be
4552 * in the ordering injected by `injectEventPluginOrder`.
4553 *
4554 * Plugins can be injected as part of page initialization or on-the-fly.
4555 *
4556 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
4557 * @internal
4558 * @see {EventPluginHub.injection.injectEventPluginsByName}
4559 */
4560 injectEventPluginsByName: function (injectedNamesToPlugins) {
4561 var isOrderingDirty = false;
4562 for (var pluginName in injectedNamesToPlugins) {
4563 if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
4564 continue;
4565 }
4566 var PluginModule = injectedNamesToPlugins[pluginName];
4567 if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
4568 !!namesToPlugins[pluginName] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : undefined;
4569 namesToPlugins[pluginName] = PluginModule;
4570 isOrderingDirty = true;
4571 }
4572 }
4573 if (isOrderingDirty) {
4574 recomputePluginOrdering();
4575 }
4576 },
4577
4578 /**
4579 * Looks up the plugin for the supplied event.
4580 *
4581 * @param {object} event A synthetic event.
4582 * @return {?object} The plugin that created the supplied event.
4583 * @internal
4584 */
4585 getPluginModuleForEvent: function (event) {
4586 var dispatchConfig = event.dispatchConfig;
4587 if (dispatchConfig.registrationName) {
4588 return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
4589 }
4590 for (var phase in dispatchConfig.phasedRegistrationNames) {
4591 if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
4592 continue;
4593 }
4594 var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];
4595 if (PluginModule) {
4596 return PluginModule;
4597 }
4598 }
4599 return null;
4600 },
4601
4602 /**
4603 * Exposed for unit testing.
4604 * @private
4605 */
4606 _resetEventPlugins: function () {
4607 EventPluginOrder = null;
4608 for (var pluginName in namesToPlugins) {
4609 if (namesToPlugins.hasOwnProperty(pluginName)) {
4610 delete namesToPlugins[pluginName];
4611 }
4612 }
4613 EventPluginRegistry.plugins.length = 0;
4614
4615 var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
4616 for (var eventName in eventNameDispatchConfigs) {
4617 if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
4618 delete eventNameDispatchConfigs[eventName];
4619 }
4620 }
4621
4622 var registrationNameModules = EventPluginRegistry.registrationNameModules;
4623 for (var registrationName in registrationNameModules) {
4624 if (registrationNameModules.hasOwnProperty(registrationName)) {
4625 delete registrationNameModules[registrationName];
4626 }
4627 }
4628 }
4629
4630 };
4631
4632 module.exports = EventPluginRegistry;
4633 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
4634
4635/***/ }),
4636/* 34 */
4637/***/ (function(module, exports, __webpack_require__) {
4638
4639 /* WEBPACK VAR INJECTION */(function(process) {/**
4640 * Copyright 2013-2015, Facebook, Inc.
4641 * All rights reserved.
4642 *
4643 * This source code is licensed under the BSD-style license found in the
4644 * LICENSE file in the root directory of this source tree. An additional grant
4645 * of patent rights can be found in the PATENTS file in the same directory.
4646 *
4647 * @providesModule EventPluginUtils
4648 */
4649
4650 'use strict';
4651
4652 var EventConstants = __webpack_require__(31);
4653 var ReactErrorUtils = __webpack_require__(35);
4654
4655 var invariant = __webpack_require__(14);
4656 var warning = __webpack_require__(26);
4657
4658 /**
4659 * Injected dependencies:
4660 */
4661
4662 /**
4663 * - `Mount`: [required] Module that can convert between React dom IDs and
4664 * actual node references.
4665 */
4666 var injection = {
4667 Mount: null,
4668 injectMount: function (InjectedMount) {
4669 injection.Mount = InjectedMount;
4670 if (process.env.NODE_ENV !== 'production') {
4671 process.env.NODE_ENV !== 'production' ? warning(InjectedMount && InjectedMount.getNode && InjectedMount.getID, 'EventPluginUtils.injection.injectMount(...): Injected Mount ' + 'module is missing getNode or getID.') : undefined;
4672 }
4673 }
4674 };
4675
4676 var topLevelTypes = EventConstants.topLevelTypes;
4677
4678 function isEndish(topLevelType) {
4679 return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
4680 }
4681
4682 function isMoveish(topLevelType) {
4683 return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;
4684 }
4685 function isStartish(topLevelType) {
4686 return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;
4687 }
4688
4689 var validateEventDispatches;
4690 if (process.env.NODE_ENV !== 'production') {
4691 validateEventDispatches = function (event) {
4692 var dispatchListeners = event._dispatchListeners;
4693 var dispatchIDs = event._dispatchIDs;
4694
4695 var listenersIsArr = Array.isArray(dispatchListeners);
4696 var idsIsArr = Array.isArray(dispatchIDs);
4697 var IDsLen = idsIsArr ? dispatchIDs.length : dispatchIDs ? 1 : 0;
4698 var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
4699
4700 process.env.NODE_ENV !== 'production' ? warning(idsIsArr === listenersIsArr && IDsLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : undefined;
4701 };
4702 }
4703
4704 /**
4705 * Dispatch the event to the listener.
4706 * @param {SyntheticEvent} event SyntheticEvent to handle
4707 * @param {boolean} simulated If the event is simulated (changes exn behavior)
4708 * @param {function} listener Application-level callback
4709 * @param {string} domID DOM id to pass to the callback.
4710 */
4711 function executeDispatch(event, simulated, listener, domID) {
4712 var type = event.type || 'unknown-event';
4713 event.currentTarget = injection.Mount.getNode(domID);
4714 if (simulated) {
4715 ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event, domID);
4716 } else {
4717 ReactErrorUtils.invokeGuardedCallback(type, listener, event, domID);
4718 }
4719 event.currentTarget = null;
4720 }
4721
4722 /**
4723 * Standard/simple iteration through an event's collected dispatches.
4724 */
4725 function executeDispatchesInOrder(event, simulated) {
4726 var dispatchListeners = event._dispatchListeners;
4727 var dispatchIDs = event._dispatchIDs;
4728 if (process.env.NODE_ENV !== 'production') {
4729 validateEventDispatches(event);
4730 }
4731 if (Array.isArray(dispatchListeners)) {
4732 for (var i = 0; i < dispatchListeners.length; i++) {
4733 if (event.isPropagationStopped()) {
4734 break;
4735 }
4736 // Listeners and IDs are two parallel arrays that are always in sync.
4737 executeDispatch(event, simulated, dispatchListeners[i], dispatchIDs[i]);
4738 }
4739 } else if (dispatchListeners) {
4740 executeDispatch(event, simulated, dispatchListeners, dispatchIDs);
4741 }
4742 event._dispatchListeners = null;
4743 event._dispatchIDs = null;
4744 }
4745
4746 /**
4747 * Standard/simple iteration through an event's collected dispatches, but stops
4748 * at the first dispatch execution returning true, and returns that id.
4749 *
4750 * @return {?string} id of the first dispatch execution who's listener returns
4751 * true, or null if no listener returned true.
4752 */
4753 function executeDispatchesInOrderStopAtTrueImpl(event) {
4754 var dispatchListeners = event._dispatchListeners;
4755 var dispatchIDs = event._dispatchIDs;
4756 if (process.env.NODE_ENV !== 'production') {
4757 validateEventDispatches(event);
4758 }
4759 if (Array.isArray(dispatchListeners)) {
4760 for (var i = 0; i < dispatchListeners.length; i++) {
4761 if (event.isPropagationStopped()) {
4762 break;
4763 }
4764 // Listeners and IDs are two parallel arrays that are always in sync.
4765 if (dispatchListeners[i](event, dispatchIDs[i])) {
4766 return dispatchIDs[i];
4767 }
4768 }
4769 } else if (dispatchListeners) {
4770 if (dispatchListeners(event, dispatchIDs)) {
4771 return dispatchIDs;
4772 }
4773 }
4774 return null;
4775 }
4776
4777 /**
4778 * @see executeDispatchesInOrderStopAtTrueImpl
4779 */
4780 function executeDispatchesInOrderStopAtTrue(event) {
4781 var ret = executeDispatchesInOrderStopAtTrueImpl(event);
4782 event._dispatchIDs = null;
4783 event._dispatchListeners = null;
4784 return ret;
4785 }
4786
4787 /**
4788 * Execution of a "direct" dispatch - there must be at most one dispatch
4789 * accumulated on the event or it is considered an error. It doesn't really make
4790 * sense for an event with multiple dispatches (bubbled) to keep track of the
4791 * return values at each dispatch execution, but it does tend to make sense when
4792 * dealing with "direct" dispatches.
4793 *
4794 * @return {*} The return value of executing the single dispatch.
4795 */
4796 function executeDirectDispatch(event) {
4797 if (process.env.NODE_ENV !== 'production') {
4798 validateEventDispatches(event);
4799 }
4800 var dispatchListener = event._dispatchListeners;
4801 var dispatchID = event._dispatchIDs;
4802 !!Array.isArray(dispatchListener) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : undefined;
4803 var res = dispatchListener ? dispatchListener(event, dispatchID) : null;
4804 event._dispatchListeners = null;
4805 event._dispatchIDs = null;
4806 return res;
4807 }
4808
4809 /**
4810 * @param {SyntheticEvent} event
4811 * @return {boolean} True iff number of dispatches accumulated is greater than 0.
4812 */
4813 function hasDispatches(event) {
4814 return !!event._dispatchListeners;
4815 }
4816
4817 /**
4818 * General utilities that are useful in creating custom Event Plugins.
4819 */
4820 var EventPluginUtils = {
4821 isEndish: isEndish,
4822 isMoveish: isMoveish,
4823 isStartish: isStartish,
4824
4825 executeDirectDispatch: executeDirectDispatch,
4826 executeDispatchesInOrder: executeDispatchesInOrder,
4827 executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
4828 hasDispatches: hasDispatches,
4829
4830 getNode: function (id) {
4831 return injection.Mount.getNode(id);
4832 },
4833 getID: function (node) {
4834 return injection.Mount.getID(node);
4835 },
4836
4837 injection: injection
4838 };
4839
4840 module.exports = EventPluginUtils;
4841 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
4842
4843/***/ }),
4844/* 35 */
4845/***/ (function(module, exports, __webpack_require__) {
4846
4847 /* WEBPACK VAR INJECTION */(function(process) {/**
4848 * Copyright 2013-2015, Facebook, Inc.
4849 * All rights reserved.
4850 *
4851 * This source code is licensed under the BSD-style license found in the
4852 * LICENSE file in the root directory of this source tree. An additional grant
4853 * of patent rights can be found in the PATENTS file in the same directory.
4854 *
4855 * @providesModule ReactErrorUtils
4856 * @typechecks
4857 */
4858
4859 'use strict';
4860
4861 var caughtError = null;
4862
4863 /**
4864 * Call a function while guarding against errors that happens within it.
4865 *
4866 * @param {?String} name of the guard to use for logging or debugging
4867 * @param {Function} func The function to invoke
4868 * @param {*} a First argument
4869 * @param {*} b Second argument
4870 */
4871 function invokeGuardedCallback(name, func, a, b) {
4872 try {
4873 return func(a, b);
4874 } catch (x) {
4875 if (caughtError === null) {
4876 caughtError = x;
4877 }
4878 return undefined;
4879 }
4880 }
4881
4882 var ReactErrorUtils = {
4883 invokeGuardedCallback: invokeGuardedCallback,
4884
4885 /**
4886 * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
4887 * handler are sure to be rethrown by rethrowCaughtError.
4888 */
4889 invokeGuardedCallbackWithCatch: invokeGuardedCallback,
4890
4891 /**
4892 * During execution of guarded functions we will capture the first error which
4893 * we will rethrow to be handled by the top level error handler.
4894 */
4895 rethrowCaughtError: function () {
4896 if (caughtError) {
4897 var error = caughtError;
4898 caughtError = null;
4899 throw error;
4900 }
4901 }
4902 };
4903
4904 if (process.env.NODE_ENV !== 'production') {
4905 /**
4906 * To help development we can get better devtools integration by simulating a
4907 * real browser event.
4908 */
4909 if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
4910 var fakeNode = document.createElement('react');
4911 ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
4912 var boundFunc = func.bind(null, a, b);
4913 var evtType = 'react-' + name;
4914 fakeNode.addEventListener(evtType, boundFunc, false);
4915 var evt = document.createEvent('Event');
4916 evt.initEvent(evtType, false, false);
4917 fakeNode.dispatchEvent(evt);
4918 fakeNode.removeEventListener(evtType, boundFunc, false);
4919 };
4920 }
4921 }
4922
4923 module.exports = ReactErrorUtils;
4924 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
4925
4926/***/ }),
4927/* 36 */
4928/***/ (function(module, exports, __webpack_require__) {
4929
4930 /* WEBPACK VAR INJECTION */(function(process) {/**
4931 * Copyright 2014-2015, Facebook, Inc.
4932 * All rights reserved.
4933 *
4934 * This source code is licensed under the BSD-style license found in the
4935 * LICENSE file in the root directory of this source tree. An additional grant
4936 * of patent rights can be found in the PATENTS file in the same directory.
4937 *
4938 * @providesModule accumulateInto
4939 */
4940
4941 'use strict';
4942
4943 var invariant = __webpack_require__(14);
4944
4945 /**
4946 *
4947 * Accumulates items that must not be null or undefined into the first one. This
4948 * is used to conserve memory by avoiding array allocations, and thus sacrifices
4949 * API cleanness. Since `current` can be null before being passed in and not
4950 * null after this function, make sure to assign it back to `current`:
4951 *
4952 * `a = accumulateInto(a, b);`
4953 *
4954 * This API should be sparingly used. Try `accumulate` for something cleaner.
4955 *
4956 * @return {*|array<*>} An accumulation of items.
4957 */
4958
4959 function accumulateInto(current, next) {
4960 !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : undefined;
4961 if (current == null) {
4962 return next;
4963 }
4964
4965 // Both are not empty. Warning: Never call x.concat(y) when you are not
4966 // certain that x is an Array (x could be a string with concat method).
4967 var currentIsArray = Array.isArray(current);
4968 var nextIsArray = Array.isArray(next);
4969
4970 if (currentIsArray && nextIsArray) {
4971 current.push.apply(current, next);
4972 return current;
4973 }
4974
4975 if (currentIsArray) {
4976 current.push(next);
4977 return current;
4978 }
4979
4980 if (nextIsArray) {
4981 // A bit too dangerous to mutate `next`.
4982 return [current].concat(next);
4983 }
4984
4985 return [current, next];
4986 }
4987
4988 module.exports = accumulateInto;
4989 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
4990
4991/***/ }),
4992/* 37 */
4993/***/ (function(module, exports) {
4994
4995 /**
4996 * Copyright 2013-2015, Facebook, Inc.
4997 * All rights reserved.
4998 *
4999 * This source code is licensed under the BSD-style license found in the
5000 * LICENSE file in the root directory of this source tree. An additional grant
5001 * of patent rights can be found in the PATENTS file in the same directory.
5002 *
5003 * @providesModule forEachAccumulated
5004 */
5005
5006 'use strict';
5007
5008 /**
5009 * @param {array} arr an "accumulation" of items which is either an Array or
5010 * a single item. Useful when paired with the `accumulate` module. This is a
5011 * simple utility that allows us to reason about a collection of items, but
5012 * handling the case when there is exactly one item (and we do not need to
5013 * allocate an array).
5014 */
5015 var forEachAccumulated = function (arr, cb, scope) {
5016 if (Array.isArray(arr)) {
5017 arr.forEach(cb, scope);
5018 } else if (arr) {
5019 cb.call(scope, arr);
5020 }
5021 };
5022
5023 module.exports = forEachAccumulated;
5024
5025/***/ }),
5026/* 38 */
5027/***/ (function(module, exports, __webpack_require__) {
5028
5029 /**
5030 * Copyright 2013-2015, Facebook, Inc.
5031 * All rights reserved.
5032 *
5033 * This source code is licensed under the BSD-style license found in the
5034 * LICENSE file in the root directory of this source tree. An additional grant
5035 * of patent rights can be found in the PATENTS file in the same directory.
5036 *
5037 * @providesModule ReactEventEmitterMixin
5038 */
5039
5040 'use strict';
5041
5042 var EventPluginHub = __webpack_require__(32);
5043
5044 function runEventQueueInBatch(events) {
5045 EventPluginHub.enqueueEvents(events);
5046 EventPluginHub.processEventQueue(false);
5047 }
5048
5049 var ReactEventEmitterMixin = {
5050
5051 /**
5052 * Streams a fired top-level event to `EventPluginHub` where plugins have the
5053 * opportunity to create `ReactEvent`s to be dispatched.
5054 *
5055 * @param {string} topLevelType Record from `EventConstants`.
5056 * @param {object} topLevelTarget The listening component root node.
5057 * @param {string} topLevelTargetID ID of `topLevelTarget`.
5058 * @param {object} nativeEvent Native environment event.
5059 */
5060 handleTopLevel: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
5061 var events = EventPluginHub.extractEvents(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget);
5062 runEventQueueInBatch(events);
5063 }
5064 };
5065
5066 module.exports = ReactEventEmitterMixin;
5067
5068/***/ }),
5069/* 39 */
5070/***/ (function(module, exports) {
5071
5072 /**
5073 * Copyright 2013-2015, Facebook, Inc.
5074 * All rights reserved.
5075 *
5076 * This source code is licensed under the BSD-style license found in the
5077 * LICENSE file in the root directory of this source tree. An additional grant
5078 * of patent rights can be found in the PATENTS file in the same directory.
5079 *
5080 * @providesModule ViewportMetrics
5081 */
5082
5083 'use strict';
5084
5085 var ViewportMetrics = {
5086
5087 currentScrollLeft: 0,
5088
5089 currentScrollTop: 0,
5090
5091 refreshScrollValues: function (scrollPosition) {
5092 ViewportMetrics.currentScrollLeft = scrollPosition.x;
5093 ViewportMetrics.currentScrollTop = scrollPosition.y;
5094 }
5095
5096 };
5097
5098 module.exports = ViewportMetrics;
5099
5100/***/ }),
5101/* 40 */
5102/***/ (function(module, exports) {
5103
5104 /**
5105 * Copyright 2014-2015, Facebook, Inc.
5106 * All rights reserved.
5107 *
5108 * This source code is licensed under the BSD-style license found in the
5109 * LICENSE file in the root directory of this source tree. An additional grant
5110 * of patent rights can be found in the PATENTS file in the same directory.
5111 *
5112 * @providesModule Object.assign
5113 */
5114
5115 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign
5116
5117 'use strict';
5118
5119 function assign(target, sources) {
5120 if (target == null) {
5121 throw new TypeError('Object.assign target cannot be null or undefined');
5122 }
5123
5124 var to = Object(target);
5125 var hasOwnProperty = Object.prototype.hasOwnProperty;
5126
5127 for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) {
5128 var nextSource = arguments[nextIndex];
5129 if (nextSource == null) {
5130 continue;
5131 }
5132
5133 var from = Object(nextSource);
5134
5135 // We don't currently support accessors nor proxies. Therefore this
5136 // copy cannot throw. If we ever supported this then we must handle
5137 // exceptions and side-effects. We don't support symbols so they won't
5138 // be transferred.
5139
5140 for (var key in from) {
5141 if (hasOwnProperty.call(from, key)) {
5142 to[key] = from[key];
5143 }
5144 }
5145 }
5146
5147 return to;
5148 }
5149
5150 module.exports = assign;
5151
5152/***/ }),
5153/* 41 */
5154/***/ (function(module, exports, __webpack_require__) {
5155
5156 /**
5157 * Copyright 2013-2015, Facebook, Inc.
5158 * All rights reserved.
5159 *
5160 * This source code is licensed under the BSD-style license found in the
5161 * LICENSE file in the root directory of this source tree. An additional grant
5162 * of patent rights can be found in the PATENTS file in the same directory.
5163 *
5164 * @providesModule isEventSupported
5165 */
5166
5167 'use strict';
5168
5169 var ExecutionEnvironment = __webpack_require__(10);
5170
5171 var useHasFeature;
5172 if (ExecutionEnvironment.canUseDOM) {
5173 useHasFeature = document.implementation && document.implementation.hasFeature &&
5174 // always returns true in newer browsers as per the standard.
5175 // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
5176 document.implementation.hasFeature('', '') !== true;
5177 }
5178
5179 /**
5180 * Checks if an event is supported in the current execution environment.
5181 *
5182 * NOTE: This will not work correctly for non-generic events such as `change`,
5183 * `reset`, `load`, `error`, and `select`.
5184 *
5185 * Borrows from Modernizr.
5186 *
5187 * @param {string} eventNameSuffix Event name, e.g. "click".
5188 * @param {?boolean} capture Check if the capture phase is supported.
5189 * @return {boolean} True if the event is supported.
5190 * @internal
5191 * @license Modernizr 3.0.0pre (Custom Build) | MIT
5192 */
5193 function isEventSupported(eventNameSuffix, capture) {
5194 if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
5195 return false;
5196 }
5197
5198 var eventName = 'on' + eventNameSuffix;
5199 var isSupported = (eventName in document);
5200
5201 if (!isSupported) {
5202 var element = document.createElement('div');
5203 element.setAttribute(eventName, 'return;');
5204 isSupported = typeof element[eventName] === 'function';
5205 }
5206
5207 if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
5208 // This is the only way to test support for the `wheel` event in IE9+.
5209 isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
5210 }
5211
5212 return isSupported;
5213 }
5214
5215 module.exports = isEventSupported;
5216
5217/***/ }),
5218/* 42 */
5219/***/ (function(module, exports) {
5220
5221 /**
5222 * Copyright 2013-2015, Facebook, Inc.
5223 * All rights reserved.
5224 *
5225 * This source code is licensed under the BSD-style license found in the
5226 * LICENSE file in the root directory of this source tree. An additional grant
5227 * of patent rights can be found in the PATENTS file in the same directory.
5228 *
5229 * @providesModule ReactDOMFeatureFlags
5230 */
5231
5232 'use strict';
5233
5234 var ReactDOMFeatureFlags = {
5235 useCreateElement: false
5236 };
5237
5238 module.exports = ReactDOMFeatureFlags;
5239
5240/***/ }),
5241/* 43 */
5242/***/ (function(module, exports, __webpack_require__) {
5243
5244 /* WEBPACK VAR INJECTION */(function(process) {/**
5245 * Copyright 2014-2015, Facebook, Inc.
5246 * All rights reserved.
5247 *
5248 * This source code is licensed under the BSD-style license found in the
5249 * LICENSE file in the root directory of this source tree. An additional grant
5250 * of patent rights can be found in the PATENTS file in the same directory.
5251 *
5252 * @providesModule ReactElement
5253 */
5254
5255 'use strict';
5256
5257 var ReactCurrentOwner = __webpack_require__(6);
5258
5259 var assign = __webpack_require__(40);
5260 var canDefineProperty = __webpack_require__(44);
5261
5262 // The Symbol used to tag the ReactElement type. If there is no native Symbol
5263 // nor polyfill, then a plain number is used for performance.
5264 var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
5265
5266 var RESERVED_PROPS = {
5267 key: true,
5268 ref: true,
5269 __self: true,
5270 __source: true
5271 };
5272
5273 /**
5274 * Base constructor for all React elements. This is only used to make this
5275 * work with a dynamic instanceof check. Nothing should live on this prototype.
5276 *
5277 * @param {*} type
5278 * @param {*} key
5279 * @param {string|object} ref
5280 * @param {*} self A *temporary* helper to detect places where `this` is
5281 * different from the `owner` when React.createElement is called, so that we
5282 * can warn. We want to get rid of owner and replace string `ref`s with arrow
5283 * functions, and as long as `this` and owner are the same, there will be no
5284 * change in behavior.
5285 * @param {*} source An annotation object (added by a transpiler or otherwise)
5286 * indicating filename, line number, and/or other information.
5287 * @param {*} owner
5288 * @param {*} props
5289 * @internal
5290 */
5291 var ReactElement = function (type, key, ref, self, source, owner, props) {
5292 var element = {
5293 // This tag allow us to uniquely identify this as a React Element
5294 $$typeof: REACT_ELEMENT_TYPE,
5295
5296 // Built-in properties that belong on the element
5297 type: type,
5298 key: key,
5299 ref: ref,
5300 props: props,
5301
5302 // Record the component responsible for creating this element.
5303 _owner: owner
5304 };
5305
5306 if (process.env.NODE_ENV !== 'production') {
5307 // The validation flag is currently mutative. We put it on
5308 // an external backing store so that we can freeze the whole object.
5309 // This can be replaced with a WeakMap once they are implemented in
5310 // commonly used development environments.
5311 element._store = {};
5312
5313 // To make comparing ReactElements easier for testing purposes, we make
5314 // the validation flag non-enumerable (where possible, which should
5315 // include every environment we run tests in), so the test framework
5316 // ignores it.
5317 if (canDefineProperty) {
5318 Object.defineProperty(element._store, 'validated', {
5319 configurable: false,
5320 enumerable: false,
5321 writable: true,
5322 value: false
5323 });
5324 // self and source are DEV only properties.
5325 Object.defineProperty(element, '_self', {
5326 configurable: false,
5327 enumerable: false,
5328 writable: false,
5329 value: self
5330 });
5331 // Two elements created in two different places should be considered
5332 // equal for testing purposes and therefore we hide it from enumeration.
5333 Object.defineProperty(element, '_source', {
5334 configurable: false,
5335 enumerable: false,
5336 writable: false,
5337 value: source
5338 });
5339 } else {
5340 element._store.validated = false;
5341 element._self = self;
5342 element._source = source;
5343 }
5344 Object.freeze(element.props);
5345 Object.freeze(element);
5346 }
5347
5348 return element;
5349 };
5350
5351 ReactElement.createElement = function (type, config, children) {
5352 var propName;
5353
5354 // Reserved names are extracted
5355 var props = {};
5356
5357 var key = null;
5358 var ref = null;
5359 var self = null;
5360 var source = null;
5361
5362 if (config != null) {
5363 ref = config.ref === undefined ? null : config.ref;
5364 key = config.key === undefined ? null : '' + config.key;
5365 self = config.__self === undefined ? null : config.__self;
5366 source = config.__source === undefined ? null : config.__source;
5367 // Remaining properties are added to a new props object
5368 for (propName in config) {
5369 if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
5370 props[propName] = config[propName];
5371 }
5372 }
5373 }
5374
5375 // Children can be more than one argument, and those are transferred onto
5376 // the newly allocated props object.
5377 var childrenLength = arguments.length - 2;
5378 if (childrenLength === 1) {
5379 props.children = children;
5380 } else if (childrenLength > 1) {
5381 var childArray = Array(childrenLength);
5382 for (var i = 0; i < childrenLength; i++) {
5383 childArray[i] = arguments[i + 2];
5384 }
5385 props.children = childArray;
5386 }
5387
5388 // Resolve default props
5389 if (type && type.defaultProps) {
5390 var defaultProps = type.defaultProps;
5391 for (propName in defaultProps) {
5392 if (typeof props[propName] === 'undefined') {
5393 props[propName] = defaultProps[propName];
5394 }
5395 }
5396 }
5397
5398 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
5399 };
5400
5401 ReactElement.createFactory = function (type) {
5402 var factory = ReactElement.createElement.bind(null, type);
5403 // Expose the type on the factory and the prototype so that it can be
5404 // easily accessed on elements. E.g. `<Foo />.type === Foo`.
5405 // This should not be named `constructor` since this may not be the function
5406 // that created the element, and it may not even be a constructor.
5407 // Legacy hook TODO: Warn if this is accessed
5408 factory.type = type;
5409 return factory;
5410 };
5411
5412 ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
5413 var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
5414
5415 return newElement;
5416 };
5417
5418 ReactElement.cloneAndReplaceProps = function (oldElement, newProps) {
5419 var newElement = ReactElement(oldElement.type, oldElement.key, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, newProps);
5420
5421 if (process.env.NODE_ENV !== 'production') {
5422 // If the key on the original is valid, then the clone is valid
5423 newElement._store.validated = oldElement._store.validated;
5424 }
5425
5426 return newElement;
5427 };
5428
5429 ReactElement.cloneElement = function (element, config, children) {
5430 var propName;
5431
5432 // Original props are copied
5433 var props = assign({}, element.props);
5434
5435 // Reserved names are extracted
5436 var key = element.key;
5437 var ref = element.ref;
5438 // Self is preserved since the owner is preserved.
5439 var self = element._self;
5440 // Source is preserved since cloneElement is unlikely to be targeted by a
5441 // transpiler, and the original source is probably a better indicator of the
5442 // true owner.
5443 var source = element._source;
5444
5445 // Owner will be preserved, unless ref is overridden
5446 var owner = element._owner;
5447
5448 if (config != null) {
5449 if (config.ref !== undefined) {
5450 // Silently steal the ref from the parent.
5451 ref = config.ref;
5452 owner = ReactCurrentOwner.current;
5453 }
5454 if (config.key !== undefined) {
5455 key = '' + config.key;
5456 }
5457 // Remaining properties override existing props
5458 for (propName in config) {
5459 if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
5460 props[propName] = config[propName];
5461 }
5462 }
5463 }
5464
5465 // Children can be more than one argument, and those are transferred onto
5466 // the newly allocated props object.
5467 var childrenLength = arguments.length - 2;
5468 if (childrenLength === 1) {
5469 props.children = children;
5470 } else if (childrenLength > 1) {
5471 var childArray = Array(childrenLength);
5472 for (var i = 0; i < childrenLength; i++) {
5473 childArray[i] = arguments[i + 2];
5474 }
5475 props.children = childArray;
5476 }
5477
5478 return ReactElement(element.type, key, ref, self, source, owner, props);
5479 };
5480
5481 /**
5482 * @param {?object} object
5483 * @return {boolean} True if `object` is a valid component.
5484 * @final
5485 */
5486 ReactElement.isValidElement = function (object) {
5487 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
5488 };
5489
5490 module.exports = ReactElement;
5491 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
5492
5493/***/ }),
5494/* 44 */
5495/***/ (function(module, exports, __webpack_require__) {
5496
5497 /* WEBPACK VAR INJECTION */(function(process) {/**
5498 * Copyright 2013-2015, Facebook, Inc.
5499 * All rights reserved.
5500 *
5501 * This source code is licensed under the BSD-style license found in the
5502 * LICENSE file in the root directory of this source tree. An additional grant
5503 * of patent rights can be found in the PATENTS file in the same directory.
5504 *
5505 * @providesModule canDefineProperty
5506 */
5507
5508 'use strict';
5509
5510 var canDefineProperty = false;
5511 if (process.env.NODE_ENV !== 'production') {
5512 try {
5513 Object.defineProperty({}, 'x', { get: function () {} });
5514 canDefineProperty = true;
5515 } catch (x) {
5516 // IE will fail on defineProperty
5517 }
5518 }
5519
5520 module.exports = canDefineProperty;
5521 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
5522
5523/***/ }),
5524/* 45 */
5525/***/ (function(module, exports) {
5526
5527 /**
5528 * Copyright 2014-2015, Facebook, Inc.
5529 * All rights reserved.
5530 *
5531 * This source code is licensed under the BSD-style license found in the
5532 * LICENSE file in the root directory of this source tree. An additional grant
5533 * of patent rights can be found in the PATENTS file in the same directory.
5534 *
5535 * @providesModule ReactEmptyComponentRegistry
5536 */
5537
5538 'use strict';
5539
5540 // This registry keeps track of the React IDs of the components that rendered to
5541 // `null` (in reality a placeholder such as `noscript`)
5542 var nullComponentIDsRegistry = {};
5543
5544 /**
5545 * @param {string} id Component's `_rootNodeID`.
5546 * @return {boolean} True if the component is rendered to null.
5547 */
5548 function isNullComponentID(id) {
5549 return !!nullComponentIDsRegistry[id];
5550 }
5551
5552 /**
5553 * Mark the component as having rendered to null.
5554 * @param {string} id Component's `_rootNodeID`.
5555 */
5556 function registerNullComponentID(id) {
5557 nullComponentIDsRegistry[id] = true;
5558 }
5559
5560 /**
5561 * Unmark the component as having rendered to null: it renders to something now.
5562 * @param {string} id Component's `_rootNodeID`.
5563 */
5564 function deregisterNullComponentID(id) {
5565 delete nullComponentIDsRegistry[id];
5566 }
5567
5568 var ReactEmptyComponentRegistry = {
5569 isNullComponentID: isNullComponentID,
5570 registerNullComponentID: registerNullComponentID,
5571 deregisterNullComponentID: deregisterNullComponentID
5572 };
5573
5574 module.exports = ReactEmptyComponentRegistry;
5575
5576/***/ }),
5577/* 46 */
5578/***/ (function(module, exports, __webpack_require__) {
5579
5580 /* WEBPACK VAR INJECTION */(function(process) {/**
5581 * Copyright 2013-2015, Facebook, Inc.
5582 * All rights reserved.
5583 *
5584 * This source code is licensed under the BSD-style license found in the
5585 * LICENSE file in the root directory of this source tree. An additional grant
5586 * of patent rights can be found in the PATENTS file in the same directory.
5587 *
5588 * @providesModule ReactInstanceHandles
5589 * @typechecks static-only
5590 */
5591
5592 'use strict';
5593
5594 var ReactRootIndex = __webpack_require__(47);
5595
5596 var invariant = __webpack_require__(14);
5597
5598 var SEPARATOR = '.';
5599 var SEPARATOR_LENGTH = SEPARATOR.length;
5600
5601 /**
5602 * Maximum depth of traversals before we consider the possibility of a bad ID.
5603 */
5604 var MAX_TREE_DEPTH = 10000;
5605
5606 /**
5607 * Creates a DOM ID prefix to use when mounting React components.
5608 *
5609 * @param {number} index A unique integer
5610 * @return {string} React root ID.
5611 * @internal
5612 */
5613 function getReactRootIDString(index) {
5614 return SEPARATOR + index.toString(36);
5615 }
5616
5617 /**
5618 * Checks if a character in the supplied ID is a separator or the end.
5619 *
5620 * @param {string} id A React DOM ID.
5621 * @param {number} index Index of the character to check.
5622 * @return {boolean} True if the character is a separator or end of the ID.
5623 * @private
5624 */
5625 function isBoundary(id, index) {
5626 return id.charAt(index) === SEPARATOR || index === id.length;
5627 }
5628
5629 /**
5630 * Checks if the supplied string is a valid React DOM ID.
5631 *
5632 * @param {string} id A React DOM ID, maybe.
5633 * @return {boolean} True if the string is a valid React DOM ID.
5634 * @private
5635 */
5636 function isValidID(id) {
5637 return id === '' || id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR;
5638 }
5639
5640 /**
5641 * Checks if the first ID is an ancestor of or equal to the second ID.
5642 *
5643 * @param {string} ancestorID
5644 * @param {string} descendantID
5645 * @return {boolean} True if `ancestorID` is an ancestor of `descendantID`.
5646 * @internal
5647 */
5648 function isAncestorIDOf(ancestorID, descendantID) {
5649 return descendantID.indexOf(ancestorID) === 0 && isBoundary(descendantID, ancestorID.length);
5650 }
5651
5652 /**
5653 * Gets the parent ID of the supplied React DOM ID, `id`.
5654 *
5655 * @param {string} id ID of a component.
5656 * @return {string} ID of the parent, or an empty string.
5657 * @private
5658 */
5659 function getParentID(id) {
5660 return id ? id.substr(0, id.lastIndexOf(SEPARATOR)) : '';
5661 }
5662
5663 /**
5664 * Gets the next DOM ID on the tree path from the supplied `ancestorID` to the
5665 * supplied `destinationID`. If they are equal, the ID is returned.
5666 *
5667 * @param {string} ancestorID ID of an ancestor node of `destinationID`.
5668 * @param {string} destinationID ID of the destination node.
5669 * @return {string} Next ID on the path from `ancestorID` to `destinationID`.
5670 * @private
5671 */
5672 function getNextDescendantID(ancestorID, destinationID) {
5673 !(isValidID(ancestorID) && isValidID(destinationID)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.', ancestorID, destinationID) : invariant(false) : undefined;
5674 !isAncestorIDOf(ancestorID, destinationID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getNextDescendantID(...): React has made an invalid assumption about ' + 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.', ancestorID, destinationID) : invariant(false) : undefined;
5675 if (ancestorID === destinationID) {
5676 return ancestorID;
5677 }
5678 // Skip over the ancestor and the immediate separator. Traverse until we hit
5679 // another separator or we reach the end of `destinationID`.
5680 var start = ancestorID.length + SEPARATOR_LENGTH;
5681 var i;
5682 for (i = start; i < destinationID.length; i++) {
5683 if (isBoundary(destinationID, i)) {
5684 break;
5685 }
5686 }
5687 return destinationID.substr(0, i);
5688 }
5689
5690 /**
5691 * Gets the nearest common ancestor ID of two IDs.
5692 *
5693 * Using this ID scheme, the nearest common ancestor ID is the longest common
5694 * prefix of the two IDs that immediately preceded a "marker" in both strings.
5695 *
5696 * @param {string} oneID
5697 * @param {string} twoID
5698 * @return {string} Nearest common ancestor ID, or the empty string if none.
5699 * @private
5700 */
5701 function getFirstCommonAncestorID(oneID, twoID) {
5702 var minLength = Math.min(oneID.length, twoID.length);
5703 if (minLength === 0) {
5704 return '';
5705 }
5706 var lastCommonMarkerIndex = 0;
5707 // Use `<=` to traverse until the "EOL" of the shorter string.
5708 for (var i = 0; i <= minLength; i++) {
5709 if (isBoundary(oneID, i) && isBoundary(twoID, i)) {
5710 lastCommonMarkerIndex = i;
5711 } else if (oneID.charAt(i) !== twoID.charAt(i)) {
5712 break;
5713 }
5714 }
5715 var longestCommonID = oneID.substr(0, lastCommonMarkerIndex);
5716 !isValidID(longestCommonID) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s', oneID, twoID, longestCommonID) : invariant(false) : undefined;
5717 return longestCommonID;
5718 }
5719
5720 /**
5721 * Traverses the parent path between two IDs (either up or down). The IDs must
5722 * not be the same, and there must exist a parent path between them. If the
5723 * callback returns `false`, traversal is stopped.
5724 *
5725 * @param {?string} start ID at which to start traversal.
5726 * @param {?string} stop ID at which to end traversal.
5727 * @param {function} cb Callback to invoke each ID with.
5728 * @param {*} arg Argument to invoke the callback with.
5729 * @param {?boolean} skipFirst Whether or not to skip the first node.
5730 * @param {?boolean} skipLast Whether or not to skip the last node.
5731 * @private
5732 */
5733 function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) {
5734 start = start || '';
5735 stop = stop || '';
5736 !(start !== stop) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.', start) : invariant(false) : undefined;
5737 var traverseUp = isAncestorIDOf(stop, start);
5738 !(traverseUp || isAncestorIDOf(start, stop)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' + 'not have a parent path.', start, stop) : invariant(false) : undefined;
5739 // Traverse from `start` to `stop` one depth at a time.
5740 var depth = 0;
5741 var traverse = traverseUp ? getParentID : getNextDescendantID;
5742 for (var id = start;; /* until break */id = traverse(id, stop)) {
5743 var ret;
5744 if ((!skipFirst || id !== start) && (!skipLast || id !== stop)) {
5745 ret = cb(id, traverseUp, arg);
5746 }
5747 if (ret === false || id === stop) {
5748 // Only break //after// visiting `stop`.
5749 break;
5750 }
5751 !(depth++ < MAX_TREE_DEPTH) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' + 'traversing the React DOM ID tree. This may be due to malformed IDs: %s', start, stop, id) : invariant(false) : undefined;
5752 }
5753 }
5754
5755 /**
5756 * Manages the IDs assigned to DOM representations of React components. This
5757 * uses a specific scheme in order to traverse the DOM efficiently (e.g. in
5758 * order to simulate events).
5759 *
5760 * @internal
5761 */
5762 var ReactInstanceHandles = {
5763
5764 /**
5765 * Constructs a React root ID
5766 * @return {string} A React root ID.
5767 */
5768 createReactRootID: function () {
5769 return getReactRootIDString(ReactRootIndex.createReactRootIndex());
5770 },
5771
5772 /**
5773 * Constructs a React ID by joining a root ID with a name.
5774 *
5775 * @param {string} rootID Root ID of a parent component.
5776 * @param {string} name A component's name (as flattened children).
5777 * @return {string} A React ID.
5778 * @internal
5779 */
5780 createReactID: function (rootID, name) {
5781 return rootID + name;
5782 },
5783
5784 /**
5785 * Gets the DOM ID of the React component that is the root of the tree that
5786 * contains the React component with the supplied DOM ID.
5787 *
5788 * @param {string} id DOM ID of a React component.
5789 * @return {?string} DOM ID of the React component that is the root.
5790 * @internal
5791 */
5792 getReactRootIDFromNodeID: function (id) {
5793 if (id && id.charAt(0) === SEPARATOR && id.length > 1) {
5794 var index = id.indexOf(SEPARATOR, 1);
5795 return index > -1 ? id.substr(0, index) : id;
5796 }
5797 return null;
5798 },
5799
5800 /**
5801 * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
5802 * should would receive a `mouseEnter` or `mouseLeave` event.
5803 *
5804 * NOTE: Does not invoke the callback on the nearest common ancestor because
5805 * nothing "entered" or "left" that element.
5806 *
5807 * @param {string} leaveID ID being left.
5808 * @param {string} enterID ID being entered.
5809 * @param {function} cb Callback to invoke on each entered/left ID.
5810 * @param {*} upArg Argument to invoke the callback with on left IDs.
5811 * @param {*} downArg Argument to invoke the callback with on entered IDs.
5812 * @internal
5813 */
5814 traverseEnterLeave: function (leaveID, enterID, cb, upArg, downArg) {
5815 var ancestorID = getFirstCommonAncestorID(leaveID, enterID);
5816 if (ancestorID !== leaveID) {
5817 traverseParentPath(leaveID, ancestorID, cb, upArg, false, true);
5818 }
5819 if (ancestorID !== enterID) {
5820 traverseParentPath(ancestorID, enterID, cb, downArg, true, false);
5821 }
5822 },
5823
5824 /**
5825 * Simulates the traversal of a two-phase, capture/bubble event dispatch.
5826 *
5827 * NOTE: This traversal happens on IDs without touching the DOM.
5828 *
5829 * @param {string} targetID ID of the target node.
5830 * @param {function} cb Callback to invoke.
5831 * @param {*} arg Argument to invoke the callback with.
5832 * @internal
5833 */
5834 traverseTwoPhase: function (targetID, cb, arg) {
5835 if (targetID) {
5836 traverseParentPath('', targetID, cb, arg, true, false);
5837 traverseParentPath(targetID, '', cb, arg, false, true);
5838 }
5839 },
5840
5841 /**
5842 * Same as `traverseTwoPhase` but skips the `targetID`.
5843 */
5844 traverseTwoPhaseSkipTarget: function (targetID, cb, arg) {
5845 if (targetID) {
5846 traverseParentPath('', targetID, cb, arg, true, true);
5847 traverseParentPath(targetID, '', cb, arg, true, true);
5848 }
5849 },
5850
5851 /**
5852 * Traverse a node ID, calling the supplied `cb` for each ancestor ID. For
5853 * example, passing `.0.$row-0.1` would result in `cb` getting called
5854 * with `.0`, `.0.$row-0`, and `.0.$row-0.1`.
5855 *
5856 * NOTE: This traversal happens on IDs without touching the DOM.
5857 *
5858 * @param {string} targetID ID of the target node.
5859 * @param {function} cb Callback to invoke.
5860 * @param {*} arg Argument to invoke the callback with.
5861 * @internal
5862 */
5863 traverseAncestors: function (targetID, cb, arg) {
5864 traverseParentPath('', targetID, cb, arg, true, false);
5865 },
5866
5867 getFirstCommonAncestorID: getFirstCommonAncestorID,
5868
5869 /**
5870 * Exposed for unit testing.
5871 * @private
5872 */
5873 _getNextDescendantID: getNextDescendantID,
5874
5875 isAncestorIDOf: isAncestorIDOf,
5876
5877 SEPARATOR: SEPARATOR
5878
5879 };
5880
5881 module.exports = ReactInstanceHandles;
5882 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
5883
5884/***/ }),
5885/* 47 */
5886/***/ (function(module, exports) {
5887
5888 /**
5889 * Copyright 2013-2015, Facebook, Inc.
5890 * All rights reserved.
5891 *
5892 * This source code is licensed under the BSD-style license found in the
5893 * LICENSE file in the root directory of this source tree. An additional grant
5894 * of patent rights can be found in the PATENTS file in the same directory.
5895 *
5896 * @providesModule ReactRootIndex
5897 * @typechecks
5898 */
5899
5900 'use strict';
5901
5902 var ReactRootIndexInjection = {
5903 /**
5904 * @param {function} _createReactRootIndex
5905 */
5906 injectCreateReactRootIndex: function (_createReactRootIndex) {
5907 ReactRootIndex.createReactRootIndex = _createReactRootIndex;
5908 }
5909 };
5910
5911 var ReactRootIndex = {
5912 createReactRootIndex: null,
5913 injection: ReactRootIndexInjection
5914 };
5915
5916 module.exports = ReactRootIndex;
5917
5918/***/ }),
5919/* 48 */
5920/***/ (function(module, exports) {
5921
5922 /**
5923 * Copyright 2013-2015, Facebook, Inc.
5924 * All rights reserved.
5925 *
5926 * This source code is licensed under the BSD-style license found in the
5927 * LICENSE file in the root directory of this source tree. An additional grant
5928 * of patent rights can be found in the PATENTS file in the same directory.
5929 *
5930 * @providesModule ReactInstanceMap
5931 */
5932
5933 'use strict';
5934
5935 /**
5936 * `ReactInstanceMap` maintains a mapping from a public facing stateful
5937 * instance (key) and the internal representation (value). This allows public
5938 * methods to accept the user facing instance as an argument and map them back
5939 * to internal methods.
5940 */
5941
5942 // TODO: Replace this with ES6: var ReactInstanceMap = new Map();
5943 var ReactInstanceMap = {
5944
5945 /**
5946 * This API should be called `delete` but we'd have to make sure to always
5947 * transform these to strings for IE support. When this transform is fully
5948 * supported we can rename it.
5949 */
5950 remove: function (key) {
5951 key._reactInternalInstance = undefined;
5952 },
5953
5954 get: function (key) {
5955 return key._reactInternalInstance;
5956 },
5957
5958 has: function (key) {
5959 return key._reactInternalInstance !== undefined;
5960 },
5961
5962 set: function (key, value) {
5963 key._reactInternalInstance = value;
5964 }
5965
5966 };
5967
5968 module.exports = ReactInstanceMap;
5969
5970/***/ }),
5971/* 49 */
5972/***/ (function(module, exports, __webpack_require__) {
5973
5974 /**
5975 * Copyright 2013-2015, Facebook, Inc.
5976 * All rights reserved.
5977 *
5978 * This source code is licensed under the BSD-style license found in the
5979 * LICENSE file in the root directory of this source tree. An additional grant
5980 * of patent rights can be found in the PATENTS file in the same directory.
5981 *
5982 * @providesModule ReactMarkupChecksum
5983 */
5984
5985 'use strict';
5986
5987 var adler32 = __webpack_require__(50);
5988
5989 var TAG_END = /\/?>/;
5990
5991 var ReactMarkupChecksum = {
5992 CHECKSUM_ATTR_NAME: 'data-react-checksum',
5993
5994 /**
5995 * @param {string} markup Markup string
5996 * @return {string} Markup string with checksum attribute attached
5997 */
5998 addChecksumToMarkup: function (markup) {
5999 var checksum = adler32(markup);
6000
6001 // Add checksum (handle both parent tags and self-closing tags)
6002 return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
6003 },
6004
6005 /**
6006 * @param {string} markup to use
6007 * @param {DOMElement} element root React element
6008 * @returns {boolean} whether or not the markup is the same
6009 */
6010 canReuseMarkup: function (markup, element) {
6011 var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
6012 existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
6013 var markupChecksum = adler32(markup);
6014 return markupChecksum === existingChecksum;
6015 }
6016 };
6017
6018 module.exports = ReactMarkupChecksum;
6019
6020/***/ }),
6021/* 50 */
6022/***/ (function(module, exports) {
6023
6024 /**
6025 * Copyright 2013-2015, Facebook, Inc.
6026 * All rights reserved.
6027 *
6028 * This source code is licensed under the BSD-style license found in the
6029 * LICENSE file in the root directory of this source tree. An additional grant
6030 * of patent rights can be found in the PATENTS file in the same directory.
6031 *
6032 * @providesModule adler32
6033 */
6034
6035 'use strict';
6036
6037 var MOD = 65521;
6038
6039 // adler32 is not cryptographically strong, and is only used to sanity check that
6040 // markup generated on the server matches the markup generated on the client.
6041 // This implementation (a modified version of the SheetJS version) has been optimized
6042 // for our use case, at the expense of conforming to the adler32 specification
6043 // for non-ascii inputs.
6044 function adler32(data) {
6045 var a = 1;
6046 var b = 0;
6047 var i = 0;
6048 var l = data.length;
6049 var m = l & ~0x3;
6050 while (i < m) {
6051 for (; i < Math.min(i + 4096, m); i += 4) {
6052 b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
6053 }
6054 a %= MOD;
6055 b %= MOD;
6056 }
6057 for (; i < l; i++) {
6058 b += a += data.charCodeAt(i);
6059 }
6060 a %= MOD;
6061 b %= MOD;
6062 return a | b << 16;
6063 }
6064
6065 module.exports = adler32;
6066
6067/***/ }),
6068/* 51 */
6069/***/ (function(module, exports, __webpack_require__) {
6070
6071 /**
6072 * Copyright 2013-2015, Facebook, Inc.
6073 * All rights reserved.
6074 *
6075 * This source code is licensed under the BSD-style license found in the
6076 * LICENSE file in the root directory of this source tree. An additional grant
6077 * of patent rights can be found in the PATENTS file in the same directory.
6078 *
6079 * @providesModule ReactReconciler
6080 */
6081
6082 'use strict';
6083
6084 var ReactRef = __webpack_require__(52);
6085
6086 /**
6087 * Helper to call ReactRef.attachRefs with this composite component, split out
6088 * to avoid allocations in the transaction mount-ready queue.
6089 */
6090 function attachRefs() {
6091 ReactRef.attachRefs(this, this._currentElement);
6092 }
6093
6094 var ReactReconciler = {
6095
6096 /**
6097 * Initializes the component, renders markup, and registers event listeners.
6098 *
6099 * @param {ReactComponent} internalInstance
6100 * @param {string} rootID DOM ID of the root node.
6101 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
6102 * @return {?string} Rendered markup to be inserted into the DOM.
6103 * @final
6104 * @internal
6105 */
6106 mountComponent: function (internalInstance, rootID, transaction, context) {
6107 var markup = internalInstance.mountComponent(rootID, transaction, context);
6108 if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
6109 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
6110 }
6111 return markup;
6112 },
6113
6114 /**
6115 * Releases any resources allocated by `mountComponent`.
6116 *
6117 * @final
6118 * @internal
6119 */
6120 unmountComponent: function (internalInstance) {
6121 ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
6122 internalInstance.unmountComponent();
6123 },
6124
6125 /**
6126 * Update a component using a new element.
6127 *
6128 * @param {ReactComponent} internalInstance
6129 * @param {ReactElement} nextElement
6130 * @param {ReactReconcileTransaction} transaction
6131 * @param {object} context
6132 * @internal
6133 */
6134 receiveComponent: function (internalInstance, nextElement, transaction, context) {
6135 var prevElement = internalInstance._currentElement;
6136
6137 if (nextElement === prevElement && context === internalInstance._context) {
6138 // Since elements are immutable after the owner is rendered,
6139 // we can do a cheap identity compare here to determine if this is a
6140 // superfluous reconcile. It's possible for state to be mutable but such
6141 // change should trigger an update of the owner which would recreate
6142 // the element. We explicitly check for the existence of an owner since
6143 // it's possible for an element created outside a composite to be
6144 // deeply mutated and reused.
6145
6146 // TODO: Bailing out early is just a perf optimization right?
6147 // TODO: Removing the return statement should affect correctness?
6148 return;
6149 }
6150
6151 var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
6152
6153 if (refsChanged) {
6154 ReactRef.detachRefs(internalInstance, prevElement);
6155 }
6156
6157 internalInstance.receiveComponent(nextElement, transaction, context);
6158
6159 if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
6160 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
6161 }
6162 },
6163
6164 /**
6165 * Flush any dirty changes in a component.
6166 *
6167 * @param {ReactComponent} internalInstance
6168 * @param {ReactReconcileTransaction} transaction
6169 * @internal
6170 */
6171 performUpdateIfNecessary: function (internalInstance, transaction) {
6172 internalInstance.performUpdateIfNecessary(transaction);
6173 }
6174
6175 };
6176
6177 module.exports = ReactReconciler;
6178
6179/***/ }),
6180/* 52 */
6181/***/ (function(module, exports, __webpack_require__) {
6182
6183 /**
6184 * Copyright 2013-2015, Facebook, Inc.
6185 * All rights reserved.
6186 *
6187 * This source code is licensed under the BSD-style license found in the
6188 * LICENSE file in the root directory of this source tree. An additional grant
6189 * of patent rights can be found in the PATENTS file in the same directory.
6190 *
6191 * @providesModule ReactRef
6192 */
6193
6194 'use strict';
6195
6196 var ReactOwner = __webpack_require__(53);
6197
6198 var ReactRef = {};
6199
6200 function attachRef(ref, component, owner) {
6201 if (typeof ref === 'function') {
6202 ref(component.getPublicInstance());
6203 } else {
6204 // Legacy ref
6205 ReactOwner.addComponentAsRefTo(component, ref, owner);
6206 }
6207 }
6208
6209 function detachRef(ref, component, owner) {
6210 if (typeof ref === 'function') {
6211 ref(null);
6212 } else {
6213 // Legacy ref
6214 ReactOwner.removeComponentAsRefFrom(component, ref, owner);
6215 }
6216 }
6217
6218 ReactRef.attachRefs = function (instance, element) {
6219 if (element === null || element === false) {
6220 return;
6221 }
6222 var ref = element.ref;
6223 if (ref != null) {
6224 attachRef(ref, instance, element._owner);
6225 }
6226 };
6227
6228 ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
6229 // If either the owner or a `ref` has changed, make sure the newest owner
6230 // has stored a reference to `this`, and the previous owner (if different)
6231 // has forgotten the reference to `this`. We use the element instead
6232 // of the public this.props because the post processing cannot determine
6233 // a ref. The ref conceptually lives on the element.
6234
6235 // TODO: Should this even be possible? The owner cannot change because
6236 // it's forbidden by shouldUpdateReactComponent. The ref can change
6237 // if you swap the keys of but not the refs. Reconsider where this check
6238 // is made. It probably belongs where the key checking and
6239 // instantiateReactComponent is done.
6240
6241 var prevEmpty = prevElement === null || prevElement === false;
6242 var nextEmpty = nextElement === null || nextElement === false;
6243
6244 return(
6245 // This has a few false positives w/r/t empty components.
6246 prevEmpty || nextEmpty || nextElement._owner !== prevElement._owner || nextElement.ref !== prevElement.ref
6247 );
6248 };
6249
6250 ReactRef.detachRefs = function (instance, element) {
6251 if (element === null || element === false) {
6252 return;
6253 }
6254 var ref = element.ref;
6255 if (ref != null) {
6256 detachRef(ref, instance, element._owner);
6257 }
6258 };
6259
6260 module.exports = ReactRef;
6261
6262/***/ }),
6263/* 53 */
6264/***/ (function(module, exports, __webpack_require__) {
6265
6266 /* WEBPACK VAR INJECTION */(function(process) {/**
6267 * Copyright 2013-2015, Facebook, Inc.
6268 * All rights reserved.
6269 *
6270 * This source code is licensed under the BSD-style license found in the
6271 * LICENSE file in the root directory of this source tree. An additional grant
6272 * of patent rights can be found in the PATENTS file in the same directory.
6273 *
6274 * @providesModule ReactOwner
6275 */
6276
6277 'use strict';
6278
6279 var invariant = __webpack_require__(14);
6280
6281 /**
6282 * ReactOwners are capable of storing references to owned components.
6283 *
6284 * All components are capable of //being// referenced by owner components, but
6285 * only ReactOwner components are capable of //referencing// owned components.
6286 * The named reference is known as a "ref".
6287 *
6288 * Refs are available when mounted and updated during reconciliation.
6289 *
6290 * var MyComponent = React.createClass({
6291 * render: function() {
6292 * return (
6293 * <div onClick={this.handleClick}>
6294 * <CustomComponent ref="custom" />
6295 * </div>
6296 * );
6297 * },
6298 * handleClick: function() {
6299 * this.refs.custom.handleClick();
6300 * },
6301 * componentDidMount: function() {
6302 * this.refs.custom.initialize();
6303 * }
6304 * });
6305 *
6306 * Refs should rarely be used. When refs are used, they should only be done to
6307 * control data that is not handled by React's data flow.
6308 *
6309 * @class ReactOwner
6310 */
6311 var ReactOwner = {
6312
6313 /**
6314 * @param {?object} object
6315 * @return {boolean} True if `object` is a valid owner.
6316 * @final
6317 */
6318 isValidOwner: function (object) {
6319 return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
6320 },
6321
6322 /**
6323 * Adds a component by ref to an owner component.
6324 *
6325 * @param {ReactComponent} component Component to reference.
6326 * @param {string} ref Name by which to refer to the component.
6327 * @param {ReactOwner} owner Component on which to record the ref.
6328 * @final
6329 * @internal
6330 */
6331 addComponentAsRefTo: function (component, ref, owner) {
6332 !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might ' + 'be adding a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : undefined;
6333 owner.attachRef(ref, component);
6334 },
6335
6336 /**
6337 * Removes a component by ref from an owner component.
6338 *
6339 * @param {ReactComponent} component Component to dereference.
6340 * @param {string} ref Name of the ref to remove.
6341 * @param {ReactOwner} owner Component on which the ref is recorded.
6342 * @final
6343 * @internal
6344 */
6345 removeComponentAsRefFrom: function (component, ref, owner) {
6346 !ReactOwner.isValidOwner(owner) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might ' + 'be removing a ref to a component that was not created inside a component\'s ' + '`render` method, or you have multiple copies of React loaded ' + '(details: https://fb.me/react-refs-must-have-owner).') : invariant(false) : undefined;
6347 // Check that `component` is still the current ref because we do not want to
6348 // detach the ref if another component stole it.
6349 if (owner.getPublicInstance().refs[ref] === component.getPublicInstance()) {
6350 owner.detachRef(ref);
6351 }
6352 }
6353
6354 };
6355
6356 module.exports = ReactOwner;
6357 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
6358
6359/***/ }),
6360/* 54 */
6361/***/ (function(module, exports, __webpack_require__) {
6362
6363 /* WEBPACK VAR INJECTION */(function(process) {/**
6364 * Copyright 2015, Facebook, Inc.
6365 * All rights reserved.
6366 *
6367 * This source code is licensed under the BSD-style license found in the
6368 * LICENSE file in the root directory of this source tree. An additional grant
6369 * of patent rights can be found in the PATENTS file in the same directory.
6370 *
6371 * @providesModule ReactUpdateQueue
6372 */
6373
6374 'use strict';
6375
6376 var ReactCurrentOwner = __webpack_require__(6);
6377 var ReactElement = __webpack_require__(43);
6378 var ReactInstanceMap = __webpack_require__(48);
6379 var ReactUpdates = __webpack_require__(55);
6380
6381 var assign = __webpack_require__(40);
6382 var invariant = __webpack_require__(14);
6383 var warning = __webpack_require__(26);
6384
6385 function enqueueUpdate(internalInstance) {
6386 ReactUpdates.enqueueUpdate(internalInstance);
6387 }
6388
6389 function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
6390 var internalInstance = ReactInstanceMap.get(publicInstance);
6391 if (!internalInstance) {
6392 if (process.env.NODE_ENV !== 'production') {
6393 // Only warn when we have a callerName. Otherwise we should be silent.
6394 // We're probably calling from enqueueCallback. We don't want to warn
6395 // there because we already warned for the corresponding lifecycle method.
6396 process.env.NODE_ENV !== 'production' ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor.displayName) : undefined;
6397 }
6398 return null;
6399 }
6400
6401 if (process.env.NODE_ENV !== 'production') {
6402 process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition ' + '(such as within `render`). Render methods should be a pure function ' + 'of props and state.', callerName) : undefined;
6403 }
6404
6405 return internalInstance;
6406 }
6407
6408 /**
6409 * ReactUpdateQueue allows for state updates to be scheduled into a later
6410 * reconciliation step.
6411 */
6412 var ReactUpdateQueue = {
6413
6414 /**
6415 * Checks whether or not this composite component is mounted.
6416 * @param {ReactClass} publicInstance The instance we want to test.
6417 * @return {boolean} True if mounted, false otherwise.
6418 * @protected
6419 * @final
6420 */
6421 isMounted: function (publicInstance) {
6422 if (process.env.NODE_ENV !== 'production') {
6423 var owner = ReactCurrentOwner.current;
6424 if (owner !== null) {
6425 process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : undefined;
6426 owner._warnedAboutRefsInRender = true;
6427 }
6428 }
6429 var internalInstance = ReactInstanceMap.get(publicInstance);
6430 if (internalInstance) {
6431 // During componentWillMount and render this will still be null but after
6432 // that will always render to something. At least for now. So we can use
6433 // this hack.
6434 return !!internalInstance._renderedComponent;
6435 } else {
6436 return false;
6437 }
6438 },
6439
6440 /**
6441 * Enqueue a callback that will be executed after all the pending updates
6442 * have processed.
6443 *
6444 * @param {ReactClass} publicInstance The instance to use as `this` context.
6445 * @param {?function} callback Called after state is updated.
6446 * @internal
6447 */
6448 enqueueCallback: function (publicInstance, callback) {
6449 !(typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined;
6450 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
6451
6452 // Previously we would throw an error if we didn't have an internal
6453 // instance. Since we want to make it a no-op instead, we mirror the same
6454 // behavior we have in other enqueue* methods.
6455 // We also need to ignore callbacks in componentWillMount. See
6456 // enqueueUpdates.
6457 if (!internalInstance) {
6458 return null;
6459 }
6460
6461 if (internalInstance._pendingCallbacks) {
6462 internalInstance._pendingCallbacks.push(callback);
6463 } else {
6464 internalInstance._pendingCallbacks = [callback];
6465 }
6466 // TODO: The callback here is ignored when setState is called from
6467 // componentWillMount. Either fix it or disallow doing so completely in
6468 // favor of getInitialState. Alternatively, we can disallow
6469 // componentWillMount during server-side rendering.
6470 enqueueUpdate(internalInstance);
6471 },
6472
6473 enqueueCallbackInternal: function (internalInstance, callback) {
6474 !(typeof callback === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'enqueueCallback(...): You called `setProps`, `replaceProps`, ' + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + 'isn\'t callable.') : invariant(false) : undefined;
6475 if (internalInstance._pendingCallbacks) {
6476 internalInstance._pendingCallbacks.push(callback);
6477 } else {
6478 internalInstance._pendingCallbacks = [callback];
6479 }
6480 enqueueUpdate(internalInstance);
6481 },
6482
6483 /**
6484 * Forces an update. This should only be invoked when it is known with
6485 * certainty that we are **not** in a DOM transaction.
6486 *
6487 * You may want to call this when you know that some deeper aspect of the
6488 * component's state has changed but `setState` was not called.
6489 *
6490 * This will not invoke `shouldComponentUpdate`, but it will invoke
6491 * `componentWillUpdate` and `componentDidUpdate`.
6492 *
6493 * @param {ReactClass} publicInstance The instance that should rerender.
6494 * @internal
6495 */
6496 enqueueForceUpdate: function (publicInstance) {
6497 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
6498
6499 if (!internalInstance) {
6500 return;
6501 }
6502
6503 internalInstance._pendingForceUpdate = true;
6504
6505 enqueueUpdate(internalInstance);
6506 },
6507
6508 /**
6509 * Replaces all of the state. Always use this or `setState` to mutate state.
6510 * You should treat `this.state` as immutable.
6511 *
6512 * There is no guarantee that `this.state` will be immediately updated, so
6513 * accessing `this.state` after calling this method may return the old value.
6514 *
6515 * @param {ReactClass} publicInstance The instance that should rerender.
6516 * @param {object} completeState Next state.
6517 * @internal
6518 */
6519 enqueueReplaceState: function (publicInstance, completeState) {
6520 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
6521
6522 if (!internalInstance) {
6523 return;
6524 }
6525
6526 internalInstance._pendingStateQueue = [completeState];
6527 internalInstance._pendingReplaceState = true;
6528
6529 enqueueUpdate(internalInstance);
6530 },
6531
6532 /**
6533 * Sets a subset of the state. This only exists because _pendingState is
6534 * internal. This provides a merging strategy that is not available to deep
6535 * properties which is confusing. TODO: Expose pendingState or don't use it
6536 * during the merge.
6537 *
6538 * @param {ReactClass} publicInstance The instance that should rerender.
6539 * @param {object} partialState Next partial state to be merged with state.
6540 * @internal
6541 */
6542 enqueueSetState: function (publicInstance, partialState) {
6543 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
6544
6545 if (!internalInstance) {
6546 return;
6547 }
6548
6549 var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
6550 queue.push(partialState);
6551
6552 enqueueUpdate(internalInstance);
6553 },
6554
6555 /**
6556 * Sets a subset of the props.
6557 *
6558 * @param {ReactClass} publicInstance The instance that should rerender.
6559 * @param {object} partialProps Subset of the next props.
6560 * @internal
6561 */
6562 enqueueSetProps: function (publicInstance, partialProps) {
6563 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setProps');
6564 if (!internalInstance) {
6565 return;
6566 }
6567 ReactUpdateQueue.enqueueSetPropsInternal(internalInstance, partialProps);
6568 },
6569
6570 enqueueSetPropsInternal: function (internalInstance, partialProps) {
6571 var topLevelWrapper = internalInstance._topLevelWrapper;
6572 !topLevelWrapper ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setProps(...): You called `setProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined;
6573
6574 // Merge with the pending element if it exists, otherwise with existing
6575 // element props.
6576 var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement;
6577 var element = wrapElement.props;
6578 var props = assign({}, element.props, partialProps);
6579 topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props));
6580
6581 enqueueUpdate(topLevelWrapper);
6582 },
6583
6584 /**
6585 * Replaces all of the props.
6586 *
6587 * @param {ReactClass} publicInstance The instance that should rerender.
6588 * @param {object} props New props.
6589 * @internal
6590 */
6591 enqueueReplaceProps: function (publicInstance, props) {
6592 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceProps');
6593 if (!internalInstance) {
6594 return;
6595 }
6596 ReactUpdateQueue.enqueueReplacePropsInternal(internalInstance, props);
6597 },
6598
6599 enqueueReplacePropsInternal: function (internalInstance, props) {
6600 var topLevelWrapper = internalInstance._topLevelWrapper;
6601 !topLevelWrapper ? process.env.NODE_ENV !== 'production' ? invariant(false, 'replaceProps(...): You called `replaceProps` on a ' + 'component with a parent. This is an anti-pattern since props will ' + 'get reactively updated when rendered. Instead, change the owner\'s ' + '`render` method to pass the correct value as props to the component ' + 'where it is created.') : invariant(false) : undefined;
6602
6603 // Merge with the pending element if it exists, otherwise with existing
6604 // element props.
6605 var wrapElement = topLevelWrapper._pendingElement || topLevelWrapper._currentElement;
6606 var element = wrapElement.props;
6607 topLevelWrapper._pendingElement = ReactElement.cloneAndReplaceProps(wrapElement, ReactElement.cloneAndReplaceProps(element, props));
6608
6609 enqueueUpdate(topLevelWrapper);
6610 },
6611
6612 enqueueElementInternal: function (internalInstance, newElement) {
6613 internalInstance._pendingElement = newElement;
6614 enqueueUpdate(internalInstance);
6615 }
6616
6617 };
6618
6619 module.exports = ReactUpdateQueue;
6620 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
6621
6622/***/ }),
6623/* 55 */
6624/***/ (function(module, exports, __webpack_require__) {
6625
6626 /* WEBPACK VAR INJECTION */(function(process) {/**
6627 * Copyright 2013-2015, Facebook, Inc.
6628 * All rights reserved.
6629 *
6630 * This source code is licensed under the BSD-style license found in the
6631 * LICENSE file in the root directory of this source tree. An additional grant
6632 * of patent rights can be found in the PATENTS file in the same directory.
6633 *
6634 * @providesModule ReactUpdates
6635 */
6636
6637 'use strict';
6638
6639 var CallbackQueue = __webpack_require__(56);
6640 var PooledClass = __webpack_require__(57);
6641 var ReactPerf = __webpack_require__(19);
6642 var ReactReconciler = __webpack_require__(51);
6643 var Transaction = __webpack_require__(58);
6644
6645 var assign = __webpack_require__(40);
6646 var invariant = __webpack_require__(14);
6647
6648 var dirtyComponents = [];
6649 var asapCallbackQueue = CallbackQueue.getPooled();
6650 var asapEnqueued = false;
6651
6652 var batchingStrategy = null;
6653
6654 function ensureInjected() {
6655 !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : undefined;
6656 }
6657
6658 var NESTED_UPDATES = {
6659 initialize: function () {
6660 this.dirtyComponentsLength = dirtyComponents.length;
6661 },
6662 close: function () {
6663 if (this.dirtyComponentsLength !== dirtyComponents.length) {
6664 // Additional updates were enqueued by componentDidUpdate handlers or
6665 // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
6666 // these new updates so that if A's componentDidUpdate calls setState on
6667 // B, B will update before the callback A's updater provided when calling
6668 // setState.
6669 dirtyComponents.splice(0, this.dirtyComponentsLength);
6670 flushBatchedUpdates();
6671 } else {
6672 dirtyComponents.length = 0;
6673 }
6674 }
6675 };
6676
6677 var UPDATE_QUEUEING = {
6678 initialize: function () {
6679 this.callbackQueue.reset();
6680 },
6681 close: function () {
6682 this.callbackQueue.notifyAll();
6683 }
6684 };
6685
6686 var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
6687
6688 function ReactUpdatesFlushTransaction() {
6689 this.reinitializeTransaction();
6690 this.dirtyComponentsLength = null;
6691 this.callbackQueue = CallbackQueue.getPooled();
6692 this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled( /* forceHTML */false);
6693 }
6694
6695 assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
6696 getTransactionWrappers: function () {
6697 return TRANSACTION_WRAPPERS;
6698 },
6699
6700 destructor: function () {
6701 this.dirtyComponentsLength = null;
6702 CallbackQueue.release(this.callbackQueue);
6703 this.callbackQueue = null;
6704 ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
6705 this.reconcileTransaction = null;
6706 },
6707
6708 perform: function (method, scope, a) {
6709 // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
6710 // with this transaction's wrappers around it.
6711 return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
6712 }
6713 });
6714
6715 PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
6716
6717 function batchedUpdates(callback, a, b, c, d, e) {
6718 ensureInjected();
6719 batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
6720 }
6721
6722 /**
6723 * Array comparator for ReactComponents by mount ordering.
6724 *
6725 * @param {ReactComponent} c1 first component you're comparing
6726 * @param {ReactComponent} c2 second component you're comparing
6727 * @return {number} Return value usable by Array.prototype.sort().
6728 */
6729 function mountOrderComparator(c1, c2) {
6730 return c1._mountOrder - c2._mountOrder;
6731 }
6732
6733 function runBatchedUpdates(transaction) {
6734 var len = transaction.dirtyComponentsLength;
6735 !(len === dirtyComponents.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : undefined;
6736
6737 // Since reconciling a component higher in the owner hierarchy usually (not
6738 // always -- see shouldComponentUpdate()) will reconcile children, reconcile
6739 // them before their children by sorting the array.
6740 dirtyComponents.sort(mountOrderComparator);
6741
6742 for (var i = 0; i < len; i++) {
6743 // If a component is unmounted before pending changes apply, it will still
6744 // be here, but we assume that it has cleared its _pendingCallbacks and
6745 // that performUpdateIfNecessary is a noop.
6746 var component = dirtyComponents[i];
6747
6748 // If performUpdateIfNecessary happens to enqueue any new updates, we
6749 // shouldn't execute the callbacks until the next render happens, so
6750 // stash the callbacks first
6751 var callbacks = component._pendingCallbacks;
6752 component._pendingCallbacks = null;
6753
6754 ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction);
6755
6756 if (callbacks) {
6757 for (var j = 0; j < callbacks.length; j++) {
6758 transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
6759 }
6760 }
6761 }
6762 }
6763
6764 var flushBatchedUpdates = function () {
6765 // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
6766 // array and perform any updates enqueued by mount-ready handlers (i.e.,
6767 // componentDidUpdate) but we need to check here too in order to catch
6768 // updates enqueued by setState callbacks and asap calls.
6769 while (dirtyComponents.length || asapEnqueued) {
6770 if (dirtyComponents.length) {
6771 var transaction = ReactUpdatesFlushTransaction.getPooled();
6772 transaction.perform(runBatchedUpdates, null, transaction);
6773 ReactUpdatesFlushTransaction.release(transaction);
6774 }
6775
6776 if (asapEnqueued) {
6777 asapEnqueued = false;
6778 var queue = asapCallbackQueue;
6779 asapCallbackQueue = CallbackQueue.getPooled();
6780 queue.notifyAll();
6781 CallbackQueue.release(queue);
6782 }
6783 }
6784 };
6785 flushBatchedUpdates = ReactPerf.measure('ReactUpdates', 'flushBatchedUpdates', flushBatchedUpdates);
6786
6787 /**
6788 * Mark a component as needing a rerender, adding an optional callback to a
6789 * list of functions which will be executed once the rerender occurs.
6790 */
6791 function enqueueUpdate(component) {
6792 ensureInjected();
6793
6794 // Various parts of our code (such as ReactCompositeComponent's
6795 // _renderValidatedComponent) assume that calls to render aren't nested;
6796 // verify that that's the case. (This is called by each top-level update
6797 // function, like setProps, setState, forceUpdate, etc.; creation and
6798 // destruction of top-level components is guarded in ReactMount.)
6799
6800 if (!batchingStrategy.isBatchingUpdates) {
6801 batchingStrategy.batchedUpdates(enqueueUpdate, component);
6802 return;
6803 }
6804
6805 dirtyComponents.push(component);
6806 }
6807
6808 /**
6809 * Enqueue a callback to be run at the end of the current batching cycle. Throws
6810 * if no updates are currently being performed.
6811 */
6812 function asap(callback, context) {
6813 !batchingStrategy.isBatchingUpdates ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : undefined;
6814 asapCallbackQueue.enqueue(callback, context);
6815 asapEnqueued = true;
6816 }
6817
6818 var ReactUpdatesInjection = {
6819 injectReconcileTransaction: function (ReconcileTransaction) {
6820 !ReconcileTransaction ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : undefined;
6821 ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
6822 },
6823
6824 injectBatchingStrategy: function (_batchingStrategy) {
6825 !_batchingStrategy ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : undefined;
6826 !(typeof _batchingStrategy.batchedUpdates === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : undefined;
6827 !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : undefined;
6828 batchingStrategy = _batchingStrategy;
6829 }
6830 };
6831
6832 var ReactUpdates = {
6833 /**
6834 * React references `ReactReconcileTransaction` using this property in order
6835 * to allow dependency injection.
6836 *
6837 * @internal
6838 */
6839 ReactReconcileTransaction: null,
6840
6841 batchedUpdates: batchedUpdates,
6842 enqueueUpdate: enqueueUpdate,
6843 flushBatchedUpdates: flushBatchedUpdates,
6844 injection: ReactUpdatesInjection,
6845 asap: asap
6846 };
6847
6848 module.exports = ReactUpdates;
6849 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
6850
6851/***/ }),
6852/* 56 */
6853/***/ (function(module, exports, __webpack_require__) {
6854
6855 /* WEBPACK VAR INJECTION */(function(process) {/**
6856 * Copyright 2013-2015, Facebook, Inc.
6857 * All rights reserved.
6858 *
6859 * This source code is licensed under the BSD-style license found in the
6860 * LICENSE file in the root directory of this source tree. An additional grant
6861 * of patent rights can be found in the PATENTS file in the same directory.
6862 *
6863 * @providesModule CallbackQueue
6864 */
6865
6866 'use strict';
6867
6868 var PooledClass = __webpack_require__(57);
6869
6870 var assign = __webpack_require__(40);
6871 var invariant = __webpack_require__(14);
6872
6873 /**
6874 * A specialized pseudo-event module to help keep track of components waiting to
6875 * be notified when their DOM representations are available for use.
6876 *
6877 * This implements `PooledClass`, so you should never need to instantiate this.
6878 * Instead, use `CallbackQueue.getPooled()`.
6879 *
6880 * @class ReactMountReady
6881 * @implements PooledClass
6882 * @internal
6883 */
6884 function CallbackQueue() {
6885 this._callbacks = null;
6886 this._contexts = null;
6887 }
6888
6889 assign(CallbackQueue.prototype, {
6890
6891 /**
6892 * Enqueues a callback to be invoked when `notifyAll` is invoked.
6893 *
6894 * @param {function} callback Invoked when `notifyAll` is invoked.
6895 * @param {?object} context Context to call `callback` with.
6896 * @internal
6897 */
6898 enqueue: function (callback, context) {
6899 this._callbacks = this._callbacks || [];
6900 this._contexts = this._contexts || [];
6901 this._callbacks.push(callback);
6902 this._contexts.push(context);
6903 },
6904
6905 /**
6906 * Invokes all enqueued callbacks and clears the queue. This is invoked after
6907 * the DOM representation of a component has been created or updated.
6908 *
6909 * @internal
6910 */
6911 notifyAll: function () {
6912 var callbacks = this._callbacks;
6913 var contexts = this._contexts;
6914 if (callbacks) {
6915 !(callbacks.length === contexts.length) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : invariant(false) : undefined;
6916 this._callbacks = null;
6917 this._contexts = null;
6918 for (var i = 0; i < callbacks.length; i++) {
6919 callbacks[i].call(contexts[i]);
6920 }
6921 callbacks.length = 0;
6922 contexts.length = 0;
6923 }
6924 },
6925
6926 /**
6927 * Resets the internal queue.
6928 *
6929 * @internal
6930 */
6931 reset: function () {
6932 this._callbacks = null;
6933 this._contexts = null;
6934 },
6935
6936 /**
6937 * `PooledClass` looks for this.
6938 */
6939 destructor: function () {
6940 this.reset();
6941 }
6942
6943 });
6944
6945 PooledClass.addPoolingTo(CallbackQueue);
6946
6947 module.exports = CallbackQueue;
6948 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
6949
6950/***/ }),
6951/* 57 */
6952/***/ (function(module, exports, __webpack_require__) {
6953
6954 /* WEBPACK VAR INJECTION */(function(process) {/**
6955 * Copyright 2013-2015, Facebook, Inc.
6956 * All rights reserved.
6957 *
6958 * This source code is licensed under the BSD-style license found in the
6959 * LICENSE file in the root directory of this source tree. An additional grant
6960 * of patent rights can be found in the PATENTS file in the same directory.
6961 *
6962 * @providesModule PooledClass
6963 */
6964
6965 'use strict';
6966
6967 var invariant = __webpack_require__(14);
6968
6969 /**
6970 * Static poolers. Several custom versions for each potential number of
6971 * arguments. A completely generic pooler is easy to implement, but would
6972 * require accessing the `arguments` object. In each of these, `this` refers to
6973 * the Class itself, not an instance. If any others are needed, simply add them
6974 * here, or in their own files.
6975 */
6976 var oneArgumentPooler = function (copyFieldsFrom) {
6977 var Klass = this;
6978 if (Klass.instancePool.length) {
6979 var instance = Klass.instancePool.pop();
6980 Klass.call(instance, copyFieldsFrom);
6981 return instance;
6982 } else {
6983 return new Klass(copyFieldsFrom);
6984 }
6985 };
6986
6987 var twoArgumentPooler = function (a1, a2) {
6988 var Klass = this;
6989 if (Klass.instancePool.length) {
6990 var instance = Klass.instancePool.pop();
6991 Klass.call(instance, a1, a2);
6992 return instance;
6993 } else {
6994 return new Klass(a1, a2);
6995 }
6996 };
6997
6998 var threeArgumentPooler = function (a1, a2, a3) {
6999 var Klass = this;
7000 if (Klass.instancePool.length) {
7001 var instance = Klass.instancePool.pop();
7002 Klass.call(instance, a1, a2, a3);
7003 return instance;
7004 } else {
7005 return new Klass(a1, a2, a3);
7006 }
7007 };
7008
7009 var fourArgumentPooler = function (a1, a2, a3, a4) {
7010 var Klass = this;
7011 if (Klass.instancePool.length) {
7012 var instance = Klass.instancePool.pop();
7013 Klass.call(instance, a1, a2, a3, a4);
7014 return instance;
7015 } else {
7016 return new Klass(a1, a2, a3, a4);
7017 }
7018 };
7019
7020 var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
7021 var Klass = this;
7022 if (Klass.instancePool.length) {
7023 var instance = Klass.instancePool.pop();
7024 Klass.call(instance, a1, a2, a3, a4, a5);
7025 return instance;
7026 } else {
7027 return new Klass(a1, a2, a3, a4, a5);
7028 }
7029 };
7030
7031 var standardReleaser = function (instance) {
7032 var Klass = this;
7033 !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : undefined;
7034 instance.destructor();
7035 if (Klass.instancePool.length < Klass.poolSize) {
7036 Klass.instancePool.push(instance);
7037 }
7038 };
7039
7040 var DEFAULT_POOL_SIZE = 10;
7041 var DEFAULT_POOLER = oneArgumentPooler;
7042
7043 /**
7044 * Augments `CopyConstructor` to be a poolable class, augmenting only the class
7045 * itself (statically) not adding any prototypical fields. Any CopyConstructor
7046 * you give this may have a `poolSize` property, and will look for a
7047 * prototypical `destructor` on instances (optional).
7048 *
7049 * @param {Function} CopyConstructor Constructor that can be used to reset.
7050 * @param {Function} pooler Customizable pooler.
7051 */
7052 var addPoolingTo = function (CopyConstructor, pooler) {
7053 var NewKlass = CopyConstructor;
7054 NewKlass.instancePool = [];
7055 NewKlass.getPooled = pooler || DEFAULT_POOLER;
7056 if (!NewKlass.poolSize) {
7057 NewKlass.poolSize = DEFAULT_POOL_SIZE;
7058 }
7059 NewKlass.release = standardReleaser;
7060 return NewKlass;
7061 };
7062
7063 var PooledClass = {
7064 addPoolingTo: addPoolingTo,
7065 oneArgumentPooler: oneArgumentPooler,
7066 twoArgumentPooler: twoArgumentPooler,
7067 threeArgumentPooler: threeArgumentPooler,
7068 fourArgumentPooler: fourArgumentPooler,
7069 fiveArgumentPooler: fiveArgumentPooler
7070 };
7071
7072 module.exports = PooledClass;
7073 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
7074
7075/***/ }),
7076/* 58 */
7077/***/ (function(module, exports, __webpack_require__) {
7078
7079 /* WEBPACK VAR INJECTION */(function(process) {/**
7080 * Copyright 2013-2015, Facebook, Inc.
7081 * All rights reserved.
7082 *
7083 * This source code is licensed under the BSD-style license found in the
7084 * LICENSE file in the root directory of this source tree. An additional grant
7085 * of patent rights can be found in the PATENTS file in the same directory.
7086 *
7087 * @providesModule Transaction
7088 */
7089
7090 'use strict';
7091
7092 var invariant = __webpack_require__(14);
7093
7094 /**
7095 * `Transaction` creates a black box that is able to wrap any method such that
7096 * certain invariants are maintained before and after the method is invoked
7097 * (Even if an exception is thrown while invoking the wrapped method). Whoever
7098 * instantiates a transaction can provide enforcers of the invariants at
7099 * creation time. The `Transaction` class itself will supply one additional
7100 * automatic invariant for you - the invariant that any transaction instance
7101 * should not be run while it is already being run. You would typically create a
7102 * single instance of a `Transaction` for reuse multiple times, that potentially
7103 * is used to wrap several different methods. Wrappers are extremely simple -
7104 * they only require implementing two methods.
7105 *
7106 * <pre>
7107 * wrappers (injected at creation time)
7108 * + +
7109 * | |
7110 * +-----------------|--------|--------------+
7111 * | v | |
7112 * | +---------------+ | |
7113 * | +--| wrapper1 |---|----+ |
7114 * | | +---------------+ v | |
7115 * | | +-------------+ | |
7116 * | | +----| wrapper2 |--------+ |
7117 * | | | +-------------+ | | |
7118 * | | | | | |
7119 * | v v v v | wrapper
7120 * | +---+ +---+ +---------+ +---+ +---+ | invariants
7121 * perform(anyMethod) | | | | | | | | | | | | maintained
7122 * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
7123 * | | | | | | | | | | | |
7124 * | | | | | | | | | | | |
7125 * | | | | | | | | | | | |
7126 * | +---+ +---+ +---------+ +---+ +---+ |
7127 * | initialize close |
7128 * +-----------------------------------------+
7129 * </pre>
7130 *
7131 * Use cases:
7132 * - Preserving the input selection ranges before/after reconciliation.
7133 * Restoring selection even in the event of an unexpected error.
7134 * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
7135 * while guaranteeing that afterwards, the event system is reactivated.
7136 * - Flushing a queue of collected DOM mutations to the main UI thread after a
7137 * reconciliation takes place in a worker thread.
7138 * - Invoking any collected `componentDidUpdate` callbacks after rendering new
7139 * content.
7140 * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
7141 * to preserve the `scrollTop` (an automatic scroll aware DOM).
7142 * - (Future use case): Layout calculations before and after DOM updates.
7143 *
7144 * Transactional plugin API:
7145 * - A module that has an `initialize` method that returns any precomputation.
7146 * - and a `close` method that accepts the precomputation. `close` is invoked
7147 * when the wrapped process is completed, or has failed.
7148 *
7149 * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
7150 * that implement `initialize` and `close`.
7151 * @return {Transaction} Single transaction for reuse in thread.
7152 *
7153 * @class Transaction
7154 */
7155 var Mixin = {
7156 /**
7157 * Sets up this instance so that it is prepared for collecting metrics. Does
7158 * so such that this setup method may be used on an instance that is already
7159 * initialized, in a way that does not consume additional memory upon reuse.
7160 * That can be useful if you decide to make your subclass of this mixin a
7161 * "PooledClass".
7162 */
7163 reinitializeTransaction: function () {
7164 this.transactionWrappers = this.getTransactionWrappers();
7165 if (this.wrapperInitData) {
7166 this.wrapperInitData.length = 0;
7167 } else {
7168 this.wrapperInitData = [];
7169 }
7170 this._isInTransaction = false;
7171 },
7172
7173 _isInTransaction: false,
7174
7175 /**
7176 * @abstract
7177 * @return {Array<TransactionWrapper>} Array of transaction wrappers.
7178 */
7179 getTransactionWrappers: null,
7180
7181 isInTransaction: function () {
7182 return !!this._isInTransaction;
7183 },
7184
7185 /**
7186 * Executes the function within a safety window. Use this for the top level
7187 * methods that result in large amounts of computation/mutations that would
7188 * need to be safety checked. The optional arguments helps prevent the need
7189 * to bind in many cases.
7190 *
7191 * @param {function} method Member of scope to call.
7192 * @param {Object} scope Scope to invoke from.
7193 * @param {Object?=} a Argument to pass to the method.
7194 * @param {Object?=} b Argument to pass to the method.
7195 * @param {Object?=} c Argument to pass to the method.
7196 * @param {Object?=} d Argument to pass to the method.
7197 * @param {Object?=} e Argument to pass to the method.
7198 * @param {Object?=} f Argument to pass to the method.
7199 *
7200 * @return {*} Return value from `method`.
7201 */
7202 perform: function (method, scope, a, b, c, d, e, f) {
7203 !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : undefined;
7204 var errorThrown;
7205 var ret;
7206 try {
7207 this._isInTransaction = true;
7208 // Catching errors makes debugging more difficult, so we start with
7209 // errorThrown set to true before setting it to false after calling
7210 // close -- if it's still set to true in the finally block, it means
7211 // one of these calls threw.
7212 errorThrown = true;
7213 this.initializeAll(0);
7214 ret = method.call(scope, a, b, c, d, e, f);
7215 errorThrown = false;
7216 } finally {
7217 try {
7218 if (errorThrown) {
7219 // If `method` throws, prefer to show that stack trace over any thrown
7220 // by invoking `closeAll`.
7221 try {
7222 this.closeAll(0);
7223 } catch (err) {}
7224 } else {
7225 // Since `method` didn't throw, we don't want to silence the exception
7226 // here.
7227 this.closeAll(0);
7228 }
7229 } finally {
7230 this._isInTransaction = false;
7231 }
7232 }
7233 return ret;
7234 },
7235
7236 initializeAll: function (startIndex) {
7237 var transactionWrappers = this.transactionWrappers;
7238 for (var i = startIndex; i < transactionWrappers.length; i++) {
7239 var wrapper = transactionWrappers[i];
7240 try {
7241 // Catching errors makes debugging more difficult, so we start with the
7242 // OBSERVED_ERROR state before overwriting it with the real return value
7243 // of initialize -- if it's still set to OBSERVED_ERROR in the finally
7244 // block, it means wrapper.initialize threw.
7245 this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
7246 this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
7247 } finally {
7248 if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
7249 // The initializer for wrapper i threw an error; initialize the
7250 // remaining wrappers but silence any exceptions from them to ensure
7251 // that the first error is the one to bubble up.
7252 try {
7253 this.initializeAll(i + 1);
7254 } catch (err) {}
7255 }
7256 }
7257 }
7258 },
7259
7260 /**
7261 * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
7262 * them the respective return values of `this.transactionWrappers.init[i]`
7263 * (`close`rs that correspond to initializers that failed will not be
7264 * invoked).
7265 */
7266 closeAll: function (startIndex) {
7267 !this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : undefined;
7268 var transactionWrappers = this.transactionWrappers;
7269 for (var i = startIndex; i < transactionWrappers.length; i++) {
7270 var wrapper = transactionWrappers[i];
7271 var initData = this.wrapperInitData[i];
7272 var errorThrown;
7273 try {
7274 // Catching errors makes debugging more difficult, so we start with
7275 // errorThrown set to true before setting it to false after calling
7276 // close -- if it's still set to true in the finally block, it means
7277 // wrapper.close threw.
7278 errorThrown = true;
7279 if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
7280 wrapper.close.call(this, initData);
7281 }
7282 errorThrown = false;
7283 } finally {
7284 if (errorThrown) {
7285 // The closer for wrapper i threw an error; close the remaining
7286 // wrappers but silence any exceptions from them to ensure that the
7287 // first error is the one to bubble up.
7288 try {
7289 this.closeAll(i + 1);
7290 } catch (e) {}
7291 }
7292 }
7293 }
7294 this.wrapperInitData.length = 0;
7295 }
7296 };
7297
7298 var Transaction = {
7299
7300 Mixin: Mixin,
7301
7302 /**
7303 * Token to look for to determine if an error occurred.
7304 */
7305 OBSERVED_ERROR: {}
7306
7307 };
7308
7309 module.exports = Transaction;
7310 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
7311
7312/***/ }),
7313/* 59 */
7314/***/ (function(module, exports, __webpack_require__) {
7315
7316 /* WEBPACK VAR INJECTION */(function(process) {/**
7317 * Copyright 2013-2015, Facebook, Inc.
7318 * All rights reserved.
7319 *
7320 * This source code is licensed under the BSD-style license found in the
7321 * LICENSE file in the root directory of this source tree. An additional grant
7322 * of patent rights can be found in the PATENTS file in the same directory.
7323 *
7324 * @providesModule emptyObject
7325 */
7326
7327 'use strict';
7328
7329 var emptyObject = {};
7330
7331 if (process.env.NODE_ENV !== 'production') {
7332 Object.freeze(emptyObject);
7333 }
7334
7335 module.exports = emptyObject;
7336 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
7337
7338/***/ }),
7339/* 60 */
7340/***/ (function(module, exports, __webpack_require__) {
7341
7342 /**
7343 * Copyright 2013-2015, Facebook, Inc.
7344 * All rights reserved.
7345 *
7346 * This source code is licensed under the BSD-style license found in the
7347 * LICENSE file in the root directory of this source tree. An additional grant
7348 * of patent rights can be found in the PATENTS file in the same directory.
7349 *
7350 * @providesModule containsNode
7351 * @typechecks
7352 */
7353
7354 'use strict';
7355
7356 var isTextNode = __webpack_require__(61);
7357
7358 /*eslint-disable no-bitwise */
7359
7360 /**
7361 * Checks if a given DOM node contains or is another DOM node.
7362 *
7363 * @param {?DOMNode} outerNode Outer DOM node.
7364 * @param {?DOMNode} innerNode Inner DOM node.
7365 * @return {boolean} True if `outerNode` contains or is `innerNode`.
7366 */
7367 function containsNode(_x, _x2) {
7368 var _again = true;
7369
7370 _function: while (_again) {
7371 var outerNode = _x,
7372 innerNode = _x2;
7373 _again = false;
7374
7375 if (!outerNode || !innerNode) {
7376 return false;
7377 } else if (outerNode === innerNode) {
7378 return true;
7379 } else if (isTextNode(outerNode)) {
7380 return false;
7381 } else if (isTextNode(innerNode)) {
7382 _x = outerNode;
7383 _x2 = innerNode.parentNode;
7384 _again = true;
7385 continue _function;
7386 } else if (outerNode.contains) {
7387 return outerNode.contains(innerNode);
7388 } else if (outerNode.compareDocumentPosition) {
7389 return !!(outerNode.compareDocumentPosition(innerNode) & 16);
7390 } else {
7391 return false;
7392 }
7393 }
7394 }
7395
7396 module.exports = containsNode;
7397
7398/***/ }),
7399/* 61 */
7400/***/ (function(module, exports, __webpack_require__) {
7401
7402 /**
7403 * Copyright 2013-2015, Facebook, Inc.
7404 * All rights reserved.
7405 *
7406 * This source code is licensed under the BSD-style license found in the
7407 * LICENSE file in the root directory of this source tree. An additional grant
7408 * of patent rights can be found in the PATENTS file in the same directory.
7409 *
7410 * @providesModule isTextNode
7411 * @typechecks
7412 */
7413
7414 'use strict';
7415
7416 var isNode = __webpack_require__(62);
7417
7418 /**
7419 * @param {*} object The object to check.
7420 * @return {boolean} Whether or not the object is a DOM text node.
7421 */
7422 function isTextNode(object) {
7423 return isNode(object) && object.nodeType == 3;
7424 }
7425
7426 module.exports = isTextNode;
7427
7428/***/ }),
7429/* 62 */
7430/***/ (function(module, exports) {
7431
7432 /**
7433 * Copyright 2013-2015, Facebook, Inc.
7434 * All rights reserved.
7435 *
7436 * This source code is licensed under the BSD-style license found in the
7437 * LICENSE file in the root directory of this source tree. An additional grant
7438 * of patent rights can be found in the PATENTS file in the same directory.
7439 *
7440 * @providesModule isNode
7441 * @typechecks
7442 */
7443
7444 /**
7445 * @param {*} object The object to check.
7446 * @return {boolean} Whether or not the object is a DOM node.
7447 */
7448 'use strict';
7449
7450 function isNode(object) {
7451 return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
7452 }
7453
7454 module.exports = isNode;
7455
7456/***/ }),
7457/* 63 */
7458/***/ (function(module, exports, __webpack_require__) {
7459
7460 /* WEBPACK VAR INJECTION */(function(process) {/**
7461 * Copyright 2013-2015, Facebook, Inc.
7462 * All rights reserved.
7463 *
7464 * This source code is licensed under the BSD-style license found in the
7465 * LICENSE file in the root directory of this source tree. An additional grant
7466 * of patent rights can be found in the PATENTS file in the same directory.
7467 *
7468 * @providesModule instantiateReactComponent
7469 * @typechecks static-only
7470 */
7471
7472 'use strict';
7473
7474 var ReactCompositeComponent = __webpack_require__(64);
7475 var ReactEmptyComponent = __webpack_require__(69);
7476 var ReactNativeComponent = __webpack_require__(70);
7477
7478 var assign = __webpack_require__(40);
7479 var invariant = __webpack_require__(14);
7480 var warning = __webpack_require__(26);
7481
7482 // To avoid a cyclic dependency, we create the final class in this module
7483 var ReactCompositeComponentWrapper = function () {};
7484 assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
7485 _instantiateReactComponent: instantiateReactComponent
7486 });
7487
7488 function getDeclarationErrorAddendum(owner) {
7489 if (owner) {
7490 var name = owner.getName();
7491 if (name) {
7492 return ' Check the render method of `' + name + '`.';
7493 }
7494 }
7495 return '';
7496 }
7497
7498 /**
7499 * Check if the type reference is a known internal type. I.e. not a user
7500 * provided composite type.
7501 *
7502 * @param {function} type
7503 * @return {boolean} Returns true if this is a valid internal type.
7504 */
7505 function isInternalComponentType(type) {
7506 return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
7507 }
7508
7509 /**
7510 * Given a ReactNode, create an instance that will actually be mounted.
7511 *
7512 * @param {ReactNode} node
7513 * @return {object} A new instance of the element's constructor.
7514 * @protected
7515 */
7516 function instantiateReactComponent(node) {
7517 var instance;
7518
7519 if (node === null || node === false) {
7520 instance = new ReactEmptyComponent(instantiateReactComponent);
7521 } else if (typeof node === 'object') {
7522 var element = node;
7523 !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element type is invalid: expected a string (for built-in components) ' + 'or a class/function (for composite components) but got: %s.%s', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : invariant(false) : undefined;
7524
7525 // Special case string values
7526 if (typeof element.type === 'string') {
7527 instance = ReactNativeComponent.createInternalComponent(element);
7528 } else if (isInternalComponentType(element.type)) {
7529 // This is temporarily available for custom components that are not string
7530 // representations. I.e. ART. Once those are updated to use the string
7531 // representation, we can drop this code path.
7532 instance = new element.type(element);
7533 } else {
7534 instance = new ReactCompositeComponentWrapper();
7535 }
7536 } else if (typeof node === 'string' || typeof node === 'number') {
7537 instance = ReactNativeComponent.createInstanceForText(node);
7538 } else {
7539 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false) : undefined;
7540 }
7541
7542 if (process.env.NODE_ENV !== 'production') {
7543 process.env.NODE_ENV !== 'production' ? warning(typeof instance.construct === 'function' && typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : undefined;
7544 }
7545
7546 // Sets up the instance. This can probably just move into the constructor now.
7547 instance.construct(node);
7548
7549 // These two fields are used by the DOM and ART diffing algorithms
7550 // respectively. Instead of using expandos on components, we should be
7551 // storing the state needed by the diffing algorithms elsewhere.
7552 instance._mountIndex = 0;
7553 instance._mountImage = null;
7554
7555 if (process.env.NODE_ENV !== 'production') {
7556 instance._isOwnerNecessary = false;
7557 instance._warnedAboutRefsInRender = false;
7558 }
7559
7560 // Internal instances should fully constructed at this point, so they should
7561 // not get any new fields added to them at this point.
7562 if (process.env.NODE_ENV !== 'production') {
7563 if (Object.preventExtensions) {
7564 Object.preventExtensions(instance);
7565 }
7566 }
7567
7568 return instance;
7569 }
7570
7571 module.exports = instantiateReactComponent;
7572 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
7573
7574/***/ }),
7575/* 64 */
7576/***/ (function(module, exports, __webpack_require__) {
7577
7578 /* WEBPACK VAR INJECTION */(function(process) {/**
7579 * Copyright 2013-2015, Facebook, Inc.
7580 * All rights reserved.
7581 *
7582 * This source code is licensed under the BSD-style license found in the
7583 * LICENSE file in the root directory of this source tree. An additional grant
7584 * of patent rights can be found in the PATENTS file in the same directory.
7585 *
7586 * @providesModule ReactCompositeComponent
7587 */
7588
7589 'use strict';
7590
7591 var ReactComponentEnvironment = __webpack_require__(65);
7592 var ReactCurrentOwner = __webpack_require__(6);
7593 var ReactElement = __webpack_require__(43);
7594 var ReactInstanceMap = __webpack_require__(48);
7595 var ReactPerf = __webpack_require__(19);
7596 var ReactPropTypeLocations = __webpack_require__(66);
7597 var ReactPropTypeLocationNames = __webpack_require__(67);
7598 var ReactReconciler = __webpack_require__(51);
7599 var ReactUpdateQueue = __webpack_require__(54);
7600
7601 var assign = __webpack_require__(40);
7602 var emptyObject = __webpack_require__(59);
7603 var invariant = __webpack_require__(14);
7604 var shouldUpdateReactComponent = __webpack_require__(68);
7605 var warning = __webpack_require__(26);
7606
7607 function getDeclarationErrorAddendum(component) {
7608 var owner = component._currentElement._owner || null;
7609 if (owner) {
7610 var name = owner.getName();
7611 if (name) {
7612 return ' Check the render method of `' + name + '`.';
7613 }
7614 }
7615 return '';
7616 }
7617
7618 function StatelessComponent(Component) {}
7619 StatelessComponent.prototype.render = function () {
7620 var Component = ReactInstanceMap.get(this)._currentElement.type;
7621 return Component(this.props, this.context, this.updater);
7622 };
7623
7624 /**
7625 * ------------------ The Life-Cycle of a Composite Component ------------------
7626 *
7627 * - constructor: Initialization of state. The instance is now retained.
7628 * - componentWillMount
7629 * - render
7630 * - [children's constructors]
7631 * - [children's componentWillMount and render]
7632 * - [children's componentDidMount]
7633 * - componentDidMount
7634 *
7635 * Update Phases:
7636 * - componentWillReceiveProps (only called if parent updated)
7637 * - shouldComponentUpdate
7638 * - componentWillUpdate
7639 * - render
7640 * - [children's constructors or receive props phases]
7641 * - componentDidUpdate
7642 *
7643 * - componentWillUnmount
7644 * - [children's componentWillUnmount]
7645 * - [children destroyed]
7646 * - (destroyed): The instance is now blank, released by React and ready for GC.
7647 *
7648 * -----------------------------------------------------------------------------
7649 */
7650
7651 /**
7652 * An incrementing ID assigned to each component when it is mounted. This is
7653 * used to enforce the order in which `ReactUpdates` updates dirty components.
7654 *
7655 * @private
7656 */
7657 var nextMountID = 1;
7658
7659 /**
7660 * @lends {ReactCompositeComponent.prototype}
7661 */
7662 var ReactCompositeComponentMixin = {
7663
7664 /**
7665 * Base constructor for all composite component.
7666 *
7667 * @param {ReactElement} element
7668 * @final
7669 * @internal
7670 */
7671 construct: function (element) {
7672 this._currentElement = element;
7673 this._rootNodeID = null;
7674 this._instance = null;
7675
7676 // See ReactUpdateQueue
7677 this._pendingElement = null;
7678 this._pendingStateQueue = null;
7679 this._pendingReplaceState = false;
7680 this._pendingForceUpdate = false;
7681
7682 this._renderedComponent = null;
7683
7684 this._context = null;
7685 this._mountOrder = 0;
7686 this._topLevelWrapper = null;
7687
7688 // See ReactUpdates and ReactUpdateQueue.
7689 this._pendingCallbacks = null;
7690 },
7691
7692 /**
7693 * Initializes the component, renders markup, and registers event listeners.
7694 *
7695 * @param {string} rootID DOM ID of the root node.
7696 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7697 * @return {?string} Rendered markup to be inserted into the DOM.
7698 * @final
7699 * @internal
7700 */
7701 mountComponent: function (rootID, transaction, context) {
7702 this._context = context;
7703 this._mountOrder = nextMountID++;
7704 this._rootNodeID = rootID;
7705
7706 var publicProps = this._processProps(this._currentElement.props);
7707 var publicContext = this._processContext(context);
7708
7709 var Component = this._currentElement.type;
7710
7711 // Initialize the public class
7712 var inst;
7713 var renderedElement;
7714
7715 // This is a way to detect if Component is a stateless arrow function
7716 // component, which is not newable. It might not be 100% reliable but is
7717 // something we can do until we start detecting that Component extends
7718 // React.Component. We already assume that typeof Component === 'function'.
7719 var canInstantiate = ('prototype' in Component);
7720
7721 if (canInstantiate) {
7722 if (process.env.NODE_ENV !== 'production') {
7723 ReactCurrentOwner.current = this;
7724 try {
7725 inst = new Component(publicProps, publicContext, ReactUpdateQueue);
7726 } finally {
7727 ReactCurrentOwner.current = null;
7728 }
7729 } else {
7730 inst = new Component(publicProps, publicContext, ReactUpdateQueue);
7731 }
7732 }
7733
7734 if (!canInstantiate || inst === null || inst === false || ReactElement.isValidElement(inst)) {
7735 renderedElement = inst;
7736 inst = new StatelessComponent(Component);
7737 }
7738
7739 if (process.env.NODE_ENV !== 'production') {
7740 // This will throw later in _renderValidatedComponent, but add an early
7741 // warning now to help debugging
7742 if (inst.render == null) {
7743 process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`, returned ' + 'null/false from a stateless component, or tried to render an ' + 'element whose type is a function that isn\'t a React component.', Component.displayName || Component.name || 'Component') : undefined;
7744 } else {
7745 // We support ES6 inheriting from React.Component, the module pattern,
7746 // and stateless components, but not ES6 classes that don't extend
7747 process.env.NODE_ENV !== 'production' ? warning(Component.prototype && Component.prototype.isReactComponent || !canInstantiate || !(inst instanceof Component), '%s(...): React component classes must extend React.Component.', Component.displayName || Component.name || 'Component') : undefined;
7748 }
7749 }
7750
7751 // These should be set up in the constructor, but as a convenience for
7752 // simpler class abstractions, we set them up after the fact.
7753 inst.props = publicProps;
7754 inst.context = publicContext;
7755 inst.refs = emptyObject;
7756 inst.updater = ReactUpdateQueue;
7757
7758 this._instance = inst;
7759
7760 // Store a reference from the instance back to the internal representation
7761 ReactInstanceMap.set(inst, this);
7762
7763 if (process.env.NODE_ENV !== 'production') {
7764 // Since plain JS classes are defined without any special initialization
7765 // logic, we can not catch common errors early. Therefore, we have to
7766 // catch them here, at initialization time, instead.
7767 process.env.NODE_ENV !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : undefined;
7768 process.env.NODE_ENV !== 'production' ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : undefined;
7769 process.env.NODE_ENV !== 'production' ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : undefined;
7770 process.env.NODE_ENV !== 'production' ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : undefined;
7771 process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : undefined;
7772 process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : undefined;
7773 process.env.NODE_ENV !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : undefined;
7774 }
7775
7776 var initialState = inst.state;
7777 if (initialState === undefined) {
7778 inst.state = initialState = null;
7779 }
7780 !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
7781
7782 this._pendingStateQueue = null;
7783 this._pendingReplaceState = false;
7784 this._pendingForceUpdate = false;
7785
7786 if (inst.componentWillMount) {
7787 inst.componentWillMount();
7788 // When mounting, calls to `setState` by `componentWillMount` will set
7789 // `this._pendingStateQueue` without triggering a re-render.
7790 if (this._pendingStateQueue) {
7791 inst.state = this._processPendingState(inst.props, inst.context);
7792 }
7793 }
7794
7795 // If not a stateless component, we now render
7796 if (renderedElement === undefined) {
7797 renderedElement = this._renderValidatedComponent();
7798 }
7799
7800 this._renderedComponent = this._instantiateReactComponent(renderedElement);
7801
7802 var markup = ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, this._processChildContext(context));
7803 if (inst.componentDidMount) {
7804 transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
7805 }
7806
7807 return markup;
7808 },
7809
7810 /**
7811 * Releases any resources allocated by `mountComponent`.
7812 *
7813 * @final
7814 * @internal
7815 */
7816 unmountComponent: function () {
7817 var inst = this._instance;
7818
7819 if (inst.componentWillUnmount) {
7820 inst.componentWillUnmount();
7821 }
7822
7823 ReactReconciler.unmountComponent(this._renderedComponent);
7824 this._renderedComponent = null;
7825 this._instance = null;
7826
7827 // Reset pending fields
7828 // Even if this component is scheduled for another update in ReactUpdates,
7829 // it would still be ignored because these fields are reset.
7830 this._pendingStateQueue = null;
7831 this._pendingReplaceState = false;
7832 this._pendingForceUpdate = false;
7833 this._pendingCallbacks = null;
7834 this._pendingElement = null;
7835
7836 // These fields do not really need to be reset since this object is no
7837 // longer accessible.
7838 this._context = null;
7839 this._rootNodeID = null;
7840 this._topLevelWrapper = null;
7841
7842 // Delete the reference from the instance to this internal representation
7843 // which allow the internals to be properly cleaned up even if the user
7844 // leaks a reference to the public instance.
7845 ReactInstanceMap.remove(inst);
7846
7847 // Some existing components rely on inst.props even after they've been
7848 // destroyed (in event handlers).
7849 // TODO: inst.props = null;
7850 // TODO: inst.state = null;
7851 // TODO: inst.context = null;
7852 },
7853
7854 /**
7855 * Filters the context object to only contain keys specified in
7856 * `contextTypes`
7857 *
7858 * @param {object} context
7859 * @return {?object}
7860 * @private
7861 */
7862 _maskContext: function (context) {
7863 var maskedContext = null;
7864 var Component = this._currentElement.type;
7865 var contextTypes = Component.contextTypes;
7866 if (!contextTypes) {
7867 return emptyObject;
7868 }
7869 maskedContext = {};
7870 for (var contextName in contextTypes) {
7871 maskedContext[contextName] = context[contextName];
7872 }
7873 return maskedContext;
7874 },
7875
7876 /**
7877 * Filters the context object to only contain keys specified in
7878 * `contextTypes`, and asserts that they are valid.
7879 *
7880 * @param {object} context
7881 * @return {?object}
7882 * @private
7883 */
7884 _processContext: function (context) {
7885 var maskedContext = this._maskContext(context);
7886 if (process.env.NODE_ENV !== 'production') {
7887 var Component = this._currentElement.type;
7888 if (Component.contextTypes) {
7889 this._checkPropTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);
7890 }
7891 }
7892 return maskedContext;
7893 },
7894
7895 /**
7896 * @param {object} currentContext
7897 * @return {object}
7898 * @private
7899 */
7900 _processChildContext: function (currentContext) {
7901 var Component = this._currentElement.type;
7902 var inst = this._instance;
7903 var childContext = inst.getChildContext && inst.getChildContext();
7904 if (childContext) {
7905 !(typeof Component.childContextTypes === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
7906 if (process.env.NODE_ENV !== 'production') {
7907 this._checkPropTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);
7908 }
7909 for (var name in childContext) {
7910 !(name in Component.childContextTypes) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : invariant(false) : undefined;
7911 }
7912 return assign({}, currentContext, childContext);
7913 }
7914 return currentContext;
7915 },
7916
7917 /**
7918 * Processes props by setting default values for unspecified props and
7919 * asserting that the props are valid. Does not mutate its argument; returns
7920 * a new props object with defaults merged in.
7921 *
7922 * @param {object} newProps
7923 * @return {object}
7924 * @private
7925 */
7926 _processProps: function (newProps) {
7927 if (process.env.NODE_ENV !== 'production') {
7928 var Component = this._currentElement.type;
7929 if (Component.propTypes) {
7930 this._checkPropTypes(Component.propTypes, newProps, ReactPropTypeLocations.prop);
7931 }
7932 }
7933 return newProps;
7934 },
7935
7936 /**
7937 * Assert that the props are valid
7938 *
7939 * @param {object} propTypes Map of prop name to a ReactPropType
7940 * @param {object} props
7941 * @param {string} location e.g. "prop", "context", "child context"
7942 * @private
7943 */
7944 _checkPropTypes: function (propTypes, props, location) {
7945 // TODO: Stop validating prop types here and only use the element
7946 // validation.
7947 var componentName = this.getName();
7948 for (var propName in propTypes) {
7949 if (propTypes.hasOwnProperty(propName)) {
7950 var error;
7951 try {
7952 // This is intentionally an invariant that gets caught. It's the same
7953 // behavior as without this statement except with a better message.
7954 !(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually ' + 'from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined;
7955 error = propTypes[propName](props, propName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
7956 } catch (ex) {
7957 error = ex;
7958 }
7959 if (error instanceof Error) {
7960 // We may want to extend this logic for similar errors in
7961 // top-level render calls, so I'm abstracting it away into
7962 // a function to minimize refactoring in the future
7963 var addendum = getDeclarationErrorAddendum(this);
7964
7965 if (location === ReactPropTypeLocations.prop) {
7966 // Preface gives us something to blacklist in warning module
7967 process.env.NODE_ENV !== 'production' ? warning(false, 'Failed Composite propType: %s%s', error.message, addendum) : undefined;
7968 } else {
7969 process.env.NODE_ENV !== 'production' ? warning(false, 'Failed Context Types: %s%s', error.message, addendum) : undefined;
7970 }
7971 }
7972 }
7973 }
7974 },
7975
7976 receiveComponent: function (nextElement, transaction, nextContext) {
7977 var prevElement = this._currentElement;
7978 var prevContext = this._context;
7979
7980 this._pendingElement = null;
7981
7982 this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
7983 },
7984
7985 /**
7986 * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
7987 * is set, update the component.
7988 *
7989 * @param {ReactReconcileTransaction} transaction
7990 * @internal
7991 */
7992 performUpdateIfNecessary: function (transaction) {
7993 if (this._pendingElement != null) {
7994 ReactReconciler.receiveComponent(this, this._pendingElement || this._currentElement, transaction, this._context);
7995 }
7996
7997 if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
7998 this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
7999 }
8000 },
8001
8002 /**
8003 * Perform an update to a mounted component. The componentWillReceiveProps and
8004 * shouldComponentUpdate methods are called, then (assuming the update isn't
8005 * skipped) the remaining update lifecycle methods are called and the DOM
8006 * representation is updated.
8007 *
8008 * By default, this implements React's rendering and reconciliation algorithm.
8009 * Sophisticated clients may wish to override this.
8010 *
8011 * @param {ReactReconcileTransaction} transaction
8012 * @param {ReactElement} prevParentElement
8013 * @param {ReactElement} nextParentElement
8014 * @internal
8015 * @overridable
8016 */
8017 updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
8018 var inst = this._instance;
8019
8020 var nextContext = this._context === nextUnmaskedContext ? inst.context : this._processContext(nextUnmaskedContext);
8021 var nextProps;
8022
8023 // Distinguish between a props update versus a simple state update
8024 if (prevParentElement === nextParentElement) {
8025 // Skip checking prop types again -- we don't read inst.props to avoid
8026 // warning for DOM component props in this upgrade
8027 nextProps = nextParentElement.props;
8028 } else {
8029 nextProps = this._processProps(nextParentElement.props);
8030 // An update here will schedule an update but immediately set
8031 // _pendingStateQueue which will ensure that any state updates gets
8032 // immediately reconciled instead of waiting for the next batch.
8033
8034 if (inst.componentWillReceiveProps) {
8035 inst.componentWillReceiveProps(nextProps, nextContext);
8036 }
8037 }
8038
8039 var nextState = this._processPendingState(nextProps, nextContext);
8040
8041 var shouldUpdate = this._pendingForceUpdate || !inst.shouldComponentUpdate || inst.shouldComponentUpdate(nextProps, nextState, nextContext);
8042
8043 if (process.env.NODE_ENV !== 'production') {
8044 process.env.NODE_ENV !== 'production' ? warning(typeof shouldUpdate !== 'undefined', '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : undefined;
8045 }
8046
8047 if (shouldUpdate) {
8048 this._pendingForceUpdate = false;
8049 // Will set `this.props`, `this.state` and `this.context`.
8050 this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
8051 } else {
8052 // If it's determined that a component should not update, we still want
8053 // to set props and state but we shortcut the rest of the update.
8054 this._currentElement = nextParentElement;
8055 this._context = nextUnmaskedContext;
8056 inst.props = nextProps;
8057 inst.state = nextState;
8058 inst.context = nextContext;
8059 }
8060 },
8061
8062 _processPendingState: function (props, context) {
8063 var inst = this._instance;
8064 var queue = this._pendingStateQueue;
8065 var replace = this._pendingReplaceState;
8066 this._pendingReplaceState = false;
8067 this._pendingStateQueue = null;
8068
8069 if (!queue) {
8070 return inst.state;
8071 }
8072
8073 if (replace && queue.length === 1) {
8074 return queue[0];
8075 }
8076
8077 var nextState = assign({}, replace ? queue[0] : inst.state);
8078 for (var i = replace ? 1 : 0; i < queue.length; i++) {
8079 var partial = queue[i];
8080 assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
8081 }
8082
8083 return nextState;
8084 },
8085
8086 /**
8087 * Merges new props and state, notifies delegate methods of update and
8088 * performs update.
8089 *
8090 * @param {ReactElement} nextElement Next element
8091 * @param {object} nextProps Next public object to set as properties.
8092 * @param {?object} nextState Next object to set as state.
8093 * @param {?object} nextContext Next public object to set as context.
8094 * @param {ReactReconcileTransaction} transaction
8095 * @param {?object} unmaskedContext
8096 * @private
8097 */
8098 _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
8099 var inst = this._instance;
8100
8101 var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
8102 var prevProps;
8103 var prevState;
8104 var prevContext;
8105 if (hasComponentDidUpdate) {
8106 prevProps = inst.props;
8107 prevState = inst.state;
8108 prevContext = inst.context;
8109 }
8110
8111 if (inst.componentWillUpdate) {
8112 inst.componentWillUpdate(nextProps, nextState, nextContext);
8113 }
8114
8115 this._currentElement = nextElement;
8116 this._context = unmaskedContext;
8117 inst.props = nextProps;
8118 inst.state = nextState;
8119 inst.context = nextContext;
8120
8121 this._updateRenderedComponent(transaction, unmaskedContext);
8122
8123 if (hasComponentDidUpdate) {
8124 transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
8125 }
8126 },
8127
8128 /**
8129 * Call the component's `render` method and update the DOM accordingly.
8130 *
8131 * @param {ReactReconcileTransaction} transaction
8132 * @internal
8133 */
8134 _updateRenderedComponent: function (transaction, context) {
8135 var prevComponentInstance = this._renderedComponent;
8136 var prevRenderedElement = prevComponentInstance._currentElement;
8137 var nextRenderedElement = this._renderValidatedComponent();
8138 if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
8139 ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
8140 } else {
8141 // These two IDs are actually the same! But nothing should rely on that.
8142 var thisID = this._rootNodeID;
8143 var prevComponentID = prevComponentInstance._rootNodeID;
8144 ReactReconciler.unmountComponent(prevComponentInstance);
8145
8146 this._renderedComponent = this._instantiateReactComponent(nextRenderedElement);
8147 var nextMarkup = ReactReconciler.mountComponent(this._renderedComponent, thisID, transaction, this._processChildContext(context));
8148 this._replaceNodeWithMarkupByID(prevComponentID, nextMarkup);
8149 }
8150 },
8151
8152 /**
8153 * @protected
8154 */
8155 _replaceNodeWithMarkupByID: function (prevComponentID, nextMarkup) {
8156 ReactComponentEnvironment.replaceNodeWithMarkupByID(prevComponentID, nextMarkup);
8157 },
8158
8159 /**
8160 * @protected
8161 */
8162 _renderValidatedComponentWithoutOwnerOrContext: function () {
8163 var inst = this._instance;
8164 var renderedComponent = inst.render();
8165 if (process.env.NODE_ENV !== 'production') {
8166 // We allow auto-mocks to proceed as if they're returning null.
8167 if (typeof renderedComponent === 'undefined' && inst.render._isMockFunction) {
8168 // This is probably bad practice. Consider warning here and
8169 // deprecating this convenience.
8170 renderedComponent = null;
8171 }
8172 }
8173
8174 return renderedComponent;
8175 },
8176
8177 /**
8178 * @private
8179 */
8180 _renderValidatedComponent: function () {
8181 var renderedComponent;
8182 ReactCurrentOwner.current = this;
8183 try {
8184 renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
8185 } finally {
8186 ReactCurrentOwner.current = null;
8187 }
8188 !(
8189 // TODO: An `isValidNode` function would probably be more appropriate
8190 renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.render(): A valid ReactComponent must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : invariant(false) : undefined;
8191 return renderedComponent;
8192 },
8193
8194 /**
8195 * Lazily allocates the refs object and stores `component` as `ref`.
8196 *
8197 * @param {string} ref Reference name.
8198 * @param {component} component Component to store as `ref`.
8199 * @final
8200 * @private
8201 */
8202 attachRef: function (ref, component) {
8203 var inst = this.getPublicInstance();
8204 !(inst != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : invariant(false) : undefined;
8205 var publicComponentInstance = component.getPublicInstance();
8206 if (process.env.NODE_ENV !== 'production') {
8207 var componentName = component && component.getName ? component.getName() : 'a component';
8208 process.env.NODE_ENV !== 'production' ? warning(publicComponentInstance != null, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : undefined;
8209 }
8210 var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
8211 refs[ref] = publicComponentInstance;
8212 },
8213
8214 /**
8215 * Detaches a reference name.
8216 *
8217 * @param {string} ref Name to dereference.
8218 * @final
8219 * @private
8220 */
8221 detachRef: function (ref) {
8222 var refs = this.getPublicInstance().refs;
8223 delete refs[ref];
8224 },
8225
8226 /**
8227 * Get a text description of the component that can be used to identify it
8228 * in error messages.
8229 * @return {string} The name or null.
8230 * @internal
8231 */
8232 getName: function () {
8233 var type = this._currentElement.type;
8234 var constructor = this._instance && this._instance.constructor;
8235 return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
8236 },
8237
8238 /**
8239 * Get the publicly accessible representation of this component - i.e. what
8240 * is exposed by refs and returned by render. Can be null for stateless
8241 * components.
8242 *
8243 * @return {ReactComponent} the public component instance.
8244 * @internal
8245 */
8246 getPublicInstance: function () {
8247 var inst = this._instance;
8248 if (inst instanceof StatelessComponent) {
8249 return null;
8250 }
8251 return inst;
8252 },
8253
8254 // Stub
8255 _instantiateReactComponent: null
8256
8257 };
8258
8259 ReactPerf.measureMethods(ReactCompositeComponentMixin, 'ReactCompositeComponent', {
8260 mountComponent: 'mountComponent',
8261 updateComponent: 'updateComponent',
8262 _renderValidatedComponent: '_renderValidatedComponent'
8263 });
8264
8265 var ReactCompositeComponent = {
8266
8267 Mixin: ReactCompositeComponentMixin
8268
8269 };
8270
8271 module.exports = ReactCompositeComponent;
8272 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
8273
8274/***/ }),
8275/* 65 */
8276/***/ (function(module, exports, __webpack_require__) {
8277
8278 /* WEBPACK VAR INJECTION */(function(process) {/**
8279 * Copyright 2014-2015, Facebook, Inc.
8280 * All rights reserved.
8281 *
8282 * This source code is licensed under the BSD-style license found in the
8283 * LICENSE file in the root directory of this source tree. An additional grant
8284 * of patent rights can be found in the PATENTS file in the same directory.
8285 *
8286 * @providesModule ReactComponentEnvironment
8287 */
8288
8289 'use strict';
8290
8291 var invariant = __webpack_require__(14);
8292
8293 var injected = false;
8294
8295 var ReactComponentEnvironment = {
8296
8297 /**
8298 * Optionally injectable environment dependent cleanup hook. (server vs.
8299 * browser etc). Example: A browser system caches DOM nodes based on component
8300 * ID and must remove that cache entry when this instance is unmounted.
8301 */
8302 unmountIDFromEnvironment: null,
8303
8304 /**
8305 * Optionally injectable hook for swapping out mount images in the middle of
8306 * the tree.
8307 */
8308 replaceNodeWithMarkupByID: null,
8309
8310 /**
8311 * Optionally injectable hook for processing a queue of child updates. Will
8312 * later move into MultiChildComponents.
8313 */
8314 processChildrenUpdates: null,
8315
8316 injection: {
8317 injectEnvironment: function (environment) {
8318 !!injected ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : invariant(false) : undefined;
8319 ReactComponentEnvironment.unmountIDFromEnvironment = environment.unmountIDFromEnvironment;
8320 ReactComponentEnvironment.replaceNodeWithMarkupByID = environment.replaceNodeWithMarkupByID;
8321 ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
8322 injected = true;
8323 }
8324 }
8325
8326 };
8327
8328 module.exports = ReactComponentEnvironment;
8329 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
8330
8331/***/ }),
8332/* 66 */
8333/***/ (function(module, exports, __webpack_require__) {
8334
8335 /**
8336 * Copyright 2013-2015, Facebook, Inc.
8337 * All rights reserved.
8338 *
8339 * This source code is licensed under the BSD-style license found in the
8340 * LICENSE file in the root directory of this source tree. An additional grant
8341 * of patent rights can be found in the PATENTS file in the same directory.
8342 *
8343 * @providesModule ReactPropTypeLocations
8344 */
8345
8346 'use strict';
8347
8348 var keyMirror = __webpack_require__(18);
8349
8350 var ReactPropTypeLocations = keyMirror({
8351 prop: null,
8352 context: null,
8353 childContext: null
8354 });
8355
8356 module.exports = ReactPropTypeLocations;
8357
8358/***/ }),
8359/* 67 */
8360/***/ (function(module, exports, __webpack_require__) {
8361
8362 /* WEBPACK VAR INJECTION */(function(process) {/**
8363 * Copyright 2013-2015, Facebook, Inc.
8364 * All rights reserved.
8365 *
8366 * This source code is licensed under the BSD-style license found in the
8367 * LICENSE file in the root directory of this source tree. An additional grant
8368 * of patent rights can be found in the PATENTS file in the same directory.
8369 *
8370 * @providesModule ReactPropTypeLocationNames
8371 */
8372
8373 'use strict';
8374
8375 var ReactPropTypeLocationNames = {};
8376
8377 if (process.env.NODE_ENV !== 'production') {
8378 ReactPropTypeLocationNames = {
8379 prop: 'prop',
8380 context: 'context',
8381 childContext: 'child context'
8382 };
8383 }
8384
8385 module.exports = ReactPropTypeLocationNames;
8386 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
8387
8388/***/ }),
8389/* 68 */
8390/***/ (function(module, exports) {
8391
8392 /**
8393 * Copyright 2013-2015, Facebook, Inc.
8394 * All rights reserved.
8395 *
8396 * This source code is licensed under the BSD-style license found in the
8397 * LICENSE file in the root directory of this source tree. An additional grant
8398 * of patent rights can be found in the PATENTS file in the same directory.
8399 *
8400 * @providesModule shouldUpdateReactComponent
8401 * @typechecks static-only
8402 */
8403
8404 'use strict';
8405
8406 /**
8407 * Given a `prevElement` and `nextElement`, determines if the existing
8408 * instance should be updated as opposed to being destroyed or replaced by a new
8409 * instance. Both arguments are elements. This ensures that this logic can
8410 * operate on stateless trees without any backing instance.
8411 *
8412 * @param {?object} prevElement
8413 * @param {?object} nextElement
8414 * @return {boolean} True if the existing instance should be updated.
8415 * @protected
8416 */
8417 function shouldUpdateReactComponent(prevElement, nextElement) {
8418 var prevEmpty = prevElement === null || prevElement === false;
8419 var nextEmpty = nextElement === null || nextElement === false;
8420 if (prevEmpty || nextEmpty) {
8421 return prevEmpty === nextEmpty;
8422 }
8423
8424 var prevType = typeof prevElement;
8425 var nextType = typeof nextElement;
8426 if (prevType === 'string' || prevType === 'number') {
8427 return nextType === 'string' || nextType === 'number';
8428 } else {
8429 return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
8430 }
8431 return false;
8432 }
8433
8434 module.exports = shouldUpdateReactComponent;
8435
8436/***/ }),
8437/* 69 */
8438/***/ (function(module, exports, __webpack_require__) {
8439
8440 /**
8441 * Copyright 2014-2015, Facebook, Inc.
8442 * All rights reserved.
8443 *
8444 * This source code is licensed under the BSD-style license found in the
8445 * LICENSE file in the root directory of this source tree. An additional grant
8446 * of patent rights can be found in the PATENTS file in the same directory.
8447 *
8448 * @providesModule ReactEmptyComponent
8449 */
8450
8451 'use strict';
8452
8453 var ReactElement = __webpack_require__(43);
8454 var ReactEmptyComponentRegistry = __webpack_require__(45);
8455 var ReactReconciler = __webpack_require__(51);
8456
8457 var assign = __webpack_require__(40);
8458
8459 var placeholderElement;
8460
8461 var ReactEmptyComponentInjection = {
8462 injectEmptyComponent: function (component) {
8463 placeholderElement = ReactElement.createElement(component);
8464 }
8465 };
8466
8467 function registerNullComponentID() {
8468 ReactEmptyComponentRegistry.registerNullComponentID(this._rootNodeID);
8469 }
8470
8471 var ReactEmptyComponent = function (instantiate) {
8472 this._currentElement = null;
8473 this._rootNodeID = null;
8474 this._renderedComponent = instantiate(placeholderElement);
8475 };
8476 assign(ReactEmptyComponent.prototype, {
8477 construct: function (element) {},
8478 mountComponent: function (rootID, transaction, context) {
8479 transaction.getReactMountReady().enqueue(registerNullComponentID, this);
8480 this._rootNodeID = rootID;
8481 return ReactReconciler.mountComponent(this._renderedComponent, rootID, transaction, context);
8482 },
8483 receiveComponent: function () {},
8484 unmountComponent: function (rootID, transaction, context) {
8485 ReactReconciler.unmountComponent(this._renderedComponent);
8486 ReactEmptyComponentRegistry.deregisterNullComponentID(this._rootNodeID);
8487 this._rootNodeID = null;
8488 this._renderedComponent = null;
8489 }
8490 });
8491
8492 ReactEmptyComponent.injection = ReactEmptyComponentInjection;
8493
8494 module.exports = ReactEmptyComponent;
8495
8496/***/ }),
8497/* 70 */
8498/***/ (function(module, exports, __webpack_require__) {
8499
8500 /* WEBPACK VAR INJECTION */(function(process) {/**
8501 * Copyright 2014-2015, Facebook, Inc.
8502 * All rights reserved.
8503 *
8504 * This source code is licensed under the BSD-style license found in the
8505 * LICENSE file in the root directory of this source tree. An additional grant
8506 * of patent rights can be found in the PATENTS file in the same directory.
8507 *
8508 * @providesModule ReactNativeComponent
8509 */
8510
8511 'use strict';
8512
8513 var assign = __webpack_require__(40);
8514 var invariant = __webpack_require__(14);
8515
8516 var autoGenerateWrapperClass = null;
8517 var genericComponentClass = null;
8518 // This registry keeps track of wrapper classes around native tags.
8519 var tagToComponentClass = {};
8520 var textComponentClass = null;
8521
8522 var ReactNativeComponentInjection = {
8523 // This accepts a class that receives the tag string. This is a catch all
8524 // that can render any kind of tag.
8525 injectGenericComponentClass: function (componentClass) {
8526 genericComponentClass = componentClass;
8527 },
8528 // This accepts a text component class that takes the text string to be
8529 // rendered as props.
8530 injectTextComponentClass: function (componentClass) {
8531 textComponentClass = componentClass;
8532 },
8533 // This accepts a keyed object with classes as values. Each key represents a
8534 // tag. That particular tag will use this class instead of the generic one.
8535 injectComponentClasses: function (componentClasses) {
8536 assign(tagToComponentClass, componentClasses);
8537 }
8538 };
8539
8540 /**
8541 * Get a composite component wrapper class for a specific tag.
8542 *
8543 * @param {ReactElement} element The tag for which to get the class.
8544 * @return {function} The React class constructor function.
8545 */
8546 function getComponentClassForElement(element) {
8547 if (typeof element.type === 'function') {
8548 return element.type;
8549 }
8550 var tag = element.type;
8551 var componentClass = tagToComponentClass[tag];
8552 if (componentClass == null) {
8553 tagToComponentClass[tag] = componentClass = autoGenerateWrapperClass(tag);
8554 }
8555 return componentClass;
8556 }
8557
8558 /**
8559 * Get a native internal component class for a specific tag.
8560 *
8561 * @param {ReactElement} element The element to create.
8562 * @return {function} The internal class constructor function.
8563 */
8564 function createInternalComponent(element) {
8565 !genericComponentClass ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : invariant(false) : undefined;
8566 return new genericComponentClass(element.type, element.props);
8567 }
8568
8569 /**
8570 * @param {ReactText} text
8571 * @return {ReactComponent}
8572 */
8573 function createInstanceForText(text) {
8574 return new textComponentClass(text);
8575 }
8576
8577 /**
8578 * @param {ReactComponent} component
8579 * @return {boolean}
8580 */
8581 function isTextComponent(component) {
8582 return component instanceof textComponentClass;
8583 }
8584
8585 var ReactNativeComponent = {
8586 getComponentClassForElement: getComponentClassForElement,
8587 createInternalComponent: createInternalComponent,
8588 createInstanceForText: createInstanceForText,
8589 isTextComponent: isTextComponent,
8590 injection: ReactNativeComponentInjection
8591 };
8592
8593 module.exports = ReactNativeComponent;
8594 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
8595
8596/***/ }),
8597/* 71 */
8598/***/ (function(module, exports, __webpack_require__) {
8599
8600 /* WEBPACK VAR INJECTION */(function(process) {/**
8601 * Copyright 2015, Facebook, Inc.
8602 * All rights reserved.
8603 *
8604 * This source code is licensed under the BSD-style license found in the
8605 * LICENSE file in the root directory of this source tree. An additional grant
8606 * of patent rights can be found in the PATENTS file in the same directory.
8607 *
8608 * @providesModule validateDOMNesting
8609 */
8610
8611 'use strict';
8612
8613 var assign = __webpack_require__(40);
8614 var emptyFunction = __webpack_require__(16);
8615 var warning = __webpack_require__(26);
8616
8617 var validateDOMNesting = emptyFunction;
8618
8619 if (process.env.NODE_ENV !== 'production') {
8620 // This validation code was written based on the HTML5 parsing spec:
8621 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
8622 //
8623 // Note: this does not catch all invalid nesting, nor does it try to (as it's
8624 // not clear what practical benefit doing so provides); instead, we warn only
8625 // for cases where the parser will give a parse tree differing from what React
8626 // intended. For example, <b><div></div></b> is invalid but we don't warn
8627 // because it still parses correctly; we do warn for other cases like nested
8628 // <p> tags where the beginning of the second element implicitly closes the
8629 // first, causing a confusing mess.
8630
8631 // https://html.spec.whatwg.org/multipage/syntax.html#special
8632 var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
8633
8634 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
8635 var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
8636
8637 // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
8638 // TODO: Distinguish by namespace here -- for <title>, including it here
8639 // errs on the side of fewer warnings
8640 'foreignObject', 'desc', 'title'];
8641
8642 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
8643 var buttonScopeTags = inScopeTags.concat(['button']);
8644
8645 // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
8646 var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
8647
8648 var emptyAncestorInfo = {
8649 parentTag: null,
8650
8651 formTag: null,
8652 aTagInScope: null,
8653 buttonTagInScope: null,
8654 nobrTagInScope: null,
8655 pTagInButtonScope: null,
8656
8657 listItemTagAutoclosing: null,
8658 dlItemTagAutoclosing: null
8659 };
8660
8661 var updatedAncestorInfo = function (oldInfo, tag, instance) {
8662 var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo);
8663 var info = { tag: tag, instance: instance };
8664
8665 if (inScopeTags.indexOf(tag) !== -1) {
8666 ancestorInfo.aTagInScope = null;
8667 ancestorInfo.buttonTagInScope = null;
8668 ancestorInfo.nobrTagInScope = null;
8669 }
8670 if (buttonScopeTags.indexOf(tag) !== -1) {
8671 ancestorInfo.pTagInButtonScope = null;
8672 }
8673
8674 // See rules for 'li', 'dd', 'dt' start tags in
8675 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
8676 if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
8677 ancestorInfo.listItemTagAutoclosing = null;
8678 ancestorInfo.dlItemTagAutoclosing = null;
8679 }
8680
8681 ancestorInfo.parentTag = info;
8682
8683 if (tag === 'form') {
8684 ancestorInfo.formTag = info;
8685 }
8686 if (tag === 'a') {
8687 ancestorInfo.aTagInScope = info;
8688 }
8689 if (tag === 'button') {
8690 ancestorInfo.buttonTagInScope = info;
8691 }
8692 if (tag === 'nobr') {
8693 ancestorInfo.nobrTagInScope = info;
8694 }
8695 if (tag === 'p') {
8696 ancestorInfo.pTagInButtonScope = info;
8697 }
8698 if (tag === 'li') {
8699 ancestorInfo.listItemTagAutoclosing = info;
8700 }
8701 if (tag === 'dd' || tag === 'dt') {
8702 ancestorInfo.dlItemTagAutoclosing = info;
8703 }
8704
8705 return ancestorInfo;
8706 };
8707
8708 /**
8709 * Returns whether
8710 */
8711 var isTagValidWithParent = function (tag, parentTag) {
8712 // First, let's check if we're in an unusual parsing mode...
8713 switch (parentTag) {
8714 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
8715 case 'select':
8716 return tag === 'option' || tag === 'optgroup' || tag === '#text';
8717 case 'optgroup':
8718 return tag === 'option' || tag === '#text';
8719 // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
8720 // but
8721 case 'option':
8722 return tag === '#text';
8723
8724 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
8725 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
8726 // No special behavior since these rules fall back to "in body" mode for
8727 // all except special table nodes which cause bad parsing behavior anyway.
8728
8729 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
8730 case 'tr':
8731 return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
8732
8733 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
8734 case 'tbody':
8735 case 'thead':
8736 case 'tfoot':
8737 return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
8738
8739 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
8740 case 'colgroup':
8741 return tag === 'col' || tag === 'template';
8742
8743 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
8744 case 'table':
8745 return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
8746
8747 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
8748 case 'head':
8749 return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
8750
8751 // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
8752 case 'html':
8753 return tag === 'head' || tag === 'body';
8754 }
8755
8756 // Probably in the "in body" parsing mode, so we outlaw only tag combos
8757 // where the parsing rules cause implicit opens or closes to be added.
8758 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
8759 switch (tag) {
8760 case 'h1':
8761 case 'h2':
8762 case 'h3':
8763 case 'h4':
8764 case 'h5':
8765 case 'h6':
8766 return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
8767
8768 case 'rp':
8769 case 'rt':
8770 return impliedEndTags.indexOf(parentTag) === -1;
8771
8772 case 'caption':
8773 case 'col':
8774 case 'colgroup':
8775 case 'frame':
8776 case 'head':
8777 case 'tbody':
8778 case 'td':
8779 case 'tfoot':
8780 case 'th':
8781 case 'thead':
8782 case 'tr':
8783 // These tags are only valid with a few parents that have special child
8784 // parsing rules -- if we're down here, then none of those matched and
8785 // so we allow it only if we don't know what the parent is, as all other
8786 // cases are invalid.
8787 return parentTag == null;
8788 }
8789
8790 return true;
8791 };
8792
8793 /**
8794 * Returns whether
8795 */
8796 var findInvalidAncestorForTag = function (tag, ancestorInfo) {
8797 switch (tag) {
8798 case 'address':
8799 case 'article':
8800 case 'aside':
8801 case 'blockquote':
8802 case 'center':
8803 case 'details':
8804 case 'dialog':
8805 case 'dir':
8806 case 'div':
8807 case 'dl':
8808 case 'fieldset':
8809 case 'figcaption':
8810 case 'figure':
8811 case 'footer':
8812 case 'header':
8813 case 'hgroup':
8814 case 'main':
8815 case 'menu':
8816 case 'nav':
8817 case 'ol':
8818 case 'p':
8819 case 'section':
8820 case 'summary':
8821 case 'ul':
8822
8823 case 'pre':
8824 case 'listing':
8825
8826 case 'table':
8827
8828 case 'hr':
8829
8830 case 'xmp':
8831
8832 case 'h1':
8833 case 'h2':
8834 case 'h3':
8835 case 'h4':
8836 case 'h5':
8837 case 'h6':
8838 return ancestorInfo.pTagInButtonScope;
8839
8840 case 'form':
8841 return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
8842
8843 case 'li':
8844 return ancestorInfo.listItemTagAutoclosing;
8845
8846 case 'dd':
8847 case 'dt':
8848 return ancestorInfo.dlItemTagAutoclosing;
8849
8850 case 'button':
8851 return ancestorInfo.buttonTagInScope;
8852
8853 case 'a':
8854 // Spec says something about storing a list of markers, but it sounds
8855 // equivalent to this check.
8856 return ancestorInfo.aTagInScope;
8857
8858 case 'nobr':
8859 return ancestorInfo.nobrTagInScope;
8860 }
8861
8862 return null;
8863 };
8864
8865 /**
8866 * Given a ReactCompositeComponent instance, return a list of its recursive
8867 * owners, starting at the root and ending with the instance itself.
8868 */
8869 var findOwnerStack = function (instance) {
8870 if (!instance) {
8871 return [];
8872 }
8873
8874 var stack = [];
8875 /*eslint-disable space-after-keywords */
8876 do {
8877 /*eslint-enable space-after-keywords */
8878 stack.push(instance);
8879 } while (instance = instance._currentElement._owner);
8880 stack.reverse();
8881 return stack;
8882 };
8883
8884 var didWarn = {};
8885
8886 validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
8887 ancestorInfo = ancestorInfo || emptyAncestorInfo;
8888 var parentInfo = ancestorInfo.parentTag;
8889 var parentTag = parentInfo && parentInfo.tag;
8890
8891 var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
8892 var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
8893 var problematic = invalidParent || invalidAncestor;
8894
8895 if (problematic) {
8896 var ancestorTag = problematic.tag;
8897 var ancestorInstance = problematic.instance;
8898
8899 var childOwner = childInstance && childInstance._currentElement._owner;
8900 var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
8901
8902 var childOwners = findOwnerStack(childOwner);
8903 var ancestorOwners = findOwnerStack(ancestorOwner);
8904
8905 var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
8906 var i;
8907
8908 var deepestCommon = -1;
8909 for (i = 0; i < minStackLen; i++) {
8910 if (childOwners[i] === ancestorOwners[i]) {
8911 deepestCommon = i;
8912 } else {
8913 break;
8914 }
8915 }
8916
8917 var UNKNOWN = '(unknown)';
8918 var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
8919 return inst.getName() || UNKNOWN;
8920 });
8921 var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
8922 return inst.getName() || UNKNOWN;
8923 });
8924 var ownerInfo = [].concat(
8925 // If the parent and child instances have a common owner ancestor, start
8926 // with that -- otherwise we just start with the parent's owners.
8927 deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
8928 // If we're warning about an invalid (non-parent) ancestry, add '...'
8929 invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
8930
8931 var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
8932 if (didWarn[warnKey]) {
8933 return;
8934 }
8935 didWarn[warnKey] = true;
8936
8937 if (invalidParent) {
8938 var info = '';
8939 if (ancestorTag === 'table' && childTag === 'tr') {
8940 info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
8941 }
8942 process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a child of <%s>. ' + 'See %s.%s', childTag, ancestorTag, ownerInfo, info) : undefined;
8943 } else {
8944 process.env.NODE_ENV !== 'production' ? warning(false, 'validateDOMNesting(...): <%s> cannot appear as a descendant of ' + '<%s>. See %s.', childTag, ancestorTag, ownerInfo) : undefined;
8945 }
8946 }
8947 };
8948
8949 validateDOMNesting.ancestorInfoContextKey = '__validateDOMNesting_ancestorInfo$' + Math.random().toString(36).slice(2);
8950
8951 validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
8952
8953 // For testing
8954 validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
8955 ancestorInfo = ancestorInfo || emptyAncestorInfo;
8956 var parentInfo = ancestorInfo.parentTag;
8957 var parentTag = parentInfo && parentInfo.tag;
8958 return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
8959 };
8960 }
8961
8962 module.exports = validateDOMNesting;
8963 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
8964
8965/***/ }),
8966/* 72 */
8967/***/ (function(module, exports, __webpack_require__) {
8968
8969 /* WEBPACK VAR INJECTION */(function(process) {/**
8970 * Copyright 2013-2015, Facebook, Inc.
8971 * All rights reserved.
8972 *
8973 * This source code is licensed under the BSD-style license found in the
8974 * LICENSE file in the root directory of this source tree. An additional grant
8975 * of patent rights can be found in the PATENTS file in the same directory.
8976 *
8977 * @providesModule ReactDefaultInjection
8978 */
8979
8980 'use strict';
8981
8982 var BeforeInputEventPlugin = __webpack_require__(73);
8983 var ChangeEventPlugin = __webpack_require__(81);
8984 var ClientReactRootIndex = __webpack_require__(84);
8985 var DefaultEventPluginOrder = __webpack_require__(85);
8986 var EnterLeaveEventPlugin = __webpack_require__(86);
8987 var ExecutionEnvironment = __webpack_require__(10);
8988 var HTMLDOMPropertyConfig = __webpack_require__(90);
8989 var ReactBrowserComponentMixin = __webpack_require__(91);
8990 var ReactComponentBrowserEnvironment = __webpack_require__(27);
8991 var ReactDefaultBatchingStrategy = __webpack_require__(93);
8992 var ReactDOMComponent = __webpack_require__(94);
8993 var ReactDOMTextComponent = __webpack_require__(7);
8994 var ReactEventListener = __webpack_require__(119);
8995 var ReactInjection = __webpack_require__(122);
8996 var ReactInstanceHandles = __webpack_require__(46);
8997 var ReactMount = __webpack_require__(29);
8998 var ReactReconcileTransaction = __webpack_require__(126);
8999 var SelectEventPlugin = __webpack_require__(131);
9000 var ServerReactRootIndex = __webpack_require__(132);
9001 var SimpleEventPlugin = __webpack_require__(133);
9002 var SVGDOMPropertyConfig = __webpack_require__(142);
9003
9004 var alreadyInjected = false;
9005
9006 function inject() {
9007 if (alreadyInjected) {
9008 // TODO: This is currently true because these injections are shared between
9009 // the client and the server package. They should be built independently
9010 // and not share any injection state. Then this problem will be solved.
9011 return;
9012 }
9013 alreadyInjected = true;
9014
9015 ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
9016
9017 /**
9018 * Inject modules for resolving DOM hierarchy and plugin ordering.
9019 */
9020 ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
9021 ReactInjection.EventPluginHub.injectInstanceHandle(ReactInstanceHandles);
9022 ReactInjection.EventPluginHub.injectMount(ReactMount);
9023
9024 /**
9025 * Some important event plugins included by default (without having to require
9026 * them).
9027 */
9028 ReactInjection.EventPluginHub.injectEventPluginsByName({
9029 SimpleEventPlugin: SimpleEventPlugin,
9030 EnterLeaveEventPlugin: EnterLeaveEventPlugin,
9031 ChangeEventPlugin: ChangeEventPlugin,
9032 SelectEventPlugin: SelectEventPlugin,
9033 BeforeInputEventPlugin: BeforeInputEventPlugin
9034 });
9035
9036 ReactInjection.NativeComponent.injectGenericComponentClass(ReactDOMComponent);
9037
9038 ReactInjection.NativeComponent.injectTextComponentClass(ReactDOMTextComponent);
9039
9040 ReactInjection.Class.injectMixin(ReactBrowserComponentMixin);
9041
9042 ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
9043 ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
9044
9045 ReactInjection.EmptyComponent.injectEmptyComponent('noscript');
9046
9047 ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
9048 ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
9049
9050 ReactInjection.RootIndex.injectCreateReactRootIndex(ExecutionEnvironment.canUseDOM ? ClientReactRootIndex.createReactRootIndex : ServerReactRootIndex.createReactRootIndex);
9051
9052 ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
9053
9054 if (process.env.NODE_ENV !== 'production') {
9055 var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
9056 if (/[?&]react_perf\b/.test(url)) {
9057 var ReactDefaultPerf = __webpack_require__(143);
9058 ReactDefaultPerf.start();
9059 }
9060 }
9061 }
9062
9063 module.exports = {
9064 inject: inject
9065 };
9066 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
9067
9068/***/ }),
9069/* 73 */
9070/***/ (function(module, exports, __webpack_require__) {
9071
9072 /**
9073 * Copyright 2013-2015 Facebook, Inc.
9074 * All rights reserved.
9075 *
9076 * This source code is licensed under the BSD-style license found in the
9077 * LICENSE file in the root directory of this source tree. An additional grant
9078 * of patent rights can be found in the PATENTS file in the same directory.
9079 *
9080 * @providesModule BeforeInputEventPlugin
9081 * @typechecks static-only
9082 */
9083
9084 'use strict';
9085
9086 var EventConstants = __webpack_require__(31);
9087 var EventPropagators = __webpack_require__(74);
9088 var ExecutionEnvironment = __webpack_require__(10);
9089 var FallbackCompositionState = __webpack_require__(75);
9090 var SyntheticCompositionEvent = __webpack_require__(77);
9091 var SyntheticInputEvent = __webpack_require__(79);
9092
9093 var keyOf = __webpack_require__(80);
9094
9095 var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
9096 var START_KEYCODE = 229;
9097
9098 var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
9099
9100 var documentMode = null;
9101 if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
9102 documentMode = document.documentMode;
9103 }
9104
9105 // Webkit offers a very useful `textInput` event that can be used to
9106 // directly represent `beforeInput`. The IE `textinput` event is not as
9107 // useful, so we don't use it.
9108 var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
9109
9110 // In IE9+, we have access to composition events, but the data supplied
9111 // by the native compositionend event may be incorrect. Japanese ideographic
9112 // spaces, for instance (\u3000) are not recorded correctly.
9113 var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
9114
9115 /**
9116 * Opera <= 12 includes TextEvent in window, but does not fire
9117 * text input events. Rely on keypress instead.
9118 */
9119 function isPresto() {
9120 var opera = window.opera;
9121 return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
9122 }
9123
9124 var SPACEBAR_CODE = 32;
9125 var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
9126
9127 var topLevelTypes = EventConstants.topLevelTypes;
9128
9129 // Events and their corresponding property names.
9130 var eventTypes = {
9131 beforeInput: {
9132 phasedRegistrationNames: {
9133 bubbled: keyOf({ onBeforeInput: null }),
9134 captured: keyOf({ onBeforeInputCapture: null })
9135 },
9136 dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste]
9137 },
9138 compositionEnd: {
9139 phasedRegistrationNames: {
9140 bubbled: keyOf({ onCompositionEnd: null }),
9141 captured: keyOf({ onCompositionEndCapture: null })
9142 },
9143 dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
9144 },
9145 compositionStart: {
9146 phasedRegistrationNames: {
9147 bubbled: keyOf({ onCompositionStart: null }),
9148 captured: keyOf({ onCompositionStartCapture: null })
9149 },
9150 dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
9151 },
9152 compositionUpdate: {
9153 phasedRegistrationNames: {
9154 bubbled: keyOf({ onCompositionUpdate: null }),
9155 captured: keyOf({ onCompositionUpdateCapture: null })
9156 },
9157 dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
9158 }
9159 };
9160
9161 // Track whether we've ever handled a keypress on the space key.
9162 var hasSpaceKeypress = false;
9163
9164 /**
9165 * Return whether a native keypress event is assumed to be a command.
9166 * This is required because Firefox fires `keypress` events for key commands
9167 * (cut, copy, select-all, etc.) even though no character is inserted.
9168 */
9169 function isKeypressCommand(nativeEvent) {
9170 return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
9171 // ctrlKey && altKey is equivalent to AltGr, and is not a command.
9172 !(nativeEvent.ctrlKey && nativeEvent.altKey);
9173 }
9174
9175 /**
9176 * Translate native top level events into event types.
9177 *
9178 * @param {string} topLevelType
9179 * @return {object}
9180 */
9181 function getCompositionEventType(topLevelType) {
9182 switch (topLevelType) {
9183 case topLevelTypes.topCompositionStart:
9184 return eventTypes.compositionStart;
9185 case topLevelTypes.topCompositionEnd:
9186 return eventTypes.compositionEnd;
9187 case topLevelTypes.topCompositionUpdate:
9188 return eventTypes.compositionUpdate;
9189 }
9190 }
9191
9192 /**
9193 * Does our fallback best-guess model think this event signifies that
9194 * composition has begun?
9195 *
9196 * @param {string} topLevelType
9197 * @param {object} nativeEvent
9198 * @return {boolean}
9199 */
9200 function isFallbackCompositionStart(topLevelType, nativeEvent) {
9201 return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;
9202 }
9203
9204 /**
9205 * Does our fallback mode think that this event is the end of composition?
9206 *
9207 * @param {string} topLevelType
9208 * @param {object} nativeEvent
9209 * @return {boolean}
9210 */
9211 function isFallbackCompositionEnd(topLevelType, nativeEvent) {
9212 switch (topLevelType) {
9213 case topLevelTypes.topKeyUp:
9214 // Command keys insert or clear IME input.
9215 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
9216 case topLevelTypes.topKeyDown:
9217 // Expect IME keyCode on each keydown. If we get any other
9218 // code we must have exited earlier.
9219 return nativeEvent.keyCode !== START_KEYCODE;
9220 case topLevelTypes.topKeyPress:
9221 case topLevelTypes.topMouseDown:
9222 case topLevelTypes.topBlur:
9223 // Events are not possible without cancelling IME.
9224 return true;
9225 default:
9226 return false;
9227 }
9228 }
9229
9230 /**
9231 * Google Input Tools provides composition data via a CustomEvent,
9232 * with the `data` property populated in the `detail` object. If this
9233 * is available on the event object, use it. If not, this is a plain
9234 * composition event and we have nothing special to extract.
9235 *
9236 * @param {object} nativeEvent
9237 * @return {?string}
9238 */
9239 function getDataFromCustomEvent(nativeEvent) {
9240 var detail = nativeEvent.detail;
9241 if (typeof detail === 'object' && 'data' in detail) {
9242 return detail.data;
9243 }
9244 return null;
9245 }
9246
9247 // Track the current IME composition fallback object, if any.
9248 var currentComposition = null;
9249
9250 /**
9251 * @param {string} topLevelType Record from `EventConstants`.
9252 * @param {DOMEventTarget} topLevelTarget The listening component root node.
9253 * @param {string} topLevelTargetID ID of `topLevelTarget`.
9254 * @param {object} nativeEvent Native browser event.
9255 * @return {?object} A SyntheticCompositionEvent.
9256 */
9257 function extractCompositionEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
9258 var eventType;
9259 var fallbackData;
9260
9261 if (canUseCompositionEvent) {
9262 eventType = getCompositionEventType(topLevelType);
9263 } else if (!currentComposition) {
9264 if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
9265 eventType = eventTypes.compositionStart;
9266 }
9267 } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
9268 eventType = eventTypes.compositionEnd;
9269 }
9270
9271 if (!eventType) {
9272 return null;
9273 }
9274
9275 if (useFallbackCompositionData) {
9276 // The current composition is stored statically and must not be
9277 // overwritten while composition continues.
9278 if (!currentComposition && eventType === eventTypes.compositionStart) {
9279 currentComposition = FallbackCompositionState.getPooled(topLevelTarget);
9280 } else if (eventType === eventTypes.compositionEnd) {
9281 if (currentComposition) {
9282 fallbackData = currentComposition.getData();
9283 }
9284 }
9285 }
9286
9287 var event = SyntheticCompositionEvent.getPooled(eventType, topLevelTargetID, nativeEvent, nativeEventTarget);
9288
9289 if (fallbackData) {
9290 // Inject data generated from fallback path into the synthetic event.
9291 // This matches the property of native CompositionEventInterface.
9292 event.data = fallbackData;
9293 } else {
9294 var customData = getDataFromCustomEvent(nativeEvent);
9295 if (customData !== null) {
9296 event.data = customData;
9297 }
9298 }
9299
9300 EventPropagators.accumulateTwoPhaseDispatches(event);
9301 return event;
9302 }
9303
9304 /**
9305 * @param {string} topLevelType Record from `EventConstants`.
9306 * @param {object} nativeEvent Native browser event.
9307 * @return {?string} The string corresponding to this `beforeInput` event.
9308 */
9309 function getNativeBeforeInputChars(topLevelType, nativeEvent) {
9310 switch (topLevelType) {
9311 case topLevelTypes.topCompositionEnd:
9312 return getDataFromCustomEvent(nativeEvent);
9313 case topLevelTypes.topKeyPress:
9314 /**
9315 * If native `textInput` events are available, our goal is to make
9316 * use of them. However, there is a special case: the spacebar key.
9317 * In Webkit, preventing default on a spacebar `textInput` event
9318 * cancels character insertion, but it *also* causes the browser
9319 * to fall back to its default spacebar behavior of scrolling the
9320 * page.
9321 *
9322 * Tracking at:
9323 * https://code.google.com/p/chromium/issues/detail?id=355103
9324 *
9325 * To avoid this issue, use the keypress event as if no `textInput`
9326 * event is available.
9327 */
9328 var which = nativeEvent.which;
9329 if (which !== SPACEBAR_CODE) {
9330 return null;
9331 }
9332
9333 hasSpaceKeypress = true;
9334 return SPACEBAR_CHAR;
9335
9336 case topLevelTypes.topTextInput:
9337 // Record the characters to be added to the DOM.
9338 var chars = nativeEvent.data;
9339
9340 // If it's a spacebar character, assume that we have already handled
9341 // it at the keypress level and bail immediately. Android Chrome
9342 // doesn't give us keycodes, so we need to blacklist it.
9343 if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
9344 return null;
9345 }
9346
9347 return chars;
9348
9349 default:
9350 // For other native event types, do nothing.
9351 return null;
9352 }
9353 }
9354
9355 /**
9356 * For browsers that do not provide the `textInput` event, extract the
9357 * appropriate string to use for SyntheticInputEvent.
9358 *
9359 * @param {string} topLevelType Record from `EventConstants`.
9360 * @param {object} nativeEvent Native browser event.
9361 * @return {?string} The fallback string for this `beforeInput` event.
9362 */
9363 function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
9364 // If we are currently composing (IME) and using a fallback to do so,
9365 // try to extract the composed characters from the fallback object.
9366 if (currentComposition) {
9367 if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) {
9368 var chars = currentComposition.getData();
9369 FallbackCompositionState.release(currentComposition);
9370 currentComposition = null;
9371 return chars;
9372 }
9373 return null;
9374 }
9375
9376 switch (topLevelType) {
9377 case topLevelTypes.topPaste:
9378 // If a paste event occurs after a keypress, throw out the input
9379 // chars. Paste events should not lead to BeforeInput events.
9380 return null;
9381 case topLevelTypes.topKeyPress:
9382 /**
9383 * As of v27, Firefox may fire keypress events even when no character
9384 * will be inserted. A few possibilities:
9385 *
9386 * - `which` is `0`. Arrow keys, Esc key, etc.
9387 *
9388 * - `which` is the pressed key code, but no char is available.
9389 * Ex: 'AltGr + d` in Polish. There is no modified character for
9390 * this key combination and no character is inserted into the
9391 * document, but FF fires the keypress for char code `100` anyway.
9392 * No `input` event will occur.
9393 *
9394 * - `which` is the pressed key code, but a command combination is
9395 * being used. Ex: `Cmd+C`. No character is inserted, and no
9396 * `input` event will occur.
9397 */
9398 if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
9399 return String.fromCharCode(nativeEvent.which);
9400 }
9401 return null;
9402 case topLevelTypes.topCompositionEnd:
9403 return useFallbackCompositionData ? null : nativeEvent.data;
9404 default:
9405 return null;
9406 }
9407 }
9408
9409 /**
9410 * Extract a SyntheticInputEvent for `beforeInput`, based on either native
9411 * `textInput` or fallback behavior.
9412 *
9413 * @param {string} topLevelType Record from `EventConstants`.
9414 * @param {DOMEventTarget} topLevelTarget The listening component root node.
9415 * @param {string} topLevelTargetID ID of `topLevelTarget`.
9416 * @param {object} nativeEvent Native browser event.
9417 * @return {?object} A SyntheticInputEvent.
9418 */
9419 function extractBeforeInputEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
9420 var chars;
9421
9422 if (canUseTextInputEvent) {
9423 chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
9424 } else {
9425 chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
9426 }
9427
9428 // If no characters are being inserted, no BeforeInput event should
9429 // be fired.
9430 if (!chars) {
9431 return null;
9432 }
9433
9434 var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, topLevelTargetID, nativeEvent, nativeEventTarget);
9435
9436 event.data = chars;
9437 EventPropagators.accumulateTwoPhaseDispatches(event);
9438 return event;
9439 }
9440
9441 /**
9442 * Create an `onBeforeInput` event to match
9443 * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
9444 *
9445 * This event plugin is based on the native `textInput` event
9446 * available in Chrome, Safari, Opera, and IE. This event fires after
9447 * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
9448 *
9449 * `beforeInput` is spec'd but not implemented in any browsers, and
9450 * the `input` event does not provide any useful information about what has
9451 * actually been added, contrary to the spec. Thus, `textInput` is the best
9452 * available event to identify the characters that have actually been inserted
9453 * into the target node.
9454 *
9455 * This plugin is also responsible for emitting `composition` events, thus
9456 * allowing us to share composition fallback code for both `beforeInput` and
9457 * `composition` event types.
9458 */
9459 var BeforeInputEventPlugin = {
9460
9461 eventTypes: eventTypes,
9462
9463 /**
9464 * @param {string} topLevelType Record from `EventConstants`.
9465 * @param {DOMEventTarget} topLevelTarget The listening component root node.
9466 * @param {string} topLevelTargetID ID of `topLevelTarget`.
9467 * @param {object} nativeEvent Native browser event.
9468 * @return {*} An accumulation of synthetic events.
9469 * @see {EventPluginHub.extractEvents}
9470 */
9471 extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
9472 return [extractCompositionEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget)];
9473 }
9474 };
9475
9476 module.exports = BeforeInputEventPlugin;
9477
9478/***/ }),
9479/* 74 */
9480/***/ (function(module, exports, __webpack_require__) {
9481
9482 /* WEBPACK VAR INJECTION */(function(process) {/**
9483 * Copyright 2013-2015, Facebook, Inc.
9484 * All rights reserved.
9485 *
9486 * This source code is licensed under the BSD-style license found in the
9487 * LICENSE file in the root directory of this source tree. An additional grant
9488 * of patent rights can be found in the PATENTS file in the same directory.
9489 *
9490 * @providesModule EventPropagators
9491 */
9492
9493 'use strict';
9494
9495 var EventConstants = __webpack_require__(31);
9496 var EventPluginHub = __webpack_require__(32);
9497
9498 var warning = __webpack_require__(26);
9499
9500 var accumulateInto = __webpack_require__(36);
9501 var forEachAccumulated = __webpack_require__(37);
9502
9503 var PropagationPhases = EventConstants.PropagationPhases;
9504 var getListener = EventPluginHub.getListener;
9505
9506 /**
9507 * Some event types have a notion of different registration names for different
9508 * "phases" of propagation. This finds listeners by a given phase.
9509 */
9510 function listenerAtPhase(id, event, propagationPhase) {
9511 var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
9512 return getListener(id, registrationName);
9513 }
9514
9515 /**
9516 * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
9517 * here, allows us to not have to bind or create functions for each event.
9518 * Mutating the event's members allows us to not have to create a wrapping
9519 * "dispatch" object that pairs the event with the listener.
9520 */
9521 function accumulateDirectionalDispatches(domID, upwards, event) {
9522 if (process.env.NODE_ENV !== 'production') {
9523 process.env.NODE_ENV !== 'production' ? warning(domID, 'Dispatching id must not be null') : undefined;
9524 }
9525 var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
9526 var listener = listenerAtPhase(domID, event, phase);
9527 if (listener) {
9528 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
9529 event._dispatchIDs = accumulateInto(event._dispatchIDs, domID);
9530 }
9531 }
9532
9533 /**
9534 * Collect dispatches (must be entirely collected before dispatching - see unit
9535 * tests). Lazily allocate the array to conserve memory. We must loop through
9536 * each event and perform the traversal for each one. We cannot perform a
9537 * single traversal for the entire collection of events because each event may
9538 * have a different target.
9539 */
9540 function accumulateTwoPhaseDispatchesSingle(event) {
9541 if (event && event.dispatchConfig.phasedRegistrationNames) {
9542 EventPluginHub.injection.getInstanceHandle().traverseTwoPhase(event.dispatchMarker, accumulateDirectionalDispatches, event);
9543 }
9544 }
9545
9546 /**
9547 * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
9548 */
9549 function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
9550 if (event && event.dispatchConfig.phasedRegistrationNames) {
9551 EventPluginHub.injection.getInstanceHandle().traverseTwoPhaseSkipTarget(event.dispatchMarker, accumulateDirectionalDispatches, event);
9552 }
9553 }
9554
9555 /**
9556 * Accumulates without regard to direction, does not look for phased
9557 * registration names. Same as `accumulateDirectDispatchesSingle` but without
9558 * requiring that the `dispatchMarker` be the same as the dispatched ID.
9559 */
9560 function accumulateDispatches(id, ignoredDirection, event) {
9561 if (event && event.dispatchConfig.registrationName) {
9562 var registrationName = event.dispatchConfig.registrationName;
9563 var listener = getListener(id, registrationName);
9564 if (listener) {
9565 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
9566 event._dispatchIDs = accumulateInto(event._dispatchIDs, id);
9567 }
9568 }
9569 }
9570
9571 /**
9572 * Accumulates dispatches on an `SyntheticEvent`, but only for the
9573 * `dispatchMarker`.
9574 * @param {SyntheticEvent} event
9575 */
9576 function accumulateDirectDispatchesSingle(event) {
9577 if (event && event.dispatchConfig.registrationName) {
9578 accumulateDispatches(event.dispatchMarker, null, event);
9579 }
9580 }
9581
9582 function accumulateTwoPhaseDispatches(events) {
9583 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
9584 }
9585
9586 function accumulateTwoPhaseDispatchesSkipTarget(events) {
9587 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
9588 }
9589
9590 function accumulateEnterLeaveDispatches(leave, enter, fromID, toID) {
9591 EventPluginHub.injection.getInstanceHandle().traverseEnterLeave(fromID, toID, accumulateDispatches, leave, enter);
9592 }
9593
9594 function accumulateDirectDispatches(events) {
9595 forEachAccumulated(events, accumulateDirectDispatchesSingle);
9596 }
9597
9598 /**
9599 * A small set of propagation patterns, each of which will accept a small amount
9600 * of information, and generate a set of "dispatch ready event objects" - which
9601 * are sets of events that have already been annotated with a set of dispatched
9602 * listener functions/ids. The API is designed this way to discourage these
9603 * propagation strategies from actually executing the dispatches, since we
9604 * always want to collect the entire set of dispatches before executing event a
9605 * single one.
9606 *
9607 * @constructor EventPropagators
9608 */
9609 var EventPropagators = {
9610 accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
9611 accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
9612 accumulateDirectDispatches: accumulateDirectDispatches,
9613 accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
9614 };
9615
9616 module.exports = EventPropagators;
9617 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
9618
9619/***/ }),
9620/* 75 */
9621/***/ (function(module, exports, __webpack_require__) {
9622
9623 /**
9624 * Copyright 2013-2015, Facebook, Inc.
9625 * All rights reserved.
9626 *
9627 * This source code is licensed under the BSD-style license found in the
9628 * LICENSE file in the root directory of this source tree. An additional grant
9629 * of patent rights can be found in the PATENTS file in the same directory.
9630 *
9631 * @providesModule FallbackCompositionState
9632 * @typechecks static-only
9633 */
9634
9635 'use strict';
9636
9637 var PooledClass = __webpack_require__(57);
9638
9639 var assign = __webpack_require__(40);
9640 var getTextContentAccessor = __webpack_require__(76);
9641
9642 /**
9643 * This helper class stores information about text content of a target node,
9644 * allowing comparison of content before and after a given event.
9645 *
9646 * Identify the node where selection currently begins, then observe
9647 * both its text content and its current position in the DOM. Since the
9648 * browser may natively replace the target node during composition, we can
9649 * use its position to find its replacement.
9650 *
9651 * @param {DOMEventTarget} root
9652 */
9653 function FallbackCompositionState(root) {
9654 this._root = root;
9655 this._startText = this.getText();
9656 this._fallbackText = null;
9657 }
9658
9659 assign(FallbackCompositionState.prototype, {
9660 destructor: function () {
9661 this._root = null;
9662 this._startText = null;
9663 this._fallbackText = null;
9664 },
9665
9666 /**
9667 * Get current text of input.
9668 *
9669 * @return {string}
9670 */
9671 getText: function () {
9672 if ('value' in this._root) {
9673 return this._root.value;
9674 }
9675 return this._root[getTextContentAccessor()];
9676 },
9677
9678 /**
9679 * Determine the differing substring between the initially stored
9680 * text content and the current content.
9681 *
9682 * @return {string}
9683 */
9684 getData: function () {
9685 if (this._fallbackText) {
9686 return this._fallbackText;
9687 }
9688
9689 var start;
9690 var startValue = this._startText;
9691 var startLength = startValue.length;
9692 var end;
9693 var endValue = this.getText();
9694 var endLength = endValue.length;
9695
9696 for (start = 0; start < startLength; start++) {
9697 if (startValue[start] !== endValue[start]) {
9698 break;
9699 }
9700 }
9701
9702 var minEnd = startLength - start;
9703 for (end = 1; end <= minEnd; end++) {
9704 if (startValue[startLength - end] !== endValue[endLength - end]) {
9705 break;
9706 }
9707 }
9708
9709 var sliceTail = end > 1 ? 1 - end : undefined;
9710 this._fallbackText = endValue.slice(start, sliceTail);
9711 return this._fallbackText;
9712 }
9713 });
9714
9715 PooledClass.addPoolingTo(FallbackCompositionState);
9716
9717 module.exports = FallbackCompositionState;
9718
9719/***/ }),
9720/* 76 */
9721/***/ (function(module, exports, __webpack_require__) {
9722
9723 /**
9724 * Copyright 2013-2015, Facebook, Inc.
9725 * All rights reserved.
9726 *
9727 * This source code is licensed under the BSD-style license found in the
9728 * LICENSE file in the root directory of this source tree. An additional grant
9729 * of patent rights can be found in the PATENTS file in the same directory.
9730 *
9731 * @providesModule getTextContentAccessor
9732 */
9733
9734 'use strict';
9735
9736 var ExecutionEnvironment = __webpack_require__(10);
9737
9738 var contentKey = null;
9739
9740 /**
9741 * Gets the key used to access text content on a DOM node.
9742 *
9743 * @return {?string} Key used to access text content.
9744 * @internal
9745 */
9746 function getTextContentAccessor() {
9747 if (!contentKey && ExecutionEnvironment.canUseDOM) {
9748 // Prefer textContent to innerText because many browsers support both but
9749 // SVG <text> elements don't support innerText even when <div> does.
9750 contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
9751 }
9752 return contentKey;
9753 }
9754
9755 module.exports = getTextContentAccessor;
9756
9757/***/ }),
9758/* 77 */
9759/***/ (function(module, exports, __webpack_require__) {
9760
9761 /**
9762 * Copyright 2013-2015, Facebook, Inc.
9763 * All rights reserved.
9764 *
9765 * This source code is licensed under the BSD-style license found in the
9766 * LICENSE file in the root directory of this source tree. An additional grant
9767 * of patent rights can be found in the PATENTS file in the same directory.
9768 *
9769 * @providesModule SyntheticCompositionEvent
9770 * @typechecks static-only
9771 */
9772
9773 'use strict';
9774
9775 var SyntheticEvent = __webpack_require__(78);
9776
9777 /**
9778 * @interface Event
9779 * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
9780 */
9781 var CompositionEventInterface = {
9782 data: null
9783 };
9784
9785 /**
9786 * @param {object} dispatchConfig Configuration used to dispatch this event.
9787 * @param {string} dispatchMarker Marker identifying the event target.
9788 * @param {object} nativeEvent Native browser event.
9789 * @extends {SyntheticUIEvent}
9790 */
9791 function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
9792 SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
9793 }
9794
9795 SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
9796
9797 module.exports = SyntheticCompositionEvent;
9798
9799/***/ }),
9800/* 78 */
9801/***/ (function(module, exports, __webpack_require__) {
9802
9803 /* WEBPACK VAR INJECTION */(function(process) {/**
9804 * Copyright 2013-2015, Facebook, Inc.
9805 * All rights reserved.
9806 *
9807 * This source code is licensed under the BSD-style license found in the
9808 * LICENSE file in the root directory of this source tree. An additional grant
9809 * of patent rights can be found in the PATENTS file in the same directory.
9810 *
9811 * @providesModule SyntheticEvent
9812 * @typechecks static-only
9813 */
9814
9815 'use strict';
9816
9817 var PooledClass = __webpack_require__(57);
9818
9819 var assign = __webpack_require__(40);
9820 var emptyFunction = __webpack_require__(16);
9821 var warning = __webpack_require__(26);
9822
9823 /**
9824 * @interface Event
9825 * @see http://www.w3.org/TR/DOM-Level-3-Events/
9826 */
9827 var EventInterface = {
9828 type: null,
9829 target: null,
9830 // currentTarget is set when dispatching; no use in copying it here
9831 currentTarget: emptyFunction.thatReturnsNull,
9832 eventPhase: null,
9833 bubbles: null,
9834 cancelable: null,
9835 timeStamp: function (event) {
9836 return event.timeStamp || Date.now();
9837 },
9838 defaultPrevented: null,
9839 isTrusted: null
9840 };
9841
9842 /**
9843 * Synthetic events are dispatched by event plugins, typically in response to a
9844 * top-level event delegation handler.
9845 *
9846 * These systems should generally use pooling to reduce the frequency of garbage
9847 * collection. The system should check `isPersistent` to determine whether the
9848 * event should be released into the pool after being dispatched. Users that
9849 * need a persisted event should invoke `persist`.
9850 *
9851 * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
9852 * normalizing browser quirks. Subclasses do not necessarily have to implement a
9853 * DOM interface; custom application-specific events can also subclass this.
9854 *
9855 * @param {object} dispatchConfig Configuration used to dispatch this event.
9856 * @param {string} dispatchMarker Marker identifying the event target.
9857 * @param {object} nativeEvent Native browser event.
9858 */
9859 function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
9860 this.dispatchConfig = dispatchConfig;
9861 this.dispatchMarker = dispatchMarker;
9862 this.nativeEvent = nativeEvent;
9863
9864 var Interface = this.constructor.Interface;
9865 for (var propName in Interface) {
9866 if (!Interface.hasOwnProperty(propName)) {
9867 continue;
9868 }
9869 var normalize = Interface[propName];
9870 if (normalize) {
9871 this[propName] = normalize(nativeEvent);
9872 } else {
9873 if (propName === 'target') {
9874 this.target = nativeEventTarget;
9875 } else {
9876 this[propName] = nativeEvent[propName];
9877 }
9878 }
9879 }
9880
9881 var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
9882 if (defaultPrevented) {
9883 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
9884 } else {
9885 this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
9886 }
9887 this.isPropagationStopped = emptyFunction.thatReturnsFalse;
9888 }
9889
9890 assign(SyntheticEvent.prototype, {
9891
9892 preventDefault: function () {
9893 this.defaultPrevented = true;
9894 var event = this.nativeEvent;
9895 if (process.env.NODE_ENV !== 'production') {
9896 process.env.NODE_ENV !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `preventDefault` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'https://fb.me/react-event-pooling for more information.') : undefined;
9897 }
9898 if (!event) {
9899 return;
9900 }
9901
9902 if (event.preventDefault) {
9903 event.preventDefault();
9904 } else {
9905 event.returnValue = false;
9906 }
9907 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
9908 },
9909
9910 stopPropagation: function () {
9911 var event = this.nativeEvent;
9912 if (process.env.NODE_ENV !== 'production') {
9913 process.env.NODE_ENV !== 'production' ? warning(event, 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re calling `stopPropagation` on a ' + 'released/nullified synthetic event. This is a no-op. See ' + 'https://fb.me/react-event-pooling for more information.') : undefined;
9914 }
9915 if (!event) {
9916 return;
9917 }
9918
9919 if (event.stopPropagation) {
9920 event.stopPropagation();
9921 } else {
9922 event.cancelBubble = true;
9923 }
9924 this.isPropagationStopped = emptyFunction.thatReturnsTrue;
9925 },
9926
9927 /**
9928 * We release all dispatched `SyntheticEvent`s after each event loop, adding
9929 * them back into the pool. This allows a way to hold onto a reference that
9930 * won't be added back into the pool.
9931 */
9932 persist: function () {
9933 this.isPersistent = emptyFunction.thatReturnsTrue;
9934 },
9935
9936 /**
9937 * Checks if this event should be released back into the pool.
9938 *
9939 * @return {boolean} True if this should not be released, false otherwise.
9940 */
9941 isPersistent: emptyFunction.thatReturnsFalse,
9942
9943 /**
9944 * `PooledClass` looks for `destructor` on each instance it releases.
9945 */
9946 destructor: function () {
9947 var Interface = this.constructor.Interface;
9948 for (var propName in Interface) {
9949 this[propName] = null;
9950 }
9951 this.dispatchConfig = null;
9952 this.dispatchMarker = null;
9953 this.nativeEvent = null;
9954 }
9955
9956 });
9957
9958 SyntheticEvent.Interface = EventInterface;
9959
9960 /**
9961 * Helper to reduce boilerplate when creating subclasses.
9962 *
9963 * @param {function} Class
9964 * @param {?object} Interface
9965 */
9966 SyntheticEvent.augmentClass = function (Class, Interface) {
9967 var Super = this;
9968
9969 var prototype = Object.create(Super.prototype);
9970 assign(prototype, Class.prototype);
9971 Class.prototype = prototype;
9972 Class.prototype.constructor = Class;
9973
9974 Class.Interface = assign({}, Super.Interface, Interface);
9975 Class.augmentClass = Super.augmentClass;
9976
9977 PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
9978 };
9979
9980 PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
9981
9982 module.exports = SyntheticEvent;
9983 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
9984
9985/***/ }),
9986/* 79 */
9987/***/ (function(module, exports, __webpack_require__) {
9988
9989 /**
9990 * Copyright 2013-2015, Facebook, Inc.
9991 * All rights reserved.
9992 *
9993 * This source code is licensed under the BSD-style license found in the
9994 * LICENSE file in the root directory of this source tree. An additional grant
9995 * of patent rights can be found in the PATENTS file in the same directory.
9996 *
9997 * @providesModule SyntheticInputEvent
9998 * @typechecks static-only
9999 */
10000
10001 'use strict';
10002
10003 var SyntheticEvent = __webpack_require__(78);
10004
10005 /**
10006 * @interface Event
10007 * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
10008 * /#events-inputevents
10009 */
10010 var InputEventInterface = {
10011 data: null
10012 };
10013
10014 /**
10015 * @param {object} dispatchConfig Configuration used to dispatch this event.
10016 * @param {string} dispatchMarker Marker identifying the event target.
10017 * @param {object} nativeEvent Native browser event.
10018 * @extends {SyntheticUIEvent}
10019 */
10020 function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
10021 SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
10022 }
10023
10024 SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
10025
10026 module.exports = SyntheticInputEvent;
10027
10028/***/ }),
10029/* 80 */
10030/***/ (function(module, exports) {
10031
10032 /**
10033 * Copyright 2013-2015, Facebook, Inc.
10034 * All rights reserved.
10035 *
10036 * This source code is licensed under the BSD-style license found in the
10037 * LICENSE file in the root directory of this source tree. An additional grant
10038 * of patent rights can be found in the PATENTS file in the same directory.
10039 *
10040 * @providesModule keyOf
10041 */
10042
10043 /**
10044 * Allows extraction of a minified key. Let's the build system minify keys
10045 * without losing the ability to dynamically use key strings as values
10046 * themselves. Pass in an object with a single key/val pair and it will return
10047 * you the string key of that single record. Suppose you want to grab the
10048 * value for a key 'className' inside of an object. Key/val minification may
10049 * have aliased that key to be 'xa12'. keyOf({className: null}) will return
10050 * 'xa12' in that case. Resolve keys you want to use once at startup time, then
10051 * reuse those resolutions.
10052 */
10053 "use strict";
10054
10055 var keyOf = function (oneKeyObj) {
10056 var key;
10057 for (key in oneKeyObj) {
10058 if (!oneKeyObj.hasOwnProperty(key)) {
10059 continue;
10060 }
10061 return key;
10062 }
10063 return null;
10064 };
10065
10066 module.exports = keyOf;
10067
10068/***/ }),
10069/* 81 */
10070/***/ (function(module, exports, __webpack_require__) {
10071
10072 /**
10073 * Copyright 2013-2015, Facebook, Inc.
10074 * All rights reserved.
10075 *
10076 * This source code is licensed under the BSD-style license found in the
10077 * LICENSE file in the root directory of this source tree. An additional grant
10078 * of patent rights can be found in the PATENTS file in the same directory.
10079 *
10080 * @providesModule ChangeEventPlugin
10081 */
10082
10083 'use strict';
10084
10085 var EventConstants = __webpack_require__(31);
10086 var EventPluginHub = __webpack_require__(32);
10087 var EventPropagators = __webpack_require__(74);
10088 var ExecutionEnvironment = __webpack_require__(10);
10089 var ReactUpdates = __webpack_require__(55);
10090 var SyntheticEvent = __webpack_require__(78);
10091
10092 var getEventTarget = __webpack_require__(82);
10093 var isEventSupported = __webpack_require__(41);
10094 var isTextInputElement = __webpack_require__(83);
10095 var keyOf = __webpack_require__(80);
10096
10097 var topLevelTypes = EventConstants.topLevelTypes;
10098
10099 var eventTypes = {
10100 change: {
10101 phasedRegistrationNames: {
10102 bubbled: keyOf({ onChange: null }),
10103 captured: keyOf({ onChangeCapture: null })
10104 },
10105 dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]
10106 }
10107 };
10108
10109 /**
10110 * For IE shims
10111 */
10112 var activeElement = null;
10113 var activeElementID = null;
10114 var activeElementValue = null;
10115 var activeElementValueProp = null;
10116
10117 /**
10118 * SECTION: handle `change` event
10119 */
10120 function shouldUseChangeEvent(elem) {
10121 var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
10122 return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
10123 }
10124
10125 var doesChangeEventBubble = false;
10126 if (ExecutionEnvironment.canUseDOM) {
10127 // See `handleChange` comment below
10128 doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8);
10129 }
10130
10131 function manualDispatchChangeEvent(nativeEvent) {
10132 var event = SyntheticEvent.getPooled(eventTypes.change, activeElementID, nativeEvent, getEventTarget(nativeEvent));
10133 EventPropagators.accumulateTwoPhaseDispatches(event);
10134
10135 // If change and propertychange bubbled, we'd just bind to it like all the
10136 // other events and have it go through ReactBrowserEventEmitter. Since it
10137 // doesn't, we manually listen for the events and so we have to enqueue and
10138 // process the abstract event manually.
10139 //
10140 // Batching is necessary here in order to ensure that all event handlers run
10141 // before the next rerender (including event handlers attached to ancestor
10142 // elements instead of directly on the input). Without this, controlled
10143 // components don't work properly in conjunction with event bubbling because
10144 // the component is rerendered and the value reverted before all the event
10145 // handlers can run. See https://github.com/facebook/react/issues/708.
10146 ReactUpdates.batchedUpdates(runEventInBatch, event);
10147 }
10148
10149 function runEventInBatch(event) {
10150 EventPluginHub.enqueueEvents(event);
10151 EventPluginHub.processEventQueue(false);
10152 }
10153
10154 function startWatchingForChangeEventIE8(target, targetID) {
10155 activeElement = target;
10156 activeElementID = targetID;
10157 activeElement.attachEvent('onchange', manualDispatchChangeEvent);
10158 }
10159
10160 function stopWatchingForChangeEventIE8() {
10161 if (!activeElement) {
10162 return;
10163 }
10164 activeElement.detachEvent('onchange', manualDispatchChangeEvent);
10165 activeElement = null;
10166 activeElementID = null;
10167 }
10168
10169 function getTargetIDForChangeEvent(topLevelType, topLevelTarget, topLevelTargetID) {
10170 if (topLevelType === topLevelTypes.topChange) {
10171 return topLevelTargetID;
10172 }
10173 }
10174 function handleEventsForChangeEventIE8(topLevelType, topLevelTarget, topLevelTargetID) {
10175 if (topLevelType === topLevelTypes.topFocus) {
10176 // stopWatching() should be a noop here but we call it just in case we
10177 // missed a blur event somehow.
10178 stopWatchingForChangeEventIE8();
10179 startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID);
10180 } else if (topLevelType === topLevelTypes.topBlur) {
10181 stopWatchingForChangeEventIE8();
10182 }
10183 }
10184
10185 /**
10186 * SECTION: handle `input` event
10187 */
10188 var isInputEventSupported = false;
10189 if (ExecutionEnvironment.canUseDOM) {
10190 // IE9 claims to support the input event but fails to trigger it when
10191 // deleting text, so we ignore its input events
10192 isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 9);
10193 }
10194
10195 /**
10196 * (For old IE.) Replacement getter/setter for the `value` property that gets
10197 * set on the active element.
10198 */
10199 var newValueProp = {
10200 get: function () {
10201 return activeElementValueProp.get.call(this);
10202 },
10203 set: function (val) {
10204 // Cast to a string so we can do equality checks.
10205 activeElementValue = '' + val;
10206 activeElementValueProp.set.call(this, val);
10207 }
10208 };
10209
10210 /**
10211 * (For old IE.) Starts tracking propertychange events on the passed-in element
10212 * and override the value property so that we can distinguish user events from
10213 * value changes in JS.
10214 */
10215 function startWatchingForValueChange(target, targetID) {
10216 activeElement = target;
10217 activeElementID = targetID;
10218 activeElementValue = target.value;
10219 activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
10220
10221 // Not guarded in a canDefineProperty check: IE8 supports defineProperty only
10222 // on DOM elements
10223 Object.defineProperty(activeElement, 'value', newValueProp);
10224 activeElement.attachEvent('onpropertychange', handlePropertyChange);
10225 }
10226
10227 /**
10228 * (For old IE.) Removes the event listeners from the currently-tracked element,
10229 * if any exists.
10230 */
10231 function stopWatchingForValueChange() {
10232 if (!activeElement) {
10233 return;
10234 }
10235
10236 // delete restores the original property definition
10237 delete activeElement.value;
10238 activeElement.detachEvent('onpropertychange', handlePropertyChange);
10239
10240 activeElement = null;
10241 activeElementID = null;
10242 activeElementValue = null;
10243 activeElementValueProp = null;
10244 }
10245
10246 /**
10247 * (For old IE.) Handles a propertychange event, sending a `change` event if
10248 * the value of the active element has changed.
10249 */
10250 function handlePropertyChange(nativeEvent) {
10251 if (nativeEvent.propertyName !== 'value') {
10252 return;
10253 }
10254 var value = nativeEvent.srcElement.value;
10255 if (value === activeElementValue) {
10256 return;
10257 }
10258 activeElementValue = value;
10259
10260 manualDispatchChangeEvent(nativeEvent);
10261 }
10262
10263 /**
10264 * If a `change` event should be fired, returns the target's ID.
10265 */
10266 function getTargetIDForInputEvent(topLevelType, topLevelTarget, topLevelTargetID) {
10267 if (topLevelType === topLevelTypes.topInput) {
10268 // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
10269 // what we want so fall through here and trigger an abstract event
10270 return topLevelTargetID;
10271 }
10272 }
10273
10274 // For IE8 and IE9.
10275 function handleEventsForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) {
10276 if (topLevelType === topLevelTypes.topFocus) {
10277 // In IE8, we can capture almost all .value changes by adding a
10278 // propertychange handler and looking for events with propertyName
10279 // equal to 'value'
10280 // In IE9, propertychange fires for most input events but is buggy and
10281 // doesn't fire when text is deleted, but conveniently, selectionchange
10282 // appears to fire in all of the remaining cases so we catch those and
10283 // forward the event if the value has changed
10284 // In either case, we don't want to call the event handler if the value
10285 // is changed from JS so we redefine a setter for `.value` that updates
10286 // our activeElementValue variable, allowing us to ignore those changes
10287 //
10288 // stopWatching() should be a noop here but we call it just in case we
10289 // missed a blur event somehow.
10290 stopWatchingForValueChange();
10291 startWatchingForValueChange(topLevelTarget, topLevelTargetID);
10292 } else if (topLevelType === topLevelTypes.topBlur) {
10293 stopWatchingForValueChange();
10294 }
10295 }
10296
10297 // For IE8 and IE9.
10298 function getTargetIDForInputEventIE(topLevelType, topLevelTarget, topLevelTargetID) {
10299 if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
10300 // On the selectionchange event, the target is just document which isn't
10301 // helpful for us so just check activeElement instead.
10302 //
10303 // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
10304 // propertychange on the first input event after setting `value` from a
10305 // script and fires only keydown, keypress, keyup. Catching keyup usually
10306 // gets it and catching keydown lets us fire an event for the first
10307 // keystroke if user does a key repeat (it'll be a little delayed: right
10308 // before the second keystroke). Other input methods (e.g., paste) seem to
10309 // fire selectionchange normally.
10310 if (activeElement && activeElement.value !== activeElementValue) {
10311 activeElementValue = activeElement.value;
10312 return activeElementID;
10313 }
10314 }
10315 }
10316
10317 /**
10318 * SECTION: handle `click` event
10319 */
10320 function shouldUseClickEvent(elem) {
10321 // Use the `click` event to detect changes to checkbox and radio inputs.
10322 // This approach works across all browsers, whereas `change` does not fire
10323 // until `blur` in IE8.
10324 return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
10325 }
10326
10327 function getTargetIDForClickEvent(topLevelType, topLevelTarget, topLevelTargetID) {
10328 if (topLevelType === topLevelTypes.topClick) {
10329 return topLevelTargetID;
10330 }
10331 }
10332
10333 /**
10334 * This plugin creates an `onChange` event that normalizes change events
10335 * across form elements. This event fires at a time when it's possible to
10336 * change the element's value without seeing a flicker.
10337 *
10338 * Supported elements are:
10339 * - input (see `isTextInputElement`)
10340 * - textarea
10341 * - select
10342 */
10343 var ChangeEventPlugin = {
10344
10345 eventTypes: eventTypes,
10346
10347 /**
10348 * @param {string} topLevelType Record from `EventConstants`.
10349 * @param {DOMEventTarget} topLevelTarget The listening component root node.
10350 * @param {string} topLevelTargetID ID of `topLevelTarget`.
10351 * @param {object} nativeEvent Native browser event.
10352 * @return {*} An accumulation of synthetic events.
10353 * @see {EventPluginHub.extractEvents}
10354 */
10355 extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
10356
10357 var getTargetIDFunc, handleEventFunc;
10358 if (shouldUseChangeEvent(topLevelTarget)) {
10359 if (doesChangeEventBubble) {
10360 getTargetIDFunc = getTargetIDForChangeEvent;
10361 } else {
10362 handleEventFunc = handleEventsForChangeEventIE8;
10363 }
10364 } else if (isTextInputElement(topLevelTarget)) {
10365 if (isInputEventSupported) {
10366 getTargetIDFunc = getTargetIDForInputEvent;
10367 } else {
10368 getTargetIDFunc = getTargetIDForInputEventIE;
10369 handleEventFunc = handleEventsForInputEventIE;
10370 }
10371 } else if (shouldUseClickEvent(topLevelTarget)) {
10372 getTargetIDFunc = getTargetIDForClickEvent;
10373 }
10374
10375 if (getTargetIDFunc) {
10376 var targetID = getTargetIDFunc(topLevelType, topLevelTarget, topLevelTargetID);
10377 if (targetID) {
10378 var event = SyntheticEvent.getPooled(eventTypes.change, targetID, nativeEvent, nativeEventTarget);
10379 event.type = 'change';
10380 EventPropagators.accumulateTwoPhaseDispatches(event);
10381 return event;
10382 }
10383 }
10384
10385 if (handleEventFunc) {
10386 handleEventFunc(topLevelType, topLevelTarget, topLevelTargetID);
10387 }
10388 }
10389
10390 };
10391
10392 module.exports = ChangeEventPlugin;
10393
10394/***/ }),
10395/* 82 */
10396/***/ (function(module, exports) {
10397
10398 /**
10399 * Copyright 2013-2015, Facebook, Inc.
10400 * All rights reserved.
10401 *
10402 * This source code is licensed under the BSD-style license found in the
10403 * LICENSE file in the root directory of this source tree. An additional grant
10404 * of patent rights can be found in the PATENTS file in the same directory.
10405 *
10406 * @providesModule getEventTarget
10407 * @typechecks static-only
10408 */
10409
10410 'use strict';
10411
10412 /**
10413 * Gets the target node from a native browser event by accounting for
10414 * inconsistencies in browser DOM APIs.
10415 *
10416 * @param {object} nativeEvent Native browser event.
10417 * @return {DOMEventTarget} Target node.
10418 */
10419 function getEventTarget(nativeEvent) {
10420 var target = nativeEvent.target || nativeEvent.srcElement || window;
10421 // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
10422 // @see http://www.quirksmode.org/js/events_properties.html
10423 return target.nodeType === 3 ? target.parentNode : target;
10424 }
10425
10426 module.exports = getEventTarget;
10427
10428/***/ }),
10429/* 83 */
10430/***/ (function(module, exports) {
10431
10432 /**
10433 * Copyright 2013-2015, Facebook, Inc.
10434 * All rights reserved.
10435 *
10436 * This source code is licensed under the BSD-style license found in the
10437 * LICENSE file in the root directory of this source tree. An additional grant
10438 * of patent rights can be found in the PATENTS file in the same directory.
10439 *
10440 * @providesModule isTextInputElement
10441 */
10442
10443 'use strict';
10444
10445 /**
10446 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
10447 */
10448 var supportedInputTypes = {
10449 'color': true,
10450 'date': true,
10451 'datetime': true,
10452 'datetime-local': true,
10453 'email': true,
10454 'month': true,
10455 'number': true,
10456 'password': true,
10457 'range': true,
10458 'search': true,
10459 'tel': true,
10460 'text': true,
10461 'time': true,
10462 'url': true,
10463 'week': true
10464 };
10465
10466 function isTextInputElement(elem) {
10467 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
10468 return nodeName && (nodeName === 'input' && supportedInputTypes[elem.type] || nodeName === 'textarea');
10469 }
10470
10471 module.exports = isTextInputElement;
10472
10473/***/ }),
10474/* 84 */
10475/***/ (function(module, exports) {
10476
10477 /**
10478 * Copyright 2013-2015, Facebook, Inc.
10479 * All rights reserved.
10480 *
10481 * This source code is licensed under the BSD-style license found in the
10482 * LICENSE file in the root directory of this source tree. An additional grant
10483 * of patent rights can be found in the PATENTS file in the same directory.
10484 *
10485 * @providesModule ClientReactRootIndex
10486 * @typechecks
10487 */
10488
10489 'use strict';
10490
10491 var nextReactRootIndex = 0;
10492
10493 var ClientReactRootIndex = {
10494 createReactRootIndex: function () {
10495 return nextReactRootIndex++;
10496 }
10497 };
10498
10499 module.exports = ClientReactRootIndex;
10500
10501/***/ }),
10502/* 85 */
10503/***/ (function(module, exports, __webpack_require__) {
10504
10505 /**
10506 * Copyright 2013-2015, Facebook, Inc.
10507 * All rights reserved.
10508 *
10509 * This source code is licensed under the BSD-style license found in the
10510 * LICENSE file in the root directory of this source tree. An additional grant
10511 * of patent rights can be found in the PATENTS file in the same directory.
10512 *
10513 * @providesModule DefaultEventPluginOrder
10514 */
10515
10516 'use strict';
10517
10518 var keyOf = __webpack_require__(80);
10519
10520 /**
10521 * Module that is injectable into `EventPluginHub`, that specifies a
10522 * deterministic ordering of `EventPlugin`s. A convenient way to reason about
10523 * plugins, without having to package every one of them. This is better than
10524 * having plugins be ordered in the same order that they are injected because
10525 * that ordering would be influenced by the packaging order.
10526 * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
10527 * preventing default on events is convenient in `SimpleEventPlugin` handlers.
10528 */
10529 var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
10530
10531 module.exports = DefaultEventPluginOrder;
10532
10533/***/ }),
10534/* 86 */
10535/***/ (function(module, exports, __webpack_require__) {
10536
10537 /**
10538 * Copyright 2013-2015, Facebook, Inc.
10539 * All rights reserved.
10540 *
10541 * This source code is licensed under the BSD-style license found in the
10542 * LICENSE file in the root directory of this source tree. An additional grant
10543 * of patent rights can be found in the PATENTS file in the same directory.
10544 *
10545 * @providesModule EnterLeaveEventPlugin
10546 * @typechecks static-only
10547 */
10548
10549 'use strict';
10550
10551 var EventConstants = __webpack_require__(31);
10552 var EventPropagators = __webpack_require__(74);
10553 var SyntheticMouseEvent = __webpack_require__(87);
10554
10555 var ReactMount = __webpack_require__(29);
10556 var keyOf = __webpack_require__(80);
10557
10558 var topLevelTypes = EventConstants.topLevelTypes;
10559 var getFirstReactDOM = ReactMount.getFirstReactDOM;
10560
10561 var eventTypes = {
10562 mouseEnter: {
10563 registrationName: keyOf({ onMouseEnter: null }),
10564 dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
10565 },
10566 mouseLeave: {
10567 registrationName: keyOf({ onMouseLeave: null }),
10568 dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
10569 }
10570 };
10571
10572 var extractedEvents = [null, null];
10573
10574 var EnterLeaveEventPlugin = {
10575
10576 eventTypes: eventTypes,
10577
10578 /**
10579 * For almost every interaction we care about, there will be both a top-level
10580 * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
10581 * we do not extract duplicate events. However, moving the mouse into the
10582 * browser from outside will not fire a `mouseout` event. In this case, we use
10583 * the `mouseover` top-level event.
10584 *
10585 * @param {string} topLevelType Record from `EventConstants`.
10586 * @param {DOMEventTarget} topLevelTarget The listening component root node.
10587 * @param {string} topLevelTargetID ID of `topLevelTarget`.
10588 * @param {object} nativeEvent Native browser event.
10589 * @return {*} An accumulation of synthetic events.
10590 * @see {EventPluginHub.extractEvents}
10591 */
10592 extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
10593 if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
10594 return null;
10595 }
10596 if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {
10597 // Must not be a mouse in or mouse out - ignoring.
10598 return null;
10599 }
10600
10601 var win;
10602 if (topLevelTarget.window === topLevelTarget) {
10603 // `topLevelTarget` is probably a window object.
10604 win = topLevelTarget;
10605 } else {
10606 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
10607 var doc = topLevelTarget.ownerDocument;
10608 if (doc) {
10609 win = doc.defaultView || doc.parentWindow;
10610 } else {
10611 win = window;
10612 }
10613 }
10614
10615 var from;
10616 var to;
10617 var fromID = '';
10618 var toID = '';
10619 if (topLevelType === topLevelTypes.topMouseOut) {
10620 from = topLevelTarget;
10621 fromID = topLevelTargetID;
10622 to = getFirstReactDOM(nativeEvent.relatedTarget || nativeEvent.toElement);
10623 if (to) {
10624 toID = ReactMount.getID(to);
10625 } else {
10626 to = win;
10627 }
10628 to = to || win;
10629 } else {
10630 from = win;
10631 to = topLevelTarget;
10632 toID = topLevelTargetID;
10633 }
10634
10635 if (from === to) {
10636 // Nothing pertains to our managed components.
10637 return null;
10638 }
10639
10640 var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, fromID, nativeEvent, nativeEventTarget);
10641 leave.type = 'mouseleave';
10642 leave.target = from;
10643 leave.relatedTarget = to;
10644
10645 var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, toID, nativeEvent, nativeEventTarget);
10646 enter.type = 'mouseenter';
10647 enter.target = to;
10648 enter.relatedTarget = from;
10649
10650 EventPropagators.accumulateEnterLeaveDispatches(leave, enter, fromID, toID);
10651
10652 extractedEvents[0] = leave;
10653 extractedEvents[1] = enter;
10654
10655 return extractedEvents;
10656 }
10657
10658 };
10659
10660 module.exports = EnterLeaveEventPlugin;
10661
10662/***/ }),
10663/* 87 */
10664/***/ (function(module, exports, __webpack_require__) {
10665
10666 /**
10667 * Copyright 2013-2015, Facebook, Inc.
10668 * All rights reserved.
10669 *
10670 * This source code is licensed under the BSD-style license found in the
10671 * LICENSE file in the root directory of this source tree. An additional grant
10672 * of patent rights can be found in the PATENTS file in the same directory.
10673 *
10674 * @providesModule SyntheticMouseEvent
10675 * @typechecks static-only
10676 */
10677
10678 'use strict';
10679
10680 var SyntheticUIEvent = __webpack_require__(88);
10681 var ViewportMetrics = __webpack_require__(39);
10682
10683 var getEventModifierState = __webpack_require__(89);
10684
10685 /**
10686 * @interface MouseEvent
10687 * @see http://www.w3.org/TR/DOM-Level-3-Events/
10688 */
10689 var MouseEventInterface = {
10690 screenX: null,
10691 screenY: null,
10692 clientX: null,
10693 clientY: null,
10694 ctrlKey: null,
10695 shiftKey: null,
10696 altKey: null,
10697 metaKey: null,
10698 getModifierState: getEventModifierState,
10699 button: function (event) {
10700 // Webkit, Firefox, IE9+
10701 // which: 1 2 3
10702 // button: 0 1 2 (standard)
10703 var button = event.button;
10704 if ('which' in event) {
10705 return button;
10706 }
10707 // IE<9
10708 // which: undefined
10709 // button: 0 0 0
10710 // button: 1 4 2 (onmouseup)
10711 return button === 2 ? 2 : button === 4 ? 1 : 0;
10712 },
10713 buttons: null,
10714 relatedTarget: function (event) {
10715 return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
10716 },
10717 // "Proprietary" Interface.
10718 pageX: function (event) {
10719 return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
10720 },
10721 pageY: function (event) {
10722 return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
10723 }
10724 };
10725
10726 /**
10727 * @param {object} dispatchConfig Configuration used to dispatch this event.
10728 * @param {string} dispatchMarker Marker identifying the event target.
10729 * @param {object} nativeEvent Native browser event.
10730 * @extends {SyntheticUIEvent}
10731 */
10732 function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
10733 SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
10734 }
10735
10736 SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
10737
10738 module.exports = SyntheticMouseEvent;
10739
10740/***/ }),
10741/* 88 */
10742/***/ (function(module, exports, __webpack_require__) {
10743
10744 /**
10745 * Copyright 2013-2015, Facebook, Inc.
10746 * All rights reserved.
10747 *
10748 * This source code is licensed under the BSD-style license found in the
10749 * LICENSE file in the root directory of this source tree. An additional grant
10750 * of patent rights can be found in the PATENTS file in the same directory.
10751 *
10752 * @providesModule SyntheticUIEvent
10753 * @typechecks static-only
10754 */
10755
10756 'use strict';
10757
10758 var SyntheticEvent = __webpack_require__(78);
10759
10760 var getEventTarget = __webpack_require__(82);
10761
10762 /**
10763 * @interface UIEvent
10764 * @see http://www.w3.org/TR/DOM-Level-3-Events/
10765 */
10766 var UIEventInterface = {
10767 view: function (event) {
10768 if (event.view) {
10769 return event.view;
10770 }
10771
10772 var target = getEventTarget(event);
10773 if (target != null && target.window === target) {
10774 // target is a window object
10775 return target;
10776 }
10777
10778 var doc = target.ownerDocument;
10779 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
10780 if (doc) {
10781 return doc.defaultView || doc.parentWindow;
10782 } else {
10783 return window;
10784 }
10785 },
10786 detail: function (event) {
10787 return event.detail || 0;
10788 }
10789 };
10790
10791 /**
10792 * @param {object} dispatchConfig Configuration used to dispatch this event.
10793 * @param {string} dispatchMarker Marker identifying the event target.
10794 * @param {object} nativeEvent Native browser event.
10795 * @extends {SyntheticEvent}
10796 */
10797 function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
10798 SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
10799 }
10800
10801 SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
10802
10803 module.exports = SyntheticUIEvent;
10804
10805/***/ }),
10806/* 89 */
10807/***/ (function(module, exports) {
10808
10809 /**
10810 * Copyright 2013-2015, Facebook, Inc.
10811 * All rights reserved.
10812 *
10813 * This source code is licensed under the BSD-style license found in the
10814 * LICENSE file in the root directory of this source tree. An additional grant
10815 * of patent rights can be found in the PATENTS file in the same directory.
10816 *
10817 * @providesModule getEventModifierState
10818 * @typechecks static-only
10819 */
10820
10821 'use strict';
10822
10823 /**
10824 * Translation from modifier key to the associated property in the event.
10825 * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
10826 */
10827
10828 var modifierKeyToProp = {
10829 'Alt': 'altKey',
10830 'Control': 'ctrlKey',
10831 'Meta': 'metaKey',
10832 'Shift': 'shiftKey'
10833 };
10834
10835 // IE8 does not implement getModifierState so we simply map it to the only
10836 // modifier keys exposed by the event itself, does not support Lock-keys.
10837 // Currently, all major browsers except Chrome seems to support Lock-keys.
10838 function modifierStateGetter(keyArg) {
10839 var syntheticEvent = this;
10840 var nativeEvent = syntheticEvent.nativeEvent;
10841 if (nativeEvent.getModifierState) {
10842 return nativeEvent.getModifierState(keyArg);
10843 }
10844 var keyProp = modifierKeyToProp[keyArg];
10845 return keyProp ? !!nativeEvent[keyProp] : false;
10846 }
10847
10848 function getEventModifierState(nativeEvent) {
10849 return modifierStateGetter;
10850 }
10851
10852 module.exports = getEventModifierState;
10853
10854/***/ }),
10855/* 90 */
10856/***/ (function(module, exports, __webpack_require__) {
10857
10858 /**
10859 * Copyright 2013-2015, Facebook, Inc.
10860 * All rights reserved.
10861 *
10862 * This source code is licensed under the BSD-style license found in the
10863 * LICENSE file in the root directory of this source tree. An additional grant
10864 * of patent rights can be found in the PATENTS file in the same directory.
10865 *
10866 * @providesModule HTMLDOMPropertyConfig
10867 */
10868
10869 'use strict';
10870
10871 var DOMProperty = __webpack_require__(24);
10872 var ExecutionEnvironment = __webpack_require__(10);
10873
10874 var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
10875 var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
10876 var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
10877 var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
10878 var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
10879 var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
10880 var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
10881
10882 var hasSVG;
10883 if (ExecutionEnvironment.canUseDOM) {
10884 var implementation = document.implementation;
10885 hasSVG = implementation && implementation.hasFeature && implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1');
10886 }
10887
10888 var HTMLDOMPropertyConfig = {
10889 isCustomAttribute: RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),
10890 Properties: {
10891 /**
10892 * Standard Properties
10893 */
10894 accept: null,
10895 acceptCharset: null,
10896 accessKey: null,
10897 action: null,
10898 allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
10899 allowTransparency: MUST_USE_ATTRIBUTE,
10900 alt: null,
10901 async: HAS_BOOLEAN_VALUE,
10902 autoComplete: null,
10903 // autoFocus is polyfilled/normalized by AutoFocusUtils
10904 // autoFocus: HAS_BOOLEAN_VALUE,
10905 autoPlay: HAS_BOOLEAN_VALUE,
10906 capture: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
10907 cellPadding: null,
10908 cellSpacing: null,
10909 charSet: MUST_USE_ATTRIBUTE,
10910 challenge: MUST_USE_ATTRIBUTE,
10911 checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10912 classID: MUST_USE_ATTRIBUTE,
10913 // To set className on SVG elements, it's necessary to use .setAttribute;
10914 // this works on HTML elements too in all browsers except IE8. Conveniently,
10915 // IE8 doesn't support SVG and so we can simply use the attribute in
10916 // browsers that support SVG and the property in browsers that don't,
10917 // regardless of whether the element is HTML or SVG.
10918 className: hasSVG ? MUST_USE_ATTRIBUTE : MUST_USE_PROPERTY,
10919 cols: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
10920 colSpan: null,
10921 content: null,
10922 contentEditable: null,
10923 contextMenu: MUST_USE_ATTRIBUTE,
10924 controls: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10925 coords: null,
10926 crossOrigin: null,
10927 data: null, // For `<object />` acts as `src`.
10928 dateTime: MUST_USE_ATTRIBUTE,
10929 'default': HAS_BOOLEAN_VALUE,
10930 defer: HAS_BOOLEAN_VALUE,
10931 dir: null,
10932 disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
10933 download: HAS_OVERLOADED_BOOLEAN_VALUE,
10934 draggable: null,
10935 encType: null,
10936 form: MUST_USE_ATTRIBUTE,
10937 formAction: MUST_USE_ATTRIBUTE,
10938 formEncType: MUST_USE_ATTRIBUTE,
10939 formMethod: MUST_USE_ATTRIBUTE,
10940 formNoValidate: HAS_BOOLEAN_VALUE,
10941 formTarget: MUST_USE_ATTRIBUTE,
10942 frameBorder: MUST_USE_ATTRIBUTE,
10943 headers: null,
10944 height: MUST_USE_ATTRIBUTE,
10945 hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
10946 high: null,
10947 href: null,
10948 hrefLang: null,
10949 htmlFor: null,
10950 httpEquiv: null,
10951 icon: null,
10952 id: MUST_USE_PROPERTY,
10953 inputMode: MUST_USE_ATTRIBUTE,
10954 integrity: null,
10955 is: MUST_USE_ATTRIBUTE,
10956 keyParams: MUST_USE_ATTRIBUTE,
10957 keyType: MUST_USE_ATTRIBUTE,
10958 kind: null,
10959 label: null,
10960 lang: null,
10961 list: MUST_USE_ATTRIBUTE,
10962 loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10963 low: null,
10964 manifest: MUST_USE_ATTRIBUTE,
10965 marginHeight: null,
10966 marginWidth: null,
10967 max: null,
10968 maxLength: MUST_USE_ATTRIBUTE,
10969 media: MUST_USE_ATTRIBUTE,
10970 mediaGroup: null,
10971 method: null,
10972 min: null,
10973 minLength: MUST_USE_ATTRIBUTE,
10974 multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10975 muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10976 name: null,
10977 nonce: MUST_USE_ATTRIBUTE,
10978 noValidate: HAS_BOOLEAN_VALUE,
10979 open: HAS_BOOLEAN_VALUE,
10980 optimum: null,
10981 pattern: null,
10982 placeholder: null,
10983 poster: null,
10984 preload: null,
10985 radioGroup: null,
10986 readOnly: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10987 rel: null,
10988 required: HAS_BOOLEAN_VALUE,
10989 reversed: HAS_BOOLEAN_VALUE,
10990 role: MUST_USE_ATTRIBUTE,
10991 rows: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
10992 rowSpan: null,
10993 sandbox: null,
10994 scope: null,
10995 scoped: HAS_BOOLEAN_VALUE,
10996 scrolling: null,
10997 seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
10998 selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
10999 shape: null,
11000 size: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE,
11001 sizes: MUST_USE_ATTRIBUTE,
11002 span: HAS_POSITIVE_NUMERIC_VALUE,
11003 spellCheck: null,
11004 src: null,
11005 srcDoc: MUST_USE_PROPERTY,
11006 srcLang: null,
11007 srcSet: MUST_USE_ATTRIBUTE,
11008 start: HAS_NUMERIC_VALUE,
11009 step: null,
11010 style: null,
11011 summary: null,
11012 tabIndex: null,
11013 target: null,
11014 title: null,
11015 type: null,
11016 useMap: null,
11017 value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
11018 width: MUST_USE_ATTRIBUTE,
11019 wmode: MUST_USE_ATTRIBUTE,
11020 wrap: null,
11021
11022 /**
11023 * RDFa Properties
11024 */
11025 about: MUST_USE_ATTRIBUTE,
11026 datatype: MUST_USE_ATTRIBUTE,
11027 inlist: MUST_USE_ATTRIBUTE,
11028 prefix: MUST_USE_ATTRIBUTE,
11029 // property is also supported for OpenGraph in meta tags.
11030 property: MUST_USE_ATTRIBUTE,
11031 resource: MUST_USE_ATTRIBUTE,
11032 'typeof': MUST_USE_ATTRIBUTE,
11033 vocab: MUST_USE_ATTRIBUTE,
11034
11035 /**
11036 * Non-standard Properties
11037 */
11038 // autoCapitalize and autoCorrect are supported in Mobile Safari for
11039 // keyboard hints.
11040 autoCapitalize: MUST_USE_ATTRIBUTE,
11041 autoCorrect: MUST_USE_ATTRIBUTE,
11042 // autoSave allows WebKit/Blink to persist values of input fields on page reloads
11043 autoSave: null,
11044 // color is for Safari mask-icon link
11045 color: null,
11046 // itemProp, itemScope, itemType are for
11047 // Microdata support. See http://schema.org/docs/gs.html
11048 itemProp: MUST_USE_ATTRIBUTE,
11049 itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
11050 itemType: MUST_USE_ATTRIBUTE,
11051 // itemID and itemRef are for Microdata support as well but
11052 // only specified in the the WHATWG spec document. See
11053 // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
11054 itemID: MUST_USE_ATTRIBUTE,
11055 itemRef: MUST_USE_ATTRIBUTE,
11056 // results show looking glass icon and recent searches on input
11057 // search fields in WebKit/Blink
11058 results: null,
11059 // IE-only attribute that specifies security restrictions on an iframe
11060 // as an alternative to the sandbox attribute on IE<10
11061 security: MUST_USE_ATTRIBUTE,
11062 // IE-only attribute that controls focus behavior
11063 unselectable: MUST_USE_ATTRIBUTE
11064 },
11065 DOMAttributeNames: {
11066 acceptCharset: 'accept-charset',
11067 className: 'class',
11068 htmlFor: 'for',
11069 httpEquiv: 'http-equiv'
11070 },
11071 DOMPropertyNames: {
11072 autoComplete: 'autocomplete',
11073 autoFocus: 'autofocus',
11074 autoPlay: 'autoplay',
11075 autoSave: 'autosave',
11076 // `encoding` is equivalent to `enctype`, IE8 lacks an `enctype` setter.
11077 // http://www.w3.org/TR/html5/forms.html#dom-fs-encoding
11078 encType: 'encoding',
11079 hrefLang: 'hreflang',
11080 radioGroup: 'radiogroup',
11081 spellCheck: 'spellcheck',
11082 srcDoc: 'srcdoc',
11083 srcSet: 'srcset'
11084 }
11085 };
11086
11087 module.exports = HTMLDOMPropertyConfig;
11088
11089/***/ }),
11090/* 91 */
11091/***/ (function(module, exports, __webpack_require__) {
11092
11093 /* WEBPACK VAR INJECTION */(function(process) {/**
11094 * Copyright 2013-2015, Facebook, Inc.
11095 * All rights reserved.
11096 *
11097 * This source code is licensed under the BSD-style license found in the
11098 * LICENSE file in the root directory of this source tree. An additional grant
11099 * of patent rights can be found in the PATENTS file in the same directory.
11100 *
11101 * @providesModule ReactBrowserComponentMixin
11102 */
11103
11104 'use strict';
11105
11106 var ReactInstanceMap = __webpack_require__(48);
11107
11108 var findDOMNode = __webpack_require__(92);
11109 var warning = __webpack_require__(26);
11110
11111 var didWarnKey = '_getDOMNodeDidWarn';
11112
11113 var ReactBrowserComponentMixin = {
11114 /**
11115 * Returns the DOM node rendered by this component.
11116 *
11117 * @return {DOMElement} The root node of this component.
11118 * @final
11119 * @protected
11120 */
11121 getDOMNode: function () {
11122 process.env.NODE_ENV !== 'production' ? warning(this.constructor[didWarnKey], '%s.getDOMNode(...) is deprecated. Please use ' + 'ReactDOM.findDOMNode(instance) instead.', ReactInstanceMap.get(this).getName() || this.tagName || 'Unknown') : undefined;
11123 this.constructor[didWarnKey] = true;
11124 return findDOMNode(this);
11125 }
11126 };
11127
11128 module.exports = ReactBrowserComponentMixin;
11129 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
11130
11131/***/ }),
11132/* 92 */
11133/***/ (function(module, exports, __webpack_require__) {
11134
11135 /* WEBPACK VAR INJECTION */(function(process) {/**
11136 * Copyright 2013-2015, Facebook, Inc.
11137 * All rights reserved.
11138 *
11139 * This source code is licensed under the BSD-style license found in the
11140 * LICENSE file in the root directory of this source tree. An additional grant
11141 * of patent rights can be found in the PATENTS file in the same directory.
11142 *
11143 * @providesModule findDOMNode
11144 * @typechecks static-only
11145 */
11146
11147 'use strict';
11148
11149 var ReactCurrentOwner = __webpack_require__(6);
11150 var ReactInstanceMap = __webpack_require__(48);
11151 var ReactMount = __webpack_require__(29);
11152
11153 var invariant = __webpack_require__(14);
11154 var warning = __webpack_require__(26);
11155
11156 /**
11157 * Returns the DOM node rendered by this element.
11158 *
11159 * @param {ReactComponent|DOMElement} componentOrElement
11160 * @return {?DOMElement} The root node of this element.
11161 */
11162 function findDOMNode(componentOrElement) {
11163 if (process.env.NODE_ENV !== 'production') {
11164 var owner = ReactCurrentOwner.current;
11165 if (owner !== null) {
11166 process.env.NODE_ENV !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing getDOMNode or findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : undefined;
11167 owner._warnedAboutRefsInRender = true;
11168 }
11169 }
11170 if (componentOrElement == null) {
11171 return null;
11172 }
11173 if (componentOrElement.nodeType === 1) {
11174 return componentOrElement;
11175 }
11176 if (ReactInstanceMap.has(componentOrElement)) {
11177 return ReactMount.getNodeFromInstance(componentOrElement);
11178 }
11179 !(componentOrElement.render == null || typeof componentOrElement.render !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : undefined;
11180 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : undefined;
11181 }
11182
11183 module.exports = findDOMNode;
11184 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
11185
11186/***/ }),
11187/* 93 */
11188/***/ (function(module, exports, __webpack_require__) {
11189
11190 /**
11191 * Copyright 2013-2015, Facebook, Inc.
11192 * All rights reserved.
11193 *
11194 * This source code is licensed under the BSD-style license found in the
11195 * LICENSE file in the root directory of this source tree. An additional grant
11196 * of patent rights can be found in the PATENTS file in the same directory.
11197 *
11198 * @providesModule ReactDefaultBatchingStrategy
11199 */
11200
11201 'use strict';
11202
11203 var ReactUpdates = __webpack_require__(55);
11204 var Transaction = __webpack_require__(58);
11205
11206 var assign = __webpack_require__(40);
11207 var emptyFunction = __webpack_require__(16);
11208
11209 var RESET_BATCHED_UPDATES = {
11210 initialize: emptyFunction,
11211 close: function () {
11212 ReactDefaultBatchingStrategy.isBatchingUpdates = false;
11213 }
11214 };
11215
11216 var FLUSH_BATCHED_UPDATES = {
11217 initialize: emptyFunction,
11218 close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
11219 };
11220
11221 var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
11222
11223 function ReactDefaultBatchingStrategyTransaction() {
11224 this.reinitializeTransaction();
11225 }
11226
11227 assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
11228 getTransactionWrappers: function () {
11229 return TRANSACTION_WRAPPERS;
11230 }
11231 });
11232
11233 var transaction = new ReactDefaultBatchingStrategyTransaction();
11234
11235 var ReactDefaultBatchingStrategy = {
11236 isBatchingUpdates: false,
11237
11238 /**
11239 * Call the provided function in a context within which calls to `setState`
11240 * and friends are batched such that components aren't updated unnecessarily.
11241 */
11242 batchedUpdates: function (callback, a, b, c, d, e) {
11243 var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
11244
11245 ReactDefaultBatchingStrategy.isBatchingUpdates = true;
11246
11247 // The code is written this way to avoid extra allocations
11248 if (alreadyBatchingUpdates) {
11249 callback(a, b, c, d, e);
11250 } else {
11251 transaction.perform(callback, null, a, b, c, d, e);
11252 }
11253 }
11254 };
11255
11256 module.exports = ReactDefaultBatchingStrategy;
11257
11258/***/ }),
11259/* 94 */
11260/***/ (function(module, exports, __webpack_require__) {
11261
11262 /* WEBPACK VAR INJECTION */(function(process) {/**
11263 * Copyright 2013-2015, Facebook, Inc.
11264 * All rights reserved.
11265 *
11266 * This source code is licensed under the BSD-style license found in the
11267 * LICENSE file in the root directory of this source tree. An additional grant
11268 * of patent rights can be found in the PATENTS file in the same directory.
11269 *
11270 * @providesModule ReactDOMComponent
11271 * @typechecks static-only
11272 */
11273
11274 /* global hasOwnProperty:true */
11275
11276 'use strict';
11277
11278 var AutoFocusUtils = __webpack_require__(95);
11279 var CSSPropertyOperations = __webpack_require__(97);
11280 var DOMProperty = __webpack_require__(24);
11281 var DOMPropertyOperations = __webpack_require__(23);
11282 var EventConstants = __webpack_require__(31);
11283 var ReactBrowserEventEmitter = __webpack_require__(30);
11284 var ReactComponentBrowserEnvironment = __webpack_require__(27);
11285 var ReactDOMButton = __webpack_require__(105);
11286 var ReactDOMInput = __webpack_require__(106);
11287 var ReactDOMOption = __webpack_require__(110);
11288 var ReactDOMSelect = __webpack_require__(113);
11289 var ReactDOMTextarea = __webpack_require__(114);
11290 var ReactMount = __webpack_require__(29);
11291 var ReactMultiChild = __webpack_require__(115);
11292 var ReactPerf = __webpack_require__(19);
11293 var ReactUpdateQueue = __webpack_require__(54);
11294
11295 var assign = __webpack_require__(40);
11296 var canDefineProperty = __webpack_require__(44);
11297 var escapeTextContentForBrowser = __webpack_require__(22);
11298 var invariant = __webpack_require__(14);
11299 var isEventSupported = __webpack_require__(41);
11300 var keyOf = __webpack_require__(80);
11301 var setInnerHTML = __webpack_require__(20);
11302 var setTextContent = __webpack_require__(21);
11303 var shallowEqual = __webpack_require__(118);
11304 var validateDOMNesting = __webpack_require__(71);
11305 var warning = __webpack_require__(26);
11306
11307 var deleteListener = ReactBrowserEventEmitter.deleteListener;
11308 var listenTo = ReactBrowserEventEmitter.listenTo;
11309 var registrationNameModules = ReactBrowserEventEmitter.registrationNameModules;
11310
11311 // For quickly matching children type, to test if can be treated as content.
11312 var CONTENT_TYPES = { 'string': true, 'number': true };
11313
11314 var CHILDREN = keyOf({ children: null });
11315 var STYLE = keyOf({ style: null });
11316 var HTML = keyOf({ __html: null });
11317
11318 var ELEMENT_NODE_TYPE = 1;
11319
11320 function getDeclarationErrorAddendum(internalInstance) {
11321 if (internalInstance) {
11322 var owner = internalInstance._currentElement._owner || null;
11323 if (owner) {
11324 var name = owner.getName();
11325 if (name) {
11326 return ' This DOM node was rendered by `' + name + '`.';
11327 }
11328 }
11329 }
11330 return '';
11331 }
11332
11333 var legacyPropsDescriptor;
11334 if (process.env.NODE_ENV !== 'production') {
11335 legacyPropsDescriptor = {
11336 props: {
11337 enumerable: false,
11338 get: function () {
11339 var component = this._reactInternalComponent;
11340 process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .props of a DOM node; instead, ' + 'recreate the props as `render` did originally or read the DOM ' + 'properties/attributes directly from this node (e.g., ' + 'this.refs.box.className).%s', getDeclarationErrorAddendum(component)) : undefined;
11341 return component._currentElement.props;
11342 }
11343 }
11344 };
11345 }
11346
11347 function legacyGetDOMNode() {
11348 if (process.env.NODE_ENV !== 'production') {
11349 var component = this._reactInternalComponent;
11350 process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .getDOMNode() of a DOM node; ' + 'instead, use the node directly.%s', getDeclarationErrorAddendum(component)) : undefined;
11351 }
11352 return this;
11353 }
11354
11355 function legacyIsMounted() {
11356 var component = this._reactInternalComponent;
11357 if (process.env.NODE_ENV !== 'production') {
11358 process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .isMounted() of a DOM node.%s', getDeclarationErrorAddendum(component)) : undefined;
11359 }
11360 return !!component;
11361 }
11362
11363 function legacySetStateEtc() {
11364 if (process.env.NODE_ENV !== 'production') {
11365 var component = this._reactInternalComponent;
11366 process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setState(), .replaceState(), or ' + '.forceUpdate() of a DOM node. This is a no-op.%s', getDeclarationErrorAddendum(component)) : undefined;
11367 }
11368 }
11369
11370 function legacySetProps(partialProps, callback) {
11371 var component = this._reactInternalComponent;
11372 if (process.env.NODE_ENV !== 'production') {
11373 process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .setProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined;
11374 }
11375 if (!component) {
11376 return;
11377 }
11378 ReactUpdateQueue.enqueueSetPropsInternal(component, partialProps);
11379 if (callback) {
11380 ReactUpdateQueue.enqueueCallbackInternal(component, callback);
11381 }
11382 }
11383
11384 function legacyReplaceProps(partialProps, callback) {
11385 var component = this._reactInternalComponent;
11386 if (process.env.NODE_ENV !== 'production') {
11387 process.env.NODE_ENV !== 'production' ? warning(false, 'ReactDOMComponent: Do not access .replaceProps() of a DOM node. ' + 'Instead, call ReactDOM.render again at the top level.%s', getDeclarationErrorAddendum(component)) : undefined;
11388 }
11389 if (!component) {
11390 return;
11391 }
11392 ReactUpdateQueue.enqueueReplacePropsInternal(component, partialProps);
11393 if (callback) {
11394 ReactUpdateQueue.enqueueCallbackInternal(component, callback);
11395 }
11396 }
11397
11398 function friendlyStringify(obj) {
11399 if (typeof obj === 'object') {
11400 if (Array.isArray(obj)) {
11401 return '[' + obj.map(friendlyStringify).join(', ') + ']';
11402 } else {
11403 var pairs = [];
11404 for (var key in obj) {
11405 if (Object.prototype.hasOwnProperty.call(obj, key)) {
11406 var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
11407 pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
11408 }
11409 }
11410 return '{' + pairs.join(', ') + '}';
11411 }
11412 } else if (typeof obj === 'string') {
11413 return JSON.stringify(obj);
11414 } else if (typeof obj === 'function') {
11415 return '[function object]';
11416 }
11417 // Differs from JSON.stringify in that undefined becauses undefined and that
11418 // inf and nan don't become null
11419 return String(obj);
11420 }
11421
11422 var styleMutationWarning = {};
11423
11424 function checkAndWarnForMutatedStyle(style1, style2, component) {
11425 if (style1 == null || style2 == null) {
11426 return;
11427 }
11428 if (shallowEqual(style1, style2)) {
11429 return;
11430 }
11431
11432 var componentName = component._tag;
11433 var owner = component._currentElement._owner;
11434 var ownerName;
11435 if (owner) {
11436 ownerName = owner.getName();
11437 }
11438
11439 var hash = ownerName + '|' + componentName;
11440
11441 if (styleMutationWarning.hasOwnProperty(hash)) {
11442 return;
11443 }
11444
11445 styleMutationWarning[hash] = true;
11446
11447 process.env.NODE_ENV !== 'production' ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : undefined;
11448 }
11449
11450 /**
11451 * @param {object} component
11452 * @param {?object} props
11453 */
11454 function assertValidProps(component, props) {
11455 if (!props) {
11456 return;
11457 }
11458 // Note the use of `==` which checks for null or undefined.
11459 if (process.env.NODE_ENV !== 'production') {
11460 if (voidElementTags[component._tag]) {
11461 process.env.NODE_ENV !== 'production' ? warning(props.children == null && props.dangerouslySetInnerHTML == null, '%s is a void element tag and must not have `children` or ' + 'use `props.dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : undefined;
11462 }
11463 }
11464 if (props.dangerouslySetInnerHTML != null) {
11465 !(props.children == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : invariant(false) : undefined;
11466 !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + 'Please visit https://fb.me/react-invariant-dangerously-set-inner-html ' + 'for more information.') : invariant(false) : undefined;
11467 }
11468 if (process.env.NODE_ENV !== 'production') {
11469 process.env.NODE_ENV !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : undefined;
11470 process.env.NODE_ENV !== 'production' ? warning(!props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : undefined;
11471 }
11472 !(props.style == null || typeof props.style === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'The `style` prop expects a mapping from style properties to values, ' + 'not a string. For example, style={{marginRight: spacing + \'em\'}} when ' + 'using JSX.%s', getDeclarationErrorAddendum(component)) : invariant(false) : undefined;
11473 }
11474
11475 function enqueuePutListener(id, registrationName, listener, transaction) {
11476 if (process.env.NODE_ENV !== 'production') {
11477 // IE8 has no API for event capturing and the `onScroll` event doesn't
11478 // bubble.
11479 process.env.NODE_ENV !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : undefined;
11480 }
11481 var container = ReactMount.findReactContainerForID(id);
11482 if (container) {
11483 var doc = container.nodeType === ELEMENT_NODE_TYPE ? container.ownerDocument : container;
11484 listenTo(registrationName, doc);
11485 }
11486 transaction.getReactMountReady().enqueue(putListener, {
11487 id: id,
11488 registrationName: registrationName,
11489 listener: listener
11490 });
11491 }
11492
11493 function putListener() {
11494 var listenerToPut = this;
11495 ReactBrowserEventEmitter.putListener(listenerToPut.id, listenerToPut.registrationName, listenerToPut.listener);
11496 }
11497
11498 // There are so many media events, it makes sense to just
11499 // maintain a list rather than create a `trapBubbledEvent` for each
11500 var mediaEvents = {
11501 topAbort: 'abort',
11502 topCanPlay: 'canplay',
11503 topCanPlayThrough: 'canplaythrough',
11504 topDurationChange: 'durationchange',
11505 topEmptied: 'emptied',
11506 topEncrypted: 'encrypted',
11507 topEnded: 'ended',
11508 topError: 'error',
11509 topLoadedData: 'loadeddata',
11510 topLoadedMetadata: 'loadedmetadata',
11511 topLoadStart: 'loadstart',
11512 topPause: 'pause',
11513 topPlay: 'play',
11514 topPlaying: 'playing',
11515 topProgress: 'progress',
11516 topRateChange: 'ratechange',
11517 topSeeked: 'seeked',
11518 topSeeking: 'seeking',
11519 topStalled: 'stalled',
11520 topSuspend: 'suspend',
11521 topTimeUpdate: 'timeupdate',
11522 topVolumeChange: 'volumechange',
11523 topWaiting: 'waiting'
11524 };
11525
11526 function trapBubbledEventsLocal() {
11527 var inst = this;
11528 // If a component renders to null or if another component fatals and causes
11529 // the state of the tree to be corrupted, `node` here can be null.
11530 !inst._rootNodeID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Must be mounted to trap events') : invariant(false) : undefined;
11531 var node = ReactMount.getNode(inst._rootNodeID);
11532 !node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : invariant(false) : undefined;
11533
11534 switch (inst._tag) {
11535 case 'iframe':
11536 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
11537 break;
11538 case 'video':
11539 case 'audio':
11540
11541 inst._wrapperState.listeners = [];
11542 // create listener for each media event
11543 for (var event in mediaEvents) {
11544 if (mediaEvents.hasOwnProperty(event)) {
11545 inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
11546 }
11547 }
11548
11549 break;
11550 case 'img':
11551 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
11552 break;
11553 case 'form':
11554 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
11555 break;
11556 }
11557 }
11558
11559 function mountReadyInputWrapper() {
11560 ReactDOMInput.mountReadyWrapper(this);
11561 }
11562
11563 function postUpdateSelectWrapper() {
11564 ReactDOMSelect.postUpdateWrapper(this);
11565 }
11566
11567 // For HTML, certain tags should omit their close tag. We keep a whitelist for
11568 // those special cased tags.
11569
11570 var omittedCloseTags = {
11571 'area': true,
11572 'base': true,
11573 'br': true,
11574 'col': true,
11575 'embed': true,
11576 'hr': true,
11577 'img': true,
11578 'input': true,
11579 'keygen': true,
11580 'link': true,
11581 'meta': true,
11582 'param': true,
11583 'source': true,
11584 'track': true,
11585 'wbr': true
11586 };
11587
11588 // NOTE: menuitem's close tag should be omitted, but that causes problems.
11589 var newlineEatingTags = {
11590 'listing': true,
11591 'pre': true,
11592 'textarea': true
11593 };
11594
11595 // For HTML, certain tags cannot have children. This has the same purpose as
11596 // `omittedCloseTags` except that `menuitem` should still have its closing tag.
11597
11598 var voidElementTags = assign({
11599 'menuitem': true
11600 }, omittedCloseTags);
11601
11602 // We accept any tag to be rendered but since this gets injected into arbitrary
11603 // HTML, we want to make sure that it's a safe tag.
11604 // http://www.w3.org/TR/REC-xml/#NT-Name
11605
11606 var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
11607 var validatedTagCache = {};
11608 var hasOwnProperty = ({}).hasOwnProperty;
11609
11610 function validateDangerousTag(tag) {
11611 if (!hasOwnProperty.call(validatedTagCache, tag)) {
11612 !VALID_TAG_REGEX.test(tag) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : invariant(false) : undefined;
11613 validatedTagCache[tag] = true;
11614 }
11615 }
11616
11617 function processChildContextDev(context, inst) {
11618 // Pass down our tag name to child components for validation purposes
11619 context = assign({}, context);
11620 var info = context[validateDOMNesting.ancestorInfoContextKey];
11621 context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(info, inst._tag, inst);
11622 return context;
11623 }
11624
11625 function isCustomComponent(tagName, props) {
11626 return tagName.indexOf('-') >= 0 || props.is != null;
11627 }
11628
11629 /**
11630 * Creates a new React class that is idempotent and capable of containing other
11631 * React components. It accepts event listeners and DOM properties that are
11632 * valid according to `DOMProperty`.
11633 *
11634 * - Event listeners: `onClick`, `onMouseDown`, etc.
11635 * - DOM properties: `className`, `name`, `title`, etc.
11636 *
11637 * The `style` property functions differently from the DOM API. It accepts an
11638 * object mapping of style properties to values.
11639 *
11640 * @constructor ReactDOMComponent
11641 * @extends ReactMultiChild
11642 */
11643 function ReactDOMComponent(tag) {
11644 validateDangerousTag(tag);
11645 this._tag = tag.toLowerCase();
11646 this._renderedChildren = null;
11647 this._previousStyle = null;
11648 this._previousStyleCopy = null;
11649 this._rootNodeID = null;
11650 this._wrapperState = null;
11651 this._topLevelWrapper = null;
11652 this._nodeWithLegacyProperties = null;
11653 if (process.env.NODE_ENV !== 'production') {
11654 this._unprocessedContextDev = null;
11655 this._processedContextDev = null;
11656 }
11657 }
11658
11659 ReactDOMComponent.displayName = 'ReactDOMComponent';
11660
11661 ReactDOMComponent.Mixin = {
11662
11663 construct: function (element) {
11664 this._currentElement = element;
11665 },
11666
11667 /**
11668 * Generates root tag markup then recurses. This method has side effects and
11669 * is not idempotent.
11670 *
11671 * @internal
11672 * @param {string} rootID The root DOM ID for this node.
11673 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
11674 * @param {object} context
11675 * @return {string} The computed markup.
11676 */
11677 mountComponent: function (rootID, transaction, context) {
11678 this._rootNodeID = rootID;
11679
11680 var props = this._currentElement.props;
11681
11682 switch (this._tag) {
11683 case 'iframe':
11684 case 'img':
11685 case 'form':
11686 case 'video':
11687 case 'audio':
11688 this._wrapperState = {
11689 listeners: null
11690 };
11691 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
11692 break;
11693 case 'button':
11694 props = ReactDOMButton.getNativeProps(this, props, context);
11695 break;
11696 case 'input':
11697 ReactDOMInput.mountWrapper(this, props, context);
11698 props = ReactDOMInput.getNativeProps(this, props, context);
11699 break;
11700 case 'option':
11701 ReactDOMOption.mountWrapper(this, props, context);
11702 props = ReactDOMOption.getNativeProps(this, props, context);
11703 break;
11704 case 'select':
11705 ReactDOMSelect.mountWrapper(this, props, context);
11706 props = ReactDOMSelect.getNativeProps(this, props, context);
11707 context = ReactDOMSelect.processChildContext(this, props, context);
11708 break;
11709 case 'textarea':
11710 ReactDOMTextarea.mountWrapper(this, props, context);
11711 props = ReactDOMTextarea.getNativeProps(this, props, context);
11712 break;
11713 }
11714
11715 assertValidProps(this, props);
11716 if (process.env.NODE_ENV !== 'production') {
11717 if (context[validateDOMNesting.ancestorInfoContextKey]) {
11718 validateDOMNesting(this._tag, this, context[validateDOMNesting.ancestorInfoContextKey]);
11719 }
11720 }
11721
11722 if (process.env.NODE_ENV !== 'production') {
11723 this._unprocessedContextDev = context;
11724 this._processedContextDev = processChildContextDev(context, this);
11725 context = this._processedContextDev;
11726 }
11727
11728 var mountImage;
11729 if (transaction.useCreateElement) {
11730 var ownerDocument = context[ReactMount.ownerDocumentContextKey];
11731 var el = ownerDocument.createElement(this._currentElement.type);
11732 DOMPropertyOperations.setAttributeForID(el, this._rootNodeID);
11733 // Populate node cache
11734 ReactMount.getID(el);
11735 this._updateDOMProperties({}, props, transaction, el);
11736 this._createInitialChildren(transaction, props, context, el);
11737 mountImage = el;
11738 } else {
11739 var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
11740 var tagContent = this._createContentMarkup(transaction, props, context);
11741 if (!tagContent && omittedCloseTags[this._tag]) {
11742 mountImage = tagOpen + '/>';
11743 } else {
11744 mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
11745 }
11746 }
11747
11748 switch (this._tag) {
11749 case 'input':
11750 transaction.getReactMountReady().enqueue(mountReadyInputWrapper, this);
11751 // falls through
11752 case 'button':
11753 case 'select':
11754 case 'textarea':
11755 if (props.autoFocus) {
11756 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
11757 }
11758 break;
11759 }
11760
11761 return mountImage;
11762 },
11763
11764 /**
11765 * Creates markup for the open tag and all attributes.
11766 *
11767 * This method has side effects because events get registered.
11768 *
11769 * Iterating over object properties is faster than iterating over arrays.
11770 * @see http://jsperf.com/obj-vs-arr-iteration
11771 *
11772 * @private
11773 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
11774 * @param {object} props
11775 * @return {string} Markup of opening tag.
11776 */
11777 _createOpenTagMarkupAndPutListeners: function (transaction, props) {
11778 var ret = '<' + this._currentElement.type;
11779
11780 for (var propKey in props) {
11781 if (!props.hasOwnProperty(propKey)) {
11782 continue;
11783 }
11784 var propValue = props[propKey];
11785 if (propValue == null) {
11786 continue;
11787 }
11788 if (registrationNameModules.hasOwnProperty(propKey)) {
11789 if (propValue) {
11790 enqueuePutListener(this._rootNodeID, propKey, propValue, transaction);
11791 }
11792 } else {
11793 if (propKey === STYLE) {
11794 if (propValue) {
11795 if (process.env.NODE_ENV !== 'production') {
11796 // See `_updateDOMProperties`. style block
11797 this._previousStyle = propValue;
11798 }
11799 propValue = this._previousStyleCopy = assign({}, props.style);
11800 }
11801 propValue = CSSPropertyOperations.createMarkupForStyles(propValue);
11802 }
11803 var markup = null;
11804 if (this._tag != null && isCustomComponent(this._tag, props)) {
11805 if (propKey !== CHILDREN) {
11806 markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
11807 }
11808 } else {
11809 markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
11810 }
11811 if (markup) {
11812 ret += ' ' + markup;
11813 }
11814 }
11815 }
11816
11817 // For static pages, no need to put React ID and checksum. Saves lots of
11818 // bytes.
11819 if (transaction.renderToStaticMarkup) {
11820 return ret;
11821 }
11822
11823 var markupForID = DOMPropertyOperations.createMarkupForID(this._rootNodeID);
11824 return ret + ' ' + markupForID;
11825 },
11826
11827 /**
11828 * Creates markup for the content between the tags.
11829 *
11830 * @private
11831 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
11832 * @param {object} props
11833 * @param {object} context
11834 * @return {string} Content markup.
11835 */
11836 _createContentMarkup: function (transaction, props, context) {
11837 var ret = '';
11838
11839 // Intentional use of != to avoid catching zero/false.
11840 var innerHTML = props.dangerouslySetInnerHTML;
11841 if (innerHTML != null) {
11842 if (innerHTML.__html != null) {
11843 ret = innerHTML.__html;
11844 }
11845 } else {
11846 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
11847 var childrenToUse = contentToUse != null ? null : props.children;
11848 if (contentToUse != null) {
11849 // TODO: Validate that text is allowed as a child of this node
11850 ret = escapeTextContentForBrowser(contentToUse);
11851 } else if (childrenToUse != null) {
11852 var mountImages = this.mountChildren(childrenToUse, transaction, context);
11853 ret = mountImages.join('');
11854 }
11855 }
11856 if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
11857 // text/html ignores the first character in these tags if it's a newline
11858 // Prefer to break application/xml over text/html (for now) by adding
11859 // a newline specifically to get eaten by the parser. (Alternately for
11860 // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
11861 // \r is normalized out by HTMLTextAreaElement#value.)
11862 // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
11863 // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
11864 // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
11865 // See: Parsing of "textarea" "listing" and "pre" elements
11866 // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
11867 return '\n' + ret;
11868 } else {
11869 return ret;
11870 }
11871 },
11872
11873 _createInitialChildren: function (transaction, props, context, el) {
11874 // Intentional use of != to avoid catching zero/false.
11875 var innerHTML = props.dangerouslySetInnerHTML;
11876 if (innerHTML != null) {
11877 if (innerHTML.__html != null) {
11878 setInnerHTML(el, innerHTML.__html);
11879 }
11880 } else {
11881 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
11882 var childrenToUse = contentToUse != null ? null : props.children;
11883 if (contentToUse != null) {
11884 // TODO: Validate that text is allowed as a child of this node
11885 setTextContent(el, contentToUse);
11886 } else if (childrenToUse != null) {
11887 var mountImages = this.mountChildren(childrenToUse, transaction, context);
11888 for (var i = 0; i < mountImages.length; i++) {
11889 el.appendChild(mountImages[i]);
11890 }
11891 }
11892 }
11893 },
11894
11895 /**
11896 * Receives a next element and updates the component.
11897 *
11898 * @internal
11899 * @param {ReactElement} nextElement
11900 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
11901 * @param {object} context
11902 */
11903 receiveComponent: function (nextElement, transaction, context) {
11904 var prevElement = this._currentElement;
11905 this._currentElement = nextElement;
11906 this.updateComponent(transaction, prevElement, nextElement, context);
11907 },
11908
11909 /**
11910 * Updates a native DOM component after it has already been allocated and
11911 * attached to the DOM. Reconciles the root DOM node, then recurses.
11912 *
11913 * @param {ReactReconcileTransaction} transaction
11914 * @param {ReactElement} prevElement
11915 * @param {ReactElement} nextElement
11916 * @internal
11917 * @overridable
11918 */
11919 updateComponent: function (transaction, prevElement, nextElement, context) {
11920 var lastProps = prevElement.props;
11921 var nextProps = this._currentElement.props;
11922
11923 switch (this._tag) {
11924 case 'button':
11925 lastProps = ReactDOMButton.getNativeProps(this, lastProps);
11926 nextProps = ReactDOMButton.getNativeProps(this, nextProps);
11927 break;
11928 case 'input':
11929 ReactDOMInput.updateWrapper(this);
11930 lastProps = ReactDOMInput.getNativeProps(this, lastProps);
11931 nextProps = ReactDOMInput.getNativeProps(this, nextProps);
11932 break;
11933 case 'option':
11934 lastProps = ReactDOMOption.getNativeProps(this, lastProps);
11935 nextProps = ReactDOMOption.getNativeProps(this, nextProps);
11936 break;
11937 case 'select':
11938 lastProps = ReactDOMSelect.getNativeProps(this, lastProps);
11939 nextProps = ReactDOMSelect.getNativeProps(this, nextProps);
11940 break;
11941 case 'textarea':
11942 ReactDOMTextarea.updateWrapper(this);
11943 lastProps = ReactDOMTextarea.getNativeProps(this, lastProps);
11944 nextProps = ReactDOMTextarea.getNativeProps(this, nextProps);
11945 break;
11946 }
11947
11948 if (process.env.NODE_ENV !== 'production') {
11949 // If the context is reference-equal to the old one, pass down the same
11950 // processed object so the update bailout in ReactReconciler behaves
11951 // correctly (and identically in dev and prod). See #5005.
11952 if (this._unprocessedContextDev !== context) {
11953 this._unprocessedContextDev = context;
11954 this._processedContextDev = processChildContextDev(context, this);
11955 }
11956 context = this._processedContextDev;
11957 }
11958
11959 assertValidProps(this, nextProps);
11960 this._updateDOMProperties(lastProps, nextProps, transaction, null);
11961 this._updateDOMChildren(lastProps, nextProps, transaction, context);
11962
11963 if (!canDefineProperty && this._nodeWithLegacyProperties) {
11964 this._nodeWithLegacyProperties.props = nextProps;
11965 }
11966
11967 if (this._tag === 'select') {
11968 // <select> value update needs to occur after <option> children
11969 // reconciliation
11970 transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
11971 }
11972 },
11973
11974 /**
11975 * Reconciles the properties by detecting differences in property values and
11976 * updating the DOM as necessary. This function is probably the single most
11977 * critical path for performance optimization.
11978 *
11979 * TODO: Benchmark whether checking for changed values in memory actually
11980 * improves performance (especially statically positioned elements).
11981 * TODO: Benchmark the effects of putting this at the top since 99% of props
11982 * do not change for a given reconciliation.
11983 * TODO: Benchmark areas that can be improved with caching.
11984 *
11985 * @private
11986 * @param {object} lastProps
11987 * @param {object} nextProps
11988 * @param {ReactReconcileTransaction} transaction
11989 * @param {?DOMElement} node
11990 */
11991 _updateDOMProperties: function (lastProps, nextProps, transaction, node) {
11992 var propKey;
11993 var styleName;
11994 var styleUpdates;
11995 for (propKey in lastProps) {
11996 if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey)) {
11997 continue;
11998 }
11999 if (propKey === STYLE) {
12000 var lastStyle = this._previousStyleCopy;
12001 for (styleName in lastStyle) {
12002 if (lastStyle.hasOwnProperty(styleName)) {
12003 styleUpdates = styleUpdates || {};
12004 styleUpdates[styleName] = '';
12005 }
12006 }
12007 this._previousStyleCopy = null;
12008 } else if (registrationNameModules.hasOwnProperty(propKey)) {
12009 if (lastProps[propKey]) {
12010 // Only call deleteListener if there was a listener previously or
12011 // else willDeleteListener gets called when there wasn't actually a
12012 // listener (e.g., onClick={null})
12013 deleteListener(this._rootNodeID, propKey);
12014 }
12015 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
12016 if (!node) {
12017 node = ReactMount.getNode(this._rootNodeID);
12018 }
12019 DOMPropertyOperations.deleteValueForProperty(node, propKey);
12020 }
12021 }
12022 for (propKey in nextProps) {
12023 var nextProp = nextProps[propKey];
12024 var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps[propKey];
12025 if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp) {
12026 continue;
12027 }
12028 if (propKey === STYLE) {
12029 if (nextProp) {
12030 if (process.env.NODE_ENV !== 'production') {
12031 checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
12032 this._previousStyle = nextProp;
12033 }
12034 nextProp = this._previousStyleCopy = assign({}, nextProp);
12035 } else {
12036 this._previousStyleCopy = null;
12037 }
12038 if (lastProp) {
12039 // Unset styles on `lastProp` but not on `nextProp`.
12040 for (styleName in lastProp) {
12041 if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
12042 styleUpdates = styleUpdates || {};
12043 styleUpdates[styleName] = '';
12044 }
12045 }
12046 // Update styles that changed since `lastProp`.
12047 for (styleName in nextProp) {
12048 if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
12049 styleUpdates = styleUpdates || {};
12050 styleUpdates[styleName] = nextProp[styleName];
12051 }
12052 }
12053 } else {
12054 // Relies on `updateStylesByID` not mutating `styleUpdates`.
12055 styleUpdates = nextProp;
12056 }
12057 } else if (registrationNameModules.hasOwnProperty(propKey)) {
12058 if (nextProp) {
12059 enqueuePutListener(this._rootNodeID, propKey, nextProp, transaction);
12060 } else if (lastProp) {
12061 deleteListener(this._rootNodeID, propKey);
12062 }
12063 } else if (isCustomComponent(this._tag, nextProps)) {
12064 if (!node) {
12065 node = ReactMount.getNode(this._rootNodeID);
12066 }
12067 if (propKey === CHILDREN) {
12068 nextProp = null;
12069 }
12070 DOMPropertyOperations.setValueForAttribute(node, propKey, nextProp);
12071 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
12072 if (!node) {
12073 node = ReactMount.getNode(this._rootNodeID);
12074 }
12075 // If we're updating to null or undefined, we should remove the property
12076 // from the DOM node instead of inadvertantly setting to a string. This
12077 // brings us in line with the same behavior we have on initial render.
12078 if (nextProp != null) {
12079 DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
12080 } else {
12081 DOMPropertyOperations.deleteValueForProperty(node, propKey);
12082 }
12083 }
12084 }
12085 if (styleUpdates) {
12086 if (!node) {
12087 node = ReactMount.getNode(this._rootNodeID);
12088 }
12089 CSSPropertyOperations.setValueForStyles(node, styleUpdates);
12090 }
12091 },
12092
12093 /**
12094 * Reconciles the children with the various properties that affect the
12095 * children content.
12096 *
12097 * @param {object} lastProps
12098 * @param {object} nextProps
12099 * @param {ReactReconcileTransaction} transaction
12100 * @param {object} context
12101 */
12102 _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
12103 var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
12104 var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
12105
12106 var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
12107 var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
12108
12109 // Note the use of `!=` which checks for null or undefined.
12110 var lastChildren = lastContent != null ? null : lastProps.children;
12111 var nextChildren = nextContent != null ? null : nextProps.children;
12112
12113 // If we're switching from children to content/html or vice versa, remove
12114 // the old content
12115 var lastHasContentOrHtml = lastContent != null || lastHtml != null;
12116 var nextHasContentOrHtml = nextContent != null || nextHtml != null;
12117 if (lastChildren != null && nextChildren == null) {
12118 this.updateChildren(null, transaction, context);
12119 } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
12120 this.updateTextContent('');
12121 }
12122
12123 if (nextContent != null) {
12124 if (lastContent !== nextContent) {
12125 this.updateTextContent('' + nextContent);
12126 }
12127 } else if (nextHtml != null) {
12128 if (lastHtml !== nextHtml) {
12129 this.updateMarkup('' + nextHtml);
12130 }
12131 } else if (nextChildren != null) {
12132 this.updateChildren(nextChildren, transaction, context);
12133 }
12134 },
12135
12136 /**
12137 * Destroys all event registrations for this instance. Does not remove from
12138 * the DOM. That must be done by the parent.
12139 *
12140 * @internal
12141 */
12142 unmountComponent: function () {
12143 switch (this._tag) {
12144 case 'iframe':
12145 case 'img':
12146 case 'form':
12147 case 'video':
12148 case 'audio':
12149 var listeners = this._wrapperState.listeners;
12150 if (listeners) {
12151 for (var i = 0; i < listeners.length; i++) {
12152 listeners[i].remove();
12153 }
12154 }
12155 break;
12156 case 'input':
12157 ReactDOMInput.unmountWrapper(this);
12158 break;
12159 case 'html':
12160 case 'head':
12161 case 'body':
12162 /**
12163 * Components like <html> <head> and <body> can't be removed or added
12164 * easily in a cross-browser way, however it's valuable to be able to
12165 * take advantage of React's reconciliation for styling and <title>
12166 * management. So we just document it and throw in dangerous cases.
12167 */
12168 true ? process.env.NODE_ENV !== 'production' ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is ' + 'impossible to unmount some top-level components (eg <html>, ' + '<head>, and <body>) reliably and efficiently. To fix this, have a ' + 'single top-level component that never unmounts render these ' + 'elements.', this._tag) : invariant(false) : undefined;
12169 break;
12170 }
12171
12172 this.unmountChildren();
12173 ReactBrowserEventEmitter.deleteAllListeners(this._rootNodeID);
12174 ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
12175 this._rootNodeID = null;
12176 this._wrapperState = null;
12177 if (this._nodeWithLegacyProperties) {
12178 var node = this._nodeWithLegacyProperties;
12179 node._reactInternalComponent = null;
12180 this._nodeWithLegacyProperties = null;
12181 }
12182 },
12183
12184 getPublicInstance: function () {
12185 if (!this._nodeWithLegacyProperties) {
12186 var node = ReactMount.getNode(this._rootNodeID);
12187
12188 node._reactInternalComponent = this;
12189 node.getDOMNode = legacyGetDOMNode;
12190 node.isMounted = legacyIsMounted;
12191 node.setState = legacySetStateEtc;
12192 node.replaceState = legacySetStateEtc;
12193 node.forceUpdate = legacySetStateEtc;
12194 node.setProps = legacySetProps;
12195 node.replaceProps = legacyReplaceProps;
12196
12197 if (process.env.NODE_ENV !== 'production') {
12198 if (canDefineProperty) {
12199 Object.defineProperties(node, legacyPropsDescriptor);
12200 } else {
12201 // updateComponent will update this property on subsequent renders
12202 node.props = this._currentElement.props;
12203 }
12204 } else {
12205 // updateComponent will update this property on subsequent renders
12206 node.props = this._currentElement.props;
12207 }
12208
12209 this._nodeWithLegacyProperties = node;
12210 }
12211 return this._nodeWithLegacyProperties;
12212 }
12213
12214 };
12215
12216 ReactPerf.measureMethods(ReactDOMComponent, 'ReactDOMComponent', {
12217 mountComponent: 'mountComponent',
12218 updateComponent: 'updateComponent'
12219 });
12220
12221 assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
12222
12223 module.exports = ReactDOMComponent;
12224 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
12225
12226/***/ }),
12227/* 95 */
12228/***/ (function(module, exports, __webpack_require__) {
12229
12230 /**
12231 * Copyright 2013-2015, Facebook, Inc.
12232 * All rights reserved.
12233 *
12234 * This source code is licensed under the BSD-style license found in the
12235 * LICENSE file in the root directory of this source tree. An additional grant
12236 * of patent rights can be found in the PATENTS file in the same directory.
12237 *
12238 * @providesModule AutoFocusUtils
12239 * @typechecks static-only
12240 */
12241
12242 'use strict';
12243
12244 var ReactMount = __webpack_require__(29);
12245
12246 var findDOMNode = __webpack_require__(92);
12247 var focusNode = __webpack_require__(96);
12248
12249 var Mixin = {
12250 componentDidMount: function () {
12251 if (this.props.autoFocus) {
12252 focusNode(findDOMNode(this));
12253 }
12254 }
12255 };
12256
12257 var AutoFocusUtils = {
12258 Mixin: Mixin,
12259
12260 focusDOMComponent: function () {
12261 focusNode(ReactMount.getNode(this._rootNodeID));
12262 }
12263 };
12264
12265 module.exports = AutoFocusUtils;
12266
12267/***/ }),
12268/* 96 */
12269/***/ (function(module, exports) {
12270
12271 /**
12272 * Copyright 2013-2015, Facebook, Inc.
12273 * All rights reserved.
12274 *
12275 * This source code is licensed under the BSD-style license found in the
12276 * LICENSE file in the root directory of this source tree. An additional grant
12277 * of patent rights can be found in the PATENTS file in the same directory.
12278 *
12279 * @providesModule focusNode
12280 */
12281
12282 'use strict';
12283
12284 /**
12285 * @param {DOMElement} node input/textarea to focus
12286 */
12287 function focusNode(node) {
12288 // IE8 can throw "Can't move focus to the control because it is invisible,
12289 // not enabled, or of a type that does not accept the focus." for all kinds of
12290 // reasons that are too expensive and fragile to test.
12291 try {
12292 node.focus();
12293 } catch (e) {}
12294 }
12295
12296 module.exports = focusNode;
12297
12298/***/ }),
12299/* 97 */
12300/***/ (function(module, exports, __webpack_require__) {
12301
12302 /* WEBPACK VAR INJECTION */(function(process) {/**
12303 * Copyright 2013-2015, Facebook, Inc.
12304 * All rights reserved.
12305 *
12306 * This source code is licensed under the BSD-style license found in the
12307 * LICENSE file in the root directory of this source tree. An additional grant
12308 * of patent rights can be found in the PATENTS file in the same directory.
12309 *
12310 * @providesModule CSSPropertyOperations
12311 * @typechecks static-only
12312 */
12313
12314 'use strict';
12315
12316 var CSSProperty = __webpack_require__(98);
12317 var ExecutionEnvironment = __webpack_require__(10);
12318 var ReactPerf = __webpack_require__(19);
12319
12320 var camelizeStyleName = __webpack_require__(99);
12321 var dangerousStyleValue = __webpack_require__(101);
12322 var hyphenateStyleName = __webpack_require__(102);
12323 var memoizeStringOnly = __webpack_require__(104);
12324 var warning = __webpack_require__(26);
12325
12326 var processStyleName = memoizeStringOnly(function (styleName) {
12327 return hyphenateStyleName(styleName);
12328 });
12329
12330 var hasShorthandPropertyBug = false;
12331 var styleFloatAccessor = 'cssFloat';
12332 if (ExecutionEnvironment.canUseDOM) {
12333 var tempStyle = document.createElement('div').style;
12334 try {
12335 // IE8 throws "Invalid argument." if resetting shorthand style properties.
12336 tempStyle.font = '';
12337 } catch (e) {
12338 hasShorthandPropertyBug = true;
12339 }
12340 // IE8 only supports accessing cssFloat (standard) as styleFloat
12341 if (document.documentElement.style.cssFloat === undefined) {
12342 styleFloatAccessor = 'styleFloat';
12343 }
12344 }
12345
12346 if (process.env.NODE_ENV !== 'production') {
12347 // 'msTransform' is correct, but the other prefixes should be capitalized
12348 var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
12349
12350 // style values shouldn't contain a semicolon
12351 var badStyleValueWithSemicolonPattern = /;\s*$/;
12352
12353 var warnedStyleNames = {};
12354 var warnedStyleValues = {};
12355
12356 var warnHyphenatedStyleName = function (name) {
12357 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
12358 return;
12359 }
12360
12361 warnedStyleNames[name] = true;
12362 process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?', name, camelizeStyleName(name)) : undefined;
12363 };
12364
12365 var warnBadVendoredStyleName = function (name) {
12366 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
12367 return;
12368 }
12369
12370 warnedStyleNames[name] = true;
12371 process.env.NODE_ENV !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)) : undefined;
12372 };
12373
12374 var warnStyleValueWithSemicolon = function (name, value) {
12375 if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
12376 return;
12377 }
12378
12379 warnedStyleValues[value] = true;
12380 process.env.NODE_ENV !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon. ' + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')) : undefined;
12381 };
12382
12383 /**
12384 * @param {string} name
12385 * @param {*} value
12386 */
12387 var warnValidStyle = function (name, value) {
12388 if (name.indexOf('-') > -1) {
12389 warnHyphenatedStyleName(name);
12390 } else if (badVendoredStyleNamePattern.test(name)) {
12391 warnBadVendoredStyleName(name);
12392 } else if (badStyleValueWithSemicolonPattern.test(value)) {
12393 warnStyleValueWithSemicolon(name, value);
12394 }
12395 };
12396 }
12397
12398 /**
12399 * Operations for dealing with CSS properties.
12400 */
12401 var CSSPropertyOperations = {
12402
12403 /**
12404 * Serializes a mapping of style properties for use as inline styles:
12405 *
12406 * > createMarkupForStyles({width: '200px', height: 0})
12407 * "width:200px;height:0;"
12408 *
12409 * Undefined values are ignored so that declarative programming is easier.
12410 * The result should be HTML-escaped before insertion into the DOM.
12411 *
12412 * @param {object} styles
12413 * @return {?string}
12414 */
12415 createMarkupForStyles: function (styles) {
12416 var serialized = '';
12417 for (var styleName in styles) {
12418 if (!styles.hasOwnProperty(styleName)) {
12419 continue;
12420 }
12421 var styleValue = styles[styleName];
12422 if (process.env.NODE_ENV !== 'production') {
12423 warnValidStyle(styleName, styleValue);
12424 }
12425 if (styleValue != null) {
12426 serialized += processStyleName(styleName) + ':';
12427 serialized += dangerousStyleValue(styleName, styleValue) + ';';
12428 }
12429 }
12430 return serialized || null;
12431 },
12432
12433 /**
12434 * Sets the value for multiple styles on a node. If a value is specified as
12435 * '' (empty string), the corresponding style property will be unset.
12436 *
12437 * @param {DOMElement} node
12438 * @param {object} styles
12439 */
12440 setValueForStyles: function (node, styles) {
12441 var style = node.style;
12442 for (var styleName in styles) {
12443 if (!styles.hasOwnProperty(styleName)) {
12444 continue;
12445 }
12446 if (process.env.NODE_ENV !== 'production') {
12447 warnValidStyle(styleName, styles[styleName]);
12448 }
12449 var styleValue = dangerousStyleValue(styleName, styles[styleName]);
12450 if (styleName === 'float') {
12451 styleName = styleFloatAccessor;
12452 }
12453 if (styleValue) {
12454 style[styleName] = styleValue;
12455 } else {
12456 var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
12457 if (expansion) {
12458 // Shorthand property that IE8 won't like unsetting, so unset each
12459 // component to placate it
12460 for (var individualStyleName in expansion) {
12461 style[individualStyleName] = '';
12462 }
12463 } else {
12464 style[styleName] = '';
12465 }
12466 }
12467 }
12468 }
12469
12470 };
12471
12472 ReactPerf.measureMethods(CSSPropertyOperations, 'CSSPropertyOperations', {
12473 setValueForStyles: 'setValueForStyles'
12474 });
12475
12476 module.exports = CSSPropertyOperations;
12477 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
12478
12479/***/ }),
12480/* 98 */
12481/***/ (function(module, exports) {
12482
12483 /**
12484 * Copyright 2013-2015, Facebook, Inc.
12485 * All rights reserved.
12486 *
12487 * This source code is licensed under the BSD-style license found in the
12488 * LICENSE file in the root directory of this source tree. An additional grant
12489 * of patent rights can be found in the PATENTS file in the same directory.
12490 *
12491 * @providesModule CSSProperty
12492 */
12493
12494 'use strict';
12495
12496 /**
12497 * CSS properties which accept numbers but are not in units of "px".
12498 */
12499 var isUnitlessNumber = {
12500 animationIterationCount: true,
12501 boxFlex: true,
12502 boxFlexGroup: true,
12503 boxOrdinalGroup: true,
12504 columnCount: true,
12505 flex: true,
12506 flexGrow: true,
12507 flexPositive: true,
12508 flexShrink: true,
12509 flexNegative: true,
12510 flexOrder: true,
12511 fontWeight: true,
12512 lineClamp: true,
12513 lineHeight: true,
12514 opacity: true,
12515 order: true,
12516 orphans: true,
12517 tabSize: true,
12518 widows: true,
12519 zIndex: true,
12520 zoom: true,
12521
12522 // SVG-related properties
12523 fillOpacity: true,
12524 stopOpacity: true,
12525 strokeDashoffset: true,
12526 strokeOpacity: true,
12527 strokeWidth: true
12528 };
12529
12530 /**
12531 * @param {string} prefix vendor-specific prefix, eg: Webkit
12532 * @param {string} key style name, eg: transitionDuration
12533 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
12534 * WebkitTransitionDuration
12535 */
12536 function prefixKey(prefix, key) {
12537 return prefix + key.charAt(0).toUpperCase() + key.substring(1);
12538 }
12539
12540 /**
12541 * Support style names that may come passed in prefixed by adding permutations
12542 * of vendor prefixes.
12543 */
12544 var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
12545
12546 // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
12547 // infinite loop, because it iterates over the newly added props too.
12548 Object.keys(isUnitlessNumber).forEach(function (prop) {
12549 prefixes.forEach(function (prefix) {
12550 isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
12551 });
12552 });
12553
12554 /**
12555 * Most style properties can be unset by doing .style[prop] = '' but IE8
12556 * doesn't like doing that with shorthand properties so for the properties that
12557 * IE8 breaks on, which are listed here, we instead unset each of the
12558 * individual properties. See http://bugs.jquery.com/ticket/12385.
12559 * The 4-value 'clock' properties like margin, padding, border-width seem to
12560 * behave without any problems. Curiously, list-style works too without any
12561 * special prodding.
12562 */
12563 var shorthandPropertyExpansions = {
12564 background: {
12565 backgroundAttachment: true,
12566 backgroundColor: true,
12567 backgroundImage: true,
12568 backgroundPositionX: true,
12569 backgroundPositionY: true,
12570 backgroundRepeat: true
12571 },
12572 backgroundPosition: {
12573 backgroundPositionX: true,
12574 backgroundPositionY: true
12575 },
12576 border: {
12577 borderWidth: true,
12578 borderStyle: true,
12579 borderColor: true
12580 },
12581 borderBottom: {
12582 borderBottomWidth: true,
12583 borderBottomStyle: true,
12584 borderBottomColor: true
12585 },
12586 borderLeft: {
12587 borderLeftWidth: true,
12588 borderLeftStyle: true,
12589 borderLeftColor: true
12590 },
12591 borderRight: {
12592 borderRightWidth: true,
12593 borderRightStyle: true,
12594 borderRightColor: true
12595 },
12596 borderTop: {
12597 borderTopWidth: true,
12598 borderTopStyle: true,
12599 borderTopColor: true
12600 },
12601 font: {
12602 fontStyle: true,
12603 fontVariant: true,
12604 fontWeight: true,
12605 fontSize: true,
12606 lineHeight: true,
12607 fontFamily: true
12608 },
12609 outline: {
12610 outlineWidth: true,
12611 outlineStyle: true,
12612 outlineColor: true
12613 }
12614 };
12615
12616 var CSSProperty = {
12617 isUnitlessNumber: isUnitlessNumber,
12618 shorthandPropertyExpansions: shorthandPropertyExpansions
12619 };
12620
12621 module.exports = CSSProperty;
12622
12623/***/ }),
12624/* 99 */
12625/***/ (function(module, exports, __webpack_require__) {
12626
12627 /**
12628 * Copyright 2013-2015, Facebook, Inc.
12629 * All rights reserved.
12630 *
12631 * This source code is licensed under the BSD-style license found in the
12632 * LICENSE file in the root directory of this source tree. An additional grant
12633 * of patent rights can be found in the PATENTS file in the same directory.
12634 *
12635 * @providesModule camelizeStyleName
12636 * @typechecks
12637 */
12638
12639 'use strict';
12640
12641 var camelize = __webpack_require__(100);
12642
12643 var msPattern = /^-ms-/;
12644
12645 /**
12646 * Camelcases a hyphenated CSS property name, for example:
12647 *
12648 * > camelizeStyleName('background-color')
12649 * < "backgroundColor"
12650 * > camelizeStyleName('-moz-transition')
12651 * < "MozTransition"
12652 * > camelizeStyleName('-ms-transition')
12653 * < "msTransition"
12654 *
12655 * As Andi Smith suggests
12656 * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
12657 * is converted to lowercase `ms`.
12658 *
12659 * @param {string} string
12660 * @return {string}
12661 */
12662 function camelizeStyleName(string) {
12663 return camelize(string.replace(msPattern, 'ms-'));
12664 }
12665
12666 module.exports = camelizeStyleName;
12667
12668/***/ }),
12669/* 100 */
12670/***/ (function(module, exports) {
12671
12672 /**
12673 * Copyright 2013-2015, Facebook, Inc.
12674 * All rights reserved.
12675 *
12676 * This source code is licensed under the BSD-style license found in the
12677 * LICENSE file in the root directory of this source tree. An additional grant
12678 * of patent rights can be found in the PATENTS file in the same directory.
12679 *
12680 * @providesModule camelize
12681 * @typechecks
12682 */
12683
12684 "use strict";
12685
12686 var _hyphenPattern = /-(.)/g;
12687
12688 /**
12689 * Camelcases a hyphenated string, for example:
12690 *
12691 * > camelize('background-color')
12692 * < "backgroundColor"
12693 *
12694 * @param {string} string
12695 * @return {string}
12696 */
12697 function camelize(string) {
12698 return string.replace(_hyphenPattern, function (_, character) {
12699 return character.toUpperCase();
12700 });
12701 }
12702
12703 module.exports = camelize;
12704
12705/***/ }),
12706/* 101 */
12707/***/ (function(module, exports, __webpack_require__) {
12708
12709 /**
12710 * Copyright 2013-2015, Facebook, Inc.
12711 * All rights reserved.
12712 *
12713 * This source code is licensed under the BSD-style license found in the
12714 * LICENSE file in the root directory of this source tree. An additional grant
12715 * of patent rights can be found in the PATENTS file in the same directory.
12716 *
12717 * @providesModule dangerousStyleValue
12718 * @typechecks static-only
12719 */
12720
12721 'use strict';
12722
12723 var CSSProperty = __webpack_require__(98);
12724
12725 var isUnitlessNumber = CSSProperty.isUnitlessNumber;
12726
12727 /**
12728 * Convert a value into the proper css writable value. The style name `name`
12729 * should be logical (no hyphens), as specified
12730 * in `CSSProperty.isUnitlessNumber`.
12731 *
12732 * @param {string} name CSS property name such as `topMargin`.
12733 * @param {*} value CSS property value such as `10px`.
12734 * @return {string} Normalized style value with dimensions applied.
12735 */
12736 function dangerousStyleValue(name, value) {
12737 // Note that we've removed escapeTextForBrowser() calls here since the
12738 // whole string will be escaped when the attribute is injected into
12739 // the markup. If you provide unsafe user data here they can inject
12740 // arbitrary CSS which may be problematic (I couldn't repro this):
12741 // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
12742 // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
12743 // This is not an XSS hole but instead a potential CSS injection issue
12744 // which has lead to a greater discussion about how we're going to
12745 // trust URLs moving forward. See #2115901
12746
12747 var isEmpty = value == null || typeof value === 'boolean' || value === '';
12748 if (isEmpty) {
12749 return '';
12750 }
12751
12752 var isNonNumeric = isNaN(value);
12753 if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
12754 return '' + value; // cast to string
12755 }
12756
12757 if (typeof value === 'string') {
12758 value = value.trim();
12759 }
12760 return value + 'px';
12761 }
12762
12763 module.exports = dangerousStyleValue;
12764
12765/***/ }),
12766/* 102 */
12767/***/ (function(module, exports, __webpack_require__) {
12768
12769 /**
12770 * Copyright 2013-2015, Facebook, Inc.
12771 * All rights reserved.
12772 *
12773 * This source code is licensed under the BSD-style license found in the
12774 * LICENSE file in the root directory of this source tree. An additional grant
12775 * of patent rights can be found in the PATENTS file in the same directory.
12776 *
12777 * @providesModule hyphenateStyleName
12778 * @typechecks
12779 */
12780
12781 'use strict';
12782
12783 var hyphenate = __webpack_require__(103);
12784
12785 var msPattern = /^ms-/;
12786
12787 /**
12788 * Hyphenates a camelcased CSS property name, for example:
12789 *
12790 * > hyphenateStyleName('backgroundColor')
12791 * < "background-color"
12792 * > hyphenateStyleName('MozTransition')
12793 * < "-moz-transition"
12794 * > hyphenateStyleName('msTransition')
12795 * < "-ms-transition"
12796 *
12797 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
12798 * is converted to `-ms-`.
12799 *
12800 * @param {string} string
12801 * @return {string}
12802 */
12803 function hyphenateStyleName(string) {
12804 return hyphenate(string).replace(msPattern, '-ms-');
12805 }
12806
12807 module.exports = hyphenateStyleName;
12808
12809/***/ }),
12810/* 103 */
12811/***/ (function(module, exports) {
12812
12813 /**
12814 * Copyright 2013-2015, Facebook, Inc.
12815 * All rights reserved.
12816 *
12817 * This source code is licensed under the BSD-style license found in the
12818 * LICENSE file in the root directory of this source tree. An additional grant
12819 * of patent rights can be found in the PATENTS file in the same directory.
12820 *
12821 * @providesModule hyphenate
12822 * @typechecks
12823 */
12824
12825 'use strict';
12826
12827 var _uppercasePattern = /([A-Z])/g;
12828
12829 /**
12830 * Hyphenates a camelcased string, for example:
12831 *
12832 * > hyphenate('backgroundColor')
12833 * < "background-color"
12834 *
12835 * For CSS style names, use `hyphenateStyleName` instead which works properly
12836 * with all vendor prefixes, including `ms`.
12837 *
12838 * @param {string} string
12839 * @return {string}
12840 */
12841 function hyphenate(string) {
12842 return string.replace(_uppercasePattern, '-$1').toLowerCase();
12843 }
12844
12845 module.exports = hyphenate;
12846
12847/***/ }),
12848/* 104 */
12849/***/ (function(module, exports) {
12850
12851 /**
12852 * Copyright 2013-2015, Facebook, Inc.
12853 * All rights reserved.
12854 *
12855 * This source code is licensed under the BSD-style license found in the
12856 * LICENSE file in the root directory of this source tree. An additional grant
12857 * of patent rights can be found in the PATENTS file in the same directory.
12858 *
12859 * @providesModule memoizeStringOnly
12860 * @typechecks static-only
12861 */
12862
12863 'use strict';
12864
12865 /**
12866 * Memoizes the return value of a function that accepts one string argument.
12867 *
12868 * @param {function} callback
12869 * @return {function}
12870 */
12871 function memoizeStringOnly(callback) {
12872 var cache = {};
12873 return function (string) {
12874 if (!cache.hasOwnProperty(string)) {
12875 cache[string] = callback.call(this, string);
12876 }
12877 return cache[string];
12878 };
12879 }
12880
12881 module.exports = memoizeStringOnly;
12882
12883/***/ }),
12884/* 105 */
12885/***/ (function(module, exports) {
12886
12887 /**
12888 * Copyright 2013-2015, Facebook, Inc.
12889 * All rights reserved.
12890 *
12891 * This source code is licensed under the BSD-style license found in the
12892 * LICENSE file in the root directory of this source tree. An additional grant
12893 * of patent rights can be found in the PATENTS file in the same directory.
12894 *
12895 * @providesModule ReactDOMButton
12896 */
12897
12898 'use strict';
12899
12900 var mouseListenerNames = {
12901 onClick: true,
12902 onDoubleClick: true,
12903 onMouseDown: true,
12904 onMouseMove: true,
12905 onMouseUp: true,
12906
12907 onClickCapture: true,
12908 onDoubleClickCapture: true,
12909 onMouseDownCapture: true,
12910 onMouseMoveCapture: true,
12911 onMouseUpCapture: true
12912 };
12913
12914 /**
12915 * Implements a <button> native component that does not receive mouse events
12916 * when `disabled` is set.
12917 */
12918 var ReactDOMButton = {
12919 getNativeProps: function (inst, props, context) {
12920 if (!props.disabled) {
12921 return props;
12922 }
12923
12924 // Copy the props, except the mouse listeners
12925 var nativeProps = {};
12926 for (var key in props) {
12927 if (props.hasOwnProperty(key) && !mouseListenerNames[key]) {
12928 nativeProps[key] = props[key];
12929 }
12930 }
12931
12932 return nativeProps;
12933 }
12934 };
12935
12936 module.exports = ReactDOMButton;
12937
12938/***/ }),
12939/* 106 */
12940/***/ (function(module, exports, __webpack_require__) {
12941
12942 /* WEBPACK VAR INJECTION */(function(process) {/**
12943 * Copyright 2013-2015, Facebook, Inc.
12944 * All rights reserved.
12945 *
12946 * This source code is licensed under the BSD-style license found in the
12947 * LICENSE file in the root directory of this source tree. An additional grant
12948 * of patent rights can be found in the PATENTS file in the same directory.
12949 *
12950 * @providesModule ReactDOMInput
12951 */
12952
12953 'use strict';
12954
12955 var ReactDOMIDOperations = __webpack_require__(28);
12956 var LinkedValueUtils = __webpack_require__(107);
12957 var ReactMount = __webpack_require__(29);
12958 var ReactUpdates = __webpack_require__(55);
12959
12960 var assign = __webpack_require__(40);
12961 var invariant = __webpack_require__(14);
12962
12963 var instancesByReactID = {};
12964
12965 function forceUpdateIfMounted() {
12966 if (this._rootNodeID) {
12967 // DOM component is still mounted; update
12968 ReactDOMInput.updateWrapper(this);
12969 }
12970 }
12971
12972 /**
12973 * Implements an <input> native component that allows setting these optional
12974 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
12975 *
12976 * If `checked` or `value` are not supplied (or null/undefined), user actions
12977 * that affect the checked state or value will trigger updates to the element.
12978 *
12979 * If they are supplied (and not null/undefined), the rendered element will not
12980 * trigger updates to the element. Instead, the props must change in order for
12981 * the rendered element to be updated.
12982 *
12983 * The rendered element will be initialized as unchecked (or `defaultChecked`)
12984 * with an empty value (or `defaultValue`).
12985 *
12986 * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
12987 */
12988 var ReactDOMInput = {
12989 getNativeProps: function (inst, props, context) {
12990 var value = LinkedValueUtils.getValue(props);
12991 var checked = LinkedValueUtils.getChecked(props);
12992
12993 var nativeProps = assign({}, props, {
12994 defaultChecked: undefined,
12995 defaultValue: undefined,
12996 value: value != null ? value : inst._wrapperState.initialValue,
12997 checked: checked != null ? checked : inst._wrapperState.initialChecked,
12998 onChange: inst._wrapperState.onChange
12999 });
13000
13001 return nativeProps;
13002 },
13003
13004 mountWrapper: function (inst, props) {
13005 if (process.env.NODE_ENV !== 'production') {
13006 LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
13007 }
13008
13009 var defaultValue = props.defaultValue;
13010 inst._wrapperState = {
13011 initialChecked: props.defaultChecked || false,
13012 initialValue: defaultValue != null ? defaultValue : null,
13013 onChange: _handleChange.bind(inst)
13014 };
13015 },
13016
13017 mountReadyWrapper: function (inst) {
13018 // Can't be in mountWrapper or else server rendering leaks.
13019 instancesByReactID[inst._rootNodeID] = inst;
13020 },
13021
13022 unmountWrapper: function (inst) {
13023 delete instancesByReactID[inst._rootNodeID];
13024 },
13025
13026 updateWrapper: function (inst) {
13027 var props = inst._currentElement.props;
13028
13029 // TODO: Shouldn't this be getChecked(props)?
13030 var checked = props.checked;
13031 if (checked != null) {
13032 ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'checked', checked || false);
13033 }
13034
13035 var value = LinkedValueUtils.getValue(props);
13036 if (value != null) {
13037 // Cast `value` to a string to ensure the value is set correctly. While
13038 // browsers typically do this as necessary, jsdom doesn't.
13039 ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'value', '' + value);
13040 }
13041 }
13042 };
13043
13044 function _handleChange(event) {
13045 var props = this._currentElement.props;
13046
13047 var returnValue = LinkedValueUtils.executeOnChange(props, event);
13048
13049 // Here we use asap to wait until all updates have propagated, which
13050 // is important when using controlled components within layers:
13051 // https://github.com/facebook/react/issues/1698
13052 ReactUpdates.asap(forceUpdateIfMounted, this);
13053
13054 var name = props.name;
13055 if (props.type === 'radio' && name != null) {
13056 var rootNode = ReactMount.getNode(this._rootNodeID);
13057 var queryRoot = rootNode;
13058
13059 while (queryRoot.parentNode) {
13060 queryRoot = queryRoot.parentNode;
13061 }
13062
13063 // If `rootNode.form` was non-null, then we could try `form.elements`,
13064 // but that sometimes behaves strangely in IE8. We could also try using
13065 // `form.getElementsByName`, but that will only return direct children
13066 // and won't include inputs that use the HTML5 `form=` attribute. Since
13067 // the input might not even be in a form, let's just use the global
13068 // `querySelectorAll` to ensure we don't miss anything.
13069 var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
13070
13071 for (var i = 0; i < group.length; i++) {
13072 var otherNode = group[i];
13073 if (otherNode === rootNode || otherNode.form !== rootNode.form) {
13074 continue;
13075 }
13076 // This will throw if radio buttons rendered by different copies of React
13077 // and the same name are rendered into the same form (same as #1939).
13078 // That's probably okay; we don't support it just as we don't support
13079 // mixing React with non-React.
13080 var otherID = ReactMount.getID(otherNode);
13081 !otherID ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.') : invariant(false) : undefined;
13082 var otherInstance = instancesByReactID[otherID];
13083 !otherInstance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactDOMInput: Unknown radio button ID %s.', otherID) : invariant(false) : undefined;
13084 // If this is a controlled radio button group, forcing the input that
13085 // was previously checked to update will cause it to be come re-checked
13086 // as appropriate.
13087 ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
13088 }
13089 }
13090
13091 return returnValue;
13092 }
13093
13094 module.exports = ReactDOMInput;
13095 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
13096
13097/***/ }),
13098/* 107 */
13099/***/ (function(module, exports, __webpack_require__) {
13100
13101 /* WEBPACK VAR INJECTION */(function(process) {/**
13102 * Copyright 2013-2015, Facebook, Inc.
13103 * All rights reserved.
13104 *
13105 * This source code is licensed under the BSD-style license found in the
13106 * LICENSE file in the root directory of this source tree. An additional grant
13107 * of patent rights can be found in the PATENTS file in the same directory.
13108 *
13109 * @providesModule LinkedValueUtils
13110 * @typechecks static-only
13111 */
13112
13113 'use strict';
13114
13115 var ReactPropTypes = __webpack_require__(108);
13116 var ReactPropTypeLocations = __webpack_require__(66);
13117
13118 var invariant = __webpack_require__(14);
13119 var warning = __webpack_require__(26);
13120
13121 var hasReadOnlyValue = {
13122 'button': true,
13123 'checkbox': true,
13124 'image': true,
13125 'hidden': true,
13126 'radio': true,
13127 'reset': true,
13128 'submit': true
13129 };
13130
13131 function _assertSingleLink(inputProps) {
13132 !(inputProps.checkedLink == null || inputProps.valueLink == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use ' + 'checkedLink, you probably don\'t want to use valueLink and vice versa.') : invariant(false) : undefined;
13133 }
13134 function _assertValueLink(inputProps) {
13135 _assertSingleLink(inputProps);
13136 !(inputProps.value == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want ' + 'to use value or onChange, you probably don\'t want to use valueLink.') : invariant(false) : undefined;
13137 }
13138
13139 function _assertCheckedLink(inputProps) {
13140 _assertSingleLink(inputProps);
13141 !(inputProps.checked == null && inputProps.onChange == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. ' + 'If you want to use checked or onChange, you probably don\'t want to ' + 'use checkedLink') : invariant(false) : undefined;
13142 }
13143
13144 var propTypes = {
13145 value: function (props, propName, componentName) {
13146 if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
13147 return null;
13148 }
13149 return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
13150 },
13151 checked: function (props, propName, componentName) {
13152 if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
13153 return null;
13154 }
13155 return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
13156 },
13157 onChange: ReactPropTypes.func
13158 };
13159
13160 var loggedTypeFailures = {};
13161 function getDeclarationErrorAddendum(owner) {
13162 if (owner) {
13163 var name = owner.getName();
13164 if (name) {
13165 return ' Check the render method of `' + name + '`.';
13166 }
13167 }
13168 return '';
13169 }
13170
13171 /**
13172 * Provide a linked `value` attribute for controlled forms. You should not use
13173 * this outside of the ReactDOM controlled form components.
13174 */
13175 var LinkedValueUtils = {
13176 checkPropTypes: function (tagName, props, owner) {
13177 for (var propName in propTypes) {
13178 if (propTypes.hasOwnProperty(propName)) {
13179 var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
13180 }
13181 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
13182 // Only monitor this failure once because there tends to be a lot of the
13183 // same error.
13184 loggedTypeFailures[error.message] = true;
13185
13186 var addendum = getDeclarationErrorAddendum(owner);
13187 process.env.NODE_ENV !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : undefined;
13188 }
13189 }
13190 },
13191
13192 /**
13193 * @param {object} inputProps Props for form component
13194 * @return {*} current value of the input either from value prop or link.
13195 */
13196 getValue: function (inputProps) {
13197 if (inputProps.valueLink) {
13198 _assertValueLink(inputProps);
13199 return inputProps.valueLink.value;
13200 }
13201 return inputProps.value;
13202 },
13203
13204 /**
13205 * @param {object} inputProps Props for form component
13206 * @return {*} current checked status of the input either from checked prop
13207 * or link.
13208 */
13209 getChecked: function (inputProps) {
13210 if (inputProps.checkedLink) {
13211 _assertCheckedLink(inputProps);
13212 return inputProps.checkedLink.value;
13213 }
13214 return inputProps.checked;
13215 },
13216
13217 /**
13218 * @param {object} inputProps Props for form component
13219 * @param {SyntheticEvent} event change event to handle
13220 */
13221 executeOnChange: function (inputProps, event) {
13222 if (inputProps.valueLink) {
13223 _assertValueLink(inputProps);
13224 return inputProps.valueLink.requestChange(event.target.value);
13225 } else if (inputProps.checkedLink) {
13226 _assertCheckedLink(inputProps);
13227 return inputProps.checkedLink.requestChange(event.target.checked);
13228 } else if (inputProps.onChange) {
13229 return inputProps.onChange.call(undefined, event);
13230 }
13231 }
13232 };
13233
13234 module.exports = LinkedValueUtils;
13235 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
13236
13237/***/ }),
13238/* 108 */
13239/***/ (function(module, exports, __webpack_require__) {
13240
13241 /**
13242 * Copyright 2013-2015, Facebook, Inc.
13243 * All rights reserved.
13244 *
13245 * This source code is licensed under the BSD-style license found in the
13246 * LICENSE file in the root directory of this source tree. An additional grant
13247 * of patent rights can be found in the PATENTS file in the same directory.
13248 *
13249 * @providesModule ReactPropTypes
13250 */
13251
13252 'use strict';
13253
13254 var ReactElement = __webpack_require__(43);
13255 var ReactPropTypeLocationNames = __webpack_require__(67);
13256
13257 var emptyFunction = __webpack_require__(16);
13258 var getIteratorFn = __webpack_require__(109);
13259
13260 /**
13261 * Collection of methods that allow declaration and validation of props that are
13262 * supplied to React components. Example usage:
13263 *
13264 * var Props = require('ReactPropTypes');
13265 * var MyArticle = React.createClass({
13266 * propTypes: {
13267 * // An optional string prop named "description".
13268 * description: Props.string,
13269 *
13270 * // A required enum prop named "category".
13271 * category: Props.oneOf(['News','Photos']).isRequired,
13272 *
13273 * // A prop named "dialog" that requires an instance of Dialog.
13274 * dialog: Props.instanceOf(Dialog).isRequired
13275 * },
13276 * render: function() { ... }
13277 * });
13278 *
13279 * A more formal specification of how these methods are used:
13280 *
13281 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
13282 * decl := ReactPropTypes.{type}(.isRequired)?
13283 *
13284 * Each and every declaration produces a function with the same signature. This
13285 * allows the creation of custom validation functions. For example:
13286 *
13287 * var MyLink = React.createClass({
13288 * propTypes: {
13289 * // An optional string or URI prop named "href".
13290 * href: function(props, propName, componentName) {
13291 * var propValue = props[propName];
13292 * if (propValue != null && typeof propValue !== 'string' &&
13293 * !(propValue instanceof URI)) {
13294 * return new Error(
13295 * 'Expected a string or an URI for ' + propName + ' in ' +
13296 * componentName
13297 * );
13298 * }
13299 * }
13300 * },
13301 * render: function() {...}
13302 * });
13303 *
13304 * @internal
13305 */
13306
13307 var ANONYMOUS = '<<anonymous>>';
13308
13309 var ReactPropTypes = {
13310 array: createPrimitiveTypeChecker('array'),
13311 bool: createPrimitiveTypeChecker('boolean'),
13312 func: createPrimitiveTypeChecker('function'),
13313 number: createPrimitiveTypeChecker('number'),
13314 object: createPrimitiveTypeChecker('object'),
13315 string: createPrimitiveTypeChecker('string'),
13316
13317 any: createAnyTypeChecker(),
13318 arrayOf: createArrayOfTypeChecker,
13319 element: createElementTypeChecker(),
13320 instanceOf: createInstanceTypeChecker,
13321 node: createNodeChecker(),
13322 objectOf: createObjectOfTypeChecker,
13323 oneOf: createEnumTypeChecker,
13324 oneOfType: createUnionTypeChecker,
13325 shape: createShapeTypeChecker
13326 };
13327
13328 function createChainableTypeChecker(validate) {
13329 function checkType(isRequired, props, propName, componentName, location, propFullName) {
13330 componentName = componentName || ANONYMOUS;
13331 propFullName = propFullName || propName;
13332 if (props[propName] == null) {
13333 var locationName = ReactPropTypeLocationNames[location];
13334 if (isRequired) {
13335 return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
13336 }
13337 return null;
13338 } else {
13339 return validate(props, propName, componentName, location, propFullName);
13340 }
13341 }
13342
13343 var chainedCheckType = checkType.bind(null, false);
13344 chainedCheckType.isRequired = checkType.bind(null, true);
13345
13346 return chainedCheckType;
13347 }
13348
13349 function createPrimitiveTypeChecker(expectedType) {
13350 function validate(props, propName, componentName, location, propFullName) {
13351 var propValue = props[propName];
13352 var propType = getPropType(propValue);
13353 if (propType !== expectedType) {
13354 var locationName = ReactPropTypeLocationNames[location];
13355 // `propValue` being instance of, say, date/regexp, pass the 'object'
13356 // check, but we can offer a more precise error message here rather than
13357 // 'of type `object`'.
13358 var preciseType = getPreciseType(propValue);
13359
13360 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
13361 }
13362 return null;
13363 }
13364 return createChainableTypeChecker(validate);
13365 }
13366
13367 function createAnyTypeChecker() {
13368 return createChainableTypeChecker(emptyFunction.thatReturns(null));
13369 }
13370
13371 function createArrayOfTypeChecker(typeChecker) {
13372 function validate(props, propName, componentName, location, propFullName) {
13373 var propValue = props[propName];
13374 if (!Array.isArray(propValue)) {
13375 var locationName = ReactPropTypeLocationNames[location];
13376 var propType = getPropType(propValue);
13377 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
13378 }
13379 for (var i = 0; i < propValue.length; i++) {
13380 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
13381 if (error instanceof Error) {
13382 return error;
13383 }
13384 }
13385 return null;
13386 }
13387 return createChainableTypeChecker(validate);
13388 }
13389
13390 function createElementTypeChecker() {
13391 function validate(props, propName, componentName, location, propFullName) {
13392 if (!ReactElement.isValidElement(props[propName])) {
13393 var locationName = ReactPropTypeLocationNames[location];
13394 return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.'));
13395 }
13396 return null;
13397 }
13398 return createChainableTypeChecker(validate);
13399 }
13400
13401 function createInstanceTypeChecker(expectedClass) {
13402 function validate(props, propName, componentName, location, propFullName) {
13403 if (!(props[propName] instanceof expectedClass)) {
13404 var locationName = ReactPropTypeLocationNames[location];
13405 var expectedClassName = expectedClass.name || ANONYMOUS;
13406 var actualClassName = getClassName(props[propName]);
13407 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
13408 }
13409 return null;
13410 }
13411 return createChainableTypeChecker(validate);
13412 }
13413
13414 function createEnumTypeChecker(expectedValues) {
13415 if (!Array.isArray(expectedValues)) {
13416 return createChainableTypeChecker(function () {
13417 return new Error('Invalid argument supplied to oneOf, expected an instance of array.');
13418 });
13419 }
13420
13421 function validate(props, propName, componentName, location, propFullName) {
13422 var propValue = props[propName];
13423 for (var i = 0; i < expectedValues.length; i++) {
13424 if (propValue === expectedValues[i]) {
13425 return null;
13426 }
13427 }
13428
13429 var locationName = ReactPropTypeLocationNames[location];
13430 var valuesString = JSON.stringify(expectedValues);
13431 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
13432 }
13433 return createChainableTypeChecker(validate);
13434 }
13435
13436 function createObjectOfTypeChecker(typeChecker) {
13437 function validate(props, propName, componentName, location, propFullName) {
13438 var propValue = props[propName];
13439 var propType = getPropType(propValue);
13440 if (propType !== 'object') {
13441 var locationName = ReactPropTypeLocationNames[location];
13442 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
13443 }
13444 for (var key in propValue) {
13445 if (propValue.hasOwnProperty(key)) {
13446 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
13447 if (error instanceof Error) {
13448 return error;
13449 }
13450 }
13451 }
13452 return null;
13453 }
13454 return createChainableTypeChecker(validate);
13455 }
13456
13457 function createUnionTypeChecker(arrayOfTypeCheckers) {
13458 if (!Array.isArray(arrayOfTypeCheckers)) {
13459 return createChainableTypeChecker(function () {
13460 return new Error('Invalid argument supplied to oneOfType, expected an instance of array.');
13461 });
13462 }
13463
13464 function validate(props, propName, componentName, location, propFullName) {
13465 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
13466 var checker = arrayOfTypeCheckers[i];
13467 if (checker(props, propName, componentName, location, propFullName, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED') == null) {
13468 return null;
13469 }
13470 }
13471
13472 var locationName = ReactPropTypeLocationNames[location];
13473 return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
13474 }
13475 return createChainableTypeChecker(validate);
13476 }
13477
13478 function createNodeChecker() {
13479 function validate(props, propName, componentName, location, propFullName) {
13480 if (!isNode(props[propName])) {
13481 var locationName = ReactPropTypeLocationNames[location];
13482 return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
13483 }
13484 return null;
13485 }
13486 return createChainableTypeChecker(validate);
13487 }
13488
13489 function createShapeTypeChecker(shapeTypes) {
13490 function validate(props, propName, componentName, location, propFullName) {
13491 var propValue = props[propName];
13492 var propType = getPropType(propValue);
13493 if (propType !== 'object') {
13494 var locationName = ReactPropTypeLocationNames[location];
13495 return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
13496 }
13497 for (var key in shapeTypes) {
13498 var checker = shapeTypes[key];
13499 if (!checker) {
13500 continue;
13501 }
13502 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
13503 if (error) {
13504 return error;
13505 }
13506 }
13507 return null;
13508 }
13509 return createChainableTypeChecker(validate);
13510 }
13511
13512 function isNode(propValue) {
13513 switch (typeof propValue) {
13514 case 'number':
13515 case 'string':
13516 case 'undefined':
13517 return true;
13518 case 'boolean':
13519 return !propValue;
13520 case 'object':
13521 if (Array.isArray(propValue)) {
13522 return propValue.every(isNode);
13523 }
13524 if (propValue === null || ReactElement.isValidElement(propValue)) {
13525 return true;
13526 }
13527
13528 var iteratorFn = getIteratorFn(propValue);
13529 if (iteratorFn) {
13530 var iterator = iteratorFn.call(propValue);
13531 var step;
13532 if (iteratorFn !== propValue.entries) {
13533 while (!(step = iterator.next()).done) {
13534 if (!isNode(step.value)) {
13535 return false;
13536 }
13537 }
13538 } else {
13539 // Iterator will provide entry [k,v] tuples rather than values.
13540 while (!(step = iterator.next()).done) {
13541 var entry = step.value;
13542 if (entry) {
13543 if (!isNode(entry[1])) {
13544 return false;
13545 }
13546 }
13547 }
13548 }
13549 } else {
13550 return false;
13551 }
13552
13553 return true;
13554 default:
13555 return false;
13556 }
13557 }
13558
13559 // Equivalent of `typeof` but with special handling for array and regexp.
13560 function getPropType(propValue) {
13561 var propType = typeof propValue;
13562 if (Array.isArray(propValue)) {
13563 return 'array';
13564 }
13565 if (propValue instanceof RegExp) {
13566 // Old webkits (at least until Android 4.0) return 'function' rather than
13567 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
13568 // passes PropTypes.object.
13569 return 'object';
13570 }
13571 return propType;
13572 }
13573
13574 // This handles more types than `getPropType`. Only used for error messages.
13575 // See `createPrimitiveTypeChecker`.
13576 function getPreciseType(propValue) {
13577 var propType = getPropType(propValue);
13578 if (propType === 'object') {
13579 if (propValue instanceof Date) {
13580 return 'date';
13581 } else if (propValue instanceof RegExp) {
13582 return 'regexp';
13583 }
13584 }
13585 return propType;
13586 }
13587
13588 // Returns class name of the object, if any.
13589 function getClassName(propValue) {
13590 if (!propValue.constructor || !propValue.constructor.name) {
13591 return '<<anonymous>>';
13592 }
13593 return propValue.constructor.name;
13594 }
13595
13596 module.exports = ReactPropTypes;
13597
13598/***/ }),
13599/* 109 */
13600/***/ (function(module, exports) {
13601
13602 /**
13603 * Copyright 2013-2015, Facebook, Inc.
13604 * All rights reserved.
13605 *
13606 * This source code is licensed under the BSD-style license found in the
13607 * LICENSE file in the root directory of this source tree. An additional grant
13608 * of patent rights can be found in the PATENTS file in the same directory.
13609 *
13610 * @providesModule getIteratorFn
13611 * @typechecks static-only
13612 */
13613
13614 'use strict';
13615
13616 /* global Symbol */
13617 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
13618 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
13619
13620 /**
13621 * Returns the iterator method function contained on the iterable object.
13622 *
13623 * Be sure to invoke the function with the iterable as context:
13624 *
13625 * var iteratorFn = getIteratorFn(myIterable);
13626 * if (iteratorFn) {
13627 * var iterator = iteratorFn.call(myIterable);
13628 * ...
13629 * }
13630 *
13631 * @param {?object} maybeIterable
13632 * @return {?function}
13633 */
13634 function getIteratorFn(maybeIterable) {
13635 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
13636 if (typeof iteratorFn === 'function') {
13637 return iteratorFn;
13638 }
13639 }
13640
13641 module.exports = getIteratorFn;
13642
13643/***/ }),
13644/* 110 */
13645/***/ (function(module, exports, __webpack_require__) {
13646
13647 /* WEBPACK VAR INJECTION */(function(process) {/**
13648 * Copyright 2013-2015, Facebook, Inc.
13649 * All rights reserved.
13650 *
13651 * This source code is licensed under the BSD-style license found in the
13652 * LICENSE file in the root directory of this source tree. An additional grant
13653 * of patent rights can be found in the PATENTS file in the same directory.
13654 *
13655 * @providesModule ReactDOMOption
13656 */
13657
13658 'use strict';
13659
13660 var ReactChildren = __webpack_require__(111);
13661 var ReactDOMSelect = __webpack_require__(113);
13662
13663 var assign = __webpack_require__(40);
13664 var warning = __webpack_require__(26);
13665
13666 var valueContextKey = ReactDOMSelect.valueContextKey;
13667
13668 /**
13669 * Implements an <option> native component that warns when `selected` is set.
13670 */
13671 var ReactDOMOption = {
13672 mountWrapper: function (inst, props, context) {
13673 // TODO (yungsters): Remove support for `selected` in <option>.
13674 if (process.env.NODE_ENV !== 'production') {
13675 process.env.NODE_ENV !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : undefined;
13676 }
13677
13678 // Look up whether this option is 'selected' via context
13679 var selectValue = context[valueContextKey];
13680
13681 // If context key is null (e.g., no specified value or after initial mount)
13682 // or missing (e.g., for <datalist>), we don't change props.selected
13683 var selected = null;
13684 if (selectValue != null) {
13685 selected = false;
13686 if (Array.isArray(selectValue)) {
13687 // multiple
13688 for (var i = 0; i < selectValue.length; i++) {
13689 if ('' + selectValue[i] === '' + props.value) {
13690 selected = true;
13691 break;
13692 }
13693 }
13694 } else {
13695 selected = '' + selectValue === '' + props.value;
13696 }
13697 }
13698
13699 inst._wrapperState = { selected: selected };
13700 },
13701
13702 getNativeProps: function (inst, props, context) {
13703 var nativeProps = assign({ selected: undefined, children: undefined }, props);
13704
13705 // Read state only from initial mount because <select> updates value
13706 // manually; we need the initial state only for server rendering
13707 if (inst._wrapperState.selected != null) {
13708 nativeProps.selected = inst._wrapperState.selected;
13709 }
13710
13711 var content = '';
13712
13713 // Flatten children and warn if they aren't strings or numbers;
13714 // invalid types are ignored.
13715 ReactChildren.forEach(props.children, function (child) {
13716 if (child == null) {
13717 return;
13718 }
13719 if (typeof child === 'string' || typeof child === 'number') {
13720 content += child;
13721 } else {
13722 process.env.NODE_ENV !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : undefined;
13723 }
13724 });
13725
13726 if (content) {
13727 nativeProps.children = content;
13728 }
13729
13730 return nativeProps;
13731 }
13732
13733 };
13734
13735 module.exports = ReactDOMOption;
13736 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
13737
13738/***/ }),
13739/* 111 */
13740/***/ (function(module, exports, __webpack_require__) {
13741
13742 /**
13743 * Copyright 2013-2015, Facebook, Inc.
13744 * All rights reserved.
13745 *
13746 * This source code is licensed under the BSD-style license found in the
13747 * LICENSE file in the root directory of this source tree. An additional grant
13748 * of patent rights can be found in the PATENTS file in the same directory.
13749 *
13750 * @providesModule ReactChildren
13751 */
13752
13753 'use strict';
13754
13755 var PooledClass = __webpack_require__(57);
13756 var ReactElement = __webpack_require__(43);
13757
13758 var emptyFunction = __webpack_require__(16);
13759 var traverseAllChildren = __webpack_require__(112);
13760
13761 var twoArgumentPooler = PooledClass.twoArgumentPooler;
13762 var fourArgumentPooler = PooledClass.fourArgumentPooler;
13763
13764 var userProvidedKeyEscapeRegex = /\/(?!\/)/g;
13765 function escapeUserProvidedKey(text) {
13766 return ('' + text).replace(userProvidedKeyEscapeRegex, '//');
13767 }
13768
13769 /**
13770 * PooledClass representing the bookkeeping associated with performing a child
13771 * traversal. Allows avoiding binding callbacks.
13772 *
13773 * @constructor ForEachBookKeeping
13774 * @param {!function} forEachFunction Function to perform traversal with.
13775 * @param {?*} forEachContext Context to perform context with.
13776 */
13777 function ForEachBookKeeping(forEachFunction, forEachContext) {
13778 this.func = forEachFunction;
13779 this.context = forEachContext;
13780 this.count = 0;
13781 }
13782 ForEachBookKeeping.prototype.destructor = function () {
13783 this.func = null;
13784 this.context = null;
13785 this.count = 0;
13786 };
13787 PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
13788
13789 function forEachSingleChild(bookKeeping, child, name) {
13790 var func = bookKeeping.func;
13791 var context = bookKeeping.context;
13792
13793 func.call(context, child, bookKeeping.count++);
13794 }
13795
13796 /**
13797 * Iterates through children that are typically specified as `props.children`.
13798 *
13799 * The provided forEachFunc(child, index) will be called for each
13800 * leaf child.
13801 *
13802 * @param {?*} children Children tree container.
13803 * @param {function(*, int)} forEachFunc
13804 * @param {*} forEachContext Context for forEachContext.
13805 */
13806 function forEachChildren(children, forEachFunc, forEachContext) {
13807 if (children == null) {
13808 return children;
13809 }
13810 var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
13811 traverseAllChildren(children, forEachSingleChild, traverseContext);
13812 ForEachBookKeeping.release(traverseContext);
13813 }
13814
13815 /**
13816 * PooledClass representing the bookkeeping associated with performing a child
13817 * mapping. Allows avoiding binding callbacks.
13818 *
13819 * @constructor MapBookKeeping
13820 * @param {!*} mapResult Object containing the ordered map of results.
13821 * @param {!function} mapFunction Function to perform mapping with.
13822 * @param {?*} mapContext Context to perform mapping with.
13823 */
13824 function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
13825 this.result = mapResult;
13826 this.keyPrefix = keyPrefix;
13827 this.func = mapFunction;
13828 this.context = mapContext;
13829 this.count = 0;
13830 }
13831 MapBookKeeping.prototype.destructor = function () {
13832 this.result = null;
13833 this.keyPrefix = null;
13834 this.func = null;
13835 this.context = null;
13836 this.count = 0;
13837 };
13838 PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
13839
13840 function mapSingleChildIntoContext(bookKeeping, child, childKey) {
13841 var result = bookKeeping.result;
13842 var keyPrefix = bookKeeping.keyPrefix;
13843 var func = bookKeeping.func;
13844 var context = bookKeeping.context;
13845
13846 var mappedChild = func.call(context, child, bookKeeping.count++);
13847 if (Array.isArray(mappedChild)) {
13848 mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
13849 } else if (mappedChild != null) {
13850 if (ReactElement.isValidElement(mappedChild)) {
13851 mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
13852 // Keep both the (mapped) and old keys if they differ, just as
13853 // traverseAllChildren used to do for objects as children
13854 keyPrefix + (mappedChild !== child ? escapeUserProvidedKey(mappedChild.key || '') + '/' : '') + childKey);
13855 }
13856 result.push(mappedChild);
13857 }
13858 }
13859
13860 function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
13861 var escapedPrefix = '';
13862 if (prefix != null) {
13863 escapedPrefix = escapeUserProvidedKey(prefix) + '/';
13864 }
13865 var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
13866 traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
13867 MapBookKeeping.release(traverseContext);
13868 }
13869
13870 /**
13871 * Maps children that are typically specified as `props.children`.
13872 *
13873 * The provided mapFunction(child, key, index) will be called for each
13874 * leaf child.
13875 *
13876 * @param {?*} children Children tree container.
13877 * @param {function(*, int)} func The map function.
13878 * @param {*} context Context for mapFunction.
13879 * @return {object} Object containing the ordered map of results.
13880 */
13881 function mapChildren(children, func, context) {
13882 if (children == null) {
13883 return children;
13884 }
13885 var result = [];
13886 mapIntoWithKeyPrefixInternal(children, result, null, func, context);
13887 return result;
13888 }
13889
13890 function forEachSingleChildDummy(traverseContext, child, name) {
13891 return null;
13892 }
13893
13894 /**
13895 * Count the number of children that are typically specified as
13896 * `props.children`.
13897 *
13898 * @param {?*} children Children tree container.
13899 * @return {number} The number of children.
13900 */
13901 function countChildren(children, context) {
13902 return traverseAllChildren(children, forEachSingleChildDummy, null);
13903 }
13904
13905 /**
13906 * Flatten a children object (typically specified as `props.children`) and
13907 * return an array with appropriately re-keyed children.
13908 */
13909 function toArray(children) {
13910 var result = [];
13911 mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
13912 return result;
13913 }
13914
13915 var ReactChildren = {
13916 forEach: forEachChildren,
13917 map: mapChildren,
13918 mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
13919 count: countChildren,
13920 toArray: toArray
13921 };
13922
13923 module.exports = ReactChildren;
13924
13925/***/ }),
13926/* 112 */
13927/***/ (function(module, exports, __webpack_require__) {
13928
13929 /* WEBPACK VAR INJECTION */(function(process) {/**
13930 * Copyright 2013-2015, Facebook, Inc.
13931 * All rights reserved.
13932 *
13933 * This source code is licensed under the BSD-style license found in the
13934 * LICENSE file in the root directory of this source tree. An additional grant
13935 * of patent rights can be found in the PATENTS file in the same directory.
13936 *
13937 * @providesModule traverseAllChildren
13938 */
13939
13940 'use strict';
13941
13942 var ReactCurrentOwner = __webpack_require__(6);
13943 var ReactElement = __webpack_require__(43);
13944 var ReactInstanceHandles = __webpack_require__(46);
13945
13946 var getIteratorFn = __webpack_require__(109);
13947 var invariant = __webpack_require__(14);
13948 var warning = __webpack_require__(26);
13949
13950 var SEPARATOR = ReactInstanceHandles.SEPARATOR;
13951 var SUBSEPARATOR = ':';
13952
13953 /**
13954 * TODO: Test that a single child and an array with one item have the same key
13955 * pattern.
13956 */
13957
13958 var userProvidedKeyEscaperLookup = {
13959 '=': '=0',
13960 '.': '=1',
13961 ':': '=2'
13962 };
13963
13964 var userProvidedKeyEscapeRegex = /[=.:]/g;
13965
13966 var didWarnAboutMaps = false;
13967
13968 function userProvidedKeyEscaper(match) {
13969 return userProvidedKeyEscaperLookup[match];
13970 }
13971
13972 /**
13973 * Generate a key string that identifies a component within a set.
13974 *
13975 * @param {*} component A component that could contain a manual key.
13976 * @param {number} index Index that is used if a manual key is not provided.
13977 * @return {string}
13978 */
13979 function getComponentKey(component, index) {
13980 if (component && component.key != null) {
13981 // Explicit key
13982 return wrapUserProvidedKey(component.key);
13983 }
13984 // Implicit key determined by the index in the set
13985 return index.toString(36);
13986 }
13987
13988 /**
13989 * Escape a component key so that it is safe to use in a reactid.
13990 *
13991 * @param {*} text Component key to be escaped.
13992 * @return {string} An escaped string.
13993 */
13994 function escapeUserProvidedKey(text) {
13995 return ('' + text).replace(userProvidedKeyEscapeRegex, userProvidedKeyEscaper);
13996 }
13997
13998 /**
13999 * Wrap a `key` value explicitly provided by the user to distinguish it from
14000 * implicitly-generated keys generated by a component's index in its parent.
14001 *
14002 * @param {string} key Value of a user-provided `key` attribute
14003 * @return {string}
14004 */
14005 function wrapUserProvidedKey(key) {
14006 return '$' + escapeUserProvidedKey(key);
14007 }
14008
14009 /**
14010 * @param {?*} children Children tree container.
14011 * @param {!string} nameSoFar Name of the key path so far.
14012 * @param {!function} callback Callback to invoke with each child found.
14013 * @param {?*} traverseContext Used to pass information throughout the traversal
14014 * process.
14015 * @return {!number} The number of children in this subtree.
14016 */
14017 function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
14018 var type = typeof children;
14019
14020 if (type === 'undefined' || type === 'boolean') {
14021 // All of the above are perceived as null.
14022 children = null;
14023 }
14024
14025 if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
14026 callback(traverseContext, children,
14027 // If it's the only child, treat the name as if it was wrapped in an array
14028 // so that it's consistent if the number of children grows.
14029 nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
14030 return 1;
14031 }
14032
14033 var child;
14034 var nextName;
14035 var subtreeCount = 0; // Count of children found in the current subtree.
14036 var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
14037
14038 if (Array.isArray(children)) {
14039 for (var i = 0; i < children.length; i++) {
14040 child = children[i];
14041 nextName = nextNamePrefix + getComponentKey(child, i);
14042 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
14043 }
14044 } else {
14045 var iteratorFn = getIteratorFn(children);
14046 if (iteratorFn) {
14047 var iterator = iteratorFn.call(children);
14048 var step;
14049 if (iteratorFn !== children.entries) {
14050 var ii = 0;
14051 while (!(step = iterator.next()).done) {
14052 child = step.value;
14053 nextName = nextNamePrefix + getComponentKey(child, ii++);
14054 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
14055 }
14056 } else {
14057 if (process.env.NODE_ENV !== 'production') {
14058 process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.') : undefined;
14059 didWarnAboutMaps = true;
14060 }
14061 // Iterator will provide entry [k,v] tuples rather than values.
14062 while (!(step = iterator.next()).done) {
14063 var entry = step.value;
14064 if (entry) {
14065 child = entry[1];
14066 nextName = nextNamePrefix + wrapUserProvidedKey(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
14067 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
14068 }
14069 }
14070 }
14071 } else if (type === 'object') {
14072 var addendum = '';
14073 if (process.env.NODE_ENV !== 'production') {
14074 addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.';
14075 if (children._isReactElement) {
14076 addendum = ' It looks like you\'re using an element created by a different ' + 'version of React. Make sure to use only one copy of React.';
14077 }
14078 if (ReactCurrentOwner.current) {
14079 var name = ReactCurrentOwner.current.getName();
14080 if (name) {
14081 addendum += ' Check the render method of `' + name + '`.';
14082 }
14083 }
14084 }
14085 var childrenString = String(children);
14086 true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : invariant(false) : undefined;
14087 }
14088 }
14089
14090 return subtreeCount;
14091 }
14092
14093 /**
14094 * Traverses children that are typically specified as `props.children`, but
14095 * might also be specified through attributes:
14096 *
14097 * - `traverseAllChildren(this.props.children, ...)`
14098 * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
14099 *
14100 * The `traverseContext` is an optional argument that is passed through the
14101 * entire traversal. It can be used to store accumulations or anything else that
14102 * the callback might find relevant.
14103 *
14104 * @param {?*} children Children tree object.
14105 * @param {!function} callback To invoke upon traversing each child.
14106 * @param {?*} traverseContext Context for traversal.
14107 * @return {!number} The number of children in this subtree.
14108 */
14109 function traverseAllChildren(children, callback, traverseContext) {
14110 if (children == null) {
14111 return 0;
14112 }
14113
14114 return traverseAllChildrenImpl(children, '', callback, traverseContext);
14115 }
14116
14117 module.exports = traverseAllChildren;
14118 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
14119
14120/***/ }),
14121/* 113 */
14122/***/ (function(module, exports, __webpack_require__) {
14123
14124 /* WEBPACK VAR INJECTION */(function(process) {/**
14125 * Copyright 2013-2015, Facebook, Inc.
14126 * All rights reserved.
14127 *
14128 * This source code is licensed under the BSD-style license found in the
14129 * LICENSE file in the root directory of this source tree. An additional grant
14130 * of patent rights can be found in the PATENTS file in the same directory.
14131 *
14132 * @providesModule ReactDOMSelect
14133 */
14134
14135 'use strict';
14136
14137 var LinkedValueUtils = __webpack_require__(107);
14138 var ReactMount = __webpack_require__(29);
14139 var ReactUpdates = __webpack_require__(55);
14140
14141 var assign = __webpack_require__(40);
14142 var warning = __webpack_require__(26);
14143
14144 var valueContextKey = '__ReactDOMSelect_value$' + Math.random().toString(36).slice(2);
14145
14146 function updateOptionsIfPendingUpdateAndMounted() {
14147 if (this._rootNodeID && this._wrapperState.pendingUpdate) {
14148 this._wrapperState.pendingUpdate = false;
14149
14150 var props = this._currentElement.props;
14151 var value = LinkedValueUtils.getValue(props);
14152
14153 if (value != null) {
14154 updateOptions(this, Boolean(props.multiple), value);
14155 }
14156 }
14157 }
14158
14159 function getDeclarationErrorAddendum(owner) {
14160 if (owner) {
14161 var name = owner.getName();
14162 if (name) {
14163 return ' Check the render method of `' + name + '`.';
14164 }
14165 }
14166 return '';
14167 }
14168
14169 var valuePropNames = ['value', 'defaultValue'];
14170
14171 /**
14172 * Validation function for `value` and `defaultValue`.
14173 * @private
14174 */
14175 function checkSelectPropTypes(inst, props) {
14176 var owner = inst._currentElement._owner;
14177 LinkedValueUtils.checkPropTypes('select', props, owner);
14178
14179 for (var i = 0; i < valuePropNames.length; i++) {
14180 var propName = valuePropNames[i];
14181 if (props[propName] == null) {
14182 continue;
14183 }
14184 if (props.multiple) {
14185 process.env.NODE_ENV !== 'production' ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;
14186 } else {
14187 process.env.NODE_ENV !== 'production' ? warning(!Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : undefined;
14188 }
14189 }
14190 }
14191
14192 /**
14193 * @param {ReactDOMComponent} inst
14194 * @param {boolean} multiple
14195 * @param {*} propValue A stringable (with `multiple`, a list of stringables).
14196 * @private
14197 */
14198 function updateOptions(inst, multiple, propValue) {
14199 var selectedValue, i;
14200 var options = ReactMount.getNode(inst._rootNodeID).options;
14201
14202 if (multiple) {
14203 selectedValue = {};
14204 for (i = 0; i < propValue.length; i++) {
14205 selectedValue['' + propValue[i]] = true;
14206 }
14207 for (i = 0; i < options.length; i++) {
14208 var selected = selectedValue.hasOwnProperty(options[i].value);
14209 if (options[i].selected !== selected) {
14210 options[i].selected = selected;
14211 }
14212 }
14213 } else {
14214 // Do not set `select.value` as exact behavior isn't consistent across all
14215 // browsers for all cases.
14216 selectedValue = '' + propValue;
14217 for (i = 0; i < options.length; i++) {
14218 if (options[i].value === selectedValue) {
14219 options[i].selected = true;
14220 return;
14221 }
14222 }
14223 if (options.length) {
14224 options[0].selected = true;
14225 }
14226 }
14227 }
14228
14229 /**
14230 * Implements a <select> native component that allows optionally setting the
14231 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
14232 * stringable. If `multiple` is true, the prop must be an array of stringables.
14233 *
14234 * If `value` is not supplied (or null/undefined), user actions that change the
14235 * selected option will trigger updates to the rendered options.
14236 *
14237 * If it is supplied (and not null/undefined), the rendered options will not
14238 * update in response to user actions. Instead, the `value` prop must change in
14239 * order for the rendered options to update.
14240 *
14241 * If `defaultValue` is provided, any options with the supplied values will be
14242 * selected.
14243 */
14244 var ReactDOMSelect = {
14245 valueContextKey: valueContextKey,
14246
14247 getNativeProps: function (inst, props, context) {
14248 return assign({}, props, {
14249 onChange: inst._wrapperState.onChange,
14250 value: undefined
14251 });
14252 },
14253
14254 mountWrapper: function (inst, props) {
14255 if (process.env.NODE_ENV !== 'production') {
14256 checkSelectPropTypes(inst, props);
14257 }
14258
14259 var value = LinkedValueUtils.getValue(props);
14260 inst._wrapperState = {
14261 pendingUpdate: false,
14262 initialValue: value != null ? value : props.defaultValue,
14263 onChange: _handleChange.bind(inst),
14264 wasMultiple: Boolean(props.multiple)
14265 };
14266 },
14267
14268 processChildContext: function (inst, props, context) {
14269 // Pass down initial value so initial generated markup has correct
14270 // `selected` attributes
14271 var childContext = assign({}, context);
14272 childContext[valueContextKey] = inst._wrapperState.initialValue;
14273 return childContext;
14274 },
14275
14276 postUpdateWrapper: function (inst) {
14277 var props = inst._currentElement.props;
14278
14279 // After the initial mount, we control selected-ness manually so don't pass
14280 // the context value down
14281 inst._wrapperState.initialValue = undefined;
14282
14283 var wasMultiple = inst._wrapperState.wasMultiple;
14284 inst._wrapperState.wasMultiple = Boolean(props.multiple);
14285
14286 var value = LinkedValueUtils.getValue(props);
14287 if (value != null) {
14288 inst._wrapperState.pendingUpdate = false;
14289 updateOptions(inst, Boolean(props.multiple), value);
14290 } else if (wasMultiple !== Boolean(props.multiple)) {
14291 // For simplicity, reapply `defaultValue` if `multiple` is toggled.
14292 if (props.defaultValue != null) {
14293 updateOptions(inst, Boolean(props.multiple), props.defaultValue);
14294 } else {
14295 // Revert the select back to its default unselected state.
14296 updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
14297 }
14298 }
14299 }
14300 };
14301
14302 function _handleChange(event) {
14303 var props = this._currentElement.props;
14304 var returnValue = LinkedValueUtils.executeOnChange(props, event);
14305
14306 this._wrapperState.pendingUpdate = true;
14307 ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
14308 return returnValue;
14309 }
14310
14311 module.exports = ReactDOMSelect;
14312 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
14313
14314/***/ }),
14315/* 114 */
14316/***/ (function(module, exports, __webpack_require__) {
14317
14318 /* WEBPACK VAR INJECTION */(function(process) {/**
14319 * Copyright 2013-2015, Facebook, Inc.
14320 * All rights reserved.
14321 *
14322 * This source code is licensed under the BSD-style license found in the
14323 * LICENSE file in the root directory of this source tree. An additional grant
14324 * of patent rights can be found in the PATENTS file in the same directory.
14325 *
14326 * @providesModule ReactDOMTextarea
14327 */
14328
14329 'use strict';
14330
14331 var LinkedValueUtils = __webpack_require__(107);
14332 var ReactDOMIDOperations = __webpack_require__(28);
14333 var ReactUpdates = __webpack_require__(55);
14334
14335 var assign = __webpack_require__(40);
14336 var invariant = __webpack_require__(14);
14337 var warning = __webpack_require__(26);
14338
14339 function forceUpdateIfMounted() {
14340 if (this._rootNodeID) {
14341 // DOM component is still mounted; update
14342 ReactDOMTextarea.updateWrapper(this);
14343 }
14344 }
14345
14346 /**
14347 * Implements a <textarea> native component that allows setting `value`, and
14348 * `defaultValue`. This differs from the traditional DOM API because value is
14349 * usually set as PCDATA children.
14350 *
14351 * If `value` is not supplied (or null/undefined), user actions that affect the
14352 * value will trigger updates to the element.
14353 *
14354 * If `value` is supplied (and not null/undefined), the rendered element will
14355 * not trigger updates to the element. Instead, the `value` prop must change in
14356 * order for the rendered element to be updated.
14357 *
14358 * The rendered element will be initialized with an empty value, the prop
14359 * `defaultValue` if specified, or the children content (deprecated).
14360 */
14361 var ReactDOMTextarea = {
14362 getNativeProps: function (inst, props, context) {
14363 !(props.dangerouslySetInnerHTML == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : invariant(false) : undefined;
14364
14365 // Always set children to the same thing. In IE9, the selection range will
14366 // get reset if `textContent` is mutated.
14367 var nativeProps = assign({}, props, {
14368 defaultValue: undefined,
14369 value: undefined,
14370 children: inst._wrapperState.initialValue,
14371 onChange: inst._wrapperState.onChange
14372 });
14373
14374 return nativeProps;
14375 },
14376
14377 mountWrapper: function (inst, props) {
14378 if (process.env.NODE_ENV !== 'production') {
14379 LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
14380 }
14381
14382 var defaultValue = props.defaultValue;
14383 // TODO (yungsters): Remove support for children content in <textarea>.
14384 var children = props.children;
14385 if (children != null) {
14386 if (process.env.NODE_ENV !== 'production') {
14387 process.env.NODE_ENV !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : undefined;
14388 }
14389 !(defaultValue == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : invariant(false) : undefined;
14390 if (Array.isArray(children)) {
14391 !(children.length <= 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : invariant(false) : undefined;
14392 children = children[0];
14393 }
14394
14395 defaultValue = '' + children;
14396 }
14397 if (defaultValue == null) {
14398 defaultValue = '';
14399 }
14400 var value = LinkedValueUtils.getValue(props);
14401
14402 inst._wrapperState = {
14403 // We save the initial value so that `ReactDOMComponent` doesn't update
14404 // `textContent` (unnecessary since we update value).
14405 // The initial value can be a boolean or object so that's why it's
14406 // forced to be a string.
14407 initialValue: '' + (value != null ? value : defaultValue),
14408 onChange: _handleChange.bind(inst)
14409 };
14410 },
14411
14412 updateWrapper: function (inst) {
14413 var props = inst._currentElement.props;
14414 var value = LinkedValueUtils.getValue(props);
14415 if (value != null) {
14416 // Cast `value` to a string to ensure the value is set correctly. While
14417 // browsers typically do this as necessary, jsdom doesn't.
14418 ReactDOMIDOperations.updatePropertyByID(inst._rootNodeID, 'value', '' + value);
14419 }
14420 }
14421 };
14422
14423 function _handleChange(event) {
14424 var props = this._currentElement.props;
14425 var returnValue = LinkedValueUtils.executeOnChange(props, event);
14426 ReactUpdates.asap(forceUpdateIfMounted, this);
14427 return returnValue;
14428 }
14429
14430 module.exports = ReactDOMTextarea;
14431 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
14432
14433/***/ }),
14434/* 115 */
14435/***/ (function(module, exports, __webpack_require__) {
14436
14437 /* WEBPACK VAR INJECTION */(function(process) {/**
14438 * Copyright 2013-2015, Facebook, Inc.
14439 * All rights reserved.
14440 *
14441 * This source code is licensed under the BSD-style license found in the
14442 * LICENSE file in the root directory of this source tree. An additional grant
14443 * of patent rights can be found in the PATENTS file in the same directory.
14444 *
14445 * @providesModule ReactMultiChild
14446 * @typechecks static-only
14447 */
14448
14449 'use strict';
14450
14451 var ReactComponentEnvironment = __webpack_require__(65);
14452 var ReactMultiChildUpdateTypes = __webpack_require__(17);
14453
14454 var ReactCurrentOwner = __webpack_require__(6);
14455 var ReactReconciler = __webpack_require__(51);
14456 var ReactChildReconciler = __webpack_require__(116);
14457
14458 var flattenChildren = __webpack_require__(117);
14459
14460 /**
14461 * Updating children of a component may trigger recursive updates. The depth is
14462 * used to batch recursive updates to render markup more efficiently.
14463 *
14464 * @type {number}
14465 * @private
14466 */
14467 var updateDepth = 0;
14468
14469 /**
14470 * Queue of update configuration objects.
14471 *
14472 * Each object has a `type` property that is in `ReactMultiChildUpdateTypes`.
14473 *
14474 * @type {array<object>}
14475 * @private
14476 */
14477 var updateQueue = [];
14478
14479 /**
14480 * Queue of markup to be rendered.
14481 *
14482 * @type {array<string>}
14483 * @private
14484 */
14485 var markupQueue = [];
14486
14487 /**
14488 * Enqueues markup to be rendered and inserted at a supplied index.
14489 *
14490 * @param {string} parentID ID of the parent component.
14491 * @param {string} markup Markup that renders into an element.
14492 * @param {number} toIndex Destination index.
14493 * @private
14494 */
14495 function enqueueInsertMarkup(parentID, markup, toIndex) {
14496 // NOTE: Null values reduce hidden classes.
14497 updateQueue.push({
14498 parentID: parentID,
14499 parentNode: null,
14500 type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
14501 markupIndex: markupQueue.push(markup) - 1,
14502 content: null,
14503 fromIndex: null,
14504 toIndex: toIndex
14505 });
14506 }
14507
14508 /**
14509 * Enqueues moving an existing element to another index.
14510 *
14511 * @param {string} parentID ID of the parent component.
14512 * @param {number} fromIndex Source index of the existing element.
14513 * @param {number} toIndex Destination index of the element.
14514 * @private
14515 */
14516 function enqueueMove(parentID, fromIndex, toIndex) {
14517 // NOTE: Null values reduce hidden classes.
14518 updateQueue.push({
14519 parentID: parentID,
14520 parentNode: null,
14521 type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
14522 markupIndex: null,
14523 content: null,
14524 fromIndex: fromIndex,
14525 toIndex: toIndex
14526 });
14527 }
14528
14529 /**
14530 * Enqueues removing an element at an index.
14531 *
14532 * @param {string} parentID ID of the parent component.
14533 * @param {number} fromIndex Index of the element to remove.
14534 * @private
14535 */
14536 function enqueueRemove(parentID, fromIndex) {
14537 // NOTE: Null values reduce hidden classes.
14538 updateQueue.push({
14539 parentID: parentID,
14540 parentNode: null,
14541 type: ReactMultiChildUpdateTypes.REMOVE_NODE,
14542 markupIndex: null,
14543 content: null,
14544 fromIndex: fromIndex,
14545 toIndex: null
14546 });
14547 }
14548
14549 /**
14550 * Enqueues setting the markup of a node.
14551 *
14552 * @param {string} parentID ID of the parent component.
14553 * @param {string} markup Markup that renders into an element.
14554 * @private
14555 */
14556 function enqueueSetMarkup(parentID, markup) {
14557 // NOTE: Null values reduce hidden classes.
14558 updateQueue.push({
14559 parentID: parentID,
14560 parentNode: null,
14561 type: ReactMultiChildUpdateTypes.SET_MARKUP,
14562 markupIndex: null,
14563 content: markup,
14564 fromIndex: null,
14565 toIndex: null
14566 });
14567 }
14568
14569 /**
14570 * Enqueues setting the text content.
14571 *
14572 * @param {string} parentID ID of the parent component.
14573 * @param {string} textContent Text content to set.
14574 * @private
14575 */
14576 function enqueueTextContent(parentID, textContent) {
14577 // NOTE: Null values reduce hidden classes.
14578 updateQueue.push({
14579 parentID: parentID,
14580 parentNode: null,
14581 type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
14582 markupIndex: null,
14583 content: textContent,
14584 fromIndex: null,
14585 toIndex: null
14586 });
14587 }
14588
14589 /**
14590 * Processes any enqueued updates.
14591 *
14592 * @private
14593 */
14594 function processQueue() {
14595 if (updateQueue.length) {
14596 ReactComponentEnvironment.processChildrenUpdates(updateQueue, markupQueue);
14597 clearQueue();
14598 }
14599 }
14600
14601 /**
14602 * Clears any enqueued updates.
14603 *
14604 * @private
14605 */
14606 function clearQueue() {
14607 updateQueue.length = 0;
14608 markupQueue.length = 0;
14609 }
14610
14611 /**
14612 * ReactMultiChild are capable of reconciling multiple children.
14613 *
14614 * @class ReactMultiChild
14615 * @internal
14616 */
14617 var ReactMultiChild = {
14618
14619 /**
14620 * Provides common functionality for components that must reconcile multiple
14621 * children. This is used by `ReactDOMComponent` to mount, update, and
14622 * unmount child components.
14623 *
14624 * @lends {ReactMultiChild.prototype}
14625 */
14626 Mixin: {
14627
14628 _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
14629 if (process.env.NODE_ENV !== 'production') {
14630 if (this._currentElement) {
14631 try {
14632 ReactCurrentOwner.current = this._currentElement._owner;
14633 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
14634 } finally {
14635 ReactCurrentOwner.current = null;
14636 }
14637 }
14638 }
14639 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
14640 },
14641
14642 _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, transaction, context) {
14643 var nextChildren;
14644 if (process.env.NODE_ENV !== 'production') {
14645 if (this._currentElement) {
14646 try {
14647 ReactCurrentOwner.current = this._currentElement._owner;
14648 nextChildren = flattenChildren(nextNestedChildrenElements);
14649 } finally {
14650 ReactCurrentOwner.current = null;
14651 }
14652 return ReactChildReconciler.updateChildren(prevChildren, nextChildren, transaction, context);
14653 }
14654 }
14655 nextChildren = flattenChildren(nextNestedChildrenElements);
14656 return ReactChildReconciler.updateChildren(prevChildren, nextChildren, transaction, context);
14657 },
14658
14659 /**
14660 * Generates a "mount image" for each of the supplied children. In the case
14661 * of `ReactDOMComponent`, a mount image is a string of markup.
14662 *
14663 * @param {?object} nestedChildren Nested child maps.
14664 * @return {array} An array of mounted representations.
14665 * @internal
14666 */
14667 mountChildren: function (nestedChildren, transaction, context) {
14668 var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
14669 this._renderedChildren = children;
14670 var mountImages = [];
14671 var index = 0;
14672 for (var name in children) {
14673 if (children.hasOwnProperty(name)) {
14674 var child = children[name];
14675 // Inlined for performance, see `ReactInstanceHandles.createReactID`.
14676 var rootID = this._rootNodeID + name;
14677 var mountImage = ReactReconciler.mountComponent(child, rootID, transaction, context);
14678 child._mountIndex = index++;
14679 mountImages.push(mountImage);
14680 }
14681 }
14682 return mountImages;
14683 },
14684
14685 /**
14686 * Replaces any rendered children with a text content string.
14687 *
14688 * @param {string} nextContent String of content.
14689 * @internal
14690 */
14691 updateTextContent: function (nextContent) {
14692 updateDepth++;
14693 var errorThrown = true;
14694 try {
14695 var prevChildren = this._renderedChildren;
14696 // Remove any rendered children.
14697 ReactChildReconciler.unmountChildren(prevChildren);
14698 // TODO: The setTextContent operation should be enough
14699 for (var name in prevChildren) {
14700 if (prevChildren.hasOwnProperty(name)) {
14701 this._unmountChild(prevChildren[name]);
14702 }
14703 }
14704 // Set new text content.
14705 this.setTextContent(nextContent);
14706 errorThrown = false;
14707 } finally {
14708 updateDepth--;
14709 if (!updateDepth) {
14710 if (errorThrown) {
14711 clearQueue();
14712 } else {
14713 processQueue();
14714 }
14715 }
14716 }
14717 },
14718
14719 /**
14720 * Replaces any rendered children with a markup string.
14721 *
14722 * @param {string} nextMarkup String of markup.
14723 * @internal
14724 */
14725 updateMarkup: function (nextMarkup) {
14726 updateDepth++;
14727 var errorThrown = true;
14728 try {
14729 var prevChildren = this._renderedChildren;
14730 // Remove any rendered children.
14731 ReactChildReconciler.unmountChildren(prevChildren);
14732 for (var name in prevChildren) {
14733 if (prevChildren.hasOwnProperty(name)) {
14734 this._unmountChildByName(prevChildren[name], name);
14735 }
14736 }
14737 this.setMarkup(nextMarkup);
14738 errorThrown = false;
14739 } finally {
14740 updateDepth--;
14741 if (!updateDepth) {
14742 if (errorThrown) {
14743 clearQueue();
14744 } else {
14745 processQueue();
14746 }
14747 }
14748 }
14749 },
14750
14751 /**
14752 * Updates the rendered children with new children.
14753 *
14754 * @param {?object} nextNestedChildrenElements Nested child element maps.
14755 * @param {ReactReconcileTransaction} transaction
14756 * @internal
14757 */
14758 updateChildren: function (nextNestedChildrenElements, transaction, context) {
14759 updateDepth++;
14760 var errorThrown = true;
14761 try {
14762 this._updateChildren(nextNestedChildrenElements, transaction, context);
14763 errorThrown = false;
14764 } finally {
14765 updateDepth--;
14766 if (!updateDepth) {
14767 if (errorThrown) {
14768 clearQueue();
14769 } else {
14770 processQueue();
14771 }
14772 }
14773 }
14774 },
14775
14776 /**
14777 * Improve performance by isolating this hot code path from the try/catch
14778 * block in `updateChildren`.
14779 *
14780 * @param {?object} nextNestedChildrenElements Nested child element maps.
14781 * @param {ReactReconcileTransaction} transaction
14782 * @final
14783 * @protected
14784 */
14785 _updateChildren: function (nextNestedChildrenElements, transaction, context) {
14786 var prevChildren = this._renderedChildren;
14787 var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, transaction, context);
14788 this._renderedChildren = nextChildren;
14789 if (!nextChildren && !prevChildren) {
14790 return;
14791 }
14792 var name;
14793 // `nextIndex` will increment for each child in `nextChildren`, but
14794 // `lastIndex` will be the last index visited in `prevChildren`.
14795 var lastIndex = 0;
14796 var nextIndex = 0;
14797 for (name in nextChildren) {
14798 if (!nextChildren.hasOwnProperty(name)) {
14799 continue;
14800 }
14801 var prevChild = prevChildren && prevChildren[name];
14802 var nextChild = nextChildren[name];
14803 if (prevChild === nextChild) {
14804 this.moveChild(prevChild, nextIndex, lastIndex);
14805 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
14806 prevChild._mountIndex = nextIndex;
14807 } else {
14808 if (prevChild) {
14809 // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
14810 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
14811 this._unmountChild(prevChild);
14812 }
14813 // The child must be instantiated before it's mounted.
14814 this._mountChildByNameAtIndex(nextChild, name, nextIndex, transaction, context);
14815 }
14816 nextIndex++;
14817 }
14818 // Remove children that are no longer present.
14819 for (name in prevChildren) {
14820 if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
14821 this._unmountChild(prevChildren[name]);
14822 }
14823 }
14824 },
14825
14826 /**
14827 * Unmounts all rendered children. This should be used to clean up children
14828 * when this component is unmounted.
14829 *
14830 * @internal
14831 */
14832 unmountChildren: function () {
14833 var renderedChildren = this._renderedChildren;
14834 ReactChildReconciler.unmountChildren(renderedChildren);
14835 this._renderedChildren = null;
14836 },
14837
14838 /**
14839 * Moves a child component to the supplied index.
14840 *
14841 * @param {ReactComponent} child Component to move.
14842 * @param {number} toIndex Destination index of the element.
14843 * @param {number} lastIndex Last index visited of the siblings of `child`.
14844 * @protected
14845 */
14846 moveChild: function (child, toIndex, lastIndex) {
14847 // If the index of `child` is less than `lastIndex`, then it needs to
14848 // be moved. Otherwise, we do not need to move it because a child will be
14849 // inserted or moved before `child`.
14850 if (child._mountIndex < lastIndex) {
14851 enqueueMove(this._rootNodeID, child._mountIndex, toIndex);
14852 }
14853 },
14854
14855 /**
14856 * Creates a child component.
14857 *
14858 * @param {ReactComponent} child Component to create.
14859 * @param {string} mountImage Markup to insert.
14860 * @protected
14861 */
14862 createChild: function (child, mountImage) {
14863 enqueueInsertMarkup(this._rootNodeID, mountImage, child._mountIndex);
14864 },
14865
14866 /**
14867 * Removes a child component.
14868 *
14869 * @param {ReactComponent} child Child to remove.
14870 * @protected
14871 */
14872 removeChild: function (child) {
14873 enqueueRemove(this._rootNodeID, child._mountIndex);
14874 },
14875
14876 /**
14877 * Sets this text content string.
14878 *
14879 * @param {string} textContent Text content to set.
14880 * @protected
14881 */
14882 setTextContent: function (textContent) {
14883 enqueueTextContent(this._rootNodeID, textContent);
14884 },
14885
14886 /**
14887 * Sets this markup string.
14888 *
14889 * @param {string} markup Markup to set.
14890 * @protected
14891 */
14892 setMarkup: function (markup) {
14893 enqueueSetMarkup(this._rootNodeID, markup);
14894 },
14895
14896 /**
14897 * Mounts a child with the supplied name.
14898 *
14899 * NOTE: This is part of `updateChildren` and is here for readability.
14900 *
14901 * @param {ReactComponent} child Component to mount.
14902 * @param {string} name Name of the child.
14903 * @param {number} index Index at which to insert the child.
14904 * @param {ReactReconcileTransaction} transaction
14905 * @private
14906 */
14907 _mountChildByNameAtIndex: function (child, name, index, transaction, context) {
14908 // Inlined for performance, see `ReactInstanceHandles.createReactID`.
14909 var rootID = this._rootNodeID + name;
14910 var mountImage = ReactReconciler.mountComponent(child, rootID, transaction, context);
14911 child._mountIndex = index;
14912 this.createChild(child, mountImage);
14913 },
14914
14915 /**
14916 * Unmounts a rendered child.
14917 *
14918 * NOTE: This is part of `updateChildren` and is here for readability.
14919 *
14920 * @param {ReactComponent} child Component to unmount.
14921 * @private
14922 */
14923 _unmountChild: function (child) {
14924 this.removeChild(child);
14925 child._mountIndex = null;
14926 }
14927
14928 }
14929
14930 };
14931
14932 module.exports = ReactMultiChild;
14933 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
14934
14935/***/ }),
14936/* 116 */
14937/***/ (function(module, exports, __webpack_require__) {
14938
14939 /* WEBPACK VAR INJECTION */(function(process) {/**
14940 * Copyright 2014-2015, Facebook, Inc.
14941 * All rights reserved.
14942 *
14943 * This source code is licensed under the BSD-style license found in the
14944 * LICENSE file in the root directory of this source tree. An additional grant
14945 * of patent rights can be found in the PATENTS file in the same directory.
14946 *
14947 * @providesModule ReactChildReconciler
14948 * @typechecks static-only
14949 */
14950
14951 'use strict';
14952
14953 var ReactReconciler = __webpack_require__(51);
14954
14955 var instantiateReactComponent = __webpack_require__(63);
14956 var shouldUpdateReactComponent = __webpack_require__(68);
14957 var traverseAllChildren = __webpack_require__(112);
14958 var warning = __webpack_require__(26);
14959
14960 function instantiateChild(childInstances, child, name) {
14961 // We found a component instance.
14962 var keyUnique = childInstances[name] === undefined;
14963 if (process.env.NODE_ENV !== 'production') {
14964 process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name) : undefined;
14965 }
14966 if (child != null && keyUnique) {
14967 childInstances[name] = instantiateReactComponent(child, null);
14968 }
14969 }
14970
14971 /**
14972 * ReactChildReconciler provides helpers for initializing or updating a set of
14973 * children. Its output is suitable for passing it onto ReactMultiChild which
14974 * does diffed reordering and insertion.
14975 */
14976 var ReactChildReconciler = {
14977 /**
14978 * Generates a "mount image" for each of the supplied children. In the case
14979 * of `ReactDOMComponent`, a mount image is a string of markup.
14980 *
14981 * @param {?object} nestedChildNodes Nested child maps.
14982 * @return {?object} A set of child instances.
14983 * @internal
14984 */
14985 instantiateChildren: function (nestedChildNodes, transaction, context) {
14986 if (nestedChildNodes == null) {
14987 return null;
14988 }
14989 var childInstances = {};
14990 traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
14991 return childInstances;
14992 },
14993
14994 /**
14995 * Updates the rendered children and returns a new set of children.
14996 *
14997 * @param {?object} prevChildren Previously initialized set of children.
14998 * @param {?object} nextChildren Flat child element maps.
14999 * @param {ReactReconcileTransaction} transaction
15000 * @param {object} context
15001 * @return {?object} A new set of child instances.
15002 * @internal
15003 */
15004 updateChildren: function (prevChildren, nextChildren, transaction, context) {
15005 // We currently don't have a way to track moves here but if we use iterators
15006 // instead of for..in we can zip the iterators and check if an item has
15007 // moved.
15008 // TODO: If nothing has changed, return the prevChildren object so that we
15009 // can quickly bailout if nothing has changed.
15010 if (!nextChildren && !prevChildren) {
15011 return null;
15012 }
15013 var name;
15014 for (name in nextChildren) {
15015 if (!nextChildren.hasOwnProperty(name)) {
15016 continue;
15017 }
15018 var prevChild = prevChildren && prevChildren[name];
15019 var prevElement = prevChild && prevChild._currentElement;
15020 var nextElement = nextChildren[name];
15021 if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
15022 ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
15023 nextChildren[name] = prevChild;
15024 } else {
15025 if (prevChild) {
15026 ReactReconciler.unmountComponent(prevChild, name);
15027 }
15028 // The child must be instantiated before it's mounted.
15029 var nextChildInstance = instantiateReactComponent(nextElement, null);
15030 nextChildren[name] = nextChildInstance;
15031 }
15032 }
15033 // Unmount children that are no longer present.
15034 for (name in prevChildren) {
15035 if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
15036 ReactReconciler.unmountComponent(prevChildren[name]);
15037 }
15038 }
15039 return nextChildren;
15040 },
15041
15042 /**
15043 * Unmounts all rendered children. This should be used to clean up children
15044 * when this component is unmounted.
15045 *
15046 * @param {?object} renderedChildren Previously initialized set of children.
15047 * @internal
15048 */
15049 unmountChildren: function (renderedChildren) {
15050 for (var name in renderedChildren) {
15051 if (renderedChildren.hasOwnProperty(name)) {
15052 var renderedChild = renderedChildren[name];
15053 ReactReconciler.unmountComponent(renderedChild);
15054 }
15055 }
15056 }
15057
15058 };
15059
15060 module.exports = ReactChildReconciler;
15061 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
15062
15063/***/ }),
15064/* 117 */
15065/***/ (function(module, exports, __webpack_require__) {
15066
15067 /* WEBPACK VAR INJECTION */(function(process) {/**
15068 * Copyright 2013-2015, Facebook, Inc.
15069 * All rights reserved.
15070 *
15071 * This source code is licensed under the BSD-style license found in the
15072 * LICENSE file in the root directory of this source tree. An additional grant
15073 * of patent rights can be found in the PATENTS file in the same directory.
15074 *
15075 * @providesModule flattenChildren
15076 */
15077
15078 'use strict';
15079
15080 var traverseAllChildren = __webpack_require__(112);
15081 var warning = __webpack_require__(26);
15082
15083 /**
15084 * @param {function} traverseContext Context passed through traversal.
15085 * @param {?ReactComponent} child React child component.
15086 * @param {!string} name String name of key path to child.
15087 */
15088 function flattenSingleChildIntoContext(traverseContext, child, name) {
15089 // We found a component instance.
15090 var result = traverseContext;
15091 var keyUnique = result[name] === undefined;
15092 if (process.env.NODE_ENV !== 'production') {
15093 process.env.NODE_ENV !== 'production' ? warning(keyUnique, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name) : undefined;
15094 }
15095 if (keyUnique && child != null) {
15096 result[name] = child;
15097 }
15098 }
15099
15100 /**
15101 * Flattens children that are typically specified as `props.children`. Any null
15102 * children will not be included in the resulting object.
15103 * @return {!object} flattened children keyed by name.
15104 */
15105 function flattenChildren(children) {
15106 if (children == null) {
15107 return children;
15108 }
15109 var result = {};
15110 traverseAllChildren(children, flattenSingleChildIntoContext, result);
15111 return result;
15112 }
15113
15114 module.exports = flattenChildren;
15115 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
15116
15117/***/ }),
15118/* 118 */
15119/***/ (function(module, exports) {
15120
15121 /**
15122 * Copyright 2013-2015, Facebook, Inc.
15123 * All rights reserved.
15124 *
15125 * This source code is licensed under the BSD-style license found in the
15126 * LICENSE file in the root directory of this source tree. An additional grant
15127 * of patent rights can be found in the PATENTS file in the same directory.
15128 *
15129 * @providesModule shallowEqual
15130 * @typechecks
15131 *
15132 */
15133
15134 'use strict';
15135
15136 var hasOwnProperty = Object.prototype.hasOwnProperty;
15137
15138 /**
15139 * Performs equality by iterating through keys on an object and returning false
15140 * when any key has values which are not strictly equal between the arguments.
15141 * Returns true when the values of all keys are strictly equal.
15142 */
15143 function shallowEqual(objA, objB) {
15144 if (objA === objB) {
15145 return true;
15146 }
15147
15148 if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
15149 return false;
15150 }
15151
15152 var keysA = Object.keys(objA);
15153 var keysB = Object.keys(objB);
15154
15155 if (keysA.length !== keysB.length) {
15156 return false;
15157 }
15158
15159 // Test for A's keys different from B.
15160 var bHasOwnProperty = hasOwnProperty.bind(objB);
15161 for (var i = 0; i < keysA.length; i++) {
15162 if (!bHasOwnProperty(keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {
15163 return false;
15164 }
15165 }
15166
15167 return true;
15168 }
15169
15170 module.exports = shallowEqual;
15171
15172/***/ }),
15173/* 119 */
15174/***/ (function(module, exports, __webpack_require__) {
15175
15176 /**
15177 * Copyright 2013-2015, Facebook, Inc.
15178 * All rights reserved.
15179 *
15180 * This source code is licensed under the BSD-style license found in the
15181 * LICENSE file in the root directory of this source tree. An additional grant
15182 * of patent rights can be found in the PATENTS file in the same directory.
15183 *
15184 * @providesModule ReactEventListener
15185 * @typechecks static-only
15186 */
15187
15188 'use strict';
15189
15190 var EventListener = __webpack_require__(120);
15191 var ExecutionEnvironment = __webpack_require__(10);
15192 var PooledClass = __webpack_require__(57);
15193 var ReactInstanceHandles = __webpack_require__(46);
15194 var ReactMount = __webpack_require__(29);
15195 var ReactUpdates = __webpack_require__(55);
15196
15197 var assign = __webpack_require__(40);
15198 var getEventTarget = __webpack_require__(82);
15199 var getUnboundedScrollPosition = __webpack_require__(121);
15200
15201 var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
15202
15203 /**
15204 * Finds the parent React component of `node`.
15205 *
15206 * @param {*} node
15207 * @return {?DOMEventTarget} Parent container, or `null` if the specified node
15208 * is not nested.
15209 */
15210 function findParent(node) {
15211 // TODO: It may be a good idea to cache this to prevent unnecessary DOM
15212 // traversal, but caching is difficult to do correctly without using a
15213 // mutation observer to listen for all DOM changes.
15214 var nodeID = ReactMount.getID(node);
15215 var rootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);
15216 var container = ReactMount.findReactContainerForID(rootID);
15217 var parent = ReactMount.getFirstReactDOM(container);
15218 return parent;
15219 }
15220
15221 // Used to store ancestor hierarchy in top level callback
15222 function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
15223 this.topLevelType = topLevelType;
15224 this.nativeEvent = nativeEvent;
15225 this.ancestors = [];
15226 }
15227 assign(TopLevelCallbackBookKeeping.prototype, {
15228 destructor: function () {
15229 this.topLevelType = null;
15230 this.nativeEvent = null;
15231 this.ancestors.length = 0;
15232 }
15233 });
15234 PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
15235
15236 function handleTopLevelImpl(bookKeeping) {
15237 // TODO: Re-enable event.path handling
15238 //
15239 // if (bookKeeping.nativeEvent.path && bookKeeping.nativeEvent.path.length > 1) {
15240 // // New browsers have a path attribute on native events
15241 // handleTopLevelWithPath(bookKeeping);
15242 // } else {
15243 // // Legacy browsers don't have a path attribute on native events
15244 // handleTopLevelWithoutPath(bookKeeping);
15245 // }
15246
15247 void handleTopLevelWithPath; // temporarily unused
15248 handleTopLevelWithoutPath(bookKeeping);
15249 }
15250
15251 // Legacy browsers don't have a path attribute on native events
15252 function handleTopLevelWithoutPath(bookKeeping) {
15253 var topLevelTarget = ReactMount.getFirstReactDOM(getEventTarget(bookKeeping.nativeEvent)) || window;
15254
15255 // Loop through the hierarchy, in case there's any nested components.
15256 // It's important that we build the array of ancestors before calling any
15257 // event handlers, because event handlers can modify the DOM, leading to
15258 // inconsistencies with ReactMount's node cache. See #1105.
15259 var ancestor = topLevelTarget;
15260 while (ancestor) {
15261 bookKeeping.ancestors.push(ancestor);
15262 ancestor = findParent(ancestor);
15263 }
15264
15265 for (var i = 0; i < bookKeeping.ancestors.length; i++) {
15266 topLevelTarget = bookKeeping.ancestors[i];
15267 var topLevelTargetID = ReactMount.getID(topLevelTarget) || '';
15268 ReactEventListener._handleTopLevel(bookKeeping.topLevelType, topLevelTarget, topLevelTargetID, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
15269 }
15270 }
15271
15272 // New browsers have a path attribute on native events
15273 function handleTopLevelWithPath(bookKeeping) {
15274 var path = bookKeeping.nativeEvent.path;
15275 var currentNativeTarget = path[0];
15276 var eventsFired = 0;
15277 for (var i = 0; i < path.length; i++) {
15278 var currentPathElement = path[i];
15279 if (currentPathElement.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE) {
15280 currentNativeTarget = path[i + 1];
15281 }
15282 // TODO: slow
15283 var reactParent = ReactMount.getFirstReactDOM(currentPathElement);
15284 if (reactParent === currentPathElement) {
15285 var currentPathElementID = ReactMount.getID(currentPathElement);
15286 var newRootID = ReactInstanceHandles.getReactRootIDFromNodeID(currentPathElementID);
15287 bookKeeping.ancestors.push(currentPathElement);
15288
15289 var topLevelTargetID = ReactMount.getID(currentPathElement) || '';
15290 eventsFired++;
15291 ReactEventListener._handleTopLevel(bookKeeping.topLevelType, currentPathElement, topLevelTargetID, bookKeeping.nativeEvent, currentNativeTarget);
15292
15293 // Jump to the root of this React render tree
15294 while (currentPathElementID !== newRootID) {
15295 i++;
15296 currentPathElement = path[i];
15297 currentPathElementID = ReactMount.getID(currentPathElement);
15298 }
15299 }
15300 }
15301 if (eventsFired === 0) {
15302 ReactEventListener._handleTopLevel(bookKeeping.topLevelType, window, '', bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
15303 }
15304 }
15305
15306 function scrollValueMonitor(cb) {
15307 var scrollPosition = getUnboundedScrollPosition(window);
15308 cb(scrollPosition);
15309 }
15310
15311 var ReactEventListener = {
15312 _enabled: true,
15313 _handleTopLevel: null,
15314
15315 WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
15316
15317 setHandleTopLevel: function (handleTopLevel) {
15318 ReactEventListener._handleTopLevel = handleTopLevel;
15319 },
15320
15321 setEnabled: function (enabled) {
15322 ReactEventListener._enabled = !!enabled;
15323 },
15324
15325 isEnabled: function () {
15326 return ReactEventListener._enabled;
15327 },
15328
15329 /**
15330 * Traps top-level events by using event bubbling.
15331 *
15332 * @param {string} topLevelType Record from `EventConstants`.
15333 * @param {string} handlerBaseName Event name (e.g. "click").
15334 * @param {object} handle Element on which to attach listener.
15335 * @return {?object} An object with a remove function which will forcefully
15336 * remove the listener.
15337 * @internal
15338 */
15339 trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
15340 var element = handle;
15341 if (!element) {
15342 return null;
15343 }
15344 return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
15345 },
15346
15347 /**
15348 * Traps a top-level event by using event capturing.
15349 *
15350 * @param {string} topLevelType Record from `EventConstants`.
15351 * @param {string} handlerBaseName Event name (e.g. "click").
15352 * @param {object} handle Element on which to attach listener.
15353 * @return {?object} An object with a remove function which will forcefully
15354 * remove the listener.
15355 * @internal
15356 */
15357 trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
15358 var element = handle;
15359 if (!element) {
15360 return null;
15361 }
15362 return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
15363 },
15364
15365 monitorScrollValue: function (refresh) {
15366 var callback = scrollValueMonitor.bind(null, refresh);
15367 EventListener.listen(window, 'scroll', callback);
15368 },
15369
15370 dispatchEvent: function (topLevelType, nativeEvent) {
15371 if (!ReactEventListener._enabled) {
15372 return;
15373 }
15374
15375 var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
15376 try {
15377 // Event queue being processed in the same cycle allows
15378 // `preventDefault`.
15379 ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
15380 } finally {
15381 TopLevelCallbackBookKeeping.release(bookKeeping);
15382 }
15383 }
15384 };
15385
15386 module.exports = ReactEventListener;
15387
15388/***/ }),
15389/* 120 */
15390/***/ (function(module, exports, __webpack_require__) {
15391
15392 /* WEBPACK VAR INJECTION */(function(process) {/**
15393 * Copyright 2013-2015, Facebook, Inc.
15394 *
15395 * Licensed under the Apache License, Version 2.0 (the "License");
15396 * you may not use this file except in compliance with the License.
15397 * You may obtain a copy of the License at
15398 *
15399 * http://www.apache.org/licenses/LICENSE-2.0
15400 *
15401 * Unless required by applicable law or agreed to in writing, software
15402 * distributed under the License is distributed on an "AS IS" BASIS,
15403 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15404 * See the License for the specific language governing permissions and
15405 * limitations under the License.
15406 *
15407 * @providesModule EventListener
15408 * @typechecks
15409 */
15410
15411 'use strict';
15412
15413 var emptyFunction = __webpack_require__(16);
15414
15415 /**
15416 * Upstream version of event listener. Does not take into account specific
15417 * nature of platform.
15418 */
15419 var EventListener = {
15420 /**
15421 * Listen to DOM events during the bubble phase.
15422 *
15423 * @param {DOMEventTarget} target DOM element to register listener on.
15424 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
15425 * @param {function} callback Callback function.
15426 * @return {object} Object with a `remove` method.
15427 */
15428 listen: function (target, eventType, callback) {
15429 if (target.addEventListener) {
15430 target.addEventListener(eventType, callback, false);
15431 return {
15432 remove: function () {
15433 target.removeEventListener(eventType, callback, false);
15434 }
15435 };
15436 } else if (target.attachEvent) {
15437 target.attachEvent('on' + eventType, callback);
15438 return {
15439 remove: function () {
15440 target.detachEvent('on' + eventType, callback);
15441 }
15442 };
15443 }
15444 },
15445
15446 /**
15447 * Listen to DOM events during the capture phase.
15448 *
15449 * @param {DOMEventTarget} target DOM element to register listener on.
15450 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
15451 * @param {function} callback Callback function.
15452 * @return {object} Object with a `remove` method.
15453 */
15454 capture: function (target, eventType, callback) {
15455 if (target.addEventListener) {
15456 target.addEventListener(eventType, callback, true);
15457 return {
15458 remove: function () {
15459 target.removeEventListener(eventType, callback, true);
15460 }
15461 };
15462 } else {
15463 if (process.env.NODE_ENV !== 'production') {
15464 console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
15465 }
15466 return {
15467 remove: emptyFunction
15468 };
15469 }
15470 },
15471
15472 registerDefault: function () {}
15473 };
15474
15475 module.exports = EventListener;
15476 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
15477
15478/***/ }),
15479/* 121 */
15480/***/ (function(module, exports) {
15481
15482 /**
15483 * Copyright 2013-2015, Facebook, Inc.
15484 * All rights reserved.
15485 *
15486 * This source code is licensed under the BSD-style license found in the
15487 * LICENSE file in the root directory of this source tree. An additional grant
15488 * of patent rights can be found in the PATENTS file in the same directory.
15489 *
15490 * @providesModule getUnboundedScrollPosition
15491 * @typechecks
15492 */
15493
15494 'use strict';
15495
15496 /**
15497 * Gets the scroll position of the supplied element or window.
15498 *
15499 * The return values are unbounded, unlike `getScrollPosition`. This means they
15500 * may be negative or exceed the element boundaries (which is possible using
15501 * inertial scrolling).
15502 *
15503 * @param {DOMWindow|DOMElement} scrollable
15504 * @return {object} Map with `x` and `y` keys.
15505 */
15506 function getUnboundedScrollPosition(scrollable) {
15507 if (scrollable === window) {
15508 return {
15509 x: window.pageXOffset || document.documentElement.scrollLeft,
15510 y: window.pageYOffset || document.documentElement.scrollTop
15511 };
15512 }
15513 return {
15514 x: scrollable.scrollLeft,
15515 y: scrollable.scrollTop
15516 };
15517 }
15518
15519 module.exports = getUnboundedScrollPosition;
15520
15521/***/ }),
15522/* 122 */
15523/***/ (function(module, exports, __webpack_require__) {
15524
15525 /**
15526 * Copyright 2013-2015, Facebook, Inc.
15527 * All rights reserved.
15528 *
15529 * This source code is licensed under the BSD-style license found in the
15530 * LICENSE file in the root directory of this source tree. An additional grant
15531 * of patent rights can be found in the PATENTS file in the same directory.
15532 *
15533 * @providesModule ReactInjection
15534 */
15535
15536 'use strict';
15537
15538 var DOMProperty = __webpack_require__(24);
15539 var EventPluginHub = __webpack_require__(32);
15540 var ReactComponentEnvironment = __webpack_require__(65);
15541 var ReactClass = __webpack_require__(123);
15542 var ReactEmptyComponent = __webpack_require__(69);
15543 var ReactBrowserEventEmitter = __webpack_require__(30);
15544 var ReactNativeComponent = __webpack_require__(70);
15545 var ReactPerf = __webpack_require__(19);
15546 var ReactRootIndex = __webpack_require__(47);
15547 var ReactUpdates = __webpack_require__(55);
15548
15549 var ReactInjection = {
15550 Component: ReactComponentEnvironment.injection,
15551 Class: ReactClass.injection,
15552 DOMProperty: DOMProperty.injection,
15553 EmptyComponent: ReactEmptyComponent.injection,
15554 EventPluginHub: EventPluginHub.injection,
15555 EventEmitter: ReactBrowserEventEmitter.injection,
15556 NativeComponent: ReactNativeComponent.injection,
15557 Perf: ReactPerf.injection,
15558 RootIndex: ReactRootIndex.injection,
15559 Updates: ReactUpdates.injection
15560 };
15561
15562 module.exports = ReactInjection;
15563
15564/***/ }),
15565/* 123 */
15566/***/ (function(module, exports, __webpack_require__) {
15567
15568 /* WEBPACK VAR INJECTION */(function(process) {/**
15569 * Copyright 2013-2015, Facebook, Inc.
15570 * All rights reserved.
15571 *
15572 * This source code is licensed under the BSD-style license found in the
15573 * LICENSE file in the root directory of this source tree. An additional grant
15574 * of patent rights can be found in the PATENTS file in the same directory.
15575 *
15576 * @providesModule ReactClass
15577 */
15578
15579 'use strict';
15580
15581 var ReactComponent = __webpack_require__(124);
15582 var ReactElement = __webpack_require__(43);
15583 var ReactPropTypeLocations = __webpack_require__(66);
15584 var ReactPropTypeLocationNames = __webpack_require__(67);
15585 var ReactNoopUpdateQueue = __webpack_require__(125);
15586
15587 var assign = __webpack_require__(40);
15588 var emptyObject = __webpack_require__(59);
15589 var invariant = __webpack_require__(14);
15590 var keyMirror = __webpack_require__(18);
15591 var keyOf = __webpack_require__(80);
15592 var warning = __webpack_require__(26);
15593
15594 var MIXINS_KEY = keyOf({ mixins: null });
15595
15596 /**
15597 * Policies that describe methods in `ReactClassInterface`.
15598 */
15599 var SpecPolicy = keyMirror({
15600 /**
15601 * These methods may be defined only once by the class specification or mixin.
15602 */
15603 DEFINE_ONCE: null,
15604 /**
15605 * These methods may be defined by both the class specification and mixins.
15606 * Subsequent definitions will be chained. These methods must return void.
15607 */
15608 DEFINE_MANY: null,
15609 /**
15610 * These methods are overriding the base class.
15611 */
15612 OVERRIDE_BASE: null,
15613 /**
15614 * These methods are similar to DEFINE_MANY, except we assume they return
15615 * objects. We try to merge the keys of the return values of all the mixed in
15616 * functions. If there is a key conflict we throw.
15617 */
15618 DEFINE_MANY_MERGED: null
15619 });
15620
15621 var injectedMixins = [];
15622
15623 var warnedSetProps = false;
15624 function warnSetProps() {
15625 if (!warnedSetProps) {
15626 warnedSetProps = true;
15627 process.env.NODE_ENV !== 'production' ? warning(false, 'setProps(...) and replaceProps(...) are deprecated. ' + 'Instead, call render again at the top level.') : undefined;
15628 }
15629 }
15630
15631 /**
15632 * Composite components are higher-level components that compose other composite
15633 * or native components.
15634 *
15635 * To create a new type of `ReactClass`, pass a specification of
15636 * your new class to `React.createClass`. The only requirement of your class
15637 * specification is that you implement a `render` method.
15638 *
15639 * var MyComponent = React.createClass({
15640 * render: function() {
15641 * return <div>Hello World</div>;
15642 * }
15643 * });
15644 *
15645 * The class specification supports a specific protocol of methods that have
15646 * special meaning (e.g. `render`). See `ReactClassInterface` for
15647 * more the comprehensive protocol. Any other properties and methods in the
15648 * class specification will be available on the prototype.
15649 *
15650 * @interface ReactClassInterface
15651 * @internal
15652 */
15653 var ReactClassInterface = {
15654
15655 /**
15656 * An array of Mixin objects to include when defining your component.
15657 *
15658 * @type {array}
15659 * @optional
15660 */
15661 mixins: SpecPolicy.DEFINE_MANY,
15662
15663 /**
15664 * An object containing properties and methods that should be defined on
15665 * the component's constructor instead of its prototype (static methods).
15666 *
15667 * @type {object}
15668 * @optional
15669 */
15670 statics: SpecPolicy.DEFINE_MANY,
15671
15672 /**
15673 * Definition of prop types for this component.
15674 *
15675 * @type {object}
15676 * @optional
15677 */
15678 propTypes: SpecPolicy.DEFINE_MANY,
15679
15680 /**
15681 * Definition of context types for this component.
15682 *
15683 * @type {object}
15684 * @optional
15685 */
15686 contextTypes: SpecPolicy.DEFINE_MANY,
15687
15688 /**
15689 * Definition of context types this component sets for its children.
15690 *
15691 * @type {object}
15692 * @optional
15693 */
15694 childContextTypes: SpecPolicy.DEFINE_MANY,
15695
15696 // ==== Definition methods ====
15697
15698 /**
15699 * Invoked when the component is mounted. Values in the mapping will be set on
15700 * `this.props` if that prop is not specified (i.e. using an `in` check).
15701 *
15702 * This method is invoked before `getInitialState` and therefore cannot rely
15703 * on `this.state` or use `this.setState`.
15704 *
15705 * @return {object}
15706 * @optional
15707 */
15708 getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
15709
15710 /**
15711 * Invoked once before the component is mounted. The return value will be used
15712 * as the initial value of `this.state`.
15713 *
15714 * getInitialState: function() {
15715 * return {
15716 * isOn: false,
15717 * fooBaz: new BazFoo()
15718 * }
15719 * }
15720 *
15721 * @return {object}
15722 * @optional
15723 */
15724 getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
15725
15726 /**
15727 * @return {object}
15728 * @optional
15729 */
15730 getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
15731
15732 /**
15733 * Uses props from `this.props` and state from `this.state` to render the
15734 * structure of the component.
15735 *
15736 * No guarantees are made about when or how often this method is invoked, so
15737 * it must not have side effects.
15738 *
15739 * render: function() {
15740 * var name = this.props.name;
15741 * return <div>Hello, {name}!</div>;
15742 * }
15743 *
15744 * @return {ReactComponent}
15745 * @nosideeffects
15746 * @required
15747 */
15748 render: SpecPolicy.DEFINE_ONCE,
15749
15750 // ==== Delegate methods ====
15751
15752 /**
15753 * Invoked when the component is initially created and about to be mounted.
15754 * This may have side effects, but any external subscriptions or data created
15755 * by this method must be cleaned up in `componentWillUnmount`.
15756 *
15757 * @optional
15758 */
15759 componentWillMount: SpecPolicy.DEFINE_MANY,
15760
15761 /**
15762 * Invoked when the component has been mounted and has a DOM representation.
15763 * However, there is no guarantee that the DOM node is in the document.
15764 *
15765 * Use this as an opportunity to operate on the DOM when the component has
15766 * been mounted (initialized and rendered) for the first time.
15767 *
15768 * @param {DOMElement} rootNode DOM element representing the component.
15769 * @optional
15770 */
15771 componentDidMount: SpecPolicy.DEFINE_MANY,
15772
15773 /**
15774 * Invoked before the component receives new props.
15775 *
15776 * Use this as an opportunity to react to a prop transition by updating the
15777 * state using `this.setState`. Current props are accessed via `this.props`.
15778 *
15779 * componentWillReceiveProps: function(nextProps, nextContext) {
15780 * this.setState({
15781 * likesIncreasing: nextProps.likeCount > this.props.likeCount
15782 * });
15783 * }
15784 *
15785 * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
15786 * transition may cause a state change, but the opposite is not true. If you
15787 * need it, you are probably looking for `componentWillUpdate`.
15788 *
15789 * @param {object} nextProps
15790 * @optional
15791 */
15792 componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
15793
15794 /**
15795 * Invoked while deciding if the component should be updated as a result of
15796 * receiving new props, state and/or context.
15797 *
15798 * Use this as an opportunity to `return false` when you're certain that the
15799 * transition to the new props/state/context will not require a component
15800 * update.
15801 *
15802 * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
15803 * return !equal(nextProps, this.props) ||
15804 * !equal(nextState, this.state) ||
15805 * !equal(nextContext, this.context);
15806 * }
15807 *
15808 * @param {object} nextProps
15809 * @param {?object} nextState
15810 * @param {?object} nextContext
15811 * @return {boolean} True if the component should update.
15812 * @optional
15813 */
15814 shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
15815
15816 /**
15817 * Invoked when the component is about to update due to a transition from
15818 * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
15819 * and `nextContext`.
15820 *
15821 * Use this as an opportunity to perform preparation before an update occurs.
15822 *
15823 * NOTE: You **cannot** use `this.setState()` in this method.
15824 *
15825 * @param {object} nextProps
15826 * @param {?object} nextState
15827 * @param {?object} nextContext
15828 * @param {ReactReconcileTransaction} transaction
15829 * @optional
15830 */
15831 componentWillUpdate: SpecPolicy.DEFINE_MANY,
15832
15833 /**
15834 * Invoked when the component's DOM representation has been updated.
15835 *
15836 * Use this as an opportunity to operate on the DOM when the component has
15837 * been updated.
15838 *
15839 * @param {object} prevProps
15840 * @param {?object} prevState
15841 * @param {?object} prevContext
15842 * @param {DOMElement} rootNode DOM element representing the component.
15843 * @optional
15844 */
15845 componentDidUpdate: SpecPolicy.DEFINE_MANY,
15846
15847 /**
15848 * Invoked when the component is about to be removed from its parent and have
15849 * its DOM representation destroyed.
15850 *
15851 * Use this as an opportunity to deallocate any external resources.
15852 *
15853 * NOTE: There is no `componentDidUnmount` since your component will have been
15854 * destroyed by that point.
15855 *
15856 * @optional
15857 */
15858 componentWillUnmount: SpecPolicy.DEFINE_MANY,
15859
15860 // ==== Advanced methods ====
15861
15862 /**
15863 * Updates the component's currently mounted DOM representation.
15864 *
15865 * By default, this implements React's rendering and reconciliation algorithm.
15866 * Sophisticated clients may wish to override this.
15867 *
15868 * @param {ReactReconcileTransaction} transaction
15869 * @internal
15870 * @overridable
15871 */
15872 updateComponent: SpecPolicy.OVERRIDE_BASE
15873
15874 };
15875
15876 /**
15877 * Mapping from class specification keys to special processing functions.
15878 *
15879 * Although these are declared like instance properties in the specification
15880 * when defining classes using `React.createClass`, they are actually static
15881 * and are accessible on the constructor instead of the prototype. Despite
15882 * being static, they must be defined outside of the "statics" key under
15883 * which all other static methods are defined.
15884 */
15885 var RESERVED_SPEC_KEYS = {
15886 displayName: function (Constructor, displayName) {
15887 Constructor.displayName = displayName;
15888 },
15889 mixins: function (Constructor, mixins) {
15890 if (mixins) {
15891 for (var i = 0; i < mixins.length; i++) {
15892 mixSpecIntoComponent(Constructor, mixins[i]);
15893 }
15894 }
15895 },
15896 childContextTypes: function (Constructor, childContextTypes) {
15897 if (process.env.NODE_ENV !== 'production') {
15898 validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
15899 }
15900 Constructor.childContextTypes = assign({}, Constructor.childContextTypes, childContextTypes);
15901 },
15902 contextTypes: function (Constructor, contextTypes) {
15903 if (process.env.NODE_ENV !== 'production') {
15904 validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
15905 }
15906 Constructor.contextTypes = assign({}, Constructor.contextTypes, contextTypes);
15907 },
15908 /**
15909 * Special case getDefaultProps which should move into statics but requires
15910 * automatic merging.
15911 */
15912 getDefaultProps: function (Constructor, getDefaultProps) {
15913 if (Constructor.getDefaultProps) {
15914 Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
15915 } else {
15916 Constructor.getDefaultProps = getDefaultProps;
15917 }
15918 },
15919 propTypes: function (Constructor, propTypes) {
15920 if (process.env.NODE_ENV !== 'production') {
15921 validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
15922 }
15923 Constructor.propTypes = assign({}, Constructor.propTypes, propTypes);
15924 },
15925 statics: function (Constructor, statics) {
15926 mixStaticSpecIntoComponent(Constructor, statics);
15927 },
15928 autobind: function () {} };
15929
15930 // noop
15931 function validateTypeDef(Constructor, typeDef, location) {
15932 for (var propName in typeDef) {
15933 if (typeDef.hasOwnProperty(propName)) {
15934 // use a warning instead of an invariant so components
15935 // don't show up in prod but not in __DEV__
15936 process.env.NODE_ENV !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : undefined;
15937 }
15938 }
15939 }
15940
15941 function validateMethodOverride(proto, name) {
15942 var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
15943
15944 // Disallow overriding of base class methods unless explicitly allowed.
15945 if (ReactClassMixin.hasOwnProperty(name)) {
15946 !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name) : invariant(false) : undefined;
15947 }
15948
15949 // Disallow defining methods more than once unless explicitly allowed.
15950 if (proto.hasOwnProperty(name)) {
15951 !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name) : invariant(false) : undefined;
15952 }
15953 }
15954
15955 /**
15956 * Mixin helper which handles policy validation and reserved
15957 * specification keys when building React classses.
15958 */
15959 function mixSpecIntoComponent(Constructor, spec) {
15960 if (!spec) {
15961 return;
15962 }
15963
15964 !(typeof spec !== 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component class as a mixin. Instead, just use a regular object.') : invariant(false) : undefined;
15965 !!ReactElement.isValidElement(spec) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.') : invariant(false) : undefined;
15966
15967 var proto = Constructor.prototype;
15968
15969 // By handling mixins before any other properties, we ensure the same
15970 // chaining order is applied to methods with DEFINE_MANY policy, whether
15971 // mixins are listed before or after these methods in the spec.
15972 if (spec.hasOwnProperty(MIXINS_KEY)) {
15973 RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
15974 }
15975
15976 for (var name in spec) {
15977 if (!spec.hasOwnProperty(name)) {
15978 continue;
15979 }
15980
15981 if (name === MIXINS_KEY) {
15982 // We have already handled mixins in a special case above.
15983 continue;
15984 }
15985
15986 var property = spec[name];
15987 validateMethodOverride(proto, name);
15988
15989 if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
15990 RESERVED_SPEC_KEYS[name](Constructor, property);
15991 } else {
15992 // Setup methods on prototype:
15993 // The following member methods should not be automatically bound:
15994 // 1. Expected ReactClass methods (in the "interface").
15995 // 2. Overridden methods (that were mixed in).
15996 var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
15997 var isAlreadyDefined = proto.hasOwnProperty(name);
15998 var isFunction = typeof property === 'function';
15999 var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
16000
16001 if (shouldAutoBind) {
16002 if (!proto.__reactAutoBindMap) {
16003 proto.__reactAutoBindMap = {};
16004 }
16005 proto.__reactAutoBindMap[name] = property;
16006 proto[name] = property;
16007 } else {
16008 if (isAlreadyDefined) {
16009 var specPolicy = ReactClassInterface[name];
16010
16011 // These cases should already be caught by validateMethodOverride.
16012 !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(false) : undefined;
16013
16014 // For methods which are defined more than once, call the existing
16015 // methods before calling the new property, merging if appropriate.
16016 if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
16017 proto[name] = createMergedResultFunction(proto[name], property);
16018 } else if (specPolicy === SpecPolicy.DEFINE_MANY) {
16019 proto[name] = createChainedFunction(proto[name], property);
16020 }
16021 } else {
16022 proto[name] = property;
16023 if (process.env.NODE_ENV !== 'production') {
16024 // Add verbose displayName to the function, which helps when looking
16025 // at profiling tools.
16026 if (typeof property === 'function' && spec.displayName) {
16027 proto[name].displayName = spec.displayName + '_' + name;
16028 }
16029 }
16030 }
16031 }
16032 }
16033 }
16034 }
16035
16036 function mixStaticSpecIntoComponent(Constructor, statics) {
16037 if (!statics) {
16038 return;
16039 }
16040 for (var name in statics) {
16041 var property = statics[name];
16042 if (!statics.hasOwnProperty(name)) {
16043 continue;
16044 }
16045
16046 var isReserved = (name in RESERVED_SPEC_KEYS);
16047 !!isReserved ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name) : invariant(false) : undefined;
16048
16049 var isInherited = (name in Constructor);
16050 !!isInherited ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name) : invariant(false) : undefined;
16051 Constructor[name] = property;
16052 }
16053 }
16054
16055 /**
16056 * Merge two objects, but throw if both contain the same key.
16057 *
16058 * @param {object} one The first object, which is mutated.
16059 * @param {object} two The second object
16060 * @return {object} one after it has been mutated to contain everything in two.
16061 */
16062 function mergeIntoWithNoDuplicateKeys(one, two) {
16063 !(one && two && typeof one === 'object' && typeof two === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : invariant(false) : undefined;
16064
16065 for (var key in two) {
16066 if (two.hasOwnProperty(key)) {
16067 !(one[key] === undefined) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key) : invariant(false) : undefined;
16068 one[key] = two[key];
16069 }
16070 }
16071 return one;
16072 }
16073
16074 /**
16075 * Creates a function that invokes two functions and merges their return values.
16076 *
16077 * @param {function} one Function to invoke first.
16078 * @param {function} two Function to invoke second.
16079 * @return {function} Function that invokes the two argument functions.
16080 * @private
16081 */
16082 function createMergedResultFunction(one, two) {
16083 return function mergedResult() {
16084 var a = one.apply(this, arguments);
16085 var b = two.apply(this, arguments);
16086 if (a == null) {
16087 return b;
16088 } else if (b == null) {
16089 return a;
16090 }
16091 var c = {};
16092 mergeIntoWithNoDuplicateKeys(c, a);
16093 mergeIntoWithNoDuplicateKeys(c, b);
16094 return c;
16095 };
16096 }
16097
16098 /**
16099 * Creates a function that invokes two functions and ignores their return vales.
16100 *
16101 * @param {function} one Function to invoke first.
16102 * @param {function} two Function to invoke second.
16103 * @return {function} Function that invokes the two argument functions.
16104 * @private
16105 */
16106 function createChainedFunction(one, two) {
16107 return function chainedFunction() {
16108 one.apply(this, arguments);
16109 two.apply(this, arguments);
16110 };
16111 }
16112
16113 /**
16114 * Binds a method to the component.
16115 *
16116 * @param {object} component Component whose method is going to be bound.
16117 * @param {function} method Method to be bound.
16118 * @return {function} The bound method.
16119 */
16120 function bindAutoBindMethod(component, method) {
16121 var boundMethod = method.bind(component);
16122 if (process.env.NODE_ENV !== 'production') {
16123 boundMethod.__reactBoundContext = component;
16124 boundMethod.__reactBoundMethod = method;
16125 boundMethod.__reactBoundArguments = null;
16126 var componentName = component.constructor.displayName;
16127 var _bind = boundMethod.bind;
16128 /* eslint-disable block-scoped-var, no-undef */
16129 boundMethod.bind = function (newThis) {
16130 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
16131 args[_key - 1] = arguments[_key];
16132 }
16133
16134 // User is trying to bind() an autobound method; we effectively will
16135 // ignore the value of "this" that the user is trying to use, so
16136 // let's warn.
16137 if (newThis !== component && newThis !== null) {
16138 process.env.NODE_ENV !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : undefined;
16139 } else if (!args.length) {
16140 process.env.NODE_ENV !== 'production' ? warning(false, '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 %s', componentName) : undefined;
16141 return boundMethod;
16142 }
16143 var reboundMethod = _bind.apply(boundMethod, arguments);
16144 reboundMethod.__reactBoundContext = component;
16145 reboundMethod.__reactBoundMethod = method;
16146 reboundMethod.__reactBoundArguments = args;
16147 return reboundMethod;
16148 /* eslint-enable */
16149 };
16150 }
16151 return boundMethod;
16152 }
16153
16154 /**
16155 * Binds all auto-bound methods in a component.
16156 *
16157 * @param {object} component Component whose method is going to be bound.
16158 */
16159 function bindAutoBindMethods(component) {
16160 for (var autoBindKey in component.__reactAutoBindMap) {
16161 if (component.__reactAutoBindMap.hasOwnProperty(autoBindKey)) {
16162 var method = component.__reactAutoBindMap[autoBindKey];
16163 component[autoBindKey] = bindAutoBindMethod(component, method);
16164 }
16165 }
16166 }
16167
16168 /**
16169 * Add more to the ReactClass base class. These are all legacy features and
16170 * therefore not already part of the modern ReactComponent.
16171 */
16172 var ReactClassMixin = {
16173
16174 /**
16175 * TODO: This will be deprecated because state should always keep a consistent
16176 * type signature and the only use case for this, is to avoid that.
16177 */
16178 replaceState: function (newState, callback) {
16179 this.updater.enqueueReplaceState(this, newState);
16180 if (callback) {
16181 this.updater.enqueueCallback(this, callback);
16182 }
16183 },
16184
16185 /**
16186 * Checks whether or not this composite component is mounted.
16187 * @return {boolean} True if mounted, false otherwise.
16188 * @protected
16189 * @final
16190 */
16191 isMounted: function () {
16192 return this.updater.isMounted(this);
16193 },
16194
16195 /**
16196 * Sets a subset of the props.
16197 *
16198 * @param {object} partialProps Subset of the next props.
16199 * @param {?function} callback Called after props are updated.
16200 * @final
16201 * @public
16202 * @deprecated
16203 */
16204 setProps: function (partialProps, callback) {
16205 if (process.env.NODE_ENV !== 'production') {
16206 warnSetProps();
16207 }
16208 this.updater.enqueueSetProps(this, partialProps);
16209 if (callback) {
16210 this.updater.enqueueCallback(this, callback);
16211 }
16212 },
16213
16214 /**
16215 * Replace all the props.
16216 *
16217 * @param {object} newProps Subset of the next props.
16218 * @param {?function} callback Called after props are updated.
16219 * @final
16220 * @public
16221 * @deprecated
16222 */
16223 replaceProps: function (newProps, callback) {
16224 if (process.env.NODE_ENV !== 'production') {
16225 warnSetProps();
16226 }
16227 this.updater.enqueueReplaceProps(this, newProps);
16228 if (callback) {
16229 this.updater.enqueueCallback(this, callback);
16230 }
16231 }
16232 };
16233
16234 var ReactClassComponent = function () {};
16235 assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
16236
16237 /**
16238 * Module for creating composite components.
16239 *
16240 * @class ReactClass
16241 */
16242 var ReactClass = {
16243
16244 /**
16245 * Creates a composite component class given a class specification.
16246 *
16247 * @param {object} spec Class specification (which must define `render`).
16248 * @return {function} Component constructor function.
16249 * @public
16250 */
16251 createClass: function (spec) {
16252 var Constructor = function (props, context, updater) {
16253 // This constructor is overridden by mocks. The argument is used
16254 // by mocks to assert on what gets mounted.
16255
16256 if (process.env.NODE_ENV !== 'production') {
16257 process.env.NODE_ENV !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : undefined;
16258 }
16259
16260 // Wire up auto-binding
16261 if (this.__reactAutoBindMap) {
16262 bindAutoBindMethods(this);
16263 }
16264
16265 this.props = props;
16266 this.context = context;
16267 this.refs = emptyObject;
16268 this.updater = updater || ReactNoopUpdateQueue;
16269
16270 this.state = null;
16271
16272 // ReactClasses doesn't have constructors. Instead, they use the
16273 // getInitialState and componentWillMount methods for initialization.
16274
16275 var initialState = this.getInitialState ? this.getInitialState() : null;
16276 if (process.env.NODE_ENV !== 'production') {
16277 // We allow auto-mocks to proceed as if they're returning null.
16278 if (typeof initialState === 'undefined' && this.getInitialState._isMockFunction) {
16279 // This is probably bad practice. Consider warning here and
16280 // deprecating this convenience.
16281 initialState = null;
16282 }
16283 }
16284 !(typeof initialState === 'object' && !Array.isArray(initialState)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : invariant(false) : undefined;
16285
16286 this.state = initialState;
16287 };
16288 Constructor.prototype = new ReactClassComponent();
16289 Constructor.prototype.constructor = Constructor;
16290
16291 injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
16292
16293 mixSpecIntoComponent(Constructor, spec);
16294
16295 // Initialize the defaultProps property after all mixins have been merged.
16296 if (Constructor.getDefaultProps) {
16297 Constructor.defaultProps = Constructor.getDefaultProps();
16298 }
16299
16300 if (process.env.NODE_ENV !== 'production') {
16301 // This is a tag to indicate that the use of these method names is ok,
16302 // since it's used with createClass. If it's not, then it's likely a
16303 // mistake so we'll warn you to use the static property, property
16304 // initializer or constructor respectively.
16305 if (Constructor.getDefaultProps) {
16306 Constructor.getDefaultProps.isReactClassApproved = {};
16307 }
16308 if (Constructor.prototype.getInitialState) {
16309 Constructor.prototype.getInitialState.isReactClassApproved = {};
16310 }
16311 }
16312
16313 !Constructor.prototype.render ? process.env.NODE_ENV !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : invariant(false) : undefined;
16314
16315 if (process.env.NODE_ENV !== 'production') {
16316 process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : undefined;
16317 process.env.NODE_ENV !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : undefined;
16318 }
16319
16320 // Reduce time spent doing lookups by setting these on the prototype.
16321 for (var methodName in ReactClassInterface) {
16322 if (!Constructor.prototype[methodName]) {
16323 Constructor.prototype[methodName] = null;
16324 }
16325 }
16326
16327 return Constructor;
16328 },
16329
16330 injection: {
16331 injectMixin: function (mixin) {
16332 injectedMixins.push(mixin);
16333 }
16334 }
16335
16336 };
16337
16338 module.exports = ReactClass;
16339 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
16340
16341/***/ }),
16342/* 124 */
16343/***/ (function(module, exports, __webpack_require__) {
16344
16345 /* WEBPACK VAR INJECTION */(function(process) {/**
16346 * Copyright 2013-2015, Facebook, Inc.
16347 * All rights reserved.
16348 *
16349 * This source code is licensed under the BSD-style license found in the
16350 * LICENSE file in the root directory of this source tree. An additional grant
16351 * of patent rights can be found in the PATENTS file in the same directory.
16352 *
16353 * @providesModule ReactComponent
16354 */
16355
16356 'use strict';
16357
16358 var ReactNoopUpdateQueue = __webpack_require__(125);
16359
16360 var canDefineProperty = __webpack_require__(44);
16361 var emptyObject = __webpack_require__(59);
16362 var invariant = __webpack_require__(14);
16363 var warning = __webpack_require__(26);
16364
16365 /**
16366 * Base class helpers for the updating state of a component.
16367 */
16368 function ReactComponent(props, context, updater) {
16369 this.props = props;
16370 this.context = context;
16371 this.refs = emptyObject;
16372 // We initialize the default updater but the real one gets injected by the
16373 // renderer.
16374 this.updater = updater || ReactNoopUpdateQueue;
16375 }
16376
16377 ReactComponent.prototype.isReactComponent = {};
16378
16379 /**
16380 * Sets a subset of the state. Always use this to mutate
16381 * state. You should treat `this.state` as immutable.
16382 *
16383 * There is no guarantee that `this.state` will be immediately updated, so
16384 * accessing `this.state` after calling this method may return the old value.
16385 *
16386 * There is no guarantee that calls to `setState` will run synchronously,
16387 * as they may eventually be batched together. You can provide an optional
16388 * callback that will be executed when the call to setState is actually
16389 * completed.
16390 *
16391 * When a function is provided to setState, it will be called at some point in
16392 * the future (not synchronously). It will be called with the up to date
16393 * component arguments (state, props, context). These values can be different
16394 * from this.* because your function may be called after receiveProps but before
16395 * shouldComponentUpdate, and this new state, props, and context will not yet be
16396 * assigned to this.
16397 *
16398 * @param {object|function} partialState Next partial state or function to
16399 * produce next partial state to be merged with current state.
16400 * @param {?function} callback Called after state is updated.
16401 * @final
16402 * @protected
16403 */
16404 ReactComponent.prototype.setState = function (partialState, callback) {
16405 !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.') : invariant(false) : undefined;
16406 if (process.env.NODE_ENV !== 'production') {
16407 process.env.NODE_ENV !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : undefined;
16408 }
16409 this.updater.enqueueSetState(this, partialState);
16410 if (callback) {
16411 this.updater.enqueueCallback(this, callback);
16412 }
16413 };
16414
16415 /**
16416 * Forces an update. This should only be invoked when it is known with
16417 * certainty that we are **not** in a DOM transaction.
16418 *
16419 * You may want to call this when you know that some deeper aspect of the
16420 * component's state has changed but `setState` was not called.
16421 *
16422 * This will not invoke `shouldComponentUpdate`, but it will invoke
16423 * `componentWillUpdate` and `componentDidUpdate`.
16424 *
16425 * @param {?function} callback Called after update is complete.
16426 * @final
16427 * @protected
16428 */
16429 ReactComponent.prototype.forceUpdate = function (callback) {
16430 this.updater.enqueueForceUpdate(this);
16431 if (callback) {
16432 this.updater.enqueueCallback(this, callback);
16433 }
16434 };
16435
16436 /**
16437 * Deprecated APIs. These APIs used to exist on classic React classes but since
16438 * we would like to deprecate them, we're not going to move them over to this
16439 * modern base class. Instead, we define a getter that warns if it's accessed.
16440 */
16441 if (process.env.NODE_ENV !== 'production') {
16442 var deprecatedAPIs = {
16443 getDOMNode: ['getDOMNode', 'Use ReactDOM.findDOMNode(component) instead.'],
16444 isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
16445 replaceProps: ['replaceProps', 'Instead, call render again at the top level.'],
16446 replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'],
16447 setProps: ['setProps', 'Instead, call render again at the top level.']
16448 };
16449 var defineDeprecationWarning = function (methodName, info) {
16450 if (canDefineProperty) {
16451 Object.defineProperty(ReactComponent.prototype, methodName, {
16452 get: function () {
16453 process.env.NODE_ENV !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : undefined;
16454 return undefined;
16455 }
16456 });
16457 }
16458 };
16459 for (var fnName in deprecatedAPIs) {
16460 if (deprecatedAPIs.hasOwnProperty(fnName)) {
16461 defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
16462 }
16463 }
16464 }
16465
16466 module.exports = ReactComponent;
16467 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
16468
16469/***/ }),
16470/* 125 */
16471/***/ (function(module, exports, __webpack_require__) {
16472
16473 /* WEBPACK VAR INJECTION */(function(process) {/**
16474 * Copyright 2015, Facebook, Inc.
16475 * All rights reserved.
16476 *
16477 * This source code is licensed under the BSD-style license found in the
16478 * LICENSE file in the root directory of this source tree. An additional grant
16479 * of patent rights can be found in the PATENTS file in the same directory.
16480 *
16481 * @providesModule ReactNoopUpdateQueue
16482 */
16483
16484 'use strict';
16485
16486 var warning = __webpack_require__(26);
16487
16488 function warnTDZ(publicInstance, callerName) {
16489 if (process.env.NODE_ENV !== 'production') {
16490 process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, publicInstance.constructor && publicInstance.constructor.displayName || '') : undefined;
16491 }
16492 }
16493
16494 /**
16495 * This is the abstract API for an update queue.
16496 */
16497 var ReactNoopUpdateQueue = {
16498
16499 /**
16500 * Checks whether or not this composite component is mounted.
16501 * @param {ReactClass} publicInstance The instance we want to test.
16502 * @return {boolean} True if mounted, false otherwise.
16503 * @protected
16504 * @final
16505 */
16506 isMounted: function (publicInstance) {
16507 return false;
16508 },
16509
16510 /**
16511 * Enqueue a callback that will be executed after all the pending updates
16512 * have processed.
16513 *
16514 * @param {ReactClass} publicInstance The instance to use as `this` context.
16515 * @param {?function} callback Called after state is updated.
16516 * @internal
16517 */
16518 enqueueCallback: function (publicInstance, callback) {},
16519
16520 /**
16521 * Forces an update. This should only be invoked when it is known with
16522 * certainty that we are **not** in a DOM transaction.
16523 *
16524 * You may want to call this when you know that some deeper aspect of the
16525 * component's state has changed but `setState` was not called.
16526 *
16527 * This will not invoke `shouldComponentUpdate`, but it will invoke
16528 * `componentWillUpdate` and `componentDidUpdate`.
16529 *
16530 * @param {ReactClass} publicInstance The instance that should rerender.
16531 * @internal
16532 */
16533 enqueueForceUpdate: function (publicInstance) {
16534 warnTDZ(publicInstance, 'forceUpdate');
16535 },
16536
16537 /**
16538 * Replaces all of the state. Always use this or `setState` to mutate state.
16539 * You should treat `this.state` as immutable.
16540 *
16541 * There is no guarantee that `this.state` will be immediately updated, so
16542 * accessing `this.state` after calling this method may return the old value.
16543 *
16544 * @param {ReactClass} publicInstance The instance that should rerender.
16545 * @param {object} completeState Next state.
16546 * @internal
16547 */
16548 enqueueReplaceState: function (publicInstance, completeState) {
16549 warnTDZ(publicInstance, 'replaceState');
16550 },
16551
16552 /**
16553 * Sets a subset of the state. This only exists because _pendingState is
16554 * internal. This provides a merging strategy that is not available to deep
16555 * properties which is confusing. TODO: Expose pendingState or don't use it
16556 * during the merge.
16557 *
16558 * @param {ReactClass} publicInstance The instance that should rerender.
16559 * @param {object} partialState Next partial state to be merged with state.
16560 * @internal
16561 */
16562 enqueueSetState: function (publicInstance, partialState) {
16563 warnTDZ(publicInstance, 'setState');
16564 },
16565
16566 /**
16567 * Sets a subset of the props.
16568 *
16569 * @param {ReactClass} publicInstance The instance that should rerender.
16570 * @param {object} partialProps Subset of the next props.
16571 * @internal
16572 */
16573 enqueueSetProps: function (publicInstance, partialProps) {
16574 warnTDZ(publicInstance, 'setProps');
16575 },
16576
16577 /**
16578 * Replaces all of the props.
16579 *
16580 * @param {ReactClass} publicInstance The instance that should rerender.
16581 * @param {object} props New props.
16582 * @internal
16583 */
16584 enqueueReplaceProps: function (publicInstance, props) {
16585 warnTDZ(publicInstance, 'replaceProps');
16586 }
16587
16588 };
16589
16590 module.exports = ReactNoopUpdateQueue;
16591 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
16592
16593/***/ }),
16594/* 126 */
16595/***/ (function(module, exports, __webpack_require__) {
16596
16597 /**
16598 * Copyright 2013-2015, Facebook, Inc.
16599 * All rights reserved.
16600 *
16601 * This source code is licensed under the BSD-style license found in the
16602 * LICENSE file in the root directory of this source tree. An additional grant
16603 * of patent rights can be found in the PATENTS file in the same directory.
16604 *
16605 * @providesModule ReactReconcileTransaction
16606 * @typechecks static-only
16607 */
16608
16609 'use strict';
16610
16611 var CallbackQueue = __webpack_require__(56);
16612 var PooledClass = __webpack_require__(57);
16613 var ReactBrowserEventEmitter = __webpack_require__(30);
16614 var ReactDOMFeatureFlags = __webpack_require__(42);
16615 var ReactInputSelection = __webpack_require__(127);
16616 var Transaction = __webpack_require__(58);
16617
16618 var assign = __webpack_require__(40);
16619
16620 /**
16621 * Ensures that, when possible, the selection range (currently selected text
16622 * input) is not disturbed by performing the transaction.
16623 */
16624 var SELECTION_RESTORATION = {
16625 /**
16626 * @return {Selection} Selection information.
16627 */
16628 initialize: ReactInputSelection.getSelectionInformation,
16629 /**
16630 * @param {Selection} sel Selection information returned from `initialize`.
16631 */
16632 close: ReactInputSelection.restoreSelection
16633 };
16634
16635 /**
16636 * Suppresses events (blur/focus) that could be inadvertently dispatched due to
16637 * high level DOM manipulations (like temporarily removing a text input from the
16638 * DOM).
16639 */
16640 var EVENT_SUPPRESSION = {
16641 /**
16642 * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
16643 * the reconciliation.
16644 */
16645 initialize: function () {
16646 var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
16647 ReactBrowserEventEmitter.setEnabled(false);
16648 return currentlyEnabled;
16649 },
16650
16651 /**
16652 * @param {boolean} previouslyEnabled Enabled status of
16653 * `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
16654 * restores the previous value.
16655 */
16656 close: function (previouslyEnabled) {
16657 ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
16658 }
16659 };
16660
16661 /**
16662 * Provides a queue for collecting `componentDidMount` and
16663 * `componentDidUpdate` callbacks during the the transaction.
16664 */
16665 var ON_DOM_READY_QUEUEING = {
16666 /**
16667 * Initializes the internal `onDOMReady` queue.
16668 */
16669 initialize: function () {
16670 this.reactMountReady.reset();
16671 },
16672
16673 /**
16674 * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
16675 */
16676 close: function () {
16677 this.reactMountReady.notifyAll();
16678 }
16679 };
16680
16681 /**
16682 * Executed within the scope of the `Transaction` instance. Consider these as
16683 * being member methods, but with an implied ordering while being isolated from
16684 * each other.
16685 */
16686 var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
16687
16688 /**
16689 * Currently:
16690 * - The order that these are listed in the transaction is critical:
16691 * - Suppresses events.
16692 * - Restores selection range.
16693 *
16694 * Future:
16695 * - Restore document/overflow scroll positions that were unintentionally
16696 * modified via DOM insertions above the top viewport boundary.
16697 * - Implement/integrate with customized constraint based layout system and keep
16698 * track of which dimensions must be remeasured.
16699 *
16700 * @class ReactReconcileTransaction
16701 */
16702 function ReactReconcileTransaction(forceHTML) {
16703 this.reinitializeTransaction();
16704 // Only server-side rendering really needs this option (see
16705 // `ReactServerRendering`), but server-side uses
16706 // `ReactServerRenderingTransaction` instead. This option is here so that it's
16707 // accessible and defaults to false when `ReactDOMComponent` and
16708 // `ReactTextComponent` checks it in `mountComponent`.`
16709 this.renderToStaticMarkup = false;
16710 this.reactMountReady = CallbackQueue.getPooled(null);
16711 this.useCreateElement = !forceHTML && ReactDOMFeatureFlags.useCreateElement;
16712 }
16713
16714 var Mixin = {
16715 /**
16716 * @see Transaction
16717 * @abstract
16718 * @final
16719 * @return {array<object>} List of operation wrap procedures.
16720 * TODO: convert to array<TransactionWrapper>
16721 */
16722 getTransactionWrappers: function () {
16723 return TRANSACTION_WRAPPERS;
16724 },
16725
16726 /**
16727 * @return {object} The queue to collect `onDOMReady` callbacks with.
16728 */
16729 getReactMountReady: function () {
16730 return this.reactMountReady;
16731 },
16732
16733 /**
16734 * `PooledClass` looks for this, and will invoke this before allowing this
16735 * instance to be reused.
16736 */
16737 destructor: function () {
16738 CallbackQueue.release(this.reactMountReady);
16739 this.reactMountReady = null;
16740 }
16741 };
16742
16743 assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
16744
16745 PooledClass.addPoolingTo(ReactReconcileTransaction);
16746
16747 module.exports = ReactReconcileTransaction;
16748
16749/***/ }),
16750/* 127 */
16751/***/ (function(module, exports, __webpack_require__) {
16752
16753 /**
16754 * Copyright 2013-2015, Facebook, Inc.
16755 * All rights reserved.
16756 *
16757 * This source code is licensed under the BSD-style license found in the
16758 * LICENSE file in the root directory of this source tree. An additional grant
16759 * of patent rights can be found in the PATENTS file in the same directory.
16760 *
16761 * @providesModule ReactInputSelection
16762 */
16763
16764 'use strict';
16765
16766 var ReactDOMSelection = __webpack_require__(128);
16767
16768 var containsNode = __webpack_require__(60);
16769 var focusNode = __webpack_require__(96);
16770 var getActiveElement = __webpack_require__(130);
16771
16772 function isInDocument(node) {
16773 return containsNode(document.documentElement, node);
16774 }
16775
16776 /**
16777 * @ReactInputSelection: React input selection module. Based on Selection.js,
16778 * but modified to be suitable for react and has a couple of bug fixes (doesn't
16779 * assume buttons have range selections allowed).
16780 * Input selection module for React.
16781 */
16782 var ReactInputSelection = {
16783
16784 hasSelectionCapabilities: function (elem) {
16785 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
16786 return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
16787 },
16788
16789 getSelectionInformation: function () {
16790 var focusedElem = getActiveElement();
16791 return {
16792 focusedElem: focusedElem,
16793 selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
16794 };
16795 },
16796
16797 /**
16798 * @restoreSelection: If any selection information was potentially lost,
16799 * restore it. This is useful when performing operations that could remove dom
16800 * nodes and place them back in, resulting in focus being lost.
16801 */
16802 restoreSelection: function (priorSelectionInformation) {
16803 var curFocusedElem = getActiveElement();
16804 var priorFocusedElem = priorSelectionInformation.focusedElem;
16805 var priorSelectionRange = priorSelectionInformation.selectionRange;
16806 if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
16807 if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
16808 ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
16809 }
16810 focusNode(priorFocusedElem);
16811 }
16812 },
16813
16814 /**
16815 * @getSelection: Gets the selection bounds of a focused textarea, input or
16816 * contentEditable node.
16817 * -@input: Look up selection bounds of this input
16818 * -@return {start: selectionStart, end: selectionEnd}
16819 */
16820 getSelection: function (input) {
16821 var selection;
16822
16823 if ('selectionStart' in input) {
16824 // Modern browser with input or textarea.
16825 selection = {
16826 start: input.selectionStart,
16827 end: input.selectionEnd
16828 };
16829 } else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) {
16830 // IE8 input.
16831 var range = document.selection.createRange();
16832 // There can only be one selection per document in IE, so it must
16833 // be in our element.
16834 if (range.parentElement() === input) {
16835 selection = {
16836 start: -range.moveStart('character', -input.value.length),
16837 end: -range.moveEnd('character', -input.value.length)
16838 };
16839 }
16840 } else {
16841 // Content editable or old IE textarea.
16842 selection = ReactDOMSelection.getOffsets(input);
16843 }
16844
16845 return selection || { start: 0, end: 0 };
16846 },
16847
16848 /**
16849 * @setSelection: Sets the selection bounds of a textarea or input and focuses
16850 * the input.
16851 * -@input Set selection bounds of this input or textarea
16852 * -@offsets Object of same form that is returned from get*
16853 */
16854 setSelection: function (input, offsets) {
16855 var start = offsets.start;
16856 var end = offsets.end;
16857 if (typeof end === 'undefined') {
16858 end = start;
16859 }
16860
16861 if ('selectionStart' in input) {
16862 input.selectionStart = start;
16863 input.selectionEnd = Math.min(end, input.value.length);
16864 } else if (document.selection && (input.nodeName && input.nodeName.toLowerCase() === 'input')) {
16865 var range = input.createTextRange();
16866 range.collapse(true);
16867 range.moveStart('character', start);
16868 range.moveEnd('character', end - start);
16869 range.select();
16870 } else {
16871 ReactDOMSelection.setOffsets(input, offsets);
16872 }
16873 }
16874 };
16875
16876 module.exports = ReactInputSelection;
16877
16878/***/ }),
16879/* 128 */
16880/***/ (function(module, exports, __webpack_require__) {
16881
16882 /**
16883 * Copyright 2013-2015, Facebook, Inc.
16884 * All rights reserved.
16885 *
16886 * This source code is licensed under the BSD-style license found in the
16887 * LICENSE file in the root directory of this source tree. An additional grant
16888 * of patent rights can be found in the PATENTS file in the same directory.
16889 *
16890 * @providesModule ReactDOMSelection
16891 */
16892
16893 'use strict';
16894
16895 var ExecutionEnvironment = __webpack_require__(10);
16896
16897 var getNodeForCharacterOffset = __webpack_require__(129);
16898 var getTextContentAccessor = __webpack_require__(76);
16899
16900 /**
16901 * While `isCollapsed` is available on the Selection object and `collapsed`
16902 * is available on the Range object, IE11 sometimes gets them wrong.
16903 * If the anchor/focus nodes and offsets are the same, the range is collapsed.
16904 */
16905 function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
16906 return anchorNode === focusNode && anchorOffset === focusOffset;
16907 }
16908
16909 /**
16910 * Get the appropriate anchor and focus node/offset pairs for IE.
16911 *
16912 * The catch here is that IE's selection API doesn't provide information
16913 * about whether the selection is forward or backward, so we have to
16914 * behave as though it's always forward.
16915 *
16916 * IE text differs from modern selection in that it behaves as though
16917 * block elements end with a new line. This means character offsets will
16918 * differ between the two APIs.
16919 *
16920 * @param {DOMElement} node
16921 * @return {object}
16922 */
16923 function getIEOffsets(node) {
16924 var selection = document.selection;
16925 var selectedRange = selection.createRange();
16926 var selectedLength = selectedRange.text.length;
16927
16928 // Duplicate selection so we can move range without breaking user selection.
16929 var fromStart = selectedRange.duplicate();
16930 fromStart.moveToElementText(node);
16931 fromStart.setEndPoint('EndToStart', selectedRange);
16932
16933 var startOffset = fromStart.text.length;
16934 var endOffset = startOffset + selectedLength;
16935
16936 return {
16937 start: startOffset,
16938 end: endOffset
16939 };
16940 }
16941
16942 /**
16943 * @param {DOMElement} node
16944 * @return {?object}
16945 */
16946 function getModernOffsets(node) {
16947 var selection = window.getSelection && window.getSelection();
16948
16949 if (!selection || selection.rangeCount === 0) {
16950 return null;
16951 }
16952
16953 var anchorNode = selection.anchorNode;
16954 var anchorOffset = selection.anchorOffset;
16955 var focusNode = selection.focusNode;
16956 var focusOffset = selection.focusOffset;
16957
16958 var currentRange = selection.getRangeAt(0);
16959
16960 // In Firefox, range.startContainer and range.endContainer can be "anonymous
16961 // divs", e.g. the up/down buttons on an <input type="number">. Anonymous
16962 // divs do not seem to expose properties, triggering a "Permission denied
16963 // error" if any of its properties are accessed. The only seemingly possible
16964 // way to avoid erroring is to access a property that typically works for
16965 // non-anonymous divs and catch any error that may otherwise arise. See
16966 // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
16967 try {
16968 /* eslint-disable no-unused-expressions */
16969 currentRange.startContainer.nodeType;
16970 currentRange.endContainer.nodeType;
16971 /* eslint-enable no-unused-expressions */
16972 } catch (e) {
16973 return null;
16974 }
16975
16976 // If the node and offset values are the same, the selection is collapsed.
16977 // `Selection.isCollapsed` is available natively, but IE sometimes gets
16978 // this value wrong.
16979 var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
16980
16981 var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
16982
16983 var tempRange = currentRange.cloneRange();
16984 tempRange.selectNodeContents(node);
16985 tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
16986
16987 var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
16988
16989 var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
16990 var end = start + rangeLength;
16991
16992 // Detect whether the selection is backward.
16993 var detectionRange = document.createRange();
16994 detectionRange.setStart(anchorNode, anchorOffset);
16995 detectionRange.setEnd(focusNode, focusOffset);
16996 var isBackward = detectionRange.collapsed;
16997
16998 return {
16999 start: isBackward ? end : start,
17000 end: isBackward ? start : end
17001 };
17002 }
17003
17004 /**
17005 * @param {DOMElement|DOMTextNode} node
17006 * @param {object} offsets
17007 */
17008 function setIEOffsets(node, offsets) {
17009 var range = document.selection.createRange().duplicate();
17010 var start, end;
17011
17012 if (typeof offsets.end === 'undefined') {
17013 start = offsets.start;
17014 end = start;
17015 } else if (offsets.start > offsets.end) {
17016 start = offsets.end;
17017 end = offsets.start;
17018 } else {
17019 start = offsets.start;
17020 end = offsets.end;
17021 }
17022
17023 range.moveToElementText(node);
17024 range.moveStart('character', start);
17025 range.setEndPoint('EndToStart', range);
17026 range.moveEnd('character', end - start);
17027 range.select();
17028 }
17029
17030 /**
17031 * In modern non-IE browsers, we can support both forward and backward
17032 * selections.
17033 *
17034 * Note: IE10+ supports the Selection object, but it does not support
17035 * the `extend` method, which means that even in modern IE, it's not possible
17036 * to programatically create a backward selection. Thus, for all IE
17037 * versions, we use the old IE API to create our selections.
17038 *
17039 * @param {DOMElement|DOMTextNode} node
17040 * @param {object} offsets
17041 */
17042 function setModernOffsets(node, offsets) {
17043 if (!window.getSelection) {
17044 return;
17045 }
17046
17047 var selection = window.getSelection();
17048 var length = node[getTextContentAccessor()].length;
17049 var start = Math.min(offsets.start, length);
17050 var end = typeof offsets.end === 'undefined' ? start : Math.min(offsets.end, length);
17051
17052 // IE 11 uses modern selection, but doesn't support the extend method.
17053 // Flip backward selections, so we can set with a single range.
17054 if (!selection.extend && start > end) {
17055 var temp = end;
17056 end = start;
17057 start = temp;
17058 }
17059
17060 var startMarker = getNodeForCharacterOffset(node, start);
17061 var endMarker = getNodeForCharacterOffset(node, end);
17062
17063 if (startMarker && endMarker) {
17064 var range = document.createRange();
17065 range.setStart(startMarker.node, startMarker.offset);
17066 selection.removeAllRanges();
17067
17068 if (start > end) {
17069 selection.addRange(range);
17070 selection.extend(endMarker.node, endMarker.offset);
17071 } else {
17072 range.setEnd(endMarker.node, endMarker.offset);
17073 selection.addRange(range);
17074 }
17075 }
17076 }
17077
17078 var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
17079
17080 var ReactDOMSelection = {
17081 /**
17082 * @param {DOMElement} node
17083 */
17084 getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
17085
17086 /**
17087 * @param {DOMElement|DOMTextNode} node
17088 * @param {object} offsets
17089 */
17090 setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
17091 };
17092
17093 module.exports = ReactDOMSelection;
17094
17095/***/ }),
17096/* 129 */
17097/***/ (function(module, exports) {
17098
17099 /**
17100 * Copyright 2013-2015, Facebook, Inc.
17101 * All rights reserved.
17102 *
17103 * This source code is licensed under the BSD-style license found in the
17104 * LICENSE file in the root directory of this source tree. An additional grant
17105 * of patent rights can be found in the PATENTS file in the same directory.
17106 *
17107 * @providesModule getNodeForCharacterOffset
17108 */
17109
17110 'use strict';
17111
17112 /**
17113 * Given any node return the first leaf node without children.
17114 *
17115 * @param {DOMElement|DOMTextNode} node
17116 * @return {DOMElement|DOMTextNode}
17117 */
17118 function getLeafNode(node) {
17119 while (node && node.firstChild) {
17120 node = node.firstChild;
17121 }
17122 return node;
17123 }
17124
17125 /**
17126 * Get the next sibling within a container. This will walk up the
17127 * DOM if a node's siblings have been exhausted.
17128 *
17129 * @param {DOMElement|DOMTextNode} node
17130 * @return {?DOMElement|DOMTextNode}
17131 */
17132 function getSiblingNode(node) {
17133 while (node) {
17134 if (node.nextSibling) {
17135 return node.nextSibling;
17136 }
17137 node = node.parentNode;
17138 }
17139 }
17140
17141 /**
17142 * Get object describing the nodes which contain characters at offset.
17143 *
17144 * @param {DOMElement|DOMTextNode} root
17145 * @param {number} offset
17146 * @return {?object}
17147 */
17148 function getNodeForCharacterOffset(root, offset) {
17149 var node = getLeafNode(root);
17150 var nodeStart = 0;
17151 var nodeEnd = 0;
17152
17153 while (node) {
17154 if (node.nodeType === 3) {
17155 nodeEnd = nodeStart + node.textContent.length;
17156
17157 if (nodeStart <= offset && nodeEnd >= offset) {
17158 return {
17159 node: node,
17160 offset: offset - nodeStart
17161 };
17162 }
17163
17164 nodeStart = nodeEnd;
17165 }
17166
17167 node = getLeafNode(getSiblingNode(node));
17168 }
17169 }
17170
17171 module.exports = getNodeForCharacterOffset;
17172
17173/***/ }),
17174/* 130 */
17175/***/ (function(module, exports) {
17176
17177 /**
17178 * Copyright 2013-2015, Facebook, Inc.
17179 * All rights reserved.
17180 *
17181 * This source code is licensed under the BSD-style license found in the
17182 * LICENSE file in the root directory of this source tree. An additional grant
17183 * of patent rights can be found in the PATENTS file in the same directory.
17184 *
17185 * @providesModule getActiveElement
17186 * @typechecks
17187 */
17188
17189 /* eslint-disable fb-www/typeof-undefined */
17190
17191 /**
17192 * Same as document.activeElement but wraps in a try-catch block. In IE it is
17193 * not safe to call document.activeElement if there is nothing focused.
17194 *
17195 * The activeElement will be null only if the document or document body is not
17196 * yet defined.
17197 */
17198 'use strict';
17199
17200 function getActiveElement() /*?DOMElement*/{
17201 if (typeof document === 'undefined') {
17202 return null;
17203 }
17204 try {
17205 return document.activeElement || document.body;
17206 } catch (e) {
17207 return document.body;
17208 }
17209 }
17210
17211 module.exports = getActiveElement;
17212
17213/***/ }),
17214/* 131 */
17215/***/ (function(module, exports, __webpack_require__) {
17216
17217 /**
17218 * Copyright 2013-2015, Facebook, Inc.
17219 * All rights reserved.
17220 *
17221 * This source code is licensed under the BSD-style license found in the
17222 * LICENSE file in the root directory of this source tree. An additional grant
17223 * of patent rights can be found in the PATENTS file in the same directory.
17224 *
17225 * @providesModule SelectEventPlugin
17226 */
17227
17228 'use strict';
17229
17230 var EventConstants = __webpack_require__(31);
17231 var EventPropagators = __webpack_require__(74);
17232 var ExecutionEnvironment = __webpack_require__(10);
17233 var ReactInputSelection = __webpack_require__(127);
17234 var SyntheticEvent = __webpack_require__(78);
17235
17236 var getActiveElement = __webpack_require__(130);
17237 var isTextInputElement = __webpack_require__(83);
17238 var keyOf = __webpack_require__(80);
17239 var shallowEqual = __webpack_require__(118);
17240
17241 var topLevelTypes = EventConstants.topLevelTypes;
17242
17243 var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
17244
17245 var eventTypes = {
17246 select: {
17247 phasedRegistrationNames: {
17248 bubbled: keyOf({ onSelect: null }),
17249 captured: keyOf({ onSelectCapture: null })
17250 },
17251 dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
17252 }
17253 };
17254
17255 var activeElement = null;
17256 var activeElementID = null;
17257 var lastSelection = null;
17258 var mouseDown = false;
17259
17260 // Track whether a listener exists for this plugin. If none exist, we do
17261 // not extract events.
17262 var hasListener = false;
17263 var ON_SELECT_KEY = keyOf({ onSelect: null });
17264
17265 /**
17266 * Get an object which is a unique representation of the current selection.
17267 *
17268 * The return value will not be consistent across nodes or browsers, but
17269 * two identical selections on the same node will return identical objects.
17270 *
17271 * @param {DOMElement} node
17272 * @return {object}
17273 */
17274 function getSelection(node) {
17275 if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
17276 return {
17277 start: node.selectionStart,
17278 end: node.selectionEnd
17279 };
17280 } else if (window.getSelection) {
17281 var selection = window.getSelection();
17282 return {
17283 anchorNode: selection.anchorNode,
17284 anchorOffset: selection.anchorOffset,
17285 focusNode: selection.focusNode,
17286 focusOffset: selection.focusOffset
17287 };
17288 } else if (document.selection) {
17289 var range = document.selection.createRange();
17290 return {
17291 parentElement: range.parentElement(),
17292 text: range.text,
17293 top: range.boundingTop,
17294 left: range.boundingLeft
17295 };
17296 }
17297 }
17298
17299 /**
17300 * Poll selection to see whether it's changed.
17301 *
17302 * @param {object} nativeEvent
17303 * @return {?SyntheticEvent}
17304 */
17305 function constructSelectEvent(nativeEvent, nativeEventTarget) {
17306 // Ensure we have the right element, and that the user is not dragging a
17307 // selection (this matches native `select` event behavior). In HTML5, select
17308 // fires only on input and textarea thus if there's no focused element we
17309 // won't dispatch.
17310 if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
17311 return null;
17312 }
17313
17314 // Only fire when selection has actually changed.
17315 var currentSelection = getSelection(activeElement);
17316 if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
17317 lastSelection = currentSelection;
17318
17319 var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementID, nativeEvent, nativeEventTarget);
17320
17321 syntheticEvent.type = 'select';
17322 syntheticEvent.target = activeElement;
17323
17324 EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
17325
17326 return syntheticEvent;
17327 }
17328
17329 return null;
17330 }
17331
17332 /**
17333 * This plugin creates an `onSelect` event that normalizes select events
17334 * across form elements.
17335 *
17336 * Supported elements are:
17337 * - input (see `isTextInputElement`)
17338 * - textarea
17339 * - contentEditable
17340 *
17341 * This differs from native browser implementations in the following ways:
17342 * - Fires on contentEditable fields as well as inputs.
17343 * - Fires for collapsed selection.
17344 * - Fires after user input.
17345 */
17346 var SelectEventPlugin = {
17347
17348 eventTypes: eventTypes,
17349
17350 /**
17351 * @param {string} topLevelType Record from `EventConstants`.
17352 * @param {DOMEventTarget} topLevelTarget The listening component root node.
17353 * @param {string} topLevelTargetID ID of `topLevelTarget`.
17354 * @param {object} nativeEvent Native browser event.
17355 * @return {*} An accumulation of synthetic events.
17356 * @see {EventPluginHub.extractEvents}
17357 */
17358 extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
17359 if (!hasListener) {
17360 return null;
17361 }
17362
17363 switch (topLevelType) {
17364 // Track the input node that has focus.
17365 case topLevelTypes.topFocus:
17366 if (isTextInputElement(topLevelTarget) || topLevelTarget.contentEditable === 'true') {
17367 activeElement = topLevelTarget;
17368 activeElementID = topLevelTargetID;
17369 lastSelection = null;
17370 }
17371 break;
17372 case topLevelTypes.topBlur:
17373 activeElement = null;
17374 activeElementID = null;
17375 lastSelection = null;
17376 break;
17377
17378 // Don't fire the event while the user is dragging. This matches the
17379 // semantics of the native select event.
17380 case topLevelTypes.topMouseDown:
17381 mouseDown = true;
17382 break;
17383 case topLevelTypes.topContextMenu:
17384 case topLevelTypes.topMouseUp:
17385 mouseDown = false;
17386 return constructSelectEvent(nativeEvent, nativeEventTarget);
17387
17388 // Chrome and IE fire non-standard event when selection is changed (and
17389 // sometimes when it hasn't). IE's event fires out of order with respect
17390 // to key and input events on deletion, so we discard it.
17391 //
17392 // Firefox doesn't support selectionchange, so check selection status
17393 // after each key entry. The selection changes after keydown and before
17394 // keyup, but we check on keydown as well in the case of holding down a
17395 // key, when multiple keydown events are fired but only one keyup is.
17396 // This is also our approach for IE handling, for the reason above.
17397 case topLevelTypes.topSelectionChange:
17398 if (skipSelectionChangeEvent) {
17399 break;
17400 }
17401 // falls through
17402 case topLevelTypes.topKeyDown:
17403 case topLevelTypes.topKeyUp:
17404 return constructSelectEvent(nativeEvent, nativeEventTarget);
17405 }
17406
17407 return null;
17408 },
17409
17410 didPutListener: function (id, registrationName, listener) {
17411 if (registrationName === ON_SELECT_KEY) {
17412 hasListener = true;
17413 }
17414 }
17415 };
17416
17417 module.exports = SelectEventPlugin;
17418
17419/***/ }),
17420/* 132 */
17421/***/ (function(module, exports) {
17422
17423 /**
17424 * Copyright 2013-2015, Facebook, Inc.
17425 * All rights reserved.
17426 *
17427 * This source code is licensed under the BSD-style license found in the
17428 * LICENSE file in the root directory of this source tree. An additional grant
17429 * of patent rights can be found in the PATENTS file in the same directory.
17430 *
17431 * @providesModule ServerReactRootIndex
17432 * @typechecks
17433 */
17434
17435 'use strict';
17436
17437 /**
17438 * Size of the reactRoot ID space. We generate random numbers for React root
17439 * IDs and if there's a collision the events and DOM update system will
17440 * get confused. In the future we need a way to generate GUIDs but for
17441 * now this will work on a smaller scale.
17442 */
17443 var GLOBAL_MOUNT_POINT_MAX = Math.pow(2, 53);
17444
17445 var ServerReactRootIndex = {
17446 createReactRootIndex: function () {
17447 return Math.ceil(Math.random() * GLOBAL_MOUNT_POINT_MAX);
17448 }
17449 };
17450
17451 module.exports = ServerReactRootIndex;
17452
17453/***/ }),
17454/* 133 */
17455/***/ (function(module, exports, __webpack_require__) {
17456
17457 /* WEBPACK VAR INJECTION */(function(process) {/**
17458 * Copyright 2013-2015, Facebook, Inc.
17459 * All rights reserved.
17460 *
17461 * This source code is licensed under the BSD-style license found in the
17462 * LICENSE file in the root directory of this source tree. An additional grant
17463 * of patent rights can be found in the PATENTS file in the same directory.
17464 *
17465 * @providesModule SimpleEventPlugin
17466 */
17467
17468 'use strict';
17469
17470 var EventConstants = __webpack_require__(31);
17471 var EventListener = __webpack_require__(120);
17472 var EventPropagators = __webpack_require__(74);
17473 var ReactMount = __webpack_require__(29);
17474 var SyntheticClipboardEvent = __webpack_require__(134);
17475 var SyntheticEvent = __webpack_require__(78);
17476 var SyntheticFocusEvent = __webpack_require__(135);
17477 var SyntheticKeyboardEvent = __webpack_require__(136);
17478 var SyntheticMouseEvent = __webpack_require__(87);
17479 var SyntheticDragEvent = __webpack_require__(139);
17480 var SyntheticTouchEvent = __webpack_require__(140);
17481 var SyntheticUIEvent = __webpack_require__(88);
17482 var SyntheticWheelEvent = __webpack_require__(141);
17483
17484 var emptyFunction = __webpack_require__(16);
17485 var getEventCharCode = __webpack_require__(137);
17486 var invariant = __webpack_require__(14);
17487 var keyOf = __webpack_require__(80);
17488
17489 var topLevelTypes = EventConstants.topLevelTypes;
17490
17491 var eventTypes = {
17492 abort: {
17493 phasedRegistrationNames: {
17494 bubbled: keyOf({ onAbort: true }),
17495 captured: keyOf({ onAbortCapture: true })
17496 }
17497 },
17498 blur: {
17499 phasedRegistrationNames: {
17500 bubbled: keyOf({ onBlur: true }),
17501 captured: keyOf({ onBlurCapture: true })
17502 }
17503 },
17504 canPlay: {
17505 phasedRegistrationNames: {
17506 bubbled: keyOf({ onCanPlay: true }),
17507 captured: keyOf({ onCanPlayCapture: true })
17508 }
17509 },
17510 canPlayThrough: {
17511 phasedRegistrationNames: {
17512 bubbled: keyOf({ onCanPlayThrough: true }),
17513 captured: keyOf({ onCanPlayThroughCapture: true })
17514 }
17515 },
17516 click: {
17517 phasedRegistrationNames: {
17518 bubbled: keyOf({ onClick: true }),
17519 captured: keyOf({ onClickCapture: true })
17520 }
17521 },
17522 contextMenu: {
17523 phasedRegistrationNames: {
17524 bubbled: keyOf({ onContextMenu: true }),
17525 captured: keyOf({ onContextMenuCapture: true })
17526 }
17527 },
17528 copy: {
17529 phasedRegistrationNames: {
17530 bubbled: keyOf({ onCopy: true }),
17531 captured: keyOf({ onCopyCapture: true })
17532 }
17533 },
17534 cut: {
17535 phasedRegistrationNames: {
17536 bubbled: keyOf({ onCut: true }),
17537 captured: keyOf({ onCutCapture: true })
17538 }
17539 },
17540 doubleClick: {
17541 phasedRegistrationNames: {
17542 bubbled: keyOf({ onDoubleClick: true }),
17543 captured: keyOf({ onDoubleClickCapture: true })
17544 }
17545 },
17546 drag: {
17547 phasedRegistrationNames: {
17548 bubbled: keyOf({ onDrag: true }),
17549 captured: keyOf({ onDragCapture: true })
17550 }
17551 },
17552 dragEnd: {
17553 phasedRegistrationNames: {
17554 bubbled: keyOf({ onDragEnd: true }),
17555 captured: keyOf({ onDragEndCapture: true })
17556 }
17557 },
17558 dragEnter: {
17559 phasedRegistrationNames: {
17560 bubbled: keyOf({ onDragEnter: true }),
17561 captured: keyOf({ onDragEnterCapture: true })
17562 }
17563 },
17564 dragExit: {
17565 phasedRegistrationNames: {
17566 bubbled: keyOf({ onDragExit: true }),
17567 captured: keyOf({ onDragExitCapture: true })
17568 }
17569 },
17570 dragLeave: {
17571 phasedRegistrationNames: {
17572 bubbled: keyOf({ onDragLeave: true }),
17573 captured: keyOf({ onDragLeaveCapture: true })
17574 }
17575 },
17576 dragOver: {
17577 phasedRegistrationNames: {
17578 bubbled: keyOf({ onDragOver: true }),
17579 captured: keyOf({ onDragOverCapture: true })
17580 }
17581 },
17582 dragStart: {
17583 phasedRegistrationNames: {
17584 bubbled: keyOf({ onDragStart: true }),
17585 captured: keyOf({ onDragStartCapture: true })
17586 }
17587 },
17588 drop: {
17589 phasedRegistrationNames: {
17590 bubbled: keyOf({ onDrop: true }),
17591 captured: keyOf({ onDropCapture: true })
17592 }
17593 },
17594 durationChange: {
17595 phasedRegistrationNames: {
17596 bubbled: keyOf({ onDurationChange: true }),
17597 captured: keyOf({ onDurationChangeCapture: true })
17598 }
17599 },
17600 emptied: {
17601 phasedRegistrationNames: {
17602 bubbled: keyOf({ onEmptied: true }),
17603 captured: keyOf({ onEmptiedCapture: true })
17604 }
17605 },
17606 encrypted: {
17607 phasedRegistrationNames: {
17608 bubbled: keyOf({ onEncrypted: true }),
17609 captured: keyOf({ onEncryptedCapture: true })
17610 }
17611 },
17612 ended: {
17613 phasedRegistrationNames: {
17614 bubbled: keyOf({ onEnded: true }),
17615 captured: keyOf({ onEndedCapture: true })
17616 }
17617 },
17618 error: {
17619 phasedRegistrationNames: {
17620 bubbled: keyOf({ onError: true }),
17621 captured: keyOf({ onErrorCapture: true })
17622 }
17623 },
17624 focus: {
17625 phasedRegistrationNames: {
17626 bubbled: keyOf({ onFocus: true }),
17627 captured: keyOf({ onFocusCapture: true })
17628 }
17629 },
17630 input: {
17631 phasedRegistrationNames: {
17632 bubbled: keyOf({ onInput: true }),
17633 captured: keyOf({ onInputCapture: true })
17634 }
17635 },
17636 keyDown: {
17637 phasedRegistrationNames: {
17638 bubbled: keyOf({ onKeyDown: true }),
17639 captured: keyOf({ onKeyDownCapture: true })
17640 }
17641 },
17642 keyPress: {
17643 phasedRegistrationNames: {
17644 bubbled: keyOf({ onKeyPress: true }),
17645 captured: keyOf({ onKeyPressCapture: true })
17646 }
17647 },
17648 keyUp: {
17649 phasedRegistrationNames: {
17650 bubbled: keyOf({ onKeyUp: true }),
17651 captured: keyOf({ onKeyUpCapture: true })
17652 }
17653 },
17654 load: {
17655 phasedRegistrationNames: {
17656 bubbled: keyOf({ onLoad: true }),
17657 captured: keyOf({ onLoadCapture: true })
17658 }
17659 },
17660 loadedData: {
17661 phasedRegistrationNames: {
17662 bubbled: keyOf({ onLoadedData: true }),
17663 captured: keyOf({ onLoadedDataCapture: true })
17664 }
17665 },
17666 loadedMetadata: {
17667 phasedRegistrationNames: {
17668 bubbled: keyOf({ onLoadedMetadata: true }),
17669 captured: keyOf({ onLoadedMetadataCapture: true })
17670 }
17671 },
17672 loadStart: {
17673 phasedRegistrationNames: {
17674 bubbled: keyOf({ onLoadStart: true }),
17675 captured: keyOf({ onLoadStartCapture: true })
17676 }
17677 },
17678 // Note: We do not allow listening to mouseOver events. Instead, use the
17679 // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
17680 mouseDown: {
17681 phasedRegistrationNames: {
17682 bubbled: keyOf({ onMouseDown: true }),
17683 captured: keyOf({ onMouseDownCapture: true })
17684 }
17685 },
17686 mouseMove: {
17687 phasedRegistrationNames: {
17688 bubbled: keyOf({ onMouseMove: true }),
17689 captured: keyOf({ onMouseMoveCapture: true })
17690 }
17691 },
17692 mouseOut: {
17693 phasedRegistrationNames: {
17694 bubbled: keyOf({ onMouseOut: true }),
17695 captured: keyOf({ onMouseOutCapture: true })
17696 }
17697 },
17698 mouseOver: {
17699 phasedRegistrationNames: {
17700 bubbled: keyOf({ onMouseOver: true }),
17701 captured: keyOf({ onMouseOverCapture: true })
17702 }
17703 },
17704 mouseUp: {
17705 phasedRegistrationNames: {
17706 bubbled: keyOf({ onMouseUp: true }),
17707 captured: keyOf({ onMouseUpCapture: true })
17708 }
17709 },
17710 paste: {
17711 phasedRegistrationNames: {
17712 bubbled: keyOf({ onPaste: true }),
17713 captured: keyOf({ onPasteCapture: true })
17714 }
17715 },
17716 pause: {
17717 phasedRegistrationNames: {
17718 bubbled: keyOf({ onPause: true }),
17719 captured: keyOf({ onPauseCapture: true })
17720 }
17721 },
17722 play: {
17723 phasedRegistrationNames: {
17724 bubbled: keyOf({ onPlay: true }),
17725 captured: keyOf({ onPlayCapture: true })
17726 }
17727 },
17728 playing: {
17729 phasedRegistrationNames: {
17730 bubbled: keyOf({ onPlaying: true }),
17731 captured: keyOf({ onPlayingCapture: true })
17732 }
17733 },
17734 progress: {
17735 phasedRegistrationNames: {
17736 bubbled: keyOf({ onProgress: true }),
17737 captured: keyOf({ onProgressCapture: true })
17738 }
17739 },
17740 rateChange: {
17741 phasedRegistrationNames: {
17742 bubbled: keyOf({ onRateChange: true }),
17743 captured: keyOf({ onRateChangeCapture: true })
17744 }
17745 },
17746 reset: {
17747 phasedRegistrationNames: {
17748 bubbled: keyOf({ onReset: true }),
17749 captured: keyOf({ onResetCapture: true })
17750 }
17751 },
17752 scroll: {
17753 phasedRegistrationNames: {
17754 bubbled: keyOf({ onScroll: true }),
17755 captured: keyOf({ onScrollCapture: true })
17756 }
17757 },
17758 seeked: {
17759 phasedRegistrationNames: {
17760 bubbled: keyOf({ onSeeked: true }),
17761 captured: keyOf({ onSeekedCapture: true })
17762 }
17763 },
17764 seeking: {
17765 phasedRegistrationNames: {
17766 bubbled: keyOf({ onSeeking: true }),
17767 captured: keyOf({ onSeekingCapture: true })
17768 }
17769 },
17770 stalled: {
17771 phasedRegistrationNames: {
17772 bubbled: keyOf({ onStalled: true }),
17773 captured: keyOf({ onStalledCapture: true })
17774 }
17775 },
17776 submit: {
17777 phasedRegistrationNames: {
17778 bubbled: keyOf({ onSubmit: true }),
17779 captured: keyOf({ onSubmitCapture: true })
17780 }
17781 },
17782 suspend: {
17783 phasedRegistrationNames: {
17784 bubbled: keyOf({ onSuspend: true }),
17785 captured: keyOf({ onSuspendCapture: true })
17786 }
17787 },
17788 timeUpdate: {
17789 phasedRegistrationNames: {
17790 bubbled: keyOf({ onTimeUpdate: true }),
17791 captured: keyOf({ onTimeUpdateCapture: true })
17792 }
17793 },
17794 touchCancel: {
17795 phasedRegistrationNames: {
17796 bubbled: keyOf({ onTouchCancel: true }),
17797 captured: keyOf({ onTouchCancelCapture: true })
17798 }
17799 },
17800 touchEnd: {
17801 phasedRegistrationNames: {
17802 bubbled: keyOf({ onTouchEnd: true }),
17803 captured: keyOf({ onTouchEndCapture: true })
17804 }
17805 },
17806 touchMove: {
17807 phasedRegistrationNames: {
17808 bubbled: keyOf({ onTouchMove: true }),
17809 captured: keyOf({ onTouchMoveCapture: true })
17810 }
17811 },
17812 touchStart: {
17813 phasedRegistrationNames: {
17814 bubbled: keyOf({ onTouchStart: true }),
17815 captured: keyOf({ onTouchStartCapture: true })
17816 }
17817 },
17818 volumeChange: {
17819 phasedRegistrationNames: {
17820 bubbled: keyOf({ onVolumeChange: true }),
17821 captured: keyOf({ onVolumeChangeCapture: true })
17822 }
17823 },
17824 waiting: {
17825 phasedRegistrationNames: {
17826 bubbled: keyOf({ onWaiting: true }),
17827 captured: keyOf({ onWaitingCapture: true })
17828 }
17829 },
17830 wheel: {
17831 phasedRegistrationNames: {
17832 bubbled: keyOf({ onWheel: true }),
17833 captured: keyOf({ onWheelCapture: true })
17834 }
17835 }
17836 };
17837
17838 var topLevelEventsToDispatchConfig = {
17839 topAbort: eventTypes.abort,
17840 topBlur: eventTypes.blur,
17841 topCanPlay: eventTypes.canPlay,
17842 topCanPlayThrough: eventTypes.canPlayThrough,
17843 topClick: eventTypes.click,
17844 topContextMenu: eventTypes.contextMenu,
17845 topCopy: eventTypes.copy,
17846 topCut: eventTypes.cut,
17847 topDoubleClick: eventTypes.doubleClick,
17848 topDrag: eventTypes.drag,
17849 topDragEnd: eventTypes.dragEnd,
17850 topDragEnter: eventTypes.dragEnter,
17851 topDragExit: eventTypes.dragExit,
17852 topDragLeave: eventTypes.dragLeave,
17853 topDragOver: eventTypes.dragOver,
17854 topDragStart: eventTypes.dragStart,
17855 topDrop: eventTypes.drop,
17856 topDurationChange: eventTypes.durationChange,
17857 topEmptied: eventTypes.emptied,
17858 topEncrypted: eventTypes.encrypted,
17859 topEnded: eventTypes.ended,
17860 topError: eventTypes.error,
17861 topFocus: eventTypes.focus,
17862 topInput: eventTypes.input,
17863 topKeyDown: eventTypes.keyDown,
17864 topKeyPress: eventTypes.keyPress,
17865 topKeyUp: eventTypes.keyUp,
17866 topLoad: eventTypes.load,
17867 topLoadedData: eventTypes.loadedData,
17868 topLoadedMetadata: eventTypes.loadedMetadata,
17869 topLoadStart: eventTypes.loadStart,
17870 topMouseDown: eventTypes.mouseDown,
17871 topMouseMove: eventTypes.mouseMove,
17872 topMouseOut: eventTypes.mouseOut,
17873 topMouseOver: eventTypes.mouseOver,
17874 topMouseUp: eventTypes.mouseUp,
17875 topPaste: eventTypes.paste,
17876 topPause: eventTypes.pause,
17877 topPlay: eventTypes.play,
17878 topPlaying: eventTypes.playing,
17879 topProgress: eventTypes.progress,
17880 topRateChange: eventTypes.rateChange,
17881 topReset: eventTypes.reset,
17882 topScroll: eventTypes.scroll,
17883 topSeeked: eventTypes.seeked,
17884 topSeeking: eventTypes.seeking,
17885 topStalled: eventTypes.stalled,
17886 topSubmit: eventTypes.submit,
17887 topSuspend: eventTypes.suspend,
17888 topTimeUpdate: eventTypes.timeUpdate,
17889 topTouchCancel: eventTypes.touchCancel,
17890 topTouchEnd: eventTypes.touchEnd,
17891 topTouchMove: eventTypes.touchMove,
17892 topTouchStart: eventTypes.touchStart,
17893 topVolumeChange: eventTypes.volumeChange,
17894 topWaiting: eventTypes.waiting,
17895 topWheel: eventTypes.wheel
17896 };
17897
17898 for (var type in topLevelEventsToDispatchConfig) {
17899 topLevelEventsToDispatchConfig[type].dependencies = [type];
17900 }
17901
17902 var ON_CLICK_KEY = keyOf({ onClick: null });
17903 var onClickListeners = {};
17904
17905 var SimpleEventPlugin = {
17906
17907 eventTypes: eventTypes,
17908
17909 /**
17910 * @param {string} topLevelType Record from `EventConstants`.
17911 * @param {DOMEventTarget} topLevelTarget The listening component root node.
17912 * @param {string} topLevelTargetID ID of `topLevelTarget`.
17913 * @param {object} nativeEvent Native browser event.
17914 * @return {*} An accumulation of synthetic events.
17915 * @see {EventPluginHub.extractEvents}
17916 */
17917 extractEvents: function (topLevelType, topLevelTarget, topLevelTargetID, nativeEvent, nativeEventTarget) {
17918 var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
17919 if (!dispatchConfig) {
17920 return null;
17921 }
17922 var EventConstructor;
17923 switch (topLevelType) {
17924 case topLevelTypes.topAbort:
17925 case topLevelTypes.topCanPlay:
17926 case topLevelTypes.topCanPlayThrough:
17927 case topLevelTypes.topDurationChange:
17928 case topLevelTypes.topEmptied:
17929 case topLevelTypes.topEncrypted:
17930 case topLevelTypes.topEnded:
17931 case topLevelTypes.topError:
17932 case topLevelTypes.topInput:
17933 case topLevelTypes.topLoad:
17934 case topLevelTypes.topLoadedData:
17935 case topLevelTypes.topLoadedMetadata:
17936 case topLevelTypes.topLoadStart:
17937 case topLevelTypes.topPause:
17938 case topLevelTypes.topPlay:
17939 case topLevelTypes.topPlaying:
17940 case topLevelTypes.topProgress:
17941 case topLevelTypes.topRateChange:
17942 case topLevelTypes.topReset:
17943 case topLevelTypes.topSeeked:
17944 case topLevelTypes.topSeeking:
17945 case topLevelTypes.topStalled:
17946 case topLevelTypes.topSubmit:
17947 case topLevelTypes.topSuspend:
17948 case topLevelTypes.topTimeUpdate:
17949 case topLevelTypes.topVolumeChange:
17950 case topLevelTypes.topWaiting:
17951 // HTML Events
17952 // @see http://www.w3.org/TR/html5/index.html#events-0
17953 EventConstructor = SyntheticEvent;
17954 break;
17955 case topLevelTypes.topKeyPress:
17956 // FireFox creates a keypress event for function keys too. This removes
17957 // the unwanted keypress events. Enter is however both printable and
17958 // non-printable. One would expect Tab to be as well (but it isn't).
17959 if (getEventCharCode(nativeEvent) === 0) {
17960 return null;
17961 }
17962 /* falls through */
17963 case topLevelTypes.topKeyDown:
17964 case topLevelTypes.topKeyUp:
17965 EventConstructor = SyntheticKeyboardEvent;
17966 break;
17967 case topLevelTypes.topBlur:
17968 case topLevelTypes.topFocus:
17969 EventConstructor = SyntheticFocusEvent;
17970 break;
17971 case topLevelTypes.topClick:
17972 // Firefox creates a click event on right mouse clicks. This removes the
17973 // unwanted click events.
17974 if (nativeEvent.button === 2) {
17975 return null;
17976 }
17977 /* falls through */
17978 case topLevelTypes.topContextMenu:
17979 case topLevelTypes.topDoubleClick:
17980 case topLevelTypes.topMouseDown:
17981 case topLevelTypes.topMouseMove:
17982 case topLevelTypes.topMouseOut:
17983 case topLevelTypes.topMouseOver:
17984 case topLevelTypes.topMouseUp:
17985 EventConstructor = SyntheticMouseEvent;
17986 break;
17987 case topLevelTypes.topDrag:
17988 case topLevelTypes.topDragEnd:
17989 case topLevelTypes.topDragEnter:
17990 case topLevelTypes.topDragExit:
17991 case topLevelTypes.topDragLeave:
17992 case topLevelTypes.topDragOver:
17993 case topLevelTypes.topDragStart:
17994 case topLevelTypes.topDrop:
17995 EventConstructor = SyntheticDragEvent;
17996 break;
17997 case topLevelTypes.topTouchCancel:
17998 case topLevelTypes.topTouchEnd:
17999 case topLevelTypes.topTouchMove:
18000 case topLevelTypes.topTouchStart:
18001 EventConstructor = SyntheticTouchEvent;
18002 break;
18003 case topLevelTypes.topScroll:
18004 EventConstructor = SyntheticUIEvent;
18005 break;
18006 case topLevelTypes.topWheel:
18007 EventConstructor = SyntheticWheelEvent;
18008 break;
18009 case topLevelTypes.topCopy:
18010 case topLevelTypes.topCut:
18011 case topLevelTypes.topPaste:
18012 EventConstructor = SyntheticClipboardEvent;
18013 break;
18014 }
18015 !EventConstructor ? process.env.NODE_ENV !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : undefined;
18016 var event = EventConstructor.getPooled(dispatchConfig, topLevelTargetID, nativeEvent, nativeEventTarget);
18017 EventPropagators.accumulateTwoPhaseDispatches(event);
18018 return event;
18019 },
18020
18021 didPutListener: function (id, registrationName, listener) {
18022 // Mobile Safari does not fire properly bubble click events on
18023 // non-interactive elements, which means delegated click listeners do not
18024 // fire. The workaround for this bug involves attaching an empty click
18025 // listener on the target node.
18026 if (registrationName === ON_CLICK_KEY) {
18027 var node = ReactMount.getNode(id);
18028 if (!onClickListeners[id]) {
18029 onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);
18030 }
18031 }
18032 },
18033
18034 willDeleteListener: function (id, registrationName) {
18035 if (registrationName === ON_CLICK_KEY) {
18036 onClickListeners[id].remove();
18037 delete onClickListeners[id];
18038 }
18039 }
18040
18041 };
18042
18043 module.exports = SimpleEventPlugin;
18044 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
18045
18046/***/ }),
18047/* 134 */
18048/***/ (function(module, exports, __webpack_require__) {
18049
18050 /**
18051 * Copyright 2013-2015, Facebook, Inc.
18052 * All rights reserved.
18053 *
18054 * This source code is licensed under the BSD-style license found in the
18055 * LICENSE file in the root directory of this source tree. An additional grant
18056 * of patent rights can be found in the PATENTS file in the same directory.
18057 *
18058 * @providesModule SyntheticClipboardEvent
18059 * @typechecks static-only
18060 */
18061
18062 'use strict';
18063
18064 var SyntheticEvent = __webpack_require__(78);
18065
18066 /**
18067 * @interface Event
18068 * @see http://www.w3.org/TR/clipboard-apis/
18069 */
18070 var ClipboardEventInterface = {
18071 clipboardData: function (event) {
18072 return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
18073 }
18074 };
18075
18076 /**
18077 * @param {object} dispatchConfig Configuration used to dispatch this event.
18078 * @param {string} dispatchMarker Marker identifying the event target.
18079 * @param {object} nativeEvent Native browser event.
18080 * @extends {SyntheticUIEvent}
18081 */
18082 function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18083 SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18084 }
18085
18086 SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
18087
18088 module.exports = SyntheticClipboardEvent;
18089
18090/***/ }),
18091/* 135 */
18092/***/ (function(module, exports, __webpack_require__) {
18093
18094 /**
18095 * Copyright 2013-2015, Facebook, Inc.
18096 * All rights reserved.
18097 *
18098 * This source code is licensed under the BSD-style license found in the
18099 * LICENSE file in the root directory of this source tree. An additional grant
18100 * of patent rights can be found in the PATENTS file in the same directory.
18101 *
18102 * @providesModule SyntheticFocusEvent
18103 * @typechecks static-only
18104 */
18105
18106 'use strict';
18107
18108 var SyntheticUIEvent = __webpack_require__(88);
18109
18110 /**
18111 * @interface FocusEvent
18112 * @see http://www.w3.org/TR/DOM-Level-3-Events/
18113 */
18114 var FocusEventInterface = {
18115 relatedTarget: null
18116 };
18117
18118 /**
18119 * @param {object} dispatchConfig Configuration used to dispatch this event.
18120 * @param {string} dispatchMarker Marker identifying the event target.
18121 * @param {object} nativeEvent Native browser event.
18122 * @extends {SyntheticUIEvent}
18123 */
18124 function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18125 SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18126 }
18127
18128 SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
18129
18130 module.exports = SyntheticFocusEvent;
18131
18132/***/ }),
18133/* 136 */
18134/***/ (function(module, exports, __webpack_require__) {
18135
18136 /**
18137 * Copyright 2013-2015, Facebook, Inc.
18138 * All rights reserved.
18139 *
18140 * This source code is licensed under the BSD-style license found in the
18141 * LICENSE file in the root directory of this source tree. An additional grant
18142 * of patent rights can be found in the PATENTS file in the same directory.
18143 *
18144 * @providesModule SyntheticKeyboardEvent
18145 * @typechecks static-only
18146 */
18147
18148 'use strict';
18149
18150 var SyntheticUIEvent = __webpack_require__(88);
18151
18152 var getEventCharCode = __webpack_require__(137);
18153 var getEventKey = __webpack_require__(138);
18154 var getEventModifierState = __webpack_require__(89);
18155
18156 /**
18157 * @interface KeyboardEvent
18158 * @see http://www.w3.org/TR/DOM-Level-3-Events/
18159 */
18160 var KeyboardEventInterface = {
18161 key: getEventKey,
18162 location: null,
18163 ctrlKey: null,
18164 shiftKey: null,
18165 altKey: null,
18166 metaKey: null,
18167 repeat: null,
18168 locale: null,
18169 getModifierState: getEventModifierState,
18170 // Legacy Interface
18171 charCode: function (event) {
18172 // `charCode` is the result of a KeyPress event and represents the value of
18173 // the actual printable character.
18174
18175 // KeyPress is deprecated, but its replacement is not yet final and not
18176 // implemented in any major browser. Only KeyPress has charCode.
18177 if (event.type === 'keypress') {
18178 return getEventCharCode(event);
18179 }
18180 return 0;
18181 },
18182 keyCode: function (event) {
18183 // `keyCode` is the result of a KeyDown/Up event and represents the value of
18184 // physical keyboard key.
18185
18186 // The actual meaning of the value depends on the users' keyboard layout
18187 // which cannot be detected. Assuming that it is a US keyboard layout
18188 // provides a surprisingly accurate mapping for US and European users.
18189 // Due to this, it is left to the user to implement at this time.
18190 if (event.type === 'keydown' || event.type === 'keyup') {
18191 return event.keyCode;
18192 }
18193 return 0;
18194 },
18195 which: function (event) {
18196 // `which` is an alias for either `keyCode` or `charCode` depending on the
18197 // type of the event.
18198 if (event.type === 'keypress') {
18199 return getEventCharCode(event);
18200 }
18201 if (event.type === 'keydown' || event.type === 'keyup') {
18202 return event.keyCode;
18203 }
18204 return 0;
18205 }
18206 };
18207
18208 /**
18209 * @param {object} dispatchConfig Configuration used to dispatch this event.
18210 * @param {string} dispatchMarker Marker identifying the event target.
18211 * @param {object} nativeEvent Native browser event.
18212 * @extends {SyntheticUIEvent}
18213 */
18214 function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18215 SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18216 }
18217
18218 SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
18219
18220 module.exports = SyntheticKeyboardEvent;
18221
18222/***/ }),
18223/* 137 */
18224/***/ (function(module, exports) {
18225
18226 /**
18227 * Copyright 2013-2015, Facebook, Inc.
18228 * All rights reserved.
18229 *
18230 * This source code is licensed under the BSD-style license found in the
18231 * LICENSE file in the root directory of this source tree. An additional grant
18232 * of patent rights can be found in the PATENTS file in the same directory.
18233 *
18234 * @providesModule getEventCharCode
18235 * @typechecks static-only
18236 */
18237
18238 'use strict';
18239
18240 /**
18241 * `charCode` represents the actual "character code" and is safe to use with
18242 * `String.fromCharCode`. As such, only keys that correspond to printable
18243 * characters produce a valid `charCode`, the only exception to this is Enter.
18244 * The Tab-key is considered non-printable and does not have a `charCode`,
18245 * presumably because it does not produce a tab-character in browsers.
18246 *
18247 * @param {object} nativeEvent Native browser event.
18248 * @return {number} Normalized `charCode` property.
18249 */
18250 function getEventCharCode(nativeEvent) {
18251 var charCode;
18252 var keyCode = nativeEvent.keyCode;
18253
18254 if ('charCode' in nativeEvent) {
18255 charCode = nativeEvent.charCode;
18256
18257 // FF does not set `charCode` for the Enter-key, check against `keyCode`.
18258 if (charCode === 0 && keyCode === 13) {
18259 charCode = 13;
18260 }
18261 } else {
18262 // IE8 does not implement `charCode`, but `keyCode` has the correct value.
18263 charCode = keyCode;
18264 }
18265
18266 // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
18267 // Must not discard the (non-)printable Enter-key.
18268 if (charCode >= 32 || charCode === 13) {
18269 return charCode;
18270 }
18271
18272 return 0;
18273 }
18274
18275 module.exports = getEventCharCode;
18276
18277/***/ }),
18278/* 138 */
18279/***/ (function(module, exports, __webpack_require__) {
18280
18281 /**
18282 * Copyright 2013-2015, Facebook, Inc.
18283 * All rights reserved.
18284 *
18285 * This source code is licensed under the BSD-style license found in the
18286 * LICENSE file in the root directory of this source tree. An additional grant
18287 * of patent rights can be found in the PATENTS file in the same directory.
18288 *
18289 * @providesModule getEventKey
18290 * @typechecks static-only
18291 */
18292
18293 'use strict';
18294
18295 var getEventCharCode = __webpack_require__(137);
18296
18297 /**
18298 * Normalization of deprecated HTML5 `key` values
18299 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
18300 */
18301 var normalizeKey = {
18302 'Esc': 'Escape',
18303 'Spacebar': ' ',
18304 'Left': 'ArrowLeft',
18305 'Up': 'ArrowUp',
18306 'Right': 'ArrowRight',
18307 'Down': 'ArrowDown',
18308 'Del': 'Delete',
18309 'Win': 'OS',
18310 'Menu': 'ContextMenu',
18311 'Apps': 'ContextMenu',
18312 'Scroll': 'ScrollLock',
18313 'MozPrintableKey': 'Unidentified'
18314 };
18315
18316 /**
18317 * Translation from legacy `keyCode` to HTML5 `key`
18318 * Only special keys supported, all others depend on keyboard layout or browser
18319 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
18320 */
18321 var translateToKey = {
18322 8: 'Backspace',
18323 9: 'Tab',
18324 12: 'Clear',
18325 13: 'Enter',
18326 16: 'Shift',
18327 17: 'Control',
18328 18: 'Alt',
18329 19: 'Pause',
18330 20: 'CapsLock',
18331 27: 'Escape',
18332 32: ' ',
18333 33: 'PageUp',
18334 34: 'PageDown',
18335 35: 'End',
18336 36: 'Home',
18337 37: 'ArrowLeft',
18338 38: 'ArrowUp',
18339 39: 'ArrowRight',
18340 40: 'ArrowDown',
18341 45: 'Insert',
18342 46: 'Delete',
18343 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
18344 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
18345 144: 'NumLock',
18346 145: 'ScrollLock',
18347 224: 'Meta'
18348 };
18349
18350 /**
18351 * @param {object} nativeEvent Native browser event.
18352 * @return {string} Normalized `key` property.
18353 */
18354 function getEventKey(nativeEvent) {
18355 if (nativeEvent.key) {
18356 // Normalize inconsistent values reported by browsers due to
18357 // implementations of a working draft specification.
18358
18359 // FireFox implements `key` but returns `MozPrintableKey` for all
18360 // printable characters (normalized to `Unidentified`), ignore it.
18361 var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
18362 if (key !== 'Unidentified') {
18363 return key;
18364 }
18365 }
18366
18367 // Browser does not implement `key`, polyfill as much of it as we can.
18368 if (nativeEvent.type === 'keypress') {
18369 var charCode = getEventCharCode(nativeEvent);
18370
18371 // The enter-key is technically both printable and non-printable and can
18372 // thus be captured by `keypress`, no other non-printable key should.
18373 return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
18374 }
18375 if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
18376 // While user keyboard layout determines the actual meaning of each
18377 // `keyCode` value, almost all function keys have a universal value.
18378 return translateToKey[nativeEvent.keyCode] || 'Unidentified';
18379 }
18380 return '';
18381 }
18382
18383 module.exports = getEventKey;
18384
18385/***/ }),
18386/* 139 */
18387/***/ (function(module, exports, __webpack_require__) {
18388
18389 /**
18390 * Copyright 2013-2015, Facebook, Inc.
18391 * All rights reserved.
18392 *
18393 * This source code is licensed under the BSD-style license found in the
18394 * LICENSE file in the root directory of this source tree. An additional grant
18395 * of patent rights can be found in the PATENTS file in the same directory.
18396 *
18397 * @providesModule SyntheticDragEvent
18398 * @typechecks static-only
18399 */
18400
18401 'use strict';
18402
18403 var SyntheticMouseEvent = __webpack_require__(87);
18404
18405 /**
18406 * @interface DragEvent
18407 * @see http://www.w3.org/TR/DOM-Level-3-Events/
18408 */
18409 var DragEventInterface = {
18410 dataTransfer: null
18411 };
18412
18413 /**
18414 * @param {object} dispatchConfig Configuration used to dispatch this event.
18415 * @param {string} dispatchMarker Marker identifying the event target.
18416 * @param {object} nativeEvent Native browser event.
18417 * @extends {SyntheticUIEvent}
18418 */
18419 function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18420 SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18421 }
18422
18423 SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
18424
18425 module.exports = SyntheticDragEvent;
18426
18427/***/ }),
18428/* 140 */
18429/***/ (function(module, exports, __webpack_require__) {
18430
18431 /**
18432 * Copyright 2013-2015, Facebook, Inc.
18433 * All rights reserved.
18434 *
18435 * This source code is licensed under the BSD-style license found in the
18436 * LICENSE file in the root directory of this source tree. An additional grant
18437 * of patent rights can be found in the PATENTS file in the same directory.
18438 *
18439 * @providesModule SyntheticTouchEvent
18440 * @typechecks static-only
18441 */
18442
18443 'use strict';
18444
18445 var SyntheticUIEvent = __webpack_require__(88);
18446
18447 var getEventModifierState = __webpack_require__(89);
18448
18449 /**
18450 * @interface TouchEvent
18451 * @see http://www.w3.org/TR/touch-events/
18452 */
18453 var TouchEventInterface = {
18454 touches: null,
18455 targetTouches: null,
18456 changedTouches: null,
18457 altKey: null,
18458 metaKey: null,
18459 ctrlKey: null,
18460 shiftKey: null,
18461 getModifierState: getEventModifierState
18462 };
18463
18464 /**
18465 * @param {object} dispatchConfig Configuration used to dispatch this event.
18466 * @param {string} dispatchMarker Marker identifying the event target.
18467 * @param {object} nativeEvent Native browser event.
18468 * @extends {SyntheticUIEvent}
18469 */
18470 function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18471 SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18472 }
18473
18474 SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
18475
18476 module.exports = SyntheticTouchEvent;
18477
18478/***/ }),
18479/* 141 */
18480/***/ (function(module, exports, __webpack_require__) {
18481
18482 /**
18483 * Copyright 2013-2015, Facebook, Inc.
18484 * All rights reserved.
18485 *
18486 * This source code is licensed under the BSD-style license found in the
18487 * LICENSE file in the root directory of this source tree. An additional grant
18488 * of patent rights can be found in the PATENTS file in the same directory.
18489 *
18490 * @providesModule SyntheticWheelEvent
18491 * @typechecks static-only
18492 */
18493
18494 'use strict';
18495
18496 var SyntheticMouseEvent = __webpack_require__(87);
18497
18498 /**
18499 * @interface WheelEvent
18500 * @see http://www.w3.org/TR/DOM-Level-3-Events/
18501 */
18502 var WheelEventInterface = {
18503 deltaX: function (event) {
18504 return 'deltaX' in event ? event.deltaX :
18505 // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
18506 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
18507 },
18508 deltaY: function (event) {
18509 return 'deltaY' in event ? event.deltaY :
18510 // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
18511 'wheelDeltaY' in event ? -event.wheelDeltaY :
18512 // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
18513 'wheelDelta' in event ? -event.wheelDelta : 0;
18514 },
18515 deltaZ: null,
18516
18517 // Browsers without "deltaMode" is reporting in raw wheel delta where one
18518 // notch on the scroll is always +/- 120, roughly equivalent to pixels.
18519 // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
18520 // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
18521 deltaMode: null
18522 };
18523
18524 /**
18525 * @param {object} dispatchConfig Configuration used to dispatch this event.
18526 * @param {string} dispatchMarker Marker identifying the event target.
18527 * @param {object} nativeEvent Native browser event.
18528 * @extends {SyntheticMouseEvent}
18529 */
18530 function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18531 SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18532 }
18533
18534 SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
18535
18536 module.exports = SyntheticWheelEvent;
18537
18538/***/ }),
18539/* 142 */
18540/***/ (function(module, exports, __webpack_require__) {
18541
18542 /**
18543 * Copyright 2013-2015, Facebook, Inc.
18544 * All rights reserved.
18545 *
18546 * This source code is licensed under the BSD-style license found in the
18547 * LICENSE file in the root directory of this source tree. An additional grant
18548 * of patent rights can be found in the PATENTS file in the same directory.
18549 *
18550 * @providesModule SVGDOMPropertyConfig
18551 */
18552
18553 'use strict';
18554
18555 var DOMProperty = __webpack_require__(24);
18556
18557 var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
18558
18559 var NS = {
18560 xlink: 'http://www.w3.org/1999/xlink',
18561 xml: 'http://www.w3.org/XML/1998/namespace'
18562 };
18563
18564 var SVGDOMPropertyConfig = {
18565 Properties: {
18566 clipPath: MUST_USE_ATTRIBUTE,
18567 cx: MUST_USE_ATTRIBUTE,
18568 cy: MUST_USE_ATTRIBUTE,
18569 d: MUST_USE_ATTRIBUTE,
18570 dx: MUST_USE_ATTRIBUTE,
18571 dy: MUST_USE_ATTRIBUTE,
18572 fill: MUST_USE_ATTRIBUTE,
18573 fillOpacity: MUST_USE_ATTRIBUTE,
18574 fontFamily: MUST_USE_ATTRIBUTE,
18575 fontSize: MUST_USE_ATTRIBUTE,
18576 fx: MUST_USE_ATTRIBUTE,
18577 fy: MUST_USE_ATTRIBUTE,
18578 gradientTransform: MUST_USE_ATTRIBUTE,
18579 gradientUnits: MUST_USE_ATTRIBUTE,
18580 markerEnd: MUST_USE_ATTRIBUTE,
18581 markerMid: MUST_USE_ATTRIBUTE,
18582 markerStart: MUST_USE_ATTRIBUTE,
18583 offset: MUST_USE_ATTRIBUTE,
18584 opacity: MUST_USE_ATTRIBUTE,
18585 patternContentUnits: MUST_USE_ATTRIBUTE,
18586 patternUnits: MUST_USE_ATTRIBUTE,
18587 points: MUST_USE_ATTRIBUTE,
18588 preserveAspectRatio: MUST_USE_ATTRIBUTE,
18589 r: MUST_USE_ATTRIBUTE,
18590 rx: MUST_USE_ATTRIBUTE,
18591 ry: MUST_USE_ATTRIBUTE,
18592 spreadMethod: MUST_USE_ATTRIBUTE,
18593 stopColor: MUST_USE_ATTRIBUTE,
18594 stopOpacity: MUST_USE_ATTRIBUTE,
18595 stroke: MUST_USE_ATTRIBUTE,
18596 strokeDasharray: MUST_USE_ATTRIBUTE,
18597 strokeLinecap: MUST_USE_ATTRIBUTE,
18598 strokeOpacity: MUST_USE_ATTRIBUTE,
18599 strokeWidth: MUST_USE_ATTRIBUTE,
18600 textAnchor: MUST_USE_ATTRIBUTE,
18601 transform: MUST_USE_ATTRIBUTE,
18602 version: MUST_USE_ATTRIBUTE,
18603 viewBox: MUST_USE_ATTRIBUTE,
18604 x1: MUST_USE_ATTRIBUTE,
18605 x2: MUST_USE_ATTRIBUTE,
18606 x: MUST_USE_ATTRIBUTE,
18607 xlinkActuate: MUST_USE_ATTRIBUTE,
18608 xlinkArcrole: MUST_USE_ATTRIBUTE,
18609 xlinkHref: MUST_USE_ATTRIBUTE,
18610 xlinkRole: MUST_USE_ATTRIBUTE,
18611 xlinkShow: MUST_USE_ATTRIBUTE,
18612 xlinkTitle: MUST_USE_ATTRIBUTE,
18613 xlinkType: MUST_USE_ATTRIBUTE,
18614 xmlBase: MUST_USE_ATTRIBUTE,
18615 xmlLang: MUST_USE_ATTRIBUTE,
18616 xmlSpace: MUST_USE_ATTRIBUTE,
18617 y1: MUST_USE_ATTRIBUTE,
18618 y2: MUST_USE_ATTRIBUTE,
18619 y: MUST_USE_ATTRIBUTE
18620 },
18621 DOMAttributeNamespaces: {
18622 xlinkActuate: NS.xlink,
18623 xlinkArcrole: NS.xlink,
18624 xlinkHref: NS.xlink,
18625 xlinkRole: NS.xlink,
18626 xlinkShow: NS.xlink,
18627 xlinkTitle: NS.xlink,
18628 xlinkType: NS.xlink,
18629 xmlBase: NS.xml,
18630 xmlLang: NS.xml,
18631 xmlSpace: NS.xml
18632 },
18633 DOMAttributeNames: {
18634 clipPath: 'clip-path',
18635 fillOpacity: 'fill-opacity',
18636 fontFamily: 'font-family',
18637 fontSize: 'font-size',
18638 gradientTransform: 'gradientTransform',
18639 gradientUnits: 'gradientUnits',
18640 markerEnd: 'marker-end',
18641 markerMid: 'marker-mid',
18642 markerStart: 'marker-start',
18643 patternContentUnits: 'patternContentUnits',
18644 patternUnits: 'patternUnits',
18645 preserveAspectRatio: 'preserveAspectRatio',
18646 spreadMethod: 'spreadMethod',
18647 stopColor: 'stop-color',
18648 stopOpacity: 'stop-opacity',
18649 strokeDasharray: 'stroke-dasharray',
18650 strokeLinecap: 'stroke-linecap',
18651 strokeOpacity: 'stroke-opacity',
18652 strokeWidth: 'stroke-width',
18653 textAnchor: 'text-anchor',
18654 viewBox: 'viewBox',
18655 xlinkActuate: 'xlink:actuate',
18656 xlinkArcrole: 'xlink:arcrole',
18657 xlinkHref: 'xlink:href',
18658 xlinkRole: 'xlink:role',
18659 xlinkShow: 'xlink:show',
18660 xlinkTitle: 'xlink:title',
18661 xlinkType: 'xlink:type',
18662 xmlBase: 'xml:base',
18663 xmlLang: 'xml:lang',
18664 xmlSpace: 'xml:space'
18665 }
18666 };
18667
18668 module.exports = SVGDOMPropertyConfig;
18669
18670/***/ }),
18671/* 143 */
18672/***/ (function(module, exports, __webpack_require__) {
18673
18674 /**
18675 * Copyright 2013-2015, Facebook, Inc.
18676 * All rights reserved.
18677 *
18678 * This source code is licensed under the BSD-style license found in the
18679 * LICENSE file in the root directory of this source tree. An additional grant
18680 * of patent rights can be found in the PATENTS file in the same directory.
18681 *
18682 * @providesModule ReactDefaultPerf
18683 * @typechecks static-only
18684 */
18685
18686 'use strict';
18687
18688 var DOMProperty = __webpack_require__(24);
18689 var ReactDefaultPerfAnalysis = __webpack_require__(144);
18690 var ReactMount = __webpack_require__(29);
18691 var ReactPerf = __webpack_require__(19);
18692
18693 var performanceNow = __webpack_require__(145);
18694
18695 function roundFloat(val) {
18696 return Math.floor(val * 100) / 100;
18697 }
18698
18699 function addValue(obj, key, val) {
18700 obj[key] = (obj[key] || 0) + val;
18701 }
18702
18703 var ReactDefaultPerf = {
18704 _allMeasurements: [], // last item in the list is the current one
18705 _mountStack: [0],
18706 _injected: false,
18707
18708 start: function () {
18709 if (!ReactDefaultPerf._injected) {
18710 ReactPerf.injection.injectMeasure(ReactDefaultPerf.measure);
18711 }
18712
18713 ReactDefaultPerf._allMeasurements.length = 0;
18714 ReactPerf.enableMeasure = true;
18715 },
18716
18717 stop: function () {
18718 ReactPerf.enableMeasure = false;
18719 },
18720
18721 getLastMeasurements: function () {
18722 return ReactDefaultPerf._allMeasurements;
18723 },
18724
18725 printExclusive: function (measurements) {
18726 measurements = measurements || ReactDefaultPerf._allMeasurements;
18727 var summary = ReactDefaultPerfAnalysis.getExclusiveSummary(measurements);
18728 console.table(summary.map(function (item) {
18729 return {
18730 'Component class name': item.componentName,
18731 'Total inclusive time (ms)': roundFloat(item.inclusive),
18732 'Exclusive mount time (ms)': roundFloat(item.exclusive),
18733 'Exclusive render time (ms)': roundFloat(item.render),
18734 'Mount time per instance (ms)': roundFloat(item.exclusive / item.count),
18735 'Render time per instance (ms)': roundFloat(item.render / item.count),
18736 'Instances': item.count
18737 };
18738 }));
18739 // TODO: ReactDefaultPerfAnalysis.getTotalTime() does not return the correct
18740 // number.
18741 },
18742
18743 printInclusive: function (measurements) {
18744 measurements = measurements || ReactDefaultPerf._allMeasurements;
18745 var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements);
18746 console.table(summary.map(function (item) {
18747 return {
18748 'Owner > component': item.componentName,
18749 'Inclusive time (ms)': roundFloat(item.time),
18750 'Instances': item.count
18751 };
18752 }));
18753 console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
18754 },
18755
18756 getMeasurementsSummaryMap: function (measurements) {
18757 var summary = ReactDefaultPerfAnalysis.getInclusiveSummary(measurements, true);
18758 return summary.map(function (item) {
18759 return {
18760 'Owner > component': item.componentName,
18761 'Wasted time (ms)': item.time,
18762 'Instances': item.count
18763 };
18764 });
18765 },
18766
18767 printWasted: function (measurements) {
18768 measurements = measurements || ReactDefaultPerf._allMeasurements;
18769 console.table(ReactDefaultPerf.getMeasurementsSummaryMap(measurements));
18770 console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
18771 },
18772
18773 printDOM: function (measurements) {
18774 measurements = measurements || ReactDefaultPerf._allMeasurements;
18775 var summary = ReactDefaultPerfAnalysis.getDOMSummary(measurements);
18776 console.table(summary.map(function (item) {
18777 var result = {};
18778 result[DOMProperty.ID_ATTRIBUTE_NAME] = item.id;
18779 result.type = item.type;
18780 result.args = JSON.stringify(item.args);
18781 return result;
18782 }));
18783 console.log('Total time:', ReactDefaultPerfAnalysis.getTotalTime(measurements).toFixed(2) + ' ms');
18784 },
18785
18786 _recordWrite: function (id, fnName, totalTime, args) {
18787 // TODO: totalTime isn't that useful since it doesn't count paints/reflows
18788 var writes = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1].writes;
18789 writes[id] = writes[id] || [];
18790 writes[id].push({
18791 type: fnName,
18792 time: totalTime,
18793 args: args
18794 });
18795 },
18796
18797 measure: function (moduleName, fnName, func) {
18798 return function () {
18799 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
18800 args[_key] = arguments[_key];
18801 }
18802
18803 var totalTime;
18804 var rv;
18805 var start;
18806
18807 if (fnName === '_renderNewRootComponent' || fnName === 'flushBatchedUpdates') {
18808 // A "measurement" is a set of metrics recorded for each flush. We want
18809 // to group the metrics for a given flush together so we can look at the
18810 // components that rendered and the DOM operations that actually
18811 // happened to determine the amount of "wasted work" performed.
18812 ReactDefaultPerf._allMeasurements.push({
18813 exclusive: {},
18814 inclusive: {},
18815 render: {},
18816 counts: {},
18817 writes: {},
18818 displayNames: {},
18819 totalTime: 0,
18820 created: {}
18821 });
18822 start = performanceNow();
18823 rv = func.apply(this, args);
18824 ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1].totalTime = performanceNow() - start;
18825 return rv;
18826 } else if (fnName === '_mountImageIntoNode' || moduleName === 'ReactBrowserEventEmitter' || moduleName === 'ReactDOMIDOperations' || moduleName === 'CSSPropertyOperations' || moduleName === 'DOMChildrenOperations' || moduleName === 'DOMPropertyOperations') {
18827 start = performanceNow();
18828 rv = func.apply(this, args);
18829 totalTime = performanceNow() - start;
18830
18831 if (fnName === '_mountImageIntoNode') {
18832 var mountID = ReactMount.getID(args[1]);
18833 ReactDefaultPerf._recordWrite(mountID, fnName, totalTime, args[0]);
18834 } else if (fnName === 'dangerouslyProcessChildrenUpdates') {
18835 // special format
18836 args[0].forEach(function (update) {
18837 var writeArgs = {};
18838 if (update.fromIndex !== null) {
18839 writeArgs.fromIndex = update.fromIndex;
18840 }
18841 if (update.toIndex !== null) {
18842 writeArgs.toIndex = update.toIndex;
18843 }
18844 if (update.textContent !== null) {
18845 writeArgs.textContent = update.textContent;
18846 }
18847 if (update.markupIndex !== null) {
18848 writeArgs.markup = args[1][update.markupIndex];
18849 }
18850 ReactDefaultPerf._recordWrite(update.parentID, update.type, totalTime, writeArgs);
18851 });
18852 } else {
18853 // basic format
18854 var id = args[0];
18855 if (typeof id === 'object') {
18856 id = ReactMount.getID(args[0]);
18857 }
18858 ReactDefaultPerf._recordWrite(id, fnName, totalTime, Array.prototype.slice.call(args, 1));
18859 }
18860 return rv;
18861 } else if (moduleName === 'ReactCompositeComponent' && (fnName === 'mountComponent' || fnName === 'updateComponent' || // TODO: receiveComponent()?
18862 fnName === '_renderValidatedComponent')) {
18863
18864 if (this._currentElement.type === ReactMount.TopLevelWrapper) {
18865 return func.apply(this, args);
18866 }
18867
18868 var rootNodeID = fnName === 'mountComponent' ? args[0] : this._rootNodeID;
18869 var isRender = fnName === '_renderValidatedComponent';
18870 var isMount = fnName === 'mountComponent';
18871
18872 var mountStack = ReactDefaultPerf._mountStack;
18873 var entry = ReactDefaultPerf._allMeasurements[ReactDefaultPerf._allMeasurements.length - 1];
18874
18875 if (isRender) {
18876 addValue(entry.counts, rootNodeID, 1);
18877 } else if (isMount) {
18878 entry.created[rootNodeID] = true;
18879 mountStack.push(0);
18880 }
18881
18882 start = performanceNow();
18883 rv = func.apply(this, args);
18884 totalTime = performanceNow() - start;
18885
18886 if (isRender) {
18887 addValue(entry.render, rootNodeID, totalTime);
18888 } else if (isMount) {
18889 var subMountTime = mountStack.pop();
18890 mountStack[mountStack.length - 1] += totalTime;
18891 addValue(entry.exclusive, rootNodeID, totalTime - subMountTime);
18892 addValue(entry.inclusive, rootNodeID, totalTime);
18893 } else {
18894 addValue(entry.inclusive, rootNodeID, totalTime);
18895 }
18896
18897 entry.displayNames[rootNodeID] = {
18898 current: this.getName(),
18899 owner: this._currentElement._owner ? this._currentElement._owner.getName() : '<root>'
18900 };
18901
18902 return rv;
18903 } else {
18904 return func.apply(this, args);
18905 }
18906 };
18907 }
18908 };
18909
18910 module.exports = ReactDefaultPerf;
18911
18912/***/ }),
18913/* 144 */
18914/***/ (function(module, exports, __webpack_require__) {
18915
18916 /**
18917 * Copyright 2013-2015, Facebook, Inc.
18918 * All rights reserved.
18919 *
18920 * This source code is licensed under the BSD-style license found in the
18921 * LICENSE file in the root directory of this source tree. An additional grant
18922 * of patent rights can be found in the PATENTS file in the same directory.
18923 *
18924 * @providesModule ReactDefaultPerfAnalysis
18925 */
18926
18927 'use strict';
18928
18929 var assign = __webpack_require__(40);
18930
18931 // Don't try to save users less than 1.2ms (a number I made up)
18932 var DONT_CARE_THRESHOLD = 1.2;
18933 var DOM_OPERATION_TYPES = {
18934 '_mountImageIntoNode': 'set innerHTML',
18935 INSERT_MARKUP: 'set innerHTML',
18936 MOVE_EXISTING: 'move',
18937 REMOVE_NODE: 'remove',
18938 SET_MARKUP: 'set innerHTML',
18939 TEXT_CONTENT: 'set textContent',
18940 'setValueForProperty': 'update attribute',
18941 'setValueForAttribute': 'update attribute',
18942 'deleteValueForProperty': 'remove attribute',
18943 'setValueForStyles': 'update styles',
18944 'replaceNodeWithMarkup': 'replace',
18945 'updateTextContent': 'set textContent'
18946 };
18947
18948 function getTotalTime(measurements) {
18949 // TODO: return number of DOM ops? could be misleading.
18950 // TODO: measure dropped frames after reconcile?
18951 // TODO: log total time of each reconcile and the top-level component
18952 // class that triggered it.
18953 var totalTime = 0;
18954 for (var i = 0; i < measurements.length; i++) {
18955 var measurement = measurements[i];
18956 totalTime += measurement.totalTime;
18957 }
18958 return totalTime;
18959 }
18960
18961 function getDOMSummary(measurements) {
18962 var items = [];
18963 measurements.forEach(function (measurement) {
18964 Object.keys(measurement.writes).forEach(function (id) {
18965 measurement.writes[id].forEach(function (write) {
18966 items.push({
18967 id: id,
18968 type: DOM_OPERATION_TYPES[write.type] || write.type,
18969 args: write.args
18970 });
18971 });
18972 });
18973 });
18974 return items;
18975 }
18976
18977 function getExclusiveSummary(measurements) {
18978 var candidates = {};
18979 var displayName;
18980
18981 for (var i = 0; i < measurements.length; i++) {
18982 var measurement = measurements[i];
18983 var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
18984
18985 for (var id in allIDs) {
18986 displayName = measurement.displayNames[id].current;
18987
18988 candidates[displayName] = candidates[displayName] || {
18989 componentName: displayName,
18990 inclusive: 0,
18991 exclusive: 0,
18992 render: 0,
18993 count: 0
18994 };
18995 if (measurement.render[id]) {
18996 candidates[displayName].render += measurement.render[id];
18997 }
18998 if (measurement.exclusive[id]) {
18999 candidates[displayName].exclusive += measurement.exclusive[id];
19000 }
19001 if (measurement.inclusive[id]) {
19002 candidates[displayName].inclusive += measurement.inclusive[id];
19003 }
19004 if (measurement.counts[id]) {
19005 candidates[displayName].count += measurement.counts[id];
19006 }
19007 }
19008 }
19009
19010 // Now make a sorted array with the results.
19011 var arr = [];
19012 for (displayName in candidates) {
19013 if (candidates[displayName].exclusive >= DONT_CARE_THRESHOLD) {
19014 arr.push(candidates[displayName]);
19015 }
19016 }
19017
19018 arr.sort(function (a, b) {
19019 return b.exclusive - a.exclusive;
19020 });
19021
19022 return arr;
19023 }
19024
19025 function getInclusiveSummary(measurements, onlyClean) {
19026 var candidates = {};
19027 var inclusiveKey;
19028
19029 for (var i = 0; i < measurements.length; i++) {
19030 var measurement = measurements[i];
19031 var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
19032 var cleanComponents;
19033
19034 if (onlyClean) {
19035 cleanComponents = getUnchangedComponents(measurement);
19036 }
19037
19038 for (var id in allIDs) {
19039 if (onlyClean && !cleanComponents[id]) {
19040 continue;
19041 }
19042
19043 var displayName = measurement.displayNames[id];
19044
19045 // Inclusive time is not useful for many components without knowing where
19046 // they are instantiated. So we aggregate inclusive time with both the
19047 // owner and current displayName as the key.
19048 inclusiveKey = displayName.owner + ' > ' + displayName.current;
19049
19050 candidates[inclusiveKey] = candidates[inclusiveKey] || {
19051 componentName: inclusiveKey,
19052 time: 0,
19053 count: 0
19054 };
19055
19056 if (measurement.inclusive[id]) {
19057 candidates[inclusiveKey].time += measurement.inclusive[id];
19058 }
19059 if (measurement.counts[id]) {
19060 candidates[inclusiveKey].count += measurement.counts[id];
19061 }
19062 }
19063 }
19064
19065 // Now make a sorted array with the results.
19066 var arr = [];
19067 for (inclusiveKey in candidates) {
19068 if (candidates[inclusiveKey].time >= DONT_CARE_THRESHOLD) {
19069 arr.push(candidates[inclusiveKey]);
19070 }
19071 }
19072
19073 arr.sort(function (a, b) {
19074 return b.time - a.time;
19075 });
19076
19077 return arr;
19078 }
19079
19080 function getUnchangedComponents(measurement) {
19081 // For a given reconcile, look at which components did not actually
19082 // render anything to the DOM and return a mapping of their ID to
19083 // the amount of time it took to render the entire subtree.
19084 var cleanComponents = {};
19085 var dirtyLeafIDs = Object.keys(measurement.writes);
19086 var allIDs = assign({}, measurement.exclusive, measurement.inclusive);
19087
19088 for (var id in allIDs) {
19089 var isDirty = false;
19090 // For each component that rendered, see if a component that triggered
19091 // a DOM op is in its subtree.
19092 for (var i = 0; i < dirtyLeafIDs.length; i++) {
19093 if (dirtyLeafIDs[i].indexOf(id) === 0) {
19094 isDirty = true;
19095 break;
19096 }
19097 }
19098 // check if component newly created
19099 if (measurement.created[id]) {
19100 isDirty = true;
19101 }
19102 if (!isDirty && measurement.counts[id] > 0) {
19103 cleanComponents[id] = true;
19104 }
19105 }
19106 return cleanComponents;
19107 }
19108
19109 var ReactDefaultPerfAnalysis = {
19110 getExclusiveSummary: getExclusiveSummary,
19111 getInclusiveSummary: getInclusiveSummary,
19112 getDOMSummary: getDOMSummary,
19113 getTotalTime: getTotalTime
19114 };
19115
19116 module.exports = ReactDefaultPerfAnalysis;
19117
19118/***/ }),
19119/* 145 */
19120/***/ (function(module, exports, __webpack_require__) {
19121
19122 /**
19123 * Copyright 2013-2015, Facebook, Inc.
19124 * All rights reserved.
19125 *
19126 * This source code is licensed under the BSD-style license found in the
19127 * LICENSE file in the root directory of this source tree. An additional grant
19128 * of patent rights can be found in the PATENTS file in the same directory.
19129 *
19130 * @providesModule performanceNow
19131 * @typechecks
19132 */
19133
19134 'use strict';
19135
19136 var performance = __webpack_require__(146);
19137
19138 var performanceNow;
19139
19140 /**
19141 * Detect if we can use `window.performance.now()` and gracefully fallback to
19142 * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
19143 * because of Facebook's testing infrastructure.
19144 */
19145 if (performance.now) {
19146 performanceNow = function () {
19147 return performance.now();
19148 };
19149 } else {
19150 performanceNow = function () {
19151 return Date.now();
19152 };
19153 }
19154
19155 module.exports = performanceNow;
19156
19157/***/ }),
19158/* 146 */
19159/***/ (function(module, exports, __webpack_require__) {
19160
19161 /**
19162 * Copyright 2013-2015, Facebook, Inc.
19163 * All rights reserved.
19164 *
19165 * This source code is licensed under the BSD-style license found in the
19166 * LICENSE file in the root directory of this source tree. An additional grant
19167 * of patent rights can be found in the PATENTS file in the same directory.
19168 *
19169 * @providesModule performance
19170 * @typechecks
19171 */
19172
19173 'use strict';
19174
19175 var ExecutionEnvironment = __webpack_require__(10);
19176
19177 var performance;
19178
19179 if (ExecutionEnvironment.canUseDOM) {
19180 performance = window.performance || window.msPerformance || window.webkitPerformance;
19181 }
19182
19183 module.exports = performance || {};
19184
19185/***/ }),
19186/* 147 */
19187/***/ (function(module, exports) {
19188
19189 /**
19190 * Copyright 2013-2015, Facebook, Inc.
19191 * All rights reserved.
19192 *
19193 * This source code is licensed under the BSD-style license found in the
19194 * LICENSE file in the root directory of this source tree. An additional grant
19195 * of patent rights can be found in the PATENTS file in the same directory.
19196 *
19197 * @providesModule ReactVersion
19198 */
19199
19200 'use strict';
19201
19202 module.exports = '0.14.9';
19203
19204/***/ }),
19205/* 148 */
19206/***/ (function(module, exports, __webpack_require__) {
19207
19208 /**
19209 * Copyright 2013-2015, Facebook, Inc.
19210 * All rights reserved.
19211 *
19212 * This source code is licensed under the BSD-style license found in the
19213 * LICENSE file in the root directory of this source tree. An additional grant
19214 * of patent rights can be found in the PATENTS file in the same directory.
19215 *
19216 * @providesModule renderSubtreeIntoContainer
19217 */
19218
19219 'use strict';
19220
19221 var ReactMount = __webpack_require__(29);
19222
19223 module.exports = ReactMount.renderSubtreeIntoContainer;
19224
19225/***/ }),
19226/* 149 */
19227/***/ (function(module, exports, __webpack_require__) {
19228
19229 /**
19230 * Copyright 2013-2015, Facebook, Inc.
19231 * All rights reserved.
19232 *
19233 * This source code is licensed under the BSD-style license found in the
19234 * LICENSE file in the root directory of this source tree. An additional grant
19235 * of patent rights can be found in the PATENTS file in the same directory.
19236 *
19237 * @providesModule ReactDOMServer
19238 */
19239
19240 'use strict';
19241
19242 var ReactDefaultInjection = __webpack_require__(72);
19243 var ReactServerRendering = __webpack_require__(150);
19244 var ReactVersion = __webpack_require__(147);
19245
19246 ReactDefaultInjection.inject();
19247
19248 var ReactDOMServer = {
19249 renderToString: ReactServerRendering.renderToString,
19250 renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
19251 version: ReactVersion
19252 };
19253
19254 module.exports = ReactDOMServer;
19255
19256/***/ }),
19257/* 150 */
19258/***/ (function(module, exports, __webpack_require__) {
19259
19260 /* WEBPACK VAR INJECTION */(function(process) {/**
19261 * Copyright 2013-2015, Facebook, Inc.
19262 * All rights reserved.
19263 *
19264 * This source code is licensed under the BSD-style license found in the
19265 * LICENSE file in the root directory of this source tree. An additional grant
19266 * of patent rights can be found in the PATENTS file in the same directory.
19267 *
19268 * @typechecks static-only
19269 * @providesModule ReactServerRendering
19270 */
19271 'use strict';
19272
19273 var ReactDefaultBatchingStrategy = __webpack_require__(93);
19274 var ReactElement = __webpack_require__(43);
19275 var ReactInstanceHandles = __webpack_require__(46);
19276 var ReactMarkupChecksum = __webpack_require__(49);
19277 var ReactServerBatchingStrategy = __webpack_require__(151);
19278 var ReactServerRenderingTransaction = __webpack_require__(152);
19279 var ReactUpdates = __webpack_require__(55);
19280
19281 var emptyObject = __webpack_require__(59);
19282 var instantiateReactComponent = __webpack_require__(63);
19283 var invariant = __webpack_require__(14);
19284
19285 /**
19286 * @param {ReactElement} element
19287 * @return {string} the HTML markup
19288 */
19289 function renderToString(element) {
19290 !ReactElement.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : invariant(false) : undefined;
19291
19292 var transaction;
19293 try {
19294 ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
19295
19296 var id = ReactInstanceHandles.createReactRootID();
19297 transaction = ReactServerRenderingTransaction.getPooled(false);
19298
19299 return transaction.perform(function () {
19300 var componentInstance = instantiateReactComponent(element, null);
19301 var markup = componentInstance.mountComponent(id, transaction, emptyObject);
19302 return ReactMarkupChecksum.addChecksumToMarkup(markup);
19303 }, null);
19304 } finally {
19305 ReactServerRenderingTransaction.release(transaction);
19306 // Revert to the DOM batching strategy since these two renderers
19307 // currently share these stateful modules.
19308 ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
19309 }
19310 }
19311
19312 /**
19313 * @param {ReactElement} element
19314 * @return {string} the HTML markup, without the extra React ID and checksum
19315 * (for generating static pages)
19316 */
19317 function renderToStaticMarkup(element) {
19318 !ReactElement.isValidElement(element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : invariant(false) : undefined;
19319
19320 var transaction;
19321 try {
19322 ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
19323
19324 var id = ReactInstanceHandles.createReactRootID();
19325 transaction = ReactServerRenderingTransaction.getPooled(true);
19326
19327 return transaction.perform(function () {
19328 var componentInstance = instantiateReactComponent(element, null);
19329 return componentInstance.mountComponent(id, transaction, emptyObject);
19330 }, null);
19331 } finally {
19332 ReactServerRenderingTransaction.release(transaction);
19333 // Revert to the DOM batching strategy since these two renderers
19334 // currently share these stateful modules.
19335 ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
19336 }
19337 }
19338
19339 module.exports = {
19340 renderToString: renderToString,
19341 renderToStaticMarkup: renderToStaticMarkup
19342 };
19343 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
19344
19345/***/ }),
19346/* 151 */
19347/***/ (function(module, exports) {
19348
19349 /**
19350 * Copyright 2014-2015, Facebook, Inc.
19351 * All rights reserved.
19352 *
19353 * This source code is licensed under the BSD-style license found in the
19354 * LICENSE file in the root directory of this source tree. An additional grant
19355 * of patent rights can be found in the PATENTS file in the same directory.
19356 *
19357 * @providesModule ReactServerBatchingStrategy
19358 * @typechecks
19359 */
19360
19361 'use strict';
19362
19363 var ReactServerBatchingStrategy = {
19364 isBatchingUpdates: false,
19365 batchedUpdates: function (callback) {
19366 // Don't do anything here. During the server rendering we don't want to
19367 // schedule any updates. We will simply ignore them.
19368 }
19369 };
19370
19371 module.exports = ReactServerBatchingStrategy;
19372
19373/***/ }),
19374/* 152 */
19375/***/ (function(module, exports, __webpack_require__) {
19376
19377 /**
19378 * Copyright 2014-2015, Facebook, Inc.
19379 * All rights reserved.
19380 *
19381 * This source code is licensed under the BSD-style license found in the
19382 * LICENSE file in the root directory of this source tree. An additional grant
19383 * of patent rights can be found in the PATENTS file in the same directory.
19384 *
19385 * @providesModule ReactServerRenderingTransaction
19386 * @typechecks
19387 */
19388
19389 'use strict';
19390
19391 var PooledClass = __webpack_require__(57);
19392 var CallbackQueue = __webpack_require__(56);
19393 var Transaction = __webpack_require__(58);
19394
19395 var assign = __webpack_require__(40);
19396 var emptyFunction = __webpack_require__(16);
19397
19398 /**
19399 * Provides a `CallbackQueue` queue for collecting `onDOMReady` callbacks
19400 * during the performing of the transaction.
19401 */
19402 var ON_DOM_READY_QUEUEING = {
19403 /**
19404 * Initializes the internal `onDOMReady` queue.
19405 */
19406 initialize: function () {
19407 this.reactMountReady.reset();
19408 },
19409
19410 close: emptyFunction
19411 };
19412
19413 /**
19414 * Executed within the scope of the `Transaction` instance. Consider these as
19415 * being member methods, but with an implied ordering while being isolated from
19416 * each other.
19417 */
19418 var TRANSACTION_WRAPPERS = [ON_DOM_READY_QUEUEING];
19419
19420 /**
19421 * @class ReactServerRenderingTransaction
19422 * @param {boolean} renderToStaticMarkup
19423 */
19424 function ReactServerRenderingTransaction(renderToStaticMarkup) {
19425 this.reinitializeTransaction();
19426 this.renderToStaticMarkup = renderToStaticMarkup;
19427 this.reactMountReady = CallbackQueue.getPooled(null);
19428 this.useCreateElement = false;
19429 }
19430
19431 var Mixin = {
19432 /**
19433 * @see Transaction
19434 * @abstract
19435 * @final
19436 * @return {array} Empty list of operation wrap procedures.
19437 */
19438 getTransactionWrappers: function () {
19439 return TRANSACTION_WRAPPERS;
19440 },
19441
19442 /**
19443 * @return {object} The queue to collect `onDOMReady` callbacks with.
19444 */
19445 getReactMountReady: function () {
19446 return this.reactMountReady;
19447 },
19448
19449 /**
19450 * `PooledClass` looks for this, and will invoke this before allowing this
19451 * instance to be reused.
19452 */
19453 destructor: function () {
19454 CallbackQueue.release(this.reactMountReady);
19455 this.reactMountReady = null;
19456 }
19457 };
19458
19459 assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);
19460
19461 PooledClass.addPoolingTo(ReactServerRenderingTransaction);
19462
19463 module.exports = ReactServerRenderingTransaction;
19464
19465/***/ }),
19466/* 153 */
19467/***/ (function(module, exports, __webpack_require__) {
19468
19469 /* WEBPACK VAR INJECTION */(function(process) {/**
19470 * Copyright 2013-2015, Facebook, Inc.
19471 * All rights reserved.
19472 *
19473 * This source code is licensed under the BSD-style license found in the
19474 * LICENSE file in the root directory of this source tree. An additional grant
19475 * of patent rights can be found in the PATENTS file in the same directory.
19476 *
19477 * @providesModule ReactIsomorphic
19478 */
19479
19480 'use strict';
19481
19482 var ReactChildren = __webpack_require__(111);
19483 var ReactComponent = __webpack_require__(124);
19484 var ReactClass = __webpack_require__(123);
19485 var ReactDOMFactories = __webpack_require__(154);
19486 var ReactElement = __webpack_require__(43);
19487 var ReactElementValidator = __webpack_require__(155);
19488 var ReactPropTypes = __webpack_require__(108);
19489 var ReactVersion = __webpack_require__(147);
19490
19491 var assign = __webpack_require__(40);
19492 var onlyChild = __webpack_require__(157);
19493
19494 var createElement = ReactElement.createElement;
19495 var createFactory = ReactElement.createFactory;
19496 var cloneElement = ReactElement.cloneElement;
19497
19498 if (process.env.NODE_ENV !== 'production') {
19499 createElement = ReactElementValidator.createElement;
19500 createFactory = ReactElementValidator.createFactory;
19501 cloneElement = ReactElementValidator.cloneElement;
19502 }
19503
19504 var React = {
19505
19506 // Modern
19507
19508 Children: {
19509 map: ReactChildren.map,
19510 forEach: ReactChildren.forEach,
19511 count: ReactChildren.count,
19512 toArray: ReactChildren.toArray,
19513 only: onlyChild
19514 },
19515
19516 Component: ReactComponent,
19517
19518 createElement: createElement,
19519 cloneElement: cloneElement,
19520 isValidElement: ReactElement.isValidElement,
19521
19522 // Classic
19523
19524 PropTypes: ReactPropTypes,
19525 createClass: ReactClass.createClass,
19526 createFactory: createFactory,
19527 createMixin: function (mixin) {
19528 // Currently a noop. Will be used to validate and trace mixins.
19529 return mixin;
19530 },
19531
19532 // This looks DOM specific but these are actually isomorphic helpers
19533 // since they are just generating DOM strings.
19534 DOM: ReactDOMFactories,
19535
19536 version: ReactVersion,
19537
19538 // Hook for JSX spread, don't use this for anything else.
19539 __spread: assign
19540 };
19541
19542 module.exports = React;
19543 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
19544
19545/***/ }),
19546/* 154 */
19547/***/ (function(module, exports, __webpack_require__) {
19548
19549 /* WEBPACK VAR INJECTION */(function(process) {/**
19550 * Copyright 2013-2015, Facebook, Inc.
19551 * All rights reserved.
19552 *
19553 * This source code is licensed under the BSD-style license found in the
19554 * LICENSE file in the root directory of this source tree. An additional grant
19555 * of patent rights can be found in the PATENTS file in the same directory.
19556 *
19557 * @providesModule ReactDOMFactories
19558 * @typechecks static-only
19559 */
19560
19561 'use strict';
19562
19563 var ReactElement = __webpack_require__(43);
19564 var ReactElementValidator = __webpack_require__(155);
19565
19566 var mapObject = __webpack_require__(156);
19567
19568 /**
19569 * Create a factory that creates HTML tag elements.
19570 *
19571 * @param {string} tag Tag name (e.g. `div`).
19572 * @private
19573 */
19574 function createDOMFactory(tag) {
19575 if (process.env.NODE_ENV !== 'production') {
19576 return ReactElementValidator.createFactory(tag);
19577 }
19578 return ReactElement.createFactory(tag);
19579 }
19580
19581 /**
19582 * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
19583 * This is also accessible via `React.DOM`.
19584 *
19585 * @public
19586 */
19587 var ReactDOMFactories = mapObject({
19588 a: 'a',
19589 abbr: 'abbr',
19590 address: 'address',
19591 area: 'area',
19592 article: 'article',
19593 aside: 'aside',
19594 audio: 'audio',
19595 b: 'b',
19596 base: 'base',
19597 bdi: 'bdi',
19598 bdo: 'bdo',
19599 big: 'big',
19600 blockquote: 'blockquote',
19601 body: 'body',
19602 br: 'br',
19603 button: 'button',
19604 canvas: 'canvas',
19605 caption: 'caption',
19606 cite: 'cite',
19607 code: 'code',
19608 col: 'col',
19609 colgroup: 'colgroup',
19610 data: 'data',
19611 datalist: 'datalist',
19612 dd: 'dd',
19613 del: 'del',
19614 details: 'details',
19615 dfn: 'dfn',
19616 dialog: 'dialog',
19617 div: 'div',
19618 dl: 'dl',
19619 dt: 'dt',
19620 em: 'em',
19621 embed: 'embed',
19622 fieldset: 'fieldset',
19623 figcaption: 'figcaption',
19624 figure: 'figure',
19625 footer: 'footer',
19626 form: 'form',
19627 h1: 'h1',
19628 h2: 'h2',
19629 h3: 'h3',
19630 h4: 'h4',
19631 h5: 'h5',
19632 h6: 'h6',
19633 head: 'head',
19634 header: 'header',
19635 hgroup: 'hgroup',
19636 hr: 'hr',
19637 html: 'html',
19638 i: 'i',
19639 iframe: 'iframe',
19640 img: 'img',
19641 input: 'input',
19642 ins: 'ins',
19643 kbd: 'kbd',
19644 keygen: 'keygen',
19645 label: 'label',
19646 legend: 'legend',
19647 li: 'li',
19648 link: 'link',
19649 main: 'main',
19650 map: 'map',
19651 mark: 'mark',
19652 menu: 'menu',
19653 menuitem: 'menuitem',
19654 meta: 'meta',
19655 meter: 'meter',
19656 nav: 'nav',
19657 noscript: 'noscript',
19658 object: 'object',
19659 ol: 'ol',
19660 optgroup: 'optgroup',
19661 option: 'option',
19662 output: 'output',
19663 p: 'p',
19664 param: 'param',
19665 picture: 'picture',
19666 pre: 'pre',
19667 progress: 'progress',
19668 q: 'q',
19669 rp: 'rp',
19670 rt: 'rt',
19671 ruby: 'ruby',
19672 s: 's',
19673 samp: 'samp',
19674 script: 'script',
19675 section: 'section',
19676 select: 'select',
19677 small: 'small',
19678 source: 'source',
19679 span: 'span',
19680 strong: 'strong',
19681 style: 'style',
19682 sub: 'sub',
19683 summary: 'summary',
19684 sup: 'sup',
19685 table: 'table',
19686 tbody: 'tbody',
19687 td: 'td',
19688 textarea: 'textarea',
19689 tfoot: 'tfoot',
19690 th: 'th',
19691 thead: 'thead',
19692 time: 'time',
19693 title: 'title',
19694 tr: 'tr',
19695 track: 'track',
19696 u: 'u',
19697 ul: 'ul',
19698 'var': 'var',
19699 video: 'video',
19700 wbr: 'wbr',
19701
19702 // SVG
19703 circle: 'circle',
19704 clipPath: 'clipPath',
19705 defs: 'defs',
19706 ellipse: 'ellipse',
19707 g: 'g',
19708 image: 'image',
19709 line: 'line',
19710 linearGradient: 'linearGradient',
19711 mask: 'mask',
19712 path: 'path',
19713 pattern: 'pattern',
19714 polygon: 'polygon',
19715 polyline: 'polyline',
19716 radialGradient: 'radialGradient',
19717 rect: 'rect',
19718 stop: 'stop',
19719 svg: 'svg',
19720 text: 'text',
19721 tspan: 'tspan'
19722
19723 }, createDOMFactory);
19724
19725 module.exports = ReactDOMFactories;
19726 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
19727
19728/***/ }),
19729/* 155 */
19730/***/ (function(module, exports, __webpack_require__) {
19731
19732 /* WEBPACK VAR INJECTION */(function(process) {/**
19733 * Copyright 2014-2015, Facebook, Inc.
19734 * All rights reserved.
19735 *
19736 * This source code is licensed under the BSD-style license found in the
19737 * LICENSE file in the root directory of this source tree. An additional grant
19738 * of patent rights can be found in the PATENTS file in the same directory.
19739 *
19740 * @providesModule ReactElementValidator
19741 */
19742
19743 /**
19744 * ReactElementValidator provides a wrapper around a element factory
19745 * which validates the props passed to the element. This is intended to be
19746 * used only in DEV and could be replaced by a static type checker for languages
19747 * that support it.
19748 */
19749
19750 'use strict';
19751
19752 var ReactElement = __webpack_require__(43);
19753 var ReactPropTypeLocations = __webpack_require__(66);
19754 var ReactPropTypeLocationNames = __webpack_require__(67);
19755 var ReactCurrentOwner = __webpack_require__(6);
19756
19757 var canDefineProperty = __webpack_require__(44);
19758 var getIteratorFn = __webpack_require__(109);
19759 var invariant = __webpack_require__(14);
19760 var warning = __webpack_require__(26);
19761
19762 function getDeclarationErrorAddendum() {
19763 if (ReactCurrentOwner.current) {
19764 var name = ReactCurrentOwner.current.getName();
19765 if (name) {
19766 return ' Check the render method of `' + name + '`.';
19767 }
19768 }
19769 return '';
19770 }
19771
19772 /**
19773 * Warn if there's no key explicitly set on dynamic arrays of children or
19774 * object keys are not valid. This allows us to keep track of children between
19775 * updates.
19776 */
19777 var ownerHasKeyUseWarning = {};
19778
19779 var loggedTypeFailures = {};
19780
19781 /**
19782 * Warn if the element doesn't have an explicit key assigned to it.
19783 * This element is in an array. The array could grow and shrink or be
19784 * reordered. All children that haven't already been validated are required to
19785 * have a "key" property assigned to it.
19786 *
19787 * @internal
19788 * @param {ReactElement} element Element that requires a key.
19789 * @param {*} parentType element's parent's type.
19790 */
19791 function validateExplicitKey(element, parentType) {
19792 if (!element._store || element._store.validated || element.key != null) {
19793 return;
19794 }
19795 element._store.validated = true;
19796
19797 var addenda = getAddendaForKeyUse('uniqueKey', element, parentType);
19798 if (addenda === null) {
19799 // we already showed the warning
19800 return;
19801 }
19802 process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s%s', addenda.parentOrOwner || '', addenda.childOwner || '', addenda.url || '') : undefined;
19803 }
19804
19805 /**
19806 * Shared warning and monitoring code for the key warnings.
19807 *
19808 * @internal
19809 * @param {string} messageType A key used for de-duping warnings.
19810 * @param {ReactElement} element Component that requires a key.
19811 * @param {*} parentType element's parent's type.
19812 * @returns {?object} A set of addenda to use in the warning message, or null
19813 * if the warning has already been shown before (and shouldn't be shown again).
19814 */
19815 function getAddendaForKeyUse(messageType, element, parentType) {
19816 var addendum = getDeclarationErrorAddendum();
19817 if (!addendum) {
19818 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
19819 if (parentName) {
19820 addendum = ' Check the top-level render call using <' + parentName + '>.';
19821 }
19822 }
19823
19824 var memoizer = ownerHasKeyUseWarning[messageType] || (ownerHasKeyUseWarning[messageType] = {});
19825 if (memoizer[addendum]) {
19826 return null;
19827 }
19828 memoizer[addendum] = true;
19829
19830 var addenda = {
19831 parentOrOwner: addendum,
19832 url: ' See https://fb.me/react-warning-keys for more information.',
19833 childOwner: null
19834 };
19835
19836 // Usually the current owner is the offender, but if it accepts children as a
19837 // property, it may be the creator of the child that's responsible for
19838 // assigning it a key.
19839 if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
19840 // Give the component that originally created this child.
19841 addenda.childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
19842 }
19843
19844 return addenda;
19845 }
19846
19847 /**
19848 * Ensure that every element either is passed in a static location, in an
19849 * array with an explicit keys property defined, or in an object literal
19850 * with valid key property.
19851 *
19852 * @internal
19853 * @param {ReactNode} node Statically passed child of any type.
19854 * @param {*} parentType node's parent's type.
19855 */
19856 function validateChildKeys(node, parentType) {
19857 if (typeof node !== 'object') {
19858 return;
19859 }
19860 if (Array.isArray(node)) {
19861 for (var i = 0; i < node.length; i++) {
19862 var child = node[i];
19863 if (ReactElement.isValidElement(child)) {
19864 validateExplicitKey(child, parentType);
19865 }
19866 }
19867 } else if (ReactElement.isValidElement(node)) {
19868 // This element was passed in a valid location.
19869 if (node._store) {
19870 node._store.validated = true;
19871 }
19872 } else if (node) {
19873 var iteratorFn = getIteratorFn(node);
19874 // Entry iterators provide implicit keys.
19875 if (iteratorFn) {
19876 if (iteratorFn !== node.entries) {
19877 var iterator = iteratorFn.call(node);
19878 var step;
19879 while (!(step = iterator.next()).done) {
19880 if (ReactElement.isValidElement(step.value)) {
19881 validateExplicitKey(step.value, parentType);
19882 }
19883 }
19884 }
19885 }
19886 }
19887 }
19888
19889 /**
19890 * Assert that the props are valid
19891 *
19892 * @param {string} componentName Name of the component for error messages.
19893 * @param {object} propTypes Map of prop name to a ReactPropType
19894 * @param {object} props
19895 * @param {string} location e.g. "prop", "context", "child context"
19896 * @private
19897 */
19898 function checkPropTypes(componentName, propTypes, props, location) {
19899 for (var propName in propTypes) {
19900 if (propTypes.hasOwnProperty(propName)) {
19901 var error;
19902 // Prop type validation may throw. In case they do, we don't want to
19903 // fail the render phase where it didn't fail before. So we log it.
19904 // After these have been cleaned up, we'll let them throw.
19905 try {
19906 // This is intentionally an invariant that gets caught. It's the same
19907 // behavior as without this statement except with a better message.
19908 !(typeof propTypes[propName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], propName) : invariant(false) : undefined;
19909 error = propTypes[propName](props, propName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
19910 } catch (ex) {
19911 error = ex;
19912 }
19913 process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], propName, typeof error) : undefined;
19914 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
19915 // Only monitor this failure once because there tends to be a lot of the
19916 // same error.
19917 loggedTypeFailures[error.message] = true;
19918
19919 var addendum = getDeclarationErrorAddendum();
19920 process.env.NODE_ENV !== 'production' ? warning(false, 'Failed propType: %s%s', error.message, addendum) : undefined;
19921 }
19922 }
19923 }
19924 }
19925
19926 /**
19927 * Given an element, validate that its props follow the propTypes definition,
19928 * provided by the type.
19929 *
19930 * @param {ReactElement} element
19931 */
19932 function validatePropTypes(element) {
19933 var componentClass = element.type;
19934 if (typeof componentClass !== 'function') {
19935 return;
19936 }
19937 var name = componentClass.displayName || componentClass.name;
19938 if (componentClass.propTypes) {
19939 checkPropTypes(name, componentClass.propTypes, element.props, ReactPropTypeLocations.prop);
19940 }
19941 if (typeof componentClass.getDefaultProps === 'function') {
19942 process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : undefined;
19943 }
19944 }
19945
19946 var ReactElementValidator = {
19947
19948 createElement: function (type, props, children) {
19949 var validType = typeof type === 'string' || typeof type === 'function';
19950 // We warn in this case but don't throw. We expect the element creation to
19951 // succeed and there will likely be errors in render.
19952 process.env.NODE_ENV !== 'production' ? warning(validType, 'React.createElement: type should not be null, undefined, boolean, or ' + 'number. It should be a string (for DOM elements) or a ReactClass ' + '(for composite components).%s', getDeclarationErrorAddendum()) : undefined;
19953
19954 var element = ReactElement.createElement.apply(this, arguments);
19955
19956 // The result can be nullish if a mock or a custom function is used.
19957 // TODO: Drop this when these are no longer allowed as the type argument.
19958 if (element == null) {
19959 return element;
19960 }
19961
19962 // Skip key warning if the type isn't valid since our key validation logic
19963 // doesn't expect a non-string/function type and can throw confusing errors.
19964 // We don't want exception behavior to differ between dev and prod.
19965 // (Rendering will throw with a helpful message and as soon as the type is
19966 // fixed, the key warnings will appear.)
19967 if (validType) {
19968 for (var i = 2; i < arguments.length; i++) {
19969 validateChildKeys(arguments[i], type);
19970 }
19971 }
19972
19973 validatePropTypes(element);
19974
19975 return element;
19976 },
19977
19978 createFactory: function (type) {
19979 var validatedFactory = ReactElementValidator.createElement.bind(null, type);
19980 // Legacy hook TODO: Warn if this is accessed
19981 validatedFactory.type = type;
19982
19983 if (process.env.NODE_ENV !== 'production') {
19984 if (canDefineProperty) {
19985 Object.defineProperty(validatedFactory, 'type', {
19986 enumerable: false,
19987 get: function () {
19988 process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : undefined;
19989 Object.defineProperty(this, 'type', {
19990 value: type
19991 });
19992 return type;
19993 }
19994 });
19995 }
19996 }
19997
19998 return validatedFactory;
19999 },
20000
20001 cloneElement: function (element, props, children) {
20002 var newElement = ReactElement.cloneElement.apply(this, arguments);
20003 for (var i = 2; i < arguments.length; i++) {
20004 validateChildKeys(arguments[i], newElement.type);
20005 }
20006 validatePropTypes(newElement);
20007 return newElement;
20008 }
20009
20010 };
20011
20012 module.exports = ReactElementValidator;
20013 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
20014
20015/***/ }),
20016/* 156 */
20017/***/ (function(module, exports) {
20018
20019 /**
20020 * Copyright 2013-2015, Facebook, Inc.
20021 * All rights reserved.
20022 *
20023 * This source code is licensed under the BSD-style license found in the
20024 * LICENSE file in the root directory of this source tree. An additional grant
20025 * of patent rights can be found in the PATENTS file in the same directory.
20026 *
20027 * @providesModule mapObject
20028 */
20029
20030 'use strict';
20031
20032 var hasOwnProperty = Object.prototype.hasOwnProperty;
20033
20034 /**
20035 * Executes the provided `callback` once for each enumerable own property in the
20036 * object and constructs a new object from the results. The `callback` is
20037 * invoked with three arguments:
20038 *
20039 * - the property value
20040 * - the property name
20041 * - the object being traversed
20042 *
20043 * Properties that are added after the call to `mapObject` will not be visited
20044 * by `callback`. If the values of existing properties are changed, the value
20045 * passed to `callback` will be the value at the time `mapObject` visits them.
20046 * Properties that are deleted before being visited are not visited.
20047 *
20048 * @grep function objectMap()
20049 * @grep function objMap()
20050 *
20051 * @param {?object} object
20052 * @param {function} callback
20053 * @param {*} context
20054 * @return {?object}
20055 */
20056 function mapObject(object, callback, context) {
20057 if (!object) {
20058 return null;
20059 }
20060 var result = {};
20061 for (var name in object) {
20062 if (hasOwnProperty.call(object, name)) {
20063 result[name] = callback.call(context, object[name], name, object);
20064 }
20065 }
20066 return result;
20067 }
20068
20069 module.exports = mapObject;
20070
20071/***/ }),
20072/* 157 */
20073/***/ (function(module, exports, __webpack_require__) {
20074
20075 /* WEBPACK VAR INJECTION */(function(process) {/**
20076 * Copyright 2013-2015, Facebook, Inc.
20077 * All rights reserved.
20078 *
20079 * This source code is licensed under the BSD-style license found in the
20080 * LICENSE file in the root directory of this source tree. An additional grant
20081 * of patent rights can be found in the PATENTS file in the same directory.
20082 *
20083 * @providesModule onlyChild
20084 */
20085 'use strict';
20086
20087 var ReactElement = __webpack_require__(43);
20088
20089 var invariant = __webpack_require__(14);
20090
20091 /**
20092 * Returns the first child in a collection of children and verifies that there
20093 * is only one child in the collection. The current implementation of this
20094 * function assumes that a single child gets passed without a wrapper, but the
20095 * purpose of this helper function is to abstract away the particular structure
20096 * of children.
20097 *
20098 * @param {?object} children Child collection structure.
20099 * @return {ReactComponent} The first and only `ReactComponent` contained in the
20100 * structure.
20101 */
20102 function onlyChild(children) {
20103 !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : undefined;
20104 return children;
20105 }
20106
20107 module.exports = onlyChild;
20108 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
20109
20110/***/ }),
20111/* 158 */
20112/***/ (function(module, exports, __webpack_require__) {
20113
20114 /* WEBPACK VAR INJECTION */(function(process) {/**
20115 * Copyright 2013-2015, Facebook, Inc.
20116 * All rights reserved.
20117 *
20118 * This source code is licensed under the BSD-style license found in the
20119 * LICENSE file in the root directory of this source tree. An additional grant
20120 * of patent rights can be found in the PATENTS file in the same directory.
20121 *
20122 * @providesModule deprecated
20123 */
20124
20125 'use strict';
20126
20127 var assign = __webpack_require__(40);
20128 var warning = __webpack_require__(26);
20129
20130 /**
20131 * This will log a single deprecation notice per function and forward the call
20132 * on to the new API.
20133 *
20134 * @param {string} fnName The name of the function
20135 * @param {string} newModule The module that fn will exist in
20136 * @param {string} newPackage The module that fn will exist in
20137 * @param {*} ctx The context this forwarded call should run in
20138 * @param {function} fn The function to forward on to
20139 * @return {function} The function that will warn once and then call fn
20140 */
20141 function deprecated(fnName, newModule, newPackage, ctx, fn) {
20142 var warned = false;
20143 if (process.env.NODE_ENV !== 'production') {
20144 var newFn = function () {
20145 process.env.NODE_ENV !== 'production' ? warning(warned,
20146 // Require examples in this string must be split to prevent React's
20147 // build tools from mistaking them for real requires.
20148 // Otherwise the build tools will attempt to build a '%s' module.
20149 'React.%s is deprecated. Please use %s.%s from require' + '(\'%s\') ' + 'instead.', fnName, newModule, fnName, newPackage) : undefined;
20150 warned = true;
20151 return fn.apply(ctx, arguments);
20152 };
20153 // We need to make sure all properties of the original fn are copied over.
20154 // In particular, this is needed to support PropTypes
20155 return assign(newFn, fn);
20156 }
20157
20158 return fn;
20159 }
20160
20161 module.exports = deprecated;
20162 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
20163
20164/***/ })
20165/******/ ])
20166});
20167;
\No newline at end of file