Start process of better client-side file locations.
[openemr.git] / public / assets / react-15-1-0 / react-with-addons.js
blobc96fe363610e12d7c63e944951ed9d5ddb9c2066
1  /**
2   * React (with addons) v15.1.0
3   */
4 (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.React = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
5 /**
6  * Copyright 2013-present, Facebook, Inc.
7  * All rights reserved.
8  *
9  * This source code is licensed under the BSD-style license found in the
10  * LICENSE file in the root directory of this source tree. An additional grant
11  * of patent rights can be found in the PATENTS file in the same directory.
12  *
13  * @providesModule AutoFocusUtils
14  */
16 'use strict';
18 var ReactDOMComponentTree = _dereq_(45);
20 var focusNode = _dereq_(167);
22 var AutoFocusUtils = {
23   focusDOMComponent: function () {
24     focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
25   }
28 module.exports = AutoFocusUtils;
29 },{"167":167,"45":45}],2:[function(_dereq_,module,exports){
30 /**
31  * Copyright 2013-present Facebook, Inc.
32  * All rights reserved.
33  *
34  * This source code is licensed under the BSD-style license found in the
35  * LICENSE file in the root directory of this source tree. An additional grant
36  * of patent rights can be found in the PATENTS file in the same directory.
37  *
38  * @providesModule BeforeInputEventPlugin
39  */
41 'use strict';
43 var EventConstants = _dereq_(16);
44 var EventPropagators = _dereq_(20);
45 var ExecutionEnvironment = _dereq_(159);
46 var FallbackCompositionState = _dereq_(21);
47 var SyntheticCompositionEvent = _dereq_(113);
48 var SyntheticInputEvent = _dereq_(117);
50 var keyOf = _dereq_(177);
52 var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
53 var START_KEYCODE = 229;
55 var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
57 var documentMode = null;
58 if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
59   documentMode = document.documentMode;
62 // Webkit offers a very useful `textInput` event that can be used to
63 // directly represent `beforeInput`. The IE `textinput` event is not as
64 // useful, so we don't use it.
65 var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
67 // In IE9+, we have access to composition events, but the data supplied
68 // by the native compositionend event may be incorrect. Japanese ideographic
69 // spaces, for instance (\u3000) are not recorded correctly.
70 var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
72 /**
73  * Opera <= 12 includes TextEvent in window, but does not fire
74  * text input events. Rely on keypress instead.
75  */
76 function isPresto() {
77   var opera = window.opera;
78   return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
81 var SPACEBAR_CODE = 32;
82 var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
84 var topLevelTypes = EventConstants.topLevelTypes;
86 // Events and their corresponding property names.
87 var eventTypes = {
88   beforeInput: {
89     phasedRegistrationNames: {
90       bubbled: keyOf({ onBeforeInput: null }),
91       captured: keyOf({ onBeforeInputCapture: null })
92     },
93     dependencies: [topLevelTypes.topCompositionEnd, topLevelTypes.topKeyPress, topLevelTypes.topTextInput, topLevelTypes.topPaste]
94   },
95   compositionEnd: {
96     phasedRegistrationNames: {
97       bubbled: keyOf({ onCompositionEnd: null }),
98       captured: keyOf({ onCompositionEndCapture: null })
99     },
100     dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionEnd, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
101   },
102   compositionStart: {
103     phasedRegistrationNames: {
104       bubbled: keyOf({ onCompositionStart: null }),
105       captured: keyOf({ onCompositionStartCapture: null })
106     },
107     dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionStart, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
108   },
109   compositionUpdate: {
110     phasedRegistrationNames: {
111       bubbled: keyOf({ onCompositionUpdate: null }),
112       captured: keyOf({ onCompositionUpdateCapture: null })
113     },
114     dependencies: [topLevelTypes.topBlur, topLevelTypes.topCompositionUpdate, topLevelTypes.topKeyDown, topLevelTypes.topKeyPress, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown]
115   }
118 // Track whether we've ever handled a keypress on the space key.
119 var hasSpaceKeypress = false;
122  * Return whether a native keypress event is assumed to be a command.
123  * This is required because Firefox fires `keypress` events for key commands
124  * (cut, copy, select-all, etc.) even though no character is inserted.
125  */
126 function isKeypressCommand(nativeEvent) {
127   return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
128   // ctrlKey && altKey is equivalent to AltGr, and is not a command.
129   !(nativeEvent.ctrlKey && nativeEvent.altKey);
133  * Translate native top level events into event types.
135  * @param {string} topLevelType
136  * @return {object}
137  */
138 function getCompositionEventType(topLevelType) {
139   switch (topLevelType) {
140     case topLevelTypes.topCompositionStart:
141       return eventTypes.compositionStart;
142     case topLevelTypes.topCompositionEnd:
143       return eventTypes.compositionEnd;
144     case topLevelTypes.topCompositionUpdate:
145       return eventTypes.compositionUpdate;
146   }
150  * Does our fallback best-guess model think this event signifies that
151  * composition has begun?
153  * @param {string} topLevelType
154  * @param {object} nativeEvent
155  * @return {boolean}
156  */
157 function isFallbackCompositionStart(topLevelType, nativeEvent) {
158   return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;
162  * Does our fallback mode think that this event is the end of composition?
164  * @param {string} topLevelType
165  * @param {object} nativeEvent
166  * @return {boolean}
167  */
168 function isFallbackCompositionEnd(topLevelType, nativeEvent) {
169   switch (topLevelType) {
170     case topLevelTypes.topKeyUp:
171       // Command keys insert or clear IME input.
172       return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
173     case topLevelTypes.topKeyDown:
174       // Expect IME keyCode on each keydown. If we get any other
175       // code we must have exited earlier.
176       return nativeEvent.keyCode !== START_KEYCODE;
177     case topLevelTypes.topKeyPress:
178     case topLevelTypes.topMouseDown:
179     case topLevelTypes.topBlur:
180       // Events are not possible without cancelling IME.
181       return true;
182     default:
183       return false;
184   }
188  * Google Input Tools provides composition data via a CustomEvent,
189  * with the `data` property populated in the `detail` object. If this
190  * is available on the event object, use it. If not, this is a plain
191  * composition event and we have nothing special to extract.
193  * @param {object} nativeEvent
194  * @return {?string}
195  */
196 function getDataFromCustomEvent(nativeEvent) {
197   var detail = nativeEvent.detail;
198   if (typeof detail === 'object' && 'data' in detail) {
199     return detail.data;
200   }
201   return null;
204 // Track the current IME composition fallback object, if any.
205 var currentComposition = null;
208  * @return {?object} A SyntheticCompositionEvent.
209  */
210 function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
211   var eventType;
212   var fallbackData;
214   if (canUseCompositionEvent) {
215     eventType = getCompositionEventType(topLevelType);
216   } else if (!currentComposition) {
217     if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
218       eventType = eventTypes.compositionStart;
219     }
220   } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
221     eventType = eventTypes.compositionEnd;
222   }
224   if (!eventType) {
225     return null;
226   }
228   if (useFallbackCompositionData) {
229     // The current composition is stored statically and must not be
230     // overwritten while composition continues.
231     if (!currentComposition && eventType === eventTypes.compositionStart) {
232       currentComposition = FallbackCompositionState.getPooled(nativeEventTarget);
233     } else if (eventType === eventTypes.compositionEnd) {
234       if (currentComposition) {
235         fallbackData = currentComposition.getData();
236       }
237     }
238   }
240   var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
242   if (fallbackData) {
243     // Inject data generated from fallback path into the synthetic event.
244     // This matches the property of native CompositionEventInterface.
245     event.data = fallbackData;
246   } else {
247     var customData = getDataFromCustomEvent(nativeEvent);
248     if (customData !== null) {
249       event.data = customData;
250     }
251   }
253   EventPropagators.accumulateTwoPhaseDispatches(event);
254   return event;
258  * @param {string} topLevelType Record from `EventConstants`.
259  * @param {object} nativeEvent Native browser event.
260  * @return {?string} The string corresponding to this `beforeInput` event.
261  */
262 function getNativeBeforeInputChars(topLevelType, nativeEvent) {
263   switch (topLevelType) {
264     case topLevelTypes.topCompositionEnd:
265       return getDataFromCustomEvent(nativeEvent);
266     case topLevelTypes.topKeyPress:
267       /**
268        * If native `textInput` events are available, our goal is to make
269        * use of them. However, there is a special case: the spacebar key.
270        * In Webkit, preventing default on a spacebar `textInput` event
271        * cancels character insertion, but it *also* causes the browser
272        * to fall back to its default spacebar behavior of scrolling the
273        * page.
274        *
275        * Tracking at:
276        * https://code.google.com/p/chromium/issues/detail?id=355103
277        *
278        * To avoid this issue, use the keypress event as if no `textInput`
279        * event is available.
280        */
281       var which = nativeEvent.which;
282       if (which !== SPACEBAR_CODE) {
283         return null;
284       }
286       hasSpaceKeypress = true;
287       return SPACEBAR_CHAR;
289     case topLevelTypes.topTextInput:
290       // Record the characters to be added to the DOM.
291       var chars = nativeEvent.data;
293       // If it's a spacebar character, assume that we have already handled
294       // it at the keypress level and bail immediately. Android Chrome
295       // doesn't give us keycodes, so we need to blacklist it.
296       if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
297         return null;
298       }
300       return chars;
302     default:
303       // For other native event types, do nothing.
304       return null;
305   }
309  * For browsers that do not provide the `textInput` event, extract the
310  * appropriate string to use for SyntheticInputEvent.
312  * @param {string} topLevelType Record from `EventConstants`.
313  * @param {object} nativeEvent Native browser event.
314  * @return {?string} The fallback string for this `beforeInput` event.
315  */
316 function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
317   // If we are currently composing (IME) and using a fallback to do so,
318   // try to extract the composed characters from the fallback object.
319   if (currentComposition) {
320     if (topLevelType === topLevelTypes.topCompositionEnd || isFallbackCompositionEnd(topLevelType, nativeEvent)) {
321       var chars = currentComposition.getData();
322       FallbackCompositionState.release(currentComposition);
323       currentComposition = null;
324       return chars;
325     }
326     return null;
327   }
329   switch (topLevelType) {
330     case topLevelTypes.topPaste:
331       // If a paste event occurs after a keypress, throw out the input
332       // chars. Paste events should not lead to BeforeInput events.
333       return null;
334     case topLevelTypes.topKeyPress:
335       /**
336        * As of v27, Firefox may fire keypress events even when no character
337        * will be inserted. A few possibilities:
338        *
339        * - `which` is `0`. Arrow keys, Esc key, etc.
340        *
341        * - `which` is the pressed key code, but no char is available.
342        *   Ex: 'AltGr + d` in Polish. There is no modified character for
343        *   this key combination and no character is inserted into the
344        *   document, but FF fires the keypress for char code `100` anyway.
345        *   No `input` event will occur.
346        *
347        * - `which` is the pressed key code, but a command combination is
348        *   being used. Ex: `Cmd+C`. No character is inserted, and no
349        *   `input` event will occur.
350        */
351       if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
352         return String.fromCharCode(nativeEvent.which);
353       }
354       return null;
355     case topLevelTypes.topCompositionEnd:
356       return useFallbackCompositionData ? null : nativeEvent.data;
357     default:
358       return null;
359   }
363  * Extract a SyntheticInputEvent for `beforeInput`, based on either native
364  * `textInput` or fallback behavior.
366  * @return {?object} A SyntheticInputEvent.
367  */
368 function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
369   var chars;
371   if (canUseTextInputEvent) {
372     chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
373   } else {
374     chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
375   }
377   // If no characters are being inserted, no BeforeInput event should
378   // be fired.
379   if (!chars) {
380     return null;
381   }
383   var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
385   event.data = chars;
386   EventPropagators.accumulateTwoPhaseDispatches(event);
387   return event;
391  * Create an `onBeforeInput` event to match
392  * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
394  * This event plugin is based on the native `textInput` event
395  * available in Chrome, Safari, Opera, and IE. This event fires after
396  * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
398  * `beforeInput` is spec'd but not implemented in any browsers, and
399  * the `input` event does not provide any useful information about what has
400  * actually been added, contrary to the spec. Thus, `textInput` is the best
401  * available event to identify the characters that have actually been inserted
402  * into the target node.
404  * This plugin is also responsible for emitting `composition` events, thus
405  * allowing us to share composition fallback code for both `beforeInput` and
406  * `composition` event types.
407  */
408 var BeforeInputEventPlugin = {
410   eventTypes: eventTypes,
412   extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
413     return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
414   }
417 module.exports = BeforeInputEventPlugin;
418 },{"113":113,"117":117,"159":159,"16":16,"177":177,"20":20,"21":21}],3:[function(_dereq_,module,exports){
420  * Copyright 2013-present, Facebook, Inc.
421  * All rights reserved.
423  * This source code is licensed under the BSD-style license found in the
424  * LICENSE file in the root directory of this source tree. An additional grant
425  * of patent rights can be found in the PATENTS file in the same directory.
427  * @providesModule CSSProperty
428  */
430 'use strict';
433  * CSS properties which accept numbers but are not in units of "px".
434  */
436 var isUnitlessNumber = {
437   animationIterationCount: true,
438   borderImageOutset: true,
439   borderImageSlice: true,
440   borderImageWidth: true,
441   boxFlex: true,
442   boxFlexGroup: true,
443   boxOrdinalGroup: true,
444   columnCount: true,
445   flex: true,
446   flexGrow: true,
447   flexPositive: true,
448   flexShrink: true,
449   flexNegative: true,
450   flexOrder: true,
451   gridRow: true,
452   gridColumn: true,
453   fontWeight: true,
454   lineClamp: true,
455   lineHeight: true,
456   opacity: true,
457   order: true,
458   orphans: true,
459   tabSize: true,
460   widows: true,
461   zIndex: true,
462   zoom: true,
464   // SVG-related properties
465   fillOpacity: true,
466   floodOpacity: true,
467   stopOpacity: true,
468   strokeDasharray: true,
469   strokeDashoffset: true,
470   strokeMiterlimit: true,
471   strokeOpacity: true,
472   strokeWidth: true
476  * @param {string} prefix vendor-specific prefix, eg: Webkit
477  * @param {string} key style name, eg: transitionDuration
478  * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
479  * WebkitTransitionDuration
480  */
481 function prefixKey(prefix, key) {
482   return prefix + key.charAt(0).toUpperCase() + key.substring(1);
486  * Support style names that may come passed in prefixed by adding permutations
487  * of vendor prefixes.
488  */
489 var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
491 // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
492 // infinite loop, because it iterates over the newly added props too.
493 Object.keys(isUnitlessNumber).forEach(function (prop) {
494   prefixes.forEach(function (prefix) {
495     isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
496   });
500  * Most style properties can be unset by doing .style[prop] = '' but IE8
501  * doesn't like doing that with shorthand properties so for the properties that
502  * IE8 breaks on, which are listed here, we instead unset each of the
503  * individual properties. See http://bugs.jquery.com/ticket/12385.
504  * The 4-value 'clock' properties like margin, padding, border-width seem to
505  * behave without any problems. Curiously, list-style works too without any
506  * special prodding.
507  */
508 var shorthandPropertyExpansions = {
509   background: {
510     backgroundAttachment: true,
511     backgroundColor: true,
512     backgroundImage: true,
513     backgroundPositionX: true,
514     backgroundPositionY: true,
515     backgroundRepeat: true
516   },
517   backgroundPosition: {
518     backgroundPositionX: true,
519     backgroundPositionY: true
520   },
521   border: {
522     borderWidth: true,
523     borderStyle: true,
524     borderColor: true
525   },
526   borderBottom: {
527     borderBottomWidth: true,
528     borderBottomStyle: true,
529     borderBottomColor: true
530   },
531   borderLeft: {
532     borderLeftWidth: true,
533     borderLeftStyle: true,
534     borderLeftColor: true
535   },
536   borderRight: {
537     borderRightWidth: true,
538     borderRightStyle: true,
539     borderRightColor: true
540   },
541   borderTop: {
542     borderTopWidth: true,
543     borderTopStyle: true,
544     borderTopColor: true
545   },
546   font: {
547     fontStyle: true,
548     fontVariant: true,
549     fontWeight: true,
550     fontSize: true,
551     lineHeight: true,
552     fontFamily: true
553   },
554   outline: {
555     outlineWidth: true,
556     outlineStyle: true,
557     outlineColor: true
558   }
561 var CSSProperty = {
562   isUnitlessNumber: isUnitlessNumber,
563   shorthandPropertyExpansions: shorthandPropertyExpansions
566 module.exports = CSSProperty;
567 },{}],4:[function(_dereq_,module,exports){
569  * Copyright 2013-present, Facebook, Inc.
570  * All rights reserved.
572  * This source code is licensed under the BSD-style license found in the
573  * LICENSE file in the root directory of this source tree. An additional grant
574  * of patent rights can be found in the PATENTS file in the same directory.
576  * @providesModule CSSPropertyOperations
577  */
579 'use strict';
581 var CSSProperty = _dereq_(3);
582 var ExecutionEnvironment = _dereq_(159);
583 var ReactInstrumentation = _dereq_(76);
585 var camelizeStyleName = _dereq_(161);
586 var dangerousStyleValue = _dereq_(130);
587 var hyphenateStyleName = _dereq_(172);
588 var memoizeStringOnly = _dereq_(179);
589 var warning = _dereq_(183);
591 var processStyleName = memoizeStringOnly(function (styleName) {
592   return hyphenateStyleName(styleName);
595 var hasShorthandPropertyBug = false;
596 var styleFloatAccessor = 'cssFloat';
597 if (ExecutionEnvironment.canUseDOM) {
598   var tempStyle = document.createElement('div').style;
599   try {
600     // IE8 throws "Invalid argument." if resetting shorthand style properties.
601     tempStyle.font = '';
602   } catch (e) {
603     hasShorthandPropertyBug = true;
604   }
605   // IE8 only supports accessing cssFloat (standard) as styleFloat
606   if (document.documentElement.style.cssFloat === undefined) {
607     styleFloatAccessor = 'styleFloat';
608   }
611 if ("development" !== 'production') {
612   // 'msTransform' is correct, but the other prefixes should be capitalized
613   var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
615   // style values shouldn't contain a semicolon
616   var badStyleValueWithSemicolonPattern = /;\s*$/;
618   var warnedStyleNames = {};
619   var warnedStyleValues = {};
620   var warnedForNaNValue = false;
622   var warnHyphenatedStyleName = function (name, owner) {
623     if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
624       return;
625     }
627     warnedStyleNames[name] = true;
628     "development" !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
629   };
631   var warnBadVendoredStyleName = function (name, owner) {
632     if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
633       return;
634     }
636     warnedStyleNames[name] = true;
637     "development" !== 'production' ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0;
638   };
640   var warnStyleValueWithSemicolon = function (name, value, owner) {
641     if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
642       return;
643     }
645     warnedStyleValues[value] = true;
646     "development" !== 'production' ? warning(false, 'Style property values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0;
647   };
649   var warnStyleValueIsNaN = function (name, value, owner) {
650     if (warnedForNaNValue) {
651       return;
652     }
654     warnedForNaNValue = true;
655     "development" !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
656   };
658   var checkRenderMessage = function (owner) {
659     if (owner) {
660       var name = owner.getName();
661       if (name) {
662         return ' Check the render method of `' + name + '`.';
663       }
664     }
665     return '';
666   };
668   /**
669    * @param {string} name
670    * @param {*} value
671    * @param {ReactDOMComponent} component
672    */
673   var warnValidStyle = function (name, value, component) {
674     var owner;
675     if (component) {
676       owner = component._currentElement._owner;
677     }
678     if (name.indexOf('-') > -1) {
679       warnHyphenatedStyleName(name, owner);
680     } else if (badVendoredStyleNamePattern.test(name)) {
681       warnBadVendoredStyleName(name, owner);
682     } else if (badStyleValueWithSemicolonPattern.test(value)) {
683       warnStyleValueWithSemicolon(name, value, owner);
684     }
686     if (typeof value === 'number' && isNaN(value)) {
687       warnStyleValueIsNaN(name, value, owner);
688     }
689   };
693  * Operations for dealing with CSS properties.
694  */
695 var CSSPropertyOperations = {
697   /**
698    * Serializes a mapping of style properties for use as inline styles:
699    *
700    *   > createMarkupForStyles({width: '200px', height: 0})
701    *   "width:200px;height:0;"
702    *
703    * Undefined values are ignored so that declarative programming is easier.
704    * The result should be HTML-escaped before insertion into the DOM.
705    *
706    * @param {object} styles
707    * @param {ReactDOMComponent} component
708    * @return {?string}
709    */
710   createMarkupForStyles: function (styles, component) {
711     var serialized = '';
712     for (var styleName in styles) {
713       if (!styles.hasOwnProperty(styleName)) {
714         continue;
715       }
716       var styleValue = styles[styleName];
717       if ("development" !== 'production') {
718         warnValidStyle(styleName, styleValue, component);
719       }
720       if (styleValue != null) {
721         serialized += processStyleName(styleName) + ':';
722         serialized += dangerousStyleValue(styleName, styleValue, component) + ';';
723       }
724     }
725     return serialized || null;
726   },
728   /**
729    * Sets the value for multiple styles on a node.  If a value is specified as
730    * '' (empty string), the corresponding style property will be unset.
731    *
732    * @param {DOMElement} node
733    * @param {object} styles
734    * @param {ReactDOMComponent} component
735    */
736   setValueForStyles: function (node, styles, component) {
737     if ("development" !== 'production') {
738       ReactInstrumentation.debugTool.onNativeOperation(component._debugID, 'update styles', styles);
739     }
741     var style = node.style;
742     for (var styleName in styles) {
743       if (!styles.hasOwnProperty(styleName)) {
744         continue;
745       }
746       if ("development" !== 'production') {
747         warnValidStyle(styleName, styles[styleName], component);
748       }
749       var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
750       if (styleName === 'float' || styleName === 'cssFloat') {
751         styleName = styleFloatAccessor;
752       }
753       if (styleValue) {
754         style[styleName] = styleValue;
755       } else {
756         var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
757         if (expansion) {
758           // Shorthand property that IE8 won't like unsetting, so unset each
759           // component to placate it
760           for (var individualStyleName in expansion) {
761             style[individualStyleName] = '';
762           }
763         } else {
764           style[styleName] = '';
765         }
766       }
767     }
768   }
772 module.exports = CSSPropertyOperations;
773 },{"130":130,"159":159,"161":161,"172":172,"179":179,"183":183,"3":3,"76":76}],5:[function(_dereq_,module,exports){
775  * Copyright 2013-present, Facebook, Inc.
776  * All rights reserved.
778  * This source code is licensed under the BSD-style license found in the
779  * LICENSE file in the root directory of this source tree. An additional grant
780  * of patent rights can be found in the PATENTS file in the same directory.
782  * @providesModule CallbackQueue
783  */
785 'use strict';
787 var _assign = _dereq_(184);
789 var PooledClass = _dereq_(26);
791 var invariant = _dereq_(173);
794  * A specialized pseudo-event module to help keep track of components waiting to
795  * be notified when their DOM representations are available for use.
797  * This implements `PooledClass`, so you should never need to instantiate this.
798  * Instead, use `CallbackQueue.getPooled()`.
800  * @class ReactMountReady
801  * @implements PooledClass
802  * @internal
803  */
804 function CallbackQueue() {
805   this._callbacks = null;
806   this._contexts = null;
809 _assign(CallbackQueue.prototype, {
811   /**
812    * Enqueues a callback to be invoked when `notifyAll` is invoked.
813    *
814    * @param {function} callback Invoked when `notifyAll` is invoked.
815    * @param {?object} context Context to call `callback` with.
816    * @internal
817    */
818   enqueue: function (callback, context) {
819     this._callbacks = this._callbacks || [];
820     this._contexts = this._contexts || [];
821     this._callbacks.push(callback);
822     this._contexts.push(context);
823   },
825   /**
826    * Invokes all enqueued callbacks and clears the queue. This is invoked after
827    * the DOM representation of a component has been created or updated.
828    *
829    * @internal
830    */
831   notifyAll: function () {
832     var callbacks = this._callbacks;
833     var contexts = this._contexts;
834     if (callbacks) {
835       !(callbacks.length === contexts.length) ? "development" !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : invariant(false) : void 0;
836       this._callbacks = null;
837       this._contexts = null;
838       for (var i = 0; i < callbacks.length; i++) {
839         callbacks[i].call(contexts[i]);
840       }
841       callbacks.length = 0;
842       contexts.length = 0;
843     }
844   },
846   checkpoint: function () {
847     return this._callbacks ? this._callbacks.length : 0;
848   },
850   rollback: function (len) {
851     if (this._callbacks) {
852       this._callbacks.length = len;
853       this._contexts.length = len;
854     }
855   },
857   /**
858    * Resets the internal queue.
859    *
860    * @internal
861    */
862   reset: function () {
863     this._callbacks = null;
864     this._contexts = null;
865   },
867   /**
868    * `PooledClass` looks for this.
869    */
870   destructor: function () {
871     this.reset();
872   }
876 PooledClass.addPoolingTo(CallbackQueue);
878 module.exports = CallbackQueue;
879 },{"173":173,"184":184,"26":26}],6:[function(_dereq_,module,exports){
881  * Copyright 2013-present, Facebook, Inc.
882  * All rights reserved.
884  * This source code is licensed under the BSD-style license found in the
885  * LICENSE file in the root directory of this source tree. An additional grant
886  * of patent rights can be found in the PATENTS file in the same directory.
888  * @providesModule ChangeEventPlugin
889  */
891 'use strict';
893 var EventConstants = _dereq_(16);
894 var EventPluginHub = _dereq_(17);
895 var EventPropagators = _dereq_(20);
896 var ExecutionEnvironment = _dereq_(159);
897 var ReactDOMComponentTree = _dereq_(45);
898 var ReactUpdates = _dereq_(104);
899 var SyntheticEvent = _dereq_(115);
901 var getEventTarget = _dereq_(138);
902 var isEventSupported = _dereq_(145);
903 var isTextInputElement = _dereq_(146);
904 var keyOf = _dereq_(177);
906 var topLevelTypes = EventConstants.topLevelTypes;
908 var eventTypes = {
909   change: {
910     phasedRegistrationNames: {
911       bubbled: keyOf({ onChange: null }),
912       captured: keyOf({ onChangeCapture: null })
913     },
914     dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]
915   }
919  * For IE shims
920  */
921 var activeElement = null;
922 var activeElementInst = null;
923 var activeElementValue = null;
924 var activeElementValueProp = null;
927  * SECTION: handle `change` event
928  */
929 function shouldUseChangeEvent(elem) {
930   var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
931   return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
934 var doesChangeEventBubble = false;
935 if (ExecutionEnvironment.canUseDOM) {
936   // See `handleChange` comment below
937   doesChangeEventBubble = isEventSupported('change') && (!('documentMode' in document) || document.documentMode > 8);
940 function manualDispatchChangeEvent(nativeEvent) {
941   var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
942   EventPropagators.accumulateTwoPhaseDispatches(event);
944   // If change and propertychange bubbled, we'd just bind to it like all the
945   // other events and have it go through ReactBrowserEventEmitter. Since it
946   // doesn't, we manually listen for the events and so we have to enqueue and
947   // process the abstract event manually.
948   //
949   // Batching is necessary here in order to ensure that all event handlers run
950   // before the next rerender (including event handlers attached to ancestor
951   // elements instead of directly on the input). Without this, controlled
952   // components don't work properly in conjunction with event bubbling because
953   // the component is rerendered and the value reverted before all the event
954   // handlers can run. See https://github.com/facebook/react/issues/708.
955   ReactUpdates.batchedUpdates(runEventInBatch, event);
958 function runEventInBatch(event) {
959   EventPluginHub.enqueueEvents(event);
960   EventPluginHub.processEventQueue(false);
963 function startWatchingForChangeEventIE8(target, targetInst) {
964   activeElement = target;
965   activeElementInst = targetInst;
966   activeElement.attachEvent('onchange', manualDispatchChangeEvent);
969 function stopWatchingForChangeEventIE8() {
970   if (!activeElement) {
971     return;
972   }
973   activeElement.detachEvent('onchange', manualDispatchChangeEvent);
974   activeElement = null;
975   activeElementInst = null;
978 function getTargetInstForChangeEvent(topLevelType, targetInst) {
979   if (topLevelType === topLevelTypes.topChange) {
980     return targetInst;
981   }
983 function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
984   if (topLevelType === topLevelTypes.topFocus) {
985     // stopWatching() should be a noop here but we call it just in case we
986     // missed a blur event somehow.
987     stopWatchingForChangeEventIE8();
988     startWatchingForChangeEventIE8(target, targetInst);
989   } else if (topLevelType === topLevelTypes.topBlur) {
990     stopWatchingForChangeEventIE8();
991   }
995  * SECTION: handle `input` event
996  */
997 var isInputEventSupported = false;
998 if (ExecutionEnvironment.canUseDOM) {
999   // IE9 claims to support the input event but fails to trigger it when
1000   // deleting text, so we ignore its input events.
1001   // IE10+ fire input events to often, such when a placeholder
1002   // changes or when an input with a placeholder is focused.
1003   isInputEventSupported = isEventSupported('input') && (!('documentMode' in document) || document.documentMode > 11);
1007  * (For IE <=11) Replacement getter/setter for the `value` property that gets
1008  * set on the active element.
1009  */
1010 var newValueProp = {
1011   get: function () {
1012     return activeElementValueProp.get.call(this);
1013   },
1014   set: function (val) {
1015     // Cast to a string so we can do equality checks.
1016     activeElementValue = '' + val;
1017     activeElementValueProp.set.call(this, val);
1018   }
1022  * (For IE <=11) Starts tracking propertychange events on the passed-in element
1023  * and override the value property so that we can distinguish user events from
1024  * value changes in JS.
1025  */
1026 function startWatchingForValueChange(target, targetInst) {
1027   activeElement = target;
1028   activeElementInst = targetInst;
1029   activeElementValue = target.value;
1030   activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
1032   // Not guarded in a canDefineProperty check: IE8 supports defineProperty only
1033   // on DOM elements
1034   Object.defineProperty(activeElement, 'value', newValueProp);
1035   if (activeElement.attachEvent) {
1036     activeElement.attachEvent('onpropertychange', handlePropertyChange);
1037   } else {
1038     activeElement.addEventListener('propertychange', handlePropertyChange, false);
1039   }
1043  * (For IE <=11) Removes the event listeners from the currently-tracked element,
1044  * if any exists.
1045  */
1046 function stopWatchingForValueChange() {
1047   if (!activeElement) {
1048     return;
1049   }
1051   // delete restores the original property definition
1052   delete activeElement.value;
1054   if (activeElement.detachEvent) {
1055     activeElement.detachEvent('onpropertychange', handlePropertyChange);
1056   } else {
1057     activeElement.removeEventListener('propertychange', handlePropertyChange, false);
1058   }
1060   activeElement = null;
1061   activeElementInst = null;
1062   activeElementValue = null;
1063   activeElementValueProp = null;
1067  * (For IE <=11) Handles a propertychange event, sending a `change` event if
1068  * the value of the active element has changed.
1069  */
1070 function handlePropertyChange(nativeEvent) {
1071   if (nativeEvent.propertyName !== 'value') {
1072     return;
1073   }
1074   var value = nativeEvent.srcElement.value;
1075   if (value === activeElementValue) {
1076     return;
1077   }
1078   activeElementValue = value;
1080   manualDispatchChangeEvent(nativeEvent);
1084  * If a `change` event should be fired, returns the target's ID.
1085  */
1086 function getTargetInstForInputEvent(topLevelType, targetInst) {
1087   if (topLevelType === topLevelTypes.topInput) {
1088     // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
1089     // what we want so fall through here and trigger an abstract event
1090     return targetInst;
1091   }
1094 function handleEventsForInputEventIE(topLevelType, target, targetInst) {
1095   if (topLevelType === topLevelTypes.topFocus) {
1096     // In IE8, we can capture almost all .value changes by adding a
1097     // propertychange handler and looking for events with propertyName
1098     // equal to 'value'
1099     // In IE9-11, propertychange fires for most input events but is buggy and
1100     // doesn't fire when text is deleted, but conveniently, selectionchange
1101     // appears to fire in all of the remaining cases so we catch those and
1102     // forward the event if the value has changed
1103     // In either case, we don't want to call the event handler if the value
1104     // is changed from JS so we redefine a setter for `.value` that updates
1105     // our activeElementValue variable, allowing us to ignore those changes
1106     //
1107     // stopWatching() should be a noop here but we call it just in case we
1108     // missed a blur event somehow.
1109     stopWatchingForValueChange();
1110     startWatchingForValueChange(target, targetInst);
1111   } else if (topLevelType === topLevelTypes.topBlur) {
1112     stopWatchingForValueChange();
1113   }
1116 // For IE8 and IE9.
1117 function getTargetInstForInputEventIE(topLevelType, targetInst) {
1118   if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
1119     // On the selectionchange event, the target is just document which isn't
1120     // helpful for us so just check activeElement instead.
1121     //
1122     // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
1123     // propertychange on the first input event after setting `value` from a
1124     // script and fires only keydown, keypress, keyup. Catching keyup usually
1125     // gets it and catching keydown lets us fire an event for the first
1126     // keystroke if user does a key repeat (it'll be a little delayed: right
1127     // before the second keystroke). Other input methods (e.g., paste) seem to
1128     // fire selectionchange normally.
1129     if (activeElement && activeElement.value !== activeElementValue) {
1130       activeElementValue = activeElement.value;
1131       return activeElementInst;
1132     }
1133   }
1137  * SECTION: handle `click` event
1138  */
1139 function shouldUseClickEvent(elem) {
1140   // Use the `click` event to detect changes to checkbox and radio inputs.
1141   // This approach works across all browsers, whereas `change` does not fire
1142   // until `blur` in IE8.
1143   return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
1146 function getTargetInstForClickEvent(topLevelType, targetInst) {
1147   if (topLevelType === topLevelTypes.topClick) {
1148     return targetInst;
1149   }
1153  * This plugin creates an `onChange` event that normalizes change events
1154  * across form elements. This event fires at a time when it's possible to
1155  * change the element's value without seeing a flicker.
1157  * Supported elements are:
1158  * - input (see `isTextInputElement`)
1159  * - textarea
1160  * - select
1161  */
1162 var ChangeEventPlugin = {
1164   eventTypes: eventTypes,
1166   extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
1167     var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
1169     var getTargetInstFunc, handleEventFunc;
1170     if (shouldUseChangeEvent(targetNode)) {
1171       if (doesChangeEventBubble) {
1172         getTargetInstFunc = getTargetInstForChangeEvent;
1173       } else {
1174         handleEventFunc = handleEventsForChangeEventIE8;
1175       }
1176     } else if (isTextInputElement(targetNode)) {
1177       if (isInputEventSupported) {
1178         getTargetInstFunc = getTargetInstForInputEvent;
1179       } else {
1180         getTargetInstFunc = getTargetInstForInputEventIE;
1181         handleEventFunc = handleEventsForInputEventIE;
1182       }
1183     } else if (shouldUseClickEvent(targetNode)) {
1184       getTargetInstFunc = getTargetInstForClickEvent;
1185     }
1187     if (getTargetInstFunc) {
1188       var inst = getTargetInstFunc(topLevelType, targetInst);
1189       if (inst) {
1190         var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget);
1191         event.type = 'change';
1192         EventPropagators.accumulateTwoPhaseDispatches(event);
1193         return event;
1194       }
1195     }
1197     if (handleEventFunc) {
1198       handleEventFunc(topLevelType, targetNode, targetInst);
1199     }
1200   }
1204 module.exports = ChangeEventPlugin;
1205 },{"104":104,"115":115,"138":138,"145":145,"146":146,"159":159,"16":16,"17":17,"177":177,"20":20,"45":45}],7:[function(_dereq_,module,exports){
1207  * Copyright 2013-present, Facebook, Inc.
1208  * All rights reserved.
1210  * This source code is licensed under the BSD-style license found in the
1211  * LICENSE file in the root directory of this source tree. An additional grant
1212  * of patent rights can be found in the PATENTS file in the same directory.
1214  * @providesModule DOMChildrenOperations
1215  */
1217 'use strict';
1219 var DOMLazyTree = _dereq_(8);
1220 var Danger = _dereq_(12);
1221 var ReactMultiChildUpdateTypes = _dereq_(82);
1222 var ReactDOMComponentTree = _dereq_(45);
1223 var ReactInstrumentation = _dereq_(76);
1225 var createMicrosoftUnsafeLocalFunction = _dereq_(129);
1226 var setInnerHTML = _dereq_(150);
1227 var setTextContent = _dereq_(151);
1229 function getNodeAfter(parentNode, node) {
1230   // Special case for text components, which return [open, close] comments
1231   // from getNativeNode.
1232   if (Array.isArray(node)) {
1233     node = node[1];
1234   }
1235   return node ? node.nextSibling : parentNode.firstChild;
1239  * Inserts `childNode` as a child of `parentNode` at the `index`.
1241  * @param {DOMElement} parentNode Parent node in which to insert.
1242  * @param {DOMElement} childNode Child node to insert.
1243  * @param {number} index Index at which to insert the child.
1244  * @internal
1245  */
1246 var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
1247   // We rely exclusively on `insertBefore(node, null)` instead of also using
1248   // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so
1249   // we are careful to use `null`.)
1250   parentNode.insertBefore(childNode, referenceNode);
1253 function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
1254   DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
1257 function moveChild(parentNode, childNode, referenceNode) {
1258   if (Array.isArray(childNode)) {
1259     moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
1260   } else {
1261     insertChildAt(parentNode, childNode, referenceNode);
1262   }
1265 function removeChild(parentNode, childNode) {
1266   if (Array.isArray(childNode)) {
1267     var closingComment = childNode[1];
1268     childNode = childNode[0];
1269     removeDelimitedText(parentNode, childNode, closingComment);
1270     parentNode.removeChild(closingComment);
1271   }
1272   parentNode.removeChild(childNode);
1275 function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {
1276   var node = openingComment;
1277   while (true) {
1278     var nextNode = node.nextSibling;
1279     insertChildAt(parentNode, node, referenceNode);
1280     if (node === closingComment) {
1281       break;
1282     }
1283     node = nextNode;
1284   }
1287 function removeDelimitedText(parentNode, startNode, closingComment) {
1288   while (true) {
1289     var node = startNode.nextSibling;
1290     if (node === closingComment) {
1291       // The closing comment is removed by ReactMultiChild.
1292       break;
1293     } else {
1294       parentNode.removeChild(node);
1295     }
1296   }
1299 function replaceDelimitedText(openingComment, closingComment, stringText) {
1300   var parentNode = openingComment.parentNode;
1301   var nodeAfterComment = openingComment.nextSibling;
1302   if (nodeAfterComment === closingComment) {
1303     // There are no text nodes between the opening and closing comments; insert
1304     // a new one if stringText isn't empty.
1305     if (stringText) {
1306       insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);
1307     }
1308   } else {
1309     if (stringText) {
1310       // Set the text content of the first node after the opening comment, and
1311       // remove all following nodes up until the closing comment.
1312       setTextContent(nodeAfterComment, stringText);
1313       removeDelimitedText(parentNode, nodeAfterComment, closingComment);
1314     } else {
1315       removeDelimitedText(parentNode, openingComment, closingComment);
1316     }
1317   }
1319   if ("development" !== 'production') {
1320     ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, 'replace text', stringText);
1321   }
1324 var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
1325 if ("development" !== 'production') {
1326   dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
1327     Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
1328     if (prevInstance._debugID !== 0) {
1329       ReactInstrumentation.debugTool.onNativeOperation(prevInstance._debugID, 'replace with', markup.toString());
1330     } else {
1331       var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
1332       if (nextInstance._debugID !== 0) {
1333         ReactInstrumentation.debugTool.onNativeOperation(nextInstance._debugID, 'mount', markup.toString());
1334       }
1335     }
1336   };
1340  * Operations for updating with DOM children.
1341  */
1342 var DOMChildrenOperations = {
1344   dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
1346   replaceDelimitedText: replaceDelimitedText,
1348   /**
1349    * Updates a component's children by processing a series of updates. The
1350    * update configurations are each expected to have a `parentNode` property.
1351    *
1352    * @param {array<object>} updates List of update configurations.
1353    * @internal
1354    */
1355   processUpdates: function (parentNode, updates) {
1356     if ("development" !== 'production') {
1357       var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
1358     }
1360     for (var k = 0; k < updates.length; k++) {
1361       var update = updates[k];
1362       switch (update.type) {
1363         case ReactMultiChildUpdateTypes.INSERT_MARKUP:
1364           insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
1365           if ("development" !== 'production') {
1366             ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'insert child', { toIndex: update.toIndex, content: update.content.toString() });
1367           }
1368           break;
1369         case ReactMultiChildUpdateTypes.MOVE_EXISTING:
1370           moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
1371           if ("development" !== 'production') {
1372             ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'move child', { fromIndex: update.fromIndex, toIndex: update.toIndex });
1373           }
1374           break;
1375         case ReactMultiChildUpdateTypes.SET_MARKUP:
1376           setInnerHTML(parentNode, update.content);
1377           if ("development" !== 'production') {
1378             ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'replace children', update.content.toString());
1379           }
1380           break;
1381         case ReactMultiChildUpdateTypes.TEXT_CONTENT:
1382           setTextContent(parentNode, update.content);
1383           if ("development" !== 'production') {
1384             ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'replace text', update.content.toString());
1385           }
1386           break;
1387         case ReactMultiChildUpdateTypes.REMOVE_NODE:
1388           removeChild(parentNode, update.fromNode);
1389           if ("development" !== 'production') {
1390             ReactInstrumentation.debugTool.onNativeOperation(parentNodeDebugID, 'remove child', { fromIndex: update.fromIndex });
1391           }
1392           break;
1393       }
1394     }
1395   }
1399 module.exports = DOMChildrenOperations;
1400 },{"12":12,"129":129,"150":150,"151":151,"45":45,"76":76,"8":8,"82":82}],8:[function(_dereq_,module,exports){
1402  * Copyright 2015-present, Facebook, Inc.
1403  * All rights reserved.
1405  * This source code is licensed under the BSD-style license found in the
1406  * LICENSE file in the root directory of this source tree. An additional grant
1407  * of patent rights can be found in the PATENTS file in the same directory.
1409  * @providesModule DOMLazyTree
1410  */
1412 'use strict';
1414 var DOMNamespaces = _dereq_(9);
1416 var createMicrosoftUnsafeLocalFunction = _dereq_(129);
1417 var setTextContent = _dereq_(151);
1419 var ELEMENT_NODE_TYPE = 1;
1420 var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
1423  * In IE (8-11) and Edge, appending nodes with no children is dramatically
1424  * faster than appending a full subtree, so we essentially queue up the
1425  * .appendChild calls here and apply them so each node is added to its parent
1426  * before any children are added.
1428  * In other browsers, doing so is slower or neutral compared to the other order
1429  * (in Firefox, twice as slow) so we only do this inversion in IE.
1431  * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.
1432  */
1433 var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
1435 function insertTreeChildren(tree) {
1436   if (!enableLazy) {
1437     return;
1438   }
1439   var node = tree.node;
1440   var children = tree.children;
1441   if (children.length) {
1442     for (var i = 0; i < children.length; i++) {
1443       insertTreeBefore(node, children[i], null);
1444     }
1445   } else if (tree.html != null) {
1446     node.innerHTML = tree.html;
1447   } else if (tree.text != null) {
1448     setTextContent(node, tree.text);
1449   }
1452 var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
1453   // DocumentFragments aren't actually part of the DOM after insertion so
1454   // appending children won't update the DOM. We need to ensure the fragment
1455   // is properly populated first, breaking out of our lazy approach for just
1456   // this level. Also, some <object> plugins (like Flash Player) will read
1457   // <param> nodes immediately upon insertion into the DOM, so <object>
1458   // must also be populated prior to insertion into the DOM.
1459   if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) {
1460     insertTreeChildren(tree);
1461     parentNode.insertBefore(tree.node, referenceNode);
1462   } else {
1463     parentNode.insertBefore(tree.node, referenceNode);
1464     insertTreeChildren(tree);
1465   }
1468 function replaceChildWithTree(oldNode, newTree) {
1469   oldNode.parentNode.replaceChild(newTree.node, oldNode);
1470   insertTreeChildren(newTree);
1473 function queueChild(parentTree, childTree) {
1474   if (enableLazy) {
1475     parentTree.children.push(childTree);
1476   } else {
1477     parentTree.node.appendChild(childTree.node);
1478   }
1481 function queueHTML(tree, html) {
1482   if (enableLazy) {
1483     tree.html = html;
1484   } else {
1485     tree.node.innerHTML = html;
1486   }
1489 function queueText(tree, text) {
1490   if (enableLazy) {
1491     tree.text = text;
1492   } else {
1493     setTextContent(tree.node, text);
1494   }
1497 function toString() {
1498   return this.node.nodeName;
1501 function DOMLazyTree(node) {
1502   return {
1503     node: node,
1504     children: [],
1505     html: null,
1506     text: null,
1507     toString: toString
1508   };
1511 DOMLazyTree.insertTreeBefore = insertTreeBefore;
1512 DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
1513 DOMLazyTree.queueChild = queueChild;
1514 DOMLazyTree.queueHTML = queueHTML;
1515 DOMLazyTree.queueText = queueText;
1517 module.exports = DOMLazyTree;
1518 },{"129":129,"151":151,"9":9}],9:[function(_dereq_,module,exports){
1520  * Copyright 2013-present, Facebook, Inc.
1521  * All rights reserved.
1523  * This source code is licensed under the BSD-style license found in the
1524  * LICENSE file in the root directory of this source tree. An additional grant
1525  * of patent rights can be found in the PATENTS file in the same directory.
1527  * @providesModule DOMNamespaces
1528  */
1530 'use strict';
1532 var DOMNamespaces = {
1533   html: 'http://www.w3.org/1999/xhtml',
1534   mathml: 'http://www.w3.org/1998/Math/MathML',
1535   svg: 'http://www.w3.org/2000/svg'
1538 module.exports = DOMNamespaces;
1539 },{}],10:[function(_dereq_,module,exports){
1541  * Copyright 2013-present, Facebook, Inc.
1542  * All rights reserved.
1544  * This source code is licensed under the BSD-style license found in the
1545  * LICENSE file in the root directory of this source tree. An additional grant
1546  * of patent rights can be found in the PATENTS file in the same directory.
1548  * @providesModule DOMProperty
1549  */
1551 'use strict';
1553 var invariant = _dereq_(173);
1555 function checkMask(value, bitmask) {
1556   return (value & bitmask) === bitmask;
1559 var DOMPropertyInjection = {
1560   /**
1561    * Mapping from normalized, camelcased property names to a configuration that
1562    * specifies how the associated DOM property should be accessed or rendered.
1563    */
1564   MUST_USE_PROPERTY: 0x1,
1565   HAS_SIDE_EFFECTS: 0x2,
1566   HAS_BOOLEAN_VALUE: 0x4,
1567   HAS_NUMERIC_VALUE: 0x8,
1568   HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
1569   HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
1571   /**
1572    * Inject some specialized knowledge about the DOM. This takes a config object
1573    * with the following properties:
1574    *
1575    * isCustomAttribute: function that given an attribute name will return true
1576    * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
1577    * attributes where it's impossible to enumerate all of the possible
1578    * attribute names,
1579    *
1580    * Properties: object mapping DOM property name to one of the
1581    * DOMPropertyInjection constants or null. If your attribute isn't in here,
1582    * it won't get written to the DOM.
1583    *
1584    * DOMAttributeNames: object mapping React attribute name to the DOM
1585    * attribute name. Attribute names not specified use the **lowercase**
1586    * normalized name.
1587    *
1588    * DOMAttributeNamespaces: object mapping React attribute name to the DOM
1589    * attribute namespace URL. (Attribute names not specified use no namespace.)
1590    *
1591    * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
1592    * Property names not specified use the normalized name.
1593    *
1594    * DOMMutationMethods: Properties that require special mutation methods. If
1595    * `value` is undefined, the mutation method should unset the property.
1596    *
1597    * @param {object} domPropertyConfig the config as described above.
1598    */
1599   injectDOMPropertyConfig: function (domPropertyConfig) {
1600     var Injection = DOMPropertyInjection;
1601     var Properties = domPropertyConfig.Properties || {};
1602     var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
1603     var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
1604     var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
1605     var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
1607     if (domPropertyConfig.isCustomAttribute) {
1608       DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
1609     }
1611     for (var propName in Properties) {
1612       !!DOMProperty.properties.hasOwnProperty(propName) ? "development" !== '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) : void 0;
1614       var lowerCased = propName.toLowerCase();
1615       var propConfig = Properties[propName];
1617       var propertyInfo = {
1618         attributeName: lowerCased,
1619         attributeNamespace: null,
1620         propertyName: propName,
1621         mutationMethod: null,
1623         mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
1624         hasSideEffects: checkMask(propConfig, Injection.HAS_SIDE_EFFECTS),
1625         hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
1626         hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
1627         hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
1628         hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
1629       };
1631       !(propertyInfo.mustUseProperty || !propertyInfo.hasSideEffects) ? "development" !== 'production' ? invariant(false, 'DOMProperty: Properties that have side effects must use property: %s', propName) : invariant(false) : void 0;
1632       !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? "development" !== 'production' ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + 'numeric value, but not a combination: %s', propName) : invariant(false) : void 0;
1634       if ("development" !== 'production') {
1635         DOMProperty.getPossibleStandardName[lowerCased] = propName;
1636       }
1638       if (DOMAttributeNames.hasOwnProperty(propName)) {
1639         var attributeName = DOMAttributeNames[propName];
1640         propertyInfo.attributeName = attributeName;
1641         if ("development" !== 'production') {
1642           DOMProperty.getPossibleStandardName[attributeName] = propName;
1643         }
1644       }
1646       if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
1647         propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
1648       }
1650       if (DOMPropertyNames.hasOwnProperty(propName)) {
1651         propertyInfo.propertyName = DOMPropertyNames[propName];
1652       }
1654       if (DOMMutationMethods.hasOwnProperty(propName)) {
1655         propertyInfo.mutationMethod = DOMMutationMethods[propName];
1656       }
1658       DOMProperty.properties[propName] = propertyInfo;
1659     }
1660   }
1663 /* eslint-disable max-len */
1664 var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
1665 /* eslint-enable max-len */
1668  * DOMProperty exports lookup objects that can be used like functions:
1670  *   > DOMProperty.isValid['id']
1671  *   true
1672  *   > DOMProperty.isValid['foobar']
1673  *   undefined
1675  * Although this may be confusing, it performs better in general.
1677  * @see http://jsperf.com/key-exists
1678  * @see http://jsperf.com/key-missing
1679  */
1680 var DOMProperty = {
1682   ID_ATTRIBUTE_NAME: 'data-reactid',
1683   ROOT_ATTRIBUTE_NAME: 'data-reactroot',
1685   ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
1686   ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\uB7\\u0300-\\u036F\\u203F-\\u2040',
1688   /**
1689    * Map from property "standard name" to an object with info about how to set
1690    * the property in the DOM. Each object contains:
1691    *
1692    * attributeName:
1693    *   Used when rendering markup or with `*Attribute()`.
1694    * attributeNamespace
1695    * propertyName:
1696    *   Used on DOM node instances. (This includes properties that mutate due to
1697    *   external factors.)
1698    * mutationMethod:
1699    *   If non-null, used instead of the property or `setAttribute()` after
1700    *   initial render.
1701    * mustUseProperty:
1702    *   Whether the property must be accessed and mutated as an object property.
1703    * hasSideEffects:
1704    *   Whether or not setting a value causes side effects such as triggering
1705    *   resources to be loaded or text selection changes. If true, we read from
1706    *   the DOM before updating to ensure that the value is only set if it has
1707    *   changed.
1708    * hasBooleanValue:
1709    *   Whether the property should be removed when set to a falsey value.
1710    * hasNumericValue:
1711    *   Whether the property must be numeric or parse as a numeric and should be
1712    *   removed when set to a falsey value.
1713    * hasPositiveNumericValue:
1714    *   Whether the property must be positive numeric or parse as a positive
1715    *   numeric and should be removed when set to a falsey value.
1716    * hasOverloadedBooleanValue:
1717    *   Whether the property can be used as a flag as well as with a value.
1718    *   Removed when strictly equal to false; present without a value when
1719    *   strictly equal to true; present with a value otherwise.
1720    */
1721   properties: {},
1723   /**
1724    * Mapping from lowercase property names to the properly cased version, used
1725    * to warn in the case of missing properties. Available only in __DEV__.
1726    * @type {Object}
1727    */
1728   getPossibleStandardName: "development" !== 'production' ? {} : null,
1730   /**
1731    * All of the isCustomAttribute() functions that have been injected.
1732    */
1733   _isCustomAttributeFunctions: [],
1735   /**
1736    * Checks whether a property name is a custom attribute.
1737    * @method
1738    */
1739   isCustomAttribute: function (attributeName) {
1740     for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
1741       var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
1742       if (isCustomAttributeFn(attributeName)) {
1743         return true;
1744       }
1745     }
1746     return false;
1747   },
1749   injection: DOMPropertyInjection
1752 module.exports = DOMProperty;
1753 },{"173":173}],11:[function(_dereq_,module,exports){
1755  * Copyright 2013-present, Facebook, Inc.
1756  * All rights reserved.
1758  * This source code is licensed under the BSD-style license found in the
1759  * LICENSE file in the root directory of this source tree. An additional grant
1760  * of patent rights can be found in the PATENTS file in the same directory.
1762  * @providesModule DOMPropertyOperations
1763  */
1765 'use strict';
1767 var DOMProperty = _dereq_(10);
1768 var ReactDOMComponentTree = _dereq_(45);
1769 var ReactDOMInstrumentation = _dereq_(53);
1770 var ReactInstrumentation = _dereq_(76);
1772 var quoteAttributeValueForBrowser = _dereq_(148);
1773 var warning = _dereq_(183);
1775 var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
1776 var illegalAttributeNameCache = {};
1777 var validatedAttributeNameCache = {};
1779 function isAttributeNameSafe(attributeName) {
1780   if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
1781     return true;
1782   }
1783   if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
1784     return false;
1785   }
1786   if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
1787     validatedAttributeNameCache[attributeName] = true;
1788     return true;
1789   }
1790   illegalAttributeNameCache[attributeName] = true;
1791   "development" !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
1792   return false;
1795 function shouldIgnoreValue(propertyInfo, value) {
1796   return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
1800  * Operations for dealing with DOM properties.
1801  */
1802 var DOMPropertyOperations = {
1804   /**
1805    * Creates markup for the ID property.
1806    *
1807    * @param {string} id Unescaped ID.
1808    * @return {string} Markup string.
1809    */
1810   createMarkupForID: function (id) {
1811     return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
1812   },
1814   setAttributeForID: function (node, id) {
1815     node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
1816   },
1818   createMarkupForRoot: function () {
1819     return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
1820   },
1822   setAttributeForRoot: function (node) {
1823     node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
1824   },
1826   /**
1827    * Creates markup for a property.
1828    *
1829    * @param {string} name
1830    * @param {*} value
1831    * @return {?string} Markup string, or null if the property was invalid.
1832    */
1833   createMarkupForProperty: function (name, value) {
1834     if ("development" !== 'production') {
1835       ReactDOMInstrumentation.debugTool.onCreateMarkupForProperty(name, value);
1836     }
1837     var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1838     if (propertyInfo) {
1839       if (shouldIgnoreValue(propertyInfo, value)) {
1840         return '';
1841       }
1842       var attributeName = propertyInfo.attributeName;
1843       if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
1844         return attributeName + '=""';
1845       }
1846       return attributeName + '=' + quoteAttributeValueForBrowser(value);
1847     } else if (DOMProperty.isCustomAttribute(name)) {
1848       if (value == null) {
1849         return '';
1850       }
1851       return name + '=' + quoteAttributeValueForBrowser(value);
1852     }
1853     return null;
1854   },
1856   /**
1857    * Creates markup for a custom property.
1858    *
1859    * @param {string} name
1860    * @param {*} value
1861    * @return {string} Markup string, or empty string if the property was invalid.
1862    */
1863   createMarkupForCustomAttribute: function (name, value) {
1864     if (!isAttributeNameSafe(name) || value == null) {
1865       return '';
1866     }
1867     return name + '=' + quoteAttributeValueForBrowser(value);
1868   },
1870   /**
1871    * Sets the value for a property on a node.
1872    *
1873    * @param {DOMElement} node
1874    * @param {string} name
1875    * @param {*} value
1876    */
1877   setValueForProperty: function (node, name, value) {
1878     var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1879     if (propertyInfo) {
1880       var mutationMethod = propertyInfo.mutationMethod;
1881       if (mutationMethod) {
1882         mutationMethod(node, value);
1883       } else if (shouldIgnoreValue(propertyInfo, value)) {
1884         this.deleteValueForProperty(node, name);
1885         return;
1886       } else if (propertyInfo.mustUseProperty) {
1887         var propName = propertyInfo.propertyName;
1888         // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the
1889         // property type before comparing; only `value` does and is string.
1890         if (!propertyInfo.hasSideEffects || '' + node[propName] !== '' + value) {
1891           // Contrary to `setAttribute`, object properties are properly
1892           // `toString`ed by IE8/9.
1893           node[propName] = value;
1894         }
1895       } else {
1896         var attributeName = propertyInfo.attributeName;
1897         var namespace = propertyInfo.attributeNamespace;
1898         // `setAttribute` with objects becomes only `[object]` in IE8/9,
1899         // ('' + value) makes it output the correct toString()-value.
1900         if (namespace) {
1901           node.setAttributeNS(namespace, attributeName, '' + value);
1902         } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
1903           node.setAttribute(attributeName, '');
1904         } else {
1905           node.setAttribute(attributeName, '' + value);
1906         }
1907       }
1908     } else if (DOMProperty.isCustomAttribute(name)) {
1909       DOMPropertyOperations.setValueForAttribute(node, name, value);
1910       return;
1911     }
1913     if ("development" !== 'production') {
1914       ReactDOMInstrumentation.debugTool.onSetValueForProperty(node, name, value);
1915       var payload = {};
1916       payload[name] = value;
1917       ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
1918     }
1919   },
1921   setValueForAttribute: function (node, name, value) {
1922     if (!isAttributeNameSafe(name)) {
1923       return;
1924     }
1925     if (value == null) {
1926       node.removeAttribute(name);
1927     } else {
1928       node.setAttribute(name, '' + value);
1929     }
1931     if ("development" !== 'production') {
1932       var payload = {};
1933       payload[name] = value;
1934       ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
1935     }
1936   },
1938   /**
1939    * Deletes the value for a property on a node.
1940    *
1941    * @param {DOMElement} node
1942    * @param {string} name
1943    */
1944   deleteValueForProperty: function (node, name) {
1945     var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1946     if (propertyInfo) {
1947       var mutationMethod = propertyInfo.mutationMethod;
1948       if (mutationMethod) {
1949         mutationMethod(node, undefined);
1950       } else if (propertyInfo.mustUseProperty) {
1951         var propName = propertyInfo.propertyName;
1952         if (propertyInfo.hasBooleanValue) {
1953           // No HAS_SIDE_EFFECTS logic here, only `value` has it and is string.
1954           node[propName] = false;
1955         } else {
1956           if (!propertyInfo.hasSideEffects || '' + node[propName] !== '') {
1957             node[propName] = '';
1958           }
1959         }
1960       } else {
1961         node.removeAttribute(propertyInfo.attributeName);
1962       }
1963     } else if (DOMProperty.isCustomAttribute(name)) {
1964       node.removeAttribute(name);
1965     }
1967     if ("development" !== 'production') {
1968       ReactDOMInstrumentation.debugTool.onDeleteValueForProperty(node, name);
1969       ReactInstrumentation.debugTool.onNativeOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);
1970     }
1971   }
1975 module.exports = DOMPropertyOperations;
1976 },{"10":10,"148":148,"183":183,"45":45,"53":53,"76":76}],12:[function(_dereq_,module,exports){
1978  * Copyright 2013-present, Facebook, Inc.
1979  * All rights reserved.
1981  * This source code is licensed under the BSD-style license found in the
1982  * LICENSE file in the root directory of this source tree. An additional grant
1983  * of patent rights can be found in the PATENTS file in the same directory.
1985  * @providesModule Danger
1986  */
1988 'use strict';
1990 var DOMLazyTree = _dereq_(8);
1991 var ExecutionEnvironment = _dereq_(159);
1993 var createNodesFromMarkup = _dereq_(164);
1994 var emptyFunction = _dereq_(165);
1995 var getMarkupWrap = _dereq_(169);
1996 var invariant = _dereq_(173);
1998 var OPEN_TAG_NAME_EXP = /^(<[^ \/>]+)/;
1999 var RESULT_INDEX_ATTR = 'data-danger-index';
2002  * Extracts the `nodeName` from a string of markup.
2004  * NOTE: Extracting the `nodeName` does not require a regular expression match
2005  * because we make assumptions about React-generated markup (i.e. there are no
2006  * spaces surrounding the opening tag and there is at least one attribute).
2008  * @param {string} markup String of markup.
2009  * @return {string} Node name of the supplied markup.
2010  * @see http://jsperf.com/extract-nodename
2011  */
2012 function getNodeName(markup) {
2013   return markup.substring(1, markup.indexOf(' '));
2016 var Danger = {
2018   /**
2019    * Renders markup into an array of nodes. The markup is expected to render
2020    * into a list of root nodes. Also, the length of `resultList` and
2021    * `markupList` should be the same.
2022    *
2023    * @param {array<string>} markupList List of markup strings to render.
2024    * @return {array<DOMElement>} List of rendered nodes.
2025    * @internal
2026    */
2027   dangerouslyRenderMarkup: function (markupList) {
2028     !ExecutionEnvironment.canUseDOM ? "development" !== '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) : void 0;
2029     var nodeName;
2030     var markupByNodeName = {};
2031     // Group markup by `nodeName` if a wrap is necessary, else by '*'.
2032     for (var i = 0; i < markupList.length; i++) {
2033       !markupList[i] ? "development" !== 'production' ? invariant(false, 'dangerouslyRenderMarkup(...): Missing markup.') : invariant(false) : void 0;
2034       nodeName = getNodeName(markupList[i]);
2035       nodeName = getMarkupWrap(nodeName) ? nodeName : '*';
2036       markupByNodeName[nodeName] = markupByNodeName[nodeName] || [];
2037       markupByNodeName[nodeName][i] = markupList[i];
2038     }
2039     var resultList = [];
2040     var resultListAssignmentCount = 0;
2041     for (nodeName in markupByNodeName) {
2042       if (!markupByNodeName.hasOwnProperty(nodeName)) {
2043         continue;
2044       }
2045       var markupListByNodeName = markupByNodeName[nodeName];
2047       // This for-in loop skips the holes of the sparse array. The order of
2048       // iteration should follow the order of assignment, which happens to match
2049       // numerical index order, but we don't rely on that.
2050       var resultIndex;
2051       for (resultIndex in markupListByNodeName) {
2052         if (markupListByNodeName.hasOwnProperty(resultIndex)) {
2053           var markup = markupListByNodeName[resultIndex];
2055           // Push the requested markup with an additional RESULT_INDEX_ATTR
2056           // attribute.  If the markup does not start with a < character, it
2057           // will be discarded below (with an appropriate console.error).
2058           markupListByNodeName[resultIndex] = markup.replace(OPEN_TAG_NAME_EXP,
2059           // This index will be parsed back out below.
2060           '$1 ' + RESULT_INDEX_ATTR + '="' + resultIndex + '" ');
2061         }
2062       }
2064       // Render each group of markup with similar wrapping `nodeName`.
2065       var renderNodes = createNodesFromMarkup(markupListByNodeName.join(''), emptyFunction // Do nothing special with <script> tags.
2066       );
2068       for (var j = 0; j < renderNodes.length; ++j) {
2069         var renderNode = renderNodes[j];
2070         if (renderNode.hasAttribute && renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
2072           resultIndex = +renderNode.getAttribute(RESULT_INDEX_ATTR);
2073           renderNode.removeAttribute(RESULT_INDEX_ATTR);
2075           !!resultList.hasOwnProperty(resultIndex) ? "development" !== 'production' ? invariant(false, 'Danger: Assigning to an already-occupied result index.') : invariant(false) : void 0;
2077           resultList[resultIndex] = renderNode;
2079           // This should match resultList.length and markupList.length when
2080           // we're done.
2081           resultListAssignmentCount += 1;
2082         } else if ("development" !== 'production') {
2083           console.error('Danger: Discarding unexpected node:', renderNode);
2084         }
2085       }
2086     }
2088     // Although resultList was populated out of order, it should now be a dense
2089     // array.
2090     !(resultListAssignmentCount === resultList.length) ? "development" !== 'production' ? invariant(false, 'Danger: Did not assign to every index of resultList.') : invariant(false) : void 0;
2092     !(resultList.length === markupList.length) ? "development" !== 'production' ? invariant(false, 'Danger: Expected markup to render %s nodes, but rendered %s.', markupList.length, resultList.length) : invariant(false) : void 0;
2094     return resultList;
2095   },
2097   /**
2098    * Replaces a node with a string of markup at its current position within its
2099    * parent. The markup must render into a single root node.
2100    *
2101    * @param {DOMElement} oldChild Child node to replace.
2102    * @param {string} markup Markup to render in place of the child node.
2103    * @internal
2104    */
2105   dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
2106     !ExecutionEnvironment.canUseDOM ? "development" !== '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) : void 0;
2107     !markup ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : invariant(false) : void 0;
2108     !(oldChild.nodeName !== 'HTML') ? "development" !== '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) : void 0;
2110     if (typeof markup === 'string') {
2111       var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
2112       oldChild.parentNode.replaceChild(newChild, oldChild);
2113     } else {
2114       DOMLazyTree.replaceChildWithTree(oldChild, markup);
2115     }
2116   }
2120 module.exports = Danger;
2121 },{"159":159,"164":164,"165":165,"169":169,"173":173,"8":8}],13:[function(_dereq_,module,exports){
2123  * Copyright 2013-present, Facebook, Inc.
2124  * All rights reserved.
2126  * This source code is licensed under the BSD-style license found in the
2127  * LICENSE file in the root directory of this source tree. An additional grant
2128  * of patent rights can be found in the PATENTS file in the same directory.
2130  * @providesModule DefaultEventPluginOrder
2131  */
2133 'use strict';
2135 var keyOf = _dereq_(177);
2138  * Module that is injectable into `EventPluginHub`, that specifies a
2139  * deterministic ordering of `EventPlugin`s. A convenient way to reason about
2140  * plugins, without having to package every one of them. This is better than
2141  * having plugins be ordered in the same order that they are injected because
2142  * that ordering would be influenced by the packaging order.
2143  * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
2144  * preventing default on events is convenient in `SimpleEventPlugin` handlers.
2145  */
2146 var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
2148 module.exports = DefaultEventPluginOrder;
2149 },{"177":177}],14:[function(_dereq_,module,exports){
2151  * Copyright 2013-present, Facebook, Inc.
2152  * All rights reserved.
2154  * This source code is licensed under the BSD-style license found in the
2155  * LICENSE file in the root directory of this source tree. An additional grant
2156  * of patent rights can be found in the PATENTS file in the same directory.
2158  * @providesModule DisabledInputUtils
2159  */
2161 'use strict';
2163 var disableableMouseListenerNames = {
2164   onClick: true,
2165   onDoubleClick: true,
2166   onMouseDown: true,
2167   onMouseMove: true,
2168   onMouseUp: true,
2170   onClickCapture: true,
2171   onDoubleClickCapture: true,
2172   onMouseDownCapture: true,
2173   onMouseMoveCapture: true,
2174   onMouseUpCapture: true
2178  * Implements a native component that does not receive mouse events
2179  * when `disabled` is set.
2180  */
2181 var DisabledInputUtils = {
2182   getNativeProps: function (inst, props) {
2183     if (!props.disabled) {
2184       return props;
2185     }
2187     // Copy the props, except the mouse listeners
2188     var nativeProps = {};
2189     for (var key in props) {
2190       if (!disableableMouseListenerNames[key] && props.hasOwnProperty(key)) {
2191         nativeProps[key] = props[key];
2192       }
2193     }
2195     return nativeProps;
2196   }
2199 module.exports = DisabledInputUtils;
2200 },{}],15:[function(_dereq_,module,exports){
2202  * Copyright 2013-present, Facebook, Inc.
2203  * All rights reserved.
2205  * This source code is licensed under the BSD-style license found in the
2206  * LICENSE file in the root directory of this source tree. An additional grant
2207  * of patent rights can be found in the PATENTS file in the same directory.
2209  * @providesModule EnterLeaveEventPlugin
2210  */
2212 'use strict';
2214 var EventConstants = _dereq_(16);
2215 var EventPropagators = _dereq_(20);
2216 var ReactDOMComponentTree = _dereq_(45);
2217 var SyntheticMouseEvent = _dereq_(119);
2219 var keyOf = _dereq_(177);
2221 var topLevelTypes = EventConstants.topLevelTypes;
2223 var eventTypes = {
2224   mouseEnter: {
2225     registrationName: keyOf({ onMouseEnter: null }),
2226     dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
2227   },
2228   mouseLeave: {
2229     registrationName: keyOf({ onMouseLeave: null }),
2230     dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
2231   }
2234 var EnterLeaveEventPlugin = {
2236   eventTypes: eventTypes,
2238   /**
2239    * For almost every interaction we care about, there will be both a top-level
2240    * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
2241    * we do not extract duplicate events. However, moving the mouse into the
2242    * browser from outside will not fire a `mouseout` event. In this case, we use
2243    * the `mouseover` top-level event.
2244    */
2245   extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2246     if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
2247       return null;
2248     }
2249     if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {
2250       // Must not be a mouse in or mouse out - ignoring.
2251       return null;
2252     }
2254     var win;
2255     if (nativeEventTarget.window === nativeEventTarget) {
2256       // `nativeEventTarget` is probably a window object.
2257       win = nativeEventTarget;
2258     } else {
2259       // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
2260       var doc = nativeEventTarget.ownerDocument;
2261       if (doc) {
2262         win = doc.defaultView || doc.parentWindow;
2263       } else {
2264         win = window;
2265       }
2266     }
2268     var from;
2269     var to;
2270     if (topLevelType === topLevelTypes.topMouseOut) {
2271       from = targetInst;
2272       var related = nativeEvent.relatedTarget || nativeEvent.toElement;
2273       to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
2274     } else {
2275       // Moving to a node from outside the window.
2276       from = null;
2277       to = targetInst;
2278     }
2280     if (from === to) {
2281       // Nothing pertains to our managed components.
2282       return null;
2283     }
2285     var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
2286     var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
2288     var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
2289     leave.type = 'mouseleave';
2290     leave.target = fromNode;
2291     leave.relatedTarget = toNode;
2293     var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
2294     enter.type = 'mouseenter';
2295     enter.target = toNode;
2296     enter.relatedTarget = fromNode;
2298     EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
2300     return [leave, enter];
2301   }
2305 module.exports = EnterLeaveEventPlugin;
2306 },{"119":119,"16":16,"177":177,"20":20,"45":45}],16:[function(_dereq_,module,exports){
2308  * Copyright 2013-present, Facebook, Inc.
2309  * All rights reserved.
2311  * This source code is licensed under the BSD-style license found in the
2312  * LICENSE file in the root directory of this source tree. An additional grant
2313  * of patent rights can be found in the PATENTS file in the same directory.
2315  * @providesModule EventConstants
2316  */
2318 'use strict';
2320 var keyMirror = _dereq_(176);
2322 var PropagationPhases = keyMirror({ bubbled: null, captured: null });
2325  * Types of raw signals from the browser caught at the top level.
2326  */
2327 var topLevelTypes = keyMirror({
2328   topAbort: null,
2329   topAnimationEnd: null,
2330   topAnimationIteration: null,
2331   topAnimationStart: null,
2332   topBlur: null,
2333   topCanPlay: null,
2334   topCanPlayThrough: null,
2335   topChange: null,
2336   topClick: null,
2337   topCompositionEnd: null,
2338   topCompositionStart: null,
2339   topCompositionUpdate: null,
2340   topContextMenu: null,
2341   topCopy: null,
2342   topCut: null,
2343   topDoubleClick: null,
2344   topDrag: null,
2345   topDragEnd: null,
2346   topDragEnter: null,
2347   topDragExit: null,
2348   topDragLeave: null,
2349   topDragOver: null,
2350   topDragStart: null,
2351   topDrop: null,
2352   topDurationChange: null,
2353   topEmptied: null,
2354   topEncrypted: null,
2355   topEnded: null,
2356   topError: null,
2357   topFocus: null,
2358   topInput: null,
2359   topInvalid: null,
2360   topKeyDown: null,
2361   topKeyPress: null,
2362   topKeyUp: null,
2363   topLoad: null,
2364   topLoadedData: null,
2365   topLoadedMetadata: null,
2366   topLoadStart: null,
2367   topMouseDown: null,
2368   topMouseMove: null,
2369   topMouseOut: null,
2370   topMouseOver: null,
2371   topMouseUp: null,
2372   topPaste: null,
2373   topPause: null,
2374   topPlay: null,
2375   topPlaying: null,
2376   topProgress: null,
2377   topRateChange: null,
2378   topReset: null,
2379   topScroll: null,
2380   topSeeked: null,
2381   topSeeking: null,
2382   topSelectionChange: null,
2383   topStalled: null,
2384   topSubmit: null,
2385   topSuspend: null,
2386   topTextInput: null,
2387   topTimeUpdate: null,
2388   topTouchCancel: null,
2389   topTouchEnd: null,
2390   topTouchMove: null,
2391   topTouchStart: null,
2392   topTransitionEnd: null,
2393   topVolumeChange: null,
2394   topWaiting: null,
2395   topWheel: null
2398 var EventConstants = {
2399   topLevelTypes: topLevelTypes,
2400   PropagationPhases: PropagationPhases
2403 module.exports = EventConstants;
2404 },{"176":176}],17:[function(_dereq_,module,exports){
2406  * Copyright 2013-present, Facebook, Inc.
2407  * All rights reserved.
2409  * This source code is licensed under the BSD-style license found in the
2410  * LICENSE file in the root directory of this source tree. An additional grant
2411  * of patent rights can be found in the PATENTS file in the same directory.
2413  * @providesModule EventPluginHub
2414  */
2416 'use strict';
2418 var EventPluginRegistry = _dereq_(18);
2419 var EventPluginUtils = _dereq_(19);
2420 var ReactErrorUtils = _dereq_(68);
2422 var accumulateInto = _dereq_(126);
2423 var forEachAccumulated = _dereq_(134);
2424 var invariant = _dereq_(173);
2427  * Internal store for event listeners
2428  */
2429 var listenerBank = {};
2432  * Internal queue of events that have accumulated their dispatches and are
2433  * waiting to have their dispatches executed.
2434  */
2435 var eventQueue = null;
2438  * Dispatches an event and releases it back into the pool, unless persistent.
2440  * @param {?object} event Synthetic event to be dispatched.
2441  * @param {boolean} simulated If the event is simulated (changes exn behavior)
2442  * @private
2443  */
2444 var executeDispatchesAndRelease = function (event, simulated) {
2445   if (event) {
2446     EventPluginUtils.executeDispatchesInOrder(event, simulated);
2448     if (!event.isPersistent()) {
2449       event.constructor.release(event);
2450     }
2451   }
2453 var executeDispatchesAndReleaseSimulated = function (e) {
2454   return executeDispatchesAndRelease(e, true);
2456 var executeDispatchesAndReleaseTopLevel = function (e) {
2457   return executeDispatchesAndRelease(e, false);
2461  * This is a unified interface for event plugins to be installed and configured.
2463  * Event plugins can implement the following properties:
2465  *   `extractEvents` {function(string, DOMEventTarget, string, object): *}
2466  *     Required. When a top-level event is fired, this method is expected to
2467  *     extract synthetic events that will in turn be queued and dispatched.
2469  *   `eventTypes` {object}
2470  *     Optional, plugins that fire events must publish a mapping of registration
2471  *     names that are used to register listeners. Values of this mapping must
2472  *     be objects that contain `registrationName` or `phasedRegistrationNames`.
2474  *   `executeDispatch` {function(object, function, string)}
2475  *     Optional, allows plugins to override how an event gets dispatched. By
2476  *     default, the listener is simply invoked.
2478  * Each plugin that is injected into `EventsPluginHub` is immediately operable.
2480  * @public
2481  */
2482 var EventPluginHub = {
2484   /**
2485    * Methods for injecting dependencies.
2486    */
2487   injection: {
2489     /**
2490      * @param {array} InjectedEventPluginOrder
2491      * @public
2492      */
2493     injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
2495     /**
2496      * @param {object} injectedNamesToPlugins Map from names to plugin modules.
2497      */
2498     injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
2500   },
2502   /**
2503    * Stores `listener` at `listenerBank[registrationName][id]`. Is idempotent.
2504    *
2505    * @param {object} inst The instance, which is the source of events.
2506    * @param {string} registrationName Name of listener (e.g. `onClick`).
2507    * @param {function} listener The callback to store.
2508    */
2509   putListener: function (inst, registrationName, listener) {
2510     !(typeof listener === 'function') ? "development" !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : invariant(false) : void 0;
2512     var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
2513     bankForRegistrationName[inst._rootNodeID] = listener;
2515     var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2516     if (PluginModule && PluginModule.didPutListener) {
2517       PluginModule.didPutListener(inst, registrationName, listener);
2518     }
2519   },
2521   /**
2522    * @param {object} inst The instance, which is the source of events.
2523    * @param {string} registrationName Name of listener (e.g. `onClick`).
2524    * @return {?function} The stored callback.
2525    */
2526   getListener: function (inst, registrationName) {
2527     var bankForRegistrationName = listenerBank[registrationName];
2528     return bankForRegistrationName && bankForRegistrationName[inst._rootNodeID];
2529   },
2531   /**
2532    * Deletes a listener from the registration bank.
2533    *
2534    * @param {object} inst The instance, which is the source of events.
2535    * @param {string} registrationName Name of listener (e.g. `onClick`).
2536    */
2537   deleteListener: function (inst, registrationName) {
2538     var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2539     if (PluginModule && PluginModule.willDeleteListener) {
2540       PluginModule.willDeleteListener(inst, registrationName);
2541     }
2543     var bankForRegistrationName = listenerBank[registrationName];
2544     // TODO: This should never be null -- when is it?
2545     if (bankForRegistrationName) {
2546       delete bankForRegistrationName[inst._rootNodeID];
2547     }
2548   },
2550   /**
2551    * Deletes all listeners for the DOM element with the supplied ID.
2552    *
2553    * @param {object} inst The instance, which is the source of events.
2554    */
2555   deleteAllListeners: function (inst) {
2556     for (var registrationName in listenerBank) {
2557       if (!listenerBank[registrationName][inst._rootNodeID]) {
2558         continue;
2559       }
2561       var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2562       if (PluginModule && PluginModule.willDeleteListener) {
2563         PluginModule.willDeleteListener(inst, registrationName);
2564       }
2566       delete listenerBank[registrationName][inst._rootNodeID];
2567     }
2568   },
2570   /**
2571    * Allows registered plugins an opportunity to extract events from top-level
2572    * native browser events.
2573    *
2574    * @return {*} An accumulation of synthetic events.
2575    * @internal
2576    */
2577   extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2578     var events;
2579     var plugins = EventPluginRegistry.plugins;
2580     for (var i = 0; i < plugins.length; i++) {
2581       // Not every plugin in the ordering may be loaded at runtime.
2582       var possiblePlugin = plugins[i];
2583       if (possiblePlugin) {
2584         var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
2585         if (extractedEvents) {
2586           events = accumulateInto(events, extractedEvents);
2587         }
2588       }
2589     }
2590     return events;
2591   },
2593   /**
2594    * Enqueues a synthetic event that should be dispatched when
2595    * `processEventQueue` is invoked.
2596    *
2597    * @param {*} events An accumulation of synthetic events.
2598    * @internal
2599    */
2600   enqueueEvents: function (events) {
2601     if (events) {
2602       eventQueue = accumulateInto(eventQueue, events);
2603     }
2604   },
2606   /**
2607    * Dispatches all synthetic events on the event queue.
2608    *
2609    * @internal
2610    */
2611   processEventQueue: function (simulated) {
2612     // Set `eventQueue` to null before processing it so that we can tell if more
2613     // events get enqueued while processing.
2614     var processingEventQueue = eventQueue;
2615     eventQueue = null;
2616     if (simulated) {
2617       forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
2618     } else {
2619       forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
2620     }
2621     !!eventQueue ? "development" !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing ' + 'an event queue. Support for this has not yet been implemented.') : invariant(false) : void 0;
2622     // This would be a good time to rethrow if any of the event handlers threw.
2623     ReactErrorUtils.rethrowCaughtError();
2624   },
2626   /**
2627    * These are needed for tests only. Do not use!
2628    */
2629   __purge: function () {
2630     listenerBank = {};
2631   },
2633   __getListenerBank: function () {
2634     return listenerBank;
2635   }
2639 module.exports = EventPluginHub;
2640 },{"126":126,"134":134,"173":173,"18":18,"19":19,"68":68}],18:[function(_dereq_,module,exports){
2642  * Copyright 2013-present, Facebook, Inc.
2643  * All rights reserved.
2645  * This source code is licensed under the BSD-style license found in the
2646  * LICENSE file in the root directory of this source tree. An additional grant
2647  * of patent rights can be found in the PATENTS file in the same directory.
2649  * @providesModule EventPluginRegistry
2650  */
2652 'use strict';
2654 var invariant = _dereq_(173);
2657  * Injectable ordering of event plugins.
2658  */
2659 var EventPluginOrder = null;
2662  * Injectable mapping from names to event plugin modules.
2663  */
2664 var namesToPlugins = {};
2667  * Recomputes the plugin list using the injected plugins and plugin ordering.
2669  * @private
2670  */
2671 function recomputePluginOrdering() {
2672   if (!EventPluginOrder) {
2673     // Wait until an `EventPluginOrder` is injected.
2674     return;
2675   }
2676   for (var pluginName in namesToPlugins) {
2677     var PluginModule = namesToPlugins[pluginName];
2678     var pluginIndex = EventPluginOrder.indexOf(pluginName);
2679     !(pluginIndex > -1) ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in ' + 'the plugin ordering, `%s`.', pluginName) : invariant(false) : void 0;
2680     if (EventPluginRegistry.plugins[pluginIndex]) {
2681       continue;
2682     }
2683     !PluginModule.extractEvents ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` ' + 'method, but `%s` does not.', pluginName) : invariant(false) : void 0;
2684     EventPluginRegistry.plugins[pluginIndex] = PluginModule;
2685     var publishedEvents = PluginModule.eventTypes;
2686     for (var eventName in publishedEvents) {
2687       !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : invariant(false) : void 0;
2688     }
2689   }
2693  * Publishes an event so that it can be dispatched by the supplied plugin.
2695  * @param {object} dispatchConfig Dispatch configuration for the event.
2696  * @param {object} PluginModule Plugin publishing the event.
2697  * @return {boolean} True if the event was successfully published.
2698  * @private
2699  */
2700 function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
2701   !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? "development" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'event name, `%s`.', eventName) : invariant(false) : void 0;
2702   EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
2704   var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
2705   if (phasedRegistrationNames) {
2706     for (var phaseName in phasedRegistrationNames) {
2707       if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
2708         var phasedRegistrationName = phasedRegistrationNames[phaseName];
2709         publishRegistrationName(phasedRegistrationName, PluginModule, eventName);
2710       }
2711     }
2712     return true;
2713   } else if (dispatchConfig.registrationName) {
2714     publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName);
2715     return true;
2716   }
2717   return false;
2721  * Publishes a registration name that is used to identify dispatched events and
2722  * can be used with `EventPluginHub.putListener` to register listeners.
2724  * @param {string} registrationName Registration name to add.
2725  * @param {object} PluginModule Plugin publishing the event.
2726  * @private
2727  */
2728 function publishRegistrationName(registrationName, PluginModule, eventName) {
2729   !!EventPluginRegistry.registrationNameModules[registrationName] ? "development" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName) : invariant(false) : void 0;
2730   EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
2731   EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
2733   if ("development" !== 'production') {
2734     var lowerCasedName = registrationName.toLowerCase();
2735     EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
2736   }
2740  * Registers plugins so that they can extract and dispatch events.
2742  * @see {EventPluginHub}
2743  */
2744 var EventPluginRegistry = {
2746   /**
2747    * Ordered list of injected plugins.
2748    */
2749   plugins: [],
2751   /**
2752    * Mapping from event name to dispatch config
2753    */
2754   eventNameDispatchConfigs: {},
2756   /**
2757    * Mapping from registration name to plugin module
2758    */
2759   registrationNameModules: {},
2761   /**
2762    * Mapping from registration name to event name
2763    */
2764   registrationNameDependencies: {},
2766   /**
2767    * Mapping from lowercase registration names to the properly cased version,
2768    * used to warn in the case of missing event handlers. Available
2769    * only in __DEV__.
2770    * @type {Object}
2771    */
2772   possibleRegistrationNames: "development" !== 'production' ? {} : null,
2774   /**
2775    * Injects an ordering of plugins (by plugin name). This allows the ordering
2776    * to be decoupled from injection of the actual plugins so that ordering is
2777    * always deterministic regardless of packaging, on-the-fly injection, etc.
2778    *
2779    * @param {array} InjectedEventPluginOrder
2780    * @internal
2781    * @see {EventPluginHub.injection.injectEventPluginOrder}
2782    */
2783   injectEventPluginOrder: function (InjectedEventPluginOrder) {
2784     !!EventPluginOrder ? "development" !== '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) : void 0;
2785     // Clone the ordering so it cannot be dynamically mutated.
2786     EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
2787     recomputePluginOrdering();
2788   },
2790   /**
2791    * Injects plugins to be used by `EventPluginHub`. The plugin names must be
2792    * in the ordering injected by `injectEventPluginOrder`.
2793    *
2794    * Plugins can be injected as part of page initialization or on-the-fly.
2795    *
2796    * @param {object} injectedNamesToPlugins Map from names to plugin modules.
2797    * @internal
2798    * @see {EventPluginHub.injection.injectEventPluginsByName}
2799    */
2800   injectEventPluginsByName: function (injectedNamesToPlugins) {
2801     var isOrderingDirty = false;
2802     for (var pluginName in injectedNamesToPlugins) {
2803       if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
2804         continue;
2805       }
2806       var PluginModule = injectedNamesToPlugins[pluginName];
2807       if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
2808         !!namesToPlugins[pluginName] ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins ' + 'using the same name, `%s`.', pluginName) : invariant(false) : void 0;
2809         namesToPlugins[pluginName] = PluginModule;
2810         isOrderingDirty = true;
2811       }
2812     }
2813     if (isOrderingDirty) {
2814       recomputePluginOrdering();
2815     }
2816   },
2818   /**
2819    * Looks up the plugin for the supplied event.
2820    *
2821    * @param {object} event A synthetic event.
2822    * @return {?object} The plugin that created the supplied event.
2823    * @internal
2824    */
2825   getPluginModuleForEvent: function (event) {
2826     var dispatchConfig = event.dispatchConfig;
2827     if (dispatchConfig.registrationName) {
2828       return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
2829     }
2830     for (var phase in dispatchConfig.phasedRegistrationNames) {
2831       if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
2832         continue;
2833       }
2834       var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];
2835       if (PluginModule) {
2836         return PluginModule;
2837       }
2838     }
2839     return null;
2840   },
2842   /**
2843    * Exposed for unit testing.
2844    * @private
2845    */
2846   _resetEventPlugins: function () {
2847     EventPluginOrder = null;
2848     for (var pluginName in namesToPlugins) {
2849       if (namesToPlugins.hasOwnProperty(pluginName)) {
2850         delete namesToPlugins[pluginName];
2851       }
2852     }
2853     EventPluginRegistry.plugins.length = 0;
2855     var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
2856     for (var eventName in eventNameDispatchConfigs) {
2857       if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
2858         delete eventNameDispatchConfigs[eventName];
2859       }
2860     }
2862     var registrationNameModules = EventPluginRegistry.registrationNameModules;
2863     for (var registrationName in registrationNameModules) {
2864       if (registrationNameModules.hasOwnProperty(registrationName)) {
2865         delete registrationNameModules[registrationName];
2866       }
2867     }
2869     if ("development" !== 'production') {
2870       var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
2871       for (var lowerCasedName in possibleRegistrationNames) {
2872         if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
2873           delete possibleRegistrationNames[lowerCasedName];
2874         }
2875       }
2876     }
2877   }
2881 module.exports = EventPluginRegistry;
2882 },{"173":173}],19:[function(_dereq_,module,exports){
2884  * Copyright 2013-present, Facebook, Inc.
2885  * All rights reserved.
2887  * This source code is licensed under the BSD-style license found in the
2888  * LICENSE file in the root directory of this source tree. An additional grant
2889  * of patent rights can be found in the PATENTS file in the same directory.
2891  * @providesModule EventPluginUtils
2892  */
2894 'use strict';
2896 var EventConstants = _dereq_(16);
2897 var ReactErrorUtils = _dereq_(68);
2899 var invariant = _dereq_(173);
2900 var warning = _dereq_(183);
2903  * Injected dependencies:
2904  */
2907  * - `ComponentTree`: [required] Module that can convert between React instances
2908  *   and actual node references.
2909  */
2910 var ComponentTree;
2911 var TreeTraversal;
2912 var injection = {
2913   injectComponentTree: function (Injected) {
2914     ComponentTree = Injected;
2915     if ("development" !== 'production') {
2916       "development" !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
2917     }
2918   },
2919   injectTreeTraversal: function (Injected) {
2920     TreeTraversal = Injected;
2921     if ("development" !== 'production') {
2922       "development" !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
2923     }
2924   }
2927 var topLevelTypes = EventConstants.topLevelTypes;
2929 function isEndish(topLevelType) {
2930   return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
2933 function isMoveish(topLevelType) {
2934   return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;
2936 function isStartish(topLevelType) {
2937   return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;
2940 var validateEventDispatches;
2941 if ("development" !== 'production') {
2942   validateEventDispatches = function (event) {
2943     var dispatchListeners = event._dispatchListeners;
2944     var dispatchInstances = event._dispatchInstances;
2946     var listenersIsArr = Array.isArray(dispatchListeners);
2947     var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
2949     var instancesIsArr = Array.isArray(dispatchInstances);
2950     var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
2952     "development" !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
2953   };
2957  * Dispatch the event to the listener.
2958  * @param {SyntheticEvent} event SyntheticEvent to handle
2959  * @param {boolean} simulated If the event is simulated (changes exn behavior)
2960  * @param {function} listener Application-level callback
2961  * @param {*} inst Internal component instance
2962  */
2963 function executeDispatch(event, simulated, listener, inst) {
2964   var type = event.type || 'unknown-event';
2965   event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
2966   if (simulated) {
2967     ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);
2968   } else {
2969     ReactErrorUtils.invokeGuardedCallback(type, listener, event);
2970   }
2971   event.currentTarget = null;
2975  * Standard/simple iteration through an event's collected dispatches.
2976  */
2977 function executeDispatchesInOrder(event, simulated) {
2978   var dispatchListeners = event._dispatchListeners;
2979   var dispatchInstances = event._dispatchInstances;
2980   if ("development" !== 'production') {
2981     validateEventDispatches(event);
2982   }
2983   if (Array.isArray(dispatchListeners)) {
2984     for (var i = 0; i < dispatchListeners.length; i++) {
2985       if (event.isPropagationStopped()) {
2986         break;
2987       }
2988       // Listeners and Instances are two parallel arrays that are always in sync.
2989       executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
2990     }
2991   } else if (dispatchListeners) {
2992     executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
2993   }
2994   event._dispatchListeners = null;
2995   event._dispatchInstances = null;
2999  * Standard/simple iteration through an event's collected dispatches, but stops
3000  * at the first dispatch execution returning true, and returns that id.
3002  * @return {?string} id of the first dispatch execution who's listener returns
3003  * true, or null if no listener returned true.
3004  */
3005 function executeDispatchesInOrderStopAtTrueImpl(event) {
3006   var dispatchListeners = event._dispatchListeners;
3007   var dispatchInstances = event._dispatchInstances;
3008   if ("development" !== 'production') {
3009     validateEventDispatches(event);
3010   }
3011   if (Array.isArray(dispatchListeners)) {
3012     for (var i = 0; i < dispatchListeners.length; i++) {
3013       if (event.isPropagationStopped()) {
3014         break;
3015       }
3016       // Listeners and Instances are two parallel arrays that are always in sync.
3017       if (dispatchListeners[i](event, dispatchInstances[i])) {
3018         return dispatchInstances[i];
3019       }
3020     }
3021   } else if (dispatchListeners) {
3022     if (dispatchListeners(event, dispatchInstances)) {
3023       return dispatchInstances;
3024     }
3025   }
3026   return null;
3030  * @see executeDispatchesInOrderStopAtTrueImpl
3031  */
3032 function executeDispatchesInOrderStopAtTrue(event) {
3033   var ret = executeDispatchesInOrderStopAtTrueImpl(event);
3034   event._dispatchInstances = null;
3035   event._dispatchListeners = null;
3036   return ret;
3040  * Execution of a "direct" dispatch - there must be at most one dispatch
3041  * accumulated on the event or it is considered an error. It doesn't really make
3042  * sense for an event with multiple dispatches (bubbled) to keep track of the
3043  * return values at each dispatch execution, but it does tend to make sense when
3044  * dealing with "direct" dispatches.
3046  * @return {*} The return value of executing the single dispatch.
3047  */
3048 function executeDirectDispatch(event) {
3049   if ("development" !== 'production') {
3050     validateEventDispatches(event);
3051   }
3052   var dispatchListener = event._dispatchListeners;
3053   var dispatchInstance = event._dispatchInstances;
3054   !!Array.isArray(dispatchListener) ? "development" !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : void 0;
3055   event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
3056   var res = dispatchListener ? dispatchListener(event) : null;
3057   event.currentTarget = null;
3058   event._dispatchListeners = null;
3059   event._dispatchInstances = null;
3060   return res;
3064  * @param {SyntheticEvent} event
3065  * @return {boolean} True iff number of dispatches accumulated is greater than 0.
3066  */
3067 function hasDispatches(event) {
3068   return !!event._dispatchListeners;
3072  * General utilities that are useful in creating custom Event Plugins.
3073  */
3074 var EventPluginUtils = {
3075   isEndish: isEndish,
3076   isMoveish: isMoveish,
3077   isStartish: isStartish,
3079   executeDirectDispatch: executeDirectDispatch,
3080   executeDispatchesInOrder: executeDispatchesInOrder,
3081   executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
3082   hasDispatches: hasDispatches,
3084   getInstanceFromNode: function (node) {
3085     return ComponentTree.getInstanceFromNode(node);
3086   },
3087   getNodeFromInstance: function (node) {
3088     return ComponentTree.getNodeFromInstance(node);
3089   },
3090   isAncestor: function (a, b) {
3091     return TreeTraversal.isAncestor(a, b);
3092   },
3093   getLowestCommonAncestor: function (a, b) {
3094     return TreeTraversal.getLowestCommonAncestor(a, b);
3095   },
3096   getParentInstance: function (inst) {
3097     return TreeTraversal.getParentInstance(inst);
3098   },
3099   traverseTwoPhase: function (target, fn, arg) {
3100     return TreeTraversal.traverseTwoPhase(target, fn, arg);
3101   },
3102   traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
3103     return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
3104   },
3106   injection: injection
3109 module.exports = EventPluginUtils;
3110 },{"16":16,"173":173,"183":183,"68":68}],20:[function(_dereq_,module,exports){
3112  * Copyright 2013-present, Facebook, Inc.
3113  * All rights reserved.
3115  * This source code is licensed under the BSD-style license found in the
3116  * LICENSE file in the root directory of this source tree. An additional grant
3117  * of patent rights can be found in the PATENTS file in the same directory.
3119  * @providesModule EventPropagators
3120  */
3122 'use strict';
3124 var EventConstants = _dereq_(16);
3125 var EventPluginHub = _dereq_(17);
3126 var EventPluginUtils = _dereq_(19);
3128 var accumulateInto = _dereq_(126);
3129 var forEachAccumulated = _dereq_(134);
3130 var warning = _dereq_(183);
3132 var PropagationPhases = EventConstants.PropagationPhases;
3133 var getListener = EventPluginHub.getListener;
3136  * Some event types have a notion of different registration names for different
3137  * "phases" of propagation. This finds listeners by a given phase.
3138  */
3139 function listenerAtPhase(inst, event, propagationPhase) {
3140   var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
3141   return getListener(inst, registrationName);
3145  * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
3146  * here, allows us to not have to bind or create functions for each event.
3147  * Mutating the event's members allows us to not have to create a wrapping
3148  * "dispatch" object that pairs the event with the listener.
3149  */
3150 function accumulateDirectionalDispatches(inst, upwards, event) {
3151   if ("development" !== 'production') {
3152     "development" !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
3153   }
3154   var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
3155   var listener = listenerAtPhase(inst, event, phase);
3156   if (listener) {
3157     event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
3158     event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
3159   }
3163  * Collect dispatches (must be entirely collected before dispatching - see unit
3164  * tests). Lazily allocate the array to conserve memory.  We must loop through
3165  * each event and perform the traversal for each one. We cannot perform a
3166  * single traversal for the entire collection of events because each event may
3167  * have a different target.
3168  */
3169 function accumulateTwoPhaseDispatchesSingle(event) {
3170   if (event && event.dispatchConfig.phasedRegistrationNames) {
3171     EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
3172   }
3176  * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
3177  */
3178 function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
3179   if (event && event.dispatchConfig.phasedRegistrationNames) {
3180     var targetInst = event._targetInst;
3181     var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
3182     EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
3183   }
3187  * Accumulates without regard to direction, does not look for phased
3188  * registration names. Same as `accumulateDirectDispatchesSingle` but without
3189  * requiring that the `dispatchMarker` be the same as the dispatched ID.
3190  */
3191 function accumulateDispatches(inst, ignoredDirection, event) {
3192   if (event && event.dispatchConfig.registrationName) {
3193     var registrationName = event.dispatchConfig.registrationName;
3194     var listener = getListener(inst, registrationName);
3195     if (listener) {
3196       event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
3197       event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
3198     }
3199   }
3203  * Accumulates dispatches on an `SyntheticEvent`, but only for the
3204  * `dispatchMarker`.
3205  * @param {SyntheticEvent} event
3206  */
3207 function accumulateDirectDispatchesSingle(event) {
3208   if (event && event.dispatchConfig.registrationName) {
3209     accumulateDispatches(event._targetInst, null, event);
3210   }
3213 function accumulateTwoPhaseDispatches(events) {
3214   forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
3217 function accumulateTwoPhaseDispatchesSkipTarget(events) {
3218   forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
3221 function accumulateEnterLeaveDispatches(leave, enter, from, to) {
3222   EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
3225 function accumulateDirectDispatches(events) {
3226   forEachAccumulated(events, accumulateDirectDispatchesSingle);
3230  * A small set of propagation patterns, each of which will accept a small amount
3231  * of information, and generate a set of "dispatch ready event objects" - which
3232  * are sets of events that have already been annotated with a set of dispatched
3233  * listener functions/ids. The API is designed this way to discourage these
3234  * propagation strategies from actually executing the dispatches, since we
3235  * always want to collect the entire set of dispatches before executing event a
3236  * single one.
3238  * @constructor EventPropagators
3239  */
3240 var EventPropagators = {
3241   accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
3242   accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
3243   accumulateDirectDispatches: accumulateDirectDispatches,
3244   accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
3247 module.exports = EventPropagators;
3248 },{"126":126,"134":134,"16":16,"17":17,"183":183,"19":19}],21:[function(_dereq_,module,exports){
3250  * Copyright 2013-present, Facebook, Inc.
3251  * All rights reserved.
3253  * This source code is licensed under the BSD-style license found in the
3254  * LICENSE file in the root directory of this source tree. An additional grant
3255  * of patent rights can be found in the PATENTS file in the same directory.
3257  * @providesModule FallbackCompositionState
3258  */
3260 'use strict';
3262 var _assign = _dereq_(184);
3264 var PooledClass = _dereq_(26);
3266 var getTextContentAccessor = _dereq_(142);
3269  * This helper class stores information about text content of a target node,
3270  * allowing comparison of content before and after a given event.
3272  * Identify the node where selection currently begins, then observe
3273  * both its text content and its current position in the DOM. Since the
3274  * browser may natively replace the target node during composition, we can
3275  * use its position to find its replacement.
3277  * @param {DOMEventTarget} root
3278  */
3279 function FallbackCompositionState(root) {
3280   this._root = root;
3281   this._startText = this.getText();
3282   this._fallbackText = null;
3285 _assign(FallbackCompositionState.prototype, {
3286   destructor: function () {
3287     this._root = null;
3288     this._startText = null;
3289     this._fallbackText = null;
3290   },
3292   /**
3293    * Get current text of input.
3294    *
3295    * @return {string}
3296    */
3297   getText: function () {
3298     if ('value' in this._root) {
3299       return this._root.value;
3300     }
3301     return this._root[getTextContentAccessor()];
3302   },
3304   /**
3305    * Determine the differing substring between the initially stored
3306    * text content and the current content.
3307    *
3308    * @return {string}
3309    */
3310   getData: function () {
3311     if (this._fallbackText) {
3312       return this._fallbackText;
3313     }
3315     var start;
3316     var startValue = this._startText;
3317     var startLength = startValue.length;
3318     var end;
3319     var endValue = this.getText();
3320     var endLength = endValue.length;
3322     for (start = 0; start < startLength; start++) {
3323       if (startValue[start] !== endValue[start]) {
3324         break;
3325       }
3326     }
3328     var minEnd = startLength - start;
3329     for (end = 1; end <= minEnd; end++) {
3330       if (startValue[startLength - end] !== endValue[endLength - end]) {
3331         break;
3332       }
3333     }
3335     var sliceTail = end > 1 ? 1 - end : undefined;
3336     this._fallbackText = endValue.slice(start, sliceTail);
3337     return this._fallbackText;
3338   }
3341 PooledClass.addPoolingTo(FallbackCompositionState);
3343 module.exports = FallbackCompositionState;
3344 },{"142":142,"184":184,"26":26}],22:[function(_dereq_,module,exports){
3346  * Copyright 2013-present, Facebook, Inc.
3347  * All rights reserved.
3349  * This source code is licensed under the BSD-style license found in the
3350  * LICENSE file in the root directory of this source tree. An additional grant
3351  * of patent rights can be found in the PATENTS file in the same directory.
3353  * @providesModule HTMLDOMPropertyConfig
3354  */
3356 'use strict';
3358 var DOMProperty = _dereq_(10);
3360 var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
3361 var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
3362 var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS;
3363 var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
3364 var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
3365 var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
3367 var HTMLDOMPropertyConfig = {
3368   isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
3369   Properties: {
3370     /**
3371      * Standard Properties
3372      */
3373     accept: 0,
3374     acceptCharset: 0,
3375     accessKey: 0,
3376     action: 0,
3377     allowFullScreen: HAS_BOOLEAN_VALUE,
3378     allowTransparency: 0,
3379     alt: 0,
3380     async: HAS_BOOLEAN_VALUE,
3381     autoComplete: 0,
3382     // autoFocus is polyfilled/normalized by AutoFocusUtils
3383     // autoFocus: HAS_BOOLEAN_VALUE,
3384     autoPlay: HAS_BOOLEAN_VALUE,
3385     capture: HAS_BOOLEAN_VALUE,
3386     cellPadding: 0,
3387     cellSpacing: 0,
3388     charSet: 0,
3389     challenge: 0,
3390     checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3391     cite: 0,
3392     classID: 0,
3393     className: 0,
3394     cols: HAS_POSITIVE_NUMERIC_VALUE,
3395     colSpan: 0,
3396     content: 0,
3397     contentEditable: 0,
3398     contextMenu: 0,
3399     controls: HAS_BOOLEAN_VALUE,
3400     coords: 0,
3401     crossOrigin: 0,
3402     data: 0, // For `<object />` acts as `src`.
3403     dateTime: 0,
3404     'default': HAS_BOOLEAN_VALUE,
3405     defer: HAS_BOOLEAN_VALUE,
3406     dir: 0,
3407     disabled: HAS_BOOLEAN_VALUE,
3408     download: HAS_OVERLOADED_BOOLEAN_VALUE,
3409     draggable: 0,
3410     encType: 0,
3411     form: 0,
3412     formAction: 0,
3413     formEncType: 0,
3414     formMethod: 0,
3415     formNoValidate: HAS_BOOLEAN_VALUE,
3416     formTarget: 0,
3417     frameBorder: 0,
3418     headers: 0,
3419     height: 0,
3420     hidden: HAS_BOOLEAN_VALUE,
3421     high: 0,
3422     href: 0,
3423     hrefLang: 0,
3424     htmlFor: 0,
3425     httpEquiv: 0,
3426     icon: 0,
3427     id: 0,
3428     inputMode: 0,
3429     integrity: 0,
3430     is: 0,
3431     keyParams: 0,
3432     keyType: 0,
3433     kind: 0,
3434     label: 0,
3435     lang: 0,
3436     list: 0,
3437     loop: HAS_BOOLEAN_VALUE,
3438     low: 0,
3439     manifest: 0,
3440     marginHeight: 0,
3441     marginWidth: 0,
3442     max: 0,
3443     maxLength: 0,
3444     media: 0,
3445     mediaGroup: 0,
3446     method: 0,
3447     min: 0,
3448     minLength: 0,
3449     // Caution; `option.selected` is not updated if `select.multiple` is
3450     // disabled with `removeAttribute`.
3451     multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3452     muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3453     name: 0,
3454     nonce: 0,
3455     noValidate: HAS_BOOLEAN_VALUE,
3456     open: HAS_BOOLEAN_VALUE,
3457     optimum: 0,
3458     pattern: 0,
3459     placeholder: 0,
3460     poster: 0,
3461     preload: 0,
3462     profile: 0,
3463     radioGroup: 0,
3464     readOnly: HAS_BOOLEAN_VALUE,
3465     rel: 0,
3466     required: HAS_BOOLEAN_VALUE,
3467     reversed: HAS_BOOLEAN_VALUE,
3468     role: 0,
3469     rows: HAS_POSITIVE_NUMERIC_VALUE,
3470     rowSpan: HAS_NUMERIC_VALUE,
3471     sandbox: 0,
3472     scope: 0,
3473     scoped: HAS_BOOLEAN_VALUE,
3474     scrolling: 0,
3475     seamless: HAS_BOOLEAN_VALUE,
3476     selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3477     shape: 0,
3478     size: HAS_POSITIVE_NUMERIC_VALUE,
3479     sizes: 0,
3480     span: HAS_POSITIVE_NUMERIC_VALUE,
3481     spellCheck: 0,
3482     src: 0,
3483     srcDoc: 0,
3484     srcLang: 0,
3485     srcSet: 0,
3486     start: HAS_NUMERIC_VALUE,
3487     step: 0,
3488     style: 0,
3489     summary: 0,
3490     tabIndex: 0,
3491     target: 0,
3492     title: 0,
3493     // Setting .type throws on non-<input> tags
3494     type: 0,
3495     useMap: 0,
3496     value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS,
3497     width: 0,
3498     wmode: 0,
3499     wrap: 0,
3501     /**
3502      * RDFa Properties
3503      */
3504     about: 0,
3505     datatype: 0,
3506     inlist: 0,
3507     prefix: 0,
3508     // property is also supported for OpenGraph in meta tags.
3509     property: 0,
3510     resource: 0,
3511     'typeof': 0,
3512     vocab: 0,
3514     /**
3515      * Non-standard Properties
3516      */
3517     // autoCapitalize and autoCorrect are supported in Mobile Safari for
3518     // keyboard hints.
3519     autoCapitalize: 0,
3520     autoCorrect: 0,
3521     // autoSave allows WebKit/Blink to persist values of input fields on page reloads
3522     autoSave: 0,
3523     // color is for Safari mask-icon link
3524     color: 0,
3525     // itemProp, itemScope, itemType are for
3526     // Microdata support. See http://schema.org/docs/gs.html
3527     itemProp: 0,
3528     itemScope: HAS_BOOLEAN_VALUE,
3529     itemType: 0,
3530     // itemID and itemRef are for Microdata support as well but
3531     // only specified in the WHATWG spec document. See
3532     // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
3533     itemID: 0,
3534     itemRef: 0,
3535     // results show looking glass icon and recent searches on input
3536     // search fields in WebKit/Blink
3537     results: 0,
3538     // IE-only attribute that specifies security restrictions on an iframe
3539     // as an alternative to the sandbox attribute on IE<10
3540     security: 0,
3541     // IE-only attribute that controls focus behavior
3542     unselectable: 0
3543   },
3544   DOMAttributeNames: {
3545     acceptCharset: 'accept-charset',
3546     className: 'class',
3547     htmlFor: 'for',
3548     httpEquiv: 'http-equiv'
3549   },
3550   DOMPropertyNames: {}
3553 module.exports = HTMLDOMPropertyConfig;
3554 },{"10":10}],23:[function(_dereq_,module,exports){
3556  * Copyright 2013-present, Facebook, Inc.
3557  * All rights reserved.
3559  * This source code is licensed under the BSD-style license found in the
3560  * LICENSE file in the root directory of this source tree. An additional grant
3561  * of patent rights can be found in the PATENTS file in the same directory.
3563  * @providesModule KeyEscapeUtils
3564  */
3566 'use strict';
3569  * Escape and wrap key so it is safe to use as a reactid
3571  * @param {*} key to be escaped.
3572  * @return {string} the escaped key.
3573  */
3575 function escape(key) {
3576   var escapeRegex = /[=:]/g;
3577   var escaperLookup = {
3578     '=': '=0',
3579     ':': '=2'
3580   };
3581   var escapedString = ('' + key).replace(escapeRegex, function (match) {
3582     return escaperLookup[match];
3583   });
3585   return '$' + escapedString;
3589  * Unescape and unwrap key for human-readable display
3591  * @param {string} key to unescape.
3592  * @return {string} the unescaped key.
3593  */
3594 function unescape(key) {
3595   var unescapeRegex = /(=0|=2)/g;
3596   var unescaperLookup = {
3597     '=0': '=',
3598     '=2': ':'
3599   };
3600   var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
3602   return ('' + keySubstring).replace(unescapeRegex, function (match) {
3603     return unescaperLookup[match];
3604   });
3607 var KeyEscapeUtils = {
3608   escape: escape,
3609   unescape: unescape
3612 module.exports = KeyEscapeUtils;
3613 },{}],24:[function(_dereq_,module,exports){
3615  * Copyright 2013-present, Facebook, Inc.
3616  * All rights reserved.
3618  * This source code is licensed under the BSD-style license found in the
3619  * LICENSE file in the root directory of this source tree. An additional grant
3620  * of patent rights can be found in the PATENTS file in the same directory.
3622  * @providesModule LinkedStateMixin
3623  */
3625 'use strict';
3627 var ReactLink = _dereq_(78);
3628 var ReactStateSetters = _dereq_(98);
3631  * A simple mixin around ReactLink.forState().
3632  * See https://facebook.github.io/react/docs/two-way-binding-helpers.html
3633  */
3634 var LinkedStateMixin = {
3635   /**
3636    * Create a ReactLink that's linked to part of this component's state. The
3637    * ReactLink will have the current value of this.state[key] and will call
3638    * setState() when a change is requested.
3639    *
3640    * @param {string} key state key to update. Note: you may want to use keyOf()
3641    * if you're using Google Closure Compiler advanced mode.
3642    * @return {ReactLink} ReactLink instance linking to the state.
3643    */
3644   linkState: function (key) {
3645     return new ReactLink(this.state[key], ReactStateSetters.createStateKeySetter(this, key));
3646   }
3649 module.exports = LinkedStateMixin;
3650 },{"78":78,"98":98}],25:[function(_dereq_,module,exports){
3652  * Copyright 2013-present, Facebook, Inc.
3653  * All rights reserved.
3655  * This source code is licensed under the BSD-style license found in the
3656  * LICENSE file in the root directory of this source tree. An additional grant
3657  * of patent rights can be found in the PATENTS file in the same directory.
3659  * @providesModule LinkedValueUtils
3660  */
3662 'use strict';
3664 var ReactPropTypes = _dereq_(91);
3665 var ReactPropTypeLocations = _dereq_(90);
3667 var invariant = _dereq_(173);
3668 var warning = _dereq_(183);
3670 var hasReadOnlyValue = {
3671   'button': true,
3672   'checkbox': true,
3673   'image': true,
3674   'hidden': true,
3675   'radio': true,
3676   'reset': true,
3677   'submit': true
3680 function _assertSingleLink(inputProps) {
3681   !(inputProps.checkedLink == null || inputProps.valueLink == null) ? "development" !== '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) : void 0;
3683 function _assertValueLink(inputProps) {
3684   _assertSingleLink(inputProps);
3685   !(inputProps.value == null && inputProps.onChange == null) ? "development" !== '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) : void 0;
3688 function _assertCheckedLink(inputProps) {
3689   _assertSingleLink(inputProps);
3690   !(inputProps.checked == null && inputProps.onChange == null) ? "development" !== '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) : void 0;
3693 var propTypes = {
3694   value: function (props, propName, componentName) {
3695     if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
3696       return null;
3697     }
3698     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`.');
3699   },
3700   checked: function (props, propName, componentName) {
3701     if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
3702       return null;
3703     }
3704     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`.');
3705   },
3706   onChange: ReactPropTypes.func
3709 var loggedTypeFailures = {};
3710 function getDeclarationErrorAddendum(owner) {
3711   if (owner) {
3712     var name = owner.getName();
3713     if (name) {
3714       return ' Check the render method of `' + name + '`.';
3715     }
3716   }
3717   return '';
3721  * Provide a linked `value` attribute for controlled forms. You should not use
3722  * this outside of the ReactDOM controlled form components.
3723  */
3724 var LinkedValueUtils = {
3725   checkPropTypes: function (tagName, props, owner) {
3726     for (var propName in propTypes) {
3727       if (propTypes.hasOwnProperty(propName)) {
3728         var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop);
3729       }
3730       if (error instanceof Error && !(error.message in loggedTypeFailures)) {
3731         // Only monitor this failure once because there tends to be a lot of the
3732         // same error.
3733         loggedTypeFailures[error.message] = true;
3735         var addendum = getDeclarationErrorAddendum(owner);
3736         "development" !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
3737       }
3738     }
3739   },
3741   /**
3742    * @param {object} inputProps Props for form component
3743    * @return {*} current value of the input either from value prop or link.
3744    */
3745   getValue: function (inputProps) {
3746     if (inputProps.valueLink) {
3747       _assertValueLink(inputProps);
3748       return inputProps.valueLink.value;
3749     }
3750     return inputProps.value;
3751   },
3753   /**
3754    * @param {object} inputProps Props for form component
3755    * @return {*} current checked status of the input either from checked prop
3756    *             or link.
3757    */
3758   getChecked: function (inputProps) {
3759     if (inputProps.checkedLink) {
3760       _assertCheckedLink(inputProps);
3761       return inputProps.checkedLink.value;
3762     }
3763     return inputProps.checked;
3764   },
3766   /**
3767    * @param {object} inputProps Props for form component
3768    * @param {SyntheticEvent} event change event to handle
3769    */
3770   executeOnChange: function (inputProps, event) {
3771     if (inputProps.valueLink) {
3772       _assertValueLink(inputProps);
3773       return inputProps.valueLink.requestChange(event.target.value);
3774     } else if (inputProps.checkedLink) {
3775       _assertCheckedLink(inputProps);
3776       return inputProps.checkedLink.requestChange(event.target.checked);
3777     } else if (inputProps.onChange) {
3778       return inputProps.onChange.call(undefined, event);
3779     }
3780   }
3783 module.exports = LinkedValueUtils;
3784 },{"173":173,"183":183,"90":90,"91":91}],26:[function(_dereq_,module,exports){
3786  * Copyright 2013-present, Facebook, Inc.
3787  * All rights reserved.
3789  * This source code is licensed under the BSD-style license found in the
3790  * LICENSE file in the root directory of this source tree. An additional grant
3791  * of patent rights can be found in the PATENTS file in the same directory.
3793  * @providesModule PooledClass
3794  */
3796 'use strict';
3798 var invariant = _dereq_(173);
3801  * Static poolers. Several custom versions for each potential number of
3802  * arguments. A completely generic pooler is easy to implement, but would
3803  * require accessing the `arguments` object. In each of these, `this` refers to
3804  * the Class itself, not an instance. If any others are needed, simply add them
3805  * here, or in their own files.
3806  */
3807 var oneArgumentPooler = function (copyFieldsFrom) {
3808   var Klass = this;
3809   if (Klass.instancePool.length) {
3810     var instance = Klass.instancePool.pop();
3811     Klass.call(instance, copyFieldsFrom);
3812     return instance;
3813   } else {
3814     return new Klass(copyFieldsFrom);
3815   }
3818 var twoArgumentPooler = function (a1, a2) {
3819   var Klass = this;
3820   if (Klass.instancePool.length) {
3821     var instance = Klass.instancePool.pop();
3822     Klass.call(instance, a1, a2);
3823     return instance;
3824   } else {
3825     return new Klass(a1, a2);
3826   }
3829 var threeArgumentPooler = function (a1, a2, a3) {
3830   var Klass = this;
3831   if (Klass.instancePool.length) {
3832     var instance = Klass.instancePool.pop();
3833     Klass.call(instance, a1, a2, a3);
3834     return instance;
3835   } else {
3836     return new Klass(a1, a2, a3);
3837   }
3840 var fourArgumentPooler = function (a1, a2, a3, a4) {
3841   var Klass = this;
3842   if (Klass.instancePool.length) {
3843     var instance = Klass.instancePool.pop();
3844     Klass.call(instance, a1, a2, a3, a4);
3845     return instance;
3846   } else {
3847     return new Klass(a1, a2, a3, a4);
3848   }
3851 var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
3852   var Klass = this;
3853   if (Klass.instancePool.length) {
3854     var instance = Klass.instancePool.pop();
3855     Klass.call(instance, a1, a2, a3, a4, a5);
3856     return instance;
3857   } else {
3858     return new Klass(a1, a2, a3, a4, a5);
3859   }
3862 var standardReleaser = function (instance) {
3863   var Klass = this;
3864   !(instance instanceof Klass) ? "development" !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : invariant(false) : void 0;
3865   instance.destructor();
3866   if (Klass.instancePool.length < Klass.poolSize) {
3867     Klass.instancePool.push(instance);
3868   }
3871 var DEFAULT_POOL_SIZE = 10;
3872 var DEFAULT_POOLER = oneArgumentPooler;
3875  * Augments `CopyConstructor` to be a poolable class, augmenting only the class
3876  * itself (statically) not adding any prototypical fields. Any CopyConstructor
3877  * you give this may have a `poolSize` property, and will look for a
3878  * prototypical `destructor` on instances (optional).
3880  * @param {Function} CopyConstructor Constructor that can be used to reset.
3881  * @param {Function} pooler Customizable pooler.
3882  */
3883 var addPoolingTo = function (CopyConstructor, pooler) {
3884   var NewKlass = CopyConstructor;
3885   NewKlass.instancePool = [];
3886   NewKlass.getPooled = pooler || DEFAULT_POOLER;
3887   if (!NewKlass.poolSize) {
3888     NewKlass.poolSize = DEFAULT_POOL_SIZE;
3889   }
3890   NewKlass.release = standardReleaser;
3891   return NewKlass;
3894 var PooledClass = {
3895   addPoolingTo: addPoolingTo,
3896   oneArgumentPooler: oneArgumentPooler,
3897   twoArgumentPooler: twoArgumentPooler,
3898   threeArgumentPooler: threeArgumentPooler,
3899   fourArgumentPooler: fourArgumentPooler,
3900   fiveArgumentPooler: fiveArgumentPooler
3903 module.exports = PooledClass;
3904 },{"173":173}],27:[function(_dereq_,module,exports){
3906  * Copyright 2013-present, Facebook, Inc.
3907  * All rights reserved.
3909  * This source code is licensed under the BSD-style license found in the
3910  * LICENSE file in the root directory of this source tree. An additional grant
3911  * of patent rights can be found in the PATENTS file in the same directory.
3913  * @providesModule React
3914  */
3916 'use strict';
3918 var _assign = _dereq_(184);
3920 var ReactChildren = _dereq_(32);
3921 var ReactComponent = _dereq_(34);
3922 var ReactClass = _dereq_(33);
3923 var ReactDOMFactories = _dereq_(49);
3924 var ReactElement = _dereq_(65);
3925 var ReactElementValidator = _dereq_(66);
3926 var ReactPropTypes = _dereq_(91);
3927 var ReactVersion = _dereq_(105);
3929 var onlyChild = _dereq_(147);
3930 var warning = _dereq_(183);
3932 var createElement = ReactElement.createElement;
3933 var createFactory = ReactElement.createFactory;
3934 var cloneElement = ReactElement.cloneElement;
3936 if ("development" !== 'production') {
3937   createElement = ReactElementValidator.createElement;
3938   createFactory = ReactElementValidator.createFactory;
3939   cloneElement = ReactElementValidator.cloneElement;
3942 var __spread = _assign;
3944 if ("development" !== 'production') {
3945   var warned = false;
3946   __spread = function () {
3947     "development" !== 'production' ? warning(warned, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.') : void 0;
3948     warned = true;
3949     return _assign.apply(null, arguments);
3950   };
3953 var React = {
3955   // Modern
3957   Children: {
3958     map: ReactChildren.map,
3959     forEach: ReactChildren.forEach,
3960     count: ReactChildren.count,
3961     toArray: ReactChildren.toArray,
3962     only: onlyChild
3963   },
3965   Component: ReactComponent,
3967   createElement: createElement,
3968   cloneElement: cloneElement,
3969   isValidElement: ReactElement.isValidElement,
3971   // Classic
3973   PropTypes: ReactPropTypes,
3974   createClass: ReactClass.createClass,
3975   createFactory: createFactory,
3976   createMixin: function (mixin) {
3977     // Currently a noop. Will be used to validate and trace mixins.
3978     return mixin;
3979   },
3981   // This looks DOM specific but these are actually isomorphic helpers
3982   // since they are just generating DOM strings.
3983   DOM: ReactDOMFactories,
3985   version: ReactVersion,
3987   // Deprecated hook for JSX spread, don't use this for anything.
3988   __spread: __spread
3991 module.exports = React;
3992 },{"105":105,"147":147,"183":183,"184":184,"32":32,"33":33,"34":34,"49":49,"65":65,"66":66,"91":91}],28:[function(_dereq_,module,exports){
3994  * Copyright 2013-present, Facebook, Inc.
3995  * All rights reserved.
3997  * This source code is licensed under the BSD-style license found in the
3998  * LICENSE file in the root directory of this source tree. An additional grant
3999  * of patent rights can be found in the PATENTS file in the same directory.
4001  * @providesModule ReactBrowserEventEmitter
4002  */
4004 'use strict';
4006 var _assign = _dereq_(184);
4008 var EventConstants = _dereq_(16);
4009 var EventPluginRegistry = _dereq_(18);
4010 var ReactEventEmitterMixin = _dereq_(69);
4011 var ViewportMetrics = _dereq_(125);
4013 var getVendorPrefixedEventName = _dereq_(143);
4014 var isEventSupported = _dereq_(145);
4017  * Summary of `ReactBrowserEventEmitter` event handling:
4019  *  - Top-level delegation is used to trap most native browser events. This
4020  *    may only occur in the main thread and is the responsibility of
4021  *    ReactEventListener, which is injected and can therefore support pluggable
4022  *    event sources. This is the only work that occurs in the main thread.
4024  *  - We normalize and de-duplicate events to account for browser quirks. This
4025  *    may be done in the worker thread.
4027  *  - Forward these native events (with the associated top-level type used to
4028  *    trap it) to `EventPluginHub`, which in turn will ask plugins if they want
4029  *    to extract any synthetic events.
4031  *  - The `EventPluginHub` will then process each event by annotating them with
4032  *    "dispatches", a sequence of listeners and IDs that care about that event.
4034  *  - The `EventPluginHub` then dispatches the events.
4036  * Overview of React and the event system:
4038  * +------------+    .
4039  * |    DOM     |    .
4040  * +------------+    .
4041  *       |           .
4042  *       v           .
4043  * +------------+    .
4044  * | ReactEvent |    .
4045  * |  Listener  |    .
4046  * +------------+    .                         +-----------+
4047  *       |           .               +--------+|SimpleEvent|
4048  *       |           .               |         |Plugin     |
4049  * +-----|------+    .               v         +-----------+
4050  * |     |      |    .    +--------------+                    +------------+
4051  * |     +-----------.--->|EventPluginHub|                    |    Event   |
4052  * |            |    .    |              |     +-----------+  | Propagators|
4053  * | ReactEvent |    .    |              |     |TapEvent   |  |------------|
4054  * |  Emitter   |    .    |              |<---+|Plugin     |  |other plugin|
4055  * |            |    .    |              |     +-----------+  |  utilities |
4056  * |     +-----------.--->|              |                    +------------+
4057  * |     |      |    .    +--------------+
4058  * +-----|------+    .                ^        +-----------+
4059  *       |           .                |        |Enter/Leave|
4060  *       +           .                +-------+|Plugin     |
4061  * +-------------+   .                         +-----------+
4062  * | application |   .
4063  * |-------------|   .
4064  * |             |   .
4065  * |             |   .
4066  * +-------------+   .
4067  *                   .
4068  *    React Core     .  General Purpose Event Plugin System
4069  */
4071 var hasEventPageXY;
4072 var alreadyListeningTo = {};
4073 var isMonitoringScrollValue = false;
4074 var reactTopListenersCounter = 0;
4076 // For events like 'submit' which don't consistently bubble (which we trap at a
4077 // lower node than `document`), binding at `document` would cause duplicate
4078 // events so we don't include them here
4079 var topEventMapping = {
4080   topAbort: 'abort',
4081   topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
4082   topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
4083   topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
4084   topBlur: 'blur',
4085   topCanPlay: 'canplay',
4086   topCanPlayThrough: 'canplaythrough',
4087   topChange: 'change',
4088   topClick: 'click',
4089   topCompositionEnd: 'compositionend',
4090   topCompositionStart: 'compositionstart',
4091   topCompositionUpdate: 'compositionupdate',
4092   topContextMenu: 'contextmenu',
4093   topCopy: 'copy',
4094   topCut: 'cut',
4095   topDoubleClick: 'dblclick',
4096   topDrag: 'drag',
4097   topDragEnd: 'dragend',
4098   topDragEnter: 'dragenter',
4099   topDragExit: 'dragexit',
4100   topDragLeave: 'dragleave',
4101   topDragOver: 'dragover',
4102   topDragStart: 'dragstart',
4103   topDrop: 'drop',
4104   topDurationChange: 'durationchange',
4105   topEmptied: 'emptied',
4106   topEncrypted: 'encrypted',
4107   topEnded: 'ended',
4108   topError: 'error',
4109   topFocus: 'focus',
4110   topInput: 'input',
4111   topKeyDown: 'keydown',
4112   topKeyPress: 'keypress',
4113   topKeyUp: 'keyup',
4114   topLoadedData: 'loadeddata',
4115   topLoadedMetadata: 'loadedmetadata',
4116   topLoadStart: 'loadstart',
4117   topMouseDown: 'mousedown',
4118   topMouseMove: 'mousemove',
4119   topMouseOut: 'mouseout',
4120   topMouseOver: 'mouseover',
4121   topMouseUp: 'mouseup',
4122   topPaste: 'paste',
4123   topPause: 'pause',
4124   topPlay: 'play',
4125   topPlaying: 'playing',
4126   topProgress: 'progress',
4127   topRateChange: 'ratechange',
4128   topScroll: 'scroll',
4129   topSeeked: 'seeked',
4130   topSeeking: 'seeking',
4131   topSelectionChange: 'selectionchange',
4132   topStalled: 'stalled',
4133   topSuspend: 'suspend',
4134   topTextInput: 'textInput',
4135   topTimeUpdate: 'timeupdate',
4136   topTouchCancel: 'touchcancel',
4137   topTouchEnd: 'touchend',
4138   topTouchMove: 'touchmove',
4139   topTouchStart: 'touchstart',
4140   topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
4141   topVolumeChange: 'volumechange',
4142   topWaiting: 'waiting',
4143   topWheel: 'wheel'
4147  * To ensure no conflicts with other potential React instances on the page
4148  */
4149 var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
4151 function getListeningForDocument(mountAt) {
4152   // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
4153   // directly.
4154   if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
4155     mountAt[topListenersIDKey] = reactTopListenersCounter++;
4156     alreadyListeningTo[mountAt[topListenersIDKey]] = {};
4157   }
4158   return alreadyListeningTo[mountAt[topListenersIDKey]];
4162  * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
4163  * example:
4165  *   EventPluginHub.putListener('myID', 'onClick', myFunction);
4167  * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
4169  * @internal
4170  */
4171 var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
4173   /**
4174    * Injectable event backend
4175    */
4176   ReactEventListener: null,
4178   injection: {
4179     /**
4180      * @param {object} ReactEventListener
4181      */
4182     injectReactEventListener: function (ReactEventListener) {
4183       ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
4184       ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
4185     }
4186   },
4188   /**
4189    * Sets whether or not any created callbacks should be enabled.
4190    *
4191    * @param {boolean} enabled True if callbacks should be enabled.
4192    */
4193   setEnabled: function (enabled) {
4194     if (ReactBrowserEventEmitter.ReactEventListener) {
4195       ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
4196     }
4197   },
4199   /**
4200    * @return {boolean} True if callbacks are enabled.
4201    */
4202   isEnabled: function () {
4203     return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
4204   },
4206   /**
4207    * We listen for bubbled touch events on the document object.
4208    *
4209    * Firefox v8.01 (and possibly others) exhibited strange behavior when
4210    * mounting `onmousemove` events at some node that was not the document
4211    * element. The symptoms were that if your mouse is not moving over something
4212    * contained within that mount point (for example on the background) the
4213    * top-level listeners for `onmousemove` won't be called. However, if you
4214    * register the `mousemove` on the document object, then it will of course
4215    * catch all `mousemove`s. This along with iOS quirks, justifies restricting
4216    * top-level listeners to the document object only, at least for these
4217    * movement types of events and possibly all events.
4218    *
4219    * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
4220    *
4221    * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
4222    * they bubble to document.
4223    *
4224    * @param {string} registrationName Name of listener (e.g. `onClick`).
4225    * @param {object} contentDocumentHandle Document which owns the container
4226    */
4227   listenTo: function (registrationName, contentDocumentHandle) {
4228     var mountAt = contentDocumentHandle;
4229     var isListening = getListeningForDocument(mountAt);
4230     var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
4232     var topLevelTypes = EventConstants.topLevelTypes;
4233     for (var i = 0; i < dependencies.length; i++) {
4234       var dependency = dependencies[i];
4235       if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
4236         if (dependency === topLevelTypes.topWheel) {
4237           if (isEventSupported('wheel')) {
4238             ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);
4239           } else if (isEventSupported('mousewheel')) {
4240             ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);
4241           } else {
4242             // Firefox needs to capture a different mouse scroll event.
4243             // @see http://www.quirksmode.org/dom/events/tests/scroll.html
4244             ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
4245           }
4246         } else if (dependency === topLevelTypes.topScroll) {
4248           if (isEventSupported('scroll', true)) {
4249             ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);
4250           } else {
4251             ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
4252           }
4253         } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {
4255           if (isEventSupported('focus', true)) {
4256             ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);
4257             ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);
4258           } else if (isEventSupported('focusin')) {
4259             // IE has `focusin` and `focusout` events which bubble.
4260             // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
4261             ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);
4262             ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);
4263           }
4265           // to make sure blur and focus event listeners are only attached once
4266           isListening[topLevelTypes.topBlur] = true;
4267           isListening[topLevelTypes.topFocus] = true;
4268         } else if (topEventMapping.hasOwnProperty(dependency)) {
4269           ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
4270         }
4272         isListening[dependency] = true;
4273       }
4274     }
4275   },
4277   trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
4278     return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
4279   },
4281   trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
4282     return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
4283   },
4285   /**
4286    * Listens to window scroll and resize events. We cache scroll values so that
4287    * application code can access them without triggering reflows.
4288    *
4289    * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when
4290    * pageX/pageY isn't supported (legacy browsers).
4291    *
4292    * NOTE: Scroll events do not bubble.
4293    *
4294    * @see http://www.quirksmode.org/dom/events/scroll.html
4295    */
4296   ensureScrollValueMonitoring: function () {
4297     if (hasEventPageXY === undefined) {
4298       hasEventPageXY = document.createEvent && 'pageX' in document.createEvent('MouseEvent');
4299     }
4300     if (!hasEventPageXY && !isMonitoringScrollValue) {
4301       var refresh = ViewportMetrics.refreshScrollValues;
4302       ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
4303       isMonitoringScrollValue = true;
4304     }
4305   }
4309 module.exports = ReactBrowserEventEmitter;
4310 },{"125":125,"143":143,"145":145,"16":16,"18":18,"184":184,"69":69}],29:[function(_dereq_,module,exports){
4312  * Copyright 2013-present, Facebook, Inc.
4313  * All rights reserved.
4315  * This source code is licensed under the BSD-style license found in the
4316  * LICENSE file in the root directory of this source tree. An additional grant
4317  * of patent rights can be found in the PATENTS file in the same directory.
4319  * @providesModule ReactCSSTransitionGroup
4320  */
4322 'use strict';
4324 var _assign = _dereq_(184);
4326 var React = _dereq_(27);
4328 var ReactTransitionGroup = _dereq_(102);
4329 var ReactCSSTransitionGroupChild = _dereq_(30);
4331 function createTransitionTimeoutPropValidator(transitionType) {
4332   var timeoutPropName = 'transition' + transitionType + 'Timeout';
4333   var enabledPropName = 'transition' + transitionType;
4335   return function (props) {
4336     // If the transition is enabled
4337     if (props[enabledPropName]) {
4338       // If no timeout duration is provided
4339       if (props[timeoutPropName] == null) {
4340         return new Error(timeoutPropName + ' wasn\'t supplied to ReactCSSTransitionGroup: ' + 'this can cause unreliable animations and won\'t be supported in ' + 'a future version of React. See ' + 'https://fb.me/react-animation-transition-group-timeout for more ' + 'information.');
4342         // If the duration isn't a number
4343       } else if (typeof props[timeoutPropName] !== 'number') {
4344           return new Error(timeoutPropName + ' must be a number (in milliseconds)');
4345         }
4346     }
4347   };
4351  * An easy way to perform CSS transitions and animations when a React component
4352  * enters or leaves the DOM.
4353  * See https://facebook.github.io/react/docs/animation.html#high-level-api-reactcsstransitiongroup
4354  */
4355 var ReactCSSTransitionGroup = React.createClass({
4356   displayName: 'ReactCSSTransitionGroup',
4358   propTypes: {
4359     transitionName: ReactCSSTransitionGroupChild.propTypes.name,
4361     transitionAppear: React.PropTypes.bool,
4362     transitionEnter: React.PropTypes.bool,
4363     transitionLeave: React.PropTypes.bool,
4364     transitionAppearTimeout: createTransitionTimeoutPropValidator('Appear'),
4365     transitionEnterTimeout: createTransitionTimeoutPropValidator('Enter'),
4366     transitionLeaveTimeout: createTransitionTimeoutPropValidator('Leave')
4367   },
4369   getDefaultProps: function () {
4370     return {
4371       transitionAppear: false,
4372       transitionEnter: true,
4373       transitionLeave: true
4374     };
4375   },
4377   _wrapChild: function (child) {
4378     // We need to provide this childFactory so that
4379     // ReactCSSTransitionGroupChild can receive updates to name, enter, and
4380     // leave while it is leaving.
4381     return React.createElement(ReactCSSTransitionGroupChild, {
4382       name: this.props.transitionName,
4383       appear: this.props.transitionAppear,
4384       enter: this.props.transitionEnter,
4385       leave: this.props.transitionLeave,
4386       appearTimeout: this.props.transitionAppearTimeout,
4387       enterTimeout: this.props.transitionEnterTimeout,
4388       leaveTimeout: this.props.transitionLeaveTimeout
4389     }, child);
4390   },
4392   render: function () {
4393     return React.createElement(ReactTransitionGroup, _assign({}, this.props, { childFactory: this._wrapChild }));
4394   }
4397 module.exports = ReactCSSTransitionGroup;
4398 },{"102":102,"184":184,"27":27,"30":30}],30:[function(_dereq_,module,exports){
4400  * Copyright 2013-present, Facebook, Inc.
4401  * All rights reserved.
4403  * This source code is licensed under the BSD-style license found in the
4404  * LICENSE file in the root directory of this source tree. An additional grant
4405  * of patent rights can be found in the PATENTS file in the same directory.
4407  * @providesModule ReactCSSTransitionGroupChild
4408  */
4410 'use strict';
4412 var React = _dereq_(27);
4413 var ReactDOM = _dereq_(41);
4415 var CSSCore = _dereq_(157);
4416 var ReactTransitionEvents = _dereq_(101);
4418 var onlyChild = _dereq_(147);
4420 var TICK = 17;
4422 var ReactCSSTransitionGroupChild = React.createClass({
4423   displayName: 'ReactCSSTransitionGroupChild',
4425   propTypes: {
4426     name: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.shape({
4427       enter: React.PropTypes.string,
4428       leave: React.PropTypes.string,
4429       active: React.PropTypes.string
4430     }), React.PropTypes.shape({
4431       enter: React.PropTypes.string,
4432       enterActive: React.PropTypes.string,
4433       leave: React.PropTypes.string,
4434       leaveActive: React.PropTypes.string,
4435       appear: React.PropTypes.string,
4436       appearActive: React.PropTypes.string
4437     })]).isRequired,
4439     // Once we require timeouts to be specified, we can remove the
4440     // boolean flags (appear etc.) and just accept a number
4441     // or a bool for the timeout flags (appearTimeout etc.)
4442     appear: React.PropTypes.bool,
4443     enter: React.PropTypes.bool,
4444     leave: React.PropTypes.bool,
4445     appearTimeout: React.PropTypes.number,
4446     enterTimeout: React.PropTypes.number,
4447     leaveTimeout: React.PropTypes.number
4448   },
4450   transition: function (animationType, finishCallback, userSpecifiedDelay) {
4451     var node = ReactDOM.findDOMNode(this);
4453     if (!node) {
4454       if (finishCallback) {
4455         finishCallback();
4456       }
4457       return;
4458     }
4460     var className = this.props.name[animationType] || this.props.name + '-' + animationType;
4461     var activeClassName = this.props.name[animationType + 'Active'] || className + '-active';
4462     var timeout = null;
4464     var endListener = function (e) {
4465       if (e && e.target !== node) {
4466         return;
4467       }
4469       clearTimeout(timeout);
4471       CSSCore.removeClass(node, className);
4472       CSSCore.removeClass(node, activeClassName);
4474       ReactTransitionEvents.removeEndEventListener(node, endListener);
4476       // Usually this optional callback is used for informing an owner of
4477       // a leave animation and telling it to remove the child.
4478       if (finishCallback) {
4479         finishCallback();
4480       }
4481     };
4483     CSSCore.addClass(node, className);
4485     // Need to do this to actually trigger a transition.
4486     this.queueClass(activeClassName);
4488     // If the user specified a timeout delay.
4489     if (userSpecifiedDelay) {
4490       // Clean-up the animation after the specified delay
4491       timeout = setTimeout(endListener, userSpecifiedDelay);
4492       this.transitionTimeouts.push(timeout);
4493     } else {
4494       // DEPRECATED: this listener will be removed in a future version of react
4495       ReactTransitionEvents.addEndEventListener(node, endListener);
4496     }
4497   },
4499   queueClass: function (className) {
4500     this.classNameQueue.push(className);
4502     if (!this.timeout) {
4503       this.timeout = setTimeout(this.flushClassNameQueue, TICK);
4504     }
4505   },
4507   flushClassNameQueue: function () {
4508     if (this.isMounted()) {
4509       this.classNameQueue.forEach(CSSCore.addClass.bind(CSSCore, ReactDOM.findDOMNode(this)));
4510     }
4511     this.classNameQueue.length = 0;
4512     this.timeout = null;
4513   },
4515   componentWillMount: function () {
4516     this.classNameQueue = [];
4517     this.transitionTimeouts = [];
4518   },
4520   componentWillUnmount: function () {
4521     if (this.timeout) {
4522       clearTimeout(this.timeout);
4523     }
4524     this.transitionTimeouts.forEach(function (timeout) {
4525       clearTimeout(timeout);
4526     });
4527   },
4529   componentWillAppear: function (done) {
4530     if (this.props.appear) {
4531       this.transition('appear', done, this.props.appearTimeout);
4532     } else {
4533       done();
4534     }
4535   },
4537   componentWillEnter: function (done) {
4538     if (this.props.enter) {
4539       this.transition('enter', done, this.props.enterTimeout);
4540     } else {
4541       done();
4542     }
4543   },
4545   componentWillLeave: function (done) {
4546     if (this.props.leave) {
4547       this.transition('leave', done, this.props.leaveTimeout);
4548     } else {
4549       done();
4550     }
4551   },
4553   render: function () {
4554     return onlyChild(this.props.children);
4555   }
4558 module.exports = ReactCSSTransitionGroupChild;
4559 },{"101":101,"147":147,"157":157,"27":27,"41":41}],31:[function(_dereq_,module,exports){
4561  * Copyright 2014-present, Facebook, Inc.
4562  * All rights reserved.
4564  * This source code is licensed under the BSD-style license found in the
4565  * LICENSE file in the root directory of this source tree. An additional grant
4566  * of patent rights can be found in the PATENTS file in the same directory.
4568  * @providesModule ReactChildReconciler
4569  */
4571 'use strict';
4573 var ReactReconciler = _dereq_(93);
4575 var instantiateReactComponent = _dereq_(144);
4576 var KeyEscapeUtils = _dereq_(23);
4577 var shouldUpdateReactComponent = _dereq_(153);
4578 var traverseAllChildren = _dereq_(154);
4579 var warning = _dereq_(183);
4581 function instantiateChild(childInstances, child, name) {
4582   // We found a component instance.
4583   var keyUnique = childInstances[name] === undefined;
4584   if ("development" !== 'production') {
4585     "development" !== '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.', KeyEscapeUtils.unescape(name)) : void 0;
4586   }
4587   if (child != null && keyUnique) {
4588     childInstances[name] = instantiateReactComponent(child);
4589   }
4593  * ReactChildReconciler provides helpers for initializing or updating a set of
4594  * children. Its output is suitable for passing it onto ReactMultiChild which
4595  * does diffed reordering and insertion.
4596  */
4597 var ReactChildReconciler = {
4598   /**
4599    * Generates a "mount image" for each of the supplied children. In the case
4600    * of `ReactDOMComponent`, a mount image is a string of markup.
4601    *
4602    * @param {?object} nestedChildNodes Nested child maps.
4603    * @return {?object} A set of child instances.
4604    * @internal
4605    */
4606   instantiateChildren: function (nestedChildNodes, transaction, context) {
4607     if (nestedChildNodes == null) {
4608       return null;
4609     }
4610     var childInstances = {};
4611     traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
4612     return childInstances;
4613   },
4615   /**
4616    * Updates the rendered children and returns a new set of children.
4617    *
4618    * @param {?object} prevChildren Previously initialized set of children.
4619    * @param {?object} nextChildren Flat child element maps.
4620    * @param {ReactReconcileTransaction} transaction
4621    * @param {object} context
4622    * @return {?object} A new set of child instances.
4623    * @internal
4624    */
4625   updateChildren: function (prevChildren, nextChildren, removedNodes, transaction, context) {
4626     // We currently don't have a way to track moves here but if we use iterators
4627     // instead of for..in we can zip the iterators and check if an item has
4628     // moved.
4629     // TODO: If nothing has changed, return the prevChildren object so that we
4630     // can quickly bailout if nothing has changed.
4631     if (!nextChildren && !prevChildren) {
4632       return;
4633     }
4634     var name;
4635     var prevChild;
4636     for (name in nextChildren) {
4637       if (!nextChildren.hasOwnProperty(name)) {
4638         continue;
4639       }
4640       prevChild = prevChildren && prevChildren[name];
4641       var prevElement = prevChild && prevChild._currentElement;
4642       var nextElement = nextChildren[name];
4643       if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
4644         ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
4645         nextChildren[name] = prevChild;
4646       } else {
4647         if (prevChild) {
4648           removedNodes[name] = ReactReconciler.getNativeNode(prevChild);
4649           ReactReconciler.unmountComponent(prevChild, false);
4650         }
4651         // The child must be instantiated before it's mounted.
4652         var nextChildInstance = instantiateReactComponent(nextElement);
4653         nextChildren[name] = nextChildInstance;
4654       }
4655     }
4656     // Unmount children that are no longer present.
4657     for (name in prevChildren) {
4658       if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
4659         prevChild = prevChildren[name];
4660         removedNodes[name] = ReactReconciler.getNativeNode(prevChild);
4661         ReactReconciler.unmountComponent(prevChild, false);
4662       }
4663     }
4664   },
4666   /**
4667    * Unmounts all rendered children. This should be used to clean up children
4668    * when this component is unmounted.
4669    *
4670    * @param {?object} renderedChildren Previously initialized set of children.
4671    * @internal
4672    */
4673   unmountChildren: function (renderedChildren, safely) {
4674     for (var name in renderedChildren) {
4675       if (renderedChildren.hasOwnProperty(name)) {
4676         var renderedChild = renderedChildren[name];
4677         ReactReconciler.unmountComponent(renderedChild, safely);
4678       }
4679     }
4680   }
4684 module.exports = ReactChildReconciler;
4685 },{"144":144,"153":153,"154":154,"183":183,"23":23,"93":93}],32:[function(_dereq_,module,exports){
4687  * Copyright 2013-present, Facebook, Inc.
4688  * All rights reserved.
4690  * This source code is licensed under the BSD-style license found in the
4691  * LICENSE file in the root directory of this source tree. An additional grant
4692  * of patent rights can be found in the PATENTS file in the same directory.
4694  * @providesModule ReactChildren
4695  */
4697 'use strict';
4699 var PooledClass = _dereq_(26);
4700 var ReactElement = _dereq_(65);
4702 var emptyFunction = _dereq_(165);
4703 var traverseAllChildren = _dereq_(154);
4705 var twoArgumentPooler = PooledClass.twoArgumentPooler;
4706 var fourArgumentPooler = PooledClass.fourArgumentPooler;
4708 var userProvidedKeyEscapeRegex = /\/+/g;
4709 function escapeUserProvidedKey(text) {
4710   return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
4714  * PooledClass representing the bookkeeping associated with performing a child
4715  * traversal. Allows avoiding binding callbacks.
4717  * @constructor ForEachBookKeeping
4718  * @param {!function} forEachFunction Function to perform traversal with.
4719  * @param {?*} forEachContext Context to perform context with.
4720  */
4721 function ForEachBookKeeping(forEachFunction, forEachContext) {
4722   this.func = forEachFunction;
4723   this.context = forEachContext;
4724   this.count = 0;
4726 ForEachBookKeeping.prototype.destructor = function () {
4727   this.func = null;
4728   this.context = null;
4729   this.count = 0;
4731 PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
4733 function forEachSingleChild(bookKeeping, child, name) {
4734   var func = bookKeeping.func;
4735   var context = bookKeeping.context;
4737   func.call(context, child, bookKeeping.count++);
4741  * Iterates through children that are typically specified as `props.children`.
4743  * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
4745  * The provided forEachFunc(child, index) will be called for each
4746  * leaf child.
4748  * @param {?*} children Children tree container.
4749  * @param {function(*, int)} forEachFunc
4750  * @param {*} forEachContext Context for forEachContext.
4751  */
4752 function forEachChildren(children, forEachFunc, forEachContext) {
4753   if (children == null) {
4754     return children;
4755   }
4756   var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
4757   traverseAllChildren(children, forEachSingleChild, traverseContext);
4758   ForEachBookKeeping.release(traverseContext);
4762  * PooledClass representing the bookkeeping associated with performing a child
4763  * mapping. Allows avoiding binding callbacks.
4765  * @constructor MapBookKeeping
4766  * @param {!*} mapResult Object containing the ordered map of results.
4767  * @param {!function} mapFunction Function to perform mapping with.
4768  * @param {?*} mapContext Context to perform mapping with.
4769  */
4770 function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
4771   this.result = mapResult;
4772   this.keyPrefix = keyPrefix;
4773   this.func = mapFunction;
4774   this.context = mapContext;
4775   this.count = 0;
4777 MapBookKeeping.prototype.destructor = function () {
4778   this.result = null;
4779   this.keyPrefix = null;
4780   this.func = null;
4781   this.context = null;
4782   this.count = 0;
4784 PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
4786 function mapSingleChildIntoContext(bookKeeping, child, childKey) {
4787   var result = bookKeeping.result;
4788   var keyPrefix = bookKeeping.keyPrefix;
4789   var func = bookKeeping.func;
4790   var context = bookKeeping.context;
4793   var mappedChild = func.call(context, child, bookKeeping.count++);
4794   if (Array.isArray(mappedChild)) {
4795     mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
4796   } else if (mappedChild != null) {
4797     if (ReactElement.isValidElement(mappedChild)) {
4798       mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
4799       // Keep both the (mapped) and old keys if they differ, just as
4800       // traverseAllChildren used to do for objects as children
4801       keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
4802     }
4803     result.push(mappedChild);
4804   }
4807 function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
4808   var escapedPrefix = '';
4809   if (prefix != null) {
4810     escapedPrefix = escapeUserProvidedKey(prefix) + '/';
4811   }
4812   var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
4813   traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
4814   MapBookKeeping.release(traverseContext);
4818  * Maps children that are typically specified as `props.children`.
4820  * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
4822  * The provided mapFunction(child, key, index) will be called for each
4823  * leaf child.
4825  * @param {?*} children Children tree container.
4826  * @param {function(*, int)} func The map function.
4827  * @param {*} context Context for mapFunction.
4828  * @return {object} Object containing the ordered map of results.
4829  */
4830 function mapChildren(children, func, context) {
4831   if (children == null) {
4832     return children;
4833   }
4834   var result = [];
4835   mapIntoWithKeyPrefixInternal(children, result, null, func, context);
4836   return result;
4839 function forEachSingleChildDummy(traverseContext, child, name) {
4840   return null;
4844  * Count the number of children that are typically specified as
4845  * `props.children`.
4847  * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
4849  * @param {?*} children Children tree container.
4850  * @return {number} The number of children.
4851  */
4852 function countChildren(children, context) {
4853   return traverseAllChildren(children, forEachSingleChildDummy, null);
4857  * Flatten a children object (typically specified as `props.children`) and
4858  * return an array with appropriately re-keyed children.
4860  * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
4861  */
4862 function toArray(children) {
4863   var result = [];
4864   mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
4865   return result;
4868 var ReactChildren = {
4869   forEach: forEachChildren,
4870   map: mapChildren,
4871   mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
4872   count: countChildren,
4873   toArray: toArray
4876 module.exports = ReactChildren;
4877 },{"154":154,"165":165,"26":26,"65":65}],33:[function(_dereq_,module,exports){
4879  * Copyright 2013-present, Facebook, Inc.
4880  * All rights reserved.
4882  * This source code is licensed under the BSD-style license found in the
4883  * LICENSE file in the root directory of this source tree. An additional grant
4884  * of patent rights can be found in the PATENTS file in the same directory.
4886  * @providesModule ReactClass
4887  */
4889 'use strict';
4891 var _assign = _dereq_(184);
4893 var ReactComponent = _dereq_(34);
4894 var ReactElement = _dereq_(65);
4895 var ReactPropTypeLocations = _dereq_(90);
4896 var ReactPropTypeLocationNames = _dereq_(89);
4897 var ReactNoopUpdateQueue = _dereq_(86);
4899 var emptyObject = _dereq_(166);
4900 var invariant = _dereq_(173);
4901 var keyMirror = _dereq_(176);
4902 var keyOf = _dereq_(177);
4903 var warning = _dereq_(183);
4905 var MIXINS_KEY = keyOf({ mixins: null });
4908  * Policies that describe methods in `ReactClassInterface`.
4909  */
4910 var SpecPolicy = keyMirror({
4911   /**
4912    * These methods may be defined only once by the class specification or mixin.
4913    */
4914   DEFINE_ONCE: null,
4915   /**
4916    * These methods may be defined by both the class specification and mixins.
4917    * Subsequent definitions will be chained. These methods must return void.
4918    */
4919   DEFINE_MANY: null,
4920   /**
4921    * These methods are overriding the base class.
4922    */
4923   OVERRIDE_BASE: null,
4924   /**
4925    * These methods are similar to DEFINE_MANY, except we assume they return
4926    * objects. We try to merge the keys of the return values of all the mixed in
4927    * functions. If there is a key conflict we throw.
4928    */
4929   DEFINE_MANY_MERGED: null
4932 var injectedMixins = [];
4935  * Composite components are higher-level components that compose other composite
4936  * or native components.
4938  * To create a new type of `ReactClass`, pass a specification of
4939  * your new class to `React.createClass`. The only requirement of your class
4940  * specification is that you implement a `render` method.
4942  *   var MyComponent = React.createClass({
4943  *     render: function() {
4944  *       return <div>Hello World</div>;
4945  *     }
4946  *   });
4948  * The class specification supports a specific protocol of methods that have
4949  * special meaning (e.g. `render`). See `ReactClassInterface` for
4950  * more the comprehensive protocol. Any other properties and methods in the
4951  * class specification will be available on the prototype.
4953  * @interface ReactClassInterface
4954  * @internal
4955  */
4956 var ReactClassInterface = {
4958   /**
4959    * An array of Mixin objects to include when defining your component.
4960    *
4961    * @type {array}
4962    * @optional
4963    */
4964   mixins: SpecPolicy.DEFINE_MANY,
4966   /**
4967    * An object containing properties and methods that should be defined on
4968    * the component's constructor instead of its prototype (static methods).
4969    *
4970    * @type {object}
4971    * @optional
4972    */
4973   statics: SpecPolicy.DEFINE_MANY,
4975   /**
4976    * Definition of prop types for this component.
4977    *
4978    * @type {object}
4979    * @optional
4980    */
4981   propTypes: SpecPolicy.DEFINE_MANY,
4983   /**
4984    * Definition of context types for this component.
4985    *
4986    * @type {object}
4987    * @optional
4988    */
4989   contextTypes: SpecPolicy.DEFINE_MANY,
4991   /**
4992    * Definition of context types this component sets for its children.
4993    *
4994    * @type {object}
4995    * @optional
4996    */
4997   childContextTypes: SpecPolicy.DEFINE_MANY,
4999   // ==== Definition methods ====
5001   /**
5002    * Invoked when the component is mounted. Values in the mapping will be set on
5003    * `this.props` if that prop is not specified (i.e. using an `in` check).
5004    *
5005    * This method is invoked before `getInitialState` and therefore cannot rely
5006    * on `this.state` or use `this.setState`.
5007    *
5008    * @return {object}
5009    * @optional
5010    */
5011   getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
5013   /**
5014    * Invoked once before the component is mounted. The return value will be used
5015    * as the initial value of `this.state`.
5016    *
5017    *   getInitialState: function() {
5018    *     return {
5019    *       isOn: false,
5020    *       fooBaz: new BazFoo()
5021    *     }
5022    *   }
5023    *
5024    * @return {object}
5025    * @optional
5026    */
5027   getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
5029   /**
5030    * @return {object}
5031    * @optional
5032    */
5033   getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
5035   /**
5036    * Uses props from `this.props` and state from `this.state` to render the
5037    * structure of the component.
5038    *
5039    * No guarantees are made about when or how often this method is invoked, so
5040    * it must not have side effects.
5041    *
5042    *   render: function() {
5043    *     var name = this.props.name;
5044    *     return <div>Hello, {name}!</div>;
5045    *   }
5046    *
5047    * @return {ReactComponent}
5048    * @nosideeffects
5049    * @required
5050    */
5051   render: SpecPolicy.DEFINE_ONCE,
5053   // ==== Delegate methods ====
5055   /**
5056    * Invoked when the component is initially created and about to be mounted.
5057    * This may have side effects, but any external subscriptions or data created
5058    * by this method must be cleaned up in `componentWillUnmount`.
5059    *
5060    * @optional
5061    */
5062   componentWillMount: SpecPolicy.DEFINE_MANY,
5064   /**
5065    * Invoked when the component has been mounted and has a DOM representation.
5066    * However, there is no guarantee that the DOM node is in the document.
5067    *
5068    * Use this as an opportunity to operate on the DOM when the component has
5069    * been mounted (initialized and rendered) for the first time.
5070    *
5071    * @param {DOMElement} rootNode DOM element representing the component.
5072    * @optional
5073    */
5074   componentDidMount: SpecPolicy.DEFINE_MANY,
5076   /**
5077    * Invoked before the component receives new props.
5078    *
5079    * Use this as an opportunity to react to a prop transition by updating the
5080    * state using `this.setState`. Current props are accessed via `this.props`.
5081    *
5082    *   componentWillReceiveProps: function(nextProps, nextContext) {
5083    *     this.setState({
5084    *       likesIncreasing: nextProps.likeCount > this.props.likeCount
5085    *     });
5086    *   }
5087    *
5088    * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
5089    * transition may cause a state change, but the opposite is not true. If you
5090    * need it, you are probably looking for `componentWillUpdate`.
5091    *
5092    * @param {object} nextProps
5093    * @optional
5094    */
5095   componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
5097   /**
5098    * Invoked while deciding if the component should be updated as a result of
5099    * receiving new props, state and/or context.
5100    *
5101    * Use this as an opportunity to `return false` when you're certain that the
5102    * transition to the new props/state/context will not require a component
5103    * update.
5104    *
5105    *   shouldComponentUpdate: function(nextProps, nextState, nextContext) {
5106    *     return !equal(nextProps, this.props) ||
5107    *       !equal(nextState, this.state) ||
5108    *       !equal(nextContext, this.context);
5109    *   }
5110    *
5111    * @param {object} nextProps
5112    * @param {?object} nextState
5113    * @param {?object} nextContext
5114    * @return {boolean} True if the component should update.
5115    * @optional
5116    */
5117   shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
5119   /**
5120    * Invoked when the component is about to update due to a transition from
5121    * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
5122    * and `nextContext`.
5123    *
5124    * Use this as an opportunity to perform preparation before an update occurs.
5125    *
5126    * NOTE: You **cannot** use `this.setState()` in this method.
5127    *
5128    * @param {object} nextProps
5129    * @param {?object} nextState
5130    * @param {?object} nextContext
5131    * @param {ReactReconcileTransaction} transaction
5132    * @optional
5133    */
5134   componentWillUpdate: SpecPolicy.DEFINE_MANY,
5136   /**
5137    * Invoked when the component's DOM representation has been updated.
5138    *
5139    * Use this as an opportunity to operate on the DOM when the component has
5140    * been updated.
5141    *
5142    * @param {object} prevProps
5143    * @param {?object} prevState
5144    * @param {?object} prevContext
5145    * @param {DOMElement} rootNode DOM element representing the component.
5146    * @optional
5147    */
5148   componentDidUpdate: SpecPolicy.DEFINE_MANY,
5150   /**
5151    * Invoked when the component is about to be removed from its parent and have
5152    * its DOM representation destroyed.
5153    *
5154    * Use this as an opportunity to deallocate any external resources.
5155    *
5156    * NOTE: There is no `componentDidUnmount` since your component will have been
5157    * destroyed by that point.
5158    *
5159    * @optional
5160    */
5161   componentWillUnmount: SpecPolicy.DEFINE_MANY,
5163   // ==== Advanced methods ====
5165   /**
5166    * Updates the component's currently mounted DOM representation.
5167    *
5168    * By default, this implements React's rendering and reconciliation algorithm.
5169    * Sophisticated clients may wish to override this.
5170    *
5171    * @param {ReactReconcileTransaction} transaction
5172    * @internal
5173    * @overridable
5174    */
5175   updateComponent: SpecPolicy.OVERRIDE_BASE
5180  * Mapping from class specification keys to special processing functions.
5182  * Although these are declared like instance properties in the specification
5183  * when defining classes using `React.createClass`, they are actually static
5184  * and are accessible on the constructor instead of the prototype. Despite
5185  * being static, they must be defined outside of the "statics" key under
5186  * which all other static methods are defined.
5187  */
5188 var RESERVED_SPEC_KEYS = {
5189   displayName: function (Constructor, displayName) {
5190     Constructor.displayName = displayName;
5191   },
5192   mixins: function (Constructor, mixins) {
5193     if (mixins) {
5194       for (var i = 0; i < mixins.length; i++) {
5195         mixSpecIntoComponent(Constructor, mixins[i]);
5196       }
5197     }
5198   },
5199   childContextTypes: function (Constructor, childContextTypes) {
5200     if ("development" !== 'production') {
5201       validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
5202     }
5203     Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
5204   },
5205   contextTypes: function (Constructor, contextTypes) {
5206     if ("development" !== 'production') {
5207       validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
5208     }
5209     Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
5210   },
5211   /**
5212    * Special case getDefaultProps which should move into statics but requires
5213    * automatic merging.
5214    */
5215   getDefaultProps: function (Constructor, getDefaultProps) {
5216     if (Constructor.getDefaultProps) {
5217       Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
5218     } else {
5219       Constructor.getDefaultProps = getDefaultProps;
5220     }
5221   },
5222   propTypes: function (Constructor, propTypes) {
5223     if ("development" !== 'production') {
5224       validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
5225     }
5226     Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
5227   },
5228   statics: function (Constructor, statics) {
5229     mixStaticSpecIntoComponent(Constructor, statics);
5230   },
5231   autobind: function () {} };
5233 // noop
5234 function validateTypeDef(Constructor, typeDef, location) {
5235   for (var propName in typeDef) {
5236     if (typeDef.hasOwnProperty(propName)) {
5237       // use a warning instead of an invariant so components
5238       // don't show up in prod but only in __DEV__
5239       "development" !== '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) : void 0;
5240     }
5241   }
5244 function validateMethodOverride(isAlreadyDefined, name) {
5245   var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
5247   // Disallow overriding of base class methods unless explicitly allowed.
5248   if (ReactClassMixin.hasOwnProperty(name)) {
5249     !(specPolicy === SpecPolicy.OVERRIDE_BASE) ? "development" !== '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) : void 0;
5250   }
5252   // Disallow defining methods more than once unless explicitly allowed.
5253   if (isAlreadyDefined) {
5254     !(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED) ? "development" !== '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) : void 0;
5255   }
5259  * Mixin helper which handles policy validation and reserved
5260  * specification keys when building React classes.
5261  */
5262 function mixSpecIntoComponent(Constructor, spec) {
5263   if (!spec) {
5264     return;
5265   }
5267   !(typeof spec !== 'function') ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.') : invariant(false) : void 0;
5268   !!ReactElement.isValidElement(spec) ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.') : invariant(false) : void 0;
5270   var proto = Constructor.prototype;
5271   var autoBindPairs = proto.__reactAutoBindPairs;
5273   // By handling mixins before any other properties, we ensure the same
5274   // chaining order is applied to methods with DEFINE_MANY policy, whether
5275   // mixins are listed before or after these methods in the spec.
5276   if (spec.hasOwnProperty(MIXINS_KEY)) {
5277     RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
5278   }
5280   for (var name in spec) {
5281     if (!spec.hasOwnProperty(name)) {
5282       continue;
5283     }
5285     if (name === MIXINS_KEY) {
5286       // We have already handled mixins in a special case above.
5287       continue;
5288     }
5290     var property = spec[name];
5291     var isAlreadyDefined = proto.hasOwnProperty(name);
5292     validateMethodOverride(isAlreadyDefined, name);
5294     if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
5295       RESERVED_SPEC_KEYS[name](Constructor, property);
5296     } else {
5297       // Setup methods on prototype:
5298       // The following member methods should not be automatically bound:
5299       // 1. Expected ReactClass methods (in the "interface").
5300       // 2. Overridden methods (that were mixed in).
5301       var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
5302       var isFunction = typeof property === 'function';
5303       var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
5305       if (shouldAutoBind) {
5306         autoBindPairs.push(name, property);
5307         proto[name] = property;
5308       } else {
5309         if (isAlreadyDefined) {
5310           var specPolicy = ReactClassInterface[name];
5312           // These cases should already be caught by validateMethodOverride.
5313           !(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)) ? "development" !== 'production' ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(false) : void 0;
5315           // For methods which are defined more than once, call the existing
5316           // methods before calling the new property, merging if appropriate.
5317           if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
5318             proto[name] = createMergedResultFunction(proto[name], property);
5319           } else if (specPolicy === SpecPolicy.DEFINE_MANY) {
5320             proto[name] = createChainedFunction(proto[name], property);
5321           }
5322         } else {
5323           proto[name] = property;
5324           if ("development" !== 'production') {
5325             // Add verbose displayName to the function, which helps when looking
5326             // at profiling tools.
5327             if (typeof property === 'function' && spec.displayName) {
5328               proto[name].displayName = spec.displayName + '_' + name;
5329             }
5330           }
5331         }
5332       }
5333     }
5334   }
5337 function mixStaticSpecIntoComponent(Constructor, statics) {
5338   if (!statics) {
5339     return;
5340   }
5341   for (var name in statics) {
5342     var property = statics[name];
5343     if (!statics.hasOwnProperty(name)) {
5344       continue;
5345     }
5347     var isReserved = name in RESERVED_SPEC_KEYS;
5348     !!isReserved ? "development" !== '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) : void 0;
5350     var isInherited = name in Constructor;
5351     !!isInherited ? "development" !== '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) : void 0;
5352     Constructor[name] = property;
5353   }
5357  * Merge two objects, but throw if both contain the same key.
5359  * @param {object} one The first object, which is mutated.
5360  * @param {object} two The second object
5361  * @return {object} one after it has been mutated to contain everything in two.
5362  */
5363 function mergeIntoWithNoDuplicateKeys(one, two) {
5364   !(one && two && typeof one === 'object' && typeof two === 'object') ? "development" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : invariant(false) : void 0;
5366   for (var key in two) {
5367     if (two.hasOwnProperty(key)) {
5368       !(one[key] === undefined) ? "development" !== '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) : void 0;
5369       one[key] = two[key];
5370     }
5371   }
5372   return one;
5376  * Creates a function that invokes two functions and merges their return values.
5378  * @param {function} one Function to invoke first.
5379  * @param {function} two Function to invoke second.
5380  * @return {function} Function that invokes the two argument functions.
5381  * @private
5382  */
5383 function createMergedResultFunction(one, two) {
5384   return function mergedResult() {
5385     var a = one.apply(this, arguments);
5386     var b = two.apply(this, arguments);
5387     if (a == null) {
5388       return b;
5389     } else if (b == null) {
5390       return a;
5391     }
5392     var c = {};
5393     mergeIntoWithNoDuplicateKeys(c, a);
5394     mergeIntoWithNoDuplicateKeys(c, b);
5395     return c;
5396   };
5400  * Creates a function that invokes two functions and ignores their return vales.
5402  * @param {function} one Function to invoke first.
5403  * @param {function} two Function to invoke second.
5404  * @return {function} Function that invokes the two argument functions.
5405  * @private
5406  */
5407 function createChainedFunction(one, two) {
5408   return function chainedFunction() {
5409     one.apply(this, arguments);
5410     two.apply(this, arguments);
5411   };
5415  * Binds a method to the component.
5417  * @param {object} component Component whose method is going to be bound.
5418  * @param {function} method Method to be bound.
5419  * @return {function} The bound method.
5420  */
5421 function bindAutoBindMethod(component, method) {
5422   var boundMethod = method.bind(component);
5423   if ("development" !== 'production') {
5424     boundMethod.__reactBoundContext = component;
5425     boundMethod.__reactBoundMethod = method;
5426     boundMethod.__reactBoundArguments = null;
5427     var componentName = component.constructor.displayName;
5428     var _bind = boundMethod.bind;
5429     boundMethod.bind = function (newThis) {
5430       for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5431         args[_key - 1] = arguments[_key];
5432       }
5434       // User is trying to bind() an autobound method; we effectively will
5435       // ignore the value of "this" that the user is trying to use, so
5436       // let's warn.
5437       if (newThis !== component && newThis !== null) {
5438         "development" !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
5439       } else if (!args.length) {
5440         "development" !== '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) : void 0;
5441         return boundMethod;
5442       }
5443       var reboundMethod = _bind.apply(boundMethod, arguments);
5444       reboundMethod.__reactBoundContext = component;
5445       reboundMethod.__reactBoundMethod = method;
5446       reboundMethod.__reactBoundArguments = args;
5447       return reboundMethod;
5448     };
5449   }
5450   return boundMethod;
5454  * Binds all auto-bound methods in a component.
5456  * @param {object} component Component whose method is going to be bound.
5457  */
5458 function bindAutoBindMethods(component) {
5459   var pairs = component.__reactAutoBindPairs;
5460   for (var i = 0; i < pairs.length; i += 2) {
5461     var autoBindKey = pairs[i];
5462     var method = pairs[i + 1];
5463     component[autoBindKey] = bindAutoBindMethod(component, method);
5464   }
5468  * Add more to the ReactClass base class. These are all legacy features and
5469  * therefore not already part of the modern ReactComponent.
5470  */
5471 var ReactClassMixin = {
5473   /**
5474    * TODO: This will be deprecated because state should always keep a consistent
5475    * type signature and the only use case for this, is to avoid that.
5476    */
5477   replaceState: function (newState, callback) {
5478     this.updater.enqueueReplaceState(this, newState);
5479     if (callback) {
5480       this.updater.enqueueCallback(this, callback, 'replaceState');
5481     }
5482   },
5484   /**
5485    * Checks whether or not this composite component is mounted.
5486    * @return {boolean} True if mounted, false otherwise.
5487    * @protected
5488    * @final
5489    */
5490   isMounted: function () {
5491     return this.updater.isMounted(this);
5492   }
5495 var ReactClassComponent = function () {};
5496 _assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
5499  * Module for creating composite components.
5501  * @class ReactClass
5502  */
5503 var ReactClass = {
5505   /**
5506    * Creates a composite component class given a class specification.
5507    * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
5508    *
5509    * @param {object} spec Class specification (which must define `render`).
5510    * @return {function} Component constructor function.
5511    * @public
5512    */
5513   createClass: function (spec) {
5514     var Constructor = function (props, context, updater) {
5515       // This constructor gets overridden by mocks. The argument is used
5516       // by mocks to assert on what gets mounted.
5518       if ("development" !== 'production') {
5519         "development" !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : void 0;
5520       }
5522       // Wire up auto-binding
5523       if (this.__reactAutoBindPairs.length) {
5524         bindAutoBindMethods(this);
5525       }
5527       this.props = props;
5528       this.context = context;
5529       this.refs = emptyObject;
5530       this.updater = updater || ReactNoopUpdateQueue;
5532       this.state = null;
5534       // ReactClasses doesn't have constructors. Instead, they use the
5535       // getInitialState and componentWillMount methods for initialization.
5537       var initialState = this.getInitialState ? this.getInitialState() : null;
5538       if ("development" !== 'production') {
5539         // We allow auto-mocks to proceed as if they're returning null.
5540         if (initialState === undefined && this.getInitialState._isMockFunction) {
5541           // This is probably bad practice. Consider warning here and
5542           // deprecating this convenience.
5543           initialState = null;
5544         }
5545       }
5546       !(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : invariant(false) : void 0;
5548       this.state = initialState;
5549     };
5550     Constructor.prototype = new ReactClassComponent();
5551     Constructor.prototype.constructor = Constructor;
5552     Constructor.prototype.__reactAutoBindPairs = [];
5554     injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
5556     mixSpecIntoComponent(Constructor, spec);
5558     // Initialize the defaultProps property after all mixins have been merged.
5559     if (Constructor.getDefaultProps) {
5560       Constructor.defaultProps = Constructor.getDefaultProps();
5561     }
5563     if ("development" !== 'production') {
5564       // This is a tag to indicate that the use of these method names is ok,
5565       // since it's used with createClass. If it's not, then it's likely a
5566       // mistake so we'll warn you to use the static property, property
5567       // initializer or constructor respectively.
5568       if (Constructor.getDefaultProps) {
5569         Constructor.getDefaultProps.isReactClassApproved = {};
5570       }
5571       if (Constructor.prototype.getInitialState) {
5572         Constructor.prototype.getInitialState.isReactClassApproved = {};
5573       }
5574     }
5576     !Constructor.prototype.render ? "development" !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : invariant(false) : void 0;
5578     if ("development" !== 'production') {
5579       "development" !== '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') : void 0;
5580       "development" !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
5581     }
5583     // Reduce time spent doing lookups by setting these on the prototype.
5584     for (var methodName in ReactClassInterface) {
5585       if (!Constructor.prototype[methodName]) {
5586         Constructor.prototype[methodName] = null;
5587       }
5588     }
5590     return Constructor;
5591   },
5593   injection: {
5594     injectMixin: function (mixin) {
5595       injectedMixins.push(mixin);
5596     }
5597   }
5601 module.exports = ReactClass;
5602 },{"166":166,"173":173,"176":176,"177":177,"183":183,"184":184,"34":34,"65":65,"86":86,"89":89,"90":90}],34:[function(_dereq_,module,exports){
5604  * Copyright 2013-present, Facebook, Inc.
5605  * All rights reserved.
5607  * This source code is licensed under the BSD-style license found in the
5608  * LICENSE file in the root directory of this source tree. An additional grant
5609  * of patent rights can be found in the PATENTS file in the same directory.
5611  * @providesModule ReactComponent
5612  */
5614 'use strict';
5616 var ReactNoopUpdateQueue = _dereq_(86);
5617 var ReactInstrumentation = _dereq_(76);
5619 var canDefineProperty = _dereq_(128);
5620 var emptyObject = _dereq_(166);
5621 var invariant = _dereq_(173);
5622 var warning = _dereq_(183);
5625  * Base class helpers for the updating state of a component.
5626  */
5627 function ReactComponent(props, context, updater) {
5628   this.props = props;
5629   this.context = context;
5630   this.refs = emptyObject;
5631   // We initialize the default updater but the real one gets injected by the
5632   // renderer.
5633   this.updater = updater || ReactNoopUpdateQueue;
5636 ReactComponent.prototype.isReactComponent = {};
5639  * Sets a subset of the state. Always use this to mutate
5640  * state. You should treat `this.state` as immutable.
5642  * There is no guarantee that `this.state` will be immediately updated, so
5643  * accessing `this.state` after calling this method may return the old value.
5645  * There is no guarantee that calls to `setState` will run synchronously,
5646  * as they may eventually be batched together.  You can provide an optional
5647  * callback that will be executed when the call to setState is actually
5648  * completed.
5650  * When a function is provided to setState, it will be called at some point in
5651  * the future (not synchronously). It will be called with the up to date
5652  * component arguments (state, props, context). These values can be different
5653  * from this.* because your function may be called after receiveProps but before
5654  * shouldComponentUpdate, and this new state, props, and context will not yet be
5655  * assigned to this.
5657  * @param {object|function} partialState Next partial state or function to
5658  *        produce next partial state to be merged with current state.
5659  * @param {?function} callback Called after state is updated.
5660  * @final
5661  * @protected
5662  */
5663 ReactComponent.prototype.setState = function (partialState, callback) {
5664   !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.') : invariant(false) : void 0;
5665   if ("development" !== 'production') {
5666     ReactInstrumentation.debugTool.onSetState();
5667     "development" !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
5668   }
5669   this.updater.enqueueSetState(this, partialState);
5670   if (callback) {
5671     this.updater.enqueueCallback(this, callback, 'setState');
5672   }
5676  * Forces an update. This should only be invoked when it is known with
5677  * certainty that we are **not** in a DOM transaction.
5679  * You may want to call this when you know that some deeper aspect of the
5680  * component's state has changed but `setState` was not called.
5682  * This will not invoke `shouldComponentUpdate`, but it will invoke
5683  * `componentWillUpdate` and `componentDidUpdate`.
5685  * @param {?function} callback Called after update is complete.
5686  * @final
5687  * @protected
5688  */
5689 ReactComponent.prototype.forceUpdate = function (callback) {
5690   this.updater.enqueueForceUpdate(this);
5691   if (callback) {
5692     this.updater.enqueueCallback(this, callback, 'forceUpdate');
5693   }
5697  * Deprecated APIs. These APIs used to exist on classic React classes but since
5698  * we would like to deprecate them, we're not going to move them over to this
5699  * modern base class. Instead, we define a getter that warns if it's accessed.
5700  */
5701 if ("development" !== 'production') {
5702   var deprecatedAPIs = {
5703     isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
5704     replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
5705   };
5706   var defineDeprecationWarning = function (methodName, info) {
5707     if (canDefineProperty) {
5708       Object.defineProperty(ReactComponent.prototype, methodName, {
5709         get: function () {
5710           "development" !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
5711           return undefined;
5712         }
5713       });
5714     }
5715   };
5716   for (var fnName in deprecatedAPIs) {
5717     if (deprecatedAPIs.hasOwnProperty(fnName)) {
5718       defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
5719     }
5720   }
5723 module.exports = ReactComponent;
5724 },{"128":128,"166":166,"173":173,"183":183,"76":76,"86":86}],35:[function(_dereq_,module,exports){
5726  * Copyright 2013-present, Facebook, Inc.
5727  * All rights reserved.
5729  * This source code is licensed under the BSD-style license found in the
5730  * LICENSE file in the root directory of this source tree. An additional grant
5731  * of patent rights can be found in the PATENTS file in the same directory.
5733  * @providesModule ReactComponentBrowserEnvironment
5734  */
5736 'use strict';
5738 var DOMChildrenOperations = _dereq_(7);
5739 var ReactDOMIDOperations = _dereq_(51);
5742  * Abstracts away all functionality of the reconciler that requires knowledge of
5743  * the browser context. TODO: These callers should be refactored to avoid the
5744  * need for this injection.
5745  */
5746 var ReactComponentBrowserEnvironment = {
5748   processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
5750   replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup,
5752   /**
5753    * If a particular environment requires that some resources be cleaned up,
5754    * specify this in the injected Mixin. In the DOM, we would likely want to
5755    * purge any cached node ID lookups.
5756    *
5757    * @private
5758    */
5759   unmountIDFromEnvironment: function (rootNodeID) {}
5763 module.exports = ReactComponentBrowserEnvironment;
5764 },{"51":51,"7":7}],36:[function(_dereq_,module,exports){
5766  * Copyright 2014-present, Facebook, Inc.
5767  * All rights reserved.
5769  * This source code is licensed under the BSD-style license found in the
5770  * LICENSE file in the root directory of this source tree. An additional grant
5771  * of patent rights can be found in the PATENTS file in the same directory.
5773  * @providesModule ReactComponentEnvironment
5774  */
5776 'use strict';
5778 var invariant = _dereq_(173);
5780 var injected = false;
5782 var ReactComponentEnvironment = {
5784   /**
5785    * Optionally injectable environment dependent cleanup hook. (server vs.
5786    * browser etc). Example: A browser system caches DOM nodes based on component
5787    * ID and must remove that cache entry when this instance is unmounted.
5788    */
5789   unmountIDFromEnvironment: null,
5791   /**
5792    * Optionally injectable hook for swapping out mount images in the middle of
5793    * the tree.
5794    */
5795   replaceNodeWithMarkup: null,
5797   /**
5798    * Optionally injectable hook for processing a queue of child updates. Will
5799    * later move into MultiChildComponents.
5800    */
5801   processChildrenUpdates: null,
5803   injection: {
5804     injectEnvironment: function (environment) {
5805       !!injected ? "development" !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : invariant(false) : void 0;
5806       ReactComponentEnvironment.unmountIDFromEnvironment = environment.unmountIDFromEnvironment;
5807       ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
5808       ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
5809       injected = true;
5810     }
5811   }
5815 module.exports = ReactComponentEnvironment;
5816 },{"173":173}],37:[function(_dereq_,module,exports){
5818  * Copyright 2016-present, Facebook, Inc.
5819  * All rights reserved.
5821  * This source code is licensed under the BSD-style license found in the
5822  * LICENSE file in the root directory of this source tree. An additional grant
5823  * of patent rights can be found in the PATENTS file in the same directory.
5825  * @providesModule ReactComponentTreeDevtool
5826  */
5828 'use strict';
5830 var invariant = _dereq_(173);
5832 var tree = {};
5833 var rootIDs = [];
5835 function updateTree(id, update) {
5836   if (!tree[id]) {
5837     tree[id] = {
5838       parentID: null,
5839       ownerID: null,
5840       text: null,
5841       childIDs: [],
5842       displayName: 'Unknown',
5843       isMounted: false,
5844       updateCount: 0
5845     };
5846   }
5847   update(tree[id]);
5850 function purgeDeep(id) {
5851   var item = tree[id];
5852   if (item) {
5853     var childIDs = item.childIDs;
5855     delete tree[id];
5856     childIDs.forEach(purgeDeep);
5857   }
5860 var ReactComponentTreeDevtool = {
5861   onSetDisplayName: function (id, displayName) {
5862     updateTree(id, function (item) {
5863       return item.displayName = displayName;
5864     });
5865   },
5866   onSetChildren: function (id, nextChildIDs) {
5867     updateTree(id, function (item) {
5868       var prevChildIDs = item.childIDs;
5869       item.childIDs = nextChildIDs;
5871       nextChildIDs.forEach(function (nextChildID) {
5872         var nextChild = tree[nextChildID];
5873         !nextChild ? "development" !== 'production' ? invariant(false, 'Expected devtool events to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;
5874         !(nextChild.displayName != null) ? "development" !== 'production' ? invariant(false, 'Expected onSetDisplayName() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;
5875         !(nextChild.childIDs != null || nextChild.text != null) ? "development" !== 'production' ? invariant(false, 'Expected onSetChildren() or onSetText() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;
5876         !nextChild.isMounted ? "development" !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child ' + 'before its parent includes it in onSetChildren().') : invariant(false) : void 0;
5878         if (prevChildIDs.indexOf(nextChildID) === -1) {
5879           nextChild.parentID = id;
5880         }
5881       });
5882     });
5883   },
5884   onSetOwner: function (id, ownerID) {
5885     updateTree(id, function (item) {
5886       return item.ownerID = ownerID;
5887     });
5888   },
5889   onSetText: function (id, text) {
5890     updateTree(id, function (item) {
5891       return item.text = text;
5892     });
5893   },
5894   onMountComponent: function (id) {
5895     updateTree(id, function (item) {
5896       return item.isMounted = true;
5897     });
5898   },
5899   onMountRootComponent: function (id) {
5900     rootIDs.push(id);
5901   },
5902   onUpdateComponent: function (id) {
5903     updateTree(id, function (item) {
5904       return item.updateCount++;
5905     });
5906   },
5907   onUnmountComponent: function (id) {
5908     updateTree(id, function (item) {
5909       return item.isMounted = false;
5910     });
5911     rootIDs = rootIDs.filter(function (rootID) {
5912       return rootID !== id;
5913     });
5914   },
5915   purgeUnmountedComponents: function () {
5916     if (ReactComponentTreeDevtool._preventPurging) {
5917       // Should only be used for testing.
5918       return;
5919     }
5921     Object.keys(tree).filter(function (id) {
5922       return !tree[id].isMounted;
5923     }).forEach(purgeDeep);
5924   },
5925   isMounted: function (id) {
5926     var item = tree[id];
5927     return item ? item.isMounted : false;
5928   },
5929   getChildIDs: function (id) {
5930     var item = tree[id];
5931     return item ? item.childIDs : [];
5932   },
5933   getDisplayName: function (id) {
5934     var item = tree[id];
5935     return item ? item.displayName : 'Unknown';
5936   },
5937   getOwnerID: function (id) {
5938     var item = tree[id];
5939     return item ? item.ownerID : null;
5940   },
5941   getParentID: function (id) {
5942     var item = tree[id];
5943     return item ? item.parentID : null;
5944   },
5945   getText: function (id) {
5946     var item = tree[id];
5947     return item ? item.text : null;
5948   },
5949   getUpdateCount: function (id) {
5950     var item = tree[id];
5951     return item ? item.updateCount : 0;
5952   },
5953   getRootIDs: function () {
5954     return rootIDs;
5955   },
5956   getRegisteredIDs: function () {
5957     return Object.keys(tree);
5958   }
5961 module.exports = ReactComponentTreeDevtool;
5962 },{"173":173}],38:[function(_dereq_,module,exports){
5964  * Copyright 2013-present, Facebook, Inc.
5965  * All rights reserved.
5967  * This source code is licensed under the BSD-style license found in the
5968  * LICENSE file in the root directory of this source tree. An additional grant
5969  * of patent rights can be found in the PATENTS file in the same directory.
5971  * @providesModule ReactComponentWithPureRenderMixin
5972  */
5974 'use strict';
5976 var shallowCompare = _dereq_(152);
5979  * If your React component's render function is "pure", e.g. it will render the
5980  * same result given the same props and state, provide this mixin for a
5981  * considerable performance boost.
5983  * Most React components have pure render functions.
5985  * Example:
5987  *   var ReactComponentWithPureRenderMixin =
5988  *     require('ReactComponentWithPureRenderMixin');
5989  *   React.createClass({
5990  *     mixins: [ReactComponentWithPureRenderMixin],
5992  *     render: function() {
5993  *       return <div className={this.props.className}>foo</div>;
5994  *     }
5995  *   });
5997  * Note: This only checks shallow equality for props and state. If these contain
5998  * complex data structures this mixin may have false-negatives for deeper
5999  * differences. Only mixin to components which have simple props and state, or
6000  * use `forceUpdate()` when you know deep data structures have changed.
6002  * See https://facebook.github.io/react/docs/pure-render-mixin.html
6003  */
6004 var ReactComponentWithPureRenderMixin = {
6005   shouldComponentUpdate: function (nextProps, nextState) {
6006     return shallowCompare(this, nextProps, nextState);
6007   }
6010 module.exports = ReactComponentWithPureRenderMixin;
6011 },{"152":152}],39:[function(_dereq_,module,exports){
6013  * Copyright 2013-present, Facebook, Inc.
6014  * All rights reserved.
6016  * This source code is licensed under the BSD-style license found in the
6017  * LICENSE file in the root directory of this source tree. An additional grant
6018  * of patent rights can be found in the PATENTS file in the same directory.
6020  * @providesModule ReactCompositeComponent
6021  */
6023 'use strict';
6025 var _assign = _dereq_(184);
6027 var ReactComponentEnvironment = _dereq_(36);
6028 var ReactCurrentOwner = _dereq_(40);
6029 var ReactElement = _dereq_(65);
6030 var ReactErrorUtils = _dereq_(68);
6031 var ReactInstanceMap = _dereq_(75);
6032 var ReactInstrumentation = _dereq_(76);
6033 var ReactNodeTypes = _dereq_(85);
6034 var ReactPropTypeLocations = _dereq_(90);
6035 var ReactPropTypeLocationNames = _dereq_(89);
6036 var ReactReconciler = _dereq_(93);
6037 var ReactUpdateQueue = _dereq_(103);
6039 var emptyObject = _dereq_(166);
6040 var invariant = _dereq_(173);
6041 var shouldUpdateReactComponent = _dereq_(153);
6042 var warning = _dereq_(183);
6044 function getDeclarationErrorAddendum(component) {
6045   var owner = component._currentElement._owner || null;
6046   if (owner) {
6047     var name = owner.getName();
6048     if (name) {
6049       return ' Check the render method of `' + name + '`.';
6050     }
6051   }
6052   return '';
6055 function StatelessComponent(Component) {}
6056 StatelessComponent.prototype.render = function () {
6057   var Component = ReactInstanceMap.get(this)._currentElement.type;
6058   var element = Component(this.props, this.context, this.updater);
6059   warnIfInvalidElement(Component, element);
6060   return element;
6063 function warnIfInvalidElement(Component, element) {
6064   if ("development" !== 'production') {
6065     "development" !== 'production' ? warning(element === null || element === false || ReactElement.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : void 0;
6066   }
6069 function invokeComponentDidMountWithTimer() {
6070   var publicInstance = this._instance;
6071   if (this._debugID !== 0) {
6072     ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidMount');
6073   }
6074   publicInstance.componentDidMount();
6075   if (this._debugID !== 0) {
6076     ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidMount');
6077   }
6080 function invokeComponentDidUpdateWithTimer(prevProps, prevState, prevContext) {
6081   var publicInstance = this._instance;
6082   if (this._debugID !== 0) {
6083     ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentDidUpdate');
6084   }
6085   publicInstance.componentDidUpdate(prevProps, prevState, prevContext);
6086   if (this._debugID !== 0) {
6087     ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentDidUpdate');
6088   }
6091 function shouldConstruct(Component) {
6092   return Component.prototype && Component.prototype.isReactComponent;
6096  * ------------------ The Life-Cycle of a Composite Component ------------------
6098  * - constructor: Initialization of state. The instance is now retained.
6099  *   - componentWillMount
6100  *   - render
6101  *   - [children's constructors]
6102  *     - [children's componentWillMount and render]
6103  *     - [children's componentDidMount]
6104  *     - componentDidMount
6106  *       Update Phases:
6107  *       - componentWillReceiveProps (only called if parent updated)
6108  *       - shouldComponentUpdate
6109  *         - componentWillUpdate
6110  *           - render
6111  *           - [children's constructors or receive props phases]
6112  *         - componentDidUpdate
6114  *     - componentWillUnmount
6115  *     - [children's componentWillUnmount]
6116  *   - [children destroyed]
6117  * - (destroyed): The instance is now blank, released by React and ready for GC.
6119  * -----------------------------------------------------------------------------
6120  */
6123  * An incrementing ID assigned to each component when it is mounted. This is
6124  * used to enforce the order in which `ReactUpdates` updates dirty components.
6126  * @private
6127  */
6128 var nextMountID = 1;
6131  * @lends {ReactCompositeComponent.prototype}
6132  */
6133 var ReactCompositeComponentMixin = {
6135   /**
6136    * Base constructor for all composite component.
6137    *
6138    * @param {ReactElement} element
6139    * @final
6140    * @internal
6141    */
6142   construct: function (element) {
6143     this._currentElement = element;
6144     this._rootNodeID = null;
6145     this._instance = null;
6146     this._nativeParent = null;
6147     this._nativeContainerInfo = null;
6149     // See ReactUpdateQueue
6150     this._updateBatchNumber = null;
6151     this._pendingElement = null;
6152     this._pendingStateQueue = null;
6153     this._pendingReplaceState = false;
6154     this._pendingForceUpdate = false;
6156     this._renderedNodeType = null;
6157     this._renderedComponent = null;
6158     this._context = null;
6159     this._mountOrder = 0;
6160     this._topLevelWrapper = null;
6162     // See ReactUpdates and ReactUpdateQueue.
6163     this._pendingCallbacks = null;
6165     // ComponentWillUnmount shall only be called once
6166     this._calledComponentWillUnmount = false;
6167   },
6169   /**
6170    * Initializes the component, renders markup, and registers event listeners.
6171    *
6172    * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
6173    * @param {?object} nativeParent
6174    * @param {?object} nativeContainerInfo
6175    * @param {?object} context
6176    * @return {?string} Rendered markup to be inserted into the DOM.
6177    * @final
6178    * @internal
6179    */
6180   mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
6181     this._context = context;
6182     this._mountOrder = nextMountID++;
6183     this._nativeParent = nativeParent;
6184     this._nativeContainerInfo = nativeContainerInfo;
6186     var publicProps = this._processProps(this._currentElement.props);
6187     var publicContext = this._processContext(context);
6189     var Component = this._currentElement.type;
6191     // Initialize the public class
6192     var inst = this._constructComponent(publicProps, publicContext);
6193     var renderedElement;
6195     // Support functional components
6196     if (!shouldConstruct(Component) && (inst == null || inst.render == null)) {
6197       renderedElement = inst;
6198       warnIfInvalidElement(Component, renderedElement);
6199       !(inst === null || inst === false || ReactElement.isValidElement(inst)) ? "development" !== 'production' ? invariant(false, '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : invariant(false) : void 0;
6200       inst = new StatelessComponent(Component);
6201     }
6203     if ("development" !== 'production') {
6204       // This will throw later in _renderValidatedComponent, but add an early
6205       // warning now to help debugging
6206       if (inst.render == null) {
6207         "development" !== 'production' ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component') : void 0;
6208       }
6210       var propsMutated = inst.props !== publicProps;
6211       var componentName = Component.displayName || Component.name || 'Component';
6213       "development" !== 'production' ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + 'up the same props that your component\'s constructor was passed.', componentName, componentName) : void 0;
6214     }
6216     // These should be set up in the constructor, but as a convenience for
6217     // simpler class abstractions, we set them up after the fact.
6218     inst.props = publicProps;
6219     inst.context = publicContext;
6220     inst.refs = emptyObject;
6221     inst.updater = ReactUpdateQueue;
6223     this._instance = inst;
6225     // Store a reference from the instance back to the internal representation
6226     ReactInstanceMap.set(inst, this);
6228     if ("development" !== 'production') {
6229       // Since plain JS classes are defined without any special initialization
6230       // logic, we can not catch common errors early. Therefore, we have to
6231       // catch them here, at initialization time, instead.
6232       "development" !== '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') : void 0;
6233       "development" !== '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') : void 0;
6234       "development" !== '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') : void 0;
6235       "development" !== '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') : void 0;
6236       "development" !== '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') : void 0;
6237       "development" !== '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') : void 0;
6238       "development" !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0;
6239     }
6241     var initialState = inst.state;
6242     if (initialState === undefined) {
6243       inst.state = initialState = null;
6244     }
6245     !(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
6247     this._pendingStateQueue = null;
6248     this._pendingReplaceState = false;
6249     this._pendingForceUpdate = false;
6251     var markup;
6252     if (inst.unstable_handleError) {
6253       markup = this.performInitialMountWithErrorHandling(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
6254     } else {
6255       markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
6256     }
6258     if (inst.componentDidMount) {
6259       if ("development" !== 'production') {
6260         transaction.getReactMountReady().enqueue(invokeComponentDidMountWithTimer, this);
6261       } else {
6262         transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
6263       }
6264     }
6266     return markup;
6267   },
6269   _constructComponent: function (publicProps, publicContext) {
6270     if ("development" !== 'production') {
6271       ReactCurrentOwner.current = this;
6272       try {
6273         return this._constructComponentWithoutOwner(publicProps, publicContext);
6274       } finally {
6275         ReactCurrentOwner.current = null;
6276       }
6277     } else {
6278       return this._constructComponentWithoutOwner(publicProps, publicContext);
6279     }
6280   },
6282   _constructComponentWithoutOwner: function (publicProps, publicContext) {
6283     var Component = this._currentElement.type;
6284     var instanceOrElement;
6285     if (shouldConstruct(Component)) {
6286       if ("development" !== 'production') {
6287         if (this._debugID !== 0) {
6288           ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'ctor');
6289         }
6290       }
6291       instanceOrElement = new Component(publicProps, publicContext, ReactUpdateQueue);
6292       if ("development" !== 'production') {
6293         if (this._debugID !== 0) {
6294           ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'ctor');
6295         }
6296       }
6297     } else {
6298       // This can still be an instance in case of factory components
6299       // but we'll count this as time spent rendering as the more common case.
6300       if ("development" !== 'production') {
6301         if (this._debugID !== 0) {
6302           ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');
6303         }
6304       }
6305       instanceOrElement = Component(publicProps, publicContext, ReactUpdateQueue);
6306       if ("development" !== 'production') {
6307         if (this._debugID !== 0) {
6308           ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
6309         }
6310       }
6311     }
6312     return instanceOrElement;
6313   },
6315   performInitialMountWithErrorHandling: function (renderedElement, nativeParent, nativeContainerInfo, transaction, context) {
6316     var markup;
6317     var checkpoint = transaction.checkpoint();
6318     try {
6319       markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
6320     } catch (e) {
6321       // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint
6322       transaction.rollback(checkpoint);
6323       this._instance.unstable_handleError(e);
6324       if (this._pendingStateQueue) {
6325         this._instance.state = this._processPendingState(this._instance.props, this._instance.context);
6326       }
6327       checkpoint = transaction.checkpoint();
6329       this._renderedComponent.unmountComponent(true);
6330       transaction.rollback(checkpoint);
6332       // Try again - we've informed the component about the error, so they can render an error message this time.
6333       // If this throws again, the error will bubble up (and can be caught by a higher error boundary).
6334       markup = this.performInitialMount(renderedElement, nativeParent, nativeContainerInfo, transaction, context);
6335     }
6336     return markup;
6337   },
6339   performInitialMount: function (renderedElement, nativeParent, nativeContainerInfo, transaction, context) {
6340     var inst = this._instance;
6341     if (inst.componentWillMount) {
6342       if ("development" !== 'production') {
6343         if (this._debugID !== 0) {
6344           ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillMount');
6345         }
6346       }
6347       inst.componentWillMount();
6348       if ("development" !== 'production') {
6349         if (this._debugID !== 0) {
6350           ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillMount');
6351         }
6352       }
6353       // When mounting, calls to `setState` by `componentWillMount` will set
6354       // `this._pendingStateQueue` without triggering a re-render.
6355       if (this._pendingStateQueue) {
6356         inst.state = this._processPendingState(inst.props, inst.context);
6357       }
6358     }
6360     // If not a stateless component, we now render
6361     if (renderedElement === undefined) {
6362       renderedElement = this._renderValidatedComponent();
6363     }
6365     this._renderedNodeType = ReactNodeTypes.getType(renderedElement);
6366     this._renderedComponent = this._instantiateReactComponent(renderedElement);
6368     var markup = ReactReconciler.mountComponent(this._renderedComponent, transaction, nativeParent, nativeContainerInfo, this._processChildContext(context));
6370     if ("development" !== 'production') {
6371       if (this._debugID !== 0) {
6372         ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []);
6373       }
6374     }
6376     return markup;
6377   },
6379   getNativeNode: function () {
6380     return ReactReconciler.getNativeNode(this._renderedComponent);
6381   },
6383   /**
6384    * Releases any resources allocated by `mountComponent`.
6385    *
6386    * @final
6387    * @internal
6388    */
6389   unmountComponent: function (safely) {
6390     if (!this._renderedComponent) {
6391       return;
6392     }
6393     var inst = this._instance;
6395     if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
6396       inst._calledComponentWillUnmount = true;
6397       if ("development" !== 'production') {
6398         if (this._debugID !== 0) {
6399           ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUnmount');
6400         }
6401       }
6402       if (safely) {
6403         var name = this.getName() + '.componentWillUnmount()';
6404         ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
6405       } else {
6406         inst.componentWillUnmount();
6407       }
6408       if ("development" !== 'production') {
6409         if (this._debugID !== 0) {
6410           ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUnmount');
6411         }
6412       }
6413     }
6415     if (this._renderedComponent) {
6416       ReactReconciler.unmountComponent(this._renderedComponent, safely);
6417       this._renderedNodeType = null;
6418       this._renderedComponent = null;
6419       this._instance = null;
6420     }
6422     // Reset pending fields
6423     // Even if this component is scheduled for another update in ReactUpdates,
6424     // it would still be ignored because these fields are reset.
6425     this._pendingStateQueue = null;
6426     this._pendingReplaceState = false;
6427     this._pendingForceUpdate = false;
6428     this._pendingCallbacks = null;
6429     this._pendingElement = null;
6431     // These fields do not really need to be reset since this object is no
6432     // longer accessible.
6433     this._context = null;
6434     this._rootNodeID = null;
6435     this._topLevelWrapper = null;
6437     // Delete the reference from the instance to this internal representation
6438     // which allow the internals to be properly cleaned up even if the user
6439     // leaks a reference to the public instance.
6440     ReactInstanceMap.remove(inst);
6442     // Some existing components rely on inst.props even after they've been
6443     // destroyed (in event handlers).
6444     // TODO: inst.props = null;
6445     // TODO: inst.state = null;
6446     // TODO: inst.context = null;
6447   },
6449   /**
6450    * Filters the context object to only contain keys specified in
6451    * `contextTypes`
6452    *
6453    * @param {object} context
6454    * @return {?object}
6455    * @private
6456    */
6457   _maskContext: function (context) {
6458     var Component = this._currentElement.type;
6459     var contextTypes = Component.contextTypes;
6460     if (!contextTypes) {
6461       return emptyObject;
6462     }
6463     var maskedContext = {};
6464     for (var contextName in contextTypes) {
6465       maskedContext[contextName] = context[contextName];
6466     }
6467     return maskedContext;
6468   },
6470   /**
6471    * Filters the context object to only contain keys specified in
6472    * `contextTypes`, and asserts that they are valid.
6473    *
6474    * @param {object} context
6475    * @return {?object}
6476    * @private
6477    */
6478   _processContext: function (context) {
6479     var maskedContext = this._maskContext(context);
6480     if ("development" !== 'production') {
6481       var Component = this._currentElement.type;
6482       if (Component.contextTypes) {
6483         this._checkPropTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);
6484       }
6485     }
6486     return maskedContext;
6487   },
6489   /**
6490    * @param {object} currentContext
6491    * @return {object}
6492    * @private
6493    */
6494   _processChildContext: function (currentContext) {
6495     var Component = this._currentElement.type;
6496     var inst = this._instance;
6497     if ("development" !== 'production') {
6498       ReactInstrumentation.debugTool.onBeginProcessingChildContext();
6499     }
6500     var childContext = inst.getChildContext && inst.getChildContext();
6501     if ("development" !== 'production') {
6502       ReactInstrumentation.debugTool.onEndProcessingChildContext();
6503     }
6504     if (childContext) {
6505       !(typeof Component.childContextTypes === 'object') ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
6506       if ("development" !== 'production') {
6507         this._checkPropTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);
6508       }
6509       for (var name in childContext) {
6510         !(name in Component.childContextTypes) ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : invariant(false) : void 0;
6511       }
6512       return _assign({}, currentContext, childContext);
6513     }
6514     return currentContext;
6515   },
6517   /**
6518    * Processes props by setting default values for unspecified props and
6519    * asserting that the props are valid. Does not mutate its argument; returns
6520    * a new props object with defaults merged in.
6521    *
6522    * @param {object} newProps
6523    * @return {object}
6524    * @private
6525    */
6526   _processProps: function (newProps) {
6527     if ("development" !== 'production') {
6528       var Component = this._currentElement.type;
6529       if (Component.propTypes) {
6530         this._checkPropTypes(Component.propTypes, newProps, ReactPropTypeLocations.prop);
6531       }
6532     }
6533     return newProps;
6534   },
6536   /**
6537    * Assert that the props are valid
6538    *
6539    * @param {object} propTypes Map of prop name to a ReactPropType
6540    * @param {object} props
6541    * @param {string} location e.g. "prop", "context", "child context"
6542    * @private
6543    */
6544   _checkPropTypes: function (propTypes, props, location) {
6545     // TODO: Stop validating prop types here and only use the element
6546     // validation.
6547     var componentName = this.getName();
6548     for (var propName in propTypes) {
6549       if (propTypes.hasOwnProperty(propName)) {
6550         var error;
6551         try {
6552           // This is intentionally an invariant that gets caught. It's the same
6553           // behavior as without this statement except with a better message.
6554           !(typeof propTypes[propName] === 'function') ? "development" !== '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) : void 0;
6555           error = propTypes[propName](props, propName, componentName, location);
6556         } catch (ex) {
6557           error = ex;
6558         }
6559         if (error instanceof Error) {
6560           // We may want to extend this logic for similar errors in
6561           // top-level render calls, so I'm abstracting it away into
6562           // a function to minimize refactoring in the future
6563           var addendum = getDeclarationErrorAddendum(this);
6565           if (location === ReactPropTypeLocations.prop) {
6566             // Preface gives us something to blacklist in warning module
6567             "development" !== 'production' ? warning(false, 'Failed Composite propType: %s%s', error.message, addendum) : void 0;
6568           } else {
6569             "development" !== 'production' ? warning(false, 'Failed Context Types: %s%s', error.message, addendum) : void 0;
6570           }
6571         }
6572       }
6573     }
6574   },
6576   receiveComponent: function (nextElement, transaction, nextContext) {
6577     var prevElement = this._currentElement;
6578     var prevContext = this._context;
6580     this._pendingElement = null;
6582     this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
6583   },
6585   /**
6586    * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
6587    * is set, update the component.
6588    *
6589    * @param {ReactReconcileTransaction} transaction
6590    * @internal
6591    */
6592   performUpdateIfNecessary: function (transaction) {
6593     if (this._pendingElement != null) {
6594       ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
6595     } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
6596       this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
6597     } else {
6598       this._updateBatchNumber = null;
6599     }
6600   },
6602   /**
6603    * Perform an update to a mounted component. The componentWillReceiveProps and
6604    * shouldComponentUpdate methods are called, then (assuming the update isn't
6605    * skipped) the remaining update lifecycle methods are called and the DOM
6606    * representation is updated.
6607    *
6608    * By default, this implements React's rendering and reconciliation algorithm.
6609    * Sophisticated clients may wish to override this.
6610    *
6611    * @param {ReactReconcileTransaction} transaction
6612    * @param {ReactElement} prevParentElement
6613    * @param {ReactElement} nextParentElement
6614    * @internal
6615    * @overridable
6616    */
6617   updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
6618     var inst = this._instance;
6619     var willReceive = false;
6620     var nextContext;
6621     var nextProps;
6623     // Determine if the context has changed or not
6624     if (this._context === nextUnmaskedContext) {
6625       nextContext = inst.context;
6626     } else {
6627       nextContext = this._processContext(nextUnmaskedContext);
6628       willReceive = true;
6629     }
6631     // Distinguish between a props update versus a simple state update
6632     if (prevParentElement === nextParentElement) {
6633       // Skip checking prop types again -- we don't read inst.props to avoid
6634       // warning for DOM component props in this upgrade
6635       nextProps = nextParentElement.props;
6636     } else {
6637       nextProps = this._processProps(nextParentElement.props);
6638       willReceive = true;
6639     }
6641     // An update here will schedule an update but immediately set
6642     // _pendingStateQueue which will ensure that any state updates gets
6643     // immediately reconciled instead of waiting for the next batch.
6644     if (willReceive && inst.componentWillReceiveProps) {
6645       if ("development" !== 'production') {
6646         if (this._debugID !== 0) {
6647           ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillReceiveProps');
6648         }
6649       }
6650       inst.componentWillReceiveProps(nextProps, nextContext);
6651       if ("development" !== 'production') {
6652         if (this._debugID !== 0) {
6653           ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillReceiveProps');
6654         }
6655       }
6656     }
6658     var nextState = this._processPendingState(nextProps, nextContext);
6659     var shouldUpdate = true;
6661     if (!this._pendingForceUpdate && inst.shouldComponentUpdate) {
6662       if ("development" !== 'production') {
6663         if (this._debugID !== 0) {
6664           ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'shouldComponentUpdate');
6665         }
6666       }
6667       shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
6668       if ("development" !== 'production') {
6669         if (this._debugID !== 0) {
6670           ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'shouldComponentUpdate');
6671         }
6672       }
6673     }
6675     if ("development" !== 'production') {
6676       "development" !== 'production' ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0;
6677     }
6679     this._updateBatchNumber = null;
6680     if (shouldUpdate) {
6681       this._pendingForceUpdate = false;
6682       // Will set `this.props`, `this.state` and `this.context`.
6683       this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
6684     } else {
6685       // If it's determined that a component should not update, we still want
6686       // to set props and state but we shortcut the rest of the update.
6687       this._currentElement = nextParentElement;
6688       this._context = nextUnmaskedContext;
6689       inst.props = nextProps;
6690       inst.state = nextState;
6691       inst.context = nextContext;
6692     }
6693   },
6695   _processPendingState: function (props, context) {
6696     var inst = this._instance;
6697     var queue = this._pendingStateQueue;
6698     var replace = this._pendingReplaceState;
6699     this._pendingReplaceState = false;
6700     this._pendingStateQueue = null;
6702     if (!queue) {
6703       return inst.state;
6704     }
6706     if (replace && queue.length === 1) {
6707       return queue[0];
6708     }
6710     var nextState = _assign({}, replace ? queue[0] : inst.state);
6711     for (var i = replace ? 1 : 0; i < queue.length; i++) {
6712       var partial = queue[i];
6713       _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
6714     }
6716     return nextState;
6717   },
6719   /**
6720    * Merges new props and state, notifies delegate methods of update and
6721    * performs update.
6722    *
6723    * @param {ReactElement} nextElement Next element
6724    * @param {object} nextProps Next public object to set as properties.
6725    * @param {?object} nextState Next object to set as state.
6726    * @param {?object} nextContext Next public object to set as context.
6727    * @param {ReactReconcileTransaction} transaction
6728    * @param {?object} unmaskedContext
6729    * @private
6730    */
6731   _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
6732     var inst = this._instance;
6734     var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
6735     var prevProps;
6736     var prevState;
6737     var prevContext;
6738     if (hasComponentDidUpdate) {
6739       prevProps = inst.props;
6740       prevState = inst.state;
6741       prevContext = inst.context;
6742     }
6744     if (inst.componentWillUpdate) {
6745       if ("development" !== 'production') {
6746         if (this._debugID !== 0) {
6747           ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'componentWillUpdate');
6748         }
6749       }
6750       inst.componentWillUpdate(nextProps, nextState, nextContext);
6751       if ("development" !== 'production') {
6752         if (this._debugID !== 0) {
6753           ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'componentWillUpdate');
6754         }
6755       }
6756     }
6758     this._currentElement = nextElement;
6759     this._context = unmaskedContext;
6760     inst.props = nextProps;
6761     inst.state = nextState;
6762     inst.context = nextContext;
6764     this._updateRenderedComponent(transaction, unmaskedContext);
6766     if (hasComponentDidUpdate) {
6767       if ("development" !== 'production') {
6768         transaction.getReactMountReady().enqueue(invokeComponentDidUpdateWithTimer.bind(this, prevProps, prevState, prevContext), this);
6769       } else {
6770         transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
6771       }
6772     }
6773   },
6775   /**
6776    * Call the component's `render` method and update the DOM accordingly.
6777    *
6778    * @param {ReactReconcileTransaction} transaction
6779    * @internal
6780    */
6781   _updateRenderedComponent: function (transaction, context) {
6782     var prevComponentInstance = this._renderedComponent;
6783     var prevRenderedElement = prevComponentInstance._currentElement;
6784     var nextRenderedElement = this._renderValidatedComponent();
6785     if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
6786       ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
6787     } else {
6788       var oldNativeNode = ReactReconciler.getNativeNode(prevComponentInstance);
6789       ReactReconciler.unmountComponent(prevComponentInstance, false);
6791       this._renderedNodeType = ReactNodeTypes.getType(nextRenderedElement);
6792       this._renderedComponent = this._instantiateReactComponent(nextRenderedElement);
6794       var nextMarkup = ReactReconciler.mountComponent(this._renderedComponent, transaction, this._nativeParent, this._nativeContainerInfo, this._processChildContext(context));
6796       if ("development" !== 'production') {
6797         if (this._debugID !== 0) {
6798           ReactInstrumentation.debugTool.onSetChildren(this._debugID, this._renderedComponent._debugID !== 0 ? [this._renderedComponent._debugID] : []);
6799         }
6800       }
6802       this._replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevComponentInstance);
6803     }
6804   },
6806   /**
6807    * Overridden in shallow rendering.
6808    *
6809    * @protected
6810    */
6811   _replaceNodeWithMarkup: function (oldNativeNode, nextMarkup, prevInstance) {
6812     ReactComponentEnvironment.replaceNodeWithMarkup(oldNativeNode, nextMarkup, prevInstance);
6813   },
6815   /**
6816    * @protected
6817    */
6818   _renderValidatedComponentWithoutOwnerOrContext: function () {
6819     var inst = this._instance;
6821     if ("development" !== 'production') {
6822       if (this._debugID !== 0) {
6823         ReactInstrumentation.debugTool.onBeginLifeCycleTimer(this._debugID, 'render');
6824       }
6825     }
6826     var renderedComponent = inst.render();
6827     if ("development" !== 'production') {
6828       if (this._debugID !== 0) {
6829         ReactInstrumentation.debugTool.onEndLifeCycleTimer(this._debugID, 'render');
6830       }
6831     }
6833     if ("development" !== 'production') {
6834       // We allow auto-mocks to proceed as if they're returning null.
6835       if (renderedComponent === undefined && inst.render._isMockFunction) {
6836         // This is probably bad practice. Consider warning here and
6837         // deprecating this convenience.
6838         renderedComponent = null;
6839       }
6840     }
6842     return renderedComponent;
6843   },
6845   /**
6846    * @private
6847    */
6848   _renderValidatedComponent: function () {
6849     var renderedComponent;
6850     ReactCurrentOwner.current = this;
6851     try {
6852       renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
6853     } finally {
6854       ReactCurrentOwner.current = null;
6855     }
6856     !(
6857     // TODO: An `isValidNode` function would probably be more appropriate
6858     renderedComponent === null || renderedComponent === false || ReactElement.isValidElement(renderedComponent)) ? "development" !== 'production' ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : invariant(false) : void 0;
6860     return renderedComponent;
6861   },
6863   /**
6864    * Lazily allocates the refs object and stores `component` as `ref`.
6865    *
6866    * @param {string} ref Reference name.
6867    * @param {component} component Component to store as `ref`.
6868    * @final
6869    * @private
6870    */
6871   attachRef: function (ref, component) {
6872     var inst = this.getPublicInstance();
6873     !(inst != null) ? "development" !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : invariant(false) : void 0;
6874     var publicComponentInstance = component.getPublicInstance();
6875     if ("development" !== 'production') {
6876       var componentName = component && component.getName ? component.getName() : 'a component';
6877       "development" !== '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()) : void 0;
6878     }
6879     var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
6880     refs[ref] = publicComponentInstance;
6881   },
6883   /**
6884    * Detaches a reference name.
6885    *
6886    * @param {string} ref Name to dereference.
6887    * @final
6888    * @private
6889    */
6890   detachRef: function (ref) {
6891     var refs = this.getPublicInstance().refs;
6892     delete refs[ref];
6893   },
6895   /**
6896    * Get a text description of the component that can be used to identify it
6897    * in error messages.
6898    * @return {string} The name or null.
6899    * @internal
6900    */
6901   getName: function () {
6902     var type = this._currentElement.type;
6903     var constructor = this._instance && this._instance.constructor;
6904     return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
6905   },
6907   /**
6908    * Get the publicly accessible representation of this component - i.e. what
6909    * is exposed by refs and returned by render. Can be null for stateless
6910    * components.
6911    *
6912    * @return {ReactComponent} the public component instance.
6913    * @internal
6914    */
6915   getPublicInstance: function () {
6916     var inst = this._instance;
6917     if (inst instanceof StatelessComponent) {
6918       return null;
6919     }
6920     return inst;
6921   },
6923   // Stub
6924   _instantiateReactComponent: null
6928 var ReactCompositeComponent = {
6930   Mixin: ReactCompositeComponentMixin
6934 module.exports = ReactCompositeComponent;
6935 },{"103":103,"153":153,"166":166,"173":173,"183":183,"184":184,"36":36,"40":40,"65":65,"68":68,"75":75,"76":76,"85":85,"89":89,"90":90,"93":93}],40:[function(_dereq_,module,exports){
6937  * Copyright 2013-present, Facebook, Inc.
6938  * All rights reserved.
6940  * This source code is licensed under the BSD-style license found in the
6941  * LICENSE file in the root directory of this source tree. An additional grant
6942  * of patent rights can be found in the PATENTS file in the same directory.
6944  * @providesModule ReactCurrentOwner
6945  */
6947 'use strict';
6950  * Keeps track of the current owner.
6952  * The current owner is the component who should own any components that are
6953  * currently being constructed.
6954  */
6956 var ReactCurrentOwner = {
6958   /**
6959    * @internal
6960    * @type {ReactComponent}
6961    */
6962   current: null
6966 module.exports = ReactCurrentOwner;
6967 },{}],41:[function(_dereq_,module,exports){
6969  * Copyright 2013-present, Facebook, Inc.
6970  * All rights reserved.
6972  * This source code is licensed under the BSD-style license found in the
6973  * LICENSE file in the root directory of this source tree. An additional grant
6974  * of patent rights can be found in the PATENTS file in the same directory.
6976  * @providesModule ReactDOM
6977  */
6979 /* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
6981 'use strict';
6983 var ReactDOMComponentTree = _dereq_(45);
6984 var ReactDefaultInjection = _dereq_(64);
6985 var ReactMount = _dereq_(80);
6986 var ReactReconciler = _dereq_(93);
6987 var ReactUpdates = _dereq_(104);
6988 var ReactVersion = _dereq_(105);
6990 var findDOMNode = _dereq_(132);
6991 var getNativeComponentFromComposite = _dereq_(140);
6992 var renderSubtreeIntoContainer = _dereq_(149);
6993 var warning = _dereq_(183);
6995 ReactDefaultInjection.inject();
6997 var React = {
6998   findDOMNode: findDOMNode,
6999   render: ReactMount.render,
7000   unmountComponentAtNode: ReactMount.unmountComponentAtNode,
7001   version: ReactVersion,
7003   /* eslint-disable camelcase */
7004   unstable_batchedUpdates: ReactUpdates.batchedUpdates,
7005   unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
7008 // Inject the runtime into a devtools global hook regardless of browser.
7009 // Allows for debugging when the hook is injected on the page.
7010 /* eslint-enable camelcase */
7011 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
7012   __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
7013     ComponentTree: {
7014       getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
7015       getNodeFromInstance: function (inst) {
7016         // inst is an internal instance (but could be a composite)
7017         if (inst._renderedComponent) {
7018           inst = getNativeComponentFromComposite(inst);
7019         }
7020         if (inst) {
7021           return ReactDOMComponentTree.getNodeFromInstance(inst);
7022         } else {
7023           return null;
7024         }
7025       }
7026     },
7027     Mount: ReactMount,
7028     Reconciler: ReactReconciler
7029   });
7032 if ("development" !== 'production') {
7033   var ExecutionEnvironment = _dereq_(159);
7034   if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
7036     // First check if devtools is not installed
7037     if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
7038       // If we're in Chrome or Firefox, provide a download link if not installed.
7039       if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
7040         // Firefox does not have the issue with devtools loaded over file://
7041         var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
7042         console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools');
7043       }
7044     }
7046     var testFunc = function testFn() {};
7047     "development" !== 'production' ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, 'It looks like you\'re using a minified copy of the development build ' + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0;
7049     // If we're in IE8, check to see if we are in compatibility mode and provide
7050     // information on preventing compatibility mode
7051     var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
7053     "development" !== '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" />') : void 0;
7055     var expectedFeatures = [
7056     // shims
7057     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];
7059     for (var i = 0; i < expectedFeatures.length; i++) {
7060       if (!expectedFeatures[i]) {
7061         "development" !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0;
7062         break;
7063       }
7064     }
7065   }
7068 module.exports = React;
7069 },{"104":104,"105":105,"132":132,"140":140,"149":149,"159":159,"183":183,"45":45,"64":64,"80":80,"93":93}],42:[function(_dereq_,module,exports){
7071  * Copyright 2013-present, Facebook, Inc.
7072  * All rights reserved.
7074  * This source code is licensed under the BSD-style license found in the
7075  * LICENSE file in the root directory of this source tree. An additional grant
7076  * of patent rights can be found in the PATENTS file in the same directory.
7078  * @providesModule ReactDOMButton
7079  */
7081 'use strict';
7083 var DisabledInputUtils = _dereq_(14);
7086  * Implements a <button> native component that does not receive mouse events
7087  * when `disabled` is set.
7088  */
7089 var ReactDOMButton = {
7090   getNativeProps: DisabledInputUtils.getNativeProps
7093 module.exports = ReactDOMButton;
7094 },{"14":14}],43:[function(_dereq_,module,exports){
7096  * Copyright 2013-present, Facebook, Inc.
7097  * All rights reserved.
7099  * This source code is licensed under the BSD-style license found in the
7100  * LICENSE file in the root directory of this source tree. An additional grant
7101  * of patent rights can be found in the PATENTS file in the same directory.
7103  * @providesModule ReactDOMComponent
7104  */
7106 /* global hasOwnProperty:true */
7108 'use strict';
7110 var _assign = _dereq_(184);
7112 var AutoFocusUtils = _dereq_(1);
7113 var CSSPropertyOperations = _dereq_(4);
7114 var DOMLazyTree = _dereq_(8);
7115 var DOMNamespaces = _dereq_(9);
7116 var DOMProperty = _dereq_(10);
7117 var DOMPropertyOperations = _dereq_(11);
7118 var EventConstants = _dereq_(16);
7119 var EventPluginHub = _dereq_(17);
7120 var EventPluginRegistry = _dereq_(18);
7121 var ReactBrowserEventEmitter = _dereq_(28);
7122 var ReactComponentBrowserEnvironment = _dereq_(35);
7123 var ReactDOMButton = _dereq_(42);
7124 var ReactDOMComponentFlags = _dereq_(44);
7125 var ReactDOMComponentTree = _dereq_(45);
7126 var ReactDOMInput = _dereq_(52);
7127 var ReactDOMOption = _dereq_(54);
7128 var ReactDOMSelect = _dereq_(55);
7129 var ReactDOMTextarea = _dereq_(59);
7130 var ReactInstrumentation = _dereq_(76);
7131 var ReactMultiChild = _dereq_(81);
7132 var ReactServerRenderingTransaction = _dereq_(97);
7134 var emptyFunction = _dereq_(165);
7135 var escapeTextContentForBrowser = _dereq_(131);
7136 var invariant = _dereq_(173);
7137 var isEventSupported = _dereq_(145);
7138 var keyOf = _dereq_(177);
7139 var shallowEqual = _dereq_(182);
7140 var validateDOMNesting = _dereq_(156);
7141 var warning = _dereq_(183);
7143 var Flags = ReactDOMComponentFlags;
7144 var deleteListener = EventPluginHub.deleteListener;
7145 var getNode = ReactDOMComponentTree.getNodeFromInstance;
7146 var listenTo = ReactBrowserEventEmitter.listenTo;
7147 var registrationNameModules = EventPluginRegistry.registrationNameModules;
7149 // For quickly matching children type, to test if can be treated as content.
7150 var CONTENT_TYPES = { 'string': true, 'number': true };
7152 var STYLE = keyOf({ style: null });
7153 var HTML = keyOf({ __html: null });
7154 var RESERVED_PROPS = {
7155   children: null,
7156   dangerouslySetInnerHTML: null,
7157   suppressContentEditableWarning: null
7160 // Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
7161 var DOC_FRAGMENT_TYPE = 11;
7163 function getDeclarationErrorAddendum(internalInstance) {
7164   if (internalInstance) {
7165     var owner = internalInstance._currentElement._owner || null;
7166     if (owner) {
7167       var name = owner.getName();
7168       if (name) {
7169         return ' This DOM node was rendered by `' + name + '`.';
7170       }
7171     }
7172   }
7173   return '';
7176 function friendlyStringify(obj) {
7177   if (typeof obj === 'object') {
7178     if (Array.isArray(obj)) {
7179       return '[' + obj.map(friendlyStringify).join(', ') + ']';
7180     } else {
7181       var pairs = [];
7182       for (var key in obj) {
7183         if (Object.prototype.hasOwnProperty.call(obj, key)) {
7184           var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
7185           pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
7186         }
7187       }
7188       return '{' + pairs.join(', ') + '}';
7189     }
7190   } else if (typeof obj === 'string') {
7191     return JSON.stringify(obj);
7192   } else if (typeof obj === 'function') {
7193     return '[function object]';
7194   }
7195   // Differs from JSON.stringify in that undefined because undefined and that
7196   // inf and nan don't become null
7197   return String(obj);
7200 var styleMutationWarning = {};
7202 function checkAndWarnForMutatedStyle(style1, style2, component) {
7203   if (style1 == null || style2 == null) {
7204     return;
7205   }
7206   if (shallowEqual(style1, style2)) {
7207     return;
7208   }
7210   var componentName = component._tag;
7211   var owner = component._currentElement._owner;
7212   var ownerName;
7213   if (owner) {
7214     ownerName = owner.getName();
7215   }
7217   var hash = ownerName + '|' + componentName;
7219   if (styleMutationWarning.hasOwnProperty(hash)) {
7220     return;
7221   }
7223   styleMutationWarning[hash] = true;
7225   "development" !== '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)) : void 0;
7229  * @param {object} component
7230  * @param {?object} props
7231  */
7232 function assertValidProps(component, props) {
7233   if (!props) {
7234     return;
7235   }
7236   // Note the use of `==` which checks for null or undefined.
7237   if (voidElementTags[component._tag]) {
7238     !(props.children == null && props.dangerouslySetInnerHTML == null) ? "development" !== 'production' ? invariant(false, '%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() + '.' : '') : invariant(false) : void 0;
7239   }
7240   if (props.dangerouslySetInnerHTML != null) {
7241     !(props.children == null) ? "development" !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : invariant(false) : void 0;
7242     !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? "development" !== '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) : void 0;
7243   }
7244   if ("development" !== 'production') {
7245     "development" !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
7246     "development" !== 'production' ? warning(props.suppressContentEditableWarning || !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.') : void 0;
7247     "development" !== 'production' ? warning(props.onFocusIn == null && props.onFocusOut == null, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.') : void 0;
7248   }
7249   !(props.style == null || typeof props.style === 'object') ? "development" !== '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) : void 0;
7252 function enqueuePutListener(inst, registrationName, listener, transaction) {
7253   if (transaction instanceof ReactServerRenderingTransaction) {
7254     return;
7255   }
7256   if ("development" !== 'production') {
7257     // IE8 has no API for event capturing and the `onScroll` event doesn't
7258     // bubble.
7259     "development" !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0;
7260   }
7261   var containerInfo = inst._nativeContainerInfo;
7262   var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
7263   var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
7264   listenTo(registrationName, doc);
7265   transaction.getReactMountReady().enqueue(putListener, {
7266     inst: inst,
7267     registrationName: registrationName,
7268     listener: listener
7269   });
7272 function putListener() {
7273   var listenerToPut = this;
7274   EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
7277 function optionPostMount() {
7278   var inst = this;
7279   ReactDOMOption.postMountWrapper(inst);
7282 var setContentChildForInstrumentation = emptyFunction;
7283 if ("development" !== 'production') {
7284   setContentChildForInstrumentation = function (contentToUse) {
7285     var debugID = this._debugID;
7286     var contentDebugID = debugID + '#text';
7287     this._contentDebugID = contentDebugID;
7288     ReactInstrumentation.debugTool.onSetDisplayName(contentDebugID, '#text');
7289     ReactInstrumentation.debugTool.onSetText(contentDebugID, '' + contentToUse);
7290     ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
7291     ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
7292   };
7295 // There are so many media events, it makes sense to just
7296 // maintain a list rather than create a `trapBubbledEvent` for each
7297 var mediaEvents = {
7298   topAbort: 'abort',
7299   topCanPlay: 'canplay',
7300   topCanPlayThrough: 'canplaythrough',
7301   topDurationChange: 'durationchange',
7302   topEmptied: 'emptied',
7303   topEncrypted: 'encrypted',
7304   topEnded: 'ended',
7305   topError: 'error',
7306   topLoadedData: 'loadeddata',
7307   topLoadedMetadata: 'loadedmetadata',
7308   topLoadStart: 'loadstart',
7309   topPause: 'pause',
7310   topPlay: 'play',
7311   topPlaying: 'playing',
7312   topProgress: 'progress',
7313   topRateChange: 'ratechange',
7314   topSeeked: 'seeked',
7315   topSeeking: 'seeking',
7316   topStalled: 'stalled',
7317   topSuspend: 'suspend',
7318   topTimeUpdate: 'timeupdate',
7319   topVolumeChange: 'volumechange',
7320   topWaiting: 'waiting'
7323 function trapBubbledEventsLocal() {
7324   var inst = this;
7325   // If a component renders to null or if another component fatals and causes
7326   // the state of the tree to be corrupted, `node` here can be null.
7327   !inst._rootNodeID ? "development" !== 'production' ? invariant(false, 'Must be mounted to trap events') : invariant(false) : void 0;
7328   var node = getNode(inst);
7329   !node ? "development" !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : invariant(false) : void 0;
7331   switch (inst._tag) {
7332     case 'iframe':
7333     case 'object':
7334       inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
7335       break;
7336     case 'video':
7337     case 'audio':
7339       inst._wrapperState.listeners = [];
7340       // Create listener for each media event
7341       for (var event in mediaEvents) {
7342         if (mediaEvents.hasOwnProperty(event)) {
7343           inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
7344         }
7345       }
7347       break;
7348     case 'img':
7349       inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
7350       break;
7351     case 'form':
7352       inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
7353       break;
7354     case 'input':
7355     case 'select':
7356     case 'textarea':
7357       inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topInvalid, 'invalid', node)];
7358       break;
7359   }
7362 function postUpdateSelectWrapper() {
7363   ReactDOMSelect.postUpdateWrapper(this);
7366 // For HTML, certain tags should omit their close tag. We keep a whitelist for
7367 // those special-case tags.
7369 var omittedCloseTags = {
7370   'area': true,
7371   'base': true,
7372   'br': true,
7373   'col': true,
7374   'embed': true,
7375   'hr': true,
7376   'img': true,
7377   'input': true,
7378   'keygen': true,
7379   'link': true,
7380   'meta': true,
7381   'param': true,
7382   'source': true,
7383   'track': true,
7384   'wbr': true
7387 // NOTE: menuitem's close tag should be omitted, but that causes problems.
7388 var newlineEatingTags = {
7389   'listing': true,
7390   'pre': true,
7391   'textarea': true
7394 // For HTML, certain tags cannot have children. This has the same purpose as
7395 // `omittedCloseTags` except that `menuitem` should still have its closing tag.
7397 var voidElementTags = _assign({
7398   'menuitem': true
7399 }, omittedCloseTags);
7401 // We accept any tag to be rendered but since this gets injected into arbitrary
7402 // HTML, we want to make sure that it's a safe tag.
7403 // http://www.w3.org/TR/REC-xml/#NT-Name
7405 var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
7406 var validatedTagCache = {};
7407 var hasOwnProperty = {}.hasOwnProperty;
7409 function validateDangerousTag(tag) {
7410   if (!hasOwnProperty.call(validatedTagCache, tag)) {
7411     !VALID_TAG_REGEX.test(tag) ? "development" !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : invariant(false) : void 0;
7412     validatedTagCache[tag] = true;
7413   }
7416 function isCustomComponent(tagName, props) {
7417   return tagName.indexOf('-') >= 0 || props.is != null;
7420 var globalIdCounter = 1;
7423  * Creates a new React class that is idempotent and capable of containing other
7424  * React components. It accepts event listeners and DOM properties that are
7425  * valid according to `DOMProperty`.
7427  *  - Event listeners: `onClick`, `onMouseDown`, etc.
7428  *  - DOM properties: `className`, `name`, `title`, etc.
7430  * The `style` property functions differently from the DOM API. It accepts an
7431  * object mapping of style properties to values.
7433  * @constructor ReactDOMComponent
7434  * @extends ReactMultiChild
7435  */
7436 function ReactDOMComponent(element) {
7437   var tag = element.type;
7438   validateDangerousTag(tag);
7439   this._currentElement = element;
7440   this._tag = tag.toLowerCase();
7441   this._namespaceURI = null;
7442   this._renderedChildren = null;
7443   this._previousStyle = null;
7444   this._previousStyleCopy = null;
7445   this._nativeNode = null;
7446   this._nativeParent = null;
7447   this._rootNodeID = null;
7448   this._domID = null;
7449   this._nativeContainerInfo = null;
7450   this._wrapperState = null;
7451   this._topLevelWrapper = null;
7452   this._flags = 0;
7453   if ("development" !== 'production') {
7454     this._ancestorInfo = null;
7455     this._contentDebugID = null;
7456   }
7459 ReactDOMComponent.displayName = 'ReactDOMComponent';
7461 ReactDOMComponent.Mixin = {
7463   /**
7464    * Generates root tag markup then recurses. This method has side effects and
7465    * is not idempotent.
7466    *
7467    * @internal
7468    * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7469    * @param {?ReactDOMComponent} the containing DOM component instance
7470    * @param {?object} info about the native container
7471    * @param {object} context
7472    * @return {string} The computed markup.
7473    */
7474   mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
7475     this._rootNodeID = globalIdCounter++;
7476     this._domID = nativeContainerInfo._idCounter++;
7477     this._nativeParent = nativeParent;
7478     this._nativeContainerInfo = nativeContainerInfo;
7480     var props = this._currentElement.props;
7482     switch (this._tag) {
7483       case 'iframe':
7484       case 'object':
7485       case 'img':
7486       case 'form':
7487       case 'video':
7488       case 'audio':
7489         this._wrapperState = {
7490           listeners: null
7491         };
7492         transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7493         break;
7494       case 'button':
7495         props = ReactDOMButton.getNativeProps(this, props, nativeParent);
7496         break;
7497       case 'input':
7498         ReactDOMInput.mountWrapper(this, props, nativeParent);
7499         props = ReactDOMInput.getNativeProps(this, props);
7500         transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7501         break;
7502       case 'option':
7503         ReactDOMOption.mountWrapper(this, props, nativeParent);
7504         props = ReactDOMOption.getNativeProps(this, props);
7505         break;
7506       case 'select':
7507         ReactDOMSelect.mountWrapper(this, props, nativeParent);
7508         props = ReactDOMSelect.getNativeProps(this, props);
7509         transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7510         break;
7511       case 'textarea':
7512         ReactDOMTextarea.mountWrapper(this, props, nativeParent);
7513         props = ReactDOMTextarea.getNativeProps(this, props);
7514         transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7515         break;
7516     }
7518     assertValidProps(this, props);
7520     // We create tags in the namespace of their parent container, except HTML
7521     // tags get no namespace.
7522     var namespaceURI;
7523     var parentTag;
7524     if (nativeParent != null) {
7525       namespaceURI = nativeParent._namespaceURI;
7526       parentTag = nativeParent._tag;
7527     } else if (nativeContainerInfo._tag) {
7528       namespaceURI = nativeContainerInfo._namespaceURI;
7529       parentTag = nativeContainerInfo._tag;
7530     }
7531     if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
7532       namespaceURI = DOMNamespaces.html;
7533     }
7534     if (namespaceURI === DOMNamespaces.html) {
7535       if (this._tag === 'svg') {
7536         namespaceURI = DOMNamespaces.svg;
7537       } else if (this._tag === 'math') {
7538         namespaceURI = DOMNamespaces.mathml;
7539       }
7540     }
7541     this._namespaceURI = namespaceURI;
7543     if ("development" !== 'production') {
7544       var parentInfo;
7545       if (nativeParent != null) {
7546         parentInfo = nativeParent._ancestorInfo;
7547       } else if (nativeContainerInfo._tag) {
7548         parentInfo = nativeContainerInfo._ancestorInfo;
7549       }
7550       if (parentInfo) {
7551         // parentInfo should always be present except for the top-level
7552         // component when server rendering
7553         validateDOMNesting(this._tag, this, parentInfo);
7554       }
7555       this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
7556     }
7558     var mountImage;
7559     if (transaction.useCreateElement) {
7560       var ownerDocument = nativeContainerInfo._ownerDocument;
7561       var el;
7562       if (namespaceURI === DOMNamespaces.html) {
7563         if (this._tag === 'script') {
7564           // Create the script via .innerHTML so its "parser-inserted" flag is
7565           // set to true and it does not execute
7566           var div = ownerDocument.createElement('div');
7567           var type = this._currentElement.type;
7568           div.innerHTML = '<' + type + '></' + type + '>';
7569           el = div.removeChild(div.firstChild);
7570         } else {
7571           el = ownerDocument.createElement(this._currentElement.type, props.is || null);
7572         }
7573       } else {
7574         el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
7575       }
7576       ReactDOMComponentTree.precacheNode(this, el);
7577       this._flags |= Flags.hasCachedChildNodes;
7578       if (!this._nativeParent) {
7579         DOMPropertyOperations.setAttributeForRoot(el);
7580       }
7581       this._updateDOMProperties(null, props, transaction);
7582       var lazyTree = DOMLazyTree(el);
7583       this._createInitialChildren(transaction, props, context, lazyTree);
7584       mountImage = lazyTree;
7585     } else {
7586       var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
7587       var tagContent = this._createContentMarkup(transaction, props, context);
7588       if (!tagContent && omittedCloseTags[this._tag]) {
7589         mountImage = tagOpen + '/>';
7590       } else {
7591         mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
7592       }
7593     }
7595     switch (this._tag) {
7596       case 'button':
7597       case 'input':
7598       case 'select':
7599       case 'textarea':
7600         if (props.autoFocus) {
7601           transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
7602         }
7603         break;
7604       case 'option':
7605         transaction.getReactMountReady().enqueue(optionPostMount, this);
7606     }
7608     return mountImage;
7609   },
7611   /**
7612    * Creates markup for the open tag and all attributes.
7613    *
7614    * This method has side effects because events get registered.
7615    *
7616    * Iterating over object properties is faster than iterating over arrays.
7617    * @see http://jsperf.com/obj-vs-arr-iteration
7618    *
7619    * @private
7620    * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7621    * @param {object} props
7622    * @return {string} Markup of opening tag.
7623    */
7624   _createOpenTagMarkupAndPutListeners: function (transaction, props) {
7625     var ret = '<' + this._currentElement.type;
7627     for (var propKey in props) {
7628       if (!props.hasOwnProperty(propKey)) {
7629         continue;
7630       }
7631       var propValue = props[propKey];
7632       if (propValue == null) {
7633         continue;
7634       }
7635       if (registrationNameModules.hasOwnProperty(propKey)) {
7636         if (propValue) {
7637           enqueuePutListener(this, propKey, propValue, transaction);
7638         }
7639       } else {
7640         if (propKey === STYLE) {
7641           if (propValue) {
7642             if ("development" !== 'production') {
7643               // See `_updateDOMProperties`. style block
7644               this._previousStyle = propValue;
7645             }
7646             propValue = this._previousStyleCopy = _assign({}, props.style);
7647           }
7648           propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
7649         }
7650         var markup = null;
7651         if (this._tag != null && isCustomComponent(this._tag, props)) {
7652           if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
7653             markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
7654           }
7655         } else {
7656           markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
7657         }
7658         if (markup) {
7659           ret += ' ' + markup;
7660         }
7661       }
7662     }
7664     // For static pages, no need to put React ID and checksum. Saves lots of
7665     // bytes.
7666     if (transaction.renderToStaticMarkup) {
7667       return ret;
7668     }
7670     if (!this._nativeParent) {
7671       ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
7672     }
7673     ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
7674     return ret;
7675   },
7677   /**
7678    * Creates markup for the content between the tags.
7679    *
7680    * @private
7681    * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7682    * @param {object} props
7683    * @param {object} context
7684    * @return {string} Content markup.
7685    */
7686   _createContentMarkup: function (transaction, props, context) {
7687     var ret = '';
7689     // Intentional use of != to avoid catching zero/false.
7690     var innerHTML = props.dangerouslySetInnerHTML;
7691     if (innerHTML != null) {
7692       if (innerHTML.__html != null) {
7693         ret = innerHTML.__html;
7694       }
7695     } else {
7696       var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
7697       var childrenToUse = contentToUse != null ? null : props.children;
7698       if (contentToUse != null) {
7699         // TODO: Validate that text is allowed as a child of this node
7700         ret = escapeTextContentForBrowser(contentToUse);
7701         if ("development" !== 'production') {
7702           setContentChildForInstrumentation.call(this, contentToUse);
7703         }
7704       } else if (childrenToUse != null) {
7705         var mountImages = this.mountChildren(childrenToUse, transaction, context);
7706         ret = mountImages.join('');
7707       }
7708     }
7709     if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
7710       // text/html ignores the first character in these tags if it's a newline
7711       // Prefer to break application/xml over text/html (for now) by adding
7712       // a newline specifically to get eaten by the parser. (Alternately for
7713       // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
7714       // \r is normalized out by HTMLTextAreaElement#value.)
7715       // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
7716       // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
7717       // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
7718       // See: Parsing of "textarea" "listing" and "pre" elements
7719       //  from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
7720       return '\n' + ret;
7721     } else {
7722       return ret;
7723     }
7724   },
7726   _createInitialChildren: function (transaction, props, context, lazyTree) {
7727     // Intentional use of != to avoid catching zero/false.
7728     var innerHTML = props.dangerouslySetInnerHTML;
7729     if (innerHTML != null) {
7730       if (innerHTML.__html != null) {
7731         DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
7732       }
7733     } else {
7734       var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
7735       var childrenToUse = contentToUse != null ? null : props.children;
7736       if (contentToUse != null) {
7737         // TODO: Validate that text is allowed as a child of this node
7738         if ("development" !== 'production') {
7739           setContentChildForInstrumentation.call(this, contentToUse);
7740         }
7741         DOMLazyTree.queueText(lazyTree, contentToUse);
7742       } else if (childrenToUse != null) {
7743         var mountImages = this.mountChildren(childrenToUse, transaction, context);
7744         for (var i = 0; i < mountImages.length; i++) {
7745           DOMLazyTree.queueChild(lazyTree, mountImages[i]);
7746         }
7747       }
7748     }
7749   },
7751   /**
7752    * Receives a next element and updates the component.
7753    *
7754    * @internal
7755    * @param {ReactElement} nextElement
7756    * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7757    * @param {object} context
7758    */
7759   receiveComponent: function (nextElement, transaction, context) {
7760     var prevElement = this._currentElement;
7761     this._currentElement = nextElement;
7762     this.updateComponent(transaction, prevElement, nextElement, context);
7763   },
7765   /**
7766    * Updates a native DOM component after it has already been allocated and
7767    * attached to the DOM. Reconciles the root DOM node, then recurses.
7768    *
7769    * @param {ReactReconcileTransaction} transaction
7770    * @param {ReactElement} prevElement
7771    * @param {ReactElement} nextElement
7772    * @internal
7773    * @overridable
7774    */
7775   updateComponent: function (transaction, prevElement, nextElement, context) {
7776     var lastProps = prevElement.props;
7777     var nextProps = this._currentElement.props;
7779     switch (this._tag) {
7780       case 'button':
7781         lastProps = ReactDOMButton.getNativeProps(this, lastProps);
7782         nextProps = ReactDOMButton.getNativeProps(this, nextProps);
7783         break;
7784       case 'input':
7785         ReactDOMInput.updateWrapper(this);
7786         lastProps = ReactDOMInput.getNativeProps(this, lastProps);
7787         nextProps = ReactDOMInput.getNativeProps(this, nextProps);
7788         break;
7789       case 'option':
7790         lastProps = ReactDOMOption.getNativeProps(this, lastProps);
7791         nextProps = ReactDOMOption.getNativeProps(this, nextProps);
7792         break;
7793       case 'select':
7794         lastProps = ReactDOMSelect.getNativeProps(this, lastProps);
7795         nextProps = ReactDOMSelect.getNativeProps(this, nextProps);
7796         break;
7797       case 'textarea':
7798         ReactDOMTextarea.updateWrapper(this);
7799         lastProps = ReactDOMTextarea.getNativeProps(this, lastProps);
7800         nextProps = ReactDOMTextarea.getNativeProps(this, nextProps);
7801         break;
7802     }
7804     assertValidProps(this, nextProps);
7805     this._updateDOMProperties(lastProps, nextProps, transaction);
7806     this._updateDOMChildren(lastProps, nextProps, transaction, context);
7808     if (this._tag === 'select') {
7809       // <select> value update needs to occur after <option> children
7810       // reconciliation
7811       transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
7812     }
7813   },
7815   /**
7816    * Reconciles the properties by detecting differences in property values and
7817    * updating the DOM as necessary. This function is probably the single most
7818    * critical path for performance optimization.
7819    *
7820    * TODO: Benchmark whether checking for changed values in memory actually
7821    *       improves performance (especially statically positioned elements).
7822    * TODO: Benchmark the effects of putting this at the top since 99% of props
7823    *       do not change for a given reconciliation.
7824    * TODO: Benchmark areas that can be improved with caching.
7825    *
7826    * @private
7827    * @param {object} lastProps
7828    * @param {object} nextProps
7829    * @param {?DOMElement} node
7830    */
7831   _updateDOMProperties: function (lastProps, nextProps, transaction) {
7832     var propKey;
7833     var styleName;
7834     var styleUpdates;
7835     for (propKey in lastProps) {
7836       if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
7837         continue;
7838       }
7839       if (propKey === STYLE) {
7840         var lastStyle = this._previousStyleCopy;
7841         for (styleName in lastStyle) {
7842           if (lastStyle.hasOwnProperty(styleName)) {
7843             styleUpdates = styleUpdates || {};
7844             styleUpdates[styleName] = '';
7845           }
7846         }
7847         this._previousStyleCopy = null;
7848       } else if (registrationNameModules.hasOwnProperty(propKey)) {
7849         if (lastProps[propKey]) {
7850           // Only call deleteListener if there was a listener previously or
7851           // else willDeleteListener gets called when there wasn't actually a
7852           // listener (e.g., onClick={null})
7853           deleteListener(this, propKey);
7854         }
7855       } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
7856         DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
7857       }
7858     }
7859     for (propKey in nextProps) {
7860       var nextProp = nextProps[propKey];
7861       var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
7862       if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
7863         continue;
7864       }
7865       if (propKey === STYLE) {
7866         if (nextProp) {
7867           if ("development" !== 'production') {
7868             checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
7869             this._previousStyle = nextProp;
7870           }
7871           nextProp = this._previousStyleCopy = _assign({}, nextProp);
7872         } else {
7873           this._previousStyleCopy = null;
7874         }
7875         if (lastProp) {
7876           // Unset styles on `lastProp` but not on `nextProp`.
7877           for (styleName in lastProp) {
7878             if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
7879               styleUpdates = styleUpdates || {};
7880               styleUpdates[styleName] = '';
7881             }
7882           }
7883           // Update styles that changed since `lastProp`.
7884           for (styleName in nextProp) {
7885             if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
7886               styleUpdates = styleUpdates || {};
7887               styleUpdates[styleName] = nextProp[styleName];
7888             }
7889           }
7890         } else {
7891           // Relies on `updateStylesByID` not mutating `styleUpdates`.
7892           styleUpdates = nextProp;
7893         }
7894       } else if (registrationNameModules.hasOwnProperty(propKey)) {
7895         if (nextProp) {
7896           enqueuePutListener(this, propKey, nextProp, transaction);
7897         } else if (lastProp) {
7898           deleteListener(this, propKey);
7899         }
7900       } else if (isCustomComponent(this._tag, nextProps)) {
7901         if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
7902           DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
7903         }
7904       } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
7905         var node = getNode(this);
7906         // If we're updating to null or undefined, we should remove the property
7907         // from the DOM node instead of inadvertently setting to a string. This
7908         // brings us in line with the same behavior we have on initial render.
7909         if (nextProp != null) {
7910           DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
7911         } else {
7912           DOMPropertyOperations.deleteValueForProperty(node, propKey);
7913         }
7914       }
7915     }
7916     if (styleUpdates) {
7917       CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
7918     }
7919   },
7921   /**
7922    * Reconciles the children with the various properties that affect the
7923    * children content.
7924    *
7925    * @param {object} lastProps
7926    * @param {object} nextProps
7927    * @param {ReactReconcileTransaction} transaction
7928    * @param {object} context
7929    */
7930   _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
7931     var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
7932     var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
7934     var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
7935     var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
7937     // Note the use of `!=` which checks for null or undefined.
7938     var lastChildren = lastContent != null ? null : lastProps.children;
7939     var nextChildren = nextContent != null ? null : nextProps.children;
7941     // If we're switching from children to content/html or vice versa, remove
7942     // the old content
7943     var lastHasContentOrHtml = lastContent != null || lastHtml != null;
7944     var nextHasContentOrHtml = nextContent != null || nextHtml != null;
7945     if (lastChildren != null && nextChildren == null) {
7946       this.updateChildren(null, transaction, context);
7947     } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
7948       this.updateTextContent('');
7949       if ("development" !== 'production') {
7950         ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
7951       }
7952     }
7954     if (nextContent != null) {
7955       if (lastContent !== nextContent) {
7956         this.updateTextContent('' + nextContent);
7957         if ("development" !== 'production') {
7958           this._contentDebugID = this._debugID + '#text';
7959           setContentChildForInstrumentation.call(this, nextContent);
7960         }
7961       }
7962     } else if (nextHtml != null) {
7963       if (lastHtml !== nextHtml) {
7964         this.updateMarkup('' + nextHtml);
7965       }
7966       if ("development" !== 'production') {
7967         ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
7968       }
7969     } else if (nextChildren != null) {
7970       if ("development" !== 'production') {
7971         if (this._contentDebugID) {
7972           ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
7973           this._contentDebugID = null;
7974         }
7975       }
7977       this.updateChildren(nextChildren, transaction, context);
7978     }
7979   },
7981   getNativeNode: function () {
7982     return getNode(this);
7983   },
7985   /**
7986    * Destroys all event registrations for this instance. Does not remove from
7987    * the DOM. That must be done by the parent.
7988    *
7989    * @internal
7990    */
7991   unmountComponent: function (safely) {
7992     switch (this._tag) {
7993       case 'iframe':
7994       case 'object':
7995       case 'img':
7996       case 'form':
7997       case 'video':
7998       case 'audio':
7999         var listeners = this._wrapperState.listeners;
8000         if (listeners) {
8001           for (var i = 0; i < listeners.length; i++) {
8002             listeners[i].remove();
8003           }
8004         }
8005         break;
8006       case 'html':
8007       case 'head':
8008       case 'body':
8009         /**
8010          * Components like <html> <head> and <body> can't be removed or added
8011          * easily in a cross-browser way, however it's valuable to be able to
8012          * take advantage of React's reconciliation for styling and <title>
8013          * management. So we just document it and throw in dangerous cases.
8014          */
8015         !false ? "development" !== '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) : void 0;
8016         break;
8017     }
8019     this.unmountChildren(safely);
8020     ReactDOMComponentTree.uncacheNode(this);
8021     EventPluginHub.deleteAllListeners(this);
8022     ReactComponentBrowserEnvironment.unmountIDFromEnvironment(this._rootNodeID);
8023     this._rootNodeID = null;
8024     this._domID = null;
8025     this._wrapperState = null;
8027     if ("development" !== 'production') {
8028       if (this._contentDebugID) {
8029         ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
8030         this._contentDebugID = null;
8031       }
8032     }
8033   },
8035   getPublicInstance: function () {
8036     return getNode(this);
8037   }
8041 _assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
8043 module.exports = ReactDOMComponent;
8044 },{"1":1,"10":10,"11":11,"131":131,"145":145,"156":156,"16":16,"165":165,"17":17,"173":173,"177":177,"18":18,"182":182,"183":183,"184":184,"28":28,"35":35,"4":4,"42":42,"44":44,"45":45,"52":52,"54":54,"55":55,"59":59,"76":76,"8":8,"81":81,"9":9,"97":97}],44:[function(_dereq_,module,exports){
8046  * Copyright 2015-present, Facebook, Inc.
8047  * All rights reserved.
8049  * This source code is licensed under the BSD-style license found in the
8050  * LICENSE file in the root directory of this source tree. An additional grant
8051  * of patent rights can be found in the PATENTS file in the same directory.
8053  * @providesModule ReactDOMComponentFlags
8054  */
8056 'use strict';
8058 var ReactDOMComponentFlags = {
8059   hasCachedChildNodes: 1 << 0
8062 module.exports = ReactDOMComponentFlags;
8063 },{}],45:[function(_dereq_,module,exports){
8065  * Copyright 2013-present, Facebook, Inc.
8066  * All rights reserved.
8068  * This source code is licensed under the BSD-style license found in the
8069  * LICENSE file in the root directory of this source tree. An additional grant
8070  * of patent rights can be found in the PATENTS file in the same directory.
8072  * @providesModule ReactDOMComponentTree
8073  */
8075 'use strict';
8077 var DOMProperty = _dereq_(10);
8078 var ReactDOMComponentFlags = _dereq_(44);
8080 var invariant = _dereq_(173);
8082 var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
8083 var Flags = ReactDOMComponentFlags;
8085 var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
8088  * Drill down (through composites and empty components) until we get a native or
8089  * native text component.
8091  * This is pretty polymorphic but unavoidable with the current structure we have
8092  * for `_renderedChildren`.
8093  */
8094 function getRenderedNativeOrTextFromComponent(component) {
8095   var rendered;
8096   while (rendered = component._renderedComponent) {
8097     component = rendered;
8098   }
8099   return component;
8103  * Populate `_nativeNode` on the rendered native/text component with the given
8104  * DOM node. The passed `inst` can be a composite.
8105  */
8106 function precacheNode(inst, node) {
8107   var nativeInst = getRenderedNativeOrTextFromComponent(inst);
8108   nativeInst._nativeNode = node;
8109   node[internalInstanceKey] = nativeInst;
8112 function uncacheNode(inst) {
8113   var node = inst._nativeNode;
8114   if (node) {
8115     delete node[internalInstanceKey];
8116     inst._nativeNode = null;
8117   }
8121  * Populate `_nativeNode` on each child of `inst`, assuming that the children
8122  * match up with the DOM (element) children of `node`.
8124  * We cache entire levels at once to avoid an n^2 problem where we access the
8125  * children of a node sequentially and have to walk from the start to our target
8126  * node every time.
8128  * Since we update `_renderedChildren` and the actual DOM at (slightly)
8129  * different times, we could race here and see a newer `_renderedChildren` than
8130  * the DOM nodes we see. To avoid this, ReactMultiChild calls
8131  * `prepareToManageChildren` before we change `_renderedChildren`, at which
8132  * time the container's child nodes are always cached (until it unmounts).
8133  */
8134 function precacheChildNodes(inst, node) {
8135   if (inst._flags & Flags.hasCachedChildNodes) {
8136     return;
8137   }
8138   var children = inst._renderedChildren;
8139   var childNode = node.firstChild;
8140   outer: for (var name in children) {
8141     if (!children.hasOwnProperty(name)) {
8142       continue;
8143     }
8144     var childInst = children[name];
8145     var childID = getRenderedNativeOrTextFromComponent(childInst)._domID;
8146     if (childID == null) {
8147       // We're currently unmounting this child in ReactMultiChild; skip it.
8148       continue;
8149     }
8150     // We assume the child nodes are in the same order as the child instances.
8151     for (; childNode !== null; childNode = childNode.nextSibling) {
8152       if (childNode.nodeType === 1 && childNode.getAttribute(ATTR_NAME) === String(childID) || childNode.nodeType === 8 && childNode.nodeValue === ' react-text: ' + childID + ' ' || childNode.nodeType === 8 && childNode.nodeValue === ' react-empty: ' + childID + ' ') {
8153         precacheNode(childInst, childNode);
8154         continue outer;
8155       }
8156     }
8157     // We reached the end of the DOM children without finding an ID match.
8158     !false ? "development" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : invariant(false) : void 0;
8159   }
8160   inst._flags |= Flags.hasCachedChildNodes;
8164  * Given a DOM node, return the closest ReactDOMComponent or
8165  * ReactDOMTextComponent instance ancestor.
8166  */
8167 function getClosestInstanceFromNode(node) {
8168   if (node[internalInstanceKey]) {
8169     return node[internalInstanceKey];
8170   }
8172   // Walk up the tree until we find an ancestor whose instance we have cached.
8173   var parents = [];
8174   while (!node[internalInstanceKey]) {
8175     parents.push(node);
8176     if (node.parentNode) {
8177       node = node.parentNode;
8178     } else {
8179       // Top of the tree. This node must not be part of a React tree (or is
8180       // unmounted, potentially).
8181       return null;
8182     }
8183   }
8185   var closest;
8186   var inst;
8187   for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
8188     closest = inst;
8189     if (parents.length) {
8190       precacheChildNodes(inst, node);
8191     }
8192   }
8194   return closest;
8198  * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
8199  * instance, or null if the node was not rendered by this React.
8200  */
8201 function getInstanceFromNode(node) {
8202   var inst = getClosestInstanceFromNode(node);
8203   if (inst != null && inst._nativeNode === node) {
8204     return inst;
8205   } else {
8206     return null;
8207   }
8211  * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
8212  * DOM node.
8213  */
8214 function getNodeFromInstance(inst) {
8215   // Without this first invariant, passing a non-DOM-component triggers the next
8216   // invariant for a missing parent, which is super confusing.
8217   !(inst._nativeNode !== undefined) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;
8219   if (inst._nativeNode) {
8220     return inst._nativeNode;
8221   }
8223   // Walk up the tree until we find an ancestor whose DOM node we have cached.
8224   var parents = [];
8225   while (!inst._nativeNode) {
8226     parents.push(inst);
8227     !inst._nativeParent ? "development" !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : invariant(false) : void 0;
8228     inst = inst._nativeParent;
8229   }
8231   // Now parents contains each ancestor that does *not* have a cached native
8232   // node, and `inst` is the deepest ancestor that does.
8233   for (; parents.length; inst = parents.pop()) {
8234     precacheChildNodes(inst, inst._nativeNode);
8235   }
8237   return inst._nativeNode;
8240 var ReactDOMComponentTree = {
8241   getClosestInstanceFromNode: getClosestInstanceFromNode,
8242   getInstanceFromNode: getInstanceFromNode,
8243   getNodeFromInstance: getNodeFromInstance,
8244   precacheChildNodes: precacheChildNodes,
8245   precacheNode: precacheNode,
8246   uncacheNode: uncacheNode
8249 module.exports = ReactDOMComponentTree;
8250 },{"10":10,"173":173,"44":44}],46:[function(_dereq_,module,exports){
8252  * Copyright 2013-present, Facebook, Inc.
8253  * All rights reserved.
8255  * This source code is licensed under the BSD-style license found in the
8256  * LICENSE file in the root directory of this source tree. An additional grant
8257  * of patent rights can be found in the PATENTS file in the same directory.
8259  * @providesModule ReactDOMContainerInfo
8260  */
8262 'use strict';
8264 var validateDOMNesting = _dereq_(156);
8266 var DOC_NODE_TYPE = 9;
8268 function ReactDOMContainerInfo(topLevelWrapper, node) {
8269   var info = {
8270     _topLevelWrapper: topLevelWrapper,
8271     _idCounter: 1,
8272     _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,
8273     _node: node,
8274     _tag: node ? node.nodeName.toLowerCase() : null,
8275     _namespaceURI: node ? node.namespaceURI : null
8276   };
8277   if ("development" !== 'production') {
8278     info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
8279   }
8280   return info;
8283 module.exports = ReactDOMContainerInfo;
8284 },{"156":156}],47:[function(_dereq_,module,exports){
8286  * Copyright 2013-present, Facebook, Inc.
8287  * All rights reserved.
8289  * This source code is licensed under the BSD-style license found in the
8290  * LICENSE file in the root directory of this source tree. An additional grant
8291  * of patent rights can be found in the PATENTS file in the same directory.
8293  * @providesModule ReactDOMDebugTool
8294  */
8296 'use strict';
8298 var ReactDOMUnknownPropertyDevtool = _dereq_(61);
8300 var warning = _dereq_(183);
8302 var eventHandlers = [];
8303 var handlerDoesThrowForEvent = {};
8305 function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
8306   if ("development" !== 'production') {
8307     eventHandlers.forEach(function (handler) {
8308       try {
8309         if (handler[handlerFunctionName]) {
8310           handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);
8311         }
8312       } catch (e) {
8313         "development" !== 'production' ? warning(!handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e.message) : void 0;
8314         handlerDoesThrowForEvent[handlerFunctionName] = true;
8315       }
8316     });
8317   }
8320 var ReactDOMDebugTool = {
8321   addDevtool: function (devtool) {
8322     eventHandlers.push(devtool);
8323   },
8324   removeDevtool: function (devtool) {
8325     for (var i = 0; i < eventHandlers.length; i++) {
8326       if (eventHandlers[i] === devtool) {
8327         eventHandlers.splice(i, 1);
8328         i--;
8329       }
8330     }
8331   },
8332   onCreateMarkupForProperty: function (name, value) {
8333     emitEvent('onCreateMarkupForProperty', name, value);
8334   },
8335   onSetValueForProperty: function (node, name, value) {
8336     emitEvent('onSetValueForProperty', node, name, value);
8337   },
8338   onDeleteValueForProperty: function (node, name) {
8339     emitEvent('onDeleteValueForProperty', node, name);
8340   }
8343 ReactDOMDebugTool.addDevtool(ReactDOMUnknownPropertyDevtool);
8345 module.exports = ReactDOMDebugTool;
8346 },{"183":183,"61":61}],48:[function(_dereq_,module,exports){
8348  * Copyright 2014-present, Facebook, Inc.
8349  * All rights reserved.
8351  * This source code is licensed under the BSD-style license found in the
8352  * LICENSE file in the root directory of this source tree. An additional grant
8353  * of patent rights can be found in the PATENTS file in the same directory.
8355  * @providesModule ReactDOMEmptyComponent
8356  */
8358 'use strict';
8360 var _assign = _dereq_(184);
8362 var DOMLazyTree = _dereq_(8);
8363 var ReactDOMComponentTree = _dereq_(45);
8365 var ReactDOMEmptyComponent = function (instantiate) {
8366   // ReactCompositeComponent uses this:
8367   this._currentElement = null;
8368   // ReactDOMComponentTree uses these:
8369   this._nativeNode = null;
8370   this._nativeParent = null;
8371   this._nativeContainerInfo = null;
8372   this._domID = null;
8374 _assign(ReactDOMEmptyComponent.prototype, {
8375   mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
8376     var domID = nativeContainerInfo._idCounter++;
8377     this._domID = domID;
8378     this._nativeParent = nativeParent;
8379     this._nativeContainerInfo = nativeContainerInfo;
8381     var nodeValue = ' react-empty: ' + this._domID + ' ';
8382     if (transaction.useCreateElement) {
8383       var ownerDocument = nativeContainerInfo._ownerDocument;
8384       var node = ownerDocument.createComment(nodeValue);
8385       ReactDOMComponentTree.precacheNode(this, node);
8386       return DOMLazyTree(node);
8387     } else {
8388       if (transaction.renderToStaticMarkup) {
8389         // Normally we'd insert a comment node, but since this is a situation
8390         // where React won't take over (static pages), we can simply return
8391         // nothing.
8392         return '';
8393       }
8394       return '<!--' + nodeValue + '-->';
8395     }
8396   },
8397   receiveComponent: function () {},
8398   getNativeNode: function () {
8399     return ReactDOMComponentTree.getNodeFromInstance(this);
8400   },
8401   unmountComponent: function () {
8402     ReactDOMComponentTree.uncacheNode(this);
8403   }
8406 module.exports = ReactDOMEmptyComponent;
8407 },{"184":184,"45":45,"8":8}],49:[function(_dereq_,module,exports){
8409  * Copyright 2013-present, Facebook, Inc.
8410  * All rights reserved.
8412  * This source code is licensed under the BSD-style license found in the
8413  * LICENSE file in the root directory of this source tree. An additional grant
8414  * of patent rights can be found in the PATENTS file in the same directory.
8416  * @providesModule ReactDOMFactories
8417  */
8419 'use strict';
8421 var ReactElement = _dereq_(65);
8422 var ReactElementValidator = _dereq_(66);
8424 var mapObject = _dereq_(178);
8427  * Create a factory that creates HTML tag elements.
8429  * @param {string} tag Tag name (e.g. `div`).
8430  * @private
8431  */
8432 function createDOMFactory(tag) {
8433   if ("development" !== 'production') {
8434     return ReactElementValidator.createFactory(tag);
8435   }
8436   return ReactElement.createFactory(tag);
8440  * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
8441  * This is also accessible via `React.DOM`.
8443  * @public
8444  */
8445 var ReactDOMFactories = mapObject({
8446   a: 'a',
8447   abbr: 'abbr',
8448   address: 'address',
8449   area: 'area',
8450   article: 'article',
8451   aside: 'aside',
8452   audio: 'audio',
8453   b: 'b',
8454   base: 'base',
8455   bdi: 'bdi',
8456   bdo: 'bdo',
8457   big: 'big',
8458   blockquote: 'blockquote',
8459   body: 'body',
8460   br: 'br',
8461   button: 'button',
8462   canvas: 'canvas',
8463   caption: 'caption',
8464   cite: 'cite',
8465   code: 'code',
8466   col: 'col',
8467   colgroup: 'colgroup',
8468   data: 'data',
8469   datalist: 'datalist',
8470   dd: 'dd',
8471   del: 'del',
8472   details: 'details',
8473   dfn: 'dfn',
8474   dialog: 'dialog',
8475   div: 'div',
8476   dl: 'dl',
8477   dt: 'dt',
8478   em: 'em',
8479   embed: 'embed',
8480   fieldset: 'fieldset',
8481   figcaption: 'figcaption',
8482   figure: 'figure',
8483   footer: 'footer',
8484   form: 'form',
8485   h1: 'h1',
8486   h2: 'h2',
8487   h3: 'h3',
8488   h4: 'h4',
8489   h5: 'h5',
8490   h6: 'h6',
8491   head: 'head',
8492   header: 'header',
8493   hgroup: 'hgroup',
8494   hr: 'hr',
8495   html: 'html',
8496   i: 'i',
8497   iframe: 'iframe',
8498   img: 'img',
8499   input: 'input',
8500   ins: 'ins',
8501   kbd: 'kbd',
8502   keygen: 'keygen',
8503   label: 'label',
8504   legend: 'legend',
8505   li: 'li',
8506   link: 'link',
8507   main: 'main',
8508   map: 'map',
8509   mark: 'mark',
8510   menu: 'menu',
8511   menuitem: 'menuitem',
8512   meta: 'meta',
8513   meter: 'meter',
8514   nav: 'nav',
8515   noscript: 'noscript',
8516   object: 'object',
8517   ol: 'ol',
8518   optgroup: 'optgroup',
8519   option: 'option',
8520   output: 'output',
8521   p: 'p',
8522   param: 'param',
8523   picture: 'picture',
8524   pre: 'pre',
8525   progress: 'progress',
8526   q: 'q',
8527   rp: 'rp',
8528   rt: 'rt',
8529   ruby: 'ruby',
8530   s: 's',
8531   samp: 'samp',
8532   script: 'script',
8533   section: 'section',
8534   select: 'select',
8535   small: 'small',
8536   source: 'source',
8537   span: 'span',
8538   strong: 'strong',
8539   style: 'style',
8540   sub: 'sub',
8541   summary: 'summary',
8542   sup: 'sup',
8543   table: 'table',
8544   tbody: 'tbody',
8545   td: 'td',
8546   textarea: 'textarea',
8547   tfoot: 'tfoot',
8548   th: 'th',
8549   thead: 'thead',
8550   time: 'time',
8551   title: 'title',
8552   tr: 'tr',
8553   track: 'track',
8554   u: 'u',
8555   ul: 'ul',
8556   'var': 'var',
8557   video: 'video',
8558   wbr: 'wbr',
8560   // SVG
8561   circle: 'circle',
8562   clipPath: 'clipPath',
8563   defs: 'defs',
8564   ellipse: 'ellipse',
8565   g: 'g',
8566   image: 'image',
8567   line: 'line',
8568   linearGradient: 'linearGradient',
8569   mask: 'mask',
8570   path: 'path',
8571   pattern: 'pattern',
8572   polygon: 'polygon',
8573   polyline: 'polyline',
8574   radialGradient: 'radialGradient',
8575   rect: 'rect',
8576   stop: 'stop',
8577   svg: 'svg',
8578   text: 'text',
8579   tspan: 'tspan'
8581 }, createDOMFactory);
8583 module.exports = ReactDOMFactories;
8584 },{"178":178,"65":65,"66":66}],50:[function(_dereq_,module,exports){
8586  * Copyright 2013-present, Facebook, Inc.
8587  * All rights reserved.
8589  * This source code is licensed under the BSD-style license found in the
8590  * LICENSE file in the root directory of this source tree. An additional grant
8591  * of patent rights can be found in the PATENTS file in the same directory.
8593  * @providesModule ReactDOMFeatureFlags
8594  */
8596 'use strict';
8598 var ReactDOMFeatureFlags = {
8599   useCreateElement: true
8602 module.exports = ReactDOMFeatureFlags;
8603 },{}],51:[function(_dereq_,module,exports){
8605  * Copyright 2013-present, Facebook, Inc.
8606  * All rights reserved.
8608  * This source code is licensed under the BSD-style license found in the
8609  * LICENSE file in the root directory of this source tree. An additional grant
8610  * of patent rights can be found in the PATENTS file in the same directory.
8612  * @providesModule ReactDOMIDOperations
8613  */
8615 'use strict';
8617 var DOMChildrenOperations = _dereq_(7);
8618 var ReactDOMComponentTree = _dereq_(45);
8621  * Operations used to process updates to DOM nodes.
8622  */
8623 var ReactDOMIDOperations = {
8625   /**
8626    * Updates a component's children by processing a series of updates.
8627    *
8628    * @param {array<object>} updates List of update configurations.
8629    * @internal
8630    */
8631   dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
8632     var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
8633     DOMChildrenOperations.processUpdates(node, updates);
8634   }
8637 module.exports = ReactDOMIDOperations;
8638 },{"45":45,"7":7}],52:[function(_dereq_,module,exports){
8640  * Copyright 2013-present, Facebook, Inc.
8641  * All rights reserved.
8643  * This source code is licensed under the BSD-style license found in the
8644  * LICENSE file in the root directory of this source tree. An additional grant
8645  * of patent rights can be found in the PATENTS file in the same directory.
8647  * @providesModule ReactDOMInput
8648  */
8650 'use strict';
8652 var _assign = _dereq_(184);
8654 var DisabledInputUtils = _dereq_(14);
8655 var DOMPropertyOperations = _dereq_(11);
8656 var LinkedValueUtils = _dereq_(25);
8657 var ReactDOMComponentTree = _dereq_(45);
8658 var ReactUpdates = _dereq_(104);
8660 var invariant = _dereq_(173);
8661 var warning = _dereq_(183);
8663 var didWarnValueLink = false;
8664 var didWarnCheckedLink = false;
8665 var didWarnValueNull = false;
8666 var didWarnValueDefaultValue = false;
8667 var didWarnCheckedDefaultChecked = false;
8668 var didWarnControlledToUncontrolled = false;
8669 var didWarnUncontrolledToControlled = false;
8671 function forceUpdateIfMounted() {
8672   if (this._rootNodeID) {
8673     // DOM component is still mounted; update
8674     ReactDOMInput.updateWrapper(this);
8675   }
8678 function warnIfValueIsNull(props) {
8679   if (props != null && props.value === null && !didWarnValueNull) {
8680     "development" !== 'production' ? warning(false, '`value` prop on `input` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
8682     didWarnValueNull = true;
8683   }
8687  * Implements an <input> native component that allows setting these optional
8688  * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
8690  * If `checked` or `value` are not supplied (or null/undefined), user actions
8691  * that affect the checked state or value will trigger updates to the element.
8693  * If they are supplied (and not null/undefined), the rendered element will not
8694  * trigger updates to the element. Instead, the props must change in order for
8695  * the rendered element to be updated.
8697  * The rendered element will be initialized as unchecked (or `defaultChecked`)
8698  * with an empty value (or `defaultValue`).
8700  * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
8701  */
8702 var ReactDOMInput = {
8703   getNativeProps: function (inst, props) {
8704     var value = LinkedValueUtils.getValue(props);
8705     var checked = LinkedValueUtils.getChecked(props);
8707     var nativeProps = _assign({
8708       // Make sure we set .type before any other properties (setting .value
8709       // before .type means .value is lost in IE11 and below)
8710       type: undefined
8711     }, DisabledInputUtils.getNativeProps(inst, props), {
8712       defaultChecked: undefined,
8713       defaultValue: undefined,
8714       value: value != null ? value : inst._wrapperState.initialValue,
8715       checked: checked != null ? checked : inst._wrapperState.initialChecked,
8716       onChange: inst._wrapperState.onChange
8717     });
8719     return nativeProps;
8720   },
8722   mountWrapper: function (inst, props) {
8723     if ("development" !== 'production') {
8724       LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
8726       var owner = inst._currentElement._owner;
8728       if (props.valueLink !== undefined && !didWarnValueLink) {
8729         "development" !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
8730         didWarnValueLink = true;
8731       }
8732       if (props.checkedLink !== undefined && !didWarnCheckedLink) {
8733         "development" !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
8734         didWarnCheckedLink = true;
8735       }
8736       if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
8737         "development" !== 'production' ? warning(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
8738         didWarnCheckedDefaultChecked = true;
8739       }
8740       if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
8741         "development" !== 'production' ? warning(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
8742         didWarnValueDefaultValue = true;
8743       }
8744       warnIfValueIsNull(props);
8745     }
8747     var defaultValue = props.defaultValue;
8748     inst._wrapperState = {
8749       initialChecked: props.defaultChecked || false,
8750       initialValue: defaultValue != null ? defaultValue : null,
8751       listeners: null,
8752       onChange: _handleChange.bind(inst)
8753     };
8755     if ("development" !== 'production') {
8756       inst._wrapperState.controlled = props.checked !== undefined || props.value !== undefined;
8757     }
8758   },
8760   updateWrapper: function (inst) {
8761     var props = inst._currentElement.props;
8763     if ("development" !== 'production') {
8764       warnIfValueIsNull(props);
8766       var initialValue = inst._wrapperState.initialChecked || inst._wrapperState.initialValue;
8767       var defaultValue = props.defaultChecked || props.defaultValue;
8768       var controlled = props.checked !== undefined || props.value !== undefined;
8769       var owner = inst._currentElement._owner;
8771       if ((initialValue || !inst._wrapperState.controlled) && controlled && !didWarnUncontrolledToControlled) {
8772         "development" !== 'production' ? warning(false, '%s is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
8773         didWarnUncontrolledToControlled = true;
8774       }
8775       if (inst._wrapperState.controlled && (defaultValue || !controlled) && !didWarnControlledToUncontrolled) {
8776         "development" !== 'production' ? warning(false, '%s is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', owner && owner.getName() || 'A component', props.type) : void 0;
8777         didWarnControlledToUncontrolled = true;
8778       }
8779     }
8781     // TODO: Shouldn't this be getChecked(props)?
8782     var checked = props.checked;
8783     if (checked != null) {
8784       DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
8785     }
8787     var value = LinkedValueUtils.getValue(props);
8788     if (value != null) {
8789       // Cast `value` to a string to ensure the value is set correctly. While
8790       // browsers typically do this as necessary, jsdom doesn't.
8791       DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'value', '' + value);
8792     }
8793   }
8796 function _handleChange(event) {
8797   var props = this._currentElement.props;
8799   var returnValue = LinkedValueUtils.executeOnChange(props, event);
8801   // Here we use asap to wait until all updates have propagated, which
8802   // is important when using controlled components within layers:
8803   // https://github.com/facebook/react/issues/1698
8804   ReactUpdates.asap(forceUpdateIfMounted, this);
8806   var name = props.name;
8807   if (props.type === 'radio' && name != null) {
8808     var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
8809     var queryRoot = rootNode;
8811     while (queryRoot.parentNode) {
8812       queryRoot = queryRoot.parentNode;
8813     }
8815     // If `rootNode.form` was non-null, then we could try `form.elements`,
8816     // but that sometimes behaves strangely in IE8. We could also try using
8817     // `form.getElementsByName`, but that will only return direct children
8818     // and won't include inputs that use the HTML5 `form=` attribute. Since
8819     // the input might not even be in a form, let's just use the global
8820     // `querySelectorAll` to ensure we don't miss anything.
8821     var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
8823     for (var i = 0; i < group.length; i++) {
8824       var otherNode = group[i];
8825       if (otherNode === rootNode || otherNode.form !== rootNode.form) {
8826         continue;
8827       }
8828       // This will throw if radio buttons rendered by different copies of React
8829       // and the same name are rendered into the same form (same as #1939).
8830       // That's probably okay; we don't support it just as we don't support
8831       // mixing React radio buttons with non-React ones.
8832       var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
8833       !otherInstance ? "development" !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.') : invariant(false) : void 0;
8834       // If this is a controlled radio button group, forcing the input that
8835       // was previously checked to update will cause it to be come re-checked
8836       // as appropriate.
8837       ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
8838     }
8839   }
8841   return returnValue;
8844 module.exports = ReactDOMInput;
8845 },{"104":104,"11":11,"14":14,"173":173,"183":183,"184":184,"25":25,"45":45}],53:[function(_dereq_,module,exports){
8847  * Copyright 2013-present, Facebook, Inc.
8848  * All rights reserved.
8850  * This source code is licensed under the BSD-style license found in the
8851  * LICENSE file in the root directory of this source tree. An additional grant
8852  * of patent rights can be found in the PATENTS file in the same directory.
8854  * @providesModule ReactDOMInstrumentation
8855  */
8857 'use strict';
8859 var ReactDOMDebugTool = _dereq_(47);
8861 module.exports = { debugTool: ReactDOMDebugTool };
8862 },{"47":47}],54:[function(_dereq_,module,exports){
8864  * Copyright 2013-present, Facebook, Inc.
8865  * All rights reserved.
8867  * This source code is licensed under the BSD-style license found in the
8868  * LICENSE file in the root directory of this source tree. An additional grant
8869  * of patent rights can be found in the PATENTS file in the same directory.
8871  * @providesModule ReactDOMOption
8872  */
8874 'use strict';
8876 var _assign = _dereq_(184);
8878 var ReactChildren = _dereq_(32);
8879 var ReactDOMComponentTree = _dereq_(45);
8880 var ReactDOMSelect = _dereq_(55);
8882 var warning = _dereq_(183);
8885  * Implements an <option> native component that warns when `selected` is set.
8886  */
8887 var ReactDOMOption = {
8888   mountWrapper: function (inst, props, nativeParent) {
8889     // TODO (yungsters): Remove support for `selected` in <option>.
8890     if ("development" !== 'production') {
8891       "development" !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;
8892     }
8894     // Look up whether this option is 'selected'
8895     var selectValue = null;
8896     if (nativeParent != null) {
8897       var selectParent = nativeParent;
8899       if (selectParent._tag === 'optgroup') {
8900         selectParent = selectParent._nativeParent;
8901       }
8903       if (selectParent != null && selectParent._tag === 'select') {
8904         selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
8905       }
8906     }
8908     // If the value is null (e.g., no specified value or after initial mount)
8909     // or missing (e.g., for <datalist>), we don't change props.selected
8910     var selected = null;
8911     if (selectValue != null) {
8912       selected = false;
8913       if (Array.isArray(selectValue)) {
8914         // multiple
8915         for (var i = 0; i < selectValue.length; i++) {
8916           if ('' + selectValue[i] === '' + props.value) {
8917             selected = true;
8918             break;
8919           }
8920         }
8921       } else {
8922         selected = '' + selectValue === '' + props.value;
8923       }
8924     }
8926     inst._wrapperState = { selected: selected };
8927   },
8929   postMountWrapper: function (inst) {
8930     // value="" should make a value attribute (#6219)
8931     var props = inst._currentElement.props;
8932     if (props.value != null) {
8933       var node = ReactDOMComponentTree.getNodeFromInstance(inst);
8934       node.setAttribute('value', props.value);
8935     }
8936   },
8938   getNativeProps: function (inst, props) {
8939     var nativeProps = _assign({ selected: undefined, children: undefined }, props);
8941     // Read state only from initial mount because <select> updates value
8942     // manually; we need the initial state only for server rendering
8943     if (inst._wrapperState.selected != null) {
8944       nativeProps.selected = inst._wrapperState.selected;
8945     }
8947     var content = '';
8949     // Flatten children and warn if they aren't strings or numbers;
8950     // invalid types are ignored.
8951     ReactChildren.forEach(props.children, function (child) {
8952       if (child == null) {
8953         return;
8954       }
8955       if (typeof child === 'string' || typeof child === 'number') {
8956         content += child;
8957       } else {
8958         "development" !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
8959       }
8960     });
8962     if (content) {
8963       nativeProps.children = content;
8964     }
8966     return nativeProps;
8967   }
8971 module.exports = ReactDOMOption;
8972 },{"183":183,"184":184,"32":32,"45":45,"55":55}],55:[function(_dereq_,module,exports){
8974  * Copyright 2013-present, Facebook, Inc.
8975  * All rights reserved.
8977  * This source code is licensed under the BSD-style license found in the
8978  * LICENSE file in the root directory of this source tree. An additional grant
8979  * of patent rights can be found in the PATENTS file in the same directory.
8981  * @providesModule ReactDOMSelect
8982  */
8984 'use strict';
8986 var _assign = _dereq_(184);
8988 var DisabledInputUtils = _dereq_(14);
8989 var LinkedValueUtils = _dereq_(25);
8990 var ReactDOMComponentTree = _dereq_(45);
8991 var ReactUpdates = _dereq_(104);
8993 var warning = _dereq_(183);
8995 var didWarnValueLink = false;
8996 var didWarnValueNull = false;
8997 var didWarnValueDefaultValue = false;
8999 function updateOptionsIfPendingUpdateAndMounted() {
9000   if (this._rootNodeID && this._wrapperState.pendingUpdate) {
9001     this._wrapperState.pendingUpdate = false;
9003     var props = this._currentElement.props;
9004     var value = LinkedValueUtils.getValue(props);
9006     if (value != null) {
9007       updateOptions(this, Boolean(props.multiple), value);
9008     }
9009   }
9012 function getDeclarationErrorAddendum(owner) {
9013   if (owner) {
9014     var name = owner.getName();
9015     if (name) {
9016       return ' Check the render method of `' + name + '`.';
9017     }
9018   }
9019   return '';
9022 function warnIfValueIsNull(props) {
9023   if (props != null && props.value === null && !didWarnValueNull) {
9024     "development" !== 'production' ? warning(false, '`value` prop on `select` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
9026     didWarnValueNull = true;
9027   }
9030 var valuePropNames = ['value', 'defaultValue'];
9033  * Validation function for `value` and `defaultValue`.
9034  * @private
9035  */
9036 function checkSelectPropTypes(inst, props) {
9037   var owner = inst._currentElement._owner;
9038   LinkedValueUtils.checkPropTypes('select', props, owner);
9040   if (props.valueLink !== undefined && !didWarnValueLink) {
9041     "development" !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
9042     didWarnValueLink = true;
9043   }
9045   for (var i = 0; i < valuePropNames.length; i++) {
9046     var propName = valuePropNames[i];
9047     if (props[propName] == null) {
9048       continue;
9049     }
9050     if (props.multiple) {
9051       "development" !== 'production' ? warning(Array.isArray(props[propName]), 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
9052     } else {
9053       "development" !== '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)) : void 0;
9054     }
9055   }
9059  * @param {ReactDOMComponent} inst
9060  * @param {boolean} multiple
9061  * @param {*} propValue A stringable (with `multiple`, a list of stringables).
9062  * @private
9063  */
9064 function updateOptions(inst, multiple, propValue) {
9065   var selectedValue, i;
9066   var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
9068   if (multiple) {
9069     selectedValue = {};
9070     for (i = 0; i < propValue.length; i++) {
9071       selectedValue['' + propValue[i]] = true;
9072     }
9073     for (i = 0; i < options.length; i++) {
9074       var selected = selectedValue.hasOwnProperty(options[i].value);
9075       if (options[i].selected !== selected) {
9076         options[i].selected = selected;
9077       }
9078     }
9079   } else {
9080     // Do not set `select.value` as exact behavior isn't consistent across all
9081     // browsers for all cases.
9082     selectedValue = '' + propValue;
9083     for (i = 0; i < options.length; i++) {
9084       if (options[i].value === selectedValue) {
9085         options[i].selected = true;
9086         return;
9087       }
9088     }
9089     if (options.length) {
9090       options[0].selected = true;
9091     }
9092   }
9096  * Implements a <select> native component that allows optionally setting the
9097  * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
9098  * stringable. If `multiple` is true, the prop must be an array of stringables.
9100  * If `value` is not supplied (or null/undefined), user actions that change the
9101  * selected option will trigger updates to the rendered options.
9103  * If it is supplied (and not null/undefined), the rendered options will not
9104  * update in response to user actions. Instead, the `value` prop must change in
9105  * order for the rendered options to update.
9107  * If `defaultValue` is provided, any options with the supplied values will be
9108  * selected.
9109  */
9110 var ReactDOMSelect = {
9111   getNativeProps: function (inst, props) {
9112     return _assign({}, DisabledInputUtils.getNativeProps(inst, props), {
9113       onChange: inst._wrapperState.onChange,
9114       value: undefined
9115     });
9116   },
9118   mountWrapper: function (inst, props) {
9119     if ("development" !== 'production') {
9120       checkSelectPropTypes(inst, props);
9121       warnIfValueIsNull(props);
9122     }
9124     var value = LinkedValueUtils.getValue(props);
9125     inst._wrapperState = {
9126       pendingUpdate: false,
9127       initialValue: value != null ? value : props.defaultValue,
9128       listeners: null,
9129       onChange: _handleChange.bind(inst),
9130       wasMultiple: Boolean(props.multiple)
9131     };
9133     if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
9134       "development" !== 'production' ? warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
9135       didWarnValueDefaultValue = true;
9136     }
9137   },
9139   getSelectValueContext: function (inst) {
9140     // ReactDOMOption looks at this initial value so the initial generated
9141     // markup has correct `selected` attributes
9142     return inst._wrapperState.initialValue;
9143   },
9145   postUpdateWrapper: function (inst) {
9146     var props = inst._currentElement.props;
9147     if ("development" !== 'production') {
9148       warnIfValueIsNull(props);
9149     }
9151     // After the initial mount, we control selected-ness manually so don't pass
9152     // this value down
9153     inst._wrapperState.initialValue = undefined;
9155     var wasMultiple = inst._wrapperState.wasMultiple;
9156     inst._wrapperState.wasMultiple = Boolean(props.multiple);
9158     var value = LinkedValueUtils.getValue(props);
9159     if (value != null) {
9160       inst._wrapperState.pendingUpdate = false;
9161       updateOptions(inst, Boolean(props.multiple), value);
9162     } else if (wasMultiple !== Boolean(props.multiple)) {
9163       // For simplicity, reapply `defaultValue` if `multiple` is toggled.
9164       if (props.defaultValue != null) {
9165         updateOptions(inst, Boolean(props.multiple), props.defaultValue);
9166       } else {
9167         // Revert the select back to its default unselected state.
9168         updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
9169       }
9170     }
9171   }
9174 function _handleChange(event) {
9175   var props = this._currentElement.props;
9176   var returnValue = LinkedValueUtils.executeOnChange(props, event);
9178   if (this._rootNodeID) {
9179     this._wrapperState.pendingUpdate = true;
9180   }
9181   ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
9182   return returnValue;
9185 module.exports = ReactDOMSelect;
9186 },{"104":104,"14":14,"183":183,"184":184,"25":25,"45":45}],56:[function(_dereq_,module,exports){
9188  * Copyright 2013-present, Facebook, Inc.
9189  * All rights reserved.
9191  * This source code is licensed under the BSD-style license found in the
9192  * LICENSE file in the root directory of this source tree. An additional grant
9193  * of patent rights can be found in the PATENTS file in the same directory.
9195  * @providesModule ReactDOMSelection
9196  */
9198 'use strict';
9200 var ExecutionEnvironment = _dereq_(159);
9202 var getNodeForCharacterOffset = _dereq_(141);
9203 var getTextContentAccessor = _dereq_(142);
9206  * While `isCollapsed` is available on the Selection object and `collapsed`
9207  * is available on the Range object, IE11 sometimes gets them wrong.
9208  * If the anchor/focus nodes and offsets are the same, the range is collapsed.
9209  */
9210 function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
9211   return anchorNode === focusNode && anchorOffset === focusOffset;
9215  * Get the appropriate anchor and focus node/offset pairs for IE.
9217  * The catch here is that IE's selection API doesn't provide information
9218  * about whether the selection is forward or backward, so we have to
9219  * behave as though it's always forward.
9221  * IE text differs from modern selection in that it behaves as though
9222  * block elements end with a new line. This means character offsets will
9223  * differ between the two APIs.
9225  * @param {DOMElement} node
9226  * @return {object}
9227  */
9228 function getIEOffsets(node) {
9229   var selection = document.selection;
9230   var selectedRange = selection.createRange();
9231   var selectedLength = selectedRange.text.length;
9233   // Duplicate selection so we can move range without breaking user selection.
9234   var fromStart = selectedRange.duplicate();
9235   fromStart.moveToElementText(node);
9236   fromStart.setEndPoint('EndToStart', selectedRange);
9238   var startOffset = fromStart.text.length;
9239   var endOffset = startOffset + selectedLength;
9241   return {
9242     start: startOffset,
9243     end: endOffset
9244   };
9248  * @param {DOMElement} node
9249  * @return {?object}
9250  */
9251 function getModernOffsets(node) {
9252   var selection = window.getSelection && window.getSelection();
9254   if (!selection || selection.rangeCount === 0) {
9255     return null;
9256   }
9258   var anchorNode = selection.anchorNode;
9259   var anchorOffset = selection.anchorOffset;
9260   var focusNode = selection.focusNode;
9261   var focusOffset = selection.focusOffset;
9263   var currentRange = selection.getRangeAt(0);
9265   // In Firefox, range.startContainer and range.endContainer can be "anonymous
9266   // divs", e.g. the up/down buttons on an <input type="number">. Anonymous
9267   // divs do not seem to expose properties, triggering a "Permission denied
9268   // error" if any of its properties are accessed. The only seemingly possible
9269   // way to avoid erroring is to access a property that typically works for
9270   // non-anonymous divs and catch any error that may otherwise arise. See
9271   // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
9272   try {
9273     /* eslint-disable no-unused-expressions */
9274     currentRange.startContainer.nodeType;
9275     currentRange.endContainer.nodeType;
9276     /* eslint-enable no-unused-expressions */
9277   } catch (e) {
9278     return null;
9279   }
9281   // If the node and offset values are the same, the selection is collapsed.
9282   // `Selection.isCollapsed` is available natively, but IE sometimes gets
9283   // this value wrong.
9284   var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
9286   var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
9288   var tempRange = currentRange.cloneRange();
9289   tempRange.selectNodeContents(node);
9290   tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
9292   var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
9294   var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
9295   var end = start + rangeLength;
9297   // Detect whether the selection is backward.
9298   var detectionRange = document.createRange();
9299   detectionRange.setStart(anchorNode, anchorOffset);
9300   detectionRange.setEnd(focusNode, focusOffset);
9301   var isBackward = detectionRange.collapsed;
9303   return {
9304     start: isBackward ? end : start,
9305     end: isBackward ? start : end
9306   };
9310  * @param {DOMElement|DOMTextNode} node
9311  * @param {object} offsets
9312  */
9313 function setIEOffsets(node, offsets) {
9314   var range = document.selection.createRange().duplicate();
9315   var start, end;
9317   if (offsets.end === undefined) {
9318     start = offsets.start;
9319     end = start;
9320   } else if (offsets.start > offsets.end) {
9321     start = offsets.end;
9322     end = offsets.start;
9323   } else {
9324     start = offsets.start;
9325     end = offsets.end;
9326   }
9328   range.moveToElementText(node);
9329   range.moveStart('character', start);
9330   range.setEndPoint('EndToStart', range);
9331   range.moveEnd('character', end - start);
9332   range.select();
9336  * In modern non-IE browsers, we can support both forward and backward
9337  * selections.
9339  * Note: IE10+ supports the Selection object, but it does not support
9340  * the `extend` method, which means that even in modern IE, it's not possible
9341  * to programmatically create a backward selection. Thus, for all IE
9342  * versions, we use the old IE API to create our selections.
9344  * @param {DOMElement|DOMTextNode} node
9345  * @param {object} offsets
9346  */
9347 function setModernOffsets(node, offsets) {
9348   if (!window.getSelection) {
9349     return;
9350   }
9352   var selection = window.getSelection();
9353   var length = node[getTextContentAccessor()].length;
9354   var start = Math.min(offsets.start, length);
9355   var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
9357   // IE 11 uses modern selection, but doesn't support the extend method.
9358   // Flip backward selections, so we can set with a single range.
9359   if (!selection.extend && start > end) {
9360     var temp = end;
9361     end = start;
9362     start = temp;
9363   }
9365   var startMarker = getNodeForCharacterOffset(node, start);
9366   var endMarker = getNodeForCharacterOffset(node, end);
9368   if (startMarker && endMarker) {
9369     var range = document.createRange();
9370     range.setStart(startMarker.node, startMarker.offset);
9371     selection.removeAllRanges();
9373     if (start > end) {
9374       selection.addRange(range);
9375       selection.extend(endMarker.node, endMarker.offset);
9376     } else {
9377       range.setEnd(endMarker.node, endMarker.offset);
9378       selection.addRange(range);
9379     }
9380   }
9383 var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
9385 var ReactDOMSelection = {
9386   /**
9387    * @param {DOMElement} node
9388    */
9389   getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
9391   /**
9392    * @param {DOMElement|DOMTextNode} node
9393    * @param {object} offsets
9394    */
9395   setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
9398 module.exports = ReactDOMSelection;
9399 },{"141":141,"142":142,"159":159}],57:[function(_dereq_,module,exports){
9401  * Copyright 2013-present, Facebook, Inc.
9402  * All rights reserved.
9404  * This source code is licensed under the BSD-style license found in the
9405  * LICENSE file in the root directory of this source tree. An additional grant
9406  * of patent rights can be found in the PATENTS file in the same directory.
9408  * @providesModule ReactDOMServer
9409  */
9411 'use strict';
9413 var ReactDefaultInjection = _dereq_(64);
9414 var ReactServerRendering = _dereq_(96);
9415 var ReactVersion = _dereq_(105);
9417 ReactDefaultInjection.inject();
9419 var ReactDOMServer = {
9420   renderToString: ReactServerRendering.renderToString,
9421   renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
9422   version: ReactVersion
9425 module.exports = ReactDOMServer;
9426 },{"105":105,"64":64,"96":96}],58:[function(_dereq_,module,exports){
9428  * Copyright 2013-present, Facebook, Inc.
9429  * All rights reserved.
9431  * This source code is licensed under the BSD-style license found in the
9432  * LICENSE file in the root directory of this source tree. An additional grant
9433  * of patent rights can be found in the PATENTS file in the same directory.
9435  * @providesModule ReactDOMTextComponent
9436  */
9438 'use strict';
9440 var _assign = _dereq_(184);
9442 var DOMChildrenOperations = _dereq_(7);
9443 var DOMLazyTree = _dereq_(8);
9444 var ReactDOMComponentTree = _dereq_(45);
9445 var ReactInstrumentation = _dereq_(76);
9447 var escapeTextContentForBrowser = _dereq_(131);
9448 var invariant = _dereq_(173);
9449 var validateDOMNesting = _dereq_(156);
9452  * Text nodes violate a couple assumptions that React makes about components:
9454  *  - When mounting text into the DOM, adjacent text nodes are merged.
9455  *  - Text nodes cannot be assigned a React root ID.
9457  * This component is used to wrap strings between comment nodes so that they
9458  * can undergo the same reconciliation that is applied to elements.
9460  * TODO: Investigate representing React components in the DOM with text nodes.
9462  * @class ReactDOMTextComponent
9463  * @extends ReactComponent
9464  * @internal
9465  */
9466 var ReactDOMTextComponent = function (text) {
9467   // TODO: This is really a ReactText (ReactNode), not a ReactElement
9468   this._currentElement = text;
9469   this._stringText = '' + text;
9470   // ReactDOMComponentTree uses these:
9471   this._nativeNode = null;
9472   this._nativeParent = null;
9474   // Properties
9475   this._domID = null;
9476   this._mountIndex = 0;
9477   this._closingComment = null;
9478   this._commentNodes = null;
9481 _assign(ReactDOMTextComponent.prototype, {
9483   /**
9484    * Creates the markup for this text node. This node is not intended to have
9485    * any features besides containing text content.
9486    *
9487    * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
9488    * @return {string} Markup for this text node.
9489    * @internal
9490    */
9491   mountComponent: function (transaction, nativeParent, nativeContainerInfo, context) {
9492     if ("development" !== 'production') {
9493       ReactInstrumentation.debugTool.onSetText(this._debugID, this._stringText);
9495       var parentInfo;
9496       if (nativeParent != null) {
9497         parentInfo = nativeParent._ancestorInfo;
9498       } else if (nativeContainerInfo != null) {
9499         parentInfo = nativeContainerInfo._ancestorInfo;
9500       }
9501       if (parentInfo) {
9502         // parentInfo should always be present except for the top-level
9503         // component when server rendering
9504         validateDOMNesting('#text', this, parentInfo);
9505       }
9506     }
9508     var domID = nativeContainerInfo._idCounter++;
9509     var openingValue = ' react-text: ' + domID + ' ';
9510     var closingValue = ' /react-text ';
9511     this._domID = domID;
9512     this._nativeParent = nativeParent;
9513     if (transaction.useCreateElement) {
9514       var ownerDocument = nativeContainerInfo._ownerDocument;
9515       var openingComment = ownerDocument.createComment(openingValue);
9516       var closingComment = ownerDocument.createComment(closingValue);
9517       var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
9518       DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
9519       if (this._stringText) {
9520         DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
9521       }
9522       DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
9523       ReactDOMComponentTree.precacheNode(this, openingComment);
9524       this._closingComment = closingComment;
9525       return lazyTree;
9526     } else {
9527       var escapedText = escapeTextContentForBrowser(this._stringText);
9529       if (transaction.renderToStaticMarkup) {
9530         // Normally we'd wrap this between comment nodes for the reasons stated
9531         // above, but since this is a situation where React won't take over
9532         // (static pages), we can simply return the text as it is.
9533         return escapedText;
9534       }
9536       return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
9537     }
9538   },
9540   /**
9541    * Updates this component by updating the text content.
9542    *
9543    * @param {ReactText} nextText The next text content
9544    * @param {ReactReconcileTransaction} transaction
9545    * @internal
9546    */
9547   receiveComponent: function (nextText, transaction) {
9548     if (nextText !== this._currentElement) {
9549       this._currentElement = nextText;
9550       var nextStringText = '' + nextText;
9551       if (nextStringText !== this._stringText) {
9552         // TODO: Save this as pending props and use performUpdateIfNecessary
9553         // and/or updateComponent to do the actual update for consistency with
9554         // other component types?
9555         this._stringText = nextStringText;
9556         var commentNodes = this.getNativeNode();
9557         DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
9559         if ("development" !== 'production') {
9560           ReactInstrumentation.debugTool.onSetText(this._debugID, nextStringText);
9561         }
9562       }
9563     }
9564   },
9566   getNativeNode: function () {
9567     var nativeNode = this._commentNodes;
9568     if (nativeNode) {
9569       return nativeNode;
9570     }
9571     if (!this._closingComment) {
9572       var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
9573       var node = openingComment.nextSibling;
9574       while (true) {
9575         !(node != null) ? "development" !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : invariant(false) : void 0;
9576         if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
9577           this._closingComment = node;
9578           break;
9579         }
9580         node = node.nextSibling;
9581       }
9582     }
9583     nativeNode = [this._nativeNode, this._closingComment];
9584     this._commentNodes = nativeNode;
9585     return nativeNode;
9586   },
9588   unmountComponent: function () {
9589     this._closingComment = null;
9590     this._commentNodes = null;
9591     ReactDOMComponentTree.uncacheNode(this);
9592   }
9596 module.exports = ReactDOMTextComponent;
9597 },{"131":131,"156":156,"173":173,"184":184,"45":45,"7":7,"76":76,"8":8}],59:[function(_dereq_,module,exports){
9599  * Copyright 2013-present, Facebook, Inc.
9600  * All rights reserved.
9602  * This source code is licensed under the BSD-style license found in the
9603  * LICENSE file in the root directory of this source tree. An additional grant
9604  * of patent rights can be found in the PATENTS file in the same directory.
9606  * @providesModule ReactDOMTextarea
9607  */
9609 'use strict';
9611 var _assign = _dereq_(184);
9613 var DisabledInputUtils = _dereq_(14);
9614 var DOMPropertyOperations = _dereq_(11);
9615 var LinkedValueUtils = _dereq_(25);
9616 var ReactDOMComponentTree = _dereq_(45);
9617 var ReactUpdates = _dereq_(104);
9619 var invariant = _dereq_(173);
9620 var warning = _dereq_(183);
9622 var didWarnValueLink = false;
9623 var didWarnValueNull = false;
9624 var didWarnValDefaultVal = false;
9626 function forceUpdateIfMounted() {
9627   if (this._rootNodeID) {
9628     // DOM component is still mounted; update
9629     ReactDOMTextarea.updateWrapper(this);
9630   }
9633 function warnIfValueIsNull(props) {
9634   if (props != null && props.value === null && !didWarnValueNull) {
9635     "development" !== 'production' ? warning(false, '`value` prop on `textarea` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.') : void 0;
9637     didWarnValueNull = true;
9638   }
9642  * Implements a <textarea> native component that allows setting `value`, and
9643  * `defaultValue`. This differs from the traditional DOM API because value is
9644  * usually set as PCDATA children.
9646  * If `value` is not supplied (or null/undefined), user actions that affect the
9647  * value will trigger updates to the element.
9649  * If `value` is supplied (and not null/undefined), the rendered element will
9650  * not trigger updates to the element. Instead, the `value` prop must change in
9651  * order for the rendered element to be updated.
9653  * The rendered element will be initialized with an empty value, the prop
9654  * `defaultValue` if specified, or the children content (deprecated).
9655  */
9656 var ReactDOMTextarea = {
9657   getNativeProps: function (inst, props) {
9658     !(props.dangerouslySetInnerHTML == null) ? "development" !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : invariant(false) : void 0;
9660     // Always set children to the same thing. In IE9, the selection range will
9661     // get reset if `textContent` is mutated.
9662     var nativeProps = _assign({}, DisabledInputUtils.getNativeProps(inst, props), {
9663       defaultValue: undefined,
9664       value: undefined,
9665       children: inst._wrapperState.initialValue,
9666       onChange: inst._wrapperState.onChange
9667     });
9669     return nativeProps;
9670   },
9672   mountWrapper: function (inst, props) {
9673     if ("development" !== 'production') {
9674       LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
9675       if (props.valueLink !== undefined && !didWarnValueLink) {
9676         "development" !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;
9677         didWarnValueLink = true;
9678       }
9679       if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
9680         "development" !== 'production' ? warning(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0;
9681         didWarnValDefaultVal = true;
9682       }
9683       warnIfValueIsNull(props);
9684     }
9686     var defaultValue = props.defaultValue;
9687     // TODO (yungsters): Remove support for children content in <textarea>.
9688     var children = props.children;
9689     if (children != null) {
9690       if ("development" !== 'production') {
9691         "development" !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
9692       }
9693       !(defaultValue == null) ? "development" !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : invariant(false) : void 0;
9694       if (Array.isArray(children)) {
9695         !(children.length <= 1) ? "development" !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : invariant(false) : void 0;
9696         children = children[0];
9697       }
9699       defaultValue = '' + children;
9700     }
9701     if (defaultValue == null) {
9702       defaultValue = '';
9703     }
9704     var value = LinkedValueUtils.getValue(props);
9705     inst._wrapperState = {
9706       // We save the initial value so that `ReactDOMComponent` doesn't update
9707       // `textContent` (unnecessary since we update value).
9708       // The initial value can be a boolean or object so that's why it's
9709       // forced to be a string.
9710       initialValue: '' + (value != null ? value : defaultValue),
9711       listeners: null,
9712       onChange: _handleChange.bind(inst)
9713     };
9714   },
9716   updateWrapper: function (inst) {
9717     var props = inst._currentElement.props;
9719     if ("development" !== 'production') {
9720       warnIfValueIsNull(props);
9721     }
9723     var value = LinkedValueUtils.getValue(props);
9724     if (value != null) {
9725       // Cast `value` to a string to ensure the value is set correctly. While
9726       // browsers typically do this as necessary, jsdom doesn't.
9727       DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'value', '' + value);
9728     }
9729   }
9732 function _handleChange(event) {
9733   var props = this._currentElement.props;
9734   var returnValue = LinkedValueUtils.executeOnChange(props, event);
9735   ReactUpdates.asap(forceUpdateIfMounted, this);
9736   return returnValue;
9739 module.exports = ReactDOMTextarea;
9740 },{"104":104,"11":11,"14":14,"173":173,"183":183,"184":184,"25":25,"45":45}],60:[function(_dereq_,module,exports){
9742  * Copyright 2015-present, Facebook, Inc.
9743  * All rights reserved.
9745  * This source code is licensed under the BSD-style license found in the
9746  * LICENSE file in the root directory of this source tree. An additional grant
9747  * of patent rights can be found in the PATENTS file in the same directory.
9749  * @providesModule ReactDOMTreeTraversal
9750  */
9752 'use strict';
9754 var invariant = _dereq_(173);
9757  * Return the lowest common ancestor of A and B, or null if they are in
9758  * different trees.
9759  */
9760 function getLowestCommonAncestor(instA, instB) {
9761   !('_nativeNode' in instA) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;
9762   !('_nativeNode' in instB) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : invariant(false) : void 0;
9764   var depthA = 0;
9765   for (var tempA = instA; tempA; tempA = tempA._nativeParent) {
9766     depthA++;
9767   }
9768   var depthB = 0;
9769   for (var tempB = instB; tempB; tempB = tempB._nativeParent) {
9770     depthB++;
9771   }
9773   // If A is deeper, crawl up.
9774   while (depthA - depthB > 0) {
9775     instA = instA._nativeParent;
9776     depthA--;
9777   }
9779   // If B is deeper, crawl up.
9780   while (depthB - depthA > 0) {
9781     instB = instB._nativeParent;
9782     depthB--;
9783   }
9785   // Walk in lockstep until we find a match.
9786   var depth = depthA;
9787   while (depth--) {
9788     if (instA === instB) {
9789       return instA;
9790     }
9791     instA = instA._nativeParent;
9792     instB = instB._nativeParent;
9793   }
9794   return null;
9798  * Return if A is an ancestor of B.
9799  */
9800 function isAncestor(instA, instB) {
9801   !('_nativeNode' in instA) ? "development" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;
9802   !('_nativeNode' in instB) ? "development" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : invariant(false) : void 0;
9804   while (instB) {
9805     if (instB === instA) {
9806       return true;
9807     }
9808     instB = instB._nativeParent;
9809   }
9810   return false;
9814  * Return the parent instance of the passed-in instance.
9815  */
9816 function getParentInstance(inst) {
9817   !('_nativeNode' in inst) ? "development" !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : invariant(false) : void 0;
9819   return inst._nativeParent;
9823  * Simulates the traversal of a two-phase, capture/bubble event dispatch.
9824  */
9825 function traverseTwoPhase(inst, fn, arg) {
9826   var path = [];
9827   while (inst) {
9828     path.push(inst);
9829     inst = inst._nativeParent;
9830   }
9831   var i;
9832   for (i = path.length; i-- > 0;) {
9833     fn(path[i], false, arg);
9834   }
9835   for (i = 0; i < path.length; i++) {
9836     fn(path[i], true, arg);
9837   }
9841  * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
9842  * should would receive a `mouseEnter` or `mouseLeave` event.
9844  * Does not invoke the callback on the nearest common ancestor because nothing
9845  * "entered" or "left" that element.
9846  */
9847 function traverseEnterLeave(from, to, fn, argFrom, argTo) {
9848   var common = from && to ? getLowestCommonAncestor(from, to) : null;
9849   var pathFrom = [];
9850   while (from && from !== common) {
9851     pathFrom.push(from);
9852     from = from._nativeParent;
9853   }
9854   var pathTo = [];
9855   while (to && to !== common) {
9856     pathTo.push(to);
9857     to = to._nativeParent;
9858   }
9859   var i;
9860   for (i = 0; i < pathFrom.length; i++) {
9861     fn(pathFrom[i], true, argFrom);
9862   }
9863   for (i = pathTo.length; i-- > 0;) {
9864     fn(pathTo[i], false, argTo);
9865   }
9868 module.exports = {
9869   isAncestor: isAncestor,
9870   getLowestCommonAncestor: getLowestCommonAncestor,
9871   getParentInstance: getParentInstance,
9872   traverseTwoPhase: traverseTwoPhase,
9873   traverseEnterLeave: traverseEnterLeave
9875 },{"173":173}],61:[function(_dereq_,module,exports){
9877  * Copyright 2013-present, Facebook, Inc.
9878  * All rights reserved.
9880  * This source code is licensed under the BSD-style license found in the
9881  * LICENSE file in the root directory of this source tree. An additional grant
9882  * of patent rights can be found in the PATENTS file in the same directory.
9884  * @providesModule ReactDOMUnknownPropertyDevtool
9885  */
9887 'use strict';
9889 var DOMProperty = _dereq_(10);
9890 var EventPluginRegistry = _dereq_(18);
9892 var warning = _dereq_(183);
9894 if ("development" !== 'production') {
9895   var reactProps = {
9896     children: true,
9897     dangerouslySetInnerHTML: true,
9898     key: true,
9899     ref: true
9900   };
9901   var warnedProperties = {};
9903   var warnUnknownProperty = function (name) {
9904     if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
9905       return;
9906     }
9907     if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
9908       return;
9909     }
9911     warnedProperties[name] = true;
9912     var lowerCasedName = name.toLowerCase();
9914     // data-* attributes should be lowercase; suggest the lowercase version
9915     var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
9917     // For now, only warn when we have a suggested correction. This prevents
9918     // logging too much when using transferPropsTo.
9919     "development" !== 'production' ? warning(standardName == null, 'Unknown DOM property %s. Did you mean %s?', name, standardName) : void 0;
9921     var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
9923     "development" !== 'production' ? warning(registrationName == null, 'Unknown event handler property %s. Did you mean `%s`?', name, registrationName) : void 0;
9924   };
9927 var ReactDOMUnknownPropertyDevtool = {
9928   onCreateMarkupForProperty: function (name, value) {
9929     warnUnknownProperty(name);
9930   },
9931   onSetValueForProperty: function (node, name, value) {
9932     warnUnknownProperty(name);
9933   },
9934   onDeleteValueForProperty: function (node, name) {
9935     warnUnknownProperty(name);
9936   }
9939 module.exports = ReactDOMUnknownPropertyDevtool;
9940 },{"10":10,"18":18,"183":183}],62:[function(_dereq_,module,exports){
9942  * Copyright 2016-present, Facebook, Inc.
9943  * All rights reserved.
9945  * This source code is licensed under the BSD-style license found in the
9946  * LICENSE file in the root directory of this source tree. An additional grant
9947  * of patent rights can be found in the PATENTS file in the same directory.
9949  * @providesModule ReactDebugTool
9950  */
9952 'use strict';
9954 var ExecutionEnvironment = _dereq_(159);
9956 var performanceNow = _dereq_(181);
9957 var warning = _dereq_(183);
9959 var eventHandlers = [];
9960 var handlerDoesThrowForEvent = {};
9962 function emitEvent(handlerFunctionName, arg1, arg2, arg3, arg4, arg5) {
9963   if ("development" !== 'production') {
9964     eventHandlers.forEach(function (handler) {
9965       try {
9966         if (handler[handlerFunctionName]) {
9967           handler[handlerFunctionName](arg1, arg2, arg3, arg4, arg5);
9968         }
9969       } catch (e) {
9970         "development" !== 'production' ? warning(!handlerDoesThrowForEvent[handlerFunctionName], 'exception thrown by devtool while handling %s: %s', handlerFunctionName, e.message) : void 0;
9971         handlerDoesThrowForEvent[handlerFunctionName] = true;
9972       }
9973     });
9974   }
9977 var isProfiling = false;
9978 var flushHistory = [];
9979 var currentFlushNesting = 0;
9980 var currentFlushMeasurements = null;
9981 var currentFlushStartTime = null;
9982 var currentTimerDebugID = null;
9983 var currentTimerStartTime = null;
9984 var currentTimerType = null;
9986 function clearHistory() {
9987   ReactComponentTreeDevtool.purgeUnmountedComponents();
9988   ReactNativeOperationHistoryDevtool.clearHistory();
9991 function getTreeSnapshot(registeredIDs) {
9992   return registeredIDs.reduce(function (tree, id) {
9993     var ownerID = ReactComponentTreeDevtool.getOwnerID(id);
9994     var parentID = ReactComponentTreeDevtool.getParentID(id);
9995     tree[id] = {
9996       displayName: ReactComponentTreeDevtool.getDisplayName(id),
9997       text: ReactComponentTreeDevtool.getText(id),
9998       updateCount: ReactComponentTreeDevtool.getUpdateCount(id),
9999       childIDs: ReactComponentTreeDevtool.getChildIDs(id),
10000       // Text nodes don't have owners but this is close enough.
10001       ownerID: ownerID || ReactComponentTreeDevtool.getOwnerID(parentID),
10002       parentID: parentID
10003     };
10004     return tree;
10005   }, {});
10008 function resetMeasurements() {
10009   if ("development" !== 'production') {
10010     var previousStartTime = currentFlushStartTime;
10011     var previousMeasurements = currentFlushMeasurements || [];
10012     var previousOperations = ReactNativeOperationHistoryDevtool.getHistory();
10014     if (!isProfiling || currentFlushNesting === 0) {
10015       currentFlushStartTime = null;
10016       currentFlushMeasurements = null;
10017       clearHistory();
10018       return;
10019     }
10021     if (previousMeasurements.length || previousOperations.length) {
10022       var registeredIDs = ReactComponentTreeDevtool.getRegisteredIDs();
10023       flushHistory.push({
10024         duration: performanceNow() - previousStartTime,
10025         measurements: previousMeasurements || [],
10026         operations: previousOperations || [],
10027         treeSnapshot: getTreeSnapshot(registeredIDs)
10028       });
10029     }
10031     clearHistory();
10032     currentFlushStartTime = performanceNow();
10033     currentFlushMeasurements = [];
10034   }
10037 function checkDebugID(debugID) {
10038   "development" !== 'production' ? warning(debugID, 'ReactDebugTool: debugID may not be empty.') : void 0;
10041 var ReactDebugTool = {
10042   addDevtool: function (devtool) {
10043     eventHandlers.push(devtool);
10044   },
10045   removeDevtool: function (devtool) {
10046     for (var i = 0; i < eventHandlers.length; i++) {
10047       if (eventHandlers[i] === devtool) {
10048         eventHandlers.splice(i, 1);
10049         i--;
10050       }
10051     }
10052   },
10053   beginProfiling: function () {
10054     if ("development" !== 'production') {
10055       if (isProfiling) {
10056         return;
10057       }
10059       isProfiling = true;
10060       flushHistory.length = 0;
10061       resetMeasurements();
10062     }
10063   },
10064   endProfiling: function () {
10065     if ("development" !== 'production') {
10066       if (!isProfiling) {
10067         return;
10068       }
10070       isProfiling = false;
10071       resetMeasurements();
10072     }
10073   },
10074   getFlushHistory: function () {
10075     if ("development" !== 'production') {
10076       return flushHistory;
10077     }
10078   },
10079   onBeginFlush: function () {
10080     if ("development" !== 'production') {
10081       currentFlushNesting++;
10082       resetMeasurements();
10083     }
10084     emitEvent('onBeginFlush');
10085   },
10086   onEndFlush: function () {
10087     if ("development" !== 'production') {
10088       resetMeasurements();
10089       currentFlushNesting--;
10090     }
10091     emitEvent('onEndFlush');
10092   },
10093   onBeginLifeCycleTimer: function (debugID, timerType) {
10094     checkDebugID(debugID);
10095     emitEvent('onBeginLifeCycleTimer', debugID, timerType);
10096     if ("development" !== 'production') {
10097       if (isProfiling && currentFlushNesting > 0) {
10098         "development" !== 'production' ? warning(!currentTimerType, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
10099         currentTimerStartTime = performanceNow();
10100         currentTimerDebugID = debugID;
10101         currentTimerType = timerType;
10102       }
10103     }
10104   },
10105   onEndLifeCycleTimer: function (debugID, timerType) {
10106     checkDebugID(debugID);
10107     if ("development" !== 'production') {
10108       if (isProfiling && currentFlushNesting > 0) {
10109         "development" !== 'production' ? warning(currentTimerType === timerType, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0;
10110         currentFlushMeasurements.push({
10111           timerType: timerType,
10112           instanceID: debugID,
10113           duration: performanceNow() - currentTimerStartTime
10114         });
10115         currentTimerStartTime = null;
10116         currentTimerDebugID = null;
10117         currentTimerType = null;
10118       }
10119     }
10120     emitEvent('onEndLifeCycleTimer', debugID, timerType);
10121   },
10122   onBeginReconcilerTimer: function (debugID, timerType) {
10123     checkDebugID(debugID);
10124     emitEvent('onBeginReconcilerTimer', debugID, timerType);
10125   },
10126   onEndReconcilerTimer: function (debugID, timerType) {
10127     checkDebugID(debugID);
10128     emitEvent('onEndReconcilerTimer', debugID, timerType);
10129   },
10130   onBeginProcessingChildContext: function () {
10131     emitEvent('onBeginProcessingChildContext');
10132   },
10133   onEndProcessingChildContext: function () {
10134     emitEvent('onEndProcessingChildContext');
10135   },
10136   onNativeOperation: function (debugID, type, payload) {
10137     checkDebugID(debugID);
10138     emitEvent('onNativeOperation', debugID, type, payload);
10139   },
10140   onSetState: function () {
10141     emitEvent('onSetState');
10142   },
10143   onSetDisplayName: function (debugID, displayName) {
10144     checkDebugID(debugID);
10145     emitEvent('onSetDisplayName', debugID, displayName);
10146   },
10147   onSetChildren: function (debugID, childDebugIDs) {
10148     checkDebugID(debugID);
10149     emitEvent('onSetChildren', debugID, childDebugIDs);
10150   },
10151   onSetOwner: function (debugID, ownerDebugID) {
10152     checkDebugID(debugID);
10153     emitEvent('onSetOwner', debugID, ownerDebugID);
10154   },
10155   onSetText: function (debugID, text) {
10156     checkDebugID(debugID);
10157     emitEvent('onSetText', debugID, text);
10158   },
10159   onMountRootComponent: function (debugID) {
10160     checkDebugID(debugID);
10161     emitEvent('onMountRootComponent', debugID);
10162   },
10163   onMountComponent: function (debugID) {
10164     checkDebugID(debugID);
10165     emitEvent('onMountComponent', debugID);
10166   },
10167   onUpdateComponent: function (debugID) {
10168     checkDebugID(debugID);
10169     emitEvent('onUpdateComponent', debugID);
10170   },
10171   onUnmountComponent: function (debugID) {
10172     checkDebugID(debugID);
10173     emitEvent('onUnmountComponent', debugID);
10174   }
10177 if ("development" !== 'production') {
10178   var ReactInvalidSetStateWarningDevTool = _dereq_(77);
10179   var ReactNativeOperationHistoryDevtool = _dereq_(84);
10180   var ReactComponentTreeDevtool = _dereq_(37);
10181   ReactDebugTool.addDevtool(ReactInvalidSetStateWarningDevTool);
10182   ReactDebugTool.addDevtool(ReactComponentTreeDevtool);
10183   ReactDebugTool.addDevtool(ReactNativeOperationHistoryDevtool);
10184   var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
10185   if (/[?&]react_perf\b/.test(url)) {
10186     ReactDebugTool.beginProfiling();
10187   }
10190 module.exports = ReactDebugTool;
10191 },{"159":159,"181":181,"183":183,"37":37,"77":77,"84":84}],63:[function(_dereq_,module,exports){
10193  * Copyright 2013-present, Facebook, Inc.
10194  * All rights reserved.
10196  * This source code is licensed under the BSD-style license found in the
10197  * LICENSE file in the root directory of this source tree. An additional grant
10198  * of patent rights can be found in the PATENTS file in the same directory.
10200  * @providesModule ReactDefaultBatchingStrategy
10201  */
10203 'use strict';
10205 var _assign = _dereq_(184);
10207 var ReactUpdates = _dereq_(104);
10208 var Transaction = _dereq_(124);
10210 var emptyFunction = _dereq_(165);
10212 var RESET_BATCHED_UPDATES = {
10213   initialize: emptyFunction,
10214   close: function () {
10215     ReactDefaultBatchingStrategy.isBatchingUpdates = false;
10216   }
10219 var FLUSH_BATCHED_UPDATES = {
10220   initialize: emptyFunction,
10221   close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
10224 var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
10226 function ReactDefaultBatchingStrategyTransaction() {
10227   this.reinitializeTransaction();
10230 _assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
10231   getTransactionWrappers: function () {
10232     return TRANSACTION_WRAPPERS;
10233   }
10236 var transaction = new ReactDefaultBatchingStrategyTransaction();
10238 var ReactDefaultBatchingStrategy = {
10239   isBatchingUpdates: false,
10241   /**
10242    * Call the provided function in a context within which calls to `setState`
10243    * and friends are batched such that components aren't updated unnecessarily.
10244    */
10245   batchedUpdates: function (callback, a, b, c, d, e) {
10246     var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
10248     ReactDefaultBatchingStrategy.isBatchingUpdates = true;
10250     // The code is written this way to avoid extra allocations
10251     if (alreadyBatchingUpdates) {
10252       callback(a, b, c, d, e);
10253     } else {
10254       transaction.perform(callback, null, a, b, c, d, e);
10255     }
10256   }
10259 module.exports = ReactDefaultBatchingStrategy;
10260 },{"104":104,"124":124,"165":165,"184":184}],64:[function(_dereq_,module,exports){
10262  * Copyright 2013-present, Facebook, Inc.
10263  * All rights reserved.
10265  * This source code is licensed under the BSD-style license found in the
10266  * LICENSE file in the root directory of this source tree. An additional grant
10267  * of patent rights can be found in the PATENTS file in the same directory.
10269  * @providesModule ReactDefaultInjection
10270  */
10272 'use strict';
10274 var BeforeInputEventPlugin = _dereq_(2);
10275 var ChangeEventPlugin = _dereq_(6);
10276 var DefaultEventPluginOrder = _dereq_(13);
10277 var EnterLeaveEventPlugin = _dereq_(15);
10278 var HTMLDOMPropertyConfig = _dereq_(22);
10279 var ReactComponentBrowserEnvironment = _dereq_(35);
10280 var ReactDOMComponent = _dereq_(43);
10281 var ReactDOMComponentTree = _dereq_(45);
10282 var ReactDOMEmptyComponent = _dereq_(48);
10283 var ReactDOMTreeTraversal = _dereq_(60);
10284 var ReactDOMTextComponent = _dereq_(58);
10285 var ReactDefaultBatchingStrategy = _dereq_(63);
10286 var ReactEventListener = _dereq_(70);
10287 var ReactInjection = _dereq_(73);
10288 var ReactReconcileTransaction = _dereq_(92);
10289 var SVGDOMPropertyConfig = _dereq_(108);
10290 var SelectEventPlugin = _dereq_(109);
10291 var SimpleEventPlugin = _dereq_(110);
10293 var alreadyInjected = false;
10295 function inject() {
10296   if (alreadyInjected) {
10297     // TODO: This is currently true because these injections are shared between
10298     // the client and the server package. They should be built independently
10299     // and not share any injection state. Then this problem will be solved.
10300     return;
10301   }
10302   alreadyInjected = true;
10304   ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
10306   /**
10307    * Inject modules for resolving DOM hierarchy and plugin ordering.
10308    */
10309   ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
10310   ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
10311   ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
10313   /**
10314    * Some important event plugins included by default (without having to require
10315    * them).
10316    */
10317   ReactInjection.EventPluginHub.injectEventPluginsByName({
10318     SimpleEventPlugin: SimpleEventPlugin,
10319     EnterLeaveEventPlugin: EnterLeaveEventPlugin,
10320     ChangeEventPlugin: ChangeEventPlugin,
10321     SelectEventPlugin: SelectEventPlugin,
10322     BeforeInputEventPlugin: BeforeInputEventPlugin
10323   });
10325   ReactInjection.NativeComponent.injectGenericComponentClass(ReactDOMComponent);
10327   ReactInjection.NativeComponent.injectTextComponentClass(ReactDOMTextComponent);
10329   ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
10330   ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
10332   ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
10333     return new ReactDOMEmptyComponent(instantiate);
10334   });
10336   ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
10337   ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
10339   ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
10342 module.exports = {
10343   inject: inject
10345 },{"108":108,"109":109,"110":110,"13":13,"15":15,"2":2,"22":22,"35":35,"43":43,"45":45,"48":48,"58":58,"6":6,"60":60,"63":63,"70":70,"73":73,"92":92}],65:[function(_dereq_,module,exports){
10347  * Copyright 2014-present, Facebook, Inc.
10348  * All rights reserved.
10350  * This source code is licensed under the BSD-style license found in the
10351  * LICENSE file in the root directory of this source tree. An additional grant
10352  * of patent rights can be found in the PATENTS file in the same directory.
10354  * @providesModule ReactElement
10355  */
10357 'use strict';
10359 var _assign = _dereq_(184);
10361 var ReactCurrentOwner = _dereq_(40);
10363 var warning = _dereq_(183);
10364 var canDefineProperty = _dereq_(128);
10366 // The Symbol used to tag the ReactElement type. If there is no native Symbol
10367 // nor polyfill, then a plain number is used for performance.
10368 var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
10370 var RESERVED_PROPS = {
10371   key: true,
10372   ref: true,
10373   __self: true,
10374   __source: true
10377 var specialPropKeyWarningShown, specialPropRefWarningShown;
10380  * Factory method to create a new React element. This no longer adheres to
10381  * the class pattern, so do not use new to call it. Also, no instanceof check
10382  * will work. Instead test $$typeof field against Symbol.for('react.element') to check
10383  * if something is a React Element.
10385  * @param {*} type
10386  * @param {*} key
10387  * @param {string|object} ref
10388  * @param {*} self A *temporary* helper to detect places where `this` is
10389  * different from the `owner` when React.createElement is called, so that we
10390  * can warn. We want to get rid of owner and replace string `ref`s with arrow
10391  * functions, and as long as `this` and owner are the same, there will be no
10392  * change in behavior.
10393  * @param {*} source An annotation object (added by a transpiler or otherwise)
10394  * indicating filename, line number, and/or other information.
10395  * @param {*} owner
10396  * @param {*} props
10397  * @internal
10398  */
10399 var ReactElement = function (type, key, ref, self, source, owner, props) {
10400   var element = {
10401     // This tag allow us to uniquely identify this as a React Element
10402     $$typeof: REACT_ELEMENT_TYPE,
10404     // Built-in properties that belong on the element
10405     type: type,
10406     key: key,
10407     ref: ref,
10408     props: props,
10410     // Record the component responsible for creating this element.
10411     _owner: owner
10412   };
10414   if ("development" !== 'production') {
10415     // The validation flag is currently mutative. We put it on
10416     // an external backing store so that we can freeze the whole object.
10417     // This can be replaced with a WeakMap once they are implemented in
10418     // commonly used development environments.
10419     element._store = {};
10421     // To make comparing ReactElements easier for testing purposes, we make
10422     // the validation flag non-enumerable (where possible, which should
10423     // include every environment we run tests in), so the test framework
10424     // ignores it.
10425     if (canDefineProperty) {
10426       Object.defineProperty(element._store, 'validated', {
10427         configurable: false,
10428         enumerable: false,
10429         writable: true,
10430         value: false
10431       });
10432       // self and source are DEV only properties.
10433       Object.defineProperty(element, '_self', {
10434         configurable: false,
10435         enumerable: false,
10436         writable: false,
10437         value: self
10438       });
10439       // Two elements created in two different places should be considered
10440       // equal for testing purposes and therefore we hide it from enumeration.
10441       Object.defineProperty(element, '_source', {
10442         configurable: false,
10443         enumerable: false,
10444         writable: false,
10445         value: source
10446       });
10447     } else {
10448       element._store.validated = false;
10449       element._self = self;
10450       element._source = source;
10451     }
10452     if (Object.freeze) {
10453       Object.freeze(element.props);
10454       Object.freeze(element);
10455     }
10456   }
10458   return element;
10462  * Create and return a new ReactElement of the given type.
10463  * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
10464  */
10465 ReactElement.createElement = function (type, config, children) {
10466   var propName;
10468   // Reserved names are extracted
10469   var props = {};
10471   var key = null;
10472   var ref = null;
10473   var self = null;
10474   var source = null;
10476   if (config != null) {
10477     if ("development" !== 'production') {
10478       "development" !== 'production' ? warning(
10479       /* eslint-disable no-proto */
10480       config.__proto__ == null || config.__proto__ === Object.prototype,
10481       /* eslint-enable no-proto */
10482       'React.createElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
10483       ref = !config.hasOwnProperty('ref') || Object.getOwnPropertyDescriptor(config, 'ref').get ? null : config.ref;
10484       key = !config.hasOwnProperty('key') || Object.getOwnPropertyDescriptor(config, 'key').get ? null : '' + config.key;
10485     } else {
10486       ref = config.ref === undefined ? null : config.ref;
10487       key = config.key === undefined ? null : '' + config.key;
10488     }
10489     self = config.__self === undefined ? null : config.__self;
10490     source = config.__source === undefined ? null : config.__source;
10491     // Remaining properties are added to a new props object
10492     for (propName in config) {
10493       if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
10494         props[propName] = config[propName];
10495       }
10496     }
10497   }
10499   // Children can be more than one argument, and those are transferred onto
10500   // the newly allocated props object.
10501   var childrenLength = arguments.length - 2;
10502   if (childrenLength === 1) {
10503     props.children = children;
10504   } else if (childrenLength > 1) {
10505     var childArray = Array(childrenLength);
10506     for (var i = 0; i < childrenLength; i++) {
10507       childArray[i] = arguments[i + 2];
10508     }
10509     props.children = childArray;
10510   }
10512   // Resolve default props
10513   if (type && type.defaultProps) {
10514     var defaultProps = type.defaultProps;
10515     for (propName in defaultProps) {
10516       if (props[propName] === undefined) {
10517         props[propName] = defaultProps[propName];
10518       }
10519     }
10520   }
10521   if ("development" !== 'production') {
10522     // Create dummy `key` and `ref` property to `props` to warn users
10523     // against its use
10524     if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
10525       if (!props.hasOwnProperty('key')) {
10526         Object.defineProperty(props, 'key', {
10527           get: function () {
10528             if (!specialPropKeyWarningShown) {
10529               specialPropKeyWarningShown = true;
10530               "development" !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0;
10531             }
10532             return undefined;
10533           },
10534           configurable: true
10535         });
10536       }
10537       if (!props.hasOwnProperty('ref')) {
10538         Object.defineProperty(props, 'ref', {
10539           get: function () {
10540             if (!specialPropRefWarningShown) {
10541               specialPropRefWarningShown = true;
10542               "development" !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element') : void 0;
10543             }
10544             return undefined;
10545           },
10546           configurable: true
10547         });
10548       }
10549     }
10550   }
10551   return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
10555  * Return a function that produces ReactElements of a given type.
10556  * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
10557  */
10558 ReactElement.createFactory = function (type) {
10559   var factory = ReactElement.createElement.bind(null, type);
10560   // Expose the type on the factory and the prototype so that it can be
10561   // easily accessed on elements. E.g. `<Foo />.type === Foo`.
10562   // This should not be named `constructor` since this may not be the function
10563   // that created the element, and it may not even be a constructor.
10564   // Legacy hook TODO: Warn if this is accessed
10565   factory.type = type;
10566   return factory;
10569 ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
10570   var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
10572   return newElement;
10576  * Clone and return a new ReactElement using element as the starting point.
10577  * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
10578  */
10579 ReactElement.cloneElement = function (element, config, children) {
10580   var propName;
10582   // Original props are copied
10583   var props = _assign({}, element.props);
10585   // Reserved names are extracted
10586   var key = element.key;
10587   var ref = element.ref;
10588   // Self is preserved since the owner is preserved.
10589   var self = element._self;
10590   // Source is preserved since cloneElement is unlikely to be targeted by a
10591   // transpiler, and the original source is probably a better indicator of the
10592   // true owner.
10593   var source = element._source;
10595   // Owner will be preserved, unless ref is overridden
10596   var owner = element._owner;
10598   if (config != null) {
10599     if ("development" !== 'production') {
10600       "development" !== 'production' ? warning(
10601       /* eslint-disable no-proto */
10602       config.__proto__ == null || config.__proto__ === Object.prototype,
10603       /* eslint-enable no-proto */
10604       'React.cloneElement(...): Expected props argument to be a plain object. ' + 'Properties defined in its prototype chain will be ignored.') : void 0;
10605     }
10606     if (config.ref !== undefined) {
10607       // Silently steal the ref from the parent.
10608       ref = config.ref;
10609       owner = ReactCurrentOwner.current;
10610     }
10611     if (config.key !== undefined) {
10612       key = '' + config.key;
10613     }
10614     // Remaining properties override existing props
10615     var defaultProps;
10616     if (element.type && element.type.defaultProps) {
10617       defaultProps = element.type.defaultProps;
10618     }
10619     for (propName in config) {
10620       if (config.hasOwnProperty(propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
10621         if (config[propName] === undefined && defaultProps !== undefined) {
10622           // Resolve default props
10623           props[propName] = defaultProps[propName];
10624         } else {
10625           props[propName] = config[propName];
10626         }
10627       }
10628     }
10629   }
10631   // Children can be more than one argument, and those are transferred onto
10632   // the newly allocated props object.
10633   var childrenLength = arguments.length - 2;
10634   if (childrenLength === 1) {
10635     props.children = children;
10636   } else if (childrenLength > 1) {
10637     var childArray = Array(childrenLength);
10638     for (var i = 0; i < childrenLength; i++) {
10639       childArray[i] = arguments[i + 2];
10640     }
10641     props.children = childArray;
10642   }
10644   return ReactElement(element.type, key, ref, self, source, owner, props);
10648  * Verifies the object is a ReactElement.
10649  * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
10650  * @param {?object} object
10651  * @return {boolean} True if `object` is a valid component.
10652  * @final
10653  */
10654 ReactElement.isValidElement = function (object) {
10655   return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
10658 module.exports = ReactElement;
10659 },{"128":128,"183":183,"184":184,"40":40}],66:[function(_dereq_,module,exports){
10661  * Copyright 2014-present, Facebook, Inc.
10662  * All rights reserved.
10664  * This source code is licensed under the BSD-style license found in the
10665  * LICENSE file in the root directory of this source tree. An additional grant
10666  * of patent rights can be found in the PATENTS file in the same directory.
10668  * @providesModule ReactElementValidator
10669  */
10672  * ReactElementValidator provides a wrapper around a element factory
10673  * which validates the props passed to the element. This is intended to be
10674  * used only in DEV and could be replaced by a static type checker for languages
10675  * that support it.
10676  */
10678 'use strict';
10680 var ReactElement = _dereq_(65);
10681 var ReactPropTypeLocations = _dereq_(90);
10682 var ReactPropTypeLocationNames = _dereq_(89);
10683 var ReactCurrentOwner = _dereq_(40);
10685 var canDefineProperty = _dereq_(128);
10686 var getIteratorFn = _dereq_(139);
10687 var invariant = _dereq_(173);
10688 var warning = _dereq_(183);
10690 function getDeclarationErrorAddendum() {
10691   if (ReactCurrentOwner.current) {
10692     var name = ReactCurrentOwner.current.getName();
10693     if (name) {
10694       return ' Check the render method of `' + name + '`.';
10695     }
10696   }
10697   return '';
10701  * Warn if there's no key explicitly set on dynamic arrays of children or
10702  * object keys are not valid. This allows us to keep track of children between
10703  * updates.
10704  */
10705 var ownerHasKeyUseWarning = {};
10707 var loggedTypeFailures = {};
10710  * Warn if the element doesn't have an explicit key assigned to it.
10711  * This element is in an array. The array could grow and shrink or be
10712  * reordered. All children that haven't already been validated are required to
10713  * have a "key" property assigned to it.
10715  * @internal
10716  * @param {ReactElement} element Element that requires a key.
10717  * @param {*} parentType element's parent's type.
10718  */
10719 function validateExplicitKey(element, parentType) {
10720   if (!element._store || element._store.validated || element.key != null) {
10721     return;
10722   }
10723   element._store.validated = true;
10725   var addenda = getAddendaForKeyUse('uniqueKey', element, parentType);
10726   if (addenda === null) {
10727     // we already showed the warning
10728     return;
10729   }
10730   "development" !== '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 || '') : void 0;
10734  * Shared warning and monitoring code for the key warnings.
10736  * @internal
10737  * @param {string} messageType A key used for de-duping warnings.
10738  * @param {ReactElement} element Component that requires a key.
10739  * @param {*} parentType element's parent's type.
10740  * @returns {?object} A set of addenda to use in the warning message, or null
10741  * if the warning has already been shown before (and shouldn't be shown again).
10742  */
10743 function getAddendaForKeyUse(messageType, element, parentType) {
10744   var addendum = getDeclarationErrorAddendum();
10745   if (!addendum) {
10746     var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
10747     if (parentName) {
10748       addendum = ' Check the top-level render call using <' + parentName + '>.';
10749     }
10750   }
10752   var memoizer = ownerHasKeyUseWarning[messageType] || (ownerHasKeyUseWarning[messageType] = {});
10753   if (memoizer[addendum]) {
10754     return null;
10755   }
10756   memoizer[addendum] = true;
10758   var addenda = {
10759     parentOrOwner: addendum,
10760     url: ' See https://fb.me/react-warning-keys for more information.',
10761     childOwner: null
10762   };
10764   // Usually the current owner is the offender, but if it accepts children as a
10765   // property, it may be the creator of the child that's responsible for
10766   // assigning it a key.
10767   if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
10768     // Give the component that originally created this child.
10769     addenda.childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
10770   }
10772   return addenda;
10776  * Ensure that every element either is passed in a static location, in an
10777  * array with an explicit keys property defined, or in an object literal
10778  * with valid key property.
10780  * @internal
10781  * @param {ReactNode} node Statically passed child of any type.
10782  * @param {*} parentType node's parent's type.
10783  */
10784 function validateChildKeys(node, parentType) {
10785   if (typeof node !== 'object') {
10786     return;
10787   }
10788   if (Array.isArray(node)) {
10789     for (var i = 0; i < node.length; i++) {
10790       var child = node[i];
10791       if (ReactElement.isValidElement(child)) {
10792         validateExplicitKey(child, parentType);
10793       }
10794     }
10795   } else if (ReactElement.isValidElement(node)) {
10796     // This element was passed in a valid location.
10797     if (node._store) {
10798       node._store.validated = true;
10799     }
10800   } else if (node) {
10801     var iteratorFn = getIteratorFn(node);
10802     // Entry iterators provide implicit keys.
10803     if (iteratorFn) {
10804       if (iteratorFn !== node.entries) {
10805         var iterator = iteratorFn.call(node);
10806         var step;
10807         while (!(step = iterator.next()).done) {
10808           if (ReactElement.isValidElement(step.value)) {
10809             validateExplicitKey(step.value, parentType);
10810           }
10811         }
10812       }
10813     }
10814   }
10818  * Assert that the props are valid
10820  * @param {string} componentName Name of the component for error messages.
10821  * @param {object} propTypes Map of prop name to a ReactPropType
10822  * @param {object} props
10823  * @param {string} location e.g. "prop", "context", "child context"
10824  * @private
10825  */
10826 function checkPropTypes(componentName, propTypes, props, location) {
10827   for (var propName in propTypes) {
10828     if (propTypes.hasOwnProperty(propName)) {
10829       var error;
10830       // Prop type validation may throw. In case they do, we don't want to
10831       // fail the render phase where it didn't fail before. So we log it.
10832       // After these have been cleaned up, we'll let them throw.
10833       try {
10834         // This is intentionally an invariant that gets caught. It's the same
10835         // behavior as without this statement except with a better message.
10836         !(typeof propTypes[propName] === 'function') ? "development" !== '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) : void 0;
10837         error = propTypes[propName](props, propName, componentName, location);
10838       } catch (ex) {
10839         error = ex;
10840       }
10841       "development" !== '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) : void 0;
10842       if (error instanceof Error && !(error.message in loggedTypeFailures)) {
10843         // Only monitor this failure once because there tends to be a lot of the
10844         // same error.
10845         loggedTypeFailures[error.message] = true;
10847         var addendum = getDeclarationErrorAddendum();
10848         "development" !== 'production' ? warning(false, 'Failed propType: %s%s', error.message, addendum) : void 0;
10849       }
10850     }
10851   }
10855  * Given an element, validate that its props follow the propTypes definition,
10856  * provided by the type.
10858  * @param {ReactElement} element
10859  */
10860 function validatePropTypes(element) {
10861   var componentClass = element.type;
10862   if (typeof componentClass !== 'function') {
10863     return;
10864   }
10865   var name = componentClass.displayName || componentClass.name;
10866   if (componentClass.propTypes) {
10867     checkPropTypes(name, componentClass.propTypes, element.props, ReactPropTypeLocations.prop);
10868   }
10869   if (typeof componentClass.getDefaultProps === 'function') {
10870     "development" !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
10871   }
10874 var ReactElementValidator = {
10876   createElement: function (type, props, children) {
10877     var validType = typeof type === 'string' || typeof type === 'function';
10878     // We warn in this case but don't throw. We expect the element creation to
10879     // succeed and there will likely be errors in render.
10880     "development" !== '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()) : void 0;
10882     var element = ReactElement.createElement.apply(this, arguments);
10884     // The result can be nullish if a mock or a custom function is used.
10885     // TODO: Drop this when these are no longer allowed as the type argument.
10886     if (element == null) {
10887       return element;
10888     }
10890     // Skip key warning if the type isn't valid since our key validation logic
10891     // doesn't expect a non-string/function type and can throw confusing errors.
10892     // We don't want exception behavior to differ between dev and prod.
10893     // (Rendering will throw with a helpful message and as soon as the type is
10894     // fixed, the key warnings will appear.)
10895     if (validType) {
10896       for (var i = 2; i < arguments.length; i++) {
10897         validateChildKeys(arguments[i], type);
10898       }
10899     }
10901     validatePropTypes(element);
10903     return element;
10904   },
10906   createFactory: function (type) {
10907     var validatedFactory = ReactElementValidator.createElement.bind(null, type);
10908     // Legacy hook TODO: Warn if this is accessed
10909     validatedFactory.type = type;
10911     if ("development" !== 'production') {
10912       if (canDefineProperty) {
10913         Object.defineProperty(validatedFactory, 'type', {
10914           enumerable: false,
10915           get: function () {
10916             "development" !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;
10917             Object.defineProperty(this, 'type', {
10918               value: type
10919             });
10920             return type;
10921           }
10922         });
10923       }
10924     }
10926     return validatedFactory;
10927   },
10929   cloneElement: function (element, props, children) {
10930     var newElement = ReactElement.cloneElement.apply(this, arguments);
10931     for (var i = 2; i < arguments.length; i++) {
10932       validateChildKeys(arguments[i], newElement.type);
10933     }
10934     validatePropTypes(newElement);
10935     return newElement;
10936   }
10940 module.exports = ReactElementValidator;
10941 },{"128":128,"139":139,"173":173,"183":183,"40":40,"65":65,"89":89,"90":90}],67:[function(_dereq_,module,exports){
10943  * Copyright 2014-present, Facebook, Inc.
10944  * All rights reserved.
10946  * This source code is licensed under the BSD-style license found in the
10947  * LICENSE file in the root directory of this source tree. An additional grant
10948  * of patent rights can be found in the PATENTS file in the same directory.
10950  * @providesModule ReactEmptyComponent
10951  */
10953 'use strict';
10955 var emptyComponentFactory;
10957 var ReactEmptyComponentInjection = {
10958   injectEmptyComponentFactory: function (factory) {
10959     emptyComponentFactory = factory;
10960   }
10963 var ReactEmptyComponent = {
10964   create: function (instantiate) {
10965     return emptyComponentFactory(instantiate);
10966   }
10969 ReactEmptyComponent.injection = ReactEmptyComponentInjection;
10971 module.exports = ReactEmptyComponent;
10972 },{}],68:[function(_dereq_,module,exports){
10974  * Copyright 2013-present, Facebook, Inc.
10975  * All rights reserved.
10977  * This source code is licensed under the BSD-style license found in the
10978  * LICENSE file in the root directory of this source tree. An additional grant
10979  * of patent rights can be found in the PATENTS file in the same directory.
10981  * @providesModule ReactErrorUtils
10982  */
10984 'use strict';
10986 var caughtError = null;
10989  * Call a function while guarding against errors that happens within it.
10991  * @param {?String} name of the guard to use for logging or debugging
10992  * @param {Function} func The function to invoke
10993  * @param {*} a First argument
10994  * @param {*} b Second argument
10995  */
10996 function invokeGuardedCallback(name, func, a, b) {
10997   try {
10998     return func(a, b);
10999   } catch (x) {
11000     if (caughtError === null) {
11001       caughtError = x;
11002     }
11003     return undefined;
11004   }
11007 var ReactErrorUtils = {
11008   invokeGuardedCallback: invokeGuardedCallback,
11010   /**
11011    * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
11012    * handler are sure to be rethrown by rethrowCaughtError.
11013    */
11014   invokeGuardedCallbackWithCatch: invokeGuardedCallback,
11016   /**
11017    * During execution of guarded functions we will capture the first error which
11018    * we will rethrow to be handled by the top level error handler.
11019    */
11020   rethrowCaughtError: function () {
11021     if (caughtError) {
11022       var error = caughtError;
11023       caughtError = null;
11024       throw error;
11025     }
11026   }
11029 if ("development" !== 'production') {
11030   /**
11031    * To help development we can get better devtools integration by simulating a
11032    * real browser event.
11033    */
11034   if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
11035     var fakeNode = document.createElement('react');
11036     ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
11037       var boundFunc = func.bind(null, a, b);
11038       var evtType = 'react-' + name;
11039       fakeNode.addEventListener(evtType, boundFunc, false);
11040       var evt = document.createEvent('Event');
11041       evt.initEvent(evtType, false, false);
11042       fakeNode.dispatchEvent(evt);
11043       fakeNode.removeEventListener(evtType, boundFunc, false);
11044     };
11045   }
11048 module.exports = ReactErrorUtils;
11049 },{}],69:[function(_dereq_,module,exports){
11051  * Copyright 2013-present, Facebook, Inc.
11052  * All rights reserved.
11054  * This source code is licensed under the BSD-style license found in the
11055  * LICENSE file in the root directory of this source tree. An additional grant
11056  * of patent rights can be found in the PATENTS file in the same directory.
11058  * @providesModule ReactEventEmitterMixin
11059  */
11061 'use strict';
11063 var EventPluginHub = _dereq_(17);
11065 function runEventQueueInBatch(events) {
11066   EventPluginHub.enqueueEvents(events);
11067   EventPluginHub.processEventQueue(false);
11070 var ReactEventEmitterMixin = {
11072   /**
11073    * Streams a fired top-level event to `EventPluginHub` where plugins have the
11074    * opportunity to create `ReactEvent`s to be dispatched.
11075    */
11076   handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
11077     var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
11078     runEventQueueInBatch(events);
11079   }
11082 module.exports = ReactEventEmitterMixin;
11083 },{"17":17}],70:[function(_dereq_,module,exports){
11085  * Copyright 2013-present, Facebook, Inc.
11086  * All rights reserved.
11088  * This source code is licensed under the BSD-style license found in the
11089  * LICENSE file in the root directory of this source tree. An additional grant
11090  * of patent rights can be found in the PATENTS file in the same directory.
11092  * @providesModule ReactEventListener
11093  */
11095 'use strict';
11097 var _assign = _dereq_(184);
11099 var EventListener = _dereq_(158);
11100 var ExecutionEnvironment = _dereq_(159);
11101 var PooledClass = _dereq_(26);
11102 var ReactDOMComponentTree = _dereq_(45);
11103 var ReactUpdates = _dereq_(104);
11105 var getEventTarget = _dereq_(138);
11106 var getUnboundedScrollPosition = _dereq_(170);
11109  * Find the deepest React component completely containing the root of the
11110  * passed-in instance (for use when entire React trees are nested within each
11111  * other). If React trees are not nested, returns null.
11112  */
11113 function findParent(inst) {
11114   // TODO: It may be a good idea to cache this to prevent unnecessary DOM
11115   // traversal, but caching is difficult to do correctly without using a
11116   // mutation observer to listen for all DOM changes.
11117   while (inst._nativeParent) {
11118     inst = inst._nativeParent;
11119   }
11120   var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
11121   var container = rootNode.parentNode;
11122   return ReactDOMComponentTree.getClosestInstanceFromNode(container);
11125 // Used to store ancestor hierarchy in top level callback
11126 function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
11127   this.topLevelType = topLevelType;
11128   this.nativeEvent = nativeEvent;
11129   this.ancestors = [];
11131 _assign(TopLevelCallbackBookKeeping.prototype, {
11132   destructor: function () {
11133     this.topLevelType = null;
11134     this.nativeEvent = null;
11135     this.ancestors.length = 0;
11136   }
11138 PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
11140 function handleTopLevelImpl(bookKeeping) {
11141   var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
11142   var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
11144   // Loop through the hierarchy, in case there's any nested components.
11145   // It's important that we build the array of ancestors before calling any
11146   // event handlers, because event handlers can modify the DOM, leading to
11147   // inconsistencies with ReactMount's node cache. See #1105.
11148   var ancestor = targetInst;
11149   do {
11150     bookKeeping.ancestors.push(ancestor);
11151     ancestor = ancestor && findParent(ancestor);
11152   } while (ancestor);
11154   for (var i = 0; i < bookKeeping.ancestors.length; i++) {
11155     targetInst = bookKeeping.ancestors[i];
11156     ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
11157   }
11160 function scrollValueMonitor(cb) {
11161   var scrollPosition = getUnboundedScrollPosition(window);
11162   cb(scrollPosition);
11165 var ReactEventListener = {
11166   _enabled: true,
11167   _handleTopLevel: null,
11169   WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
11171   setHandleTopLevel: function (handleTopLevel) {
11172     ReactEventListener._handleTopLevel = handleTopLevel;
11173   },
11175   setEnabled: function (enabled) {
11176     ReactEventListener._enabled = !!enabled;
11177   },
11179   isEnabled: function () {
11180     return ReactEventListener._enabled;
11181   },
11183   /**
11184    * Traps top-level events by using event bubbling.
11185    *
11186    * @param {string} topLevelType Record from `EventConstants`.
11187    * @param {string} handlerBaseName Event name (e.g. "click").
11188    * @param {object} handle Element on which to attach listener.
11189    * @return {?object} An object with a remove function which will forcefully
11190    *                  remove the listener.
11191    * @internal
11192    */
11193   trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
11194     var element = handle;
11195     if (!element) {
11196       return null;
11197     }
11198     return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
11199   },
11201   /**
11202    * Traps a top-level event by using event capturing.
11203    *
11204    * @param {string} topLevelType Record from `EventConstants`.
11205    * @param {string} handlerBaseName Event name (e.g. "click").
11206    * @param {object} handle Element on which to attach listener.
11207    * @return {?object} An object with a remove function which will forcefully
11208    *                  remove the listener.
11209    * @internal
11210    */
11211   trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
11212     var element = handle;
11213     if (!element) {
11214       return null;
11215     }
11216     return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
11217   },
11219   monitorScrollValue: function (refresh) {
11220     var callback = scrollValueMonitor.bind(null, refresh);
11221     EventListener.listen(window, 'scroll', callback);
11222   },
11224   dispatchEvent: function (topLevelType, nativeEvent) {
11225     if (!ReactEventListener._enabled) {
11226       return;
11227     }
11229     var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
11230     try {
11231       // Event queue being processed in the same cycle allows
11232       // `preventDefault`.
11233       ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
11234     } finally {
11235       TopLevelCallbackBookKeeping.release(bookKeeping);
11236     }
11237   }
11240 module.exports = ReactEventListener;
11241 },{"104":104,"138":138,"158":158,"159":159,"170":170,"184":184,"26":26,"45":45}],71:[function(_dereq_,module,exports){
11243  * Copyright 2013-present, Facebook, Inc.
11244  * All rights reserved.
11246  * This source code is licensed under the BSD-style license found in the
11247  * LICENSE file in the root directory of this source tree. An additional grant
11248  * of patent rights can be found in the PATENTS file in the same directory.
11250  * @providesModule ReactFeatureFlags
11251  */
11253 'use strict';
11255 var ReactFeatureFlags = {
11256   // When true, call console.time() before and .timeEnd() after each top-level
11257   // render (both initial renders and updates). Useful when looking at prod-mode
11258   // timeline profiles in Chrome, for example.
11259   logTopLevelRenders: false
11262 module.exports = ReactFeatureFlags;
11263 },{}],72:[function(_dereq_,module,exports){
11265  * Copyright 2015-present, Facebook, Inc.
11266  * All rights reserved.
11268  * This source code is licensed under the BSD-style license found in the
11269  * LICENSE file in the root directory of this source tree. An additional grant
11270  * of patent rights can be found in the PATENTS file in the same directory.
11272  * @providesModule ReactFragment
11273  */
11275 'use strict';
11277 var ReactChildren = _dereq_(32);
11278 var ReactElement = _dereq_(65);
11280 var emptyFunction = _dereq_(165);
11281 var invariant = _dereq_(173);
11282 var warning = _dereq_(183);
11285  * We used to allow keyed objects to serve as a collection of ReactElements,
11286  * or nested sets. This allowed us a way to explicitly key a set or fragment of
11287  * components. This is now being replaced with an opaque data structure.
11288  * The upgrade path is to call React.addons.createFragment({ key: value }) to
11289  * create a keyed fragment. The resulting data structure is an array.
11290  */
11292 var numericPropertyRegex = /^\d+$/;
11294 var warnedAboutNumeric = false;
11296 var ReactFragment = {
11297   /**
11298    * Wrap a keyed object in an opaque proxy that warns you if you access any
11299    * of its properties.
11300    * See https://facebook.github.io/react/docs/create-fragment.html
11301    */
11302   create: function (object) {
11303     if (typeof object !== 'object' || !object || Array.isArray(object)) {
11304       "development" !== 'production' ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : void 0;
11305       return object;
11306     }
11307     if (ReactElement.isValidElement(object)) {
11308       "development" !== 'production' ? warning(false, 'React.addons.createFragment does not accept a ReactElement ' + 'without a wrapper object.') : void 0;
11309       return object;
11310     }
11312     !(object.nodeType !== 1) ? "development" !== 'production' ? invariant(false, 'React.addons.createFragment(...): Encountered an invalid child; DOM ' + 'elements are not valid children of React components.') : invariant(false) : void 0;
11314     var result = [];
11316     for (var key in object) {
11317       if ("development" !== 'production') {
11318         if (!warnedAboutNumeric && numericPropertyRegex.test(key)) {
11319           "development" !== 'production' ? warning(false, 'React.addons.createFragment(...): Child objects should have ' + 'non-numeric keys so ordering is preserved.') : void 0;
11320           warnedAboutNumeric = true;
11321         }
11322       }
11323       ReactChildren.mapIntoWithKeyPrefixInternal(object[key], result, key, emptyFunction.thatReturnsArgument);
11324     }
11326     return result;
11327   }
11330 module.exports = ReactFragment;
11331 },{"165":165,"173":173,"183":183,"32":32,"65":65}],73:[function(_dereq_,module,exports){
11333  * Copyright 2013-present, Facebook, Inc.
11334  * All rights reserved.
11336  * This source code is licensed under the BSD-style license found in the
11337  * LICENSE file in the root directory of this source tree. An additional grant
11338  * of patent rights can be found in the PATENTS file in the same directory.
11340  * @providesModule ReactInjection
11341  */
11343 'use strict';
11345 var DOMProperty = _dereq_(10);
11346 var EventPluginHub = _dereq_(17);
11347 var EventPluginUtils = _dereq_(19);
11348 var ReactComponentEnvironment = _dereq_(36);
11349 var ReactClass = _dereq_(33);
11350 var ReactEmptyComponent = _dereq_(67);
11351 var ReactBrowserEventEmitter = _dereq_(28);
11352 var ReactNativeComponent = _dereq_(83);
11353 var ReactUpdates = _dereq_(104);
11355 var ReactInjection = {
11356   Component: ReactComponentEnvironment.injection,
11357   Class: ReactClass.injection,
11358   DOMProperty: DOMProperty.injection,
11359   EmptyComponent: ReactEmptyComponent.injection,
11360   EventPluginHub: EventPluginHub.injection,
11361   EventPluginUtils: EventPluginUtils.injection,
11362   EventEmitter: ReactBrowserEventEmitter.injection,
11363   NativeComponent: ReactNativeComponent.injection,
11364   Updates: ReactUpdates.injection
11367 module.exports = ReactInjection;
11368 },{"10":10,"104":104,"17":17,"19":19,"28":28,"33":33,"36":36,"67":67,"83":83}],74:[function(_dereq_,module,exports){
11370  * Copyright 2013-present, Facebook, Inc.
11371  * All rights reserved.
11373  * This source code is licensed under the BSD-style license found in the
11374  * LICENSE file in the root directory of this source tree. An additional grant
11375  * of patent rights can be found in the PATENTS file in the same directory.
11377  * @providesModule ReactInputSelection
11378  */
11380 'use strict';
11382 var ReactDOMSelection = _dereq_(56);
11384 var containsNode = _dereq_(162);
11385 var focusNode = _dereq_(167);
11386 var getActiveElement = _dereq_(168);
11388 function isInDocument(node) {
11389   return containsNode(document.documentElement, node);
11393  * @ReactInputSelection: React input selection module. Based on Selection.js,
11394  * but modified to be suitable for react and has a couple of bug fixes (doesn't
11395  * assume buttons have range selections allowed).
11396  * Input selection module for React.
11397  */
11398 var ReactInputSelection = {
11400   hasSelectionCapabilities: function (elem) {
11401     var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
11402     return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
11403   },
11405   getSelectionInformation: function () {
11406     var focusedElem = getActiveElement();
11407     return {
11408       focusedElem: focusedElem,
11409       selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
11410     };
11411   },
11413   /**
11414    * @restoreSelection: If any selection information was potentially lost,
11415    * restore it. This is useful when performing operations that could remove dom
11416    * nodes and place them back in, resulting in focus being lost.
11417    */
11418   restoreSelection: function (priorSelectionInformation) {
11419     var curFocusedElem = getActiveElement();
11420     var priorFocusedElem = priorSelectionInformation.focusedElem;
11421     var priorSelectionRange = priorSelectionInformation.selectionRange;
11422     if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
11423       if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
11424         ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
11425       }
11426       focusNode(priorFocusedElem);
11427     }
11428   },
11430   /**
11431    * @getSelection: Gets the selection bounds of a focused textarea, input or
11432    * contentEditable node.
11433    * -@input: Look up selection bounds of this input
11434    * -@return {start: selectionStart, end: selectionEnd}
11435    */
11436   getSelection: function (input) {
11437     var selection;
11439     if ('selectionStart' in input) {
11440       // Modern browser with input or textarea.
11441       selection = {
11442         start: input.selectionStart,
11443         end: input.selectionEnd
11444       };
11445     } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
11446       // IE8 input.
11447       var range = document.selection.createRange();
11448       // There can only be one selection per document in IE, so it must
11449       // be in our element.
11450       if (range.parentElement() === input) {
11451         selection = {
11452           start: -range.moveStart('character', -input.value.length),
11453           end: -range.moveEnd('character', -input.value.length)
11454         };
11455       }
11456     } else {
11457       // Content editable or old IE textarea.
11458       selection = ReactDOMSelection.getOffsets(input);
11459     }
11461     return selection || { start: 0, end: 0 };
11462   },
11464   /**
11465    * @setSelection: Sets the selection bounds of a textarea or input and focuses
11466    * the input.
11467    * -@input     Set selection bounds of this input or textarea
11468    * -@offsets   Object of same form that is returned from get*
11469    */
11470   setSelection: function (input, offsets) {
11471     var start = offsets.start;
11472     var end = offsets.end;
11473     if (end === undefined) {
11474       end = start;
11475     }
11477     if ('selectionStart' in input) {
11478       input.selectionStart = start;
11479       input.selectionEnd = Math.min(end, input.value.length);
11480     } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
11481       var range = input.createTextRange();
11482       range.collapse(true);
11483       range.moveStart('character', start);
11484       range.moveEnd('character', end - start);
11485       range.select();
11486     } else {
11487       ReactDOMSelection.setOffsets(input, offsets);
11488     }
11489   }
11492 module.exports = ReactInputSelection;
11493 },{"162":162,"167":167,"168":168,"56":56}],75:[function(_dereq_,module,exports){
11495  * Copyright 2013-present, Facebook, Inc.
11496  * All rights reserved.
11498  * This source code is licensed under the BSD-style license found in the
11499  * LICENSE file in the root directory of this source tree. An additional grant
11500  * of patent rights can be found in the PATENTS file in the same directory.
11502  * @providesModule ReactInstanceMap
11503  */
11505 'use strict';
11508  * `ReactInstanceMap` maintains a mapping from a public facing stateful
11509  * instance (key) and the internal representation (value). This allows public
11510  * methods to accept the user facing instance as an argument and map them back
11511  * to internal methods.
11512  */
11514 // TODO: Replace this with ES6: var ReactInstanceMap = new Map();
11516 var ReactInstanceMap = {
11518   /**
11519    * This API should be called `delete` but we'd have to make sure to always
11520    * transform these to strings for IE support. When this transform is fully
11521    * supported we can rename it.
11522    */
11523   remove: function (key) {
11524     key._reactInternalInstance = undefined;
11525   },
11527   get: function (key) {
11528     return key._reactInternalInstance;
11529   },
11531   has: function (key) {
11532     return key._reactInternalInstance !== undefined;
11533   },
11535   set: function (key, value) {
11536     key._reactInternalInstance = value;
11537   }
11541 module.exports = ReactInstanceMap;
11542 },{}],76:[function(_dereq_,module,exports){
11544  * Copyright 2016-present, Facebook, Inc.
11545  * All rights reserved.
11547  * This source code is licensed under the BSD-style license found in the
11548  * LICENSE file in the root directory of this source tree. An additional grant
11549  * of patent rights can be found in the PATENTS file in the same directory.
11551  * @providesModule ReactInstrumentation
11552  */
11554 'use strict';
11556 var ReactDebugTool = _dereq_(62);
11558 module.exports = { debugTool: ReactDebugTool };
11559 },{"62":62}],77:[function(_dereq_,module,exports){
11561  * Copyright 2016-present, Facebook, Inc.
11562  * All rights reserved.
11564  * This source code is licensed under the BSD-style license found in the
11565  * LICENSE file in the root directory of this source tree. An additional grant
11566  * of patent rights can be found in the PATENTS file in the same directory.
11568  * @providesModule ReactInvalidSetStateWarningDevTool
11569  */
11571 'use strict';
11573 var warning = _dereq_(183);
11575 if ("development" !== 'production') {
11576   var processingChildContext = false;
11578   var warnInvalidSetState = function () {
11579     "development" !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
11580   };
11583 var ReactInvalidSetStateWarningDevTool = {
11584   onBeginProcessingChildContext: function () {
11585     processingChildContext = true;
11586   },
11587   onEndProcessingChildContext: function () {
11588     processingChildContext = false;
11589   },
11590   onSetState: function () {
11591     warnInvalidSetState();
11592   }
11595 module.exports = ReactInvalidSetStateWarningDevTool;
11596 },{"183":183}],78:[function(_dereq_,module,exports){
11598  * Copyright 2013-present, Facebook, Inc.
11599  * All rights reserved.
11601  * This source code is licensed under the BSD-style license found in the
11602  * LICENSE file in the root directory of this source tree. An additional grant
11603  * of patent rights can be found in the PATENTS file in the same directory.
11605  * @providesModule ReactLink
11606  */
11608 'use strict';
11611  * ReactLink encapsulates a common pattern in which a component wants to modify
11612  * a prop received from its parent. ReactLink allows the parent to pass down a
11613  * value coupled with a callback that, when invoked, expresses an intent to
11614  * modify that value. For example:
11616  * React.createClass({
11617  *   getInitialState: function() {
11618  *     return {value: ''};
11619  *   },
11620  *   render: function() {
11621  *     var valueLink = new ReactLink(this.state.value, this._handleValueChange);
11622  *     return <input valueLink={valueLink} />;
11623  *   },
11624  *   _handleValueChange: function(newValue) {
11625  *     this.setState({value: newValue});
11626  *   }
11627  * });
11629  * We have provided some sugary mixins to make the creation and
11630  * consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
11631  */
11633 var React = _dereq_(27);
11636  * Deprecated: An an easy way to express two-way binding with React. 
11637  * See https://facebook.github.io/react/docs/two-way-binding-helpers.html
11639  * @param {*} value current value of the link
11640  * @param {function} requestChange callback to request a change
11641  */
11642 function ReactLink(value, requestChange) {
11643   this.value = value;
11644   this.requestChange = requestChange;
11648  * Creates a PropType that enforces the ReactLink API and optionally checks the
11649  * type of the value being passed inside the link. Example:
11651  * MyComponent.propTypes = {
11652  *   tabIndexLink: ReactLink.PropTypes.link(React.PropTypes.number)
11653  * }
11654  */
11655 function createLinkTypeChecker(linkType) {
11656   var shapes = {
11657     value: linkType === undefined ? React.PropTypes.any.isRequired : linkType.isRequired,
11658     requestChange: React.PropTypes.func.isRequired
11659   };
11660   return React.PropTypes.shape(shapes);
11663 ReactLink.PropTypes = {
11664   link: createLinkTypeChecker
11667 module.exports = ReactLink;
11668 },{"27":27}],79:[function(_dereq_,module,exports){
11670  * Copyright 2013-present, Facebook, Inc.
11671  * All rights reserved.
11673  * This source code is licensed under the BSD-style license found in the
11674  * LICENSE file in the root directory of this source tree. An additional grant
11675  * of patent rights can be found in the PATENTS file in the same directory.
11677  * @providesModule ReactMarkupChecksum
11678  */
11680 'use strict';
11682 var adler32 = _dereq_(127);
11684 var TAG_END = /\/?>/;
11685 var COMMENT_START = /^<\!\-\-/;
11687 var ReactMarkupChecksum = {
11688   CHECKSUM_ATTR_NAME: 'data-react-checksum',
11690   /**
11691    * @param {string} markup Markup string
11692    * @return {string} Markup string with checksum attribute attached
11693    */
11694   addChecksumToMarkup: function (markup) {
11695     var checksum = adler32(markup);
11697     // Add checksum (handle both parent tags, comments and self-closing tags)
11698     if (COMMENT_START.test(markup)) {
11699       return markup;
11700     } else {
11701       return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
11702     }
11703   },
11705   /**
11706    * @param {string} markup to use
11707    * @param {DOMElement} element root React element
11708    * @returns {boolean} whether or not the markup is the same
11709    */
11710   canReuseMarkup: function (markup, element) {
11711     var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
11712     existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
11713     var markupChecksum = adler32(markup);
11714     return markupChecksum === existingChecksum;
11715   }
11718 module.exports = ReactMarkupChecksum;
11719 },{"127":127}],80:[function(_dereq_,module,exports){
11721  * Copyright 2013-present, Facebook, Inc.
11722  * All rights reserved.
11724  * This source code is licensed under the BSD-style license found in the
11725  * LICENSE file in the root directory of this source tree. An additional grant
11726  * of patent rights can be found in the PATENTS file in the same directory.
11728  * @providesModule ReactMount
11729  */
11731 'use strict';
11733 var DOMLazyTree = _dereq_(8);
11734 var DOMProperty = _dereq_(10);
11735 var ReactBrowserEventEmitter = _dereq_(28);
11736 var ReactCurrentOwner = _dereq_(40);
11737 var ReactDOMComponentTree = _dereq_(45);
11738 var ReactDOMContainerInfo = _dereq_(46);
11739 var ReactDOMFeatureFlags = _dereq_(50);
11740 var ReactElement = _dereq_(65);
11741 var ReactFeatureFlags = _dereq_(71);
11742 var ReactInstrumentation = _dereq_(76);
11743 var ReactMarkupChecksum = _dereq_(79);
11744 var ReactReconciler = _dereq_(93);
11745 var ReactUpdateQueue = _dereq_(103);
11746 var ReactUpdates = _dereq_(104);
11748 var emptyObject = _dereq_(166);
11749 var instantiateReactComponent = _dereq_(144);
11750 var invariant = _dereq_(173);
11751 var setInnerHTML = _dereq_(150);
11752 var shouldUpdateReactComponent = _dereq_(153);
11753 var warning = _dereq_(183);
11755 var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
11756 var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;
11758 var ELEMENT_NODE_TYPE = 1;
11759 var DOC_NODE_TYPE = 9;
11760 var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
11762 var instancesByReactRootID = {};
11765  * Finds the index of the first character
11766  * that's not common between the two given strings.
11768  * @return {number} the index of the character where the strings diverge
11769  */
11770 function firstDifferenceIndex(string1, string2) {
11771   var minLen = Math.min(string1.length, string2.length);
11772   for (var i = 0; i < minLen; i++) {
11773     if (string1.charAt(i) !== string2.charAt(i)) {
11774       return i;
11775     }
11776   }
11777   return string1.length === string2.length ? -1 : minLen;
11781  * @param {DOMElement|DOMDocument} container DOM element that may contain
11782  * a React component
11783  * @return {?*} DOM element that may have the reactRoot ID, or null.
11784  */
11785 function getReactRootElementInContainer(container) {
11786   if (!container) {
11787     return null;
11788   }
11790   if (container.nodeType === DOC_NODE_TYPE) {
11791     return container.documentElement;
11792   } else {
11793     return container.firstChild;
11794   }
11797 function internalGetID(node) {
11798   // If node is something like a window, document, or text node, none of
11799   // which support attributes or a .getAttribute method, gracefully return
11800   // the empty string, as if the attribute were missing.
11801   return node.getAttribute && node.getAttribute(ATTR_NAME) || '';
11805  * Mounts this component and inserts it into the DOM.
11807  * @param {ReactComponent} componentInstance The instance to mount.
11808  * @param {DOMElement} container DOM element to mount into.
11809  * @param {ReactReconcileTransaction} transaction
11810  * @param {boolean} shouldReuseMarkup If true, do not insert markup
11811  */
11812 function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {
11813   var markerName;
11814   if (ReactFeatureFlags.logTopLevelRenders) {
11815     var wrappedElement = wrapperInstance._currentElement.props;
11816     var type = wrappedElement.type;
11817     markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);
11818     console.time(markerName);
11819   }
11821   var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context);
11823   if (markerName) {
11824     console.timeEnd(markerName);
11825   }
11827   wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;
11828   ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);
11832  * Batched mount.
11834  * @param {ReactComponent} componentInstance The instance to mount.
11835  * @param {DOMElement} container DOM element to mount into.
11836  * @param {boolean} shouldReuseMarkup If true, do not insert markup
11837  */
11838 function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {
11839   var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
11840   /* useCreateElement */
11841   !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);
11842   transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);
11843   ReactUpdates.ReactReconcileTransaction.release(transaction);
11847  * Unmounts a component and removes it from the DOM.
11849  * @param {ReactComponent} instance React component instance.
11850  * @param {DOMElement} container DOM element to unmount from.
11851  * @final
11852  * @internal
11853  * @see {ReactMount.unmountComponentAtNode}
11854  */
11855 function unmountComponentFromNode(instance, container, safely) {
11856   ReactReconciler.unmountComponent(instance, safely);
11858   if (container.nodeType === DOC_NODE_TYPE) {
11859     container = container.documentElement;
11860   }
11862   // http://jsperf.com/emptying-a-node
11863   while (container.lastChild) {
11864     container.removeChild(container.lastChild);
11865   }
11869  * True if the supplied DOM node has a direct React-rendered child that is
11870  * not a React root element. Useful for warning in `render`,
11871  * `unmountComponentAtNode`, etc.
11873  * @param {?DOMElement} node The candidate DOM node.
11874  * @return {boolean} True if the DOM element contains a direct child that was
11875  * rendered by React but is not a root element.
11876  * @internal
11877  */
11878 function hasNonRootReactChild(container) {
11879   var rootEl = getReactRootElementInContainer(container);
11880   if (rootEl) {
11881     var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
11882     return !!(inst && inst._nativeParent);
11883   }
11886 function getNativeRootInstanceInContainer(container) {
11887   var rootEl = getReactRootElementInContainer(container);
11888   var prevNativeInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
11889   return prevNativeInstance && !prevNativeInstance._nativeParent ? prevNativeInstance : null;
11892 function getTopLevelWrapperInContainer(container) {
11893   var root = getNativeRootInstanceInContainer(container);
11894   return root ? root._nativeContainerInfo._topLevelWrapper : null;
11898  * Temporary (?) hack so that we can store all top-level pending updates on
11899  * composites instead of having to worry about different types of components
11900  * here.
11901  */
11902 var topLevelRootCounter = 1;
11903 var TopLevelWrapper = function () {
11904   this.rootID = topLevelRootCounter++;
11906 TopLevelWrapper.prototype.isReactComponent = {};
11907 if ("development" !== 'production') {
11908   TopLevelWrapper.displayName = 'TopLevelWrapper';
11910 TopLevelWrapper.prototype.render = function () {
11911   // this.props is actually a ReactElement
11912   return this.props;
11916  * Mounting is the process of initializing a React component by creating its
11917  * representative DOM elements and inserting them into a supplied `container`.
11918  * Any prior content inside `container` is destroyed in the process.
11920  *   ReactMount.render(
11921  *     component,
11922  *     document.getElementById('container')
11923  *   );
11925  *   <div id="container">                   <-- Supplied `container`.
11926  *     <div data-reactid=".3">              <-- Rendered reactRoot of React
11927  *       // ...                                 component.
11928  *     </div>
11929  *   </div>
11931  * Inside of `container`, the first element rendered is the "reactRoot".
11932  */
11933 var ReactMount = {
11935   TopLevelWrapper: TopLevelWrapper,
11937   /**
11938    * Used by devtools. The keys are not important.
11939    */
11940   _instancesByReactRootID: instancesByReactRootID,
11942   /**
11943    * This is a hook provided to support rendering React components while
11944    * ensuring that the apparent scroll position of its `container` does not
11945    * change.
11946    *
11947    * @param {DOMElement} container The `container` being rendered into.
11948    * @param {function} renderCallback This must be called once to do the render.
11949    */
11950   scrollMonitor: function (container, renderCallback) {
11951     renderCallback();
11952   },
11954   /**
11955    * Take a component that's already mounted into the DOM and replace its props
11956    * @param {ReactComponent} prevComponent component instance already in the DOM
11957    * @param {ReactElement} nextElement component instance to render
11958    * @param {DOMElement} container container to render into
11959    * @param {?function} callback function triggered on completion
11960    */
11961   _updateRootComponent: function (prevComponent, nextElement, container, callback) {
11962     ReactMount.scrollMonitor(container, function () {
11963       ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement);
11964       if (callback) {
11965         ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
11966       }
11967     });
11969     return prevComponent;
11970   },
11972   /**
11973    * Render a new component into the DOM. Hooked by devtools!
11974    *
11975    * @param {ReactElement} nextElement element to render
11976    * @param {DOMElement} container container to render into
11977    * @param {boolean} shouldReuseMarkup if we should skip the markup insertion
11978    * @return {ReactComponent} nextComponent
11979    */
11980   _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
11981     if ("development" !== 'production') {
11982       ReactInstrumentation.debugTool.onBeginFlush();
11983     }
11985     // Various parts of our code (such as ReactCompositeComponent's
11986     // _renderValidatedComponent) assume that calls to render aren't nested;
11987     // verify that that's the case.
11988     "development" !== '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') : void 0;
11990     !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? "development" !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : invariant(false) : void 0;
11992     ReactBrowserEventEmitter.ensureScrollValueMonitoring();
11993     var componentInstance = instantiateReactComponent(nextElement);
11995     if ("development" !== 'production') {
11996       // Mute future events from the top level wrapper.
11997       // It is an implementation detail that devtools should not know about.
11998       componentInstance._debugID = 0;
11999     }
12001     // The initial render is synchronous but any updates that happen during
12002     // rendering, in componentWillMount or componentDidMount, will be batched
12003     // according to the current batching strategy.
12005     ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);
12007     var wrapperID = componentInstance._instance.rootID;
12008     instancesByReactRootID[wrapperID] = componentInstance;
12010     if ("development" !== 'production') {
12011       // The instance here is TopLevelWrapper so we report mount for its child.
12012       ReactInstrumentation.debugTool.onMountRootComponent(componentInstance._renderedComponent._debugID);
12013       ReactInstrumentation.debugTool.onEndFlush();
12014     }
12016     return componentInstance;
12017   },
12019   /**
12020    * Renders a React component into the DOM in the supplied `container`.
12021    *
12022    * If the React component was previously rendered into `container`, this will
12023    * perform an update on it and only mutate the DOM as necessary to reflect the
12024    * latest React component.
12025    *
12026    * @param {ReactComponent} parentComponent The conceptual parent of this render tree.
12027    * @param {ReactElement} nextElement Component element to render.
12028    * @param {DOMElement} container DOM element to render into.
12029    * @param {?function} callback function triggered on completion
12030    * @return {ReactComponent} Component instance rendered in `container`.
12031    */
12032   renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
12033     !(parentComponent != null && parentComponent._reactInternalInstance != null) ? "development" !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : invariant(false) : void 0;
12034     return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
12035   },
12037   _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
12038     ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
12039     !ReactElement.isValidElement(nextElement) ? "development" !== 'production' ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing a string like \'div\', pass ' + 'React.createElement(\'div\') or <div />.' : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' :
12040     // Check if it quacks like an element
12041     nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : void 0;
12043     "development" !== '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.') : void 0;
12045     var nextWrappedElement = ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
12047     var prevComponent = getTopLevelWrapperInContainer(container);
12049     if (prevComponent) {
12050       var prevWrappedElement = prevComponent._currentElement;
12051       var prevElement = prevWrappedElement.props;
12052       if (shouldUpdateReactComponent(prevElement, nextElement)) {
12053         var publicInst = prevComponent._renderedComponent.getPublicInstance();
12054         var updatedCallback = callback && function () {
12055           callback.call(publicInst);
12056         };
12057         ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, updatedCallback);
12058         return publicInst;
12059       } else {
12060         ReactMount.unmountComponentAtNode(container);
12061       }
12062     }
12064     var reactRootElement = getReactRootElementInContainer(container);
12065     var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
12066     var containerHasNonRootReactChild = hasNonRootReactChild(container);
12068     if ("development" !== 'production') {
12069       "development" !== '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.') : void 0;
12071       if (!containerHasReactMarkup || reactRootElement.nextSibling) {
12072         var rootElementSibling = reactRootElement;
12073         while (rootElementSibling) {
12074           if (internalGetID(rootElementSibling)) {
12075             "development" !== '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.') : void 0;
12076             break;
12077           }
12078           rootElementSibling = rootElementSibling.nextSibling;
12079         }
12080       }
12081     }
12083     var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
12084     var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject)._renderedComponent.getPublicInstance();
12085     if (callback) {
12086       callback.call(component);
12087     }
12088     return component;
12089   },
12091   /**
12092    * Renders a React component into the DOM in the supplied `container`.
12093    * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
12094    *
12095    * If the React component was previously rendered into `container`, this will
12096    * perform an update on it and only mutate the DOM as necessary to reflect the
12097    * latest React component.
12098    *
12099    * @param {ReactElement} nextElement Component element to render.
12100    * @param {DOMElement} container DOM element to render into.
12101    * @param {?function} callback function triggered on completion
12102    * @return {ReactComponent} Component instance rendered in `container`.
12103    */
12104   render: function (nextElement, container, callback) {
12105     return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
12106   },
12108   /**
12109    * Unmounts and destroys the React component rendered in the `container`.
12110    * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode
12111    *
12112    * @param {DOMElement} container DOM element containing a React component.
12113    * @return {boolean} True if a component was found in and unmounted from
12114    *                   `container`
12115    */
12116   unmountComponentAtNode: function (container) {
12117     // Various parts of our code (such as ReactCompositeComponent's
12118     // _renderValidatedComponent) assume that calls to render aren't nested;
12119     // verify that that's the case. (Strictly speaking, unmounting won't cause a
12120     // render but we still don't expect to be in a render call here.)
12121     "development" !== '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') : void 0;
12123     !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? "development" !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(false) : void 0;
12125     var prevComponent = getTopLevelWrapperInContainer(container);
12126     if (!prevComponent) {
12127       // Check if the node being unmounted was rendered by React, but isn't a
12128       // root node.
12129       var containerHasNonRootReactChild = hasNonRootReactChild(container);
12131       // Check if the container itself is a React root node.
12132       var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);
12134       if ("development" !== 'production') {
12135         "development" !== '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.') : void 0;
12136       }
12138       return false;
12139     }
12140     delete instancesByReactRootID[prevComponent._instance.rootID];
12141     ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);
12142     return true;
12143   },
12145   _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {
12146     !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? "development" !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : invariant(false) : void 0;
12148     if (shouldReuseMarkup) {
12149       var rootElement = getReactRootElementInContainer(container);
12150       if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
12151         ReactDOMComponentTree.precacheNode(instance, rootElement);
12152         return;
12153       } else {
12154         var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
12155         rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
12157         var rootMarkup = rootElement.outerHTML;
12158         rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
12160         var normalizedMarkup = markup;
12161         if ("development" !== 'production') {
12162           // because rootMarkup is retrieved from the DOM, various normalizations
12163           // will have occurred which will not be present in `markup`. Here,
12164           // insert markup into a <div> or <iframe> depending on the container
12165           // type to perform the same normalizations before comparing.
12166           var normalizer;
12167           if (container.nodeType === ELEMENT_NODE_TYPE) {
12168             normalizer = document.createElement('div');
12169             normalizer.innerHTML = markup;
12170             normalizedMarkup = normalizer.innerHTML;
12171           } else {
12172             normalizer = document.createElement('iframe');
12173             document.body.appendChild(normalizer);
12174             normalizer.contentDocument.write(markup);
12175             normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
12176             document.body.removeChild(normalizer);
12177           }
12178         }
12180         var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
12181         var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
12183         !(container.nodeType !== DOC_NODE_TYPE) ? "development" !== '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) : void 0;
12185         if ("development" !== 'production') {
12186           "development" !== '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) : void 0;
12187         }
12188       }
12189     }
12191     !(container.nodeType !== DOC_NODE_TYPE) ? "development" !== '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) : void 0;
12193     if (transaction.useCreateElement) {
12194       while (container.lastChild) {
12195         container.removeChild(container.lastChild);
12196       }
12197       DOMLazyTree.insertTreeBefore(container, markup, null);
12198     } else {
12199       setInnerHTML(container, markup);
12200       ReactDOMComponentTree.precacheNode(instance, container.firstChild);
12201     }
12203     if ("development" !== 'production') {
12204       var nativeNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
12205       if (nativeNode._debugID !== 0) {
12206         ReactInstrumentation.debugTool.onNativeOperation(nativeNode._debugID, 'mount', markup.toString());
12207       }
12208     }
12209   }
12212 module.exports = ReactMount;
12213 },{"10":10,"103":103,"104":104,"144":144,"150":150,"153":153,"166":166,"173":173,"183":183,"28":28,"40":40,"45":45,"46":46,"50":50,"65":65,"71":71,"76":76,"79":79,"8":8,"93":93}],81:[function(_dereq_,module,exports){
12215  * Copyright 2013-present, Facebook, Inc.
12216  * All rights reserved.
12218  * This source code is licensed under the BSD-style license found in the
12219  * LICENSE file in the root directory of this source tree. An additional grant
12220  * of patent rights can be found in the PATENTS file in the same directory.
12222  * @providesModule ReactMultiChild
12223  */
12225 'use strict';
12227 var ReactComponentEnvironment = _dereq_(36);
12228 var ReactInstrumentation = _dereq_(76);
12229 var ReactMultiChildUpdateTypes = _dereq_(82);
12231 var ReactCurrentOwner = _dereq_(40);
12232 var ReactReconciler = _dereq_(93);
12233 var ReactChildReconciler = _dereq_(31);
12235 var emptyFunction = _dereq_(165);
12236 var flattenChildren = _dereq_(133);
12237 var invariant = _dereq_(173);
12240  * Make an update for markup to be rendered and inserted at a supplied index.
12242  * @param {string} markup Markup that renders into an element.
12243  * @param {number} toIndex Destination index.
12244  * @private
12245  */
12246 function makeInsertMarkup(markup, afterNode, toIndex) {
12247   // NOTE: Null values reduce hidden classes.
12248   return {
12249     type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
12250     content: markup,
12251     fromIndex: null,
12252     fromNode: null,
12253     toIndex: toIndex,
12254     afterNode: afterNode
12255   };
12259  * Make an update for moving an existing element to another index.
12261  * @param {number} fromIndex Source index of the existing element.
12262  * @param {number} toIndex Destination index of the element.
12263  * @private
12264  */
12265 function makeMove(child, afterNode, toIndex) {
12266   // NOTE: Null values reduce hidden classes.
12267   return {
12268     type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
12269     content: null,
12270     fromIndex: child._mountIndex,
12271     fromNode: ReactReconciler.getNativeNode(child),
12272     toIndex: toIndex,
12273     afterNode: afterNode
12274   };
12278  * Make an update for removing an element at an index.
12280  * @param {number} fromIndex Index of the element to remove.
12281  * @private
12282  */
12283 function makeRemove(child, node) {
12284   // NOTE: Null values reduce hidden classes.
12285   return {
12286     type: ReactMultiChildUpdateTypes.REMOVE_NODE,
12287     content: null,
12288     fromIndex: child._mountIndex,
12289     fromNode: node,
12290     toIndex: null,
12291     afterNode: null
12292   };
12296  * Make an update for setting the markup of a node.
12298  * @param {string} markup Markup that renders into an element.
12299  * @private
12300  */
12301 function makeSetMarkup(markup) {
12302   // NOTE: Null values reduce hidden classes.
12303   return {
12304     type: ReactMultiChildUpdateTypes.SET_MARKUP,
12305     content: markup,
12306     fromIndex: null,
12307     fromNode: null,
12308     toIndex: null,
12309     afterNode: null
12310   };
12314  * Make an update for setting the text content.
12316  * @param {string} textContent Text content to set.
12317  * @private
12318  */
12319 function makeTextContent(textContent) {
12320   // NOTE: Null values reduce hidden classes.
12321   return {
12322     type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
12323     content: textContent,
12324     fromIndex: null,
12325     fromNode: null,
12326     toIndex: null,
12327     afterNode: null
12328   };
12332  * Push an update, if any, onto the queue. Creates a new queue if none is
12333  * passed and always returns the queue. Mutative.
12334  */
12335 function enqueue(queue, update) {
12336   if (update) {
12337     queue = queue || [];
12338     queue.push(update);
12339   }
12340   return queue;
12344  * Processes any enqueued updates.
12346  * @private
12347  */
12348 function processQueue(inst, updateQueue) {
12349   ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
12352 var setChildrenForInstrumentation = emptyFunction;
12353 if ("development" !== 'production') {
12354   setChildrenForInstrumentation = function (children) {
12355     ReactInstrumentation.debugTool.onSetChildren(this._debugID, children ? Object.keys(children).map(function (key) {
12356       return children[key]._debugID;
12357     }) : []);
12358   };
12362  * ReactMultiChild are capable of reconciling multiple children.
12364  * @class ReactMultiChild
12365  * @internal
12366  */
12367 var ReactMultiChild = {
12369   /**
12370    * Provides common functionality for components that must reconcile multiple
12371    * children. This is used by `ReactDOMComponent` to mount, update, and
12372    * unmount child components.
12373    *
12374    * @lends {ReactMultiChild.prototype}
12375    */
12376   Mixin: {
12378     _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
12379       if ("development" !== 'production') {
12380         if (this._currentElement) {
12381           try {
12382             ReactCurrentOwner.current = this._currentElement._owner;
12383             return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
12384           } finally {
12385             ReactCurrentOwner.current = null;
12386           }
12387         }
12388       }
12389       return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
12390     },
12392     _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, removedNodes, transaction, context) {
12393       var nextChildren;
12394       if ("development" !== 'production') {
12395         if (this._currentElement) {
12396           try {
12397             ReactCurrentOwner.current = this._currentElement._owner;
12398             nextChildren = flattenChildren(nextNestedChildrenElements);
12399           } finally {
12400             ReactCurrentOwner.current = null;
12401           }
12402           ReactChildReconciler.updateChildren(prevChildren, nextChildren, removedNodes, transaction, context);
12403           return nextChildren;
12404         }
12405       }
12406       nextChildren = flattenChildren(nextNestedChildrenElements);
12407       ReactChildReconciler.updateChildren(prevChildren, nextChildren, removedNodes, transaction, context);
12408       return nextChildren;
12409     },
12411     /**
12412      * Generates a "mount image" for each of the supplied children. In the case
12413      * of `ReactDOMComponent`, a mount image is a string of markup.
12414      *
12415      * @param {?object} nestedChildren Nested child maps.
12416      * @return {array} An array of mounted representations.
12417      * @internal
12418      */
12419     mountChildren: function (nestedChildren, transaction, context) {
12420       var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
12421       this._renderedChildren = children;
12423       var mountImages = [];
12424       var index = 0;
12425       for (var name in children) {
12426         if (children.hasOwnProperty(name)) {
12427           var child = children[name];
12428           var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._nativeContainerInfo, context);
12429           child._mountIndex = index++;
12430           mountImages.push(mountImage);
12431         }
12432       }
12434       if ("development" !== 'production') {
12435         setChildrenForInstrumentation.call(this, children);
12436       }
12438       return mountImages;
12439     },
12441     /**
12442      * Replaces any rendered children with a text content string.
12443      *
12444      * @param {string} nextContent String of content.
12445      * @internal
12446      */
12447     updateTextContent: function (nextContent) {
12448       var prevChildren = this._renderedChildren;
12449       // Remove any rendered children.
12450       ReactChildReconciler.unmountChildren(prevChildren, false);
12451       for (var name in prevChildren) {
12452         if (prevChildren.hasOwnProperty(name)) {
12453           !false ? "development" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : invariant(false) : void 0;
12454         }
12455       }
12456       // Set new text content.
12457       var updates = [makeTextContent(nextContent)];
12458       processQueue(this, updates);
12459     },
12461     /**
12462      * Replaces any rendered children with a markup string.
12463      *
12464      * @param {string} nextMarkup String of markup.
12465      * @internal
12466      */
12467     updateMarkup: function (nextMarkup) {
12468       var prevChildren = this._renderedChildren;
12469       // Remove any rendered children.
12470       ReactChildReconciler.unmountChildren(prevChildren, false);
12471       for (var name in prevChildren) {
12472         if (prevChildren.hasOwnProperty(name)) {
12473           !false ? "development" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : invariant(false) : void 0;
12474         }
12475       }
12476       var updates = [makeSetMarkup(nextMarkup)];
12477       processQueue(this, updates);
12478     },
12480     /**
12481      * Updates the rendered children with new children.
12482      *
12483      * @param {?object} nextNestedChildrenElements Nested child element maps.
12484      * @param {ReactReconcileTransaction} transaction
12485      * @internal
12486      */
12487     updateChildren: function (nextNestedChildrenElements, transaction, context) {
12488       // Hook used by React ART
12489       this._updateChildren(nextNestedChildrenElements, transaction, context);
12490     },
12492     /**
12493      * @param {?object} nextNestedChildrenElements Nested child element maps.
12494      * @param {ReactReconcileTransaction} transaction
12495      * @final
12496      * @protected
12497      */
12498     _updateChildren: function (nextNestedChildrenElements, transaction, context) {
12499       var prevChildren = this._renderedChildren;
12500       var removedNodes = {};
12501       var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, removedNodes, transaction, context);
12502       if (!nextChildren && !prevChildren) {
12503         return;
12504       }
12505       var updates = null;
12506       var name;
12507       // `nextIndex` will increment for each child in `nextChildren`, but
12508       // `lastIndex` will be the last index visited in `prevChildren`.
12509       var lastIndex = 0;
12510       var nextIndex = 0;
12511       var lastPlacedNode = null;
12512       for (name in nextChildren) {
12513         if (!nextChildren.hasOwnProperty(name)) {
12514           continue;
12515         }
12516         var prevChild = prevChildren && prevChildren[name];
12517         var nextChild = nextChildren[name];
12518         if (prevChild === nextChild) {
12519           updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));
12520           lastIndex = Math.max(prevChild._mountIndex, lastIndex);
12521           prevChild._mountIndex = nextIndex;
12522         } else {
12523           if (prevChild) {
12524             // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
12525             lastIndex = Math.max(prevChild._mountIndex, lastIndex);
12526             // The `removedNodes` loop below will actually remove the child.
12527           }
12528           // The child must be instantiated before it's mounted.
12529           updates = enqueue(updates, this._mountChildAtIndex(nextChild, lastPlacedNode, nextIndex, transaction, context));
12530         }
12531         nextIndex++;
12532         lastPlacedNode = ReactReconciler.getNativeNode(nextChild);
12533       }
12534       // Remove children that are no longer present.
12535       for (name in removedNodes) {
12536         if (removedNodes.hasOwnProperty(name)) {
12537           updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
12538         }
12539       }
12540       if (updates) {
12541         processQueue(this, updates);
12542       }
12543       this._renderedChildren = nextChildren;
12545       if ("development" !== 'production') {
12546         setChildrenForInstrumentation.call(this, nextChildren);
12547       }
12548     },
12550     /**
12551      * Unmounts all rendered children. This should be used to clean up children
12552      * when this component is unmounted. It does not actually perform any
12553      * backend operations.
12554      *
12555      * @internal
12556      */
12557     unmountChildren: function (safely) {
12558       var renderedChildren = this._renderedChildren;
12559       ReactChildReconciler.unmountChildren(renderedChildren, safely);
12560       this._renderedChildren = null;
12561     },
12563     /**
12564      * Moves a child component to the supplied index.
12565      *
12566      * @param {ReactComponent} child Component to move.
12567      * @param {number} toIndex Destination index of the element.
12568      * @param {number} lastIndex Last index visited of the siblings of `child`.
12569      * @protected
12570      */
12571     moveChild: function (child, afterNode, toIndex, lastIndex) {
12572       // If the index of `child` is less than `lastIndex`, then it needs to
12573       // be moved. Otherwise, we do not need to move it because a child will be
12574       // inserted or moved before `child`.
12575       if (child._mountIndex < lastIndex) {
12576         return makeMove(child, afterNode, toIndex);
12577       }
12578     },
12580     /**
12581      * Creates a child component.
12582      *
12583      * @param {ReactComponent} child Component to create.
12584      * @param {string} mountImage Markup to insert.
12585      * @protected
12586      */
12587     createChild: function (child, afterNode, mountImage) {
12588       return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
12589     },
12591     /**
12592      * Removes a child component.
12593      *
12594      * @param {ReactComponent} child Child to remove.
12595      * @protected
12596      */
12597     removeChild: function (child, node) {
12598       return makeRemove(child, node);
12599     },
12601     /**
12602      * Mounts a child with the supplied name.
12603      *
12604      * NOTE: This is part of `updateChildren` and is here for readability.
12605      *
12606      * @param {ReactComponent} child Component to mount.
12607      * @param {string} name Name of the child.
12608      * @param {number} index Index at which to insert the child.
12609      * @param {ReactReconcileTransaction} transaction
12610      * @private
12611      */
12612     _mountChildAtIndex: function (child, afterNode, index, transaction, context) {
12613       var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._nativeContainerInfo, context);
12614       child._mountIndex = index;
12615       return this.createChild(child, afterNode, mountImage);
12616     },
12618     /**
12619      * Unmounts a rendered child.
12620      *
12621      * NOTE: This is part of `updateChildren` and is here for readability.
12622      *
12623      * @param {ReactComponent} child Component to unmount.
12624      * @private
12625      */
12626     _unmountChild: function (child, node) {
12627       var update = this.removeChild(child, node);
12628       child._mountIndex = null;
12629       return update;
12630     }
12632   }
12636 module.exports = ReactMultiChild;
12637 },{"133":133,"165":165,"173":173,"31":31,"36":36,"40":40,"76":76,"82":82,"93":93}],82:[function(_dereq_,module,exports){
12639  * Copyright 2013-present, Facebook, Inc.
12640  * All rights reserved.
12642  * This source code is licensed under the BSD-style license found in the
12643  * LICENSE file in the root directory of this source tree. An additional grant
12644  * of patent rights can be found in the PATENTS file in the same directory.
12646  * @providesModule ReactMultiChildUpdateTypes
12647  */
12649 'use strict';
12651 var keyMirror = _dereq_(176);
12654  * When a component's children are updated, a series of update configuration
12655  * objects are created in order to batch and serialize the required changes.
12657  * Enumerates all the possible types of update configurations.
12659  * @internal
12660  */
12661 var ReactMultiChildUpdateTypes = keyMirror({
12662   INSERT_MARKUP: null,
12663   MOVE_EXISTING: null,
12664   REMOVE_NODE: null,
12665   SET_MARKUP: null,
12666   TEXT_CONTENT: null
12669 module.exports = ReactMultiChildUpdateTypes;
12670 },{"176":176}],83:[function(_dereq_,module,exports){
12672  * Copyright 2014-present, Facebook, Inc.
12673  * All rights reserved.
12675  * This source code is licensed under the BSD-style license found in the
12676  * LICENSE file in the root directory of this source tree. An additional grant
12677  * of patent rights can be found in the PATENTS file in the same directory.
12679  * @providesModule ReactNativeComponent
12680  */
12682 'use strict';
12684 var _assign = _dereq_(184);
12686 var invariant = _dereq_(173);
12688 var autoGenerateWrapperClass = null;
12689 var genericComponentClass = null;
12690 // This registry keeps track of wrapper classes around native tags.
12691 var tagToComponentClass = {};
12692 var textComponentClass = null;
12694 var ReactNativeComponentInjection = {
12695   // This accepts a class that receives the tag string. This is a catch all
12696   // that can render any kind of tag.
12697   injectGenericComponentClass: function (componentClass) {
12698     genericComponentClass = componentClass;
12699   },
12700   // This accepts a text component class that takes the text string to be
12701   // rendered as props.
12702   injectTextComponentClass: function (componentClass) {
12703     textComponentClass = componentClass;
12704   },
12705   // This accepts a keyed object with classes as values. Each key represents a
12706   // tag. That particular tag will use this class instead of the generic one.
12707   injectComponentClasses: function (componentClasses) {
12708     _assign(tagToComponentClass, componentClasses);
12709   }
12713  * Get a composite component wrapper class for a specific tag.
12715  * @param {ReactElement} element The tag for which to get the class.
12716  * @return {function} The React class constructor function.
12717  */
12718 function getComponentClassForElement(element) {
12719   if (typeof element.type === 'function') {
12720     return element.type;
12721   }
12722   var tag = element.type;
12723   var componentClass = tagToComponentClass[tag];
12724   if (componentClass == null) {
12725     tagToComponentClass[tag] = componentClass = autoGenerateWrapperClass(tag);
12726   }
12727   return componentClass;
12731  * Get a native internal component class for a specific tag.
12733  * @param {ReactElement} element The element to create.
12734  * @return {function} The internal class constructor function.
12735  */
12736 function createInternalComponent(element) {
12737   !genericComponentClass ? "development" !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : invariant(false) : void 0;
12738   return new genericComponentClass(element);
12742  * @param {ReactText} text
12743  * @return {ReactComponent}
12744  */
12745 function createInstanceForText(text) {
12746   return new textComponentClass(text);
12750  * @param {ReactComponent} component
12751  * @return {boolean}
12752  */
12753 function isTextComponent(component) {
12754   return component instanceof textComponentClass;
12757 var ReactNativeComponent = {
12758   getComponentClassForElement: getComponentClassForElement,
12759   createInternalComponent: createInternalComponent,
12760   createInstanceForText: createInstanceForText,
12761   isTextComponent: isTextComponent,
12762   injection: ReactNativeComponentInjection
12765 module.exports = ReactNativeComponent;
12766 },{"173":173,"184":184}],84:[function(_dereq_,module,exports){
12768  * Copyright 2016-present, Facebook, Inc.
12769  * All rights reserved.
12771  * This source code is licensed under the BSD-style license found in the
12772  * LICENSE file in the root directory of this source tree. An additional grant
12773  * of patent rights can be found in the PATENTS file in the same directory.
12775  * @providesModule ReactNativeOperationHistoryDevtool
12776  */
12778 'use strict';
12780 var history = [];
12782 var ReactNativeOperationHistoryDevtool = {
12783   onNativeOperation: function (debugID, type, payload) {
12784     history.push({
12785       instanceID: debugID,
12786       type: type,
12787       payload: payload
12788     });
12789   },
12790   clearHistory: function () {
12791     if (ReactNativeOperationHistoryDevtool._preventClearing) {
12792       // Should only be used for tests.
12793       return;
12794     }
12796     history = [];
12797   },
12798   getHistory: function () {
12799     return history;
12800   }
12803 module.exports = ReactNativeOperationHistoryDevtool;
12804 },{}],85:[function(_dereq_,module,exports){
12806  * Copyright 2013-present, Facebook, Inc.
12807  * All rights reserved.
12809  * This source code is licensed under the BSD-style license found in the
12810  * LICENSE file in the root directory of this source tree. An additional grant
12811  * of patent rights can be found in the PATENTS file in the same directory.
12813  * @providesModule ReactNodeTypes
12814  */
12816 'use strict';
12818 var ReactElement = _dereq_(65);
12820 var invariant = _dereq_(173);
12822 var ReactNodeTypes = {
12823   NATIVE: 0,
12824   COMPOSITE: 1,
12825   EMPTY: 2,
12827   getType: function (node) {
12828     if (node === null || node === false) {
12829       return ReactNodeTypes.EMPTY;
12830     } else if (ReactElement.isValidElement(node)) {
12831       if (typeof node.type === 'function') {
12832         return ReactNodeTypes.COMPOSITE;
12833       } else {
12834         return ReactNodeTypes.NATIVE;
12835       }
12836     }
12837     !false ? "development" !== 'production' ? invariant(false, 'Unexpected node: %s', node) : invariant(false) : void 0;
12838   }
12841 module.exports = ReactNodeTypes;
12842 },{"173":173,"65":65}],86:[function(_dereq_,module,exports){
12844  * Copyright 2015-present, Facebook, Inc.
12845  * All rights reserved.
12847  * This source code is licensed under the BSD-style license found in the
12848  * LICENSE file in the root directory of this source tree. An additional grant
12849  * of patent rights can be found in the PATENTS file in the same directory.
12851  * @providesModule ReactNoopUpdateQueue
12852  */
12854 'use strict';
12856 var warning = _dereq_(183);
12858 function warnTDZ(publicInstance, callerName) {
12859   if ("development" !== 'production') {
12860     "development" !== '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 || '') : void 0;
12861   }
12865  * This is the abstract API for an update queue.
12866  */
12867 var ReactNoopUpdateQueue = {
12869   /**
12870    * Checks whether or not this composite component is mounted.
12871    * @param {ReactClass} publicInstance The instance we want to test.
12872    * @return {boolean} True if mounted, false otherwise.
12873    * @protected
12874    * @final
12875    */
12876   isMounted: function (publicInstance) {
12877     return false;
12878   },
12880   /**
12881    * Enqueue a callback that will be executed after all the pending updates
12882    * have processed.
12883    *
12884    * @param {ReactClass} publicInstance The instance to use as `this` context.
12885    * @param {?function} callback Called after state is updated.
12886    * @internal
12887    */
12888   enqueueCallback: function (publicInstance, callback) {},
12890   /**
12891    * Forces an update. This should only be invoked when it is known with
12892    * certainty that we are **not** in a DOM transaction.
12893    *
12894    * You may want to call this when you know that some deeper aspect of the
12895    * component's state has changed but `setState` was not called.
12896    *
12897    * This will not invoke `shouldComponentUpdate`, but it will invoke
12898    * `componentWillUpdate` and `componentDidUpdate`.
12899    *
12900    * @param {ReactClass} publicInstance The instance that should rerender.
12901    * @internal
12902    */
12903   enqueueForceUpdate: function (publicInstance) {
12904     warnTDZ(publicInstance, 'forceUpdate');
12905   },
12907   /**
12908    * Replaces all of the state. Always use this or `setState` to mutate state.
12909    * You should treat `this.state` as immutable.
12910    *
12911    * There is no guarantee that `this.state` will be immediately updated, so
12912    * accessing `this.state` after calling this method may return the old value.
12913    *
12914    * @param {ReactClass} publicInstance The instance that should rerender.
12915    * @param {object} completeState Next state.
12916    * @internal
12917    */
12918   enqueueReplaceState: function (publicInstance, completeState) {
12919     warnTDZ(publicInstance, 'replaceState');
12920   },
12922   /**
12923    * Sets a subset of the state. This only exists because _pendingState is
12924    * internal. This provides a merging strategy that is not available to deep
12925    * properties which is confusing. TODO: Expose pendingState or don't use it
12926    * during the merge.
12927    *
12928    * @param {ReactClass} publicInstance The instance that should rerender.
12929    * @param {object} partialState Next partial state to be merged with state.
12930    * @internal
12931    */
12932   enqueueSetState: function (publicInstance, partialState) {
12933     warnTDZ(publicInstance, 'setState');
12934   }
12937 module.exports = ReactNoopUpdateQueue;
12938 },{"183":183}],87:[function(_dereq_,module,exports){
12940  * Copyright 2013-present, Facebook, Inc.
12941  * All rights reserved.
12943  * This source code is licensed under the BSD-style license found in the
12944  * LICENSE file in the root directory of this source tree. An additional grant
12945  * of patent rights can be found in the PATENTS file in the same directory.
12947  * @providesModule ReactOwner
12948  */
12950 'use strict';
12952 var invariant = _dereq_(173);
12955  * ReactOwners are capable of storing references to owned components.
12957  * All components are capable of //being// referenced by owner components, but
12958  * only ReactOwner components are capable of //referencing// owned components.
12959  * The named reference is known as a "ref".
12961  * Refs are available when mounted and updated during reconciliation.
12963  *   var MyComponent = React.createClass({
12964  *     render: function() {
12965  *       return (
12966  *         <div onClick={this.handleClick}>
12967  *           <CustomComponent ref="custom" />
12968  *         </div>
12969  *       );
12970  *     },
12971  *     handleClick: function() {
12972  *       this.refs.custom.handleClick();
12973  *     },
12974  *     componentDidMount: function() {
12975  *       this.refs.custom.initialize();
12976  *     }
12977  *   });
12979  * Refs should rarely be used. When refs are used, they should only be done to
12980  * control data that is not handled by React's data flow.
12982  * @class ReactOwner
12983  */
12984 var ReactOwner = {
12986   /**
12987    * @param {?object} object
12988    * @return {boolean} True if `object` is a valid owner.
12989    * @final
12990    */
12991   isValidOwner: function (object) {
12992     return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
12993   },
12995   /**
12996    * Adds a component by ref to an owner component.
12997    *
12998    * @param {ReactComponent} component Component to reference.
12999    * @param {string} ref Name by which to refer to the component.
13000    * @param {ReactOwner} owner Component on which to record the ref.
13001    * @final
13002    * @internal
13003    */
13004   addComponentAsRefTo: function (component, ref, owner) {
13005     !ReactOwner.isValidOwner(owner) ? "development" !== '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) : void 0;
13006     owner.attachRef(ref, component);
13007   },
13009   /**
13010    * Removes a component by ref from an owner component.
13011    *
13012    * @param {ReactComponent} component Component to dereference.
13013    * @param {string} ref Name of the ref to remove.
13014    * @param {ReactOwner} owner Component on which the ref is recorded.
13015    * @final
13016    * @internal
13017    */
13018   removeComponentAsRefFrom: function (component, ref, owner) {
13019     !ReactOwner.isValidOwner(owner) ? "development" !== '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) : void 0;
13020     var ownerPublicInstance = owner.getPublicInstance();
13021     // Check that `component`'s owner is still alive and that `component` is still the current ref
13022     // because we do not want to detach the ref if another component stole it.
13023     if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
13024       owner.detachRef(ref);
13025     }
13026   }
13030 module.exports = ReactOwner;
13031 },{"173":173}],88:[function(_dereq_,module,exports){
13033  * Copyright 2016-present, Facebook, Inc.
13034  * All rights reserved.
13036  * This source code is licensed under the BSD-style license found in the
13037  * LICENSE file in the root directory of this source tree. An additional grant
13038  * of patent rights can be found in the PATENTS file in the same directory.
13040  * @providesModule ReactPerf
13041  */
13043 'use strict';
13045 var _assign = _dereq_(184);
13047 var _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
13049 var ReactDebugTool = _dereq_(62);
13050 var warning = _dereq_(183);
13052 function roundFloat(val) {
13053   var base = arguments.length <= 1 || arguments[1] === undefined ? 2 : arguments[1];
13055   var n = Math.pow(10, base);
13056   return Math.floor(val * n) / n;
13059 function getFlushHistory() {
13060   return ReactDebugTool.getFlushHistory();
13063 function getExclusive() {
13064   var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0];
13066   var aggregatedStats = {};
13067   var affectedIDs = {};
13069   function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) {
13070     var displayName = treeSnapshot[instanceID].displayName;
13072     var key = displayName;
13073     var stats = aggregatedStats[key];
13074     if (!stats) {
13075       affectedIDs[key] = {};
13076       stats = aggregatedStats[key] = {
13077         key: key,
13078         instanceCount: 0,
13079         counts: {},
13080         durations: {},
13081         totalDuration: 0
13082       };
13083     }
13084     if (!stats.durations[timerType]) {
13085       stats.durations[timerType] = 0;
13086     }
13087     if (!stats.counts[timerType]) {
13088       stats.counts[timerType] = 0;
13089     }
13090     affectedIDs[key][instanceID] = true;
13091     applyUpdate(stats);
13092   }
13094   flushHistory.forEach(function (flush) {
13095     var measurements = flush.measurements;
13096     var treeSnapshot = flush.treeSnapshot;
13098     measurements.forEach(function (measurement) {
13099       var duration = measurement.duration;
13100       var instanceID = measurement.instanceID;
13101       var timerType = measurement.timerType;
13103       updateAggregatedStats(treeSnapshot, instanceID, timerType, function (stats) {
13104         stats.totalDuration += duration;
13105         stats.durations[timerType] += duration;
13106         stats.counts[timerType]++;
13107       });
13108     });
13109   });
13111   return Object.keys(aggregatedStats).map(function (key) {
13112     return _extends({}, aggregatedStats[key], {
13113       instanceCount: Object.keys(affectedIDs[key]).length
13114     });
13115   }).sort(function (a, b) {
13116     return b.totalDuration - a.totalDuration;
13117   });
13120 function getInclusive() {
13121   var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0];
13123   var aggregatedStats = {};
13124   var affectedIDs = {};
13126   function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
13127     var _treeSnapshot$instanc = treeSnapshot[instanceID];
13128     var displayName = _treeSnapshot$instanc.displayName;
13129     var ownerID = _treeSnapshot$instanc.ownerID;
13131     var owner = treeSnapshot[ownerID];
13132     var key = (owner ? owner.displayName + ' > ' : '') + displayName;
13133     var stats = aggregatedStats[key];
13134     if (!stats) {
13135       affectedIDs[key] = {};
13136       stats = aggregatedStats[key] = {
13137         key: key,
13138         instanceCount: 0,
13139         inclusiveRenderDuration: 0,
13140         renderCount: 0
13141       };
13142     }
13143     affectedIDs[key][instanceID] = true;
13144     applyUpdate(stats);
13145   }
13147   var isCompositeByID = {};
13148   flushHistory.forEach(function (flush) {
13149     var measurements = flush.measurements;
13151     measurements.forEach(function (measurement) {
13152       var instanceID = measurement.instanceID;
13153       var timerType = measurement.timerType;
13155       if (timerType !== 'render') {
13156         return;
13157       }
13158       isCompositeByID[instanceID] = true;
13159     });
13160   });
13162   flushHistory.forEach(function (flush) {
13163     var measurements = flush.measurements;
13164     var treeSnapshot = flush.treeSnapshot;
13166     measurements.forEach(function (measurement) {
13167       var duration = measurement.duration;
13168       var instanceID = measurement.instanceID;
13169       var timerType = measurement.timerType;
13171       if (timerType !== 'render') {
13172         return;
13173       }
13174       updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
13175         stats.renderCount++;
13176       });
13177       var nextParentID = instanceID;
13178       while (nextParentID) {
13179         // As we traverse parents, only count inclusive time towards composites.
13180         // We know something is a composite if its render() was called.
13181         if (isCompositeByID[nextParentID]) {
13182           updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
13183             stats.inclusiveRenderDuration += duration;
13184           });
13185         }
13186         nextParentID = treeSnapshot[nextParentID].parentID;
13187       }
13188     });
13189   });
13191   return Object.keys(aggregatedStats).map(function (key) {
13192     return _extends({}, aggregatedStats[key], {
13193       instanceCount: Object.keys(affectedIDs[key]).length
13194     });
13195   }).sort(function (a, b) {
13196     return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
13197   });
13200 function getWasted() {
13201   var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0];
13203   var aggregatedStats = {};
13204   var affectedIDs = {};
13206   function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
13207     var _treeSnapshot$instanc2 = treeSnapshot[instanceID];
13208     var displayName = _treeSnapshot$instanc2.displayName;
13209     var ownerID = _treeSnapshot$instanc2.ownerID;
13211     var owner = treeSnapshot[ownerID];
13212     var key = (owner ? owner.displayName + ' > ' : '') + displayName;
13213     var stats = aggregatedStats[key];
13214     if (!stats) {
13215       affectedIDs[key] = {};
13216       stats = aggregatedStats[key] = {
13217         key: key,
13218         instanceCount: 0,
13219         inclusiveRenderDuration: 0,
13220         renderCount: 0
13221       };
13222     }
13223     affectedIDs[key][instanceID] = true;
13224     applyUpdate(stats);
13225   }
13227   flushHistory.forEach(function (flush) {
13228     var measurements = flush.measurements;
13229     var treeSnapshot = flush.treeSnapshot;
13230     var operations = flush.operations;
13232     var isDefinitelyNotWastedByID = {};
13234     // Find native components associated with an operation in this batch.
13235     // Mark all components in their parent tree as definitely not wasted.
13236     operations.forEach(function (operation) {
13237       var instanceID = operation.instanceID;
13239       var nextParentID = instanceID;
13240       while (nextParentID) {
13241         isDefinitelyNotWastedByID[nextParentID] = true;
13242         nextParentID = treeSnapshot[nextParentID].parentID;
13243       }
13244     });
13246     // Find composite components that rendered in this batch.
13247     // These are potential candidates for being wasted renders.
13248     var renderedCompositeIDs = {};
13249     measurements.forEach(function (measurement) {
13250       var instanceID = measurement.instanceID;
13251       var timerType = measurement.timerType;
13253       if (timerType !== 'render') {
13254         return;
13255       }
13256       renderedCompositeIDs[instanceID] = true;
13257     });
13259     measurements.forEach(function (measurement) {
13260       var duration = measurement.duration;
13261       var instanceID = measurement.instanceID;
13262       var timerType = measurement.timerType;
13264       if (timerType !== 'render') {
13265         return;
13266       }
13268       // If there was a DOM update below this component, or it has just been
13269       // mounted, its render() is not considered wasted.
13270       var updateCount = treeSnapshot[instanceID].updateCount;
13272       if (isDefinitelyNotWastedByID[instanceID] || updateCount === 0) {
13273         return;
13274       }
13276       // We consider this render() wasted.
13277       updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
13278         stats.renderCount++;
13279       });
13281       var nextParentID = instanceID;
13282       while (nextParentID) {
13283         // Any parents rendered during this batch are considered wasted
13284         // unless we previously marked them as dirty.
13285         var isWasted = renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID];
13286         if (isWasted) {
13287           updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
13288             stats.inclusiveRenderDuration += duration;
13289           });
13290         }
13291         nextParentID = treeSnapshot[nextParentID].parentID;
13292       }
13293     });
13294   });
13296   return Object.keys(aggregatedStats).map(function (key) {
13297     return _extends({}, aggregatedStats[key], {
13298       instanceCount: Object.keys(affectedIDs[key]).length
13299     });
13300   }).sort(function (a, b) {
13301     return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
13302   });
13305 function getOperations() {
13306   var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getFlushHistory() : arguments[0];
13308   var stats = [];
13309   flushHistory.forEach(function (flush, flushIndex) {
13310     var operations = flush.operations;
13311     var treeSnapshot = flush.treeSnapshot;
13313     operations.forEach(function (operation) {
13314       var instanceID = operation.instanceID;
13315       var type = operation.type;
13316       var payload = operation.payload;
13317       var _treeSnapshot$instanc3 = treeSnapshot[instanceID];
13318       var displayName = _treeSnapshot$instanc3.displayName;
13319       var ownerID = _treeSnapshot$instanc3.ownerID;
13321       var owner = treeSnapshot[ownerID];
13322       var key = (owner ? owner.displayName + ' > ' : '') + displayName;
13324       stats.push({
13325         flushIndex: flushIndex,
13326         instanceID: instanceID,
13327         key: key,
13328         type: type,
13329         ownerID: ownerID,
13330         payload: payload
13331       });
13332     });
13333   });
13334   return stats;
13337 function printExclusive(flushHistory) {
13338   var stats = getExclusive(flushHistory);
13339   var table = stats.map(function (item) {
13340     var key = item.key;
13341     var instanceCount = item.instanceCount;
13342     var totalDuration = item.totalDuration;
13344     var renderCount = item.counts.render || 0;
13345     var renderDuration = item.durations.render || 0;
13346     return {
13347       'Component': key,
13348       'Total time (ms)': roundFloat(totalDuration),
13349       'Instance count': instanceCount,
13350       'Total render time (ms)': roundFloat(renderDuration),
13351       'Average render time (ms)': renderCount ? roundFloat(renderDuration / renderCount) : undefined,
13352       'Render count': renderCount,
13353       'Total lifecycle time (ms)': roundFloat(totalDuration - renderDuration)
13354     };
13355   });
13356   console.table(table);
13359 function printInclusive(flushHistory) {
13360   var stats = getInclusive(flushHistory);
13361   var table = stats.map(function (item) {
13362     var key = item.key;
13363     var instanceCount = item.instanceCount;
13364     var inclusiveRenderDuration = item.inclusiveRenderDuration;
13365     var renderCount = item.renderCount;
13367     return {
13368       'Owner > Component': key,
13369       'Inclusive render time (ms)': roundFloat(inclusiveRenderDuration),
13370       'Instance count': instanceCount,
13371       'Render count': renderCount
13372     };
13373   });
13374   console.table(table);
13377 function printWasted(flushHistory) {
13378   var stats = getWasted(flushHistory);
13379   var table = stats.map(function (item) {
13380     var key = item.key;
13381     var instanceCount = item.instanceCount;
13382     var inclusiveRenderDuration = item.inclusiveRenderDuration;
13383     var renderCount = item.renderCount;
13385     return {
13386       'Owner > Component': key,
13387       'Inclusive wasted time (ms)': roundFloat(inclusiveRenderDuration),
13388       'Instance count': instanceCount,
13389       'Render count': renderCount
13390     };
13391   });
13392   console.table(table);
13395 function printOperations(flushHistory) {
13396   var stats = getOperations(flushHistory);
13397   var table = stats.map(function (stat) {
13398     return {
13399       'Owner > Node': stat.key,
13400       'Operation': stat.type,
13401       'Payload': typeof stat.payload === 'object' ? JSON.stringify(stat.payload) : stat.payload,
13402       'Flush index': stat.flushIndex,
13403       'Owner Component ID': stat.ownerID,
13404       'DOM Component ID': stat.instanceID
13405     };
13406   });
13407   console.table(table);
13410 var warnedAboutPrintDOM = false;
13411 function printDOM(measurements) {
13412   "development" !== 'production' ? warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.') : void 0;
13413   warnedAboutPrintDOM = true;
13414   return printOperations(measurements);
13417 var warnedAboutGetMeasurementsSummaryMap = false;
13418 function getMeasurementsSummaryMap(measurements) {
13419   "development" !== 'production' ? warning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.') : void 0;
13420   warnedAboutGetMeasurementsSummaryMap = true;
13421   return getWasted(measurements);
13424 function start() {
13425   ReactDebugTool.beginProfiling();
13428 function stop() {
13429   ReactDebugTool.endProfiling();
13432 var ReactPerfAnalysis = {
13433   getLastMeasurements: getFlushHistory,
13434   getExclusive: getExclusive,
13435   getInclusive: getInclusive,
13436   getWasted: getWasted,
13437   getOperations: getOperations,
13438   printExclusive: printExclusive,
13439   printInclusive: printInclusive,
13440   printWasted: printWasted,
13441   printOperations: printOperations,
13442   start: start,
13443   stop: stop,
13444   // Deprecated:
13445   printDOM: printDOM,
13446   getMeasurementsSummaryMap: getMeasurementsSummaryMap
13449 module.exports = ReactPerfAnalysis;
13450 },{"183":183,"184":184,"62":62}],89:[function(_dereq_,module,exports){
13452  * Copyright 2013-present, Facebook, Inc.
13453  * All rights reserved.
13455  * This source code is licensed under the BSD-style license found in the
13456  * LICENSE file in the root directory of this source tree. An additional grant
13457  * of patent rights can be found in the PATENTS file in the same directory.
13459  * @providesModule ReactPropTypeLocationNames
13460  */
13462 'use strict';
13464 var ReactPropTypeLocationNames = {};
13466 if ("development" !== 'production') {
13467   ReactPropTypeLocationNames = {
13468     prop: 'prop',
13469     context: 'context',
13470     childContext: 'child context'
13471   };
13474 module.exports = ReactPropTypeLocationNames;
13475 },{}],90:[function(_dereq_,module,exports){
13477  * Copyright 2013-present, Facebook, Inc.
13478  * All rights reserved.
13480  * This source code is licensed under the BSD-style license found in the
13481  * LICENSE file in the root directory of this source tree. An additional grant
13482  * of patent rights can be found in the PATENTS file in the same directory.
13484  * @providesModule ReactPropTypeLocations
13485  */
13487 'use strict';
13489 var keyMirror = _dereq_(176);
13491 var ReactPropTypeLocations = keyMirror({
13492   prop: null,
13493   context: null,
13494   childContext: null
13497 module.exports = ReactPropTypeLocations;
13498 },{"176":176}],91:[function(_dereq_,module,exports){
13500  * Copyright 2013-present, Facebook, Inc.
13501  * All rights reserved.
13503  * This source code is licensed under the BSD-style license found in the
13504  * LICENSE file in the root directory of this source tree. An additional grant
13505  * of patent rights can be found in the PATENTS file in the same directory.
13507  * @providesModule ReactPropTypes
13508  */
13510 'use strict';
13512 var ReactElement = _dereq_(65);
13513 var ReactPropTypeLocationNames = _dereq_(89);
13515 var emptyFunction = _dereq_(165);
13516 var getIteratorFn = _dereq_(139);
13519  * Collection of methods that allow declaration and validation of props that are
13520  * supplied to React components. Example usage:
13522  *   var Props = require('ReactPropTypes');
13523  *   var MyArticle = React.createClass({
13524  *     propTypes: {
13525  *       // An optional string prop named "description".
13526  *       description: Props.string,
13528  *       // A required enum prop named "category".
13529  *       category: Props.oneOf(['News','Photos']).isRequired,
13531  *       // A prop named "dialog" that requires an instance of Dialog.
13532  *       dialog: Props.instanceOf(Dialog).isRequired
13533  *     },
13534  *     render: function() { ... }
13535  *   });
13537  * A more formal specification of how these methods are used:
13539  *   type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
13540  *   decl := ReactPropTypes.{type}(.isRequired)?
13542  * Each and every declaration produces a function with the same signature. This
13543  * allows the creation of custom validation functions. For example:
13545  *  var MyLink = React.createClass({
13546  *    propTypes: {
13547  *      // An optional string or URI prop named "href".
13548  *      href: function(props, propName, componentName) {
13549  *        var propValue = props[propName];
13550  *        if (propValue != null && typeof propValue !== 'string' &&
13551  *            !(propValue instanceof URI)) {
13552  *          return new Error(
13553  *            'Expected a string or an URI for ' + propName + ' in ' +
13554  *            componentName
13555  *          );
13556  *        }
13557  *      }
13558  *    },
13559  *    render: function() {...}
13560  *  });
13562  * @internal
13563  */
13565 var ANONYMOUS = '<<anonymous>>';
13567 var ReactPropTypes = {
13568   array: createPrimitiveTypeChecker('array'),
13569   bool: createPrimitiveTypeChecker('boolean'),
13570   func: createPrimitiveTypeChecker('function'),
13571   number: createPrimitiveTypeChecker('number'),
13572   object: createPrimitiveTypeChecker('object'),
13573   string: createPrimitiveTypeChecker('string'),
13575   any: createAnyTypeChecker(),
13576   arrayOf: createArrayOfTypeChecker,
13577   element: createElementTypeChecker(),
13578   instanceOf: createInstanceTypeChecker,
13579   node: createNodeChecker(),
13580   objectOf: createObjectOfTypeChecker,
13581   oneOf: createEnumTypeChecker,
13582   oneOfType: createUnionTypeChecker,
13583   shape: createShapeTypeChecker
13587  * inlined Object.is polyfill to avoid requiring consumers ship their own
13588  * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
13589  */
13590 /*eslint-disable no-self-compare*/
13591 function is(x, y) {
13592   // SameValue algorithm
13593   if (x === y) {
13594     // Steps 1-5, 7-10
13595     // Steps 6.b-6.e: +0 != -0
13596     return x !== 0 || 1 / x === 1 / y;
13597   } else {
13598     // Step 6.a: NaN == NaN
13599     return x !== x && y !== y;
13600   }
13602 /*eslint-enable no-self-compare*/
13604 function createChainableTypeChecker(validate) {
13605   function checkType(isRequired, props, propName, componentName, location, propFullName) {
13606     componentName = componentName || ANONYMOUS;
13607     propFullName = propFullName || propName;
13608     if (props[propName] == null) {
13609       var locationName = ReactPropTypeLocationNames[location];
13610       if (isRequired) {
13611         return new Error('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
13612       }
13613       return null;
13614     } else {
13615       return validate(props, propName, componentName, location, propFullName);
13616     }
13617   }
13619   var chainedCheckType = checkType.bind(null, false);
13620   chainedCheckType.isRequired = checkType.bind(null, true);
13622   return chainedCheckType;
13625 function createPrimitiveTypeChecker(expectedType) {
13626   function validate(props, propName, componentName, location, propFullName) {
13627     var propValue = props[propName];
13628     var propType = getPropType(propValue);
13629     if (propType !== expectedType) {
13630       var locationName = ReactPropTypeLocationNames[location];
13631       // `propValue` being instance of, say, date/regexp, pass the 'object'
13632       // check, but we can offer a more precise error message here rather than
13633       // 'of type `object`'.
13634       var preciseType = getPreciseType(propValue);
13636       return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
13637     }
13638     return null;
13639   }
13640   return createChainableTypeChecker(validate);
13643 function createAnyTypeChecker() {
13644   return createChainableTypeChecker(emptyFunction.thatReturns(null));
13647 function createArrayOfTypeChecker(typeChecker) {
13648   function validate(props, propName, componentName, location, propFullName) {
13649     if (typeof typeChecker !== 'function') {
13650       return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
13651     }
13652     var propValue = props[propName];
13653     if (!Array.isArray(propValue)) {
13654       var locationName = ReactPropTypeLocationNames[location];
13655       var propType = getPropType(propValue);
13656       return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
13657     }
13658     for (var i = 0; i < propValue.length; i++) {
13659       var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']');
13660       if (error instanceof Error) {
13661         return error;
13662       }
13663     }
13664     return null;
13665   }
13666   return createChainableTypeChecker(validate);
13669 function createElementTypeChecker() {
13670   function validate(props, propName, componentName, location, propFullName) {
13671     if (!ReactElement.isValidElement(props[propName])) {
13672       var locationName = ReactPropTypeLocationNames[location];
13673       return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a single ReactElement.'));
13674     }
13675     return null;
13676   }
13677   return createChainableTypeChecker(validate);
13680 function createInstanceTypeChecker(expectedClass) {
13681   function validate(props, propName, componentName, location, propFullName) {
13682     if (!(props[propName] instanceof expectedClass)) {
13683       var locationName = ReactPropTypeLocationNames[location];
13684       var expectedClassName = expectedClass.name || ANONYMOUS;
13685       var actualClassName = getClassName(props[propName]);
13686       return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
13687     }
13688     return null;
13689   }
13690   return createChainableTypeChecker(validate);
13693 function createEnumTypeChecker(expectedValues) {
13694   if (!Array.isArray(expectedValues)) {
13695     return createChainableTypeChecker(function () {
13696       return new Error('Invalid argument supplied to oneOf, expected an instance of array.');
13697     });
13698   }
13700   function validate(props, propName, componentName, location, propFullName) {
13701     var propValue = props[propName];
13702     for (var i = 0; i < expectedValues.length; i++) {
13703       if (is(propValue, expectedValues[i])) {
13704         return null;
13705       }
13706     }
13708     var locationName = ReactPropTypeLocationNames[location];
13709     var valuesString = JSON.stringify(expectedValues);
13710     return new Error('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
13711   }
13712   return createChainableTypeChecker(validate);
13715 function createObjectOfTypeChecker(typeChecker) {
13716   function validate(props, propName, componentName, location, propFullName) {
13717     if (typeof typeChecker !== 'function') {
13718       return new Error('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
13719     }
13720     var propValue = props[propName];
13721     var propType = getPropType(propValue);
13722     if (propType !== 'object') {
13723       var locationName = ReactPropTypeLocationNames[location];
13724       return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
13725     }
13726     for (var key in propValue) {
13727       if (propValue.hasOwnProperty(key)) {
13728         var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key);
13729         if (error instanceof Error) {
13730           return error;
13731         }
13732       }
13733     }
13734     return null;
13735   }
13736   return createChainableTypeChecker(validate);
13739 function createUnionTypeChecker(arrayOfTypeCheckers) {
13740   if (!Array.isArray(arrayOfTypeCheckers)) {
13741     return createChainableTypeChecker(function () {
13742       return new Error('Invalid argument supplied to oneOfType, expected an instance of array.');
13743     });
13744   }
13746   function validate(props, propName, componentName, location, propFullName) {
13747     for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
13748       var checker = arrayOfTypeCheckers[i];
13749       if (checker(props, propName, componentName, location, propFullName) == null) {
13750         return null;
13751       }
13752     }
13754     var locationName = ReactPropTypeLocationNames[location];
13755     return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
13756   }
13757   return createChainableTypeChecker(validate);
13760 function createNodeChecker() {
13761   function validate(props, propName, componentName, location, propFullName) {
13762     if (!isNode(props[propName])) {
13763       var locationName = ReactPropTypeLocationNames[location];
13764       return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
13765     }
13766     return null;
13767   }
13768   return createChainableTypeChecker(validate);
13771 function createShapeTypeChecker(shapeTypes) {
13772   function validate(props, propName, componentName, location, propFullName) {
13773     var propValue = props[propName];
13774     var propType = getPropType(propValue);
13775     if (propType !== 'object') {
13776       var locationName = ReactPropTypeLocationNames[location];
13777       return new Error('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
13778     }
13779     for (var key in shapeTypes) {
13780       var checker = shapeTypes[key];
13781       if (!checker) {
13782         continue;
13783       }
13784       var error = checker(propValue, key, componentName, location, propFullName + '.' + key);
13785       if (error) {
13786         return error;
13787       }
13788     }
13789     return null;
13790   }
13791   return createChainableTypeChecker(validate);
13794 function isNode(propValue) {
13795   switch (typeof propValue) {
13796     case 'number':
13797     case 'string':
13798     case 'undefined':
13799       return true;
13800     case 'boolean':
13801       return !propValue;
13802     case 'object':
13803       if (Array.isArray(propValue)) {
13804         return propValue.every(isNode);
13805       }
13806       if (propValue === null || ReactElement.isValidElement(propValue)) {
13807         return true;
13808       }
13810       var iteratorFn = getIteratorFn(propValue);
13811       if (iteratorFn) {
13812         var iterator = iteratorFn.call(propValue);
13813         var step;
13814         if (iteratorFn !== propValue.entries) {
13815           while (!(step = iterator.next()).done) {
13816             if (!isNode(step.value)) {
13817               return false;
13818             }
13819           }
13820         } else {
13821           // Iterator will provide entry [k,v] tuples rather than values.
13822           while (!(step = iterator.next()).done) {
13823             var entry = step.value;
13824             if (entry) {
13825               if (!isNode(entry[1])) {
13826                 return false;
13827               }
13828             }
13829           }
13830         }
13831       } else {
13832         return false;
13833       }
13835       return true;
13836     default:
13837       return false;
13838   }
13841 // Equivalent of `typeof` but with special handling for array and regexp.
13842 function getPropType(propValue) {
13843   var propType = typeof propValue;
13844   if (Array.isArray(propValue)) {
13845     return 'array';
13846   }
13847   if (propValue instanceof RegExp) {
13848     // Old webkits (at least until Android 4.0) return 'function' rather than
13849     // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
13850     // passes PropTypes.object.
13851     return 'object';
13852   }
13853   return propType;
13856 // This handles more types than `getPropType`. Only used for error messages.
13857 // See `createPrimitiveTypeChecker`.
13858 function getPreciseType(propValue) {
13859   var propType = getPropType(propValue);
13860   if (propType === 'object') {
13861     if (propValue instanceof Date) {
13862       return 'date';
13863     } else if (propValue instanceof RegExp) {
13864       return 'regexp';
13865     }
13866   }
13867   return propType;
13870 // Returns class name of the object, if any.
13871 function getClassName(propValue) {
13872   if (!propValue.constructor || !propValue.constructor.name) {
13873     return ANONYMOUS;
13874   }
13875   return propValue.constructor.name;
13878 module.exports = ReactPropTypes;
13879 },{"139":139,"165":165,"65":65,"89":89}],92:[function(_dereq_,module,exports){
13881  * Copyright 2013-present, Facebook, Inc.
13882  * All rights reserved.
13884  * This source code is licensed under the BSD-style license found in the
13885  * LICENSE file in the root directory of this source tree. An additional grant
13886  * of patent rights can be found in the PATENTS file in the same directory.
13888  * @providesModule ReactReconcileTransaction
13889  */
13891 'use strict';
13893 var _assign = _dereq_(184);
13895 var CallbackQueue = _dereq_(5);
13896 var PooledClass = _dereq_(26);
13897 var ReactBrowserEventEmitter = _dereq_(28);
13898 var ReactInputSelection = _dereq_(74);
13899 var Transaction = _dereq_(124);
13902  * Ensures that, when possible, the selection range (currently selected text
13903  * input) is not disturbed by performing the transaction.
13904  */
13905 var SELECTION_RESTORATION = {
13906   /**
13907    * @return {Selection} Selection information.
13908    */
13909   initialize: ReactInputSelection.getSelectionInformation,
13910   /**
13911    * @param {Selection} sel Selection information returned from `initialize`.
13912    */
13913   close: ReactInputSelection.restoreSelection
13917  * Suppresses events (blur/focus) that could be inadvertently dispatched due to
13918  * high level DOM manipulations (like temporarily removing a text input from the
13919  * DOM).
13920  */
13921 var EVENT_SUPPRESSION = {
13922   /**
13923    * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
13924    * the reconciliation.
13925    */
13926   initialize: function () {
13927     var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
13928     ReactBrowserEventEmitter.setEnabled(false);
13929     return currentlyEnabled;
13930   },
13932   /**
13933    * @param {boolean} previouslyEnabled Enabled status of
13934    *   `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
13935    *   restores the previous value.
13936    */
13937   close: function (previouslyEnabled) {
13938     ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
13939   }
13943  * Provides a queue for collecting `componentDidMount` and
13944  * `componentDidUpdate` callbacks during the transaction.
13945  */
13946 var ON_DOM_READY_QUEUEING = {
13947   /**
13948    * Initializes the internal `onDOMReady` queue.
13949    */
13950   initialize: function () {
13951     this.reactMountReady.reset();
13952   },
13954   /**
13955    * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
13956    */
13957   close: function () {
13958     this.reactMountReady.notifyAll();
13959   }
13963  * Executed within the scope of the `Transaction` instance. Consider these as
13964  * being member methods, but with an implied ordering while being isolated from
13965  * each other.
13966  */
13967 var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
13970  * Currently:
13971  * - The order that these are listed in the transaction is critical:
13972  * - Suppresses events.
13973  * - Restores selection range.
13975  * Future:
13976  * - Restore document/overflow scroll positions that were unintentionally
13977  *   modified via DOM insertions above the top viewport boundary.
13978  * - Implement/integrate with customized constraint based layout system and keep
13979  *   track of which dimensions must be remeasured.
13981  * @class ReactReconcileTransaction
13982  */
13983 function ReactReconcileTransaction(useCreateElement) {
13984   this.reinitializeTransaction();
13985   // Only server-side rendering really needs this option (see
13986   // `ReactServerRendering`), but server-side uses
13987   // `ReactServerRenderingTransaction` instead. This option is here so that it's
13988   // accessible and defaults to false when `ReactDOMComponent` and
13989   // `ReactTextComponent` checks it in `mountComponent`.`
13990   this.renderToStaticMarkup = false;
13991   this.reactMountReady = CallbackQueue.getPooled(null);
13992   this.useCreateElement = useCreateElement;
13995 var Mixin = {
13996   /**
13997    * @see Transaction
13998    * @abstract
13999    * @final
14000    * @return {array<object>} List of operation wrap procedures.
14001    *   TODO: convert to array<TransactionWrapper>
14002    */
14003   getTransactionWrappers: function () {
14004     return TRANSACTION_WRAPPERS;
14005   },
14007   /**
14008    * @return {object} The queue to collect `onDOMReady` callbacks with.
14009    */
14010   getReactMountReady: function () {
14011     return this.reactMountReady;
14012   },
14014   /**
14015    * Save current transaction state -- if the return value from this method is
14016    * passed to `rollback`, the transaction will be reset to that state.
14017    */
14018   checkpoint: function () {
14019     // reactMountReady is the our only stateful wrapper
14020     return this.reactMountReady.checkpoint();
14021   },
14023   rollback: function (checkpoint) {
14024     this.reactMountReady.rollback(checkpoint);
14025   },
14027   /**
14028    * `PooledClass` looks for this, and will invoke this before allowing this
14029    * instance to be reused.
14030    */
14031   destructor: function () {
14032     CallbackQueue.release(this.reactMountReady);
14033     this.reactMountReady = null;
14034   }
14037 _assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
14039 PooledClass.addPoolingTo(ReactReconcileTransaction);
14041 module.exports = ReactReconcileTransaction;
14042 },{"124":124,"184":184,"26":26,"28":28,"5":5,"74":74}],93:[function(_dereq_,module,exports){
14044  * Copyright 2013-present, Facebook, Inc.
14045  * All rights reserved.
14047  * This source code is licensed under the BSD-style license found in the
14048  * LICENSE file in the root directory of this source tree. An additional grant
14049  * of patent rights can be found in the PATENTS file in the same directory.
14051  * @providesModule ReactReconciler
14052  */
14054 'use strict';
14056 var ReactRef = _dereq_(94);
14057 var ReactInstrumentation = _dereq_(76);
14059 var invariant = _dereq_(173);
14062  * Helper to call ReactRef.attachRefs with this composite component, split out
14063  * to avoid allocations in the transaction mount-ready queue.
14064  */
14065 function attachRefs() {
14066   ReactRef.attachRefs(this, this._currentElement);
14069 var ReactReconciler = {
14071   /**
14072    * Initializes the component, renders markup, and registers event listeners.
14073    *
14074    * @param {ReactComponent} internalInstance
14075    * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
14076    * @param {?object} the containing native component instance
14077    * @param {?object} info about the native container
14078    * @return {?string} Rendered markup to be inserted into the DOM.
14079    * @final
14080    * @internal
14081    */
14082   mountComponent: function (internalInstance, transaction, nativeParent, nativeContainerInfo, context) {
14083     if ("development" !== 'production') {
14084       if (internalInstance._debugID !== 0) {
14085         ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'mountComponent');
14086       }
14087     }
14088     var markup = internalInstance.mountComponent(transaction, nativeParent, nativeContainerInfo, context);
14089     if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
14090       transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
14091     }
14092     if ("development" !== 'production') {
14093       if (internalInstance._debugID !== 0) {
14094         ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'mountComponent');
14095         ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
14096       }
14097     }
14098     return markup;
14099   },
14101   /**
14102    * Returns a value that can be passed to
14103    * ReactComponentEnvironment.replaceNodeWithMarkup.
14104    */
14105   getNativeNode: function (internalInstance) {
14106     return internalInstance.getNativeNode();
14107   },
14109   /**
14110    * Releases any resources allocated by `mountComponent`.
14111    *
14112    * @final
14113    * @internal
14114    */
14115   unmountComponent: function (internalInstance, safely) {
14116     if ("development" !== 'production') {
14117       if (internalInstance._debugID !== 0) {
14118         ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'unmountComponent');
14119       }
14120     }
14121     ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
14122     internalInstance.unmountComponent(safely);
14123     if ("development" !== 'production') {
14124       if (internalInstance._debugID !== 0) {
14125         ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'unmountComponent');
14126         ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
14127       }
14128     }
14129   },
14131   /**
14132    * Update a component using a new element.
14133    *
14134    * @param {ReactComponent} internalInstance
14135    * @param {ReactElement} nextElement
14136    * @param {ReactReconcileTransaction} transaction
14137    * @param {object} context
14138    * @internal
14139    */
14140   receiveComponent: function (internalInstance, nextElement, transaction, context) {
14141     var prevElement = internalInstance._currentElement;
14143     if (nextElement === prevElement && context === internalInstance._context) {
14144       // Since elements are immutable after the owner is rendered,
14145       // we can do a cheap identity compare here to determine if this is a
14146       // superfluous reconcile. It's possible for state to be mutable but such
14147       // change should trigger an update of the owner which would recreate
14148       // the element. We explicitly check for the existence of an owner since
14149       // it's possible for an element created outside a composite to be
14150       // deeply mutated and reused.
14152       // TODO: Bailing out early is just a perf optimization right?
14153       // TODO: Removing the return statement should affect correctness?
14154       return;
14155     }
14157     if ("development" !== 'production') {
14158       if (internalInstance._debugID !== 0) {
14159         ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'receiveComponent');
14160       }
14161     }
14163     var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
14165     if (refsChanged) {
14166       ReactRef.detachRefs(internalInstance, prevElement);
14167     }
14169     internalInstance.receiveComponent(nextElement, transaction, context);
14171     if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
14172       transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
14173     }
14175     if ("development" !== 'production') {
14176       if (internalInstance._debugID !== 0) {
14177         ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'receiveComponent');
14178         ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
14179       }
14180     }
14181   },
14183   /**
14184    * Flush any dirty changes in a component.
14185    *
14186    * @param {ReactComponent} internalInstance
14187    * @param {ReactReconcileTransaction} transaction
14188    * @internal
14189    */
14190   performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
14191     if (internalInstance._updateBatchNumber !== updateBatchNumber) {
14192       // The component's enqueued batch number should always be the current
14193       // batch or the following one.
14194       !(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1) ? "development" !== 'production' ? invariant(false, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : invariant(false) : void 0;
14195       return;
14196     }
14197     if ("development" !== 'production') {
14198       if (internalInstance._debugID !== 0) {
14199         ReactInstrumentation.debugTool.onBeginReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary');
14200       }
14201     }
14202     internalInstance.performUpdateIfNecessary(transaction);
14203     if ("development" !== 'production') {
14204       if (internalInstance._debugID !== 0) {
14205         ReactInstrumentation.debugTool.onEndReconcilerTimer(internalInstance._debugID, 'performUpdateIfNecessary');
14206         ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
14207       }
14208     }
14209   }
14213 module.exports = ReactReconciler;
14214 },{"173":173,"76":76,"94":94}],94:[function(_dereq_,module,exports){
14216  * Copyright 2013-present, Facebook, Inc.
14217  * All rights reserved.
14219  * This source code is licensed under the BSD-style license found in the
14220  * LICENSE file in the root directory of this source tree. An additional grant
14221  * of patent rights can be found in the PATENTS file in the same directory.
14223  * @providesModule ReactRef
14224  */
14226 'use strict';
14228 var ReactOwner = _dereq_(87);
14230 var ReactRef = {};
14232 function attachRef(ref, component, owner) {
14233   if (typeof ref === 'function') {
14234     ref(component.getPublicInstance());
14235   } else {
14236     // Legacy ref
14237     ReactOwner.addComponentAsRefTo(component, ref, owner);
14238   }
14241 function detachRef(ref, component, owner) {
14242   if (typeof ref === 'function') {
14243     ref(null);
14244   } else {
14245     // Legacy ref
14246     ReactOwner.removeComponentAsRefFrom(component, ref, owner);
14247   }
14250 ReactRef.attachRefs = function (instance, element) {
14251   if (element === null || element === false) {
14252     return;
14253   }
14254   var ref = element.ref;
14255   if (ref != null) {
14256     attachRef(ref, instance, element._owner);
14257   }
14260 ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
14261   // If either the owner or a `ref` has changed, make sure the newest owner
14262   // has stored a reference to `this`, and the previous owner (if different)
14263   // has forgotten the reference to `this`. We use the element instead
14264   // of the public this.props because the post processing cannot determine
14265   // a ref. The ref conceptually lives on the element.
14267   // TODO: Should this even be possible? The owner cannot change because
14268   // it's forbidden by shouldUpdateReactComponent. The ref can change
14269   // if you swap the keys of but not the refs. Reconsider where this check
14270   // is made. It probably belongs where the key checking and
14271   // instantiateReactComponent is done.
14273   var prevEmpty = prevElement === null || prevElement === false;
14274   var nextEmpty = nextElement === null || nextElement === false;
14276   return(
14277     // This has a few false positives w/r/t empty components.
14278     prevEmpty || nextEmpty || nextElement._owner !== prevElement._owner || nextElement.ref !== prevElement.ref
14279   );
14282 ReactRef.detachRefs = function (instance, element) {
14283   if (element === null || element === false) {
14284     return;
14285   }
14286   var ref = element.ref;
14287   if (ref != null) {
14288     detachRef(ref, instance, element._owner);
14289   }
14292 module.exports = ReactRef;
14293 },{"87":87}],95:[function(_dereq_,module,exports){
14295  * Copyright 2014-present, Facebook, Inc.
14296  * All rights reserved.
14298  * This source code is licensed under the BSD-style license found in the
14299  * LICENSE file in the root directory of this source tree. An additional grant
14300  * of patent rights can be found in the PATENTS file in the same directory.
14302  * @providesModule ReactServerBatchingStrategy
14303  */
14305 'use strict';
14307 var ReactServerBatchingStrategy = {
14308   isBatchingUpdates: false,
14309   batchedUpdates: function (callback) {
14310     // Don't do anything here. During the server rendering we don't want to
14311     // schedule any updates. We will simply ignore them.
14312   }
14315 module.exports = ReactServerBatchingStrategy;
14316 },{}],96:[function(_dereq_,module,exports){
14318  * Copyright 2013-present, Facebook, Inc.
14319  * All rights reserved.
14321  * This source code is licensed under the BSD-style license found in the
14322  * LICENSE file in the root directory of this source tree. An additional grant
14323  * of patent rights can be found in the PATENTS file in the same directory.
14325  * @providesModule ReactServerRendering
14326  */
14327 'use strict';
14329 var ReactDOMContainerInfo = _dereq_(46);
14330 var ReactDefaultBatchingStrategy = _dereq_(63);
14331 var ReactElement = _dereq_(65);
14332 var ReactInstrumentation = _dereq_(76);
14333 var ReactMarkupChecksum = _dereq_(79);
14334 var ReactReconciler = _dereq_(93);
14335 var ReactServerBatchingStrategy = _dereq_(95);
14336 var ReactServerRenderingTransaction = _dereq_(97);
14337 var ReactUpdates = _dereq_(104);
14339 var emptyObject = _dereq_(166);
14340 var instantiateReactComponent = _dereq_(144);
14341 var invariant = _dereq_(173);
14344  * @param {ReactElement} element
14345  * @return {string} the HTML markup
14346  */
14347 function renderToStringImpl(element, makeStaticMarkup) {
14348   var transaction;
14349   try {
14350     ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
14352     transaction = ReactServerRenderingTransaction.getPooled(makeStaticMarkup);
14354     return transaction.perform(function () {
14355       if ("development" !== 'production') {
14356         ReactInstrumentation.debugTool.onBeginFlush();
14357       }
14358       var componentInstance = instantiateReactComponent(element);
14359       var markup = ReactReconciler.mountComponent(componentInstance, transaction, null, ReactDOMContainerInfo(), emptyObject);
14360       if ("development" !== 'production') {
14361         ReactInstrumentation.debugTool.onUnmountComponent(componentInstance._debugID);
14362         ReactInstrumentation.debugTool.onEndFlush();
14363       }
14364       if (!makeStaticMarkup) {
14365         markup = ReactMarkupChecksum.addChecksumToMarkup(markup);
14366       }
14367       return markup;
14368     }, null);
14369   } finally {
14370     ReactServerRenderingTransaction.release(transaction);
14371     // Revert to the DOM batching strategy since these two renderers
14372     // currently share these stateful modules.
14373     ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
14374   }
14378  * Render a ReactElement to its initial HTML. This should only be used on the
14379  * server.
14380  * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostring
14381  */
14382 function renderToString(element) {
14383   !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : invariant(false) : void 0;
14384   return renderToStringImpl(element, false);
14388  * Similar to renderToString, except this doesn't create extra DOM attributes
14389  * such as data-react-id that React uses internally.
14390  * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostaticmarkup
14391  */
14392 function renderToStaticMarkup(element) {
14393   !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : invariant(false) : void 0;
14394   return renderToStringImpl(element, true);
14397 module.exports = {
14398   renderToString: renderToString,
14399   renderToStaticMarkup: renderToStaticMarkup
14401 },{"104":104,"144":144,"166":166,"173":173,"46":46,"63":63,"65":65,"76":76,"79":79,"93":93,"95":95,"97":97}],97:[function(_dereq_,module,exports){
14403  * Copyright 2014-present, Facebook, Inc.
14404  * All rights reserved.
14406  * This source code is licensed under the BSD-style license found in the
14407  * LICENSE file in the root directory of this source tree. An additional grant
14408  * of patent rights can be found in the PATENTS file in the same directory.
14410  * @providesModule ReactServerRenderingTransaction
14411  */
14413 'use strict';
14415 var _assign = _dereq_(184);
14417 var PooledClass = _dereq_(26);
14418 var Transaction = _dereq_(124);
14421  * Executed within the scope of the `Transaction` instance. Consider these as
14422  * being member methods, but with an implied ordering while being isolated from
14423  * each other.
14424  */
14425 var TRANSACTION_WRAPPERS = [];
14427 var noopCallbackQueue = {
14428   enqueue: function () {}
14432  * @class ReactServerRenderingTransaction
14433  * @param {boolean} renderToStaticMarkup
14434  */
14435 function ReactServerRenderingTransaction(renderToStaticMarkup) {
14436   this.reinitializeTransaction();
14437   this.renderToStaticMarkup = renderToStaticMarkup;
14438   this.useCreateElement = false;
14441 var Mixin = {
14442   /**
14443    * @see Transaction
14444    * @abstract
14445    * @final
14446    * @return {array} Empty list of operation wrap procedures.
14447    */
14448   getTransactionWrappers: function () {
14449     return TRANSACTION_WRAPPERS;
14450   },
14452   /**
14453    * @return {object} The queue to collect `onDOMReady` callbacks with.
14454    */
14455   getReactMountReady: function () {
14456     return noopCallbackQueue;
14457   },
14459   /**
14460    * `PooledClass` looks for this, and will invoke this before allowing this
14461    * instance to be reused.
14462    */
14463   destructor: function () {},
14465   checkpoint: function () {},
14467   rollback: function () {}
14470 _assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);
14472 PooledClass.addPoolingTo(ReactServerRenderingTransaction);
14474 module.exports = ReactServerRenderingTransaction;
14475 },{"124":124,"184":184,"26":26}],98:[function(_dereq_,module,exports){
14477  * Copyright 2013-present, Facebook, Inc.
14478  * All rights reserved.
14480  * This source code is licensed under the BSD-style license found in the
14481  * LICENSE file in the root directory of this source tree. An additional grant
14482  * of patent rights can be found in the PATENTS file in the same directory.
14484  * @providesModule ReactStateSetters
14485  */
14487 'use strict';
14489 var ReactStateSetters = {
14490   /**
14491    * Returns a function that calls the provided function, and uses the result
14492    * of that to set the component's state.
14493    *
14494    * @param {ReactCompositeComponent} component
14495    * @param {function} funcReturningState Returned callback uses this to
14496    *                                      determine how to update state.
14497    * @return {function} callback that when invoked uses funcReturningState to
14498    *                    determined the object literal to setState.
14499    */
14500   createStateSetter: function (component, funcReturningState) {
14501     return function (a, b, c, d, e, f) {
14502       var partialState = funcReturningState.call(component, a, b, c, d, e, f);
14503       if (partialState) {
14504         component.setState(partialState);
14505       }
14506     };
14507   },
14509   /**
14510    * Returns a single-argument callback that can be used to update a single
14511    * key in the component's state.
14512    *
14513    * Note: this is memoized function, which makes it inexpensive to call.
14514    *
14515    * @param {ReactCompositeComponent} component
14516    * @param {string} key The key in the state that you should update.
14517    * @return {function} callback of 1 argument which calls setState() with
14518    *                    the provided keyName and callback argument.
14519    */
14520   createStateKeySetter: function (component, key) {
14521     // Memoize the setters.
14522     var cache = component.__keySetters || (component.__keySetters = {});
14523     return cache[key] || (cache[key] = createStateKeySetter(component, key));
14524   }
14527 function createStateKeySetter(component, key) {
14528   // Partial state is allocated outside of the function closure so it can be
14529   // reused with every call, avoiding memory allocation when this function
14530   // is called.
14531   var partialState = {};
14532   return function stateKeySetter(value) {
14533     partialState[key] = value;
14534     component.setState(partialState);
14535   };
14538 ReactStateSetters.Mixin = {
14539   /**
14540    * Returns a function that calls the provided function, and uses the result
14541    * of that to set the component's state.
14542    *
14543    * For example, these statements are equivalent:
14544    *
14545    *   this.setState({x: 1});
14546    *   this.createStateSetter(function(xValue) {
14547    *     return {x: xValue};
14548    *   })(1);
14549    *
14550    * @param {function} funcReturningState Returned callback uses this to
14551    *                                      determine how to update state.
14552    * @return {function} callback that when invoked uses funcReturningState to
14553    *                    determined the object literal to setState.
14554    */
14555   createStateSetter: function (funcReturningState) {
14556     return ReactStateSetters.createStateSetter(this, funcReturningState);
14557   },
14559   /**
14560    * Returns a single-argument callback that can be used to update a single
14561    * key in the component's state.
14562    *
14563    * For example, these statements are equivalent:
14564    *
14565    *   this.setState({x: 1});
14566    *   this.createStateKeySetter('x')(1);
14567    *
14568    * Note: this is memoized function, which makes it inexpensive to call.
14569    *
14570    * @param {string} key The key in the state that you should update.
14571    * @return {function} callback of 1 argument which calls setState() with
14572    *                    the provided keyName and callback argument.
14573    */
14574   createStateKeySetter: function (key) {
14575     return ReactStateSetters.createStateKeySetter(this, key);
14576   }
14579 module.exports = ReactStateSetters;
14580 },{}],99:[function(_dereq_,module,exports){
14582  * Copyright 2013-present, Facebook, Inc.
14583  * All rights reserved.
14585  * This source code is licensed under the BSD-style license found in the
14586  * LICENSE file in the root directory of this source tree. An additional grant
14587  * of patent rights can be found in the PATENTS file in the same directory.
14589  * @providesModule ReactTestUtils
14590  */
14592 'use strict';
14594 var _assign = _dereq_(184);
14596 var EventConstants = _dereq_(16);
14597 var EventPluginHub = _dereq_(17);
14598 var EventPluginRegistry = _dereq_(18);
14599 var EventPropagators = _dereq_(20);
14600 var React = _dereq_(27);
14601 var ReactDefaultInjection = _dereq_(64);
14602 var ReactDOM = _dereq_(41);
14603 var ReactDOMComponentTree = _dereq_(45);
14604 var ReactElement = _dereq_(65);
14605 var ReactBrowserEventEmitter = _dereq_(28);
14606 var ReactCompositeComponent = _dereq_(39);
14607 var ReactInstanceMap = _dereq_(75);
14608 var ReactUpdates = _dereq_(104);
14609 var SyntheticEvent = _dereq_(115);
14611 var emptyObject = _dereq_(166);
14612 var findDOMNode = _dereq_(132);
14613 var invariant = _dereq_(173);
14615 var topLevelTypes = EventConstants.topLevelTypes;
14617 function Event(suffix) {}
14620  * @class ReactTestUtils
14621  */
14623 function findAllInRenderedTreeInternal(inst, test) {
14624   if (!inst || !inst.getPublicInstance) {
14625     return [];
14626   }
14627   var publicInst = inst.getPublicInstance();
14628   var ret = test(publicInst) ? [publicInst] : [];
14629   var currentElement = inst._currentElement;
14630   if (ReactTestUtils.isDOMComponent(publicInst)) {
14631     var renderedChildren = inst._renderedChildren;
14632     var key;
14633     for (key in renderedChildren) {
14634       if (!renderedChildren.hasOwnProperty(key)) {
14635         continue;
14636       }
14637       ret = ret.concat(findAllInRenderedTreeInternal(renderedChildren[key], test));
14638     }
14639   } else if (ReactElement.isValidElement(currentElement) && typeof currentElement.type === 'function') {
14640     ret = ret.concat(findAllInRenderedTreeInternal(inst._renderedComponent, test));
14641   }
14642   return ret;
14646  * Utilities for making it easy to test React components.
14648  * See https://facebook.github.io/react/docs/test-utils.html
14650  * Todo: Support the entire DOM.scry query syntax. For now, these simple
14651  * utilities will suffice for testing purposes.
14652  * @lends ReactTestUtils
14653  */
14654 var ReactTestUtils = {
14655   renderIntoDocument: function (instance) {
14656     var div = document.createElement('div');
14657     // None of our tests actually require attaching the container to the
14658     // DOM, and doing so creates a mess that we rely on test isolation to
14659     // clean up, so we're going to stop honoring the name of this method
14660     // (and probably rename it eventually) if no problems arise.
14661     // document.documentElement.appendChild(div);
14662     return ReactDOM.render(instance, div);
14663   },
14665   isElement: function (element) {
14666     return ReactElement.isValidElement(element);
14667   },
14669   isElementOfType: function (inst, convenienceConstructor) {
14670     return ReactElement.isValidElement(inst) && inst.type === convenienceConstructor;
14671   },
14673   isDOMComponent: function (inst) {
14674     return !!(inst && inst.nodeType === 1 && inst.tagName);
14675   },
14677   isDOMComponentElement: function (inst) {
14678     return !!(inst && ReactElement.isValidElement(inst) && !!inst.tagName);
14679   },
14681   isCompositeComponent: function (inst) {
14682     if (ReactTestUtils.isDOMComponent(inst)) {
14683       // Accessing inst.setState warns; just return false as that'll be what
14684       // this returns when we have DOM nodes as refs directly
14685       return false;
14686     }
14687     return inst != null && typeof inst.render === 'function' && typeof inst.setState === 'function';
14688   },
14690   isCompositeComponentWithType: function (inst, type) {
14691     if (!ReactTestUtils.isCompositeComponent(inst)) {
14692       return false;
14693     }
14694     var internalInstance = ReactInstanceMap.get(inst);
14695     var constructor = internalInstance._currentElement.type;
14697     return constructor === type;
14698   },
14700   isCompositeComponentElement: function (inst) {
14701     if (!ReactElement.isValidElement(inst)) {
14702       return false;
14703     }
14704     // We check the prototype of the type that will get mounted, not the
14705     // instance itself. This is a future proof way of duck typing.
14706     var prototype = inst.type.prototype;
14707     return typeof prototype.render === 'function' && typeof prototype.setState === 'function';
14708   },
14710   isCompositeComponentElementWithType: function (inst, type) {
14711     var internalInstance = ReactInstanceMap.get(inst);
14712     var constructor = internalInstance._currentElement.type;
14714     return !!(ReactTestUtils.isCompositeComponentElement(inst) && constructor === type);
14715   },
14717   getRenderedChildOfCompositeComponent: function (inst) {
14718     if (!ReactTestUtils.isCompositeComponent(inst)) {
14719       return null;
14720     }
14721     var internalInstance = ReactInstanceMap.get(inst);
14722     return internalInstance._renderedComponent.getPublicInstance();
14723   },
14725   findAllInRenderedTree: function (inst, test) {
14726     if (!inst) {
14727       return [];
14728     }
14729     !ReactTestUtils.isCompositeComponent(inst) ? "development" !== 'production' ? invariant(false, 'findAllInRenderedTree(...): instance must be a composite component') : invariant(false) : void 0;
14730     return findAllInRenderedTreeInternal(ReactInstanceMap.get(inst), test);
14731   },
14733   /**
14734    * Finds all instance of components in the rendered tree that are DOM
14735    * components with the class name matching `className`.
14736    * @return {array} an array of all the matches.
14737    */
14738   scryRenderedDOMComponentsWithClass: function (root, classNames) {
14739     return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
14740       if (ReactTestUtils.isDOMComponent(inst)) {
14741         var className = inst.className;
14742         if (typeof className !== 'string') {
14743           // SVG, probably.
14744           className = inst.getAttribute('class') || '';
14745         }
14746         var classList = className.split(/\s+/);
14748         if (!Array.isArray(classNames)) {
14749           !(classNames !== undefined) ? "development" !== 'production' ? invariant(false, 'TestUtils.scryRenderedDOMComponentsWithClass expects a ' + 'className as a second argument.') : invariant(false) : void 0;
14750           classNames = classNames.split(/\s+/);
14751         }
14752         return classNames.every(function (name) {
14753           return classList.indexOf(name) !== -1;
14754         });
14755       }
14756       return false;
14757     });
14758   },
14760   /**
14761    * Like scryRenderedDOMComponentsWithClass but expects there to be one result,
14762    * and returns that one result, or throws exception if there is any other
14763    * number of matches besides one.
14764    * @return {!ReactDOMComponent} The one match.
14765    */
14766   findRenderedDOMComponentWithClass: function (root, className) {
14767     var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);
14768     if (all.length !== 1) {
14769       throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for class:' + className);
14770     }
14771     return all[0];
14772   },
14774   /**
14775    * Finds all instance of components in the rendered tree that are DOM
14776    * components with the tag name matching `tagName`.
14777    * @return {array} an array of all the matches.
14778    */
14779   scryRenderedDOMComponentsWithTag: function (root, tagName) {
14780     return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
14781       return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase();
14782     });
14783   },
14785   /**
14786    * Like scryRenderedDOMComponentsWithTag but expects there to be one result,
14787    * and returns that one result, or throws exception if there is any other
14788    * number of matches besides one.
14789    * @return {!ReactDOMComponent} The one match.
14790    */
14791   findRenderedDOMComponentWithTag: function (root, tagName) {
14792     var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName);
14793     if (all.length !== 1) {
14794       throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for tag:' + tagName);
14795     }
14796     return all[0];
14797   },
14799   /**
14800    * Finds all instances of components with type equal to `componentType`.
14801    * @return {array} an array of all the matches.
14802    */
14803   scryRenderedComponentsWithType: function (root, componentType) {
14804     return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
14805       return ReactTestUtils.isCompositeComponentWithType(inst, componentType);
14806     });
14807   },
14809   /**
14810    * Same as `scryRenderedComponentsWithType` but expects there to be one result
14811    * and returns that one result, or throws exception if there is any other
14812    * number of matches besides one.
14813    * @return {!ReactComponent} The one match.
14814    */
14815   findRenderedComponentWithType: function (root, componentType) {
14816     var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType);
14817     if (all.length !== 1) {
14818       throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for componentType:' + componentType);
14819     }
14820     return all[0];
14821   },
14823   /**
14824    * Pass a mocked component module to this method to augment it with
14825    * useful methods that allow it to be used as a dummy React component.
14826    * Instead of rendering as usual, the component will become a simple
14827    * <div> containing any provided children.
14828    *
14829    * @param {object} module the mock function object exported from a
14830    *                        module that defines the component to be mocked
14831    * @param {?string} mockTagName optional dummy root tag name to return
14832    *                              from render method (overrides
14833    *                              module.mockTagName if provided)
14834    * @return {object} the ReactTestUtils object (for chaining)
14835    */
14836   mockComponent: function (module, mockTagName) {
14837     mockTagName = mockTagName || module.mockTagName || 'div';
14839     module.prototype.render.mockImplementation(function () {
14840       return React.createElement(mockTagName, null, this.props.children);
14841     });
14843     return this;
14844   },
14846   /**
14847    * Simulates a top level event being dispatched from a raw event that occurred
14848    * on an `Element` node.
14849    * @param {Object} topLevelType A type from `EventConstants.topLevelTypes`
14850    * @param {!Element} node The dom to simulate an event occurring on.
14851    * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
14852    */
14853   simulateNativeEventOnNode: function (topLevelType, node, fakeNativeEvent) {
14854     fakeNativeEvent.target = node;
14855     ReactBrowserEventEmitter.ReactEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
14856   },
14858   /**
14859    * Simulates a top level event being dispatched from a raw event that occurred
14860    * on the `ReactDOMComponent` `comp`.
14861    * @param {Object} topLevelType A type from `EventConstants.topLevelTypes`.
14862    * @param {!ReactDOMComponent} comp
14863    * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
14864    */
14865   simulateNativeEventOnDOMComponent: function (topLevelType, comp, fakeNativeEvent) {
14866     ReactTestUtils.simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent);
14867   },
14869   nativeTouchData: function (x, y) {
14870     return {
14871       touches: [{ pageX: x, pageY: y }]
14872     };
14873   },
14875   createRenderer: function () {
14876     return new ReactShallowRenderer();
14877   },
14879   Simulate: null,
14880   SimulateNative: {}
14884  * @class ReactShallowRenderer
14885  */
14886 var ReactShallowRenderer = function () {
14887   this._instance = null;
14890 ReactShallowRenderer.prototype.getMountedInstance = function () {
14891   return this._instance ? this._instance._instance : null;
14894 var nextDebugID = 1;
14896 var NoopInternalComponent = function (element) {
14897   this._renderedOutput = element;
14898   this._currentElement = element;
14899   this._debugID = nextDebugID++;
14902 NoopInternalComponent.prototype = {
14904   mountComponent: function () {},
14906   receiveComponent: function (element) {
14907     this._renderedOutput = element;
14908     this._currentElement = element;
14909   },
14911   getNativeNode: function () {
14912     return undefined;
14913   },
14915   unmountComponent: function () {},
14917   getPublicInstance: function () {
14918     return null;
14919   }
14922 var ShallowComponentWrapper = function (element) {
14923   this._debugID = nextDebugID++;
14924   this.construct(element);
14926 _assign(ShallowComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
14927   _constructComponent: ReactCompositeComponent.Mixin._constructComponentWithoutOwner,
14928   _instantiateReactComponent: function (element) {
14929     return new NoopInternalComponent(element);
14930   },
14931   _replaceNodeWithMarkup: function () {},
14932   _renderValidatedComponent: ReactCompositeComponent.Mixin._renderValidatedComponentWithoutOwnerOrContext
14935 ReactShallowRenderer.prototype.render = function (element, context) {
14936   // Ensure we've done the default injections. This might not be true in the
14937   // case of a simple test that only requires React and the TestUtils in
14938   // conjunction with an inline-requires transform.
14939   ReactDefaultInjection.inject();
14941   !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Invalid component element.%s', typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') : invariant(false) : void 0;
14942   !(typeof element.type !== 'string') ? "development" !== 'production' ? invariant(false, 'ReactShallowRenderer render(): Shallow rendering works only with custom ' + 'components, not primitives (%s). Instead of calling `.render(el)` and ' + 'inspecting the rendered output, look at `el.props` directly instead.', element.type) : invariant(false) : void 0;
14944   if (!context) {
14945     context = emptyObject;
14946   }
14947   ReactUpdates.batchedUpdates(_batchedRender, this, element, context);
14949   return this.getRenderOutput();
14952 function _batchedRender(renderer, element, context) {
14953   var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(true);
14954   renderer._render(element, transaction, context);
14955   ReactUpdates.ReactReconcileTransaction.release(transaction);
14958 ReactShallowRenderer.prototype.getRenderOutput = function () {
14959   return this._instance && this._instance._renderedComponent && this._instance._renderedComponent._renderedOutput || null;
14962 ReactShallowRenderer.prototype.unmount = function () {
14963   if (this._instance) {
14964     this._instance.unmountComponent(false);
14965   }
14968 ReactShallowRenderer.prototype._render = function (element, transaction, context) {
14969   if (this._instance) {
14970     this._instance.receiveComponent(element, transaction, context);
14971   } else {
14972     var instance = new ShallowComponentWrapper(element);
14973     instance.mountComponent(transaction, null, null, context);
14974     this._instance = instance;
14975   }
14979  * Exports:
14981  * - `ReactTestUtils.Simulate.click(Element/ReactDOMComponent)`
14982  * - `ReactTestUtils.Simulate.mouseMove(Element/ReactDOMComponent)`
14983  * - `ReactTestUtils.Simulate.change(Element/ReactDOMComponent)`
14984  * - ... (All keys from event plugin `eventTypes` objects)
14985  */
14986 function makeSimulator(eventType) {
14987   return function (domComponentOrNode, eventData) {
14988     var node;
14989     !!React.isValidElement(domComponentOrNode) ? "development" !== 'production' ? invariant(false, 'TestUtils.Simulate expects a component instance and not a ReactElement.' + 'TestUtils.Simulate will not work if you are using shallow rendering.') : invariant(false) : void 0;
14990     if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
14991       node = findDOMNode(domComponentOrNode);
14992     } else if (domComponentOrNode.tagName) {
14993       node = domComponentOrNode;
14994     }
14996     var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];
14998     var fakeNativeEvent = new Event();
14999     fakeNativeEvent.target = node;
15000     // We don't use SyntheticEvent.getPooled in order to not have to worry about
15001     // properly destroying any properties assigned from `eventData` upon release
15002     var event = new SyntheticEvent(dispatchConfig, ReactDOMComponentTree.getInstanceFromNode(node), fakeNativeEvent, node);
15003     // Since we aren't using pooling, always persist the event. This will make
15004     // sure it's marked and won't warn when setting additional properties.
15005     event.persist();
15006     _assign(event, eventData);
15008     if (dispatchConfig.phasedRegistrationNames) {
15009       EventPropagators.accumulateTwoPhaseDispatches(event);
15010     } else {
15011       EventPropagators.accumulateDirectDispatches(event);
15012     }
15014     ReactUpdates.batchedUpdates(function () {
15015       EventPluginHub.enqueueEvents(event);
15016       EventPluginHub.processEventQueue(true);
15017     });
15018   };
15021 function buildSimulators() {
15022   ReactTestUtils.Simulate = {};
15024   var eventType;
15025   for (eventType in EventPluginRegistry.eventNameDispatchConfigs) {
15026     /**
15027      * @param {!Element|ReactDOMComponent} domComponentOrNode
15028      * @param {?object} eventData Fake event data to use in SyntheticEvent.
15029      */
15030     ReactTestUtils.Simulate[eventType] = makeSimulator(eventType);
15031   }
15034 // Rebuild ReactTestUtils.Simulate whenever event plugins are injected
15035 var oldInjectEventPluginOrder = EventPluginHub.injection.injectEventPluginOrder;
15036 EventPluginHub.injection.injectEventPluginOrder = function () {
15037   oldInjectEventPluginOrder.apply(this, arguments);
15038   buildSimulators();
15040 var oldInjectEventPlugins = EventPluginHub.injection.injectEventPluginsByName;
15041 EventPluginHub.injection.injectEventPluginsByName = function () {
15042   oldInjectEventPlugins.apply(this, arguments);
15043   buildSimulators();
15046 buildSimulators();
15049  * Exports:
15051  * - `ReactTestUtils.SimulateNative.click(Element/ReactDOMComponent)`
15052  * - `ReactTestUtils.SimulateNative.mouseMove(Element/ReactDOMComponent)`
15053  * - `ReactTestUtils.SimulateNative.mouseIn/ReactDOMComponent)`
15054  * - `ReactTestUtils.SimulateNative.mouseOut(Element/ReactDOMComponent)`
15055  * - ... (All keys from `EventConstants.topLevelTypes`)
15057  * Note: Top level event types are a subset of the entire set of handler types
15058  * (which include a broader set of "synthetic" events). For example, onDragDone
15059  * is a synthetic event. Except when testing an event plugin or React's event
15060  * handling code specifically, you probably want to use ReactTestUtils.Simulate
15061  * to dispatch synthetic events.
15062  */
15064 function makeNativeSimulator(eventType) {
15065   return function (domComponentOrNode, nativeEventData) {
15066     var fakeNativeEvent = new Event(eventType);
15067     _assign(fakeNativeEvent, nativeEventData);
15068     if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
15069       ReactTestUtils.simulateNativeEventOnDOMComponent(eventType, domComponentOrNode, fakeNativeEvent);
15070     } else if (domComponentOrNode.tagName) {
15071       // Will allow on actual dom nodes.
15072       ReactTestUtils.simulateNativeEventOnNode(eventType, domComponentOrNode, fakeNativeEvent);
15073     }
15074   };
15077 Object.keys(topLevelTypes).forEach(function (eventType) {
15078   // Event type is stored as 'topClick' - we transform that to 'click'
15079   var convenienceName = eventType.indexOf('top') === 0 ? eventType.charAt(3).toLowerCase() + eventType.substr(4) : eventType;
15080   /**
15081    * @param {!Element|ReactDOMComponent} domComponentOrNode
15082    * @param {?Event} nativeEventData Fake native event to use in SyntheticEvent.
15083    */
15084   ReactTestUtils.SimulateNative[convenienceName] = makeNativeSimulator(eventType);
15087 module.exports = ReactTestUtils;
15088 },{"104":104,"115":115,"132":132,"16":16,"166":166,"17":17,"173":173,"18":18,"184":184,"20":20,"27":27,"28":28,"39":39,"41":41,"45":45,"64":64,"65":65,"75":75}],100:[function(_dereq_,module,exports){
15090  * Copyright 2013-present, Facebook, Inc.
15091  * All rights reserved.
15093  * This source code is licensed under the BSD-style license found in the
15094  * LICENSE file in the root directory of this source tree. An additional grant
15095  * of patent rights can be found in the PATENTS file in the same directory.
15097  * @providesModule ReactTransitionChildMapping
15098  */
15100 'use strict';
15102 var flattenChildren = _dereq_(133);
15104 var ReactTransitionChildMapping = {
15105   /**
15106    * Given `this.props.children`, return an object mapping key to child. Just
15107    * simple syntactic sugar around flattenChildren().
15108    *
15109    * @param {*} children `this.props.children`
15110    * @return {object} Mapping of key to child
15111    */
15112   getChildMapping: function (children) {
15113     if (!children) {
15114       return children;
15115     }
15116     return flattenChildren(children);
15117   },
15119   /**
15120    * When you're adding or removing children some may be added or removed in the
15121    * same render pass. We want to show *both* since we want to simultaneously
15122    * animate elements in and out. This function takes a previous set of keys
15123    * and a new set of keys and merges them with its best guess of the correct
15124    * ordering. In the future we may expose some of the utilities in
15125    * ReactMultiChild to make this easy, but for now React itself does not
15126    * directly have this concept of the union of prevChildren and nextChildren
15127    * so we implement it here.
15128    *
15129    * @param {object} prev prev children as returned from
15130    * `ReactTransitionChildMapping.getChildMapping()`.
15131    * @param {object} next next children as returned from
15132    * `ReactTransitionChildMapping.getChildMapping()`.
15133    * @return {object} a key set that contains all keys in `prev` and all keys
15134    * in `next` in a reasonable order.
15135    */
15136   mergeChildMappings: function (prev, next) {
15137     prev = prev || {};
15138     next = next || {};
15140     function getValueForKey(key) {
15141       if (next.hasOwnProperty(key)) {
15142         return next[key];
15143       } else {
15144         return prev[key];
15145       }
15146     }
15148     // For each key of `next`, the list of keys to insert before that key in
15149     // the combined list
15150     var nextKeysPending = {};
15152     var pendingKeys = [];
15153     for (var prevKey in prev) {
15154       if (next.hasOwnProperty(prevKey)) {
15155         if (pendingKeys.length) {
15156           nextKeysPending[prevKey] = pendingKeys;
15157           pendingKeys = [];
15158         }
15159       } else {
15160         pendingKeys.push(prevKey);
15161       }
15162     }
15164     var i;
15165     var childMapping = {};
15166     for (var nextKey in next) {
15167       if (nextKeysPending.hasOwnProperty(nextKey)) {
15168         for (i = 0; i < nextKeysPending[nextKey].length; i++) {
15169           var pendingNextKey = nextKeysPending[nextKey][i];
15170           childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
15171         }
15172       }
15173       childMapping[nextKey] = getValueForKey(nextKey);
15174     }
15176     // Finally, add the keys which didn't appear before any key in `next`
15177     for (i = 0; i < pendingKeys.length; i++) {
15178       childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
15179     }
15181     return childMapping;
15182   }
15185 module.exports = ReactTransitionChildMapping;
15186 },{"133":133}],101:[function(_dereq_,module,exports){
15188  * Copyright 2013-present, Facebook, Inc.
15189  * All rights reserved.
15191  * This source code is licensed under the BSD-style license found in the
15192  * LICENSE file in the root directory of this source tree. An additional grant
15193  * of patent rights can be found in the PATENTS file in the same directory.
15195  * @providesModule ReactTransitionEvents
15196  */
15198 'use strict';
15200 var ExecutionEnvironment = _dereq_(159);
15202 var getVendorPrefixedEventName = _dereq_(143);
15204 var endEvents = [];
15206 function detectEvents() {
15207   var animEnd = getVendorPrefixedEventName('animationend');
15208   var transEnd = getVendorPrefixedEventName('transitionend');
15210   if (animEnd) {
15211     endEvents.push(animEnd);
15212   }
15214   if (transEnd) {
15215     endEvents.push(transEnd);
15216   }
15219 if (ExecutionEnvironment.canUseDOM) {
15220   detectEvents();
15223 // We use the raw {add|remove}EventListener() call because EventListener
15224 // does not know how to remove event listeners and we really should
15225 // clean up. Also, these events are not triggered in older browsers
15226 // so we should be A-OK here.
15228 function addEventListener(node, eventName, eventListener) {
15229   node.addEventListener(eventName, eventListener, false);
15232 function removeEventListener(node, eventName, eventListener) {
15233   node.removeEventListener(eventName, eventListener, false);
15236 var ReactTransitionEvents = {
15237   addEndEventListener: function (node, eventListener) {
15238     if (endEvents.length === 0) {
15239       // If CSS transitions are not supported, trigger an "end animation"
15240       // event immediately.
15241       window.setTimeout(eventListener, 0);
15242       return;
15243     }
15244     endEvents.forEach(function (endEvent) {
15245       addEventListener(node, endEvent, eventListener);
15246     });
15247   },
15249   removeEndEventListener: function (node, eventListener) {
15250     if (endEvents.length === 0) {
15251       return;
15252     }
15253     endEvents.forEach(function (endEvent) {
15254       removeEventListener(node, endEvent, eventListener);
15255     });
15256   }
15259 module.exports = ReactTransitionEvents;
15260 },{"143":143,"159":159}],102:[function(_dereq_,module,exports){
15262  * Copyright 2013-present, Facebook, Inc.
15263  * All rights reserved.
15265  * This source code is licensed under the BSD-style license found in the
15266  * LICENSE file in the root directory of this source tree. An additional grant
15267  * of patent rights can be found in the PATENTS file in the same directory.
15269  * @providesModule ReactTransitionGroup
15270  */
15272 'use strict';
15274 var _assign = _dereq_(184);
15276 var React = _dereq_(27);
15277 var ReactTransitionChildMapping = _dereq_(100);
15279 var emptyFunction = _dereq_(165);
15282  * A basis for animatins. When children are declaratively added or removed,
15283  * special lifecycle hooks are called.
15284  * See https://facebook.github.io/react/docs/animation.html#low-level-api-reacttransitiongroup
15285  */
15286 var ReactTransitionGroup = React.createClass({
15287   displayName: 'ReactTransitionGroup',
15289   propTypes: {
15290     component: React.PropTypes.any,
15291     childFactory: React.PropTypes.func
15292   },
15294   getDefaultProps: function () {
15295     return {
15296       component: 'span',
15297       childFactory: emptyFunction.thatReturnsArgument
15298     };
15299   },
15301   getInitialState: function () {
15302     return {
15303       children: ReactTransitionChildMapping.getChildMapping(this.props.children)
15304     };
15305   },
15307   componentWillMount: function () {
15308     this.currentlyTransitioningKeys = {};
15309     this.keysToEnter = [];
15310     this.keysToLeave = [];
15311   },
15313   componentDidMount: function () {
15314     var initialChildMapping = this.state.children;
15315     for (var key in initialChildMapping) {
15316       if (initialChildMapping[key]) {
15317         this.performAppear(key);
15318       }
15319     }
15320   },
15322   componentWillReceiveProps: function (nextProps) {
15323     var nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children);
15324     var prevChildMapping = this.state.children;
15326     this.setState({
15327       children: ReactTransitionChildMapping.mergeChildMappings(prevChildMapping, nextChildMapping)
15328     });
15330     var key;
15332     for (key in nextChildMapping) {
15333       var hasPrev = prevChildMapping && prevChildMapping.hasOwnProperty(key);
15334       if (nextChildMapping[key] && !hasPrev && !this.currentlyTransitioningKeys[key]) {
15335         this.keysToEnter.push(key);
15336       }
15337     }
15339     for (key in prevChildMapping) {
15340       var hasNext = nextChildMapping && nextChildMapping.hasOwnProperty(key);
15341       if (prevChildMapping[key] && !hasNext && !this.currentlyTransitioningKeys[key]) {
15342         this.keysToLeave.push(key);
15343       }
15344     }
15346     // If we want to someday check for reordering, we could do it here.
15347   },
15349   componentDidUpdate: function () {
15350     var keysToEnter = this.keysToEnter;
15351     this.keysToEnter = [];
15352     keysToEnter.forEach(this.performEnter);
15354     var keysToLeave = this.keysToLeave;
15355     this.keysToLeave = [];
15356     keysToLeave.forEach(this.performLeave);
15357   },
15359   performAppear: function (key) {
15360     this.currentlyTransitioningKeys[key] = true;
15362     var component = this.refs[key];
15364     if (component.componentWillAppear) {
15365       component.componentWillAppear(this._handleDoneAppearing.bind(this, key));
15366     } else {
15367       this._handleDoneAppearing(key);
15368     }
15369   },
15371   _handleDoneAppearing: function (key) {
15372     var component = this.refs[key];
15373     if (component.componentDidAppear) {
15374       component.componentDidAppear();
15375     }
15377     delete this.currentlyTransitioningKeys[key];
15379     var currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
15381     if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
15382       // This was removed before it had fully appeared. Remove it.
15383       this.performLeave(key);
15384     }
15385   },
15387   performEnter: function (key) {
15388     this.currentlyTransitioningKeys[key] = true;
15390     var component = this.refs[key];
15392     if (component.componentWillEnter) {
15393       component.componentWillEnter(this._handleDoneEntering.bind(this, key));
15394     } else {
15395       this._handleDoneEntering(key);
15396     }
15397   },
15399   _handleDoneEntering: function (key) {
15400     var component = this.refs[key];
15401     if (component.componentDidEnter) {
15402       component.componentDidEnter();
15403     }
15405     delete this.currentlyTransitioningKeys[key];
15407     var currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
15409     if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
15410       // This was removed before it had fully entered. Remove it.
15411       this.performLeave(key);
15412     }
15413   },
15415   performLeave: function (key) {
15416     this.currentlyTransitioningKeys[key] = true;
15418     var component = this.refs[key];
15419     if (component.componentWillLeave) {
15420       component.componentWillLeave(this._handleDoneLeaving.bind(this, key));
15421     } else {
15422       // Note that this is somewhat dangerous b/c it calls setState()
15423       // again, effectively mutating the component before all the work
15424       // is done.
15425       this._handleDoneLeaving(key);
15426     }
15427   },
15429   _handleDoneLeaving: function (key) {
15430     var component = this.refs[key];
15432     if (component.componentDidLeave) {
15433       component.componentDidLeave();
15434     }
15436     delete this.currentlyTransitioningKeys[key];
15438     var currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
15440     if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) {
15441       // This entered again before it fully left. Add it again.
15442       this.performEnter(key);
15443     } else {
15444       this.setState(function (state) {
15445         var newChildren = _assign({}, state.children);
15446         delete newChildren[key];
15447         return { children: newChildren };
15448       });
15449     }
15450   },
15452   render: function () {
15453     // TODO: we could get rid of the need for the wrapper node
15454     // by cloning a single child
15455     var childrenToRender = [];
15456     for (var key in this.state.children) {
15457       var child = this.state.children[key];
15458       if (child) {
15459         // You may need to apply reactive updates to a child as it is leaving.
15460         // The normal React way to do it won't work since the child will have
15461         // already been removed. In case you need this behavior you can provide
15462         // a childFactory function to wrap every child, even the ones that are
15463         // leaving.
15464         childrenToRender.push(React.cloneElement(this.props.childFactory(child), { ref: key, key: key }));
15465       }
15466     }
15467     return React.createElement(this.props.component, this.props, childrenToRender);
15468   }
15471 module.exports = ReactTransitionGroup;
15472 },{"100":100,"165":165,"184":184,"27":27}],103:[function(_dereq_,module,exports){
15474  * Copyright 2015-present, Facebook, Inc.
15475  * All rights reserved.
15477  * This source code is licensed under the BSD-style license found in the
15478  * LICENSE file in the root directory of this source tree. An additional grant
15479  * of patent rights can be found in the PATENTS file in the same directory.
15481  * @providesModule ReactUpdateQueue
15482  */
15484 'use strict';
15486 var ReactCurrentOwner = _dereq_(40);
15487 var ReactInstanceMap = _dereq_(75);
15488 var ReactUpdates = _dereq_(104);
15490 var invariant = _dereq_(173);
15491 var warning = _dereq_(183);
15493 function enqueueUpdate(internalInstance) {
15494   ReactUpdates.enqueueUpdate(internalInstance);
15497 function formatUnexpectedArgument(arg) {
15498   var type = typeof arg;
15499   if (type !== 'object') {
15500     return type;
15501   }
15502   var displayName = arg.constructor && arg.constructor.name || type;
15503   var keys = Object.keys(arg);
15504   if (keys.length > 0 && keys.length < 20) {
15505     return displayName + ' (keys: ' + keys.join(', ') + ')';
15506   }
15507   return displayName;
15510 function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
15511   var internalInstance = ReactInstanceMap.get(publicInstance);
15512   if (!internalInstance) {
15513     if ("development" !== 'production') {
15514       // Only warn when we have a callerName. Otherwise we should be silent.
15515       // We're probably calling from enqueueCallback. We don't want to warn
15516       // there because we already warned for the corresponding lifecycle method.
15517       "development" !== '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) : void 0;
15518     }
15519     return null;
15520   }
15522   if ("development" !== 'production') {
15523     "development" !== 'production' ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + 'within `render` or another component\'s constructor). Render methods ' + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0;
15524   }
15526   return internalInstance;
15530  * ReactUpdateQueue allows for state updates to be scheduled into a later
15531  * reconciliation step.
15532  */
15533 var ReactUpdateQueue = {
15535   /**
15536    * Checks whether or not this composite component is mounted.
15537    * @param {ReactClass} publicInstance The instance we want to test.
15538    * @return {boolean} True if mounted, false otherwise.
15539    * @protected
15540    * @final
15541    */
15542   isMounted: function (publicInstance) {
15543     if ("development" !== 'production') {
15544       var owner = ReactCurrentOwner.current;
15545       if (owner !== null) {
15546         "development" !== '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') : void 0;
15547         owner._warnedAboutRefsInRender = true;
15548       }
15549     }
15550     var internalInstance = ReactInstanceMap.get(publicInstance);
15551     if (internalInstance) {
15552       // During componentWillMount and render this will still be null but after
15553       // that will always render to something. At least for now. So we can use
15554       // this hack.
15555       return !!internalInstance._renderedComponent;
15556     } else {
15557       return false;
15558     }
15559   },
15561   /**
15562    * Enqueue a callback that will be executed after all the pending updates
15563    * have processed.
15564    *
15565    * @param {ReactClass} publicInstance The instance to use as `this` context.
15566    * @param {?function} callback Called after state is updated.
15567    * @param {string} callerName Name of the calling function in the public API.
15568    * @internal
15569    */
15570   enqueueCallback: function (publicInstance, callback, callerName) {
15571     ReactUpdateQueue.validateCallback(callback, callerName);
15572     var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
15574     // Previously we would throw an error if we didn't have an internal
15575     // instance. Since we want to make it a no-op instead, we mirror the same
15576     // behavior we have in other enqueue* methods.
15577     // We also need to ignore callbacks in componentWillMount. See
15578     // enqueueUpdates.
15579     if (!internalInstance) {
15580       return null;
15581     }
15583     if (internalInstance._pendingCallbacks) {
15584       internalInstance._pendingCallbacks.push(callback);
15585     } else {
15586       internalInstance._pendingCallbacks = [callback];
15587     }
15588     // TODO: The callback here is ignored when setState is called from
15589     // componentWillMount. Either fix it or disallow doing so completely in
15590     // favor of getInitialState. Alternatively, we can disallow
15591     // componentWillMount during server-side rendering.
15592     enqueueUpdate(internalInstance);
15593   },
15595   enqueueCallbackInternal: function (internalInstance, callback) {
15596     if (internalInstance._pendingCallbacks) {
15597       internalInstance._pendingCallbacks.push(callback);
15598     } else {
15599       internalInstance._pendingCallbacks = [callback];
15600     }
15601     enqueueUpdate(internalInstance);
15602   },
15604   /**
15605    * Forces an update. This should only be invoked when it is known with
15606    * certainty that we are **not** in a DOM transaction.
15607    *
15608    * You may want to call this when you know that some deeper aspect of the
15609    * component's state has changed but `setState` was not called.
15610    *
15611    * This will not invoke `shouldComponentUpdate`, but it will invoke
15612    * `componentWillUpdate` and `componentDidUpdate`.
15613    *
15614    * @param {ReactClass} publicInstance The instance that should rerender.
15615    * @internal
15616    */
15617   enqueueForceUpdate: function (publicInstance) {
15618     var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
15620     if (!internalInstance) {
15621       return;
15622     }
15624     internalInstance._pendingForceUpdate = true;
15626     enqueueUpdate(internalInstance);
15627   },
15629   /**
15630    * Replaces all of the state. Always use this or `setState` to mutate state.
15631    * You should treat `this.state` as immutable.
15632    *
15633    * There is no guarantee that `this.state` will be immediately updated, so
15634    * accessing `this.state` after calling this method may return the old value.
15635    *
15636    * @param {ReactClass} publicInstance The instance that should rerender.
15637    * @param {object} completeState Next state.
15638    * @internal
15639    */
15640   enqueueReplaceState: function (publicInstance, completeState) {
15641     var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
15643     if (!internalInstance) {
15644       return;
15645     }
15647     internalInstance._pendingStateQueue = [completeState];
15648     internalInstance._pendingReplaceState = true;
15650     enqueueUpdate(internalInstance);
15651   },
15653   /**
15654    * Sets a subset of the state. This only exists because _pendingState is
15655    * internal. This provides a merging strategy that is not available to deep
15656    * properties which is confusing. TODO: Expose pendingState or don't use it
15657    * during the merge.
15658    *
15659    * @param {ReactClass} publicInstance The instance that should rerender.
15660    * @param {object} partialState Next partial state to be merged with state.
15661    * @internal
15662    */
15663   enqueueSetState: function (publicInstance, partialState) {
15664     var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
15666     if (!internalInstance) {
15667       return;
15668     }
15670     var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
15671     queue.push(partialState);
15673     enqueueUpdate(internalInstance);
15674   },
15676   enqueueElementInternal: function (internalInstance, newElement) {
15677     internalInstance._pendingElement = newElement;
15678     enqueueUpdate(internalInstance);
15679   },
15681   validateCallback: function (callback, callerName) {
15682     !(!callback || typeof callback === 'function') ? "development" !== 'production' ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : invariant(false) : void 0;
15683   }
15687 module.exports = ReactUpdateQueue;
15688 },{"104":104,"173":173,"183":183,"40":40,"75":75}],104:[function(_dereq_,module,exports){
15690  * Copyright 2013-present, Facebook, Inc.
15691  * All rights reserved.
15693  * This source code is licensed under the BSD-style license found in the
15694  * LICENSE file in the root directory of this source tree. An additional grant
15695  * of patent rights can be found in the PATENTS file in the same directory.
15697  * @providesModule ReactUpdates
15698  */
15700 'use strict';
15702 var _assign = _dereq_(184);
15704 var CallbackQueue = _dereq_(5);
15705 var PooledClass = _dereq_(26);
15706 var ReactFeatureFlags = _dereq_(71);
15707 var ReactInstrumentation = _dereq_(76);
15708 var ReactReconciler = _dereq_(93);
15709 var Transaction = _dereq_(124);
15711 var invariant = _dereq_(173);
15713 var dirtyComponents = [];
15714 var updateBatchNumber = 0;
15715 var asapCallbackQueue = CallbackQueue.getPooled();
15716 var asapEnqueued = false;
15718 var batchingStrategy = null;
15720 function ensureInjected() {
15721   !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching ' + 'strategy') : invariant(false) : void 0;
15724 var NESTED_UPDATES = {
15725   initialize: function () {
15726     this.dirtyComponentsLength = dirtyComponents.length;
15727   },
15728   close: function () {
15729     if (this.dirtyComponentsLength !== dirtyComponents.length) {
15730       // Additional updates were enqueued by componentDidUpdate handlers or
15731       // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
15732       // these new updates so that if A's componentDidUpdate calls setState on
15733       // B, B will update before the callback A's updater provided when calling
15734       // setState.
15735       dirtyComponents.splice(0, this.dirtyComponentsLength);
15736       flushBatchedUpdates();
15737     } else {
15738       dirtyComponents.length = 0;
15739     }
15740   }
15743 var UPDATE_QUEUEING = {
15744   initialize: function () {
15745     this.callbackQueue.reset();
15746   },
15747   close: function () {
15748     this.callbackQueue.notifyAll();
15749   }
15752 var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
15754 function ReactUpdatesFlushTransaction() {
15755   this.reinitializeTransaction();
15756   this.dirtyComponentsLength = null;
15757   this.callbackQueue = CallbackQueue.getPooled();
15758   this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
15759   /* useCreateElement */true);
15762 _assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
15763   getTransactionWrappers: function () {
15764     return TRANSACTION_WRAPPERS;
15765   },
15767   destructor: function () {
15768     this.dirtyComponentsLength = null;
15769     CallbackQueue.release(this.callbackQueue);
15770     this.callbackQueue = null;
15771     ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
15772     this.reconcileTransaction = null;
15773   },
15775   perform: function (method, scope, a) {
15776     // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
15777     // with this transaction's wrappers around it.
15778     return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
15779   }
15782 PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
15784 function batchedUpdates(callback, a, b, c, d, e) {
15785   ensureInjected();
15786   batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
15790  * Array comparator for ReactComponents by mount ordering.
15792  * @param {ReactComponent} c1 first component you're comparing
15793  * @param {ReactComponent} c2 second component you're comparing
15794  * @return {number} Return value usable by Array.prototype.sort().
15795  */
15796 function mountOrderComparator(c1, c2) {
15797   return c1._mountOrder - c2._mountOrder;
15800 function runBatchedUpdates(transaction) {
15801   var len = transaction.dirtyComponentsLength;
15802   !(len === dirtyComponents.length) ? "development" !== 'production' ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to ' + 'match dirty-components array length (%s).', len, dirtyComponents.length) : invariant(false) : void 0;
15804   // Since reconciling a component higher in the owner hierarchy usually (not
15805   // always -- see shouldComponentUpdate()) will reconcile children, reconcile
15806   // them before their children by sorting the array.
15807   dirtyComponents.sort(mountOrderComparator);
15809   // Any updates enqueued while reconciling must be performed after this entire
15810   // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
15811   // C, B could update twice in a single batch if C's render enqueues an update
15812   // to B (since B would have already updated, we should skip it, and the only
15813   // way we can know to do so is by checking the batch counter).
15814   updateBatchNumber++;
15816   for (var i = 0; i < len; i++) {
15817     // If a component is unmounted before pending changes apply, it will still
15818     // be here, but we assume that it has cleared its _pendingCallbacks and
15819     // that performUpdateIfNecessary is a noop.
15820     var component = dirtyComponents[i];
15822     // If performUpdateIfNecessary happens to enqueue any new updates, we
15823     // shouldn't execute the callbacks until the next render happens, so
15824     // stash the callbacks first
15825     var callbacks = component._pendingCallbacks;
15826     component._pendingCallbacks = null;
15828     var markerName;
15829     if (ReactFeatureFlags.logTopLevelRenders) {
15830       var namedComponent = component;
15831       // Duck type TopLevelWrapper. This is probably always true.
15832       if (component._currentElement.props === component._renderedComponent._currentElement) {
15833         namedComponent = component._renderedComponent;
15834       }
15835       markerName = 'React update: ' + namedComponent.getName();
15836       console.time(markerName);
15837     }
15839     ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
15841     if (markerName) {
15842       console.timeEnd(markerName);
15843     }
15845     if (callbacks) {
15846       for (var j = 0; j < callbacks.length; j++) {
15847         transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
15848       }
15849     }
15850   }
15853 var flushBatchedUpdates = function () {
15854   if ("development" !== 'production') {
15855     ReactInstrumentation.debugTool.onBeginFlush();
15856   }
15858   // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
15859   // array and perform any updates enqueued by mount-ready handlers (i.e.,
15860   // componentDidUpdate) but we need to check here too in order to catch
15861   // updates enqueued by setState callbacks and asap calls.
15862   while (dirtyComponents.length || asapEnqueued) {
15863     if (dirtyComponents.length) {
15864       var transaction = ReactUpdatesFlushTransaction.getPooled();
15865       transaction.perform(runBatchedUpdates, null, transaction);
15866       ReactUpdatesFlushTransaction.release(transaction);
15867     }
15869     if (asapEnqueued) {
15870       asapEnqueued = false;
15871       var queue = asapCallbackQueue;
15872       asapCallbackQueue = CallbackQueue.getPooled();
15873       queue.notifyAll();
15874       CallbackQueue.release(queue);
15875     }
15876   }
15878   if ("development" !== 'production') {
15879     ReactInstrumentation.debugTool.onEndFlush();
15880   }
15884  * Mark a component as needing a rerender, adding an optional callback to a
15885  * list of functions which will be executed once the rerender occurs.
15886  */
15887 function enqueueUpdate(component) {
15888   ensureInjected();
15890   // Various parts of our code (such as ReactCompositeComponent's
15891   // _renderValidatedComponent) assume that calls to render aren't nested;
15892   // verify that that's the case. (This is called by each top-level update
15893   // function, like setProps, setState, forceUpdate, etc.; creation and
15894   // destruction of top-level components is guarded in ReactMount.)
15896   if (!batchingStrategy.isBatchingUpdates) {
15897     batchingStrategy.batchedUpdates(enqueueUpdate, component);
15898     return;
15899   }
15901   dirtyComponents.push(component);
15902   if (component._updateBatchNumber == null) {
15903     component._updateBatchNumber = updateBatchNumber + 1;
15904   }
15908  * Enqueue a callback to be run at the end of the current batching cycle. Throws
15909  * if no updates are currently being performed.
15910  */
15911 function asap(callback, context) {
15912   !batchingStrategy.isBatchingUpdates ? "development" !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + 'updates are not being batched.') : invariant(false) : void 0;
15913   asapCallbackQueue.enqueue(callback, context);
15914   asapEnqueued = true;
15917 var ReactUpdatesInjection = {
15918   injectReconcileTransaction: function (ReconcileTransaction) {
15919     !ReconcileTransaction ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : invariant(false) : void 0;
15920     ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
15921   },
15923   injectBatchingStrategy: function (_batchingStrategy) {
15924     !_batchingStrategy ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : invariant(false) : void 0;
15925     !(typeof _batchingStrategy.batchedUpdates === 'function') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : invariant(false) : void 0;
15926     !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : invariant(false) : void 0;
15927     batchingStrategy = _batchingStrategy;
15928   }
15931 var ReactUpdates = {
15932   /**
15933    * React references `ReactReconcileTransaction` using this property in order
15934    * to allow dependency injection.
15935    *
15936    * @internal
15937    */
15938   ReactReconcileTransaction: null,
15940   batchedUpdates: batchedUpdates,
15941   enqueueUpdate: enqueueUpdate,
15942   flushBatchedUpdates: flushBatchedUpdates,
15943   injection: ReactUpdatesInjection,
15944   asap: asap
15947 module.exports = ReactUpdates;
15948 },{"124":124,"173":173,"184":184,"26":26,"5":5,"71":71,"76":76,"93":93}],105:[function(_dereq_,module,exports){
15950  * Copyright 2013-present, Facebook, Inc.
15951  * All rights reserved.
15953  * This source code is licensed under the BSD-style license found in the
15954  * LICENSE file in the root directory of this source tree. An additional grant
15955  * of patent rights can be found in the PATENTS file in the same directory.
15957  * @providesModule ReactVersion
15958  */
15960 'use strict';
15962 module.exports = '15.1.0';
15963 },{}],106:[function(_dereq_,module,exports){
15965  * Copyright 2013-present, Facebook, Inc.
15966  * All rights reserved.
15968  * This source code is licensed under the BSD-style license found in the
15969  * LICENSE file in the root directory of this source tree. An additional grant
15970  * of patent rights can be found in the PATENTS file in the same directory.
15972  * @providesModule ReactWithAddons
15973  */
15975 'use strict';
15977 var LinkedStateMixin = _dereq_(24);
15978 var React = _dereq_(27);
15979 var ReactComponentWithPureRenderMixin = _dereq_(38);
15980 var ReactCSSTransitionGroup = _dereq_(29);
15981 var ReactFragment = _dereq_(72);
15982 var ReactTransitionGroup = _dereq_(102);
15984 var shallowCompare = _dereq_(152);
15985 var update = _dereq_(155);
15987 React.addons = {
15988   CSSTransitionGroup: ReactCSSTransitionGroup,
15989   LinkedStateMixin: LinkedStateMixin,
15990   PureRenderMixin: ReactComponentWithPureRenderMixin,
15991   TransitionGroup: ReactTransitionGroup,
15993   createFragment: ReactFragment.create,
15994   shallowCompare: shallowCompare,
15995   update: update
15998 if ("development" !== 'production') {
15999   React.addons.Perf = _dereq_(88);
16000   React.addons.TestUtils = _dereq_(99);
16003 module.exports = React;
16004 },{"102":102,"152":152,"155":155,"24":24,"27":27,"29":29,"38":38,"72":72,"88":88,"99":99}],107:[function(_dereq_,module,exports){
16006  * Copyright 2013-present, Facebook, Inc.
16007  * All rights reserved.
16009  * This source code is licensed under the BSD-style license found in the
16010  * LICENSE file in the root directory of this source tree. An additional grant
16011  * of patent rights can be found in the PATENTS file in the same directory.
16013  * @providesModule ReactWithAddonsUMDEntry
16014  */
16016 'use strict';
16018 var _assign = _dereq_(184);
16020 var ReactDOM = _dereq_(41);
16021 var ReactDOMServer = _dereq_(57);
16022 var ReactWithAddons = _dereq_(106);
16024 // `version` will be added here by ReactIsomorphic.
16025 var ReactWithAddonsUMDEntry = _assign({
16026   __SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOM,
16027   __SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOMServer
16028 }, ReactWithAddons);
16030 module.exports = ReactWithAddonsUMDEntry;
16031 },{"106":106,"184":184,"41":41,"57":57}],108:[function(_dereq_,module,exports){
16033  * Copyright 2013-present, Facebook, Inc.
16034  * All rights reserved.
16036  * This source code is licensed under the BSD-style license found in the
16037  * LICENSE file in the root directory of this source tree. An additional grant
16038  * of patent rights can be found in the PATENTS file in the same directory.
16040  * @providesModule SVGDOMPropertyConfig
16041  */
16043 'use strict';
16045 var NS = {
16046   xlink: 'http://www.w3.org/1999/xlink',
16047   xml: 'http://www.w3.org/XML/1998/namespace'
16050 // We use attributes for everything SVG so let's avoid some duplication and run
16051 // code instead.
16052 // The following are all specified in the HTML config already so we exclude here.
16053 // - class (as className)
16054 // - color
16055 // - height
16056 // - id
16057 // - lang
16058 // - max
16059 // - media
16060 // - method
16061 // - min
16062 // - name
16063 // - style
16064 // - target
16065 // - type
16066 // - width
16067 var ATTRS = {
16068   accentHeight: 'accent-height',
16069   accumulate: 0,
16070   additive: 0,
16071   alignmentBaseline: 'alignment-baseline',
16072   allowReorder: 'allowReorder',
16073   alphabetic: 0,
16074   amplitude: 0,
16075   arabicForm: 'arabic-form',
16076   ascent: 0,
16077   attributeName: 'attributeName',
16078   attributeType: 'attributeType',
16079   autoReverse: 'autoReverse',
16080   azimuth: 0,
16081   baseFrequency: 'baseFrequency',
16082   baseProfile: 'baseProfile',
16083   baselineShift: 'baseline-shift',
16084   bbox: 0,
16085   begin: 0,
16086   bias: 0,
16087   by: 0,
16088   calcMode: 'calcMode',
16089   capHeight: 'cap-height',
16090   clip: 0,
16091   clipPath: 'clip-path',
16092   clipRule: 'clip-rule',
16093   clipPathUnits: 'clipPathUnits',
16094   colorInterpolation: 'color-interpolation',
16095   colorInterpolationFilters: 'color-interpolation-filters',
16096   colorProfile: 'color-profile',
16097   colorRendering: 'color-rendering',
16098   contentScriptType: 'contentScriptType',
16099   contentStyleType: 'contentStyleType',
16100   cursor: 0,
16101   cx: 0,
16102   cy: 0,
16103   d: 0,
16104   decelerate: 0,
16105   descent: 0,
16106   diffuseConstant: 'diffuseConstant',
16107   direction: 0,
16108   display: 0,
16109   divisor: 0,
16110   dominantBaseline: 'dominant-baseline',
16111   dur: 0,
16112   dx: 0,
16113   dy: 0,
16114   edgeMode: 'edgeMode',
16115   elevation: 0,
16116   enableBackground: 'enable-background',
16117   end: 0,
16118   exponent: 0,
16119   externalResourcesRequired: 'externalResourcesRequired',
16120   fill: 0,
16121   fillOpacity: 'fill-opacity',
16122   fillRule: 'fill-rule',
16123   filter: 0,
16124   filterRes: 'filterRes',
16125   filterUnits: 'filterUnits',
16126   floodColor: 'flood-color',
16127   floodOpacity: 'flood-opacity',
16128   focusable: 0,
16129   fontFamily: 'font-family',
16130   fontSize: 'font-size',
16131   fontSizeAdjust: 'font-size-adjust',
16132   fontStretch: 'font-stretch',
16133   fontStyle: 'font-style',
16134   fontVariant: 'font-variant',
16135   fontWeight: 'font-weight',
16136   format: 0,
16137   from: 0,
16138   fx: 0,
16139   fy: 0,
16140   g1: 0,
16141   g2: 0,
16142   glyphName: 'glyph-name',
16143   glyphOrientationHorizontal: 'glyph-orientation-horizontal',
16144   glyphOrientationVertical: 'glyph-orientation-vertical',
16145   glyphRef: 'glyphRef',
16146   gradientTransform: 'gradientTransform',
16147   gradientUnits: 'gradientUnits',
16148   hanging: 0,
16149   horizAdvX: 'horiz-adv-x',
16150   horizOriginX: 'horiz-origin-x',
16151   ideographic: 0,
16152   imageRendering: 'image-rendering',
16153   'in': 0,
16154   in2: 0,
16155   intercept: 0,
16156   k: 0,
16157   k1: 0,
16158   k2: 0,
16159   k3: 0,
16160   k4: 0,
16161   kernelMatrix: 'kernelMatrix',
16162   kernelUnitLength: 'kernelUnitLength',
16163   kerning: 0,
16164   keyPoints: 'keyPoints',
16165   keySplines: 'keySplines',
16166   keyTimes: 'keyTimes',
16167   lengthAdjust: 'lengthAdjust',
16168   letterSpacing: 'letter-spacing',
16169   lightingColor: 'lighting-color',
16170   limitingConeAngle: 'limitingConeAngle',
16171   local: 0,
16172   markerEnd: 'marker-end',
16173   markerMid: 'marker-mid',
16174   markerStart: 'marker-start',
16175   markerHeight: 'markerHeight',
16176   markerUnits: 'markerUnits',
16177   markerWidth: 'markerWidth',
16178   mask: 0,
16179   maskContentUnits: 'maskContentUnits',
16180   maskUnits: 'maskUnits',
16181   mathematical: 0,
16182   mode: 0,
16183   numOctaves: 'numOctaves',
16184   offset: 0,
16185   opacity: 0,
16186   operator: 0,
16187   order: 0,
16188   orient: 0,
16189   orientation: 0,
16190   origin: 0,
16191   overflow: 0,
16192   overlinePosition: 'overline-position',
16193   overlineThickness: 'overline-thickness',
16194   paintOrder: 'paint-order',
16195   panose1: 'panose-1',
16196   pathLength: 'pathLength',
16197   patternContentUnits: 'patternContentUnits',
16198   patternTransform: 'patternTransform',
16199   patternUnits: 'patternUnits',
16200   pointerEvents: 'pointer-events',
16201   points: 0,
16202   pointsAtX: 'pointsAtX',
16203   pointsAtY: 'pointsAtY',
16204   pointsAtZ: 'pointsAtZ',
16205   preserveAlpha: 'preserveAlpha',
16206   preserveAspectRatio: 'preserveAspectRatio',
16207   primitiveUnits: 'primitiveUnits',
16208   r: 0,
16209   radius: 0,
16210   refX: 'refX',
16211   refY: 'refY',
16212   renderingIntent: 'rendering-intent',
16213   repeatCount: 'repeatCount',
16214   repeatDur: 'repeatDur',
16215   requiredExtensions: 'requiredExtensions',
16216   requiredFeatures: 'requiredFeatures',
16217   restart: 0,
16218   result: 0,
16219   rotate: 0,
16220   rx: 0,
16221   ry: 0,
16222   scale: 0,
16223   seed: 0,
16224   shapeRendering: 'shape-rendering',
16225   slope: 0,
16226   spacing: 0,
16227   specularConstant: 'specularConstant',
16228   specularExponent: 'specularExponent',
16229   speed: 0,
16230   spreadMethod: 'spreadMethod',
16231   startOffset: 'startOffset',
16232   stdDeviation: 'stdDeviation',
16233   stemh: 0,
16234   stemv: 0,
16235   stitchTiles: 'stitchTiles',
16236   stopColor: 'stop-color',
16237   stopOpacity: 'stop-opacity',
16238   strikethroughPosition: 'strikethrough-position',
16239   strikethroughThickness: 'strikethrough-thickness',
16240   string: 0,
16241   stroke: 0,
16242   strokeDasharray: 'stroke-dasharray',
16243   strokeDashoffset: 'stroke-dashoffset',
16244   strokeLinecap: 'stroke-linecap',
16245   strokeLinejoin: 'stroke-linejoin',
16246   strokeMiterlimit: 'stroke-miterlimit',
16247   strokeOpacity: 'stroke-opacity',
16248   strokeWidth: 'stroke-width',
16249   surfaceScale: 'surfaceScale',
16250   systemLanguage: 'systemLanguage',
16251   tableValues: 'tableValues',
16252   targetX: 'targetX',
16253   targetY: 'targetY',
16254   textAnchor: 'text-anchor',
16255   textDecoration: 'text-decoration',
16256   textRendering: 'text-rendering',
16257   textLength: 'textLength',
16258   to: 0,
16259   transform: 0,
16260   u1: 0,
16261   u2: 0,
16262   underlinePosition: 'underline-position',
16263   underlineThickness: 'underline-thickness',
16264   unicode: 0,
16265   unicodeBidi: 'unicode-bidi',
16266   unicodeRange: 'unicode-range',
16267   unitsPerEm: 'units-per-em',
16268   vAlphabetic: 'v-alphabetic',
16269   vHanging: 'v-hanging',
16270   vIdeographic: 'v-ideographic',
16271   vMathematical: 'v-mathematical',
16272   values: 0,
16273   vectorEffect: 'vector-effect',
16274   version: 0,
16275   vertAdvY: 'vert-adv-y',
16276   vertOriginX: 'vert-origin-x',
16277   vertOriginY: 'vert-origin-y',
16278   viewBox: 'viewBox',
16279   viewTarget: 'viewTarget',
16280   visibility: 0,
16281   widths: 0,
16282   wordSpacing: 'word-spacing',
16283   writingMode: 'writing-mode',
16284   x: 0,
16285   xHeight: 'x-height',
16286   x1: 0,
16287   x2: 0,
16288   xChannelSelector: 'xChannelSelector',
16289   xlinkActuate: 'xlink:actuate',
16290   xlinkArcrole: 'xlink:arcrole',
16291   xlinkHref: 'xlink:href',
16292   xlinkRole: 'xlink:role',
16293   xlinkShow: 'xlink:show',
16294   xlinkTitle: 'xlink:title',
16295   xlinkType: 'xlink:type',
16296   xmlBase: 'xml:base',
16297   xmlLang: 'xml:lang',
16298   xmlSpace: 'xml:space',
16299   y: 0,
16300   y1: 0,
16301   y2: 0,
16302   yChannelSelector: 'yChannelSelector',
16303   z: 0,
16304   zoomAndPan: 'zoomAndPan'
16307 var SVGDOMPropertyConfig = {
16308   Properties: {},
16309   DOMAttributeNamespaces: {
16310     xlinkActuate: NS.xlink,
16311     xlinkArcrole: NS.xlink,
16312     xlinkHref: NS.xlink,
16313     xlinkRole: NS.xlink,
16314     xlinkShow: NS.xlink,
16315     xlinkTitle: NS.xlink,
16316     xlinkType: NS.xlink,
16317     xmlBase: NS.xml,
16318     xmlLang: NS.xml,
16319     xmlSpace: NS.xml
16320   },
16321   DOMAttributeNames: {}
16324 Object.keys(ATTRS).forEach(function (key) {
16325   SVGDOMPropertyConfig.Properties[key] = 0;
16326   if (ATTRS[key]) {
16327     SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
16328   }
16331 module.exports = SVGDOMPropertyConfig;
16332 },{}],109:[function(_dereq_,module,exports){
16334  * Copyright 2013-present, Facebook, Inc.
16335  * All rights reserved.
16337  * This source code is licensed under the BSD-style license found in the
16338  * LICENSE file in the root directory of this source tree. An additional grant
16339  * of patent rights can be found in the PATENTS file in the same directory.
16341  * @providesModule SelectEventPlugin
16342  */
16344 'use strict';
16346 var EventConstants = _dereq_(16);
16347 var EventPropagators = _dereq_(20);
16348 var ExecutionEnvironment = _dereq_(159);
16349 var ReactDOMComponentTree = _dereq_(45);
16350 var ReactInputSelection = _dereq_(74);
16351 var SyntheticEvent = _dereq_(115);
16353 var getActiveElement = _dereq_(168);
16354 var isTextInputElement = _dereq_(146);
16355 var keyOf = _dereq_(177);
16356 var shallowEqual = _dereq_(182);
16358 var topLevelTypes = EventConstants.topLevelTypes;
16360 var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
16362 var eventTypes = {
16363   select: {
16364     phasedRegistrationNames: {
16365       bubbled: keyOf({ onSelect: null }),
16366       captured: keyOf({ onSelectCapture: null })
16367     },
16368     dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
16369   }
16372 var activeElement = null;
16373 var activeElementInst = null;
16374 var lastSelection = null;
16375 var mouseDown = false;
16377 // Track whether a listener exists for this plugin. If none exist, we do
16378 // not extract events. See #3639.
16379 var hasListener = false;
16380 var ON_SELECT_KEY = keyOf({ onSelect: null });
16383  * Get an object which is a unique representation of the current selection.
16385  * The return value will not be consistent across nodes or browsers, but
16386  * two identical selections on the same node will return identical objects.
16388  * @param {DOMElement} node
16389  * @return {object}
16390  */
16391 function getSelection(node) {
16392   if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
16393     return {
16394       start: node.selectionStart,
16395       end: node.selectionEnd
16396     };
16397   } else if (window.getSelection) {
16398     var selection = window.getSelection();
16399     return {
16400       anchorNode: selection.anchorNode,
16401       anchorOffset: selection.anchorOffset,
16402       focusNode: selection.focusNode,
16403       focusOffset: selection.focusOffset
16404     };
16405   } else if (document.selection) {
16406     var range = document.selection.createRange();
16407     return {
16408       parentElement: range.parentElement(),
16409       text: range.text,
16410       top: range.boundingTop,
16411       left: range.boundingLeft
16412     };
16413   }
16417  * Poll selection to see whether it's changed.
16419  * @param {object} nativeEvent
16420  * @return {?SyntheticEvent}
16421  */
16422 function constructSelectEvent(nativeEvent, nativeEventTarget) {
16423   // Ensure we have the right element, and that the user is not dragging a
16424   // selection (this matches native `select` event behavior). In HTML5, select
16425   // fires only on input and textarea thus if there's no focused element we
16426   // won't dispatch.
16427   if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
16428     return null;
16429   }
16431   // Only fire when selection has actually changed.
16432   var currentSelection = getSelection(activeElement);
16433   if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
16434     lastSelection = currentSelection;
16436     var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);
16438     syntheticEvent.type = 'select';
16439     syntheticEvent.target = activeElement;
16441     EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
16443     return syntheticEvent;
16444   }
16446   return null;
16450  * This plugin creates an `onSelect` event that normalizes select events
16451  * across form elements.
16453  * Supported elements are:
16454  * - input (see `isTextInputElement`)
16455  * - textarea
16456  * - contentEditable
16458  * This differs from native browser implementations in the following ways:
16459  * - Fires on contentEditable fields as well as inputs.
16460  * - Fires for collapsed selection.
16461  * - Fires after user input.
16462  */
16463 var SelectEventPlugin = {
16465   eventTypes: eventTypes,
16467   extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
16468     if (!hasListener) {
16469       return null;
16470     }
16472     var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
16474     switch (topLevelType) {
16475       // Track the input node that has focus.
16476       case topLevelTypes.topFocus:
16477         if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
16478           activeElement = targetNode;
16479           activeElementInst = targetInst;
16480           lastSelection = null;
16481         }
16482         break;
16483       case topLevelTypes.topBlur:
16484         activeElement = null;
16485         activeElementInst = null;
16486         lastSelection = null;
16487         break;
16489       // Don't fire the event while the user is dragging. This matches the
16490       // semantics of the native select event.
16491       case topLevelTypes.topMouseDown:
16492         mouseDown = true;
16493         break;
16494       case topLevelTypes.topContextMenu:
16495       case topLevelTypes.topMouseUp:
16496         mouseDown = false;
16497         return constructSelectEvent(nativeEvent, nativeEventTarget);
16499       // Chrome and IE fire non-standard event when selection is changed (and
16500       // sometimes when it hasn't). IE's event fires out of order with respect
16501       // to key and input events on deletion, so we discard it.
16502       //
16503       // Firefox doesn't support selectionchange, so check selection status
16504       // after each key entry. The selection changes after keydown and before
16505       // keyup, but we check on keydown as well in the case of holding down a
16506       // key, when multiple keydown events are fired but only one keyup is.
16507       // This is also our approach for IE handling, for the reason above.
16508       case topLevelTypes.topSelectionChange:
16509         if (skipSelectionChangeEvent) {
16510           break;
16511         }
16512       // falls through
16513       case topLevelTypes.topKeyDown:
16514       case topLevelTypes.topKeyUp:
16515         return constructSelectEvent(nativeEvent, nativeEventTarget);
16516     }
16518     return null;
16519   },
16521   didPutListener: function (inst, registrationName, listener) {
16522     if (registrationName === ON_SELECT_KEY) {
16523       hasListener = true;
16524     }
16525   }
16528 module.exports = SelectEventPlugin;
16529 },{"115":115,"146":146,"159":159,"16":16,"168":168,"177":177,"182":182,"20":20,"45":45,"74":74}],110:[function(_dereq_,module,exports){
16531  * Copyright 2013-present, Facebook, Inc.
16532  * All rights reserved.
16534  * This source code is licensed under the BSD-style license found in the
16535  * LICENSE file in the root directory of this source tree. An additional grant
16536  * of patent rights can be found in the PATENTS file in the same directory.
16538  * @providesModule SimpleEventPlugin
16539  */
16541 'use strict';
16543 var EventConstants = _dereq_(16);
16544 var EventListener = _dereq_(158);
16545 var EventPropagators = _dereq_(20);
16546 var ReactDOMComponentTree = _dereq_(45);
16547 var SyntheticAnimationEvent = _dereq_(111);
16548 var SyntheticClipboardEvent = _dereq_(112);
16549 var SyntheticEvent = _dereq_(115);
16550 var SyntheticFocusEvent = _dereq_(116);
16551 var SyntheticKeyboardEvent = _dereq_(118);
16552 var SyntheticMouseEvent = _dereq_(119);
16553 var SyntheticDragEvent = _dereq_(114);
16554 var SyntheticTouchEvent = _dereq_(120);
16555 var SyntheticTransitionEvent = _dereq_(121);
16556 var SyntheticUIEvent = _dereq_(122);
16557 var SyntheticWheelEvent = _dereq_(123);
16559 var emptyFunction = _dereq_(165);
16560 var getEventCharCode = _dereq_(135);
16561 var invariant = _dereq_(173);
16562 var keyOf = _dereq_(177);
16564 var topLevelTypes = EventConstants.topLevelTypes;
16566 var eventTypes = {
16567   abort: {
16568     phasedRegistrationNames: {
16569       bubbled: keyOf({ onAbort: true }),
16570       captured: keyOf({ onAbortCapture: true })
16571     }
16572   },
16573   animationEnd: {
16574     phasedRegistrationNames: {
16575       bubbled: keyOf({ onAnimationEnd: true }),
16576       captured: keyOf({ onAnimationEndCapture: true })
16577     }
16578   },
16579   animationIteration: {
16580     phasedRegistrationNames: {
16581       bubbled: keyOf({ onAnimationIteration: true }),
16582       captured: keyOf({ onAnimationIterationCapture: true })
16583     }
16584   },
16585   animationStart: {
16586     phasedRegistrationNames: {
16587       bubbled: keyOf({ onAnimationStart: true }),
16588       captured: keyOf({ onAnimationStartCapture: true })
16589     }
16590   },
16591   blur: {
16592     phasedRegistrationNames: {
16593       bubbled: keyOf({ onBlur: true }),
16594       captured: keyOf({ onBlurCapture: true })
16595     }
16596   },
16597   canPlay: {
16598     phasedRegistrationNames: {
16599       bubbled: keyOf({ onCanPlay: true }),
16600       captured: keyOf({ onCanPlayCapture: true })
16601     }
16602   },
16603   canPlayThrough: {
16604     phasedRegistrationNames: {
16605       bubbled: keyOf({ onCanPlayThrough: true }),
16606       captured: keyOf({ onCanPlayThroughCapture: true })
16607     }
16608   },
16609   click: {
16610     phasedRegistrationNames: {
16611       bubbled: keyOf({ onClick: true }),
16612       captured: keyOf({ onClickCapture: true })
16613     }
16614   },
16615   contextMenu: {
16616     phasedRegistrationNames: {
16617       bubbled: keyOf({ onContextMenu: true }),
16618       captured: keyOf({ onContextMenuCapture: true })
16619     }
16620   },
16621   copy: {
16622     phasedRegistrationNames: {
16623       bubbled: keyOf({ onCopy: true }),
16624       captured: keyOf({ onCopyCapture: true })
16625     }
16626   },
16627   cut: {
16628     phasedRegistrationNames: {
16629       bubbled: keyOf({ onCut: true }),
16630       captured: keyOf({ onCutCapture: true })
16631     }
16632   },
16633   doubleClick: {
16634     phasedRegistrationNames: {
16635       bubbled: keyOf({ onDoubleClick: true }),
16636       captured: keyOf({ onDoubleClickCapture: true })
16637     }
16638   },
16639   drag: {
16640     phasedRegistrationNames: {
16641       bubbled: keyOf({ onDrag: true }),
16642       captured: keyOf({ onDragCapture: true })
16643     }
16644   },
16645   dragEnd: {
16646     phasedRegistrationNames: {
16647       bubbled: keyOf({ onDragEnd: true }),
16648       captured: keyOf({ onDragEndCapture: true })
16649     }
16650   },
16651   dragEnter: {
16652     phasedRegistrationNames: {
16653       bubbled: keyOf({ onDragEnter: true }),
16654       captured: keyOf({ onDragEnterCapture: true })
16655     }
16656   },
16657   dragExit: {
16658     phasedRegistrationNames: {
16659       bubbled: keyOf({ onDragExit: true }),
16660       captured: keyOf({ onDragExitCapture: true })
16661     }
16662   },
16663   dragLeave: {
16664     phasedRegistrationNames: {
16665       bubbled: keyOf({ onDragLeave: true }),
16666       captured: keyOf({ onDragLeaveCapture: true })
16667     }
16668   },
16669   dragOver: {
16670     phasedRegistrationNames: {
16671       bubbled: keyOf({ onDragOver: true }),
16672       captured: keyOf({ onDragOverCapture: true })
16673     }
16674   },
16675   dragStart: {
16676     phasedRegistrationNames: {
16677       bubbled: keyOf({ onDragStart: true }),
16678       captured: keyOf({ onDragStartCapture: true })
16679     }
16680   },
16681   drop: {
16682     phasedRegistrationNames: {
16683       bubbled: keyOf({ onDrop: true }),
16684       captured: keyOf({ onDropCapture: true })
16685     }
16686   },
16687   durationChange: {
16688     phasedRegistrationNames: {
16689       bubbled: keyOf({ onDurationChange: true }),
16690       captured: keyOf({ onDurationChangeCapture: true })
16691     }
16692   },
16693   emptied: {
16694     phasedRegistrationNames: {
16695       bubbled: keyOf({ onEmptied: true }),
16696       captured: keyOf({ onEmptiedCapture: true })
16697     }
16698   },
16699   encrypted: {
16700     phasedRegistrationNames: {
16701       bubbled: keyOf({ onEncrypted: true }),
16702       captured: keyOf({ onEncryptedCapture: true })
16703     }
16704   },
16705   ended: {
16706     phasedRegistrationNames: {
16707       bubbled: keyOf({ onEnded: true }),
16708       captured: keyOf({ onEndedCapture: true })
16709     }
16710   },
16711   error: {
16712     phasedRegistrationNames: {
16713       bubbled: keyOf({ onError: true }),
16714       captured: keyOf({ onErrorCapture: true })
16715     }
16716   },
16717   focus: {
16718     phasedRegistrationNames: {
16719       bubbled: keyOf({ onFocus: true }),
16720       captured: keyOf({ onFocusCapture: true })
16721     }
16722   },
16723   input: {
16724     phasedRegistrationNames: {
16725       bubbled: keyOf({ onInput: true }),
16726       captured: keyOf({ onInputCapture: true })
16727     }
16728   },
16729   invalid: {
16730     phasedRegistrationNames: {
16731       bubbled: keyOf({ onInvalid: true }),
16732       captured: keyOf({ onInvalidCapture: true })
16733     }
16734   },
16735   keyDown: {
16736     phasedRegistrationNames: {
16737       bubbled: keyOf({ onKeyDown: true }),
16738       captured: keyOf({ onKeyDownCapture: true })
16739     }
16740   },
16741   keyPress: {
16742     phasedRegistrationNames: {
16743       bubbled: keyOf({ onKeyPress: true }),
16744       captured: keyOf({ onKeyPressCapture: true })
16745     }
16746   },
16747   keyUp: {
16748     phasedRegistrationNames: {
16749       bubbled: keyOf({ onKeyUp: true }),
16750       captured: keyOf({ onKeyUpCapture: true })
16751     }
16752   },
16753   load: {
16754     phasedRegistrationNames: {
16755       bubbled: keyOf({ onLoad: true }),
16756       captured: keyOf({ onLoadCapture: true })
16757     }
16758   },
16759   loadedData: {
16760     phasedRegistrationNames: {
16761       bubbled: keyOf({ onLoadedData: true }),
16762       captured: keyOf({ onLoadedDataCapture: true })
16763     }
16764   },
16765   loadedMetadata: {
16766     phasedRegistrationNames: {
16767       bubbled: keyOf({ onLoadedMetadata: true }),
16768       captured: keyOf({ onLoadedMetadataCapture: true })
16769     }
16770   },
16771   loadStart: {
16772     phasedRegistrationNames: {
16773       bubbled: keyOf({ onLoadStart: true }),
16774       captured: keyOf({ onLoadStartCapture: true })
16775     }
16776   },
16777   // Note: We do not allow listening to mouseOver events. Instead, use the
16778   // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
16779   mouseDown: {
16780     phasedRegistrationNames: {
16781       bubbled: keyOf({ onMouseDown: true }),
16782       captured: keyOf({ onMouseDownCapture: true })
16783     }
16784   },
16785   mouseMove: {
16786     phasedRegistrationNames: {
16787       bubbled: keyOf({ onMouseMove: true }),
16788       captured: keyOf({ onMouseMoveCapture: true })
16789     }
16790   },
16791   mouseOut: {
16792     phasedRegistrationNames: {
16793       bubbled: keyOf({ onMouseOut: true }),
16794       captured: keyOf({ onMouseOutCapture: true })
16795     }
16796   },
16797   mouseOver: {
16798     phasedRegistrationNames: {
16799       bubbled: keyOf({ onMouseOver: true }),
16800       captured: keyOf({ onMouseOverCapture: true })
16801     }
16802   },
16803   mouseUp: {
16804     phasedRegistrationNames: {
16805       bubbled: keyOf({ onMouseUp: true }),
16806       captured: keyOf({ onMouseUpCapture: true })
16807     }
16808   },
16809   paste: {
16810     phasedRegistrationNames: {
16811       bubbled: keyOf({ onPaste: true }),
16812       captured: keyOf({ onPasteCapture: true })
16813     }
16814   },
16815   pause: {
16816     phasedRegistrationNames: {
16817       bubbled: keyOf({ onPause: true }),
16818       captured: keyOf({ onPauseCapture: true })
16819     }
16820   },
16821   play: {
16822     phasedRegistrationNames: {
16823       bubbled: keyOf({ onPlay: true }),
16824       captured: keyOf({ onPlayCapture: true })
16825     }
16826   },
16827   playing: {
16828     phasedRegistrationNames: {
16829       bubbled: keyOf({ onPlaying: true }),
16830       captured: keyOf({ onPlayingCapture: true })
16831     }
16832   },
16833   progress: {
16834     phasedRegistrationNames: {
16835       bubbled: keyOf({ onProgress: true }),
16836       captured: keyOf({ onProgressCapture: true })
16837     }
16838   },
16839   rateChange: {
16840     phasedRegistrationNames: {
16841       bubbled: keyOf({ onRateChange: true }),
16842       captured: keyOf({ onRateChangeCapture: true })
16843     }
16844   },
16845   reset: {
16846     phasedRegistrationNames: {
16847       bubbled: keyOf({ onReset: true }),
16848       captured: keyOf({ onResetCapture: true })
16849     }
16850   },
16851   scroll: {
16852     phasedRegistrationNames: {
16853       bubbled: keyOf({ onScroll: true }),
16854       captured: keyOf({ onScrollCapture: true })
16855     }
16856   },
16857   seeked: {
16858     phasedRegistrationNames: {
16859       bubbled: keyOf({ onSeeked: true }),
16860       captured: keyOf({ onSeekedCapture: true })
16861     }
16862   },
16863   seeking: {
16864     phasedRegistrationNames: {
16865       bubbled: keyOf({ onSeeking: true }),
16866       captured: keyOf({ onSeekingCapture: true })
16867     }
16868   },
16869   stalled: {
16870     phasedRegistrationNames: {
16871       bubbled: keyOf({ onStalled: true }),
16872       captured: keyOf({ onStalledCapture: true })
16873     }
16874   },
16875   submit: {
16876     phasedRegistrationNames: {
16877       bubbled: keyOf({ onSubmit: true }),
16878       captured: keyOf({ onSubmitCapture: true })
16879     }
16880   },
16881   suspend: {
16882     phasedRegistrationNames: {
16883       bubbled: keyOf({ onSuspend: true }),
16884       captured: keyOf({ onSuspendCapture: true })
16885     }
16886   },
16887   timeUpdate: {
16888     phasedRegistrationNames: {
16889       bubbled: keyOf({ onTimeUpdate: true }),
16890       captured: keyOf({ onTimeUpdateCapture: true })
16891     }
16892   },
16893   touchCancel: {
16894     phasedRegistrationNames: {
16895       bubbled: keyOf({ onTouchCancel: true }),
16896       captured: keyOf({ onTouchCancelCapture: true })
16897     }
16898   },
16899   touchEnd: {
16900     phasedRegistrationNames: {
16901       bubbled: keyOf({ onTouchEnd: true }),
16902       captured: keyOf({ onTouchEndCapture: true })
16903     }
16904   },
16905   touchMove: {
16906     phasedRegistrationNames: {
16907       bubbled: keyOf({ onTouchMove: true }),
16908       captured: keyOf({ onTouchMoveCapture: true })
16909     }
16910   },
16911   touchStart: {
16912     phasedRegistrationNames: {
16913       bubbled: keyOf({ onTouchStart: true }),
16914       captured: keyOf({ onTouchStartCapture: true })
16915     }
16916   },
16917   transitionEnd: {
16918     phasedRegistrationNames: {
16919       bubbled: keyOf({ onTransitionEnd: true }),
16920       captured: keyOf({ onTransitionEndCapture: true })
16921     }
16922   },
16923   volumeChange: {
16924     phasedRegistrationNames: {
16925       bubbled: keyOf({ onVolumeChange: true }),
16926       captured: keyOf({ onVolumeChangeCapture: true })
16927     }
16928   },
16929   waiting: {
16930     phasedRegistrationNames: {
16931       bubbled: keyOf({ onWaiting: true }),
16932       captured: keyOf({ onWaitingCapture: true })
16933     }
16934   },
16935   wheel: {
16936     phasedRegistrationNames: {
16937       bubbled: keyOf({ onWheel: true }),
16938       captured: keyOf({ onWheelCapture: true })
16939     }
16940   }
16943 var topLevelEventsToDispatchConfig = {
16944   topAbort: eventTypes.abort,
16945   topAnimationEnd: eventTypes.animationEnd,
16946   topAnimationIteration: eventTypes.animationIteration,
16947   topAnimationStart: eventTypes.animationStart,
16948   topBlur: eventTypes.blur,
16949   topCanPlay: eventTypes.canPlay,
16950   topCanPlayThrough: eventTypes.canPlayThrough,
16951   topClick: eventTypes.click,
16952   topContextMenu: eventTypes.contextMenu,
16953   topCopy: eventTypes.copy,
16954   topCut: eventTypes.cut,
16955   topDoubleClick: eventTypes.doubleClick,
16956   topDrag: eventTypes.drag,
16957   topDragEnd: eventTypes.dragEnd,
16958   topDragEnter: eventTypes.dragEnter,
16959   topDragExit: eventTypes.dragExit,
16960   topDragLeave: eventTypes.dragLeave,
16961   topDragOver: eventTypes.dragOver,
16962   topDragStart: eventTypes.dragStart,
16963   topDrop: eventTypes.drop,
16964   topDurationChange: eventTypes.durationChange,
16965   topEmptied: eventTypes.emptied,
16966   topEncrypted: eventTypes.encrypted,
16967   topEnded: eventTypes.ended,
16968   topError: eventTypes.error,
16969   topFocus: eventTypes.focus,
16970   topInput: eventTypes.input,
16971   topInvalid: eventTypes.invalid,
16972   topKeyDown: eventTypes.keyDown,
16973   topKeyPress: eventTypes.keyPress,
16974   topKeyUp: eventTypes.keyUp,
16975   topLoad: eventTypes.load,
16976   topLoadedData: eventTypes.loadedData,
16977   topLoadedMetadata: eventTypes.loadedMetadata,
16978   topLoadStart: eventTypes.loadStart,
16979   topMouseDown: eventTypes.mouseDown,
16980   topMouseMove: eventTypes.mouseMove,
16981   topMouseOut: eventTypes.mouseOut,
16982   topMouseOver: eventTypes.mouseOver,
16983   topMouseUp: eventTypes.mouseUp,
16984   topPaste: eventTypes.paste,
16985   topPause: eventTypes.pause,
16986   topPlay: eventTypes.play,
16987   topPlaying: eventTypes.playing,
16988   topProgress: eventTypes.progress,
16989   topRateChange: eventTypes.rateChange,
16990   topReset: eventTypes.reset,
16991   topScroll: eventTypes.scroll,
16992   topSeeked: eventTypes.seeked,
16993   topSeeking: eventTypes.seeking,
16994   topStalled: eventTypes.stalled,
16995   topSubmit: eventTypes.submit,
16996   topSuspend: eventTypes.suspend,
16997   topTimeUpdate: eventTypes.timeUpdate,
16998   topTouchCancel: eventTypes.touchCancel,
16999   topTouchEnd: eventTypes.touchEnd,
17000   topTouchMove: eventTypes.touchMove,
17001   topTouchStart: eventTypes.touchStart,
17002   topTransitionEnd: eventTypes.transitionEnd,
17003   topVolumeChange: eventTypes.volumeChange,
17004   topWaiting: eventTypes.waiting,
17005   topWheel: eventTypes.wheel
17008 for (var type in topLevelEventsToDispatchConfig) {
17009   topLevelEventsToDispatchConfig[type].dependencies = [type];
17012 var ON_CLICK_KEY = keyOf({ onClick: null });
17013 var onClickListeners = {};
17015 var SimpleEventPlugin = {
17017   eventTypes: eventTypes,
17019   extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
17020     var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
17021     if (!dispatchConfig) {
17022       return null;
17023     }
17024     var EventConstructor;
17025     switch (topLevelType) {
17026       case topLevelTypes.topAbort:
17027       case topLevelTypes.topCanPlay:
17028       case topLevelTypes.topCanPlayThrough:
17029       case topLevelTypes.topDurationChange:
17030       case topLevelTypes.topEmptied:
17031       case topLevelTypes.topEncrypted:
17032       case topLevelTypes.topEnded:
17033       case topLevelTypes.topError:
17034       case topLevelTypes.topInput:
17035       case topLevelTypes.topInvalid:
17036       case topLevelTypes.topLoad:
17037       case topLevelTypes.topLoadedData:
17038       case topLevelTypes.topLoadedMetadata:
17039       case topLevelTypes.topLoadStart:
17040       case topLevelTypes.topPause:
17041       case topLevelTypes.topPlay:
17042       case topLevelTypes.topPlaying:
17043       case topLevelTypes.topProgress:
17044       case topLevelTypes.topRateChange:
17045       case topLevelTypes.topReset:
17046       case topLevelTypes.topSeeked:
17047       case topLevelTypes.topSeeking:
17048       case topLevelTypes.topStalled:
17049       case topLevelTypes.topSubmit:
17050       case topLevelTypes.topSuspend:
17051       case topLevelTypes.topTimeUpdate:
17052       case topLevelTypes.topVolumeChange:
17053       case topLevelTypes.topWaiting:
17054         // HTML Events
17055         // @see http://www.w3.org/TR/html5/index.html#events-0
17056         EventConstructor = SyntheticEvent;
17057         break;
17058       case topLevelTypes.topKeyPress:
17059         // Firefox creates a keypress event for function keys too. This removes
17060         // the unwanted keypress events. Enter is however both printable and
17061         // non-printable. One would expect Tab to be as well (but it isn't).
17062         if (getEventCharCode(nativeEvent) === 0) {
17063           return null;
17064         }
17065       /* falls through */
17066       case topLevelTypes.topKeyDown:
17067       case topLevelTypes.topKeyUp:
17068         EventConstructor = SyntheticKeyboardEvent;
17069         break;
17070       case topLevelTypes.topBlur:
17071       case topLevelTypes.topFocus:
17072         EventConstructor = SyntheticFocusEvent;
17073         break;
17074       case topLevelTypes.topClick:
17075         // Firefox creates a click event on right mouse clicks. This removes the
17076         // unwanted click events.
17077         if (nativeEvent.button === 2) {
17078           return null;
17079         }
17080       /* falls through */
17081       case topLevelTypes.topContextMenu:
17082       case topLevelTypes.topDoubleClick:
17083       case topLevelTypes.topMouseDown:
17084       case topLevelTypes.topMouseMove:
17085       case topLevelTypes.topMouseOut:
17086       case topLevelTypes.topMouseOver:
17087       case topLevelTypes.topMouseUp:
17088         EventConstructor = SyntheticMouseEvent;
17089         break;
17090       case topLevelTypes.topDrag:
17091       case topLevelTypes.topDragEnd:
17092       case topLevelTypes.topDragEnter:
17093       case topLevelTypes.topDragExit:
17094       case topLevelTypes.topDragLeave:
17095       case topLevelTypes.topDragOver:
17096       case topLevelTypes.topDragStart:
17097       case topLevelTypes.topDrop:
17098         EventConstructor = SyntheticDragEvent;
17099         break;
17100       case topLevelTypes.topTouchCancel:
17101       case topLevelTypes.topTouchEnd:
17102       case topLevelTypes.topTouchMove:
17103       case topLevelTypes.topTouchStart:
17104         EventConstructor = SyntheticTouchEvent;
17105         break;
17106       case topLevelTypes.topAnimationEnd:
17107       case topLevelTypes.topAnimationIteration:
17108       case topLevelTypes.topAnimationStart:
17109         EventConstructor = SyntheticAnimationEvent;
17110         break;
17111       case topLevelTypes.topTransitionEnd:
17112         EventConstructor = SyntheticTransitionEvent;
17113         break;
17114       case topLevelTypes.topScroll:
17115         EventConstructor = SyntheticUIEvent;
17116         break;
17117       case topLevelTypes.topWheel:
17118         EventConstructor = SyntheticWheelEvent;
17119         break;
17120       case topLevelTypes.topCopy:
17121       case topLevelTypes.topCut:
17122       case topLevelTypes.topPaste:
17123         EventConstructor = SyntheticClipboardEvent;
17124         break;
17125     }
17126     !EventConstructor ? "development" !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : invariant(false) : void 0;
17127     var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
17128     EventPropagators.accumulateTwoPhaseDispatches(event);
17129     return event;
17130   },
17132   didPutListener: function (inst, registrationName, listener) {
17133     // Mobile Safari does not fire properly bubble click events on
17134     // non-interactive elements, which means delegated click listeners do not
17135     // fire. The workaround for this bug involves attaching an empty click
17136     // listener on the target node.
17137     if (registrationName === ON_CLICK_KEY) {
17138       var id = inst._rootNodeID;
17139       var node = ReactDOMComponentTree.getNodeFromInstance(inst);
17140       if (!onClickListeners[id]) {
17141         onClickListeners[id] = EventListener.listen(node, 'click', emptyFunction);
17142       }
17143     }
17144   },
17146   willDeleteListener: function (inst, registrationName) {
17147     if (registrationName === ON_CLICK_KEY) {
17148       var id = inst._rootNodeID;
17149       onClickListeners[id].remove();
17150       delete onClickListeners[id];
17151     }
17152   }
17156 module.exports = SimpleEventPlugin;
17157 },{"111":111,"112":112,"114":114,"115":115,"116":116,"118":118,"119":119,"120":120,"121":121,"122":122,"123":123,"135":135,"158":158,"16":16,"165":165,"173":173,"177":177,"20":20,"45":45}],111:[function(_dereq_,module,exports){
17159  * Copyright 2013-present, Facebook, Inc.
17160  * All rights reserved.
17162  * This source code is licensed under the BSD-style license found in the
17163  * LICENSE file in the root directory of this source tree. An additional grant
17164  * of patent rights can be found in the PATENTS file in the same directory.
17166  * @providesModule SyntheticAnimationEvent
17167  */
17169 'use strict';
17171 var SyntheticEvent = _dereq_(115);
17174  * @interface Event
17175  * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
17176  * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
17177  */
17178 var AnimationEventInterface = {
17179   animationName: null,
17180   elapsedTime: null,
17181   pseudoElement: null
17185  * @param {object} dispatchConfig Configuration used to dispatch this event.
17186  * @param {string} dispatchMarker Marker identifying the event target.
17187  * @param {object} nativeEvent Native browser event.
17188  * @extends {SyntheticEvent}
17189  */
17190 function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17191   return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17194 SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
17196 module.exports = SyntheticAnimationEvent;
17197 },{"115":115}],112:[function(_dereq_,module,exports){
17199  * Copyright 2013-present, Facebook, Inc.
17200  * All rights reserved.
17202  * This source code is licensed under the BSD-style license found in the
17203  * LICENSE file in the root directory of this source tree. An additional grant
17204  * of patent rights can be found in the PATENTS file in the same directory.
17206  * @providesModule SyntheticClipboardEvent
17207  */
17209 'use strict';
17211 var SyntheticEvent = _dereq_(115);
17214  * @interface Event
17215  * @see http://www.w3.org/TR/clipboard-apis/
17216  */
17217 var ClipboardEventInterface = {
17218   clipboardData: function (event) {
17219     return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
17220   }
17224  * @param {object} dispatchConfig Configuration used to dispatch this event.
17225  * @param {string} dispatchMarker Marker identifying the event target.
17226  * @param {object} nativeEvent Native browser event.
17227  * @extends {SyntheticUIEvent}
17228  */
17229 function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17230   return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17233 SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
17235 module.exports = SyntheticClipboardEvent;
17236 },{"115":115}],113:[function(_dereq_,module,exports){
17238  * Copyright 2013-present, Facebook, Inc.
17239  * All rights reserved.
17241  * This source code is licensed under the BSD-style license found in the
17242  * LICENSE file in the root directory of this source tree. An additional grant
17243  * of patent rights can be found in the PATENTS file in the same directory.
17245  * @providesModule SyntheticCompositionEvent
17246  */
17248 'use strict';
17250 var SyntheticEvent = _dereq_(115);
17253  * @interface Event
17254  * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
17255  */
17256 var CompositionEventInterface = {
17257   data: null
17261  * @param {object} dispatchConfig Configuration used to dispatch this event.
17262  * @param {string} dispatchMarker Marker identifying the event target.
17263  * @param {object} nativeEvent Native browser event.
17264  * @extends {SyntheticUIEvent}
17265  */
17266 function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17267   return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17270 SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
17272 module.exports = SyntheticCompositionEvent;
17273 },{"115":115}],114:[function(_dereq_,module,exports){
17275  * Copyright 2013-present, Facebook, Inc.
17276  * All rights reserved.
17278  * This source code is licensed under the BSD-style license found in the
17279  * LICENSE file in the root directory of this source tree. An additional grant
17280  * of patent rights can be found in the PATENTS file in the same directory.
17282  * @providesModule SyntheticDragEvent
17283  */
17285 'use strict';
17287 var SyntheticMouseEvent = _dereq_(119);
17290  * @interface DragEvent
17291  * @see http://www.w3.org/TR/DOM-Level-3-Events/
17292  */
17293 var DragEventInterface = {
17294   dataTransfer: null
17298  * @param {object} dispatchConfig Configuration used to dispatch this event.
17299  * @param {string} dispatchMarker Marker identifying the event target.
17300  * @param {object} nativeEvent Native browser event.
17301  * @extends {SyntheticUIEvent}
17302  */
17303 function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17304   return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17307 SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
17309 module.exports = SyntheticDragEvent;
17310 },{"119":119}],115:[function(_dereq_,module,exports){
17312  * Copyright 2013-present, Facebook, Inc.
17313  * All rights reserved.
17315  * This source code is licensed under the BSD-style license found in the
17316  * LICENSE file in the root directory of this source tree. An additional grant
17317  * of patent rights can be found in the PATENTS file in the same directory.
17319  * @providesModule SyntheticEvent
17320  */
17322 'use strict';
17324 var _assign = _dereq_(184);
17326 var PooledClass = _dereq_(26);
17328 var emptyFunction = _dereq_(165);
17329 var warning = _dereq_(183);
17331 var didWarnForAddedNewProperty = false;
17332 var isProxySupported = typeof Proxy === 'function';
17334 var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
17337  * @interface Event
17338  * @see http://www.w3.org/TR/DOM-Level-3-Events/
17339  */
17340 var EventInterface = {
17341   type: null,
17342   target: null,
17343   // currentTarget is set when dispatching; no use in copying it here
17344   currentTarget: emptyFunction.thatReturnsNull,
17345   eventPhase: null,
17346   bubbles: null,
17347   cancelable: null,
17348   timeStamp: function (event) {
17349     return event.timeStamp || Date.now();
17350   },
17351   defaultPrevented: null,
17352   isTrusted: null
17356  * Synthetic events are dispatched by event plugins, typically in response to a
17357  * top-level event delegation handler.
17359  * These systems should generally use pooling to reduce the frequency of garbage
17360  * collection. The system should check `isPersistent` to determine whether the
17361  * event should be released into the pool after being dispatched. Users that
17362  * need a persisted event should invoke `persist`.
17364  * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
17365  * normalizing browser quirks. Subclasses do not necessarily have to implement a
17366  * DOM interface; custom application-specific events can also subclass this.
17368  * @param {object} dispatchConfig Configuration used to dispatch this event.
17369  * @param {*} targetInst Marker identifying the event target.
17370  * @param {object} nativeEvent Native browser event.
17371  * @param {DOMEventTarget} nativeEventTarget Target node.
17372  */
17373 function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
17374   if ("development" !== 'production') {
17375     // these have a getter/setter for warnings
17376     delete this.nativeEvent;
17377     delete this.preventDefault;
17378     delete this.stopPropagation;
17379   }
17381   this.dispatchConfig = dispatchConfig;
17382   this._targetInst = targetInst;
17383   this.nativeEvent = nativeEvent;
17385   var Interface = this.constructor.Interface;
17386   for (var propName in Interface) {
17387     if (!Interface.hasOwnProperty(propName)) {
17388       continue;
17389     }
17390     if ("development" !== 'production') {
17391       delete this[propName]; // this has a getter/setter for warnings
17392     }
17393     var normalize = Interface[propName];
17394     if (normalize) {
17395       this[propName] = normalize(nativeEvent);
17396     } else {
17397       if (propName === 'target') {
17398         this.target = nativeEventTarget;
17399       } else {
17400         this[propName] = nativeEvent[propName];
17401       }
17402     }
17403   }
17405   var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
17406   if (defaultPrevented) {
17407     this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
17408   } else {
17409     this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
17410   }
17411   this.isPropagationStopped = emptyFunction.thatReturnsFalse;
17412   return this;
17415 _assign(SyntheticEvent.prototype, {
17417   preventDefault: function () {
17418     this.defaultPrevented = true;
17419     var event = this.nativeEvent;
17420     if (!event) {
17421       return;
17422     }
17424     if (event.preventDefault) {
17425       event.preventDefault();
17426     } else {
17427       event.returnValue = false;
17428     }
17429     this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
17430   },
17432   stopPropagation: function () {
17433     var event = this.nativeEvent;
17434     if (!event) {
17435       return;
17436     }
17438     if (event.stopPropagation) {
17439       event.stopPropagation();
17440     } else {
17441       event.cancelBubble = true;
17442     }
17443     this.isPropagationStopped = emptyFunction.thatReturnsTrue;
17444   },
17446   /**
17447    * We release all dispatched `SyntheticEvent`s after each event loop, adding
17448    * them back into the pool. This allows a way to hold onto a reference that
17449    * won't be added back into the pool.
17450    */
17451   persist: function () {
17452     this.isPersistent = emptyFunction.thatReturnsTrue;
17453   },
17455   /**
17456    * Checks if this event should be released back into the pool.
17457    *
17458    * @return {boolean} True if this should not be released, false otherwise.
17459    */
17460   isPersistent: emptyFunction.thatReturnsFalse,
17462   /**
17463    * `PooledClass` looks for `destructor` on each instance it releases.
17464    */
17465   destructor: function () {
17466     var Interface = this.constructor.Interface;
17467     for (var propName in Interface) {
17468       if ("development" !== 'production') {
17469         Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
17470       } else {
17471         this[propName] = null;
17472       }
17473     }
17474     for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
17475       this[shouldBeReleasedProperties[i]] = null;
17476     }
17477     if ("development" !== 'production') {
17478       var noop = _dereq_(165);
17479       Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
17480       Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', noop));
17481       Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', noop));
17482     }
17483   }
17487 SyntheticEvent.Interface = EventInterface;
17489 if ("development" !== 'production') {
17490   if (isProxySupported) {
17491     /*eslint-disable no-func-assign */
17492     SyntheticEvent = new Proxy(SyntheticEvent, {
17493       construct: function (target, args) {
17494         return this.apply(target, Object.create(target.prototype), args);
17495       },
17496       apply: function (constructor, that, args) {
17497         return new Proxy(constructor.apply(that, args), {
17498           set: function (target, prop, value) {
17499             if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
17500               "development" !== 'production' ? warning(didWarnForAddedNewProperty || target.isPersistent(), 'This synthetic event is reused for performance reasons. If you\'re ' + 'seeing this, you\'re adding a new property in the synthetic event object. ' + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
17501               didWarnForAddedNewProperty = true;
17502             }
17503             target[prop] = value;
17504             return true;
17505           }
17506         });
17507       }
17508     });
17509     /*eslint-enable no-func-assign */
17510   }
17513  * Helper to reduce boilerplate when creating subclasses.
17515  * @param {function} Class
17516  * @param {?object} Interface
17517  */
17518 SyntheticEvent.augmentClass = function (Class, Interface) {
17519   var Super = this;
17521   var E = function () {};
17522   E.prototype = Super.prototype;
17523   var prototype = new E();
17525   _assign(prototype, Class.prototype);
17526   Class.prototype = prototype;
17527   Class.prototype.constructor = Class;
17529   Class.Interface = _assign({}, Super.Interface, Interface);
17530   Class.augmentClass = Super.augmentClass;
17532   PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
17535 PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
17537 module.exports = SyntheticEvent;
17540   * Helper to nullify syntheticEvent instance properties when destructing
17541   *
17542   * @param {object} SyntheticEvent
17543   * @param {String} propName
17544   * @return {object} defineProperty object
17545   */
17546 function getPooledWarningPropertyDefinition(propName, getVal) {
17547   var isFunction = typeof getVal === 'function';
17548   return {
17549     configurable: true,
17550     set: set,
17551     get: get
17552   };
17554   function set(val) {
17555     var action = isFunction ? 'setting the method' : 'setting the property';
17556     warn(action, 'This is effectively a no-op');
17557     return val;
17558   }
17560   function get() {
17561     var action = isFunction ? 'accessing the method' : 'accessing the property';
17562     var result = isFunction ? 'This is a no-op function' : 'This is set to null';
17563     warn(action, result);
17564     return getVal;
17565   }
17567   function warn(action, result) {
17568     var warningCondition = false;
17569     "development" !== 'production' ? warning(warningCondition, 'This synthetic event is reused for performance reasons. If you\'re seeing this, ' + 'you\'re %s `%s` on a released/nullified synthetic event. %s. ' + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
17570   }
17572 },{"165":165,"183":183,"184":184,"26":26}],116:[function(_dereq_,module,exports){
17574  * Copyright 2013-present, Facebook, Inc.
17575  * All rights reserved.
17577  * This source code is licensed under the BSD-style license found in the
17578  * LICENSE file in the root directory of this source tree. An additional grant
17579  * of patent rights can be found in the PATENTS file in the same directory.
17581  * @providesModule SyntheticFocusEvent
17582  */
17584 'use strict';
17586 var SyntheticUIEvent = _dereq_(122);
17589  * @interface FocusEvent
17590  * @see http://www.w3.org/TR/DOM-Level-3-Events/
17591  */
17592 var FocusEventInterface = {
17593   relatedTarget: null
17597  * @param {object} dispatchConfig Configuration used to dispatch this event.
17598  * @param {string} dispatchMarker Marker identifying the event target.
17599  * @param {object} nativeEvent Native browser event.
17600  * @extends {SyntheticUIEvent}
17601  */
17602 function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17603   return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17606 SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
17608 module.exports = SyntheticFocusEvent;
17609 },{"122":122}],117:[function(_dereq_,module,exports){
17611  * Copyright 2013-present, Facebook, Inc.
17612  * All rights reserved.
17614  * This source code is licensed under the BSD-style license found in the
17615  * LICENSE file in the root directory of this source tree. An additional grant
17616  * of patent rights can be found in the PATENTS file in the same directory.
17618  * @providesModule SyntheticInputEvent
17619  */
17621 'use strict';
17623 var SyntheticEvent = _dereq_(115);
17626  * @interface Event
17627  * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
17628  *      /#events-inputevents
17629  */
17630 var InputEventInterface = {
17631   data: null
17635  * @param {object} dispatchConfig Configuration used to dispatch this event.
17636  * @param {string} dispatchMarker Marker identifying the event target.
17637  * @param {object} nativeEvent Native browser event.
17638  * @extends {SyntheticUIEvent}
17639  */
17640 function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17641   return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17644 SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
17646 module.exports = SyntheticInputEvent;
17647 },{"115":115}],118:[function(_dereq_,module,exports){
17649  * Copyright 2013-present, Facebook, Inc.
17650  * All rights reserved.
17652  * This source code is licensed under the BSD-style license found in the
17653  * LICENSE file in the root directory of this source tree. An additional grant
17654  * of patent rights can be found in the PATENTS file in the same directory.
17656  * @providesModule SyntheticKeyboardEvent
17657  */
17659 'use strict';
17661 var SyntheticUIEvent = _dereq_(122);
17663 var getEventCharCode = _dereq_(135);
17664 var getEventKey = _dereq_(136);
17665 var getEventModifierState = _dereq_(137);
17668  * @interface KeyboardEvent
17669  * @see http://www.w3.org/TR/DOM-Level-3-Events/
17670  */
17671 var KeyboardEventInterface = {
17672   key: getEventKey,
17673   location: null,
17674   ctrlKey: null,
17675   shiftKey: null,
17676   altKey: null,
17677   metaKey: null,
17678   repeat: null,
17679   locale: null,
17680   getModifierState: getEventModifierState,
17681   // Legacy Interface
17682   charCode: function (event) {
17683     // `charCode` is the result of a KeyPress event and represents the value of
17684     // the actual printable character.
17686     // KeyPress is deprecated, but its replacement is not yet final and not
17687     // implemented in any major browser. Only KeyPress has charCode.
17688     if (event.type === 'keypress') {
17689       return getEventCharCode(event);
17690     }
17691     return 0;
17692   },
17693   keyCode: function (event) {
17694     // `keyCode` is the result of a KeyDown/Up event and represents the value of
17695     // physical keyboard key.
17697     // The actual meaning of the value depends on the users' keyboard layout
17698     // which cannot be detected. Assuming that it is a US keyboard layout
17699     // provides a surprisingly accurate mapping for US and European users.
17700     // Due to this, it is left to the user to implement at this time.
17701     if (event.type === 'keydown' || event.type === 'keyup') {
17702       return event.keyCode;
17703     }
17704     return 0;
17705   },
17706   which: function (event) {
17707     // `which` is an alias for either `keyCode` or `charCode` depending on the
17708     // type of the event.
17709     if (event.type === 'keypress') {
17710       return getEventCharCode(event);
17711     }
17712     if (event.type === 'keydown' || event.type === 'keyup') {
17713       return event.keyCode;
17714     }
17715     return 0;
17716   }
17720  * @param {object} dispatchConfig Configuration used to dispatch this event.
17721  * @param {string} dispatchMarker Marker identifying the event target.
17722  * @param {object} nativeEvent Native browser event.
17723  * @extends {SyntheticUIEvent}
17724  */
17725 function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17726   return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17729 SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
17731 module.exports = SyntheticKeyboardEvent;
17732 },{"122":122,"135":135,"136":136,"137":137}],119:[function(_dereq_,module,exports){
17734  * Copyright 2013-present, Facebook, Inc.
17735  * All rights reserved.
17737  * This source code is licensed under the BSD-style license found in the
17738  * LICENSE file in the root directory of this source tree. An additional grant
17739  * of patent rights can be found in the PATENTS file in the same directory.
17741  * @providesModule SyntheticMouseEvent
17742  */
17744 'use strict';
17746 var SyntheticUIEvent = _dereq_(122);
17747 var ViewportMetrics = _dereq_(125);
17749 var getEventModifierState = _dereq_(137);
17752  * @interface MouseEvent
17753  * @see http://www.w3.org/TR/DOM-Level-3-Events/
17754  */
17755 var MouseEventInterface = {
17756   screenX: null,
17757   screenY: null,
17758   clientX: null,
17759   clientY: null,
17760   ctrlKey: null,
17761   shiftKey: null,
17762   altKey: null,
17763   metaKey: null,
17764   getModifierState: getEventModifierState,
17765   button: function (event) {
17766     // Webkit, Firefox, IE9+
17767     // which:  1 2 3
17768     // button: 0 1 2 (standard)
17769     var button = event.button;
17770     if ('which' in event) {
17771       return button;
17772     }
17773     // IE<9
17774     // which:  undefined
17775     // button: 0 0 0
17776     // button: 1 4 2 (onmouseup)
17777     return button === 2 ? 2 : button === 4 ? 1 : 0;
17778   },
17779   buttons: null,
17780   relatedTarget: function (event) {
17781     return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
17782   },
17783   // "Proprietary" Interface.
17784   pageX: function (event) {
17785     return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
17786   },
17787   pageY: function (event) {
17788     return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
17789   }
17793  * @param {object} dispatchConfig Configuration used to dispatch this event.
17794  * @param {string} dispatchMarker Marker identifying the event target.
17795  * @param {object} nativeEvent Native browser event.
17796  * @extends {SyntheticUIEvent}
17797  */
17798 function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17799   return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17802 SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
17804 module.exports = SyntheticMouseEvent;
17805 },{"122":122,"125":125,"137":137}],120:[function(_dereq_,module,exports){
17807  * Copyright 2013-present, Facebook, Inc.
17808  * All rights reserved.
17810  * This source code is licensed under the BSD-style license found in the
17811  * LICENSE file in the root directory of this source tree. An additional grant
17812  * of patent rights can be found in the PATENTS file in the same directory.
17814  * @providesModule SyntheticTouchEvent
17815  */
17817 'use strict';
17819 var SyntheticUIEvent = _dereq_(122);
17821 var getEventModifierState = _dereq_(137);
17824  * @interface TouchEvent
17825  * @see http://www.w3.org/TR/touch-events/
17826  */
17827 var TouchEventInterface = {
17828   touches: null,
17829   targetTouches: null,
17830   changedTouches: null,
17831   altKey: null,
17832   metaKey: null,
17833   ctrlKey: null,
17834   shiftKey: null,
17835   getModifierState: getEventModifierState
17839  * @param {object} dispatchConfig Configuration used to dispatch this event.
17840  * @param {string} dispatchMarker Marker identifying the event target.
17841  * @param {object} nativeEvent Native browser event.
17842  * @extends {SyntheticUIEvent}
17843  */
17844 function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17845   return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17848 SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
17850 module.exports = SyntheticTouchEvent;
17851 },{"122":122,"137":137}],121:[function(_dereq_,module,exports){
17853  * Copyright 2013-present, Facebook, Inc.
17854  * All rights reserved.
17856  * This source code is licensed under the BSD-style license found in the
17857  * LICENSE file in the root directory of this source tree. An additional grant
17858  * of patent rights can be found in the PATENTS file in the same directory.
17860  * @providesModule SyntheticTransitionEvent
17861  */
17863 'use strict';
17865 var SyntheticEvent = _dereq_(115);
17868  * @interface Event
17869  * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
17870  * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
17871  */
17872 var TransitionEventInterface = {
17873   propertyName: null,
17874   elapsedTime: null,
17875   pseudoElement: null
17879  * @param {object} dispatchConfig Configuration used to dispatch this event.
17880  * @param {string} dispatchMarker Marker identifying the event target.
17881  * @param {object} nativeEvent Native browser event.
17882  * @extends {SyntheticEvent}
17883  */
17884 function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17885   return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17888 SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
17890 module.exports = SyntheticTransitionEvent;
17891 },{"115":115}],122:[function(_dereq_,module,exports){
17893  * Copyright 2013-present, Facebook, Inc.
17894  * All rights reserved.
17896  * This source code is licensed under the BSD-style license found in the
17897  * LICENSE file in the root directory of this source tree. An additional grant
17898  * of patent rights can be found in the PATENTS file in the same directory.
17900  * @providesModule SyntheticUIEvent
17901  */
17903 'use strict';
17905 var SyntheticEvent = _dereq_(115);
17907 var getEventTarget = _dereq_(138);
17910  * @interface UIEvent
17911  * @see http://www.w3.org/TR/DOM-Level-3-Events/
17912  */
17913 var UIEventInterface = {
17914   view: function (event) {
17915     if (event.view) {
17916       return event.view;
17917     }
17919     var target = getEventTarget(event);
17920     if (target != null && target.window === target) {
17921       // target is a window object
17922       return target;
17923     }
17925     var doc = target.ownerDocument;
17926     // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
17927     if (doc) {
17928       return doc.defaultView || doc.parentWindow;
17929     } else {
17930       return window;
17931     }
17932   },
17933   detail: function (event) {
17934     return event.detail || 0;
17935   }
17939  * @param {object} dispatchConfig Configuration used to dispatch this event.
17940  * @param {string} dispatchMarker Marker identifying the event target.
17941  * @param {object} nativeEvent Native browser event.
17942  * @extends {SyntheticEvent}
17943  */
17944 function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
17945   return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
17948 SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
17950 module.exports = SyntheticUIEvent;
17951 },{"115":115,"138":138}],123:[function(_dereq_,module,exports){
17953  * Copyright 2013-present, Facebook, Inc.
17954  * All rights reserved.
17956  * This source code is licensed under the BSD-style license found in the
17957  * LICENSE file in the root directory of this source tree. An additional grant
17958  * of patent rights can be found in the PATENTS file in the same directory.
17960  * @providesModule SyntheticWheelEvent
17961  */
17963 'use strict';
17965 var SyntheticMouseEvent = _dereq_(119);
17968  * @interface WheelEvent
17969  * @see http://www.w3.org/TR/DOM-Level-3-Events/
17970  */
17971 var WheelEventInterface = {
17972   deltaX: function (event) {
17973     return 'deltaX' in event ? event.deltaX :
17974     // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
17975     'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
17976   },
17977   deltaY: function (event) {
17978     return 'deltaY' in event ? event.deltaY :
17979     // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
17980     'wheelDeltaY' in event ? -event.wheelDeltaY :
17981     // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
17982     'wheelDelta' in event ? -event.wheelDelta : 0;
17983   },
17984   deltaZ: null,
17986   // Browsers without "deltaMode" is reporting in raw wheel delta where one
17987   // notch on the scroll is always +/- 120, roughly equivalent to pixels.
17988   // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
17989   // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
17990   deltaMode: null
17994  * @param {object} dispatchConfig Configuration used to dispatch this event.
17995  * @param {string} dispatchMarker Marker identifying the event target.
17996  * @param {object} nativeEvent Native browser event.
17997  * @extends {SyntheticMouseEvent}
17998  */
17999 function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18000   return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18003 SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
18005 module.exports = SyntheticWheelEvent;
18006 },{"119":119}],124:[function(_dereq_,module,exports){
18008  * Copyright 2013-present, Facebook, Inc.
18009  * All rights reserved.
18011  * This source code is licensed under the BSD-style license found in the
18012  * LICENSE file in the root directory of this source tree. An additional grant
18013  * of patent rights can be found in the PATENTS file in the same directory.
18015  * @providesModule Transaction
18016  */
18018 'use strict';
18020 var invariant = _dereq_(173);
18023  * `Transaction` creates a black box that is able to wrap any method such that
18024  * certain invariants are maintained before and after the method is invoked
18025  * (Even if an exception is thrown while invoking the wrapped method). Whoever
18026  * instantiates a transaction can provide enforcers of the invariants at
18027  * creation time. The `Transaction` class itself will supply one additional
18028  * automatic invariant for you - the invariant that any transaction instance
18029  * should not be run while it is already being run. You would typically create a
18030  * single instance of a `Transaction` for reuse multiple times, that potentially
18031  * is used to wrap several different methods. Wrappers are extremely simple -
18032  * they only require implementing two methods.
18034  * <pre>
18035  *                       wrappers (injected at creation time)
18036  *                                      +        +
18037  *                                      |        |
18038  *                    +-----------------|--------|--------------+
18039  *                    |                 v        |              |
18040  *                    |      +---------------+   |              |
18041  *                    |   +--|    wrapper1   |---|----+         |
18042  *                    |   |  +---------------+   v    |         |
18043  *                    |   |          +-------------+  |         |
18044  *                    |   |     +----|   wrapper2  |--------+   |
18045  *                    |   |     |    +-------------+  |     |   |
18046  *                    |   |     |                     |     |   |
18047  *                    |   v     v                     v     v   | wrapper
18048  *                    | +---+ +---+   +---------+   +---+ +---+ | invariants
18049  * perform(anyMethod) | |   | |   |   |         |   |   | |   | | maintained
18050  * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
18051  *                    | |   | |   |   |         |   |   | |   | |
18052  *                    | |   | |   |   |         |   |   | |   | |
18053  *                    | |   | |   |   |         |   |   | |   | |
18054  *                    | +---+ +---+   +---------+   +---+ +---+ |
18055  *                    |  initialize                    close    |
18056  *                    +-----------------------------------------+
18057  * </pre>
18059  * Use cases:
18060  * - Preserving the input selection ranges before/after reconciliation.
18061  *   Restoring selection even in the event of an unexpected error.
18062  * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
18063  *   while guaranteeing that afterwards, the event system is reactivated.
18064  * - Flushing a queue of collected DOM mutations to the main UI thread after a
18065  *   reconciliation takes place in a worker thread.
18066  * - Invoking any collected `componentDidUpdate` callbacks after rendering new
18067  *   content.
18068  * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
18069  *   to preserve the `scrollTop` (an automatic scroll aware DOM).
18070  * - (Future use case): Layout calculations before and after DOM updates.
18072  * Transactional plugin API:
18073  * - A module that has an `initialize` method that returns any precomputation.
18074  * - and a `close` method that accepts the precomputation. `close` is invoked
18075  *   when the wrapped process is completed, or has failed.
18077  * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
18078  * that implement `initialize` and `close`.
18079  * @return {Transaction} Single transaction for reuse in thread.
18081  * @class Transaction
18082  */
18083 var Mixin = {
18084   /**
18085    * Sets up this instance so that it is prepared for collecting metrics. Does
18086    * so such that this setup method may be used on an instance that is already
18087    * initialized, in a way that does not consume additional memory upon reuse.
18088    * That can be useful if you decide to make your subclass of this mixin a
18089    * "PooledClass".
18090    */
18091   reinitializeTransaction: function () {
18092     this.transactionWrappers = this.getTransactionWrappers();
18093     if (this.wrapperInitData) {
18094       this.wrapperInitData.length = 0;
18095     } else {
18096       this.wrapperInitData = [];
18097     }
18098     this._isInTransaction = false;
18099   },
18101   _isInTransaction: false,
18103   /**
18104    * @abstract
18105    * @return {Array<TransactionWrapper>} Array of transaction wrappers.
18106    */
18107   getTransactionWrappers: null,
18109   isInTransaction: function () {
18110     return !!this._isInTransaction;
18111   },
18113   /**
18114    * Executes the function within a safety window. Use this for the top level
18115    * methods that result in large amounts of computation/mutations that would
18116    * need to be safety checked. The optional arguments helps prevent the need
18117    * to bind in many cases.
18118    *
18119    * @param {function} method Member of scope to call.
18120    * @param {Object} scope Scope to invoke from.
18121    * @param {Object?=} a Argument to pass to the method.
18122    * @param {Object?=} b Argument to pass to the method.
18123    * @param {Object?=} c Argument to pass to the method.
18124    * @param {Object?=} d Argument to pass to the method.
18125    * @param {Object?=} e Argument to pass to the method.
18126    * @param {Object?=} f Argument to pass to the method.
18127    *
18128    * @return {*} Return value from `method`.
18129    */
18130   perform: function (method, scope, a, b, c, d, e, f) {
18131     !!this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there ' + 'is already an outstanding transaction.') : invariant(false) : void 0;
18132     var errorThrown;
18133     var ret;
18134     try {
18135       this._isInTransaction = true;
18136       // Catching errors makes debugging more difficult, so we start with
18137       // errorThrown set to true before setting it to false after calling
18138       // close -- if it's still set to true in the finally block, it means
18139       // one of these calls threw.
18140       errorThrown = true;
18141       this.initializeAll(0);
18142       ret = method.call(scope, a, b, c, d, e, f);
18143       errorThrown = false;
18144     } finally {
18145       try {
18146         if (errorThrown) {
18147           // If `method` throws, prefer to show that stack trace over any thrown
18148           // by invoking `closeAll`.
18149           try {
18150             this.closeAll(0);
18151           } catch (err) {}
18152         } else {
18153           // Since `method` didn't throw, we don't want to silence the exception
18154           // here.
18155           this.closeAll(0);
18156         }
18157       } finally {
18158         this._isInTransaction = false;
18159       }
18160     }
18161     return ret;
18162   },
18164   initializeAll: function (startIndex) {
18165     var transactionWrappers = this.transactionWrappers;
18166     for (var i = startIndex; i < transactionWrappers.length; i++) {
18167       var wrapper = transactionWrappers[i];
18168       try {
18169         // Catching errors makes debugging more difficult, so we start with the
18170         // OBSERVED_ERROR state before overwriting it with the real return value
18171         // of initialize -- if it's still set to OBSERVED_ERROR in the finally
18172         // block, it means wrapper.initialize threw.
18173         this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
18174         this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
18175       } finally {
18176         if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
18177           // The initializer for wrapper i threw an error; initialize the
18178           // remaining wrappers but silence any exceptions from them to ensure
18179           // that the first error is the one to bubble up.
18180           try {
18181             this.initializeAll(i + 1);
18182           } catch (err) {}
18183         }
18184       }
18185     }
18186   },
18188   /**
18189    * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
18190    * them the respective return values of `this.transactionWrappers.init[i]`
18191    * (`close`rs that correspond to initializers that failed will not be
18192    * invoked).
18193    */
18194   closeAll: function (startIndex) {
18195     !this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : invariant(false) : void 0;
18196     var transactionWrappers = this.transactionWrappers;
18197     for (var i = startIndex; i < transactionWrappers.length; i++) {
18198       var wrapper = transactionWrappers[i];
18199       var initData = this.wrapperInitData[i];
18200       var errorThrown;
18201       try {
18202         // Catching errors makes debugging more difficult, so we start with
18203         // errorThrown set to true before setting it to false after calling
18204         // close -- if it's still set to true in the finally block, it means
18205         // wrapper.close threw.
18206         errorThrown = true;
18207         if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
18208           wrapper.close.call(this, initData);
18209         }
18210         errorThrown = false;
18211       } finally {
18212         if (errorThrown) {
18213           // The closer for wrapper i threw an error; close the remaining
18214           // wrappers but silence any exceptions from them to ensure that the
18215           // first error is the one to bubble up.
18216           try {
18217             this.closeAll(i + 1);
18218           } catch (e) {}
18219         }
18220       }
18221     }
18222     this.wrapperInitData.length = 0;
18223   }
18226 var Transaction = {
18228   Mixin: Mixin,
18230   /**
18231    * Token to look for to determine if an error occurred.
18232    */
18233   OBSERVED_ERROR: {}
18237 module.exports = Transaction;
18238 },{"173":173}],125:[function(_dereq_,module,exports){
18240  * Copyright 2013-present, Facebook, Inc.
18241  * All rights reserved.
18243  * This source code is licensed under the BSD-style license found in the
18244  * LICENSE file in the root directory of this source tree. An additional grant
18245  * of patent rights can be found in the PATENTS file in the same directory.
18247  * @providesModule ViewportMetrics
18248  */
18250 'use strict';
18252 var ViewportMetrics = {
18254   currentScrollLeft: 0,
18256   currentScrollTop: 0,
18258   refreshScrollValues: function (scrollPosition) {
18259     ViewportMetrics.currentScrollLeft = scrollPosition.x;
18260     ViewportMetrics.currentScrollTop = scrollPosition.y;
18261   }
18265 module.exports = ViewportMetrics;
18266 },{}],126:[function(_dereq_,module,exports){
18268  * Copyright 2014-present, Facebook, Inc.
18269  * All rights reserved.
18271  * This source code is licensed under the BSD-style license found in the
18272  * LICENSE file in the root directory of this source tree. An additional grant
18273  * of patent rights can be found in the PATENTS file in the same directory.
18275  * @providesModule accumulateInto
18276  */
18278 'use strict';
18280 var invariant = _dereq_(173);
18284  * Accumulates items that must not be null or undefined into the first one. This
18285  * is used to conserve memory by avoiding array allocations, and thus sacrifices
18286  * API cleanness. Since `current` can be null before being passed in and not
18287  * null after this function, make sure to assign it back to `current`:
18289  * `a = accumulateInto(a, b);`
18291  * This API should be sparingly used. Try `accumulate` for something cleaner.
18293  * @return {*|array<*>} An accumulation of items.
18294  */
18296 function accumulateInto(current, next) {
18297   !(next != null) ? "development" !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : invariant(false) : void 0;
18298   if (current == null) {
18299     return next;
18300   }
18302   // Both are not empty. Warning: Never call x.concat(y) when you are not
18303   // certain that x is an Array (x could be a string with concat method).
18304   var currentIsArray = Array.isArray(current);
18305   var nextIsArray = Array.isArray(next);
18307   if (currentIsArray && nextIsArray) {
18308     current.push.apply(current, next);
18309     return current;
18310   }
18312   if (currentIsArray) {
18313     current.push(next);
18314     return current;
18315   }
18317   if (nextIsArray) {
18318     // A bit too dangerous to mutate `next`.
18319     return [current].concat(next);
18320   }
18322   return [current, next];
18325 module.exports = accumulateInto;
18326 },{"173":173}],127:[function(_dereq_,module,exports){
18328  * Copyright 2013-present, Facebook, Inc.
18329  * All rights reserved.
18331  * This source code is licensed under the BSD-style license found in the
18332  * LICENSE file in the root directory of this source tree. An additional grant
18333  * of patent rights can be found in the PATENTS file in the same directory.
18335  * @providesModule adler32
18336  */
18338 'use strict';
18340 var MOD = 65521;
18342 // adler32 is not cryptographically strong, and is only used to sanity check that
18343 // markup generated on the server matches the markup generated on the client.
18344 // This implementation (a modified version of the SheetJS version) has been optimized
18345 // for our use case, at the expense of conforming to the adler32 specification
18346 // for non-ascii inputs.
18347 function adler32(data) {
18348   var a = 1;
18349   var b = 0;
18350   var i = 0;
18351   var l = data.length;
18352   var m = l & ~0x3;
18353   while (i < m) {
18354     var n = Math.min(i + 4096, m);
18355     for (; i < n; i += 4) {
18356       b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
18357     }
18358     a %= MOD;
18359     b %= MOD;
18360   }
18361   for (; i < l; i++) {
18362     b += a += data.charCodeAt(i);
18363   }
18364   a %= MOD;
18365   b %= MOD;
18366   return a | b << 16;
18369 module.exports = adler32;
18370 },{}],128:[function(_dereq_,module,exports){
18372  * Copyright 2013-present, Facebook, Inc.
18373  * All rights reserved.
18375  * This source code is licensed under the BSD-style license found in the
18376  * LICENSE file in the root directory of this source tree. An additional grant
18377  * of patent rights can be found in the PATENTS file in the same directory.
18379  * @providesModule canDefineProperty
18380  */
18382 'use strict';
18384 var canDefineProperty = false;
18385 if ("development" !== 'production') {
18386   try {
18387     Object.defineProperty({}, 'x', { get: function () {} });
18388     canDefineProperty = true;
18389   } catch (x) {
18390     // IE will fail on defineProperty
18391   }
18394 module.exports = canDefineProperty;
18395 },{}],129:[function(_dereq_,module,exports){
18397  * Copyright 2013-present, Facebook, Inc.
18398  * All rights reserved.
18400  * This source code is licensed under the BSD-style license found in the
18401  * LICENSE file in the root directory of this source tree. An additional grant
18402  * of patent rights can be found in the PATENTS file in the same directory.
18404  * @providesModule createMicrosoftUnsafeLocalFunction
18405  */
18407 /* globals MSApp */
18409 'use strict';
18412  * Create a function which has 'unsafe' privileges (required by windows8 apps)
18413  */
18415 var createMicrosoftUnsafeLocalFunction = function (func) {
18416   if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
18417     return function (arg0, arg1, arg2, arg3) {
18418       MSApp.execUnsafeLocalFunction(function () {
18419         return func(arg0, arg1, arg2, arg3);
18420       });
18421     };
18422   } else {
18423     return func;
18424   }
18427 module.exports = createMicrosoftUnsafeLocalFunction;
18428 },{}],130:[function(_dereq_,module,exports){
18430  * Copyright 2013-present, Facebook, Inc.
18431  * All rights reserved.
18433  * This source code is licensed under the BSD-style license found in the
18434  * LICENSE file in the root directory of this source tree. An additional grant
18435  * of patent rights can be found in the PATENTS file in the same directory.
18437  * @providesModule dangerousStyleValue
18438  */
18440 'use strict';
18442 var CSSProperty = _dereq_(3);
18443 var warning = _dereq_(183);
18445 var isUnitlessNumber = CSSProperty.isUnitlessNumber;
18446 var styleWarnings = {};
18449  * Convert a value into the proper css writable value. The style name `name`
18450  * should be logical (no hyphens), as specified
18451  * in `CSSProperty.isUnitlessNumber`.
18453  * @param {string} name CSS property name such as `topMargin`.
18454  * @param {*} value CSS property value such as `10px`.
18455  * @param {ReactDOMComponent} component
18456  * @return {string} Normalized style value with dimensions applied.
18457  */
18458 function dangerousStyleValue(name, value, component) {
18459   // Note that we've removed escapeTextForBrowser() calls here since the
18460   // whole string will be escaped when the attribute is injected into
18461   // the markup. If you provide unsafe user data here they can inject
18462   // arbitrary CSS which may be problematic (I couldn't repro this):
18463   // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
18464   // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
18465   // This is not an XSS hole but instead a potential CSS injection issue
18466   // which has lead to a greater discussion about how we're going to
18467   // trust URLs moving forward. See #2115901
18469   var isEmpty = value == null || typeof value === 'boolean' || value === '';
18470   if (isEmpty) {
18471     return '';
18472   }
18474   var isNonNumeric = isNaN(value);
18475   if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
18476     return '' + value; // cast to string
18477   }
18479   if (typeof value === 'string') {
18480     if ("development" !== 'production') {
18481       if (component) {
18482         var owner = component._currentElement._owner;
18483         var ownerName = owner ? owner.getName() : null;
18484         if (ownerName && !styleWarnings[ownerName]) {
18485           styleWarnings[ownerName] = {};
18486         }
18487         var warned = false;
18488         if (ownerName) {
18489           var warnings = styleWarnings[ownerName];
18490           warned = warnings[name];
18491           if (!warned) {
18492             warnings[name] = true;
18493           }
18494         }
18495         if (!warned) {
18496           "development" !== 'production' ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0;
18497         }
18498       }
18499     }
18500     value = value.trim();
18501   }
18502   return value + 'px';
18505 module.exports = dangerousStyleValue;
18506 },{"183":183,"3":3}],131:[function(_dereq_,module,exports){
18508  * Copyright 2013-present, Facebook, Inc.
18509  * All rights reserved.
18511  * This source code is licensed under the BSD-style license found in the
18512  * LICENSE file in the root directory of this source tree. An additional grant
18513  * of patent rights can be found in the PATENTS file in the same directory.
18515  * @providesModule escapeTextContentForBrowser
18516  */
18518 'use strict';
18520 var ESCAPE_LOOKUP = {
18521   '&': '&amp;',
18522   '>': '&gt;',
18523   '<': '&lt;',
18524   '"': '&quot;',
18525   '\'': '&#x27;'
18528 var ESCAPE_REGEX = /[&><"']/g;
18530 function escaper(match) {
18531   return ESCAPE_LOOKUP[match];
18535  * Escapes text to prevent scripting attacks.
18537  * @param {*} text Text value to escape.
18538  * @return {string} An escaped string.
18539  */
18540 function escapeTextContentForBrowser(text) {
18541   return ('' + text).replace(ESCAPE_REGEX, escaper);
18544 module.exports = escapeTextContentForBrowser;
18545 },{}],132:[function(_dereq_,module,exports){
18547  * Copyright 2013-present, Facebook, Inc.
18548  * All rights reserved.
18550  * This source code is licensed under the BSD-style license found in the
18551  * LICENSE file in the root directory of this source tree. An additional grant
18552  * of patent rights can be found in the PATENTS file in the same directory.
18554  * @providesModule findDOMNode
18555  */
18557 'use strict';
18559 var ReactCurrentOwner = _dereq_(40);
18560 var ReactDOMComponentTree = _dereq_(45);
18561 var ReactInstanceMap = _dereq_(75);
18563 var getNativeComponentFromComposite = _dereq_(140);
18564 var invariant = _dereq_(173);
18565 var warning = _dereq_(183);
18568  * Returns the DOM node rendered by this element.
18570  * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
18572  * @param {ReactComponent|DOMElement} componentOrElement
18573  * @return {?DOMElement} The root node of this element.
18574  */
18575 function findDOMNode(componentOrElement) {
18576   if ("development" !== 'production') {
18577     var owner = ReactCurrentOwner.current;
18578     if (owner !== null) {
18579       "development" !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing 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') : void 0;
18580       owner._warnedAboutRefsInRender = true;
18581     }
18582   }
18583   if (componentOrElement == null) {
18584     return null;
18585   }
18586   if (componentOrElement.nodeType === 1) {
18587     return componentOrElement;
18588   }
18590   var inst = ReactInstanceMap.get(componentOrElement);
18591   if (inst) {
18592     inst = getNativeComponentFromComposite(inst);
18593     return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
18594   }
18596   if (typeof componentOrElement.render === 'function') {
18597     !false ? "development" !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : invariant(false) : void 0;
18598   } else {
18599     !false ? "development" !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : invariant(false) : void 0;
18600   }
18603 module.exports = findDOMNode;
18604 },{"140":140,"173":173,"183":183,"40":40,"45":45,"75":75}],133:[function(_dereq_,module,exports){
18606  * Copyright 2013-present, Facebook, Inc.
18607  * All rights reserved.
18609  * This source code is licensed under the BSD-style license found in the
18610  * LICENSE file in the root directory of this source tree. An additional grant
18611  * of patent rights can be found in the PATENTS file in the same directory.
18613  * @providesModule flattenChildren
18614  */
18616 'use strict';
18618 var KeyEscapeUtils = _dereq_(23);
18619 var traverseAllChildren = _dereq_(154);
18620 var warning = _dereq_(183);
18623  * @param {function} traverseContext Context passed through traversal.
18624  * @param {?ReactComponent} child React child component.
18625  * @param {!string} name String name of key path to child.
18626  */
18627 function flattenSingleChildIntoContext(traverseContext, child, name) {
18628   // We found a component instance.
18629   var result = traverseContext;
18630   var keyUnique = result[name] === undefined;
18631   if ("development" !== 'production') {
18632     "development" !== '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.', KeyEscapeUtils.unescape(name)) : void 0;
18633   }
18634   if (keyUnique && child != null) {
18635     result[name] = child;
18636   }
18640  * Flattens children that are typically specified as `props.children`. Any null
18641  * children will not be included in the resulting object.
18642  * @return {!object} flattened children keyed by name.
18643  */
18644 function flattenChildren(children) {
18645   if (children == null) {
18646     return children;
18647   }
18648   var result = {};
18649   traverseAllChildren(children, flattenSingleChildIntoContext, result);
18650   return result;
18653 module.exports = flattenChildren;
18654 },{"154":154,"183":183,"23":23}],134:[function(_dereq_,module,exports){
18656  * Copyright 2013-present, Facebook, Inc.
18657  * All rights reserved.
18659  * This source code is licensed under the BSD-style license found in the
18660  * LICENSE file in the root directory of this source tree. An additional grant
18661  * of patent rights can be found in the PATENTS file in the same directory.
18663  * @providesModule forEachAccumulated
18664  */
18666 'use strict';
18669  * @param {array} arr an "accumulation" of items which is either an Array or
18670  * a single item. Useful when paired with the `accumulate` module. This is a
18671  * simple utility that allows us to reason about a collection of items, but
18672  * handling the case when there is exactly one item (and we do not need to
18673  * allocate an array).
18674  */
18676 var forEachAccumulated = function (arr, cb, scope) {
18677   if (Array.isArray(arr)) {
18678     arr.forEach(cb, scope);
18679   } else if (arr) {
18680     cb.call(scope, arr);
18681   }
18684 module.exports = forEachAccumulated;
18685 },{}],135:[function(_dereq_,module,exports){
18687  * Copyright 2013-present, Facebook, Inc.
18688  * All rights reserved.
18690  * This source code is licensed under the BSD-style license found in the
18691  * LICENSE file in the root directory of this source tree. An additional grant
18692  * of patent rights can be found in the PATENTS file in the same directory.
18694  * @providesModule getEventCharCode
18695  */
18697 'use strict';
18700  * `charCode` represents the actual "character code" and is safe to use with
18701  * `String.fromCharCode`. As such, only keys that correspond to printable
18702  * characters produce a valid `charCode`, the only exception to this is Enter.
18703  * The Tab-key is considered non-printable and does not have a `charCode`,
18704  * presumably because it does not produce a tab-character in browsers.
18706  * @param {object} nativeEvent Native browser event.
18707  * @return {number} Normalized `charCode` property.
18708  */
18710 function getEventCharCode(nativeEvent) {
18711   var charCode;
18712   var keyCode = nativeEvent.keyCode;
18714   if ('charCode' in nativeEvent) {
18715     charCode = nativeEvent.charCode;
18717     // FF does not set `charCode` for the Enter-key, check against `keyCode`.
18718     if (charCode === 0 && keyCode === 13) {
18719       charCode = 13;
18720     }
18721   } else {
18722     // IE8 does not implement `charCode`, but `keyCode` has the correct value.
18723     charCode = keyCode;
18724   }
18726   // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
18727   // Must not discard the (non-)printable Enter-key.
18728   if (charCode >= 32 || charCode === 13) {
18729     return charCode;
18730   }
18732   return 0;
18735 module.exports = getEventCharCode;
18736 },{}],136:[function(_dereq_,module,exports){
18738  * Copyright 2013-present, Facebook, Inc.
18739  * All rights reserved.
18741  * This source code is licensed under the BSD-style license found in the
18742  * LICENSE file in the root directory of this source tree. An additional grant
18743  * of patent rights can be found in the PATENTS file in the same directory.
18745  * @providesModule getEventKey
18746  */
18748 'use strict';
18750 var getEventCharCode = _dereq_(135);
18753  * Normalization of deprecated HTML5 `key` values
18754  * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
18755  */
18756 var normalizeKey = {
18757   'Esc': 'Escape',
18758   'Spacebar': ' ',
18759   'Left': 'ArrowLeft',
18760   'Up': 'ArrowUp',
18761   'Right': 'ArrowRight',
18762   'Down': 'ArrowDown',
18763   'Del': 'Delete',
18764   'Win': 'OS',
18765   'Menu': 'ContextMenu',
18766   'Apps': 'ContextMenu',
18767   'Scroll': 'ScrollLock',
18768   'MozPrintableKey': 'Unidentified'
18772  * Translation from legacy `keyCode` to HTML5 `key`
18773  * Only special keys supported, all others depend on keyboard layout or browser
18774  * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
18775  */
18776 var translateToKey = {
18777   8: 'Backspace',
18778   9: 'Tab',
18779   12: 'Clear',
18780   13: 'Enter',
18781   16: 'Shift',
18782   17: 'Control',
18783   18: 'Alt',
18784   19: 'Pause',
18785   20: 'CapsLock',
18786   27: 'Escape',
18787   32: ' ',
18788   33: 'PageUp',
18789   34: 'PageDown',
18790   35: 'End',
18791   36: 'Home',
18792   37: 'ArrowLeft',
18793   38: 'ArrowUp',
18794   39: 'ArrowRight',
18795   40: 'ArrowDown',
18796   45: 'Insert',
18797   46: 'Delete',
18798   112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
18799   118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
18800   144: 'NumLock',
18801   145: 'ScrollLock',
18802   224: 'Meta'
18806  * @param {object} nativeEvent Native browser event.
18807  * @return {string} Normalized `key` property.
18808  */
18809 function getEventKey(nativeEvent) {
18810   if (nativeEvent.key) {
18811     // Normalize inconsistent values reported by browsers due to
18812     // implementations of a working draft specification.
18814     // FireFox implements `key` but returns `MozPrintableKey` for all
18815     // printable characters (normalized to `Unidentified`), ignore it.
18816     var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
18817     if (key !== 'Unidentified') {
18818       return key;
18819     }
18820   }
18822   // Browser does not implement `key`, polyfill as much of it as we can.
18823   if (nativeEvent.type === 'keypress') {
18824     var charCode = getEventCharCode(nativeEvent);
18826     // The enter-key is technically both printable and non-printable and can
18827     // thus be captured by `keypress`, no other non-printable key should.
18828     return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
18829   }
18830   if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
18831     // While user keyboard layout determines the actual meaning of each
18832     // `keyCode` value, almost all function keys have a universal value.
18833     return translateToKey[nativeEvent.keyCode] || 'Unidentified';
18834   }
18835   return '';
18838 module.exports = getEventKey;
18839 },{"135":135}],137:[function(_dereq_,module,exports){
18841  * Copyright 2013-present, Facebook, Inc.
18842  * All rights reserved.
18844  * This source code is licensed under the BSD-style license found in the
18845  * LICENSE file in the root directory of this source tree. An additional grant
18846  * of patent rights can be found in the PATENTS file in the same directory.
18848  * @providesModule getEventModifierState
18849  */
18851 'use strict';
18854  * Translation from modifier key to the associated property in the event.
18855  * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
18856  */
18858 var modifierKeyToProp = {
18859   'Alt': 'altKey',
18860   'Control': 'ctrlKey',
18861   'Meta': 'metaKey',
18862   'Shift': 'shiftKey'
18865 // IE8 does not implement getModifierState so we simply map it to the only
18866 // modifier keys exposed by the event itself, does not support Lock-keys.
18867 // Currently, all major browsers except Chrome seems to support Lock-keys.
18868 function modifierStateGetter(keyArg) {
18869   var syntheticEvent = this;
18870   var nativeEvent = syntheticEvent.nativeEvent;
18871   if (nativeEvent.getModifierState) {
18872     return nativeEvent.getModifierState(keyArg);
18873   }
18874   var keyProp = modifierKeyToProp[keyArg];
18875   return keyProp ? !!nativeEvent[keyProp] : false;
18878 function getEventModifierState(nativeEvent) {
18879   return modifierStateGetter;
18882 module.exports = getEventModifierState;
18883 },{}],138:[function(_dereq_,module,exports){
18885  * Copyright 2013-present, Facebook, Inc.
18886  * All rights reserved.
18888  * This source code is licensed under the BSD-style license found in the
18889  * LICENSE file in the root directory of this source tree. An additional grant
18890  * of patent rights can be found in the PATENTS file in the same directory.
18892  * @providesModule getEventTarget
18893  */
18895 'use strict';
18898  * Gets the target node from a native browser event by accounting for
18899  * inconsistencies in browser DOM APIs.
18901  * @param {object} nativeEvent Native browser event.
18902  * @return {DOMEventTarget} Target node.
18903  */
18905 function getEventTarget(nativeEvent) {
18906   var target = nativeEvent.target || nativeEvent.srcElement || window;
18908   // Normalize SVG <use> element events #4963
18909   if (target.correspondingUseElement) {
18910     target = target.correspondingUseElement;
18911   }
18913   // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
18914   // @see http://www.quirksmode.org/js/events_properties.html
18915   return target.nodeType === 3 ? target.parentNode : target;
18918 module.exports = getEventTarget;
18919 },{}],139:[function(_dereq_,module,exports){
18921  * Copyright 2013-present, Facebook, Inc.
18922  * All rights reserved.
18924  * This source code is licensed under the BSD-style license found in the
18925  * LICENSE file in the root directory of this source tree. An additional grant
18926  * of patent rights can be found in the PATENTS file in the same directory.
18928  * @providesModule getIteratorFn
18929  */
18931 'use strict';
18933 /* global Symbol */
18935 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
18936 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
18939  * Returns the iterator method function contained on the iterable object.
18941  * Be sure to invoke the function with the iterable as context:
18943  *     var iteratorFn = getIteratorFn(myIterable);
18944  *     if (iteratorFn) {
18945  *       var iterator = iteratorFn.call(myIterable);
18946  *       ...
18947  *     }
18949  * @param {?object} maybeIterable
18950  * @return {?function}
18951  */
18952 function getIteratorFn(maybeIterable) {
18953   var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
18954   if (typeof iteratorFn === 'function') {
18955     return iteratorFn;
18956   }
18959 module.exports = getIteratorFn;
18960 },{}],140:[function(_dereq_,module,exports){
18962  * Copyright 2013-present, Facebook, Inc.
18963  * All rights reserved.
18965  * This source code is licensed under the BSD-style license found in the
18966  * LICENSE file in the root directory of this source tree. An additional grant
18967  * of patent rights can be found in the PATENTS file in the same directory.
18969  * @providesModule getNativeComponentFromComposite
18970  */
18972 'use strict';
18974 var ReactNodeTypes = _dereq_(85);
18976 function getNativeComponentFromComposite(inst) {
18977   var type;
18979   while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
18980     inst = inst._renderedComponent;
18981   }
18983   if (type === ReactNodeTypes.NATIVE) {
18984     return inst._renderedComponent;
18985   } else if (type === ReactNodeTypes.EMPTY) {
18986     return null;
18987   }
18990 module.exports = getNativeComponentFromComposite;
18991 },{"85":85}],141:[function(_dereq_,module,exports){
18993  * Copyright 2013-present, Facebook, Inc.
18994  * All rights reserved.
18996  * This source code is licensed under the BSD-style license found in the
18997  * LICENSE file in the root directory of this source tree. An additional grant
18998  * of patent rights can be found in the PATENTS file in the same directory.
19000  * @providesModule getNodeForCharacterOffset
19001  */
19003 'use strict';
19006  * Given any node return the first leaf node without children.
19008  * @param {DOMElement|DOMTextNode} node
19009  * @return {DOMElement|DOMTextNode}
19010  */
19012 function getLeafNode(node) {
19013   while (node && node.firstChild) {
19014     node = node.firstChild;
19015   }
19016   return node;
19020  * Get the next sibling within a container. This will walk up the
19021  * DOM if a node's siblings have been exhausted.
19023  * @param {DOMElement|DOMTextNode} node
19024  * @return {?DOMElement|DOMTextNode}
19025  */
19026 function getSiblingNode(node) {
19027   while (node) {
19028     if (node.nextSibling) {
19029       return node.nextSibling;
19030     }
19031     node = node.parentNode;
19032   }
19036  * Get object describing the nodes which contain characters at offset.
19038  * @param {DOMElement|DOMTextNode} root
19039  * @param {number} offset
19040  * @return {?object}
19041  */
19042 function getNodeForCharacterOffset(root, offset) {
19043   var node = getLeafNode(root);
19044   var nodeStart = 0;
19045   var nodeEnd = 0;
19047   while (node) {
19048     if (node.nodeType === 3) {
19049       nodeEnd = nodeStart + node.textContent.length;
19051       if (nodeStart <= offset && nodeEnd >= offset) {
19052         return {
19053           node: node,
19054           offset: offset - nodeStart
19055         };
19056       }
19058       nodeStart = nodeEnd;
19059     }
19061     node = getLeafNode(getSiblingNode(node));
19062   }
19065 module.exports = getNodeForCharacterOffset;
19066 },{}],142:[function(_dereq_,module,exports){
19068  * Copyright 2013-present, Facebook, Inc.
19069  * All rights reserved.
19071  * This source code is licensed under the BSD-style license found in the
19072  * LICENSE file in the root directory of this source tree. An additional grant
19073  * of patent rights can be found in the PATENTS file in the same directory.
19075  * @providesModule getTextContentAccessor
19076  */
19078 'use strict';
19080 var ExecutionEnvironment = _dereq_(159);
19082 var contentKey = null;
19085  * Gets the key used to access text content on a DOM node.
19087  * @return {?string} Key used to access text content.
19088  * @internal
19089  */
19090 function getTextContentAccessor() {
19091   if (!contentKey && ExecutionEnvironment.canUseDOM) {
19092     // Prefer textContent to innerText because many browsers support both but
19093     // SVG <text> elements don't support innerText even when <div> does.
19094     contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
19095   }
19096   return contentKey;
19099 module.exports = getTextContentAccessor;
19100 },{"159":159}],143:[function(_dereq_,module,exports){
19102  * Copyright 2013-present, Facebook, Inc.
19103  * All rights reserved.
19105  * This source code is licensed under the BSD-style license found in the
19106  * LICENSE file in the root directory of this source tree. An additional grant
19107  * of patent rights can be found in the PATENTS file in the same directory.
19109  * @providesModule getVendorPrefixedEventName
19110  */
19112 'use strict';
19114 var ExecutionEnvironment = _dereq_(159);
19117  * Generate a mapping of standard vendor prefixes using the defined style property and event name.
19119  * @param {string} styleProp
19120  * @param {string} eventName
19121  * @returns {object}
19122  */
19123 function makePrefixMap(styleProp, eventName) {
19124   var prefixes = {};
19126   prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
19127   prefixes['Webkit' + styleProp] = 'webkit' + eventName;
19128   prefixes['Moz' + styleProp] = 'moz' + eventName;
19129   prefixes['ms' + styleProp] = 'MS' + eventName;
19130   prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
19132   return prefixes;
19136  * A list of event names to a configurable list of vendor prefixes.
19137  */
19138 var vendorPrefixes = {
19139   animationend: makePrefixMap('Animation', 'AnimationEnd'),
19140   animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
19141   animationstart: makePrefixMap('Animation', 'AnimationStart'),
19142   transitionend: makePrefixMap('Transition', 'TransitionEnd')
19146  * Event names that have already been detected and prefixed (if applicable).
19147  */
19148 var prefixedEventNames = {};
19151  * Element to check for prefixes on.
19152  */
19153 var style = {};
19156  * Bootstrap if a DOM exists.
19157  */
19158 if (ExecutionEnvironment.canUseDOM) {
19159   style = document.createElement('div').style;
19161   // On some platforms, in particular some releases of Android 4.x,
19162   // the un-prefixed "animation" and "transition" properties are defined on the
19163   // style object but the events that fire will still be prefixed, so we need
19164   // to check if the un-prefixed events are usable, and if not remove them from the map.
19165   if (!('AnimationEvent' in window)) {
19166     delete vendorPrefixes.animationend.animation;
19167     delete vendorPrefixes.animationiteration.animation;
19168     delete vendorPrefixes.animationstart.animation;
19169   }
19171   // Same as above
19172   if (!('TransitionEvent' in window)) {
19173     delete vendorPrefixes.transitionend.transition;
19174   }
19178  * Attempts to determine the correct vendor prefixed event name.
19180  * @param {string} eventName
19181  * @returns {string}
19182  */
19183 function getVendorPrefixedEventName(eventName) {
19184   if (prefixedEventNames[eventName]) {
19185     return prefixedEventNames[eventName];
19186   } else if (!vendorPrefixes[eventName]) {
19187     return eventName;
19188   }
19190   var prefixMap = vendorPrefixes[eventName];
19192   for (var styleProp in prefixMap) {
19193     if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
19194       return prefixedEventNames[eventName] = prefixMap[styleProp];
19195     }
19196   }
19198   return '';
19201 module.exports = getVendorPrefixedEventName;
19202 },{"159":159}],144:[function(_dereq_,module,exports){
19204  * Copyright 2013-present, Facebook, Inc.
19205  * All rights reserved.
19207  * This source code is licensed under the BSD-style license found in the
19208  * LICENSE file in the root directory of this source tree. An additional grant
19209  * of patent rights can be found in the PATENTS file in the same directory.
19211  * @providesModule instantiateReactComponent
19212  */
19214 'use strict';
19216 var _assign = _dereq_(184);
19218 var ReactCompositeComponent = _dereq_(39);
19219 var ReactEmptyComponent = _dereq_(67);
19220 var ReactNativeComponent = _dereq_(83);
19221 var ReactInstrumentation = _dereq_(76);
19223 var invariant = _dereq_(173);
19224 var warning = _dereq_(183);
19226 // To avoid a cyclic dependency, we create the final class in this module
19227 var ReactCompositeComponentWrapper = function (element) {
19228   this.construct(element);
19230 _assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
19231   _instantiateReactComponent: instantiateReactComponent
19234 function getDeclarationErrorAddendum(owner) {
19235   if (owner) {
19236     var name = owner.getName();
19237     if (name) {
19238       return ' Check the render method of `' + name + '`.';
19239     }
19240   }
19241   return '';
19244 function getDisplayName(instance) {
19245   var element = instance._currentElement;
19246   if (element == null) {
19247     return '#empty';
19248   } else if (typeof element === 'string' || typeof element === 'number') {
19249     return '#text';
19250   } else if (typeof element.type === 'string') {
19251     return element.type;
19252   } else if (instance.getName) {
19253     return instance.getName() || 'Unknown';
19254   } else {
19255     return element.type.displayName || element.type.name || 'Unknown';
19256   }
19260  * Check if the type reference is a known internal type. I.e. not a user
19261  * provided composite type.
19263  * @param {function} type
19264  * @return {boolean} Returns true if this is a valid internal type.
19265  */
19266 function isInternalComponentType(type) {
19267   return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
19270 var nextDebugID = 1;
19273  * Given a ReactNode, create an instance that will actually be mounted.
19275  * @param {ReactNode} node
19276  * @return {object} A new instance of the element's constructor.
19277  * @protected
19278  */
19279 function instantiateReactComponent(node) {
19280   var instance;
19282   var isEmpty = node === null || node === false;
19283   if (isEmpty) {
19284     instance = ReactEmptyComponent.create(instantiateReactComponent);
19285   } else if (typeof node === 'object') {
19286     var element = node;
19287     !(element && (typeof element.type === 'function' || typeof element.type === 'string')) ? "development" !== '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) : void 0;
19289     // Special case string values
19290     if (typeof element.type === 'string') {
19291       instance = ReactNativeComponent.createInternalComponent(element);
19292     } else if (isInternalComponentType(element.type)) {
19293       // This is temporarily available for custom components that are not string
19294       // representations. I.e. ART. Once those are updated to use the string
19295       // representation, we can drop this code path.
19296       instance = new element.type(element);
19297     } else {
19298       instance = new ReactCompositeComponentWrapper(element);
19299     }
19300   } else if (typeof node === 'string' || typeof node === 'number') {
19301     instance = ReactNativeComponent.createInstanceForText(node);
19302   } else {
19303     !false ? "development" !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false) : void 0;
19304   }
19306   if ("development" !== 'production') {
19307     "development" !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getNativeNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;
19308   }
19310   // These two fields are used by the DOM and ART diffing algorithms
19311   // respectively. Instead of using expandos on components, we should be
19312   // storing the state needed by the diffing algorithms elsewhere.
19313   instance._mountIndex = 0;
19314   instance._mountImage = null;
19316   if ("development" !== 'production') {
19317     instance._isOwnerNecessary = false;
19318     instance._warnedAboutRefsInRender = false;
19319   }
19321   if ("development" !== 'production') {
19322     var debugID = isEmpty ? 0 : nextDebugID++;
19323     instance._debugID = debugID;
19325     if (debugID !== 0) {
19326       var displayName = getDisplayName(instance);
19327       ReactInstrumentation.debugTool.onSetDisplayName(debugID, displayName);
19328       var owner = node && node._owner;
19329       if (owner) {
19330         ReactInstrumentation.debugTool.onSetOwner(debugID, owner._debugID);
19331       }
19332     }
19333   }
19335   // Internal instances should fully constructed at this point, so they should
19336   // not get any new fields added to them at this point.
19337   if ("development" !== 'production') {
19338     if (Object.preventExtensions) {
19339       Object.preventExtensions(instance);
19340     }
19341   }
19343   return instance;
19346 module.exports = instantiateReactComponent;
19347 },{"173":173,"183":183,"184":184,"39":39,"67":67,"76":76,"83":83}],145:[function(_dereq_,module,exports){
19349  * Copyright 2013-present, Facebook, Inc.
19350  * All rights reserved.
19352  * This source code is licensed under the BSD-style license found in the
19353  * LICENSE file in the root directory of this source tree. An additional grant
19354  * of patent rights can be found in the PATENTS file in the same directory.
19356  * @providesModule isEventSupported
19357  */
19359 'use strict';
19361 var ExecutionEnvironment = _dereq_(159);
19363 var useHasFeature;
19364 if (ExecutionEnvironment.canUseDOM) {
19365   useHasFeature = document.implementation && document.implementation.hasFeature &&
19366   // always returns true in newer browsers as per the standard.
19367   // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
19368   document.implementation.hasFeature('', '') !== true;
19372  * Checks if an event is supported in the current execution environment.
19374  * NOTE: This will not work correctly for non-generic events such as `change`,
19375  * `reset`, `load`, `error`, and `select`.
19377  * Borrows from Modernizr.
19379  * @param {string} eventNameSuffix Event name, e.g. "click".
19380  * @param {?boolean} capture Check if the capture phase is supported.
19381  * @return {boolean} True if the event is supported.
19382  * @internal
19383  * @license Modernizr 3.0.0pre (Custom Build) | MIT
19384  */
19385 function isEventSupported(eventNameSuffix, capture) {
19386   if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
19387     return false;
19388   }
19390   var eventName = 'on' + eventNameSuffix;
19391   var isSupported = eventName in document;
19393   if (!isSupported) {
19394     var element = document.createElement('div');
19395     element.setAttribute(eventName, 'return;');
19396     isSupported = typeof element[eventName] === 'function';
19397   }
19399   if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
19400     // This is the only way to test support for the `wheel` event in IE9+.
19401     isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
19402   }
19404   return isSupported;
19407 module.exports = isEventSupported;
19408 },{"159":159}],146:[function(_dereq_,module,exports){
19410  * Copyright 2013-present, Facebook, Inc.
19411  * All rights reserved.
19413  * This source code is licensed under the BSD-style license found in the
19414  * LICENSE file in the root directory of this source tree. An additional grant
19415  * of patent rights can be found in the PATENTS file in the same directory.
19417  * @providesModule isTextInputElement
19418  */
19420 'use strict';
19423  * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
19424  */
19426 var supportedInputTypes = {
19427   'color': true,
19428   'date': true,
19429   'datetime': true,
19430   'datetime-local': true,
19431   'email': true,
19432   'month': true,
19433   'number': true,
19434   'password': true,
19435   'range': true,
19436   'search': true,
19437   'tel': true,
19438   'text': true,
19439   'time': true,
19440   'url': true,
19441   'week': true
19444 function isTextInputElement(elem) {
19445   var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
19446   return nodeName && (nodeName === 'input' && supportedInputTypes[elem.type] || nodeName === 'textarea');
19449 module.exports = isTextInputElement;
19450 },{}],147:[function(_dereq_,module,exports){
19452  * Copyright 2013-present, Facebook, Inc.
19453  * All rights reserved.
19455  * This source code is licensed under the BSD-style license found in the
19456  * LICENSE file in the root directory of this source tree. An additional grant
19457  * of patent rights can be found in the PATENTS file in the same directory.
19459  * @providesModule onlyChild
19460  */
19461 'use strict';
19463 var ReactElement = _dereq_(65);
19465 var invariant = _dereq_(173);
19468  * Returns the first child in a collection of children and verifies that there
19469  * is only one child in the collection.
19471  * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
19473  * The current implementation of this function assumes that a single child gets
19474  * passed without a wrapper, but the purpose of this helper function is to
19475  * abstract away the particular structure of children.
19477  * @param {?object} children Child collection structure.
19478  * @return {ReactElement} The first and only `ReactElement` contained in the
19479  * structure.
19480  */
19481 function onlyChild(children) {
19482   !ReactElement.isValidElement(children) ? "development" !== 'production' ? invariant(false, 'onlyChild must be passed a children with exactly one child.') : invariant(false) : void 0;
19483   return children;
19486 module.exports = onlyChild;
19487 },{"173":173,"65":65}],148:[function(_dereq_,module,exports){
19489  * Copyright 2013-present, Facebook, Inc.
19490  * All rights reserved.
19492  * This source code is licensed under the BSD-style license found in the
19493  * LICENSE file in the root directory of this source tree. An additional grant
19494  * of patent rights can be found in the PATENTS file in the same directory.
19496  * @providesModule quoteAttributeValueForBrowser
19497  */
19499 'use strict';
19501 var escapeTextContentForBrowser = _dereq_(131);
19504  * Escapes attribute value to prevent scripting attacks.
19506  * @param {*} value Value to escape.
19507  * @return {string} An escaped string.
19508  */
19509 function quoteAttributeValueForBrowser(value) {
19510   return '"' + escapeTextContentForBrowser(value) + '"';
19513 module.exports = quoteAttributeValueForBrowser;
19514 },{"131":131}],149:[function(_dereq_,module,exports){
19516  * Copyright 2013-present, Facebook, Inc.
19517  * All rights reserved.
19519  * This source code is licensed under the BSD-style license found in the
19520  * LICENSE file in the root directory of this source tree. An additional grant
19521  * of patent rights can be found in the PATENTS file in the same directory.
19523 * @providesModule renderSubtreeIntoContainer
19526 'use strict';
19528 var ReactMount = _dereq_(80);
19530 module.exports = ReactMount.renderSubtreeIntoContainer;
19531 },{"80":80}],150:[function(_dereq_,module,exports){
19533  * Copyright 2013-present, Facebook, Inc.
19534  * All rights reserved.
19536  * This source code is licensed under the BSD-style license found in the
19537  * LICENSE file in the root directory of this source tree. An additional grant
19538  * of patent rights can be found in the PATENTS file in the same directory.
19540  * @providesModule setInnerHTML
19541  */
19543 'use strict';
19545 var ExecutionEnvironment = _dereq_(159);
19547 var WHITESPACE_TEST = /^[ \r\n\t\f]/;
19548 var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
19550 var createMicrosoftUnsafeLocalFunction = _dereq_(129);
19553  * Set the innerHTML property of a node, ensuring that whitespace is preserved
19554  * even in IE8.
19556  * @param {DOMElement} node
19557  * @param {string} html
19558  * @internal
19559  */
19560 var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
19561   node.innerHTML = html;
19564 if (ExecutionEnvironment.canUseDOM) {
19565   // IE8: When updating a just created node with innerHTML only leading
19566   // whitespace is removed. When updating an existing node with innerHTML
19567   // whitespace in root TextNodes is also collapsed.
19568   // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
19570   // Feature detection; only IE8 is known to behave improperly like this.
19571   var testElement = document.createElement('div');
19572   testElement.innerHTML = ' ';
19573   if (testElement.innerHTML === '') {
19574     setInnerHTML = function (node, html) {
19575       // Magic theory: IE8 supposedly differentiates between added and updated
19576       // nodes when processing innerHTML, innerHTML on updated nodes suffers
19577       // from worse whitespace behavior. Re-adding a node like this triggers
19578       // the initial and more favorable whitespace behavior.
19579       // TODO: What to do on a detached node?
19580       if (node.parentNode) {
19581         node.parentNode.replaceChild(node, node);
19582       }
19584       // We also implement a workaround for non-visible tags disappearing into
19585       // thin air on IE8, this only happens if there is no visible text
19586       // in-front of the non-visible tags. Piggyback on the whitespace fix
19587       // and simply check if any non-visible tags appear in the source.
19588       if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
19589         // Recover leading whitespace by temporarily prepending any character.
19590         // \uFEFF has the potential advantage of being zero-width/invisible.
19591         // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
19592         // in hopes that this is preserved even if "\uFEFF" is transformed to
19593         // the actual Unicode character (by Babel, for example).
19594         // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
19595         node.innerHTML = String.fromCharCode(0xFEFF) + html;
19597         // deleteData leaves an empty `TextNode` which offsets the index of all
19598         // children. Definitely want to avoid this.
19599         var textNode = node.firstChild;
19600         if (textNode.data.length === 1) {
19601           node.removeChild(textNode);
19602         } else {
19603           textNode.deleteData(0, 1);
19604         }
19605       } else {
19606         node.innerHTML = html;
19607       }
19608     };
19609   }
19610   testElement = null;
19613 module.exports = setInnerHTML;
19614 },{"129":129,"159":159}],151:[function(_dereq_,module,exports){
19616  * Copyright 2013-present, Facebook, Inc.
19617  * All rights reserved.
19619  * This source code is licensed under the BSD-style license found in the
19620  * LICENSE file in the root directory of this source tree. An additional grant
19621  * of patent rights can be found in the PATENTS file in the same directory.
19623  * @providesModule setTextContent
19624  */
19626 'use strict';
19628 var ExecutionEnvironment = _dereq_(159);
19629 var escapeTextContentForBrowser = _dereq_(131);
19630 var setInnerHTML = _dereq_(150);
19633  * Set the textContent property of a node, ensuring that whitespace is preserved
19634  * even in IE8. innerText is a poor substitute for textContent and, among many
19635  * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
19636  * as it should.
19638  * @param {DOMElement} node
19639  * @param {string} text
19640  * @internal
19641  */
19642 var setTextContent = function (node, text) {
19643   node.textContent = text;
19646 if (ExecutionEnvironment.canUseDOM) {
19647   if (!('textContent' in document.documentElement)) {
19648     setTextContent = function (node, text) {
19649       setInnerHTML(node, escapeTextContentForBrowser(text));
19650     };
19651   }
19654 module.exports = setTextContent;
19655 },{"131":131,"150":150,"159":159}],152:[function(_dereq_,module,exports){
19657  * Copyright 2013-present, Facebook, Inc.
19658  * All rights reserved.
19660  * This source code is licensed under the BSD-style license found in the
19661  * LICENSE file in the root directory of this source tree. An additional grant
19662  * of patent rights can be found in the PATENTS file in the same directory.
19664 * @providesModule shallowCompare
19667 'use strict';
19669 var shallowEqual = _dereq_(182);
19672  * Does a shallow comparison for props and state.
19673  * See ReactComponentWithPureRenderMixin
19674  * See also https://facebook.github.io/react/docs/shallow-compare.html
19675  */
19676 function shallowCompare(instance, nextProps, nextState) {
19677   return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);
19680 module.exports = shallowCompare;
19681 },{"182":182}],153:[function(_dereq_,module,exports){
19683  * Copyright 2013-present, Facebook, Inc.
19684  * All rights reserved.
19686  * This source code is licensed under the BSD-style license found in the
19687  * LICENSE file in the root directory of this source tree. An additional grant
19688  * of patent rights can be found in the PATENTS file in the same directory.
19690  * @providesModule shouldUpdateReactComponent
19691  */
19693 'use strict';
19696  * Given a `prevElement` and `nextElement`, determines if the existing
19697  * instance should be updated as opposed to being destroyed or replaced by a new
19698  * instance. Both arguments are elements. This ensures that this logic can
19699  * operate on stateless trees without any backing instance.
19701  * @param {?object} prevElement
19702  * @param {?object} nextElement
19703  * @return {boolean} True if the existing instance should be updated.
19704  * @protected
19705  */
19707 function shouldUpdateReactComponent(prevElement, nextElement) {
19708   var prevEmpty = prevElement === null || prevElement === false;
19709   var nextEmpty = nextElement === null || nextElement === false;
19710   if (prevEmpty || nextEmpty) {
19711     return prevEmpty === nextEmpty;
19712   }
19714   var prevType = typeof prevElement;
19715   var nextType = typeof nextElement;
19716   if (prevType === 'string' || prevType === 'number') {
19717     return nextType === 'string' || nextType === 'number';
19718   } else {
19719     return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
19720   }
19723 module.exports = shouldUpdateReactComponent;
19724 },{}],154:[function(_dereq_,module,exports){
19726  * Copyright 2013-present, Facebook, Inc.
19727  * All rights reserved.
19729  * This source code is licensed under the BSD-style license found in the
19730  * LICENSE file in the root directory of this source tree. An additional grant
19731  * of patent rights can be found in the PATENTS file in the same directory.
19733  * @providesModule traverseAllChildren
19734  */
19736 'use strict';
19738 var ReactCurrentOwner = _dereq_(40);
19739 var ReactElement = _dereq_(65);
19741 var getIteratorFn = _dereq_(139);
19742 var invariant = _dereq_(173);
19743 var KeyEscapeUtils = _dereq_(23);
19744 var warning = _dereq_(183);
19746 var SEPARATOR = '.';
19747 var SUBSEPARATOR = ':';
19750  * TODO: Test that a single child and an array with one item have the same key
19751  * pattern.
19752  */
19754 var didWarnAboutMaps = false;
19757  * Generate a key string that identifies a component within a set.
19759  * @param {*} component A component that could contain a manual key.
19760  * @param {number} index Index that is used if a manual key is not provided.
19761  * @return {string}
19762  */
19763 function getComponentKey(component, index) {
19764   // Do some typechecking here since we call this blindly. We want to ensure
19765   // that we don't block potential future ES APIs.
19766   if (component && typeof component === 'object' && component.key != null) {
19767     // Explicit key
19768     return KeyEscapeUtils.escape(component.key);
19769   }
19770   // Implicit key determined by the index in the set
19771   return index.toString(36);
19775  * @param {?*} children Children tree container.
19776  * @param {!string} nameSoFar Name of the key path so far.
19777  * @param {!function} callback Callback to invoke with each child found.
19778  * @param {?*} traverseContext Used to pass information throughout the traversal
19779  * process.
19780  * @return {!number} The number of children in this subtree.
19781  */
19782 function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
19783   var type = typeof children;
19785   if (type === 'undefined' || type === 'boolean') {
19786     // All of the above are perceived as null.
19787     children = null;
19788   }
19790   if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
19791     callback(traverseContext, children,
19792     // If it's the only child, treat the name as if it was wrapped in an array
19793     // so that it's consistent if the number of children grows.
19794     nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
19795     return 1;
19796   }
19798   var child;
19799   var nextName;
19800   var subtreeCount = 0; // Count of children found in the current subtree.
19801   var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
19803   if (Array.isArray(children)) {
19804     for (var i = 0; i < children.length; i++) {
19805       child = children[i];
19806       nextName = nextNamePrefix + getComponentKey(child, i);
19807       subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
19808     }
19809   } else {
19810     var iteratorFn = getIteratorFn(children);
19811     if (iteratorFn) {
19812       var iterator = iteratorFn.call(children);
19813       var step;
19814       if (iteratorFn !== children.entries) {
19815         var ii = 0;
19816         while (!(step = iterator.next()).done) {
19817           child = step.value;
19818           nextName = nextNamePrefix + getComponentKey(child, ii++);
19819           subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
19820         }
19821       } else {
19822         if ("development" !== 'production') {
19823           "development" !== '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.') : void 0;
19824           didWarnAboutMaps = true;
19825         }
19826         // Iterator will provide entry [k,v] tuples rather than values.
19827         while (!(step = iterator.next()).done) {
19828           var entry = step.value;
19829           if (entry) {
19830             child = entry[1];
19831             nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
19832             subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
19833           }
19834         }
19835       }
19836     } else if (type === 'object') {
19837       var addendum = '';
19838       if ("development" !== 'production') {
19839         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.';
19840         if (children._isReactElement) {
19841           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.';
19842         }
19843         if (ReactCurrentOwner.current) {
19844           var name = ReactCurrentOwner.current.getName();
19845           if (name) {
19846             addendum += ' Check the render method of `' + name + '`.';
19847           }
19848         }
19849       }
19850       var childrenString = String(children);
19851       !false ? "development" !== '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) : void 0;
19852     }
19853   }
19855   return subtreeCount;
19859  * Traverses children that are typically specified as `props.children`, but
19860  * might also be specified through attributes:
19862  * - `traverseAllChildren(this.props.children, ...)`
19863  * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
19865  * The `traverseContext` is an optional argument that is passed through the
19866  * entire traversal. It can be used to store accumulations or anything else that
19867  * the callback might find relevant.
19869  * @param {?*} children Children tree object.
19870  * @param {!function} callback To invoke upon traversing each child.
19871  * @param {?*} traverseContext Context for traversal.
19872  * @return {!number} The number of children in this subtree.
19873  */
19874 function traverseAllChildren(children, callback, traverseContext) {
19875   if (children == null) {
19876     return 0;
19877   }
19879   return traverseAllChildrenImpl(children, '', callback, traverseContext);
19882 module.exports = traverseAllChildren;
19883 },{"139":139,"173":173,"183":183,"23":23,"40":40,"65":65}],155:[function(_dereq_,module,exports){
19885  * Copyright 2013-present, Facebook, Inc.
19886  * All rights reserved.
19888  * This source code is licensed under the BSD-style license found in the
19889  * LICENSE file in the root directory of this source tree. An additional grant
19890  * of patent rights can be found in the PATENTS file in the same directory.
19892  * @providesModule update
19893  */
19895 /* global hasOwnProperty:true */
19897 'use strict';
19899 var _assign = _dereq_(184);
19901 var keyOf = _dereq_(177);
19902 var invariant = _dereq_(173);
19903 var hasOwnProperty = {}.hasOwnProperty;
19905 function shallowCopy(x) {
19906   if (Array.isArray(x)) {
19907     return x.concat();
19908   } else if (x && typeof x === 'object') {
19909     return _assign(new x.constructor(), x);
19910   } else {
19911     return x;
19912   }
19915 var COMMAND_PUSH = keyOf({ $push: null });
19916 var COMMAND_UNSHIFT = keyOf({ $unshift: null });
19917 var COMMAND_SPLICE = keyOf({ $splice: null });
19918 var COMMAND_SET = keyOf({ $set: null });
19919 var COMMAND_MERGE = keyOf({ $merge: null });
19920 var COMMAND_APPLY = keyOf({ $apply: null });
19922 var ALL_COMMANDS_LIST = [COMMAND_PUSH, COMMAND_UNSHIFT, COMMAND_SPLICE, COMMAND_SET, COMMAND_MERGE, COMMAND_APPLY];
19924 var ALL_COMMANDS_SET = {};
19926 ALL_COMMANDS_LIST.forEach(function (command) {
19927   ALL_COMMANDS_SET[command] = true;
19930 function invariantArrayCase(value, spec, command) {
19931   !Array.isArray(value) ? "development" !== 'production' ? invariant(false, 'update(): expected target of %s to be an array; got %s.', command, value) : invariant(false) : void 0;
19932   var specValue = spec[command];
19933   !Array.isArray(specValue) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array; got %s. ' + 'Did you forget to wrap your parameter in an array?', command, specValue) : invariant(false) : void 0;
19937  * Returns a updated shallow copy of an object without mutating the original.
19938  * See https://facebook.github.io/react/docs/update.html for details.
19939  */
19940 function update(value, spec) {
19941   !(typeof spec === 'object') ? "development" !== 'production' ? invariant(false, 'update(): You provided a key path to update() that did not contain one ' + 'of %s. Did you forget to include {%s: ...}?', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : invariant(false) : void 0;
19943   if (hasOwnProperty.call(spec, COMMAND_SET)) {
19944     !(Object.keys(spec).length === 1) ? "development" !== 'production' ? invariant(false, 'Cannot have more than one key in an object with %s', COMMAND_SET) : invariant(false) : void 0;
19946     return spec[COMMAND_SET];
19947   }
19949   var nextValue = shallowCopy(value);
19951   if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
19952     var mergeObj = spec[COMMAND_MERGE];
19953     !(mergeObj && typeof mergeObj === 'object') ? "development" !== 'production' ? invariant(false, 'update(): %s expects a spec of type \'object\'; got %s', COMMAND_MERGE, mergeObj) : invariant(false) : void 0;
19954     !(nextValue && typeof nextValue === 'object') ? "development" !== 'production' ? invariant(false, 'update(): %s expects a target of type \'object\'; got %s', COMMAND_MERGE, nextValue) : invariant(false) : void 0;
19955     _assign(nextValue, spec[COMMAND_MERGE]);
19956   }
19958   if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
19959     invariantArrayCase(value, spec, COMMAND_PUSH);
19960     spec[COMMAND_PUSH].forEach(function (item) {
19961       nextValue.push(item);
19962     });
19963   }
19965   if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
19966     invariantArrayCase(value, spec, COMMAND_UNSHIFT);
19967     spec[COMMAND_UNSHIFT].forEach(function (item) {
19968       nextValue.unshift(item);
19969     });
19970   }
19972   if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
19973     !Array.isArray(value) ? "development" !== 'production' ? invariant(false, 'Expected %s target to be an array; got %s', COMMAND_SPLICE, value) : invariant(false) : void 0;
19974     !Array.isArray(spec[COMMAND_SPLICE]) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. ' + 'Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : invariant(false) : void 0;
19975     spec[COMMAND_SPLICE].forEach(function (args) {
19976       !Array.isArray(args) ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be an array of arrays; got %s. ' + 'Did you forget to wrap your parameters in an array?', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : invariant(false) : void 0;
19977       nextValue.splice.apply(nextValue, args);
19978     });
19979   }
19981   if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
19982     !(typeof spec[COMMAND_APPLY] === 'function') ? "development" !== 'production' ? invariant(false, 'update(): expected spec of %s to be a function; got %s.', COMMAND_APPLY, spec[COMMAND_APPLY]) : invariant(false) : void 0;
19983     nextValue = spec[COMMAND_APPLY](nextValue);
19984   }
19986   for (var k in spec) {
19987     if (!(ALL_COMMANDS_SET.hasOwnProperty(k) && ALL_COMMANDS_SET[k])) {
19988       nextValue[k] = update(value[k], spec[k]);
19989     }
19990   }
19992   return nextValue;
19995 module.exports = update;
19996 },{"173":173,"177":177,"184":184}],156:[function(_dereq_,module,exports){
19998  * Copyright 2015-present, Facebook, Inc.
19999  * All rights reserved.
20001  * This source code is licensed under the BSD-style license found in the
20002  * LICENSE file in the root directory of this source tree. An additional grant
20003  * of patent rights can be found in the PATENTS file in the same directory.
20005  * @providesModule validateDOMNesting
20006  */
20008 'use strict';
20010 var _assign = _dereq_(184);
20012 var emptyFunction = _dereq_(165);
20013 var warning = _dereq_(183);
20015 var validateDOMNesting = emptyFunction;
20017 if ("development" !== 'production') {
20018   // This validation code was written based on the HTML5 parsing spec:
20019   // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
20020   //
20021   // Note: this does not catch all invalid nesting, nor does it try to (as it's
20022   // not clear what practical benefit doing so provides); instead, we warn only
20023   // for cases where the parser will give a parse tree differing from what React
20024   // intended. For example, <b><div></div></b> is invalid but we don't warn
20025   // because it still parses correctly; we do warn for other cases like nested
20026   // <p> tags where the beginning of the second element implicitly closes the
20027   // first, causing a confusing mess.
20029   // https://html.spec.whatwg.org/multipage/syntax.html#special
20030   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'];
20032   // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
20033   var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
20035   // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
20036   // TODO: Distinguish by namespace here -- for <title>, including it here
20037   // errs on the side of fewer warnings
20038   'foreignObject', 'desc', 'title'];
20040   // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
20041   var buttonScopeTags = inScopeTags.concat(['button']);
20043   // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
20044   var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
20046   var emptyAncestorInfo = {
20047     current: null,
20049     formTag: null,
20050     aTagInScope: null,
20051     buttonTagInScope: null,
20052     nobrTagInScope: null,
20053     pTagInButtonScope: null,
20055     listItemTagAutoclosing: null,
20056     dlItemTagAutoclosing: null
20057   };
20059   var updatedAncestorInfo = function (oldInfo, tag, instance) {
20060     var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
20061     var info = { tag: tag, instance: instance };
20063     if (inScopeTags.indexOf(tag) !== -1) {
20064       ancestorInfo.aTagInScope = null;
20065       ancestorInfo.buttonTagInScope = null;
20066       ancestorInfo.nobrTagInScope = null;
20067     }
20068     if (buttonScopeTags.indexOf(tag) !== -1) {
20069       ancestorInfo.pTagInButtonScope = null;
20070     }
20072     // See rules for 'li', 'dd', 'dt' start tags in
20073     // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
20074     if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
20075       ancestorInfo.listItemTagAutoclosing = null;
20076       ancestorInfo.dlItemTagAutoclosing = null;
20077     }
20079     ancestorInfo.current = info;
20081     if (tag === 'form') {
20082       ancestorInfo.formTag = info;
20083     }
20084     if (tag === 'a') {
20085       ancestorInfo.aTagInScope = info;
20086     }
20087     if (tag === 'button') {
20088       ancestorInfo.buttonTagInScope = info;
20089     }
20090     if (tag === 'nobr') {
20091       ancestorInfo.nobrTagInScope = info;
20092     }
20093     if (tag === 'p') {
20094       ancestorInfo.pTagInButtonScope = info;
20095     }
20096     if (tag === 'li') {
20097       ancestorInfo.listItemTagAutoclosing = info;
20098     }
20099     if (tag === 'dd' || tag === 'dt') {
20100       ancestorInfo.dlItemTagAutoclosing = info;
20101     }
20103     return ancestorInfo;
20104   };
20106   /**
20107    * Returns whether
20108    */
20109   var isTagValidWithParent = function (tag, parentTag) {
20110     // First, let's check if we're in an unusual parsing mode...
20111     switch (parentTag) {
20112       // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
20113       case 'select':
20114         return tag === 'option' || tag === 'optgroup' || tag === '#text';
20115       case 'optgroup':
20116         return tag === 'option' || tag === '#text';
20117       // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
20118       // but
20119       case 'option':
20120         return tag === '#text';
20122       // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
20123       // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
20124       // No special behavior since these rules fall back to "in body" mode for
20125       // all except special table nodes which cause bad parsing behavior anyway.
20127       // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
20128       case 'tr':
20129         return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
20131       // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
20132       case 'tbody':
20133       case 'thead':
20134       case 'tfoot':
20135         return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
20137       // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
20138       case 'colgroup':
20139         return tag === 'col' || tag === 'template';
20141       // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
20142       case 'table':
20143         return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
20145       // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
20146       case 'head':
20147         return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
20149       // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
20150       case 'html':
20151         return tag === 'head' || tag === 'body';
20152       case '#document':
20153         return tag === 'html';
20154     }
20156     // Probably in the "in body" parsing mode, so we outlaw only tag combos
20157     // where the parsing rules cause implicit opens or closes to be added.
20158     // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
20159     switch (tag) {
20160       case 'h1':
20161       case 'h2':
20162       case 'h3':
20163       case 'h4':
20164       case 'h5':
20165       case 'h6':
20166         return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
20168       case 'rp':
20169       case 'rt':
20170         return impliedEndTags.indexOf(parentTag) === -1;
20172       case 'body':
20173       case 'caption':
20174       case 'col':
20175       case 'colgroup':
20176       case 'frame':
20177       case 'head':
20178       case 'html':
20179       case 'tbody':
20180       case 'td':
20181       case 'tfoot':
20182       case 'th':
20183       case 'thead':
20184       case 'tr':
20185         // These tags are only valid with a few parents that have special child
20186         // parsing rules -- if we're down here, then none of those matched and
20187         // so we allow it only if we don't know what the parent is, as all other
20188         // cases are invalid.
20189         return parentTag == null;
20190     }
20192     return true;
20193   };
20195   /**
20196    * Returns whether
20197    */
20198   var findInvalidAncestorForTag = function (tag, ancestorInfo) {
20199     switch (tag) {
20200       case 'address':
20201       case 'article':
20202       case 'aside':
20203       case 'blockquote':
20204       case 'center':
20205       case 'details':
20206       case 'dialog':
20207       case 'dir':
20208       case 'div':
20209       case 'dl':
20210       case 'fieldset':
20211       case 'figcaption':
20212       case 'figure':
20213       case 'footer':
20214       case 'header':
20215       case 'hgroup':
20216       case 'main':
20217       case 'menu':
20218       case 'nav':
20219       case 'ol':
20220       case 'p':
20221       case 'section':
20222       case 'summary':
20223       case 'ul':
20225       case 'pre':
20226       case 'listing':
20228       case 'table':
20230       case 'hr':
20232       case 'xmp':
20234       case 'h1':
20235       case 'h2':
20236       case 'h3':
20237       case 'h4':
20238       case 'h5':
20239       case 'h6':
20240         return ancestorInfo.pTagInButtonScope;
20242       case 'form':
20243         return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
20245       case 'li':
20246         return ancestorInfo.listItemTagAutoclosing;
20248       case 'dd':
20249       case 'dt':
20250         return ancestorInfo.dlItemTagAutoclosing;
20252       case 'button':
20253         return ancestorInfo.buttonTagInScope;
20255       case 'a':
20256         // Spec says something about storing a list of markers, but it sounds
20257         // equivalent to this check.
20258         return ancestorInfo.aTagInScope;
20260       case 'nobr':
20261         return ancestorInfo.nobrTagInScope;
20262     }
20264     return null;
20265   };
20267   /**
20268    * Given a ReactCompositeComponent instance, return a list of its recursive
20269    * owners, starting at the root and ending with the instance itself.
20270    */
20271   var findOwnerStack = function (instance) {
20272     if (!instance) {
20273       return [];
20274     }
20276     var stack = [];
20277     do {
20278       stack.push(instance);
20279     } while (instance = instance._currentElement._owner);
20280     stack.reverse();
20281     return stack;
20282   };
20284   var didWarn = {};
20286   validateDOMNesting = function (childTag, childInstance, ancestorInfo) {
20287     ancestorInfo = ancestorInfo || emptyAncestorInfo;
20288     var parentInfo = ancestorInfo.current;
20289     var parentTag = parentInfo && parentInfo.tag;
20291     var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
20292     var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
20293     var problematic = invalidParent || invalidAncestor;
20295     if (problematic) {
20296       var ancestorTag = problematic.tag;
20297       var ancestorInstance = problematic.instance;
20299       var childOwner = childInstance && childInstance._currentElement._owner;
20300       var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
20302       var childOwners = findOwnerStack(childOwner);
20303       var ancestorOwners = findOwnerStack(ancestorOwner);
20305       var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
20306       var i;
20308       var deepestCommon = -1;
20309       for (i = 0; i < minStackLen; i++) {
20310         if (childOwners[i] === ancestorOwners[i]) {
20311           deepestCommon = i;
20312         } else {
20313           break;
20314         }
20315       }
20317       var UNKNOWN = '(unknown)';
20318       var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
20319         return inst.getName() || UNKNOWN;
20320       });
20321       var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
20322         return inst.getName() || UNKNOWN;
20323       });
20324       var ownerInfo = [].concat(
20325       // If the parent and child instances have a common owner ancestor, start
20326       // with that -- otherwise we just start with the parent's owners.
20327       deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
20328       // If we're warning about an invalid (non-parent) ancestry, add '...'
20329       invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
20331       var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
20332       if (didWarn[warnKey]) {
20333         return;
20334       }
20335       didWarn[warnKey] = true;
20337       var tagDisplayName = childTag;
20338       if (childTag !== '#text') {
20339         tagDisplayName = '<' + childTag + '>';
20340       }
20342       if (invalidParent) {
20343         var info = '';
20344         if (ancestorTag === 'table' && childTag === 'tr') {
20345           info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
20346         }
20347         "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>. ' + 'See %s.%s', tagDisplayName, ancestorTag, ownerInfo, info) : void 0;
20348       } else {
20349         "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
20350       }
20351     }
20352   };
20354   validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
20356   // For testing
20357   validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
20358     ancestorInfo = ancestorInfo || emptyAncestorInfo;
20359     var parentInfo = ancestorInfo.current;
20360     var parentTag = parentInfo && parentInfo.tag;
20361     return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
20362   };
20365 module.exports = validateDOMNesting;
20366 },{"165":165,"183":183,"184":184}],157:[function(_dereq_,module,exports){
20367 'use strict';
20370  * Copyright (c) 2013-present, Facebook, Inc.
20371  * All rights reserved.
20373  * This source code is licensed under the BSD-style license found in the
20374  * LICENSE file in the root directory of this source tree. An additional grant
20375  * of patent rights can be found in the PATENTS file in the same directory.
20377  * @typechecks
20378  */
20380 var invariant = _dereq_(173);
20383  * The CSSCore module specifies the API (and implements most of the methods)
20384  * that should be used when dealing with the display of elements (via their
20385  * CSS classes and visibility on screen. It is an API focused on mutating the
20386  * display and not reading it as no logical state should be encoded in the
20387  * display of elements.
20388  */
20390 /* Slow implementation for browsers that don't natively support .matches() */
20391 function matchesSelector_SLOW(element, selector) {
20392   var root = element;
20393   while (root.parentNode) {
20394     root = root.parentNode;
20395   }
20397   var all = root.querySelectorAll(selector);
20398   return Array.prototype.indexOf.call(all, element) !== -1;
20401 var CSSCore = {
20403   /**
20404    * Adds the class passed in to the element if it doesn't already have it.
20405    *
20406    * @param {DOMElement} element the element to set the class on
20407    * @param {string} className the CSS className
20408    * @return {DOMElement} the element passed in
20409    */
20410   addClass: function (element, className) {
20411     !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0;
20413     if (className) {
20414       if (element.classList) {
20415         element.classList.add(className);
20416       } else if (!CSSCore.hasClass(element, className)) {
20417         element.className = element.className + ' ' + className;
20418       }
20419     }
20420     return element;
20421   },
20423   /**
20424    * Removes the class passed in from the element
20425    *
20426    * @param {DOMElement} element the element to set the class on
20427    * @param {string} className the CSS className
20428    * @return {DOMElement} the element passed in
20429    */
20430   removeClass: function (element, className) {
20431     !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0;
20433     if (className) {
20434       if (element.classList) {
20435         element.classList.remove(className);
20436       } else if (CSSCore.hasClass(element, className)) {
20437         element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ') // multiple spaces to one
20438         .replace(/^\s*|\s*$/g, ''); // trim the ends
20439       }
20440     }
20441     return element;
20442   },
20444   /**
20445    * Helper to add or remove a class from an element based on a condition.
20446    *
20447    * @param {DOMElement} element the element to set the class on
20448    * @param {string} className the CSS className
20449    * @param {*} bool condition to whether to add or remove the class
20450    * @return {DOMElement} the element passed in
20451    */
20452   conditionClass: function (element, className, bool) {
20453     return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className);
20454   },
20456   /**
20457    * Tests whether the element has the class specified.
20458    *
20459    * @param {DOMNode|DOMWindow} element the element to check the class on
20460    * @param {string} className the CSS className
20461    * @return {boolean} true if the element has the class, false if not
20462    */
20463   hasClass: function (element, className) {
20464     !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSS.hasClass takes only a single class name.') : invariant(false) : void 0;
20465     if (element.classList) {
20466       return !!className && element.classList.contains(className);
20467     }
20468     return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;
20469   },
20471   /**
20472    * Tests whether the element matches the selector specified
20473    *
20474    * @param {DOMNode|DOMWindow} element the element that we are querying
20475    * @param {string} selector the CSS selector
20476    * @return {boolean} true if the element matches the selector, false if not
20477    */
20478   matchesSelector: function (element, selector) {
20479     var matchesImpl = element.matches || element.webkitMatchesSelector || element.mozMatchesSelector || element.msMatchesSelector || function (s) {
20480       return matchesSelector_SLOW(element, s);
20481     };
20482     return matchesImpl.call(element, selector);
20483   }
20487 module.exports = CSSCore;
20488 },{"173":173}],158:[function(_dereq_,module,exports){
20489 'use strict';
20492  * Copyright (c) 2013-present, Facebook, Inc.
20494  * Licensed under the Apache License, Version 2.0 (the "License");
20495  * you may not use this file except in compliance with the License.
20496  * You may obtain a copy of the License at
20498  * http://www.apache.org/licenses/LICENSE-2.0
20500  * Unless required by applicable law or agreed to in writing, software
20501  * distributed under the License is distributed on an "AS IS" BASIS,
20502  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20503  * See the License for the specific language governing permissions and
20504  * limitations under the License.
20506  * @typechecks
20507  */
20509 var emptyFunction = _dereq_(165);
20512  * Upstream version of event listener. Does not take into account specific
20513  * nature of platform.
20514  */
20515 var EventListener = {
20516   /**
20517    * Listen to DOM events during the bubble phase.
20518    *
20519    * @param {DOMEventTarget} target DOM element to register listener on.
20520    * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
20521    * @param {function} callback Callback function.
20522    * @return {object} Object with a `remove` method.
20523    */
20524   listen: function (target, eventType, callback) {
20525     if (target.addEventListener) {
20526       target.addEventListener(eventType, callback, false);
20527       return {
20528         remove: function () {
20529           target.removeEventListener(eventType, callback, false);
20530         }
20531       };
20532     } else if (target.attachEvent) {
20533       target.attachEvent('on' + eventType, callback);
20534       return {
20535         remove: function () {
20536           target.detachEvent('on' + eventType, callback);
20537         }
20538       };
20539     }
20540   },
20542   /**
20543    * Listen to DOM events during the capture phase.
20544    *
20545    * @param {DOMEventTarget} target DOM element to register listener on.
20546    * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
20547    * @param {function} callback Callback function.
20548    * @return {object} Object with a `remove` method.
20549    */
20550   capture: function (target, eventType, callback) {
20551     if (target.addEventListener) {
20552       target.addEventListener(eventType, callback, true);
20553       return {
20554         remove: function () {
20555           target.removeEventListener(eventType, callback, true);
20556         }
20557       };
20558     } else {
20559       if ("development" !== 'production') {
20560         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.');
20561       }
20562       return {
20563         remove: emptyFunction
20564       };
20565     }
20566   },
20568   registerDefault: function () {}
20571 module.exports = EventListener;
20572 },{"165":165}],159:[function(_dereq_,module,exports){
20574  * Copyright (c) 2013-present, Facebook, Inc.
20575  * All rights reserved.
20577  * This source code is licensed under the BSD-style license found in the
20578  * LICENSE file in the root directory of this source tree. An additional grant
20579  * of patent rights can be found in the PATENTS file in the same directory.
20581  */
20583 'use strict';
20585 var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
20588  * Simple, lightweight module assisting with the detection and context of
20589  * Worker. Helps avoid circular dependencies and allows code to reason about
20590  * whether or not they are in a Worker, even if they never include the main
20591  * `ReactWorker` dependency.
20592  */
20593 var ExecutionEnvironment = {
20595   canUseDOM: canUseDOM,
20597   canUseWorkers: typeof Worker !== 'undefined',
20599   canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
20601   canUseViewport: canUseDOM && !!window.screen,
20603   isInWorker: !canUseDOM // For now, this is true - might change in the future.
20607 module.exports = ExecutionEnvironment;
20608 },{}],160:[function(_dereq_,module,exports){
20609 "use strict";
20612  * Copyright (c) 2013-present, Facebook, Inc.
20613  * All rights reserved.
20615  * This source code is licensed under the BSD-style license found in the
20616  * LICENSE file in the root directory of this source tree. An additional grant
20617  * of patent rights can be found in the PATENTS file in the same directory.
20619  * @typechecks
20620  */
20622 var _hyphenPattern = /-(.)/g;
20625  * Camelcases a hyphenated string, for example:
20627  *   > camelize('background-color')
20628  *   < "backgroundColor"
20630  * @param {string} string
20631  * @return {string}
20632  */
20633 function camelize(string) {
20634   return string.replace(_hyphenPattern, function (_, character) {
20635     return character.toUpperCase();
20636   });
20639 module.exports = camelize;
20640 },{}],161:[function(_dereq_,module,exports){
20642  * Copyright (c) 2013-present, Facebook, Inc.
20643  * All rights reserved.
20645  * This source code is licensed under the BSD-style license found in the
20646  * LICENSE file in the root directory of this source tree. An additional grant
20647  * of patent rights can be found in the PATENTS file in the same directory.
20649  * @typechecks
20650  */
20652 'use strict';
20654 var camelize = _dereq_(160);
20656 var msPattern = /^-ms-/;
20659  * Camelcases a hyphenated CSS property name, for example:
20661  *   > camelizeStyleName('background-color')
20662  *   < "backgroundColor"
20663  *   > camelizeStyleName('-moz-transition')
20664  *   < "MozTransition"
20665  *   > camelizeStyleName('-ms-transition')
20666  *   < "msTransition"
20668  * As Andi Smith suggests
20669  * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
20670  * is converted to lowercase `ms`.
20672  * @param {string} string
20673  * @return {string}
20674  */
20675 function camelizeStyleName(string) {
20676   return camelize(string.replace(msPattern, 'ms-'));
20679 module.exports = camelizeStyleName;
20680 },{"160":160}],162:[function(_dereq_,module,exports){
20681 'use strict';
20684  * Copyright (c) 2013-present, Facebook, Inc.
20685  * All rights reserved.
20687  * This source code is licensed under the BSD-style license found in the
20688  * LICENSE file in the root directory of this source tree. An additional grant
20689  * of patent rights can be found in the PATENTS file in the same directory.
20691  * @typechecks
20692  */
20694 var isTextNode = _dereq_(175);
20696 /*eslint-disable no-bitwise */
20699  * Checks if a given DOM node contains or is another DOM node.
20701  * @param {?DOMNode} outerNode Outer DOM node.
20702  * @param {?DOMNode} innerNode Inner DOM node.
20703  * @return {boolean} True if `outerNode` contains or is `innerNode`.
20704  */
20705 function containsNode(outerNode, innerNode) {
20706   if (!outerNode || !innerNode) {
20707     return false;
20708   } else if (outerNode === innerNode) {
20709     return true;
20710   } else if (isTextNode(outerNode)) {
20711     return false;
20712   } else if (isTextNode(innerNode)) {
20713     return containsNode(outerNode, innerNode.parentNode);
20714   } else if (outerNode.contains) {
20715     return outerNode.contains(innerNode);
20716   } else if (outerNode.compareDocumentPosition) {
20717     return !!(outerNode.compareDocumentPosition(innerNode) & 16);
20718   } else {
20719     return false;
20720   }
20723 module.exports = containsNode;
20724 },{"175":175}],163:[function(_dereq_,module,exports){
20725 'use strict';
20728  * Copyright (c) 2013-present, Facebook, Inc.
20729  * All rights reserved.
20731  * This source code is licensed under the BSD-style license found in the
20732  * LICENSE file in the root directory of this source tree. An additional grant
20733  * of patent rights can be found in the PATENTS file in the same directory.
20735  * @typechecks
20736  */
20738 var invariant = _dereq_(173);
20741  * Convert array-like objects to arrays.
20743  * This API assumes the caller knows the contents of the data type. For less
20744  * well defined inputs use createArrayFromMixed.
20746  * @param {object|function|filelist} obj
20747  * @return {array}
20748  */
20749 function toArray(obj) {
20750   var length = obj.length;
20752   // Some browsers builtin objects can report typeof 'function' (e.g. NodeList
20753   // in old versions of Safari).
20754   !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? "development" !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
20756   !(typeof length === 'number') ? "development" !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
20758   !(length === 0 || length - 1 in obj) ? "development" !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
20760   !(typeof obj.callee !== 'function') ? "development" !== 'production' ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0;
20762   // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
20763   // without method will throw during the slice call and skip straight to the
20764   // fallback.
20765   if (obj.hasOwnProperty) {
20766     try {
20767       return Array.prototype.slice.call(obj);
20768     } catch (e) {
20769       // IE < 9 does not support Array#slice on collections objects
20770     }
20771   }
20773   // Fall back to copying key by key. This assumes all keys have a value,
20774   // so will not preserve sparsely populated inputs.
20775   var ret = Array(length);
20776   for (var ii = 0; ii < length; ii++) {
20777     ret[ii] = obj[ii];
20778   }
20779   return ret;
20783  * Perform a heuristic test to determine if an object is "array-like".
20785  *   A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
20786  *   Joshu replied: "Mu."
20788  * This function determines if its argument has "array nature": it returns
20789  * true if the argument is an actual array, an `arguments' object, or an
20790  * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
20792  * It will return false for other array-like objects like Filelist.
20794  * @param {*} obj
20795  * @return {boolean}
20796  */
20797 function hasArrayNature(obj) {
20798   return(
20799     // not null/false
20800     !!obj && (
20801     // arrays are objects, NodeLists are functions in Safari
20802     typeof obj == 'object' || typeof obj == 'function') &&
20803     // quacks like an array
20804     'length' in obj &&
20805     // not window
20806     !('setInterval' in obj) &&
20807     // no DOM node should be considered an array-like
20808     // a 'select' element has 'length' and 'item' properties on IE8
20809     typeof obj.nodeType != 'number' && (
20810     // a real array
20811     Array.isArray(obj) ||
20812     // arguments
20813     'callee' in obj ||
20814     // HTMLCollection/NodeList
20815     'item' in obj)
20816   );
20820  * Ensure that the argument is an array by wrapping it in an array if it is not.
20821  * Creates a copy of the argument if it is already an array.
20823  * This is mostly useful idiomatically:
20825  *   var createArrayFromMixed = require('createArrayFromMixed');
20827  *   function takesOneOrMoreThings(things) {
20828  *     things = createArrayFromMixed(things);
20829  *     ...
20830  *   }
20832  * This allows you to treat `things' as an array, but accept scalars in the API.
20834  * If you need to convert an array-like object, like `arguments`, into an array
20835  * use toArray instead.
20837  * @param {*} obj
20838  * @return {array}
20839  */
20840 function createArrayFromMixed(obj) {
20841   if (!hasArrayNature(obj)) {
20842     return [obj];
20843   } else if (Array.isArray(obj)) {
20844     return obj.slice();
20845   } else {
20846     return toArray(obj);
20847   }
20850 module.exports = createArrayFromMixed;
20851 },{"173":173}],164:[function(_dereq_,module,exports){
20852 'use strict';
20855  * Copyright (c) 2013-present, Facebook, Inc.
20856  * All rights reserved.
20858  * This source code is licensed under the BSD-style license found in the
20859  * LICENSE file in the root directory of this source tree. An additional grant
20860  * of patent rights can be found in the PATENTS file in the same directory.
20862  * @typechecks
20863  */
20865 /*eslint-disable fb-www/unsafe-html*/
20867 var ExecutionEnvironment = _dereq_(159);
20869 var createArrayFromMixed = _dereq_(163);
20870 var getMarkupWrap = _dereq_(169);
20871 var invariant = _dereq_(173);
20874  * Dummy container used to render all markup.
20875  */
20876 var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
20879  * Pattern used by `getNodeName`.
20880  */
20881 var nodeNamePattern = /^\s*<(\w+)/;
20884  * Extracts the `nodeName` of the first element in a string of markup.
20886  * @param {string} markup String of markup.
20887  * @return {?string} Node name of the supplied markup.
20888  */
20889 function getNodeName(markup) {
20890   var nodeNameMatch = markup.match(nodeNamePattern);
20891   return nodeNameMatch && nodeNameMatch[1].toLowerCase();
20895  * Creates an array containing the nodes rendered from the supplied markup. The
20896  * optionally supplied `handleScript` function will be invoked once for each
20897  * <script> element that is rendered. If no `handleScript` function is supplied,
20898  * an exception is thrown if any <script> elements are rendered.
20900  * @param {string} markup A string of valid HTML markup.
20901  * @param {?function} handleScript Invoked once for each rendered <script>.
20902  * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
20903  */
20904 function createNodesFromMarkup(markup, handleScript) {
20905   var node = dummyNode;
20906   !!!dummyNode ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
20907   var nodeName = getNodeName(markup);
20909   var wrap = nodeName && getMarkupWrap(nodeName);
20910   if (wrap) {
20911     node.innerHTML = wrap[1] + markup + wrap[2];
20913     var wrapDepth = wrap[0];
20914     while (wrapDepth--) {
20915       node = node.lastChild;
20916     }
20917   } else {
20918     node.innerHTML = markup;
20919   }
20921   var scripts = node.getElementsByTagName('script');
20922   if (scripts.length) {
20923     !handleScript ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;
20924     createArrayFromMixed(scripts).forEach(handleScript);
20925   }
20927   var nodes = Array.from(node.childNodes);
20928   while (node.lastChild) {
20929     node.removeChild(node.lastChild);
20930   }
20931   return nodes;
20934 module.exports = createNodesFromMarkup;
20935 },{"159":159,"163":163,"169":169,"173":173}],165:[function(_dereq_,module,exports){
20936 "use strict";
20939  * Copyright (c) 2013-present, Facebook, Inc.
20940  * All rights reserved.
20942  * This source code is licensed under the BSD-style license found in the
20943  * LICENSE file in the root directory of this source tree. An additional grant
20944  * of patent rights can be found in the PATENTS file in the same directory.
20946  */
20948 function makeEmptyFunction(arg) {
20949   return function () {
20950     return arg;
20951   };
20955  * This function accepts and discards inputs; it has no side effects. This is
20956  * primarily useful idiomatically for overridable function endpoints which
20957  * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
20958  */
20959 function emptyFunction() {}
20961 emptyFunction.thatReturns = makeEmptyFunction;
20962 emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
20963 emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
20964 emptyFunction.thatReturnsNull = makeEmptyFunction(null);
20965 emptyFunction.thatReturnsThis = function () {
20966   return this;
20968 emptyFunction.thatReturnsArgument = function (arg) {
20969   return arg;
20972 module.exports = emptyFunction;
20973 },{}],166:[function(_dereq_,module,exports){
20975  * Copyright (c) 2013-present, Facebook, Inc.
20976  * All rights reserved.
20978  * This source code is licensed under the BSD-style license found in the
20979  * LICENSE file in the root directory of this source tree. An additional grant
20980  * of patent rights can be found in the PATENTS file in the same directory.
20982  */
20984 'use strict';
20986 var emptyObject = {};
20988 if ("development" !== 'production') {
20989   Object.freeze(emptyObject);
20992 module.exports = emptyObject;
20993 },{}],167:[function(_dereq_,module,exports){
20995  * Copyright (c) 2013-present, Facebook, Inc.
20996  * All rights reserved.
20998  * This source code is licensed under the BSD-style license found in the
20999  * LICENSE file in the root directory of this source tree. An additional grant
21000  * of patent rights can be found in the PATENTS file in the same directory.
21002  */
21004 'use strict';
21007  * @param {DOMElement} node input/textarea to focus
21008  */
21010 function focusNode(node) {
21011   // IE8 can throw "Can't move focus to the control because it is invisible,
21012   // not enabled, or of a type that does not accept the focus." for all kinds of
21013   // reasons that are too expensive and fragile to test.
21014   try {
21015     node.focus();
21016   } catch (e) {}
21019 module.exports = focusNode;
21020 },{}],168:[function(_dereq_,module,exports){
21021 'use strict';
21024  * Copyright (c) 2013-present, Facebook, Inc.
21025  * All rights reserved.
21027  * This source code is licensed under the BSD-style license found in the
21028  * LICENSE file in the root directory of this source tree. An additional grant
21029  * of patent rights can be found in the PATENTS file in the same directory.
21031  * @typechecks
21032  */
21034 /* eslint-disable fb-www/typeof-undefined */
21037  * Same as document.activeElement but wraps in a try-catch block. In IE it is
21038  * not safe to call document.activeElement if there is nothing focused.
21040  * The activeElement will be null only if the document or document body is not
21041  * yet defined.
21042  */
21043 function getActiveElement() /*?DOMElement*/{
21044   if (typeof document === 'undefined') {
21045     return null;
21046   }
21047   try {
21048     return document.activeElement || document.body;
21049   } catch (e) {
21050     return document.body;
21051   }
21054 module.exports = getActiveElement;
21055 },{}],169:[function(_dereq_,module,exports){
21056 'use strict';
21059  * Copyright (c) 2013-present, Facebook, Inc.
21060  * All rights reserved.
21062  * This source code is licensed under the BSD-style license found in the
21063  * LICENSE file in the root directory of this source tree. An additional grant
21064  * of patent rights can be found in the PATENTS file in the same directory.
21066  */
21068 /*eslint-disable fb-www/unsafe-html */
21070 var ExecutionEnvironment = _dereq_(159);
21072 var invariant = _dereq_(173);
21075  * Dummy container used to detect which wraps are necessary.
21076  */
21077 var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
21080  * Some browsers cannot use `innerHTML` to render certain elements standalone,
21081  * so we wrap them, render the wrapped nodes, then extract the desired node.
21083  * In IE8, certain elements cannot render alone, so wrap all elements ('*').
21084  */
21086 var shouldWrap = {};
21088 var selectWrap = [1, '<select multiple="true">', '</select>'];
21089 var tableWrap = [1, '<table>', '</table>'];
21090 var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
21092 var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
21094 var markupWrap = {
21095   '*': [1, '?<div>', '</div>'],
21097   'area': [1, '<map>', '</map>'],
21098   'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
21099   'legend': [1, '<fieldset>', '</fieldset>'],
21100   'param': [1, '<object>', '</object>'],
21101   'tr': [2, '<table><tbody>', '</tbody></table>'],
21103   'optgroup': selectWrap,
21104   'option': selectWrap,
21106   'caption': tableWrap,
21107   'colgroup': tableWrap,
21108   'tbody': tableWrap,
21109   'tfoot': tableWrap,
21110   'thead': tableWrap,
21112   'td': trWrap,
21113   'th': trWrap
21116 // Initialize the SVG elements since we know they'll always need to be wrapped
21117 // consistently. If they are created inside a <div> they will be initialized in
21118 // the wrong namespace (and will not display).
21119 var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
21120 svgElements.forEach(function (nodeName) {
21121   markupWrap[nodeName] = svgWrap;
21122   shouldWrap[nodeName] = true;
21126  * Gets the markup wrap configuration for the supplied `nodeName`.
21128  * NOTE: This lazily detects which wraps are necessary for the current browser.
21130  * @param {string} nodeName Lowercase `nodeName`.
21131  * @return {?array} Markup wrap configuration, if applicable.
21132  */
21133 function getMarkupWrap(nodeName) {
21134   !!!dummyNode ? "development" !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
21135   if (!markupWrap.hasOwnProperty(nodeName)) {
21136     nodeName = '*';
21137   }
21138   if (!shouldWrap.hasOwnProperty(nodeName)) {
21139     if (nodeName === '*') {
21140       dummyNode.innerHTML = '<link />';
21141     } else {
21142       dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
21143     }
21144     shouldWrap[nodeName] = !dummyNode.firstChild;
21145   }
21146   return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
21149 module.exports = getMarkupWrap;
21150 },{"159":159,"173":173}],170:[function(_dereq_,module,exports){
21152  * Copyright (c) 2013-present, Facebook, Inc.
21153  * All rights reserved.
21155  * This source code is licensed under the BSD-style license found in the
21156  * LICENSE file in the root directory of this source tree. An additional grant
21157  * of patent rights can be found in the PATENTS file in the same directory.
21159  * @typechecks
21160  */
21162 'use strict';
21165  * Gets the scroll position of the supplied element or window.
21167  * The return values are unbounded, unlike `getScrollPosition`. This means they
21168  * may be negative or exceed the element boundaries (which is possible using
21169  * inertial scrolling).
21171  * @param {DOMWindow|DOMElement} scrollable
21172  * @return {object} Map with `x` and `y` keys.
21173  */
21175 function getUnboundedScrollPosition(scrollable) {
21176   if (scrollable === window) {
21177     return {
21178       x: window.pageXOffset || document.documentElement.scrollLeft,
21179       y: window.pageYOffset || document.documentElement.scrollTop
21180     };
21181   }
21182   return {
21183     x: scrollable.scrollLeft,
21184     y: scrollable.scrollTop
21185   };
21188 module.exports = getUnboundedScrollPosition;
21189 },{}],171:[function(_dereq_,module,exports){
21190 'use strict';
21193  * Copyright (c) 2013-present, Facebook, Inc.
21194  * All rights reserved.
21196  * This source code is licensed under the BSD-style license found in the
21197  * LICENSE file in the root directory of this source tree. An additional grant
21198  * of patent rights can be found in the PATENTS file in the same directory.
21200  * @typechecks
21201  */
21203 var _uppercasePattern = /([A-Z])/g;
21206  * Hyphenates a camelcased string, for example:
21208  *   > hyphenate('backgroundColor')
21209  *   < "background-color"
21211  * For CSS style names, use `hyphenateStyleName` instead which works properly
21212  * with all vendor prefixes, including `ms`.
21214  * @param {string} string
21215  * @return {string}
21216  */
21217 function hyphenate(string) {
21218   return string.replace(_uppercasePattern, '-$1').toLowerCase();
21221 module.exports = hyphenate;
21222 },{}],172:[function(_dereq_,module,exports){
21224  * Copyright (c) 2013-present, Facebook, Inc.
21225  * All rights reserved.
21227  * This source code is licensed under the BSD-style license found in the
21228  * LICENSE file in the root directory of this source tree. An additional grant
21229  * of patent rights can be found in the PATENTS file in the same directory.
21231  * @typechecks
21232  */
21234 'use strict';
21236 var hyphenate = _dereq_(171);
21238 var msPattern = /^ms-/;
21241  * Hyphenates a camelcased CSS property name, for example:
21243  *   > hyphenateStyleName('backgroundColor')
21244  *   < "background-color"
21245  *   > hyphenateStyleName('MozTransition')
21246  *   < "-moz-transition"
21247  *   > hyphenateStyleName('msTransition')
21248  *   < "-ms-transition"
21250  * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
21251  * is converted to `-ms-`.
21253  * @param {string} string
21254  * @return {string}
21255  */
21256 function hyphenateStyleName(string) {
21257   return hyphenate(string).replace(msPattern, '-ms-');
21260 module.exports = hyphenateStyleName;
21261 },{"171":171}],173:[function(_dereq_,module,exports){
21263  * Copyright (c) 2013-present, Facebook, Inc.
21264  * All rights reserved.
21266  * This source code is licensed under the BSD-style license found in the
21267  * LICENSE file in the root directory of this source tree. An additional grant
21268  * of patent rights can be found in the PATENTS file in the same directory.
21270  */
21272 'use strict';
21275  * Use invariant() to assert state which your program assumes to be true.
21277  * Provide sprintf-style format (only %s is supported) and arguments
21278  * to provide information about what broke and what you were
21279  * expecting.
21281  * The invariant message will be stripped in production, but the invariant
21282  * will remain to ensure logic does not differ in production.
21283  */
21285 function invariant(condition, format, a, b, c, d, e, f) {
21286   if ("development" !== 'production') {
21287     if (format === undefined) {
21288       throw new Error('invariant requires an error message argument');
21289     }
21290   }
21292   if (!condition) {
21293     var error;
21294     if (format === undefined) {
21295       error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
21296     } else {
21297       var args = [a, b, c, d, e, f];
21298       var argIndex = 0;
21299       error = new Error(format.replace(/%s/g, function () {
21300         return args[argIndex++];
21301       }));
21302       error.name = 'Invariant Violation';
21303     }
21305     error.framesToPop = 1; // we don't care about invariant's own frame
21306     throw error;
21307   }
21310 module.exports = invariant;
21311 },{}],174:[function(_dereq_,module,exports){
21312 'use strict';
21315  * Copyright (c) 2013-present, Facebook, Inc.
21316  * All rights reserved.
21318  * This source code is licensed under the BSD-style license found in the
21319  * LICENSE file in the root directory of this source tree. An additional grant
21320  * of patent rights can be found in the PATENTS file in the same directory.
21322  * @typechecks
21323  */
21326  * @param {*} object The object to check.
21327  * @return {boolean} Whether or not the object is a DOM node.
21328  */
21329 function isNode(object) {
21330   return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
21333 module.exports = isNode;
21334 },{}],175:[function(_dereq_,module,exports){
21335 'use strict';
21338  * Copyright (c) 2013-present, Facebook, Inc.
21339  * All rights reserved.
21341  * This source code is licensed under the BSD-style license found in the
21342  * LICENSE file in the root directory of this source tree. An additional grant
21343  * of patent rights can be found in the PATENTS file in the same directory.
21345  * @typechecks
21346  */
21348 var isNode = _dereq_(174);
21351  * @param {*} object The object to check.
21352  * @return {boolean} Whether or not the object is a DOM text node.
21353  */
21354 function isTextNode(object) {
21355   return isNode(object) && object.nodeType == 3;
21358 module.exports = isTextNode;
21359 },{"174":174}],176:[function(_dereq_,module,exports){
21361  * Copyright (c) 2013-present, Facebook, Inc.
21362  * All rights reserved.
21364  * This source code is licensed under the BSD-style license found in the
21365  * LICENSE file in the root directory of this source tree. An additional grant
21366  * of patent rights can be found in the PATENTS file in the same directory.
21368  * @typechecks static-only
21369  */
21371 'use strict';
21373 var invariant = _dereq_(173);
21376  * Constructs an enumeration with keys equal to their value.
21378  * For example:
21380  *   var COLORS = keyMirror({blue: null, red: null});
21381  *   var myColor = COLORS.blue;
21382  *   var isColorValid = !!COLORS[myColor];
21384  * The last line could not be performed if the values of the generated enum were
21385  * not equal to their keys.
21387  *   Input:  {key1: val1, key2: val2}
21388  *   Output: {key1: key1, key2: key2}
21390  * @param {object} obj
21391  * @return {object}
21392  */
21393 var keyMirror = function (obj) {
21394   var ret = {};
21395   var key;
21396   !(obj instanceof Object && !Array.isArray(obj)) ? "development" !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0;
21397   for (key in obj) {
21398     if (!obj.hasOwnProperty(key)) {
21399       continue;
21400     }
21401     ret[key] = key;
21402   }
21403   return ret;
21406 module.exports = keyMirror;
21407 },{"173":173}],177:[function(_dereq_,module,exports){
21408 "use strict";
21411  * Copyright (c) 2013-present, Facebook, Inc.
21412  * All rights reserved.
21414  * This source code is licensed under the BSD-style license found in the
21415  * LICENSE file in the root directory of this source tree. An additional grant
21416  * of patent rights can be found in the PATENTS file in the same directory.
21418  */
21421  * Allows extraction of a minified key. Let's the build system minify keys
21422  * without losing the ability to dynamically use key strings as values
21423  * themselves. Pass in an object with a single key/val pair and it will return
21424  * you the string key of that single record. Suppose you want to grab the
21425  * value for a key 'className' inside of an object. Key/val minification may
21426  * have aliased that key to be 'xa12'. keyOf({className: null}) will return
21427  * 'xa12' in that case. Resolve keys you want to use once at startup time, then
21428  * reuse those resolutions.
21429  */
21430 var keyOf = function (oneKeyObj) {
21431   var key;
21432   for (key in oneKeyObj) {
21433     if (!oneKeyObj.hasOwnProperty(key)) {
21434       continue;
21435     }
21436     return key;
21437   }
21438   return null;
21441 module.exports = keyOf;
21442 },{}],178:[function(_dereq_,module,exports){
21444  * Copyright (c) 2013-present, Facebook, Inc.
21445  * All rights reserved.
21447  * This source code is licensed under the BSD-style license found in the
21448  * LICENSE file in the root directory of this source tree. An additional grant
21449  * of patent rights can be found in the PATENTS file in the same directory.
21451  */
21453 'use strict';
21455 var hasOwnProperty = Object.prototype.hasOwnProperty;
21458  * Executes the provided `callback` once for each enumerable own property in the
21459  * object and constructs a new object from the results. The `callback` is
21460  * invoked with three arguments:
21462  *  - the property value
21463  *  - the property name
21464  *  - the object being traversed
21466  * Properties that are added after the call to `mapObject` will not be visited
21467  * by `callback`. If the values of existing properties are changed, the value
21468  * passed to `callback` will be the value at the time `mapObject` visits them.
21469  * Properties that are deleted before being visited are not visited.
21471  * @grep function objectMap()
21472  * @grep function objMap()
21474  * @param {?object} object
21475  * @param {function} callback
21476  * @param {*} context
21477  * @return {?object}
21478  */
21479 function mapObject(object, callback, context) {
21480   if (!object) {
21481     return null;
21482   }
21483   var result = {};
21484   for (var name in object) {
21485     if (hasOwnProperty.call(object, name)) {
21486       result[name] = callback.call(context, object[name], name, object);
21487     }
21488   }
21489   return result;
21492 module.exports = mapObject;
21493 },{}],179:[function(_dereq_,module,exports){
21495  * Copyright (c) 2013-present, Facebook, Inc.
21496  * All rights reserved.
21498  * This source code is licensed under the BSD-style license found in the
21499  * LICENSE file in the root directory of this source tree. An additional grant
21500  * of patent rights can be found in the PATENTS file in the same directory.
21502  * @typechecks static-only
21503  */
21505 'use strict';
21508  * Memoizes the return value of a function that accepts one string argument.
21510  * @param {function} callback
21511  * @return {function}
21512  */
21514 function memoizeStringOnly(callback) {
21515   var cache = {};
21516   return function (string) {
21517     if (!cache.hasOwnProperty(string)) {
21518       cache[string] = callback.call(this, string);
21519     }
21520     return cache[string];
21521   };
21524 module.exports = memoizeStringOnly;
21525 },{}],180:[function(_dereq_,module,exports){
21527  * Copyright (c) 2013-present, Facebook, Inc.
21528  * All rights reserved.
21530  * This source code is licensed under the BSD-style license found in the
21531  * LICENSE file in the root directory of this source tree. An additional grant
21532  * of patent rights can be found in the PATENTS file in the same directory.
21534  * @typechecks
21535  */
21537 'use strict';
21539 var ExecutionEnvironment = _dereq_(159);
21541 var performance;
21543 if (ExecutionEnvironment.canUseDOM) {
21544   performance = window.performance || window.msPerformance || window.webkitPerformance;
21547 module.exports = performance || {};
21548 },{"159":159}],181:[function(_dereq_,module,exports){
21549 'use strict';
21552  * Copyright (c) 2013-present, Facebook, Inc.
21553  * All rights reserved.
21555  * This source code is licensed under the BSD-style license found in the
21556  * LICENSE file in the root directory of this source tree. An additional grant
21557  * of patent rights can be found in the PATENTS file in the same directory.
21559  * @typechecks
21560  */
21562 var performance = _dereq_(180);
21564 var performanceNow;
21567  * Detect if we can use `window.performance.now()` and gracefully fallback to
21568  * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
21569  * because of Facebook's testing infrastructure.
21570  */
21571 if (performance.now) {
21572   performanceNow = function () {
21573     return performance.now();
21574   };
21575 } else {
21576   performanceNow = function () {
21577     return Date.now();
21578   };
21581 module.exports = performanceNow;
21582 },{"180":180}],182:[function(_dereq_,module,exports){
21584  * Copyright (c) 2013-present, Facebook, Inc.
21585  * All rights reserved.
21587  * This source code is licensed under the BSD-style license found in the
21588  * LICENSE file in the root directory of this source tree. An additional grant
21589  * of patent rights can be found in the PATENTS file in the same directory.
21591  * @typechecks
21592  * 
21593  */
21595 /*eslint-disable no-self-compare */
21597 'use strict';
21599 var hasOwnProperty = Object.prototype.hasOwnProperty;
21602  * inlined Object.is polyfill to avoid requiring consumers ship their own
21603  * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
21604  */
21605 function is(x, y) {
21606   // SameValue algorithm
21607   if (x === y) {
21608     // Steps 1-5, 7-10
21609     // Steps 6.b-6.e: +0 != -0
21610     return x !== 0 || 1 / x === 1 / y;
21611   } else {
21612     // Step 6.a: NaN == NaN
21613     return x !== x && y !== y;
21614   }
21618  * Performs equality by iterating through keys on an object and returning false
21619  * when any key has values which are not strictly equal between the arguments.
21620  * Returns true when the values of all keys are strictly equal.
21621  */
21622 function shallowEqual(objA, objB) {
21623   if (is(objA, objB)) {
21624     return true;
21625   }
21627   if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
21628     return false;
21629   }
21631   var keysA = Object.keys(objA);
21632   var keysB = Object.keys(objB);
21634   if (keysA.length !== keysB.length) {
21635     return false;
21636   }
21638   // Test for A's keys different from B.
21639   for (var i = 0; i < keysA.length; i++) {
21640     if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
21641       return false;
21642     }
21643   }
21645   return true;
21648 module.exports = shallowEqual;
21649 },{}],183:[function(_dereq_,module,exports){
21651  * Copyright 2014-2015, Facebook, Inc.
21652  * All rights reserved.
21654  * This source code is licensed under the BSD-style license found in the
21655  * LICENSE file in the root directory of this source tree. An additional grant
21656  * of patent rights can be found in the PATENTS file in the same directory.
21658  */
21660 'use strict';
21662 var emptyFunction = _dereq_(165);
21665  * Similar to invariant but only logs a warning if the condition is not met.
21666  * This can be used to log issues in development environments in critical
21667  * paths. Removing the logging code for production environments will keep the
21668  * same logic and follow the same code paths.
21669  */
21671 var warning = emptyFunction;
21673 if ("development" !== 'production') {
21674   warning = function (condition, format) {
21675     for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
21676       args[_key - 2] = arguments[_key];
21677     }
21679     if (format === undefined) {
21680       throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
21681     }
21683     if (format.indexOf('Failed Composite propType: ') === 0) {
21684       return; // Ignore CompositeComponent proptype check.
21685     }
21687     if (!condition) {
21688       var argIndex = 0;
21689       var message = 'Warning: ' + format.replace(/%s/g, function () {
21690         return args[argIndex++];
21691       });
21692       if (typeof console !== 'undefined') {
21693         console.error(message);
21694       }
21695       try {
21696         // --- Welcome to debugging React ---
21697         // This error was thrown as a convenience so that you can use this stack
21698         // to find the callsite that caused this warning to fire.
21699         throw new Error(message);
21700       } catch (x) {}
21701     }
21702   };
21705 module.exports = warning;
21706 },{"165":165}],184:[function(_dereq_,module,exports){
21707 'use strict';
21708 /* eslint-disable no-unused-vars */
21709 var hasOwnProperty = Object.prototype.hasOwnProperty;
21710 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
21712 function toObject(val) {
21713         if (val === null || val === undefined) {
21714                 throw new TypeError('Object.assign cannot be called with null or undefined');
21715         }
21717         return Object(val);
21720 function shouldUseNative() {
21721         try {
21722                 if (!Object.assign) {
21723                         return false;
21724                 }
21726                 // Detect buggy property enumeration order in older V8 versions.
21728                 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
21729                 var test1 = new String('abc');  // eslint-disable-line
21730                 test1[5] = 'de';
21731                 if (Object.getOwnPropertyNames(test1)[0] === '5') {
21732                         return false;
21733                 }
21735                 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
21736                 var test2 = {};
21737                 for (var i = 0; i < 10; i++) {
21738                         test2['_' + String.fromCharCode(i)] = i;
21739                 }
21740                 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
21741                         return test2[n];
21742                 });
21743                 if (order2.join('') !== '0123456789') {
21744                         return false;
21745                 }
21747                 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
21748                 var test3 = {};
21749                 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
21750                         test3[letter] = letter;
21751                 });
21752                 if (Object.keys(Object.assign({}, test3)).join('') !==
21753                                 'abcdefghijklmnopqrst') {
21754                         return false;
21755                 }
21757                 return true;
21758         } catch (e) {
21759                 // We don't expect any of the above to throw, but better to be safe.
21760                 return false;
21761         }
21764 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
21765         var from;
21766         var to = toObject(target);
21767         var symbols;
21769         for (var s = 1; s < arguments.length; s++) {
21770                 from = Object(arguments[s]);
21772                 for (var key in from) {
21773                         if (hasOwnProperty.call(from, key)) {
21774                                 to[key] = from[key];
21775                         }
21776                 }
21778                 if (Object.getOwnPropertySymbols) {
21779                         symbols = Object.getOwnPropertySymbols(from);
21780                         for (var i = 0; i < symbols.length; i++) {
21781                                 if (propIsEnumerable.call(from, symbols[i])) {
21782                                         to[symbols[i]] = from[symbols[i]];
21783                                 }
21784                         }
21785                 }
21786         }
21788         return to;
21791 },{}]},{},[107])(107)