UNPKG

780 kBJavaScriptView Raw
1 /**
2 * React (with addons) v15.3.2
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 */
15
16'use strict';
17
18var ReactDOMComponentTree = _dereq_(46);
19
20var focusNode = _dereq_(172);
21
22var AutoFocusUtils = {
23 focusDOMComponent: function () {
24 focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
25 }
26};
27
28module.exports = AutoFocusUtils;
29},{"172":172,"46":46}],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 */
40
41'use strict';
42
43var EventConstants = _dereq_(16);
44var EventPropagators = _dereq_(20);
45var ExecutionEnvironment = _dereq_(164);
46var FallbackCompositionState = _dereq_(21);
47var SyntheticCompositionEvent = _dereq_(116);
48var SyntheticInputEvent = _dereq_(120);
49
50var keyOf = _dereq_(182);
51
52var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
53var START_KEYCODE = 229;
54
55var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
56
57var documentMode = null;
58if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
59 documentMode = document.documentMode;
60}
61
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.
65var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
66
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.
70var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
71
72/**
73 * Opera <= 12 includes TextEvent in window, but does not fire
74 * text input events. Rely on keypress instead.
75 */
76function isPresto() {
77 var opera = window.opera;
78 return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
79}
80
81var SPACEBAR_CODE = 32;
82var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
83
84var topLevelTypes = EventConstants.topLevelTypes;
85
86// Events and their corresponding property names.
87var 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 }
116};
117
118// Track whether we've ever handled a keypress on the space key.
119var hasSpaceKeypress = false;
120
121/**
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 */
126function 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);
130}
131
132/**
133 * Translate native top level events into event types.
134 *
135 * @param {string} topLevelType
136 * @return {object}
137 */
138function 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 }
147}
148
149/**
150 * Does our fallback best-guess model think this event signifies that
151 * composition has begun?
152 *
153 * @param {string} topLevelType
154 * @param {object} nativeEvent
155 * @return {boolean}
156 */
157function isFallbackCompositionStart(topLevelType, nativeEvent) {
158 return topLevelType === topLevelTypes.topKeyDown && nativeEvent.keyCode === START_KEYCODE;
159}
160
161/**
162 * Does our fallback mode think that this event is the end of composition?
163 *
164 * @param {string} topLevelType
165 * @param {object} nativeEvent
166 * @return {boolean}
167 */
168function 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 }
185}
186
187/**
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.
192 *
193 * @param {object} nativeEvent
194 * @return {?string}
195 */
196function getDataFromCustomEvent(nativeEvent) {
197 var detail = nativeEvent.detail;
198 if (typeof detail === 'object' && 'data' in detail) {
199 return detail.data;
200 }
201 return null;
202}
203
204// Track the current IME composition fallback object, if any.
205var currentComposition = null;
206
207/**
208 * @return {?object} A SyntheticCompositionEvent.
209 */
210function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
211 var eventType;
212 var fallbackData;
213
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 }
223
224 if (!eventType) {
225 return null;
226 }
227
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 }
239
240 var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
241
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 }
252
253 EventPropagators.accumulateTwoPhaseDispatches(event);
254 return event;
255}
256
257/**
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 */
262function 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 }
285
286 hasSpaceKeypress = true;
287 return SPACEBAR_CHAR;
288
289 case topLevelTypes.topTextInput:
290 // Record the characters to be added to the DOM.
291 var chars = nativeEvent.data;
292
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 }
299
300 return chars;
301
302 default:
303 // For other native event types, do nothing.
304 return null;
305 }
306}
307
308/**
309 * For browsers that do not provide the `textInput` event, extract the
310 * appropriate string to use for SyntheticInputEvent.
311 *
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 */
316function 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 composition event is available, we extract a string only at
320 // compositionevent, otherwise extract it at fallback events.
321 if (currentComposition) {
322 if (topLevelType === topLevelTypes.topCompositionEnd || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
323 var chars = currentComposition.getData();
324 FallbackCompositionState.release(currentComposition);
325 currentComposition = null;
326 return chars;
327 }
328 return null;
329 }
330
331 switch (topLevelType) {
332 case topLevelTypes.topPaste:
333 // If a paste event occurs after a keypress, throw out the input
334 // chars. Paste events should not lead to BeforeInput events.
335 return null;
336 case topLevelTypes.topKeyPress:
337 /**
338 * As of v27, Firefox may fire keypress events even when no character
339 * will be inserted. A few possibilities:
340 *
341 * - `which` is `0`. Arrow keys, Esc key, etc.
342 *
343 * - `which` is the pressed key code, but no char is available.
344 * Ex: 'AltGr + d` in Polish. There is no modified character for
345 * this key combination and no character is inserted into the
346 * document, but FF fires the keypress for char code `100` anyway.
347 * No `input` event will occur.
348 *
349 * - `which` is the pressed key code, but a command combination is
350 * being used. Ex: `Cmd+C`. No character is inserted, and no
351 * `input` event will occur.
352 */
353 if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
354 return String.fromCharCode(nativeEvent.which);
355 }
356 return null;
357 case topLevelTypes.topCompositionEnd:
358 return useFallbackCompositionData ? null : nativeEvent.data;
359 default:
360 return null;
361 }
362}
363
364/**
365 * Extract a SyntheticInputEvent for `beforeInput`, based on either native
366 * `textInput` or fallback behavior.
367 *
368 * @return {?object} A SyntheticInputEvent.
369 */
370function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
371 var chars;
372
373 if (canUseTextInputEvent) {
374 chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
375 } else {
376 chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
377 }
378
379 // If no characters are being inserted, no BeforeInput event should
380 // be fired.
381 if (!chars) {
382 return null;
383 }
384
385 var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
386
387 event.data = chars;
388 EventPropagators.accumulateTwoPhaseDispatches(event);
389 return event;
390}
391
392/**
393 * Create an `onBeforeInput` event to match
394 * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
395 *
396 * This event plugin is based on the native `textInput` event
397 * available in Chrome, Safari, Opera, and IE. This event fires after
398 * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
399 *
400 * `beforeInput` is spec'd but not implemented in any browsers, and
401 * the `input` event does not provide any useful information about what has
402 * actually been added, contrary to the spec. Thus, `textInput` is the best
403 * available event to identify the characters that have actually been inserted
404 * into the target node.
405 *
406 * This plugin is also responsible for emitting `composition` events, thus
407 * allowing us to share composition fallback code for both `beforeInput` and
408 * `composition` event types.
409 */
410var BeforeInputEventPlugin = {
411
412 eventTypes: eventTypes,
413
414 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
415 return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
416 }
417};
418
419module.exports = BeforeInputEventPlugin;
420},{"116":116,"120":120,"16":16,"164":164,"182":182,"20":20,"21":21}],3:[function(_dereq_,module,exports){
421/**
422 * Copyright 2013-present, Facebook, Inc.
423 * All rights reserved.
424 *
425 * This source code is licensed under the BSD-style license found in the
426 * LICENSE file in the root directory of this source tree. An additional grant
427 * of patent rights can be found in the PATENTS file in the same directory.
428 *
429 * @providesModule CSSProperty
430 */
431
432'use strict';
433
434/**
435 * CSS properties which accept numbers but are not in units of "px".
436 */
437
438var isUnitlessNumber = {
439 animationIterationCount: true,
440 borderImageOutset: true,
441 borderImageSlice: true,
442 borderImageWidth: true,
443 boxFlex: true,
444 boxFlexGroup: true,
445 boxOrdinalGroup: true,
446 columnCount: true,
447 flex: true,
448 flexGrow: true,
449 flexPositive: true,
450 flexShrink: true,
451 flexNegative: true,
452 flexOrder: true,
453 gridRow: true,
454 gridColumn: true,
455 fontWeight: true,
456 lineClamp: true,
457 lineHeight: true,
458 opacity: true,
459 order: true,
460 orphans: true,
461 tabSize: true,
462 widows: true,
463 zIndex: true,
464 zoom: true,
465
466 // SVG-related properties
467 fillOpacity: true,
468 floodOpacity: true,
469 stopOpacity: true,
470 strokeDasharray: true,
471 strokeDashoffset: true,
472 strokeMiterlimit: true,
473 strokeOpacity: true,
474 strokeWidth: true
475};
476
477/**
478 * @param {string} prefix vendor-specific prefix, eg: Webkit
479 * @param {string} key style name, eg: transitionDuration
480 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
481 * WebkitTransitionDuration
482 */
483function prefixKey(prefix, key) {
484 return prefix + key.charAt(0).toUpperCase() + key.substring(1);
485}
486
487/**
488 * Support style names that may come passed in prefixed by adding permutations
489 * of vendor prefixes.
490 */
491var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
492
493// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
494// infinite loop, because it iterates over the newly added props too.
495Object.keys(isUnitlessNumber).forEach(function (prop) {
496 prefixes.forEach(function (prefix) {
497 isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
498 });
499});
500
501/**
502 * Most style properties can be unset by doing .style[prop] = '' but IE8
503 * doesn't like doing that with shorthand properties so for the properties that
504 * IE8 breaks on, which are listed here, we instead unset each of the
505 * individual properties. See http://bugs.jquery.com/ticket/12385.
506 * The 4-value 'clock' properties like margin, padding, border-width seem to
507 * behave without any problems. Curiously, list-style works too without any
508 * special prodding.
509 */
510var shorthandPropertyExpansions = {
511 background: {
512 backgroundAttachment: true,
513 backgroundColor: true,
514 backgroundImage: true,
515 backgroundPositionX: true,
516 backgroundPositionY: true,
517 backgroundRepeat: true
518 },
519 backgroundPosition: {
520 backgroundPositionX: true,
521 backgroundPositionY: true
522 },
523 border: {
524 borderWidth: true,
525 borderStyle: true,
526 borderColor: true
527 },
528 borderBottom: {
529 borderBottomWidth: true,
530 borderBottomStyle: true,
531 borderBottomColor: true
532 },
533 borderLeft: {
534 borderLeftWidth: true,
535 borderLeftStyle: true,
536 borderLeftColor: true
537 },
538 borderRight: {
539 borderRightWidth: true,
540 borderRightStyle: true,
541 borderRightColor: true
542 },
543 borderTop: {
544 borderTopWidth: true,
545 borderTopStyle: true,
546 borderTopColor: true
547 },
548 font: {
549 fontStyle: true,
550 fontVariant: true,
551 fontWeight: true,
552 fontSize: true,
553 lineHeight: true,
554 fontFamily: true
555 },
556 outline: {
557 outlineWidth: true,
558 outlineStyle: true,
559 outlineColor: true
560 }
561};
562
563var CSSProperty = {
564 isUnitlessNumber: isUnitlessNumber,
565 shorthandPropertyExpansions: shorthandPropertyExpansions
566};
567
568module.exports = CSSProperty;
569},{}],4:[function(_dereq_,module,exports){
570/**
571 * Copyright 2013-present, Facebook, Inc.
572 * All rights reserved.
573 *
574 * This source code is licensed under the BSD-style license found in the
575 * LICENSE file in the root directory of this source tree. An additional grant
576 * of patent rights can be found in the PATENTS file in the same directory.
577 *
578 * @providesModule CSSPropertyOperations
579 */
580
581'use strict';
582
583var CSSProperty = _dereq_(3);
584var ExecutionEnvironment = _dereq_(164);
585var ReactInstrumentation = _dereq_(78);
586
587var camelizeStyleName = _dereq_(166);
588var dangerousStyleValue = _dereq_(134);
589var hyphenateStyleName = _dereq_(177);
590var memoizeStringOnly = _dereq_(183);
591var warning = _dereq_(187);
592
593var processStyleName = memoizeStringOnly(function (styleName) {
594 return hyphenateStyleName(styleName);
595});
596
597var hasShorthandPropertyBug = false;
598var styleFloatAccessor = 'cssFloat';
599if (ExecutionEnvironment.canUseDOM) {
600 var tempStyle = document.createElement('div').style;
601 try {
602 // IE8 throws "Invalid argument." if resetting shorthand style properties.
603 tempStyle.font = '';
604 } catch (e) {
605 hasShorthandPropertyBug = true;
606 }
607 // IE8 only supports accessing cssFloat (standard) as styleFloat
608 if (document.documentElement.style.cssFloat === undefined) {
609 styleFloatAccessor = 'styleFloat';
610 }
611}
612
613if ("development" !== 'production') {
614 // 'msTransform' is correct, but the other prefixes should be capitalized
615 var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
616
617 // style values shouldn't contain a semicolon
618 var badStyleValueWithSemicolonPattern = /;\s*$/;
619
620 var warnedStyleNames = {};
621 var warnedStyleValues = {};
622 var warnedForNaNValue = false;
623
624 var warnHyphenatedStyleName = function (name, owner) {
625 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
626 return;
627 }
628
629 warnedStyleNames[name] = true;
630 "development" !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
631 };
632
633 var warnBadVendoredStyleName = function (name, owner) {
634 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
635 return;
636 }
637
638 warnedStyleNames[name] = true;
639 "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;
640 };
641
642 var warnStyleValueWithSemicolon = function (name, value, owner) {
643 if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
644 return;
645 }
646
647 warnedStyleValues[value] = true;
648 "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;
649 };
650
651 var warnStyleValueIsNaN = function (name, value, owner) {
652 if (warnedForNaNValue) {
653 return;
654 }
655
656 warnedForNaNValue = true;
657 "development" !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
658 };
659
660 var checkRenderMessage = function (owner) {
661 if (owner) {
662 var name = owner.getName();
663 if (name) {
664 return ' Check the render method of `' + name + '`.';
665 }
666 }
667 return '';
668 };
669
670 /**
671 * @param {string} name
672 * @param {*} value
673 * @param {ReactDOMComponent} component
674 */
675 var warnValidStyle = function (name, value, component) {
676 var owner;
677 if (component) {
678 owner = component._currentElement._owner;
679 }
680 if (name.indexOf('-') > -1) {
681 warnHyphenatedStyleName(name, owner);
682 } else if (badVendoredStyleNamePattern.test(name)) {
683 warnBadVendoredStyleName(name, owner);
684 } else if (badStyleValueWithSemicolonPattern.test(value)) {
685 warnStyleValueWithSemicolon(name, value, owner);
686 }
687
688 if (typeof value === 'number' && isNaN(value)) {
689 warnStyleValueIsNaN(name, value, owner);
690 }
691 };
692}
693
694/**
695 * Operations for dealing with CSS properties.
696 */
697var CSSPropertyOperations = {
698
699 /**
700 * Serializes a mapping of style properties for use as inline styles:
701 *
702 * > createMarkupForStyles({width: '200px', height: 0})
703 * "width:200px;height:0;"
704 *
705 * Undefined values are ignored so that declarative programming is easier.
706 * The result should be HTML-escaped before insertion into the DOM.
707 *
708 * @param {object} styles
709 * @param {ReactDOMComponent} component
710 * @return {?string}
711 */
712 createMarkupForStyles: function (styles, component) {
713 var serialized = '';
714 for (var styleName in styles) {
715 if (!styles.hasOwnProperty(styleName)) {
716 continue;
717 }
718 var styleValue = styles[styleName];
719 if ("development" !== 'production') {
720 warnValidStyle(styleName, styleValue, component);
721 }
722 if (styleValue != null) {
723 serialized += processStyleName(styleName) + ':';
724 serialized += dangerousStyleValue(styleName, styleValue, component) + ';';
725 }
726 }
727 return serialized || null;
728 },
729
730 /**
731 * Sets the value for multiple styles on a node. If a value is specified as
732 * '' (empty string), the corresponding style property will be unset.
733 *
734 * @param {DOMElement} node
735 * @param {object} styles
736 * @param {ReactDOMComponent} component
737 */
738 setValueForStyles: function (node, styles, component) {
739 if ("development" !== 'production') {
740 ReactInstrumentation.debugTool.onHostOperation(component._debugID, 'update styles', styles);
741 }
742
743 var style = node.style;
744 for (var styleName in styles) {
745 if (!styles.hasOwnProperty(styleName)) {
746 continue;
747 }
748 if ("development" !== 'production') {
749 warnValidStyle(styleName, styles[styleName], component);
750 }
751 var styleValue = dangerousStyleValue(styleName, styles[styleName], component);
752 if (styleName === 'float' || styleName === 'cssFloat') {
753 styleName = styleFloatAccessor;
754 }
755 if (styleValue) {
756 style[styleName] = styleValue;
757 } else {
758 var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
759 if (expansion) {
760 // Shorthand property that IE8 won't like unsetting, so unset each
761 // component to placate it
762 for (var individualStyleName in expansion) {
763 style[individualStyleName] = '';
764 }
765 } else {
766 style[styleName] = '';
767 }
768 }
769 }
770 }
771
772};
773
774module.exports = CSSPropertyOperations;
775},{"134":134,"164":164,"166":166,"177":177,"183":183,"187":187,"3":3,"78":78}],5:[function(_dereq_,module,exports){
776/**
777 * Copyright 2013-present, Facebook, Inc.
778 * All rights reserved.
779 *
780 * This source code is licensed under the BSD-style license found in the
781 * LICENSE file in the root directory of this source tree. An additional grant
782 * of patent rights can be found in the PATENTS file in the same directory.
783 *
784 * @providesModule CallbackQueue
785 */
786
787'use strict';
788
789var _prodInvariant = _dereq_(153),
790 _assign = _dereq_(188);
791
792var PooledClass = _dereq_(26);
793
794var invariant = _dereq_(178);
795
796/**
797 * A specialized pseudo-event module to help keep track of components waiting to
798 * be notified when their DOM representations are available for use.
799 *
800 * This implements `PooledClass`, so you should never need to instantiate this.
801 * Instead, use `CallbackQueue.getPooled()`.
802 *
803 * @class ReactMountReady
804 * @implements PooledClass
805 * @internal
806 */
807function CallbackQueue() {
808 this._callbacks = null;
809 this._contexts = null;
810}
811
812_assign(CallbackQueue.prototype, {
813
814 /**
815 * Enqueues a callback to be invoked when `notifyAll` is invoked.
816 *
817 * @param {function} callback Invoked when `notifyAll` is invoked.
818 * @param {?object} context Context to call `callback` with.
819 * @internal
820 */
821 enqueue: function (callback, context) {
822 this._callbacks = this._callbacks || [];
823 this._contexts = this._contexts || [];
824 this._callbacks.push(callback);
825 this._contexts.push(context);
826 },
827
828 /**
829 * Invokes all enqueued callbacks and clears the queue. This is invoked after
830 * the DOM representation of a component has been created or updated.
831 *
832 * @internal
833 */
834 notifyAll: function () {
835 var callbacks = this._callbacks;
836 var contexts = this._contexts;
837 if (callbacks) {
838 !(callbacks.length === contexts.length) ? "development" !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0;
839 this._callbacks = null;
840 this._contexts = null;
841 for (var i = 0; i < callbacks.length; i++) {
842 callbacks[i].call(contexts[i]);
843 }
844 callbacks.length = 0;
845 contexts.length = 0;
846 }
847 },
848
849 checkpoint: function () {
850 return this._callbacks ? this._callbacks.length : 0;
851 },
852
853 rollback: function (len) {
854 if (this._callbacks) {
855 this._callbacks.length = len;
856 this._contexts.length = len;
857 }
858 },
859
860 /**
861 * Resets the internal queue.
862 *
863 * @internal
864 */
865 reset: function () {
866 this._callbacks = null;
867 this._contexts = null;
868 },
869
870 /**
871 * `PooledClass` looks for this.
872 */
873 destructor: function () {
874 this.reset();
875 }
876
877});
878
879PooledClass.addPoolingTo(CallbackQueue);
880
881module.exports = CallbackQueue;
882},{"153":153,"178":178,"188":188,"26":26}],6:[function(_dereq_,module,exports){
883/**
884 * Copyright 2013-present, Facebook, Inc.
885 * All rights reserved.
886 *
887 * This source code is licensed under the BSD-style license found in the
888 * LICENSE file in the root directory of this source tree. An additional grant
889 * of patent rights can be found in the PATENTS file in the same directory.
890 *
891 * @providesModule ChangeEventPlugin
892 */
893
894'use strict';
895
896var EventConstants = _dereq_(16);
897var EventPluginHub = _dereq_(17);
898var EventPropagators = _dereq_(20);
899var ExecutionEnvironment = _dereq_(164);
900var ReactDOMComponentTree = _dereq_(46);
901var ReactUpdates = _dereq_(107);
902var SyntheticEvent = _dereq_(118);
903
904var getEventTarget = _dereq_(142);
905var isEventSupported = _dereq_(149);
906var isTextInputElement = _dereq_(150);
907var keyOf = _dereq_(182);
908
909var topLevelTypes = EventConstants.topLevelTypes;
910
911var eventTypes = {
912 change: {
913 phasedRegistrationNames: {
914 bubbled: keyOf({ onChange: null }),
915 captured: keyOf({ onChangeCapture: null })
916 },
917 dependencies: [topLevelTypes.topBlur, topLevelTypes.topChange, topLevelTypes.topClick, topLevelTypes.topFocus, topLevelTypes.topInput, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topSelectionChange]
918 }
919};
920
921/**
922 * For IE shims
923 */
924var activeElement = null;
925var activeElementInst = null;
926var activeElementValue = null;
927var activeElementValueProp = null;
928
929/**
930 * SECTION: handle `change` event
931 */
932function shouldUseChangeEvent(elem) {
933 var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
934 return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
935}
936
937var doesChangeEventBubble = false;
938if (ExecutionEnvironment.canUseDOM) {
939 // See `handleChange` comment below
940 doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8);
941}
942
943function manualDispatchChangeEvent(nativeEvent) {
944 var event = SyntheticEvent.getPooled(eventTypes.change, activeElementInst, nativeEvent, getEventTarget(nativeEvent));
945 EventPropagators.accumulateTwoPhaseDispatches(event);
946
947 // If change and propertychange bubbled, we'd just bind to it like all the
948 // other events and have it go through ReactBrowserEventEmitter. Since it
949 // doesn't, we manually listen for the events and so we have to enqueue and
950 // process the abstract event manually.
951 //
952 // Batching is necessary here in order to ensure that all event handlers run
953 // before the next rerender (including event handlers attached to ancestor
954 // elements instead of directly on the input). Without this, controlled
955 // components don't work properly in conjunction with event bubbling because
956 // the component is rerendered and the value reverted before all the event
957 // handlers can run. See https://github.com/facebook/react/issues/708.
958 ReactUpdates.batchedUpdates(runEventInBatch, event);
959}
960
961function runEventInBatch(event) {
962 EventPluginHub.enqueueEvents(event);
963 EventPluginHub.processEventQueue(false);
964}
965
966function startWatchingForChangeEventIE8(target, targetInst) {
967 activeElement = target;
968 activeElementInst = targetInst;
969 activeElement.attachEvent('onchange', manualDispatchChangeEvent);
970}
971
972function stopWatchingForChangeEventIE8() {
973 if (!activeElement) {
974 return;
975 }
976 activeElement.detachEvent('onchange', manualDispatchChangeEvent);
977 activeElement = null;
978 activeElementInst = null;
979}
980
981function getTargetInstForChangeEvent(topLevelType, targetInst) {
982 if (topLevelType === topLevelTypes.topChange) {
983 return targetInst;
984 }
985}
986function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
987 if (topLevelType === topLevelTypes.topFocus) {
988 // stopWatching() should be a noop here but we call it just in case we
989 // missed a blur event somehow.
990 stopWatchingForChangeEventIE8();
991 startWatchingForChangeEventIE8(target, targetInst);
992 } else if (topLevelType === topLevelTypes.topBlur) {
993 stopWatchingForChangeEventIE8();
994 }
995}
996
997/**
998 * SECTION: handle `input` event
999 */
1000var isInputEventSupported = false;
1001if (ExecutionEnvironment.canUseDOM) {
1002 // IE9 claims to support the input event but fails to trigger it when
1003 // deleting text, so we ignore its input events.
1004 // IE10+ fire input events to often, such when a placeholder
1005 // changes or when an input with a placeholder is focused.
1006 isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 11);
1007}
1008
1009/**
1010 * (For IE <=11) Replacement getter/setter for the `value` property that gets
1011 * set on the active element.
1012 */
1013var newValueProp = {
1014 get: function () {
1015 return activeElementValueProp.get.call(this);
1016 },
1017 set: function (val) {
1018 // Cast to a string so we can do equality checks.
1019 activeElementValue = '' + val;
1020 activeElementValueProp.set.call(this, val);
1021 }
1022};
1023
1024/**
1025 * (For IE <=11) Starts tracking propertychange events on the passed-in element
1026 * and override the value property so that we can distinguish user events from
1027 * value changes in JS.
1028 */
1029function startWatchingForValueChange(target, targetInst) {
1030 activeElement = target;
1031 activeElementInst = targetInst;
1032 activeElementValue = target.value;
1033 activeElementValueProp = Object.getOwnPropertyDescriptor(target.constructor.prototype, 'value');
1034
1035 // Not guarded in a canDefineProperty check: IE8 supports defineProperty only
1036 // on DOM elements
1037 Object.defineProperty(activeElement, 'value', newValueProp);
1038 if (activeElement.attachEvent) {
1039 activeElement.attachEvent('onpropertychange', handlePropertyChange);
1040 } else {
1041 activeElement.addEventListener('propertychange', handlePropertyChange, false);
1042 }
1043}
1044
1045/**
1046 * (For IE <=11) Removes the event listeners from the currently-tracked element,
1047 * if any exists.
1048 */
1049function stopWatchingForValueChange() {
1050 if (!activeElement) {
1051 return;
1052 }
1053
1054 // delete restores the original property definition
1055 delete activeElement.value;
1056
1057 if (activeElement.detachEvent) {
1058 activeElement.detachEvent('onpropertychange', handlePropertyChange);
1059 } else {
1060 activeElement.removeEventListener('propertychange', handlePropertyChange, false);
1061 }
1062
1063 activeElement = null;
1064 activeElementInst = null;
1065 activeElementValue = null;
1066 activeElementValueProp = null;
1067}
1068
1069/**
1070 * (For IE <=11) Handles a propertychange event, sending a `change` event if
1071 * the value of the active element has changed.
1072 */
1073function handlePropertyChange(nativeEvent) {
1074 if (nativeEvent.propertyName !== 'value') {
1075 return;
1076 }
1077 var value = nativeEvent.srcElement.value;
1078 if (value === activeElementValue) {
1079 return;
1080 }
1081 activeElementValue = value;
1082
1083 manualDispatchChangeEvent(nativeEvent);
1084}
1085
1086/**
1087 * If a `change` event should be fired, returns the target's ID.
1088 */
1089function getTargetInstForInputEvent(topLevelType, targetInst) {
1090 if (topLevelType === topLevelTypes.topInput) {
1091 // In modern browsers (i.e., not IE8 or IE9), the input event is exactly
1092 // what we want so fall through here and trigger an abstract event
1093 return targetInst;
1094 }
1095}
1096
1097function handleEventsForInputEventIE(topLevelType, target, targetInst) {
1098 if (topLevelType === topLevelTypes.topFocus) {
1099 // In IE8, we can capture almost all .value changes by adding a
1100 // propertychange handler and looking for events with propertyName
1101 // equal to 'value'
1102 // In IE9-11, propertychange fires for most input events but is buggy and
1103 // doesn't fire when text is deleted, but conveniently, selectionchange
1104 // appears to fire in all of the remaining cases so we catch those and
1105 // forward the event if the value has changed
1106 // In either case, we don't want to call the event handler if the value
1107 // is changed from JS so we redefine a setter for `.value` that updates
1108 // our activeElementValue variable, allowing us to ignore those changes
1109 //
1110 // stopWatching() should be a noop here but we call it just in case we
1111 // missed a blur event somehow.
1112 stopWatchingForValueChange();
1113 startWatchingForValueChange(target, targetInst);
1114 } else if (topLevelType === topLevelTypes.topBlur) {
1115 stopWatchingForValueChange();
1116 }
1117}
1118
1119// For IE8 and IE9.
1120function getTargetInstForInputEventIE(topLevelType, targetInst) {
1121 if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
1122 // On the selectionchange event, the target is just document which isn't
1123 // helpful for us so just check activeElement instead.
1124 //
1125 // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
1126 // propertychange on the first input event after setting `value` from a
1127 // script and fires only keydown, keypress, keyup. Catching keyup usually
1128 // gets it and catching keydown lets us fire an event for the first
1129 // keystroke if user does a key repeat (it'll be a little delayed: right
1130 // before the second keystroke). Other input methods (e.g., paste) seem to
1131 // fire selectionchange normally.
1132 if (activeElement && activeElement.value !== activeElementValue) {
1133 activeElementValue = activeElement.value;
1134 return activeElementInst;
1135 }
1136 }
1137}
1138
1139/**
1140 * SECTION: handle `click` event
1141 */
1142function shouldUseClickEvent(elem) {
1143 // Use the `click` event to detect changes to checkbox and radio inputs.
1144 // This approach works across all browsers, whereas `change` does not fire
1145 // until `blur` in IE8.
1146 return elem.nodeName && elem.nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
1147}
1148
1149function getTargetInstForClickEvent(topLevelType, targetInst) {
1150 if (topLevelType === topLevelTypes.topClick) {
1151 return targetInst;
1152 }
1153}
1154
1155/**
1156 * This plugin creates an `onChange` event that normalizes change events
1157 * across form elements. This event fires at a time when it's possible to
1158 * change the element's value without seeing a flicker.
1159 *
1160 * Supported elements are:
1161 * - input (see `isTextInputElement`)
1162 * - textarea
1163 * - select
1164 */
1165var ChangeEventPlugin = {
1166
1167 eventTypes: eventTypes,
1168
1169 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
1170 var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
1171
1172 var getTargetInstFunc, handleEventFunc;
1173 if (shouldUseChangeEvent(targetNode)) {
1174 if (doesChangeEventBubble) {
1175 getTargetInstFunc = getTargetInstForChangeEvent;
1176 } else {
1177 handleEventFunc = handleEventsForChangeEventIE8;
1178 }
1179 } else if (isTextInputElement(targetNode)) {
1180 if (isInputEventSupported) {
1181 getTargetInstFunc = getTargetInstForInputEvent;
1182 } else {
1183 getTargetInstFunc = getTargetInstForInputEventIE;
1184 handleEventFunc = handleEventsForInputEventIE;
1185 }
1186 } else if (shouldUseClickEvent(targetNode)) {
1187 getTargetInstFunc = getTargetInstForClickEvent;
1188 }
1189
1190 if (getTargetInstFunc) {
1191 var inst = getTargetInstFunc(topLevelType, targetInst);
1192 if (inst) {
1193 var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, nativeEventTarget);
1194 event.type = 'change';
1195 EventPropagators.accumulateTwoPhaseDispatches(event);
1196 return event;
1197 }
1198 }
1199
1200 if (handleEventFunc) {
1201 handleEventFunc(topLevelType, targetNode, targetInst);
1202 }
1203 }
1204
1205};
1206
1207module.exports = ChangeEventPlugin;
1208},{"107":107,"118":118,"142":142,"149":149,"150":150,"16":16,"164":164,"17":17,"182":182,"20":20,"46":46}],7:[function(_dereq_,module,exports){
1209/**
1210 * Copyright 2013-present, Facebook, Inc.
1211 * All rights reserved.
1212 *
1213 * This source code is licensed under the BSD-style license found in the
1214 * LICENSE file in the root directory of this source tree. An additional grant
1215 * of patent rights can be found in the PATENTS file in the same directory.
1216 *
1217 * @providesModule DOMChildrenOperations
1218 */
1219
1220'use strict';
1221
1222var DOMLazyTree = _dereq_(8);
1223var Danger = _dereq_(12);
1224var ReactMultiChildUpdateTypes = _dereq_(84);
1225var ReactDOMComponentTree = _dereq_(46);
1226var ReactInstrumentation = _dereq_(78);
1227
1228var createMicrosoftUnsafeLocalFunction = _dereq_(133);
1229var setInnerHTML = _dereq_(155);
1230var setTextContent = _dereq_(156);
1231
1232function getNodeAfter(parentNode, node) {
1233 // Special case for text components, which return [open, close] comments
1234 // from getHostNode.
1235 if (Array.isArray(node)) {
1236 node = node[1];
1237 }
1238 return node ? node.nextSibling : parentNode.firstChild;
1239}
1240
1241/**
1242 * Inserts `childNode` as a child of `parentNode` at the `index`.
1243 *
1244 * @param {DOMElement} parentNode Parent node in which to insert.
1245 * @param {DOMElement} childNode Child node to insert.
1246 * @param {number} index Index at which to insert the child.
1247 * @internal
1248 */
1249var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
1250 // We rely exclusively on `insertBefore(node, null)` instead of also using
1251 // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so
1252 // we are careful to use `null`.)
1253 parentNode.insertBefore(childNode, referenceNode);
1254});
1255
1256function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
1257 DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
1258}
1259
1260function moveChild(parentNode, childNode, referenceNode) {
1261 if (Array.isArray(childNode)) {
1262 moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
1263 } else {
1264 insertChildAt(parentNode, childNode, referenceNode);
1265 }
1266}
1267
1268function removeChild(parentNode, childNode) {
1269 if (Array.isArray(childNode)) {
1270 var closingComment = childNode[1];
1271 childNode = childNode[0];
1272 removeDelimitedText(parentNode, childNode, closingComment);
1273 parentNode.removeChild(closingComment);
1274 }
1275 parentNode.removeChild(childNode);
1276}
1277
1278function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {
1279 var node = openingComment;
1280 while (true) {
1281 var nextNode = node.nextSibling;
1282 insertChildAt(parentNode, node, referenceNode);
1283 if (node === closingComment) {
1284 break;
1285 }
1286 node = nextNode;
1287 }
1288}
1289
1290function removeDelimitedText(parentNode, startNode, closingComment) {
1291 while (true) {
1292 var node = startNode.nextSibling;
1293 if (node === closingComment) {
1294 // The closing comment is removed by ReactMultiChild.
1295 break;
1296 } else {
1297 parentNode.removeChild(node);
1298 }
1299 }
1300}
1301
1302function replaceDelimitedText(openingComment, closingComment, stringText) {
1303 var parentNode = openingComment.parentNode;
1304 var nodeAfterComment = openingComment.nextSibling;
1305 if (nodeAfterComment === closingComment) {
1306 // There are no text nodes between the opening and closing comments; insert
1307 // a new one if stringText isn't empty.
1308 if (stringText) {
1309 insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);
1310 }
1311 } else {
1312 if (stringText) {
1313 // Set the text content of the first node after the opening comment, and
1314 // remove all following nodes up until the closing comment.
1315 setTextContent(nodeAfterComment, stringText);
1316 removeDelimitedText(parentNode, nodeAfterComment, closingComment);
1317 } else {
1318 removeDelimitedText(parentNode, openingComment, closingComment);
1319 }
1320 }
1321
1322 if ("development" !== 'production') {
1323 ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, 'replace text', stringText);
1324 }
1325}
1326
1327var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
1328if ("development" !== 'production') {
1329 dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
1330 Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
1331 if (prevInstance._debugID !== 0) {
1332 ReactInstrumentation.debugTool.onHostOperation(prevInstance._debugID, 'replace with', markup.toString());
1333 } else {
1334 var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
1335 if (nextInstance._debugID !== 0) {
1336 ReactInstrumentation.debugTool.onHostOperation(nextInstance._debugID, 'mount', markup.toString());
1337 }
1338 }
1339 };
1340}
1341
1342/**
1343 * Operations for updating with DOM children.
1344 */
1345var DOMChildrenOperations = {
1346
1347 dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
1348
1349 replaceDelimitedText: replaceDelimitedText,
1350
1351 /**
1352 * Updates a component's children by processing a series of updates. The
1353 * update configurations are each expected to have a `parentNode` property.
1354 *
1355 * @param {array<object>} updates List of update configurations.
1356 * @internal
1357 */
1358 processUpdates: function (parentNode, updates) {
1359 if ("development" !== 'production') {
1360 var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
1361 }
1362
1363 for (var k = 0; k < updates.length; k++) {
1364 var update = updates[k];
1365 switch (update.type) {
1366 case ReactMultiChildUpdateTypes.INSERT_MARKUP:
1367 insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
1368 if ("development" !== 'production') {
1369 ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'insert child', { toIndex: update.toIndex, content: update.content.toString() });
1370 }
1371 break;
1372 case ReactMultiChildUpdateTypes.MOVE_EXISTING:
1373 moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
1374 if ("development" !== 'production') {
1375 ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'move child', { fromIndex: update.fromIndex, toIndex: update.toIndex });
1376 }
1377 break;
1378 case ReactMultiChildUpdateTypes.SET_MARKUP:
1379 setInnerHTML(parentNode, update.content);
1380 if ("development" !== 'production') {
1381 ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'replace children', update.content.toString());
1382 }
1383 break;
1384 case ReactMultiChildUpdateTypes.TEXT_CONTENT:
1385 setTextContent(parentNode, update.content);
1386 if ("development" !== 'production') {
1387 ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'replace text', update.content.toString());
1388 }
1389 break;
1390 case ReactMultiChildUpdateTypes.REMOVE_NODE:
1391 removeChild(parentNode, update.fromNode);
1392 if ("development" !== 'production') {
1393 ReactInstrumentation.debugTool.onHostOperation(parentNodeDebugID, 'remove child', { fromIndex: update.fromIndex });
1394 }
1395 break;
1396 }
1397 }
1398 }
1399
1400};
1401
1402module.exports = DOMChildrenOperations;
1403},{"12":12,"133":133,"155":155,"156":156,"46":46,"78":78,"8":8,"84":84}],8:[function(_dereq_,module,exports){
1404/**
1405 * Copyright 2015-present, Facebook, Inc.
1406 * All rights reserved.
1407 *
1408 * This source code is licensed under the BSD-style license found in the
1409 * LICENSE file in the root directory of this source tree. An additional grant
1410 * of patent rights can be found in the PATENTS file in the same directory.
1411 *
1412 * @providesModule DOMLazyTree
1413 */
1414
1415'use strict';
1416
1417var DOMNamespaces = _dereq_(9);
1418var setInnerHTML = _dereq_(155);
1419
1420var createMicrosoftUnsafeLocalFunction = _dereq_(133);
1421var setTextContent = _dereq_(156);
1422
1423var ELEMENT_NODE_TYPE = 1;
1424var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
1425
1426/**
1427 * In IE (8-11) and Edge, appending nodes with no children is dramatically
1428 * faster than appending a full subtree, so we essentially queue up the
1429 * .appendChild calls here and apply them so each node is added to its parent
1430 * before any children are added.
1431 *
1432 * In other browsers, doing so is slower or neutral compared to the other order
1433 * (in Firefox, twice as slow) so we only do this inversion in IE.
1434 *
1435 * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.
1436 */
1437var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
1438
1439function insertTreeChildren(tree) {
1440 if (!enableLazy) {
1441 return;
1442 }
1443 var node = tree.node;
1444 var children = tree.children;
1445 if (children.length) {
1446 for (var i = 0; i < children.length; i++) {
1447 insertTreeBefore(node, children[i], null);
1448 }
1449 } else if (tree.html != null) {
1450 setInnerHTML(node, tree.html);
1451 } else if (tree.text != null) {
1452 setTextContent(node, tree.text);
1453 }
1454}
1455
1456var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
1457 // DocumentFragments aren't actually part of the DOM after insertion so
1458 // appending children won't update the DOM. We need to ensure the fragment
1459 // is properly populated first, breaking out of our lazy approach for just
1460 // this level. Also, some <object> plugins (like Flash Player) will read
1461 // <param> nodes immediately upon insertion into the DOM, so <object>
1462 // must also be populated prior to insertion into the DOM.
1463 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)) {
1464 insertTreeChildren(tree);
1465 parentNode.insertBefore(tree.node, referenceNode);
1466 } else {
1467 parentNode.insertBefore(tree.node, referenceNode);
1468 insertTreeChildren(tree);
1469 }
1470});
1471
1472function replaceChildWithTree(oldNode, newTree) {
1473 oldNode.parentNode.replaceChild(newTree.node, oldNode);
1474 insertTreeChildren(newTree);
1475}
1476
1477function queueChild(parentTree, childTree) {
1478 if (enableLazy) {
1479 parentTree.children.push(childTree);
1480 } else {
1481 parentTree.node.appendChild(childTree.node);
1482 }
1483}
1484
1485function queueHTML(tree, html) {
1486 if (enableLazy) {
1487 tree.html = html;
1488 } else {
1489 setInnerHTML(tree.node, html);
1490 }
1491}
1492
1493function queueText(tree, text) {
1494 if (enableLazy) {
1495 tree.text = text;
1496 } else {
1497 setTextContent(tree.node, text);
1498 }
1499}
1500
1501function toString() {
1502 return this.node.nodeName;
1503}
1504
1505function DOMLazyTree(node) {
1506 return {
1507 node: node,
1508 children: [],
1509 html: null,
1510 text: null,
1511 toString: toString
1512 };
1513}
1514
1515DOMLazyTree.insertTreeBefore = insertTreeBefore;
1516DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
1517DOMLazyTree.queueChild = queueChild;
1518DOMLazyTree.queueHTML = queueHTML;
1519DOMLazyTree.queueText = queueText;
1520
1521module.exports = DOMLazyTree;
1522},{"133":133,"155":155,"156":156,"9":9}],9:[function(_dereq_,module,exports){
1523/**
1524 * Copyright 2013-present, Facebook, Inc.
1525 * All rights reserved.
1526 *
1527 * This source code is licensed under the BSD-style license found in the
1528 * LICENSE file in the root directory of this source tree. An additional grant
1529 * of patent rights can be found in the PATENTS file in the same directory.
1530 *
1531 * @providesModule DOMNamespaces
1532 */
1533
1534'use strict';
1535
1536var DOMNamespaces = {
1537 html: 'http://www.w3.org/1999/xhtml',
1538 mathml: 'http://www.w3.org/1998/Math/MathML',
1539 svg: 'http://www.w3.org/2000/svg'
1540};
1541
1542module.exports = DOMNamespaces;
1543},{}],10:[function(_dereq_,module,exports){
1544/**
1545 * Copyright 2013-present, Facebook, Inc.
1546 * All rights reserved.
1547 *
1548 * This source code is licensed under the BSD-style license found in the
1549 * LICENSE file in the root directory of this source tree. An additional grant
1550 * of patent rights can be found in the PATENTS file in the same directory.
1551 *
1552 * @providesModule DOMProperty
1553 */
1554
1555'use strict';
1556
1557var _prodInvariant = _dereq_(153);
1558
1559var invariant = _dereq_(178);
1560
1561function checkMask(value, bitmask) {
1562 return (value & bitmask) === bitmask;
1563}
1564
1565var DOMPropertyInjection = {
1566 /**
1567 * Mapping from normalized, camelcased property names to a configuration that
1568 * specifies how the associated DOM property should be accessed or rendered.
1569 */
1570 MUST_USE_PROPERTY: 0x1,
1571 HAS_BOOLEAN_VALUE: 0x4,
1572 HAS_NUMERIC_VALUE: 0x8,
1573 HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
1574 HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
1575
1576 /**
1577 * Inject some specialized knowledge about the DOM. This takes a config object
1578 * with the following properties:
1579 *
1580 * isCustomAttribute: function that given an attribute name will return true
1581 * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
1582 * attributes where it's impossible to enumerate all of the possible
1583 * attribute names,
1584 *
1585 * Properties: object mapping DOM property name to one of the
1586 * DOMPropertyInjection constants or null. If your attribute isn't in here,
1587 * it won't get written to the DOM.
1588 *
1589 * DOMAttributeNames: object mapping React attribute name to the DOM
1590 * attribute name. Attribute names not specified use the **lowercase**
1591 * normalized name.
1592 *
1593 * DOMAttributeNamespaces: object mapping React attribute name to the DOM
1594 * attribute namespace URL. (Attribute names not specified use no namespace.)
1595 *
1596 * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
1597 * Property names not specified use the normalized name.
1598 *
1599 * DOMMutationMethods: Properties that require special mutation methods. If
1600 * `value` is undefined, the mutation method should unset the property.
1601 *
1602 * @param {object} domPropertyConfig the config as described above.
1603 */
1604 injectDOMPropertyConfig: function (domPropertyConfig) {
1605 var Injection = DOMPropertyInjection;
1606 var Properties = domPropertyConfig.Properties || {};
1607 var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
1608 var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
1609 var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
1610 var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
1611
1612 if (domPropertyConfig.isCustomAttribute) {
1613 DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
1614 }
1615
1616 for (var propName in Properties) {
1617 !!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) : _prodInvariant('48', propName) : void 0;
1618
1619 var lowerCased = propName.toLowerCase();
1620 var propConfig = Properties[propName];
1621
1622 var propertyInfo = {
1623 attributeName: lowerCased,
1624 attributeNamespace: null,
1625 propertyName: propName,
1626 mutationMethod: null,
1627
1628 mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
1629 hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
1630 hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
1631 hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
1632 hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
1633 };
1634 !(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) : _prodInvariant('50', propName) : void 0;
1635
1636 if ("development" !== 'production') {
1637 DOMProperty.getPossibleStandardName[lowerCased] = propName;
1638 }
1639
1640 if (DOMAttributeNames.hasOwnProperty(propName)) {
1641 var attributeName = DOMAttributeNames[propName];
1642 propertyInfo.attributeName = attributeName;
1643 if ("development" !== 'production') {
1644 DOMProperty.getPossibleStandardName[attributeName] = propName;
1645 }
1646 }
1647
1648 if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
1649 propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
1650 }
1651
1652 if (DOMPropertyNames.hasOwnProperty(propName)) {
1653 propertyInfo.propertyName = DOMPropertyNames[propName];
1654 }
1655
1656 if (DOMMutationMethods.hasOwnProperty(propName)) {
1657 propertyInfo.mutationMethod = DOMMutationMethods[propName];
1658 }
1659
1660 DOMProperty.properties[propName] = propertyInfo;
1661 }
1662 }
1663};
1664
1665/* eslint-disable max-len */
1666var 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';
1667/* eslint-enable max-len */
1668
1669/**
1670 * DOMProperty exports lookup objects that can be used like functions:
1671 *
1672 * > DOMProperty.isValid['id']
1673 * true
1674 * > DOMProperty.isValid['foobar']
1675 * undefined
1676 *
1677 * Although this may be confusing, it performs better in general.
1678 *
1679 * @see http://jsperf.com/key-exists
1680 * @see http://jsperf.com/key-missing
1681 */
1682var DOMProperty = {
1683
1684 ID_ATTRIBUTE_NAME: 'data-reactid',
1685 ROOT_ATTRIBUTE_NAME: 'data-reactroot',
1686
1687 ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
1688 ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040',
1689
1690 /**
1691 * Map from property "standard name" to an object with info about how to set
1692 * the property in the DOM. Each object contains:
1693 *
1694 * attributeName:
1695 * Used when rendering markup or with `*Attribute()`.
1696 * attributeNamespace
1697 * propertyName:
1698 * Used on DOM node instances. (This includes properties that mutate due to
1699 * external factors.)
1700 * mutationMethod:
1701 * If non-null, used instead of the property or `setAttribute()` after
1702 * initial render.
1703 * mustUseProperty:
1704 * Whether the property must be accessed and mutated as an object property.
1705 * hasBooleanValue:
1706 * Whether the property should be removed when set to a falsey value.
1707 * hasNumericValue:
1708 * Whether the property must be numeric or parse as a numeric and should be
1709 * removed when set to a falsey value.
1710 * hasPositiveNumericValue:
1711 * Whether the property must be positive numeric or parse as a positive
1712 * numeric and should be removed when set to a falsey value.
1713 * hasOverloadedBooleanValue:
1714 * Whether the property can be used as a flag as well as with a value.
1715 * Removed when strictly equal to false; present without a value when
1716 * strictly equal to true; present with a value otherwise.
1717 */
1718 properties: {},
1719
1720 /**
1721 * Mapping from lowercase property names to the properly cased version, used
1722 * to warn in the case of missing properties. Available only in __DEV__.
1723 * @type {Object}
1724 */
1725 getPossibleStandardName: "development" !== 'production' ? {} : null,
1726
1727 /**
1728 * All of the isCustomAttribute() functions that have been injected.
1729 */
1730 _isCustomAttributeFunctions: [],
1731
1732 /**
1733 * Checks whether a property name is a custom attribute.
1734 * @method
1735 */
1736 isCustomAttribute: function (attributeName) {
1737 for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
1738 var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
1739 if (isCustomAttributeFn(attributeName)) {
1740 return true;
1741 }
1742 }
1743 return false;
1744 },
1745
1746 injection: DOMPropertyInjection
1747};
1748
1749module.exports = DOMProperty;
1750},{"153":153,"178":178}],11:[function(_dereq_,module,exports){
1751/**
1752 * Copyright 2013-present, Facebook, Inc.
1753 * All rights reserved.
1754 *
1755 * This source code is licensed under the BSD-style license found in the
1756 * LICENSE file in the root directory of this source tree. An additional grant
1757 * of patent rights can be found in the PATENTS file in the same directory.
1758 *
1759 * @providesModule DOMPropertyOperations
1760 */
1761
1762'use strict';
1763
1764var DOMProperty = _dereq_(10);
1765var ReactDOMComponentTree = _dereq_(46);
1766var ReactInstrumentation = _dereq_(78);
1767
1768var quoteAttributeValueForBrowser = _dereq_(152);
1769var warning = _dereq_(187);
1770
1771var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
1772var illegalAttributeNameCache = {};
1773var validatedAttributeNameCache = {};
1774
1775function isAttributeNameSafe(attributeName) {
1776 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
1777 return true;
1778 }
1779 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
1780 return false;
1781 }
1782 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
1783 validatedAttributeNameCache[attributeName] = true;
1784 return true;
1785 }
1786 illegalAttributeNameCache[attributeName] = true;
1787 "development" !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
1788 return false;
1789}
1790
1791function shouldIgnoreValue(propertyInfo, value) {
1792 return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
1793}
1794
1795/**
1796 * Operations for dealing with DOM properties.
1797 */
1798var DOMPropertyOperations = {
1799
1800 /**
1801 * Creates markup for the ID property.
1802 *
1803 * @param {string} id Unescaped ID.
1804 * @return {string} Markup string.
1805 */
1806 createMarkupForID: function (id) {
1807 return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
1808 },
1809
1810 setAttributeForID: function (node, id) {
1811 node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
1812 },
1813
1814 createMarkupForRoot: function () {
1815 return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
1816 },
1817
1818 setAttributeForRoot: function (node) {
1819 node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
1820 },
1821
1822 /**
1823 * Creates markup for a property.
1824 *
1825 * @param {string} name
1826 * @param {*} value
1827 * @return {?string} Markup string, or null if the property was invalid.
1828 */
1829 createMarkupForProperty: function (name, value) {
1830 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1831 if (propertyInfo) {
1832 if (shouldIgnoreValue(propertyInfo, value)) {
1833 return '';
1834 }
1835 var attributeName = propertyInfo.attributeName;
1836 if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
1837 return attributeName + '=""';
1838 }
1839 return attributeName + '=' + quoteAttributeValueForBrowser(value);
1840 } else if (DOMProperty.isCustomAttribute(name)) {
1841 if (value == null) {
1842 return '';
1843 }
1844 return name + '=' + quoteAttributeValueForBrowser(value);
1845 }
1846 return null;
1847 },
1848
1849 /**
1850 * Creates markup for a custom property.
1851 *
1852 * @param {string} name
1853 * @param {*} value
1854 * @return {string} Markup string, or empty string if the property was invalid.
1855 */
1856 createMarkupForCustomAttribute: function (name, value) {
1857 if (!isAttributeNameSafe(name) || value == null) {
1858 return '';
1859 }
1860 return name + '=' + quoteAttributeValueForBrowser(value);
1861 },
1862
1863 /**
1864 * Sets the value for a property on a node.
1865 *
1866 * @param {DOMElement} node
1867 * @param {string} name
1868 * @param {*} value
1869 */
1870 setValueForProperty: function (node, name, value) {
1871 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1872 if (propertyInfo) {
1873 var mutationMethod = propertyInfo.mutationMethod;
1874 if (mutationMethod) {
1875 mutationMethod(node, value);
1876 } else if (shouldIgnoreValue(propertyInfo, value)) {
1877 this.deleteValueForProperty(node, name);
1878 return;
1879 } else if (propertyInfo.mustUseProperty) {
1880 // Contrary to `setAttribute`, object properties are properly
1881 // `toString`ed by IE8/9.
1882 node[propertyInfo.propertyName] = value;
1883 } else {
1884 var attributeName = propertyInfo.attributeName;
1885 var namespace = propertyInfo.attributeNamespace;
1886 // `setAttribute` with objects becomes only `[object]` in IE8/9,
1887 // ('' + value) makes it output the correct toString()-value.
1888 if (namespace) {
1889 node.setAttributeNS(namespace, attributeName, '' + value);
1890 } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
1891 node.setAttribute(attributeName, '');
1892 } else {
1893 node.setAttribute(attributeName, '' + value);
1894 }
1895 }
1896 } else if (DOMProperty.isCustomAttribute(name)) {
1897 DOMPropertyOperations.setValueForAttribute(node, name, value);
1898 return;
1899 }
1900
1901 if ("development" !== 'production') {
1902 var payload = {};
1903 payload[name] = value;
1904 ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
1905 }
1906 },
1907
1908 setValueForAttribute: function (node, name, value) {
1909 if (!isAttributeNameSafe(name)) {
1910 return;
1911 }
1912 if (value == null) {
1913 node.removeAttribute(name);
1914 } else {
1915 node.setAttribute(name, '' + value);
1916 }
1917
1918 if ("development" !== 'production') {
1919 var payload = {};
1920 payload[name] = value;
1921 ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'update attribute', payload);
1922 }
1923 },
1924
1925 /**
1926 * Deletes an attributes from a node.
1927 *
1928 * @param {DOMElement} node
1929 * @param {string} name
1930 */
1931 deleteValueForAttribute: function (node, name) {
1932 node.removeAttribute(name);
1933 if ("development" !== 'production') {
1934 ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);
1935 }
1936 },
1937
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 node[propName] = false;
1954 } else {
1955 node[propName] = '';
1956 }
1957 } else {
1958 node.removeAttribute(propertyInfo.attributeName);
1959 }
1960 } else if (DOMProperty.isCustomAttribute(name)) {
1961 node.removeAttribute(name);
1962 }
1963
1964 if ("development" !== 'production') {
1965 ReactInstrumentation.debugTool.onHostOperation(ReactDOMComponentTree.getInstanceFromNode(node)._debugID, 'remove attribute', name);
1966 }
1967 }
1968
1969};
1970
1971module.exports = DOMPropertyOperations;
1972},{"10":10,"152":152,"187":187,"46":46,"78":78}],12:[function(_dereq_,module,exports){
1973/**
1974 * Copyright 2013-present, Facebook, Inc.
1975 * All rights reserved.
1976 *
1977 * This source code is licensed under the BSD-style license found in the
1978 * LICENSE file in the root directory of this source tree. An additional grant
1979 * of patent rights can be found in the PATENTS file in the same directory.
1980 *
1981 * @providesModule Danger
1982 */
1983
1984'use strict';
1985
1986var _prodInvariant = _dereq_(153);
1987
1988var DOMLazyTree = _dereq_(8);
1989var ExecutionEnvironment = _dereq_(164);
1990
1991var createNodesFromMarkup = _dereq_(169);
1992var emptyFunction = _dereq_(170);
1993var invariant = _dereq_(178);
1994
1995var Danger = {
1996
1997 /**
1998 * Replaces a node with a string of markup at its current position within its
1999 * parent. The markup must render into a single root node.
2000 *
2001 * @param {DOMElement} oldChild Child node to replace.
2002 * @param {string} markup Markup to render in place of the child node.
2003 * @internal
2004 */
2005 dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
2006 !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.') : _prodInvariant('56') : void 0;
2007 !markup ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0;
2008 !(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().') : _prodInvariant('58') : void 0;
2009
2010 if (typeof markup === 'string') {
2011 var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
2012 oldChild.parentNode.replaceChild(newChild, oldChild);
2013 } else {
2014 DOMLazyTree.replaceChildWithTree(oldChild, markup);
2015 }
2016 }
2017
2018};
2019
2020module.exports = Danger;
2021},{"153":153,"164":164,"169":169,"170":170,"178":178,"8":8}],13:[function(_dereq_,module,exports){
2022/**
2023 * Copyright 2013-present, Facebook, Inc.
2024 * All rights reserved.
2025 *
2026 * This source code is licensed under the BSD-style license found in the
2027 * LICENSE file in the root directory of this source tree. An additional grant
2028 * of patent rights can be found in the PATENTS file in the same directory.
2029 *
2030 * @providesModule DefaultEventPluginOrder
2031 */
2032
2033'use strict';
2034
2035var keyOf = _dereq_(182);
2036
2037/**
2038 * Module that is injectable into `EventPluginHub`, that specifies a
2039 * deterministic ordering of `EventPlugin`s. A convenient way to reason about
2040 * plugins, without having to package every one of them. This is better than
2041 * having plugins be ordered in the same order that they are injected because
2042 * that ordering would be influenced by the packaging order.
2043 * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
2044 * preventing default on events is convenient in `SimpleEventPlugin` handlers.
2045 */
2046var DefaultEventPluginOrder = [keyOf({ ResponderEventPlugin: null }), keyOf({ SimpleEventPlugin: null }), keyOf({ TapEventPlugin: null }), keyOf({ EnterLeaveEventPlugin: null }), keyOf({ ChangeEventPlugin: null }), keyOf({ SelectEventPlugin: null }), keyOf({ BeforeInputEventPlugin: null })];
2047
2048module.exports = DefaultEventPluginOrder;
2049},{"182":182}],14:[function(_dereq_,module,exports){
2050/**
2051 * Copyright 2013-present, Facebook, Inc.
2052 * All rights reserved.
2053 *
2054 * This source code is licensed under the BSD-style license found in the
2055 * LICENSE file in the root directory of this source tree. An additional grant
2056 * of patent rights can be found in the PATENTS file in the same directory.
2057 *
2058 * @providesModule DisabledInputUtils
2059 */
2060
2061'use strict';
2062
2063var disableableMouseListenerNames = {
2064 onClick: true,
2065 onDoubleClick: true,
2066 onMouseDown: true,
2067 onMouseMove: true,
2068 onMouseUp: true,
2069
2070 onClickCapture: true,
2071 onDoubleClickCapture: true,
2072 onMouseDownCapture: true,
2073 onMouseMoveCapture: true,
2074 onMouseUpCapture: true
2075};
2076
2077/**
2078 * Implements a host component that does not receive mouse events
2079 * when `disabled` is set.
2080 */
2081var DisabledInputUtils = {
2082 getHostProps: function (inst, props) {
2083 if (!props.disabled) {
2084 return props;
2085 }
2086
2087 // Copy the props, except the mouse listeners
2088 var hostProps = {};
2089 for (var key in props) {
2090 if (!disableableMouseListenerNames[key] && props.hasOwnProperty(key)) {
2091 hostProps[key] = props[key];
2092 }
2093 }
2094
2095 return hostProps;
2096 }
2097};
2098
2099module.exports = DisabledInputUtils;
2100},{}],15:[function(_dereq_,module,exports){
2101/**
2102 * Copyright 2013-present, Facebook, Inc.
2103 * All rights reserved.
2104 *
2105 * This source code is licensed under the BSD-style license found in the
2106 * LICENSE file in the root directory of this source tree. An additional grant
2107 * of patent rights can be found in the PATENTS file in the same directory.
2108 *
2109 * @providesModule EnterLeaveEventPlugin
2110 */
2111
2112'use strict';
2113
2114var EventConstants = _dereq_(16);
2115var EventPropagators = _dereq_(20);
2116var ReactDOMComponentTree = _dereq_(46);
2117var SyntheticMouseEvent = _dereq_(122);
2118
2119var keyOf = _dereq_(182);
2120
2121var topLevelTypes = EventConstants.topLevelTypes;
2122
2123var eventTypes = {
2124 mouseEnter: {
2125 registrationName: keyOf({ onMouseEnter: null }),
2126 dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
2127 },
2128 mouseLeave: {
2129 registrationName: keyOf({ onMouseLeave: null }),
2130 dependencies: [topLevelTypes.topMouseOut, topLevelTypes.topMouseOver]
2131 }
2132};
2133
2134var EnterLeaveEventPlugin = {
2135
2136 eventTypes: eventTypes,
2137
2138 /**
2139 * For almost every interaction we care about, there will be both a top-level
2140 * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
2141 * we do not extract duplicate events. However, moving the mouse into the
2142 * browser from outside will not fire a `mouseout` event. In this case, we use
2143 * the `mouseover` top-level event.
2144 */
2145 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2146 if (topLevelType === topLevelTypes.topMouseOver && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
2147 return null;
2148 }
2149 if (topLevelType !== topLevelTypes.topMouseOut && topLevelType !== topLevelTypes.topMouseOver) {
2150 // Must not be a mouse in or mouse out - ignoring.
2151 return null;
2152 }
2153
2154 var win;
2155 if (nativeEventTarget.window === nativeEventTarget) {
2156 // `nativeEventTarget` is probably a window object.
2157 win = nativeEventTarget;
2158 } else {
2159 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
2160 var doc = nativeEventTarget.ownerDocument;
2161 if (doc) {
2162 win = doc.defaultView || doc.parentWindow;
2163 } else {
2164 win = window;
2165 }
2166 }
2167
2168 var from;
2169 var to;
2170 if (topLevelType === topLevelTypes.topMouseOut) {
2171 from = targetInst;
2172 var related = nativeEvent.relatedTarget || nativeEvent.toElement;
2173 to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
2174 } else {
2175 // Moving to a node from outside the window.
2176 from = null;
2177 to = targetInst;
2178 }
2179
2180 if (from === to) {
2181 // Nothing pertains to our managed components.
2182 return null;
2183 }
2184
2185 var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
2186 var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
2187
2188 var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
2189 leave.type = 'mouseleave';
2190 leave.target = fromNode;
2191 leave.relatedTarget = toNode;
2192
2193 var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
2194 enter.type = 'mouseenter';
2195 enter.target = toNode;
2196 enter.relatedTarget = fromNode;
2197
2198 EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
2199
2200 return [leave, enter];
2201 }
2202
2203};
2204
2205module.exports = EnterLeaveEventPlugin;
2206},{"122":122,"16":16,"182":182,"20":20,"46":46}],16:[function(_dereq_,module,exports){
2207/**
2208 * Copyright 2013-present, Facebook, Inc.
2209 * All rights reserved.
2210 *
2211 * This source code is licensed under the BSD-style license found in the
2212 * LICENSE file in the root directory of this source tree. An additional grant
2213 * of patent rights can be found in the PATENTS file in the same directory.
2214 *
2215 * @providesModule EventConstants
2216 */
2217
2218'use strict';
2219
2220var keyMirror = _dereq_(181);
2221
2222var PropagationPhases = keyMirror({ bubbled: null, captured: null });
2223
2224/**
2225 * Types of raw signals from the browser caught at the top level.
2226 */
2227var topLevelTypes = keyMirror({
2228 topAbort: null,
2229 topAnimationEnd: null,
2230 topAnimationIteration: null,
2231 topAnimationStart: null,
2232 topBlur: null,
2233 topCanPlay: null,
2234 topCanPlayThrough: null,
2235 topChange: null,
2236 topClick: null,
2237 topCompositionEnd: null,
2238 topCompositionStart: null,
2239 topCompositionUpdate: null,
2240 topContextMenu: null,
2241 topCopy: null,
2242 topCut: null,
2243 topDoubleClick: null,
2244 topDrag: null,
2245 topDragEnd: null,
2246 topDragEnter: null,
2247 topDragExit: null,
2248 topDragLeave: null,
2249 topDragOver: null,
2250 topDragStart: null,
2251 topDrop: null,
2252 topDurationChange: null,
2253 topEmptied: null,
2254 topEncrypted: null,
2255 topEnded: null,
2256 topError: null,
2257 topFocus: null,
2258 topInput: null,
2259 topInvalid: null,
2260 topKeyDown: null,
2261 topKeyPress: null,
2262 topKeyUp: null,
2263 topLoad: null,
2264 topLoadedData: null,
2265 topLoadedMetadata: null,
2266 topLoadStart: null,
2267 topMouseDown: null,
2268 topMouseMove: null,
2269 topMouseOut: null,
2270 topMouseOver: null,
2271 topMouseUp: null,
2272 topPaste: null,
2273 topPause: null,
2274 topPlay: null,
2275 topPlaying: null,
2276 topProgress: null,
2277 topRateChange: null,
2278 topReset: null,
2279 topScroll: null,
2280 topSeeked: null,
2281 topSeeking: null,
2282 topSelectionChange: null,
2283 topStalled: null,
2284 topSubmit: null,
2285 topSuspend: null,
2286 topTextInput: null,
2287 topTimeUpdate: null,
2288 topTouchCancel: null,
2289 topTouchEnd: null,
2290 topTouchMove: null,
2291 topTouchStart: null,
2292 topTransitionEnd: null,
2293 topVolumeChange: null,
2294 topWaiting: null,
2295 topWheel: null
2296});
2297
2298var EventConstants = {
2299 topLevelTypes: topLevelTypes,
2300 PropagationPhases: PropagationPhases
2301};
2302
2303module.exports = EventConstants;
2304},{"181":181}],17:[function(_dereq_,module,exports){
2305/**
2306 * Copyright 2013-present, Facebook, Inc.
2307 * All rights reserved.
2308 *
2309 * This source code is licensed under the BSD-style license found in the
2310 * LICENSE file in the root directory of this source tree. An additional grant
2311 * of patent rights can be found in the PATENTS file in the same directory.
2312 *
2313 * @providesModule EventPluginHub
2314 */
2315
2316'use strict';
2317
2318var _prodInvariant = _dereq_(153);
2319
2320var EventPluginRegistry = _dereq_(18);
2321var EventPluginUtils = _dereq_(19);
2322var ReactErrorUtils = _dereq_(68);
2323
2324var accumulateInto = _dereq_(129);
2325var forEachAccumulated = _dereq_(138);
2326var invariant = _dereq_(178);
2327
2328/**
2329 * Internal store for event listeners
2330 */
2331var listenerBank = {};
2332
2333/**
2334 * Internal queue of events that have accumulated their dispatches and are
2335 * waiting to have their dispatches executed.
2336 */
2337var eventQueue = null;
2338
2339/**
2340 * Dispatches an event and releases it back into the pool, unless persistent.
2341 *
2342 * @param {?object} event Synthetic event to be dispatched.
2343 * @param {boolean} simulated If the event is simulated (changes exn behavior)
2344 * @private
2345 */
2346var executeDispatchesAndRelease = function (event, simulated) {
2347 if (event) {
2348 EventPluginUtils.executeDispatchesInOrder(event, simulated);
2349
2350 if (!event.isPersistent()) {
2351 event.constructor.release(event);
2352 }
2353 }
2354};
2355var executeDispatchesAndReleaseSimulated = function (e) {
2356 return executeDispatchesAndRelease(e, true);
2357};
2358var executeDispatchesAndReleaseTopLevel = function (e) {
2359 return executeDispatchesAndRelease(e, false);
2360};
2361
2362var getDictionaryKey = function (inst) {
2363 // Prevents V8 performance issue:
2364 // https://github.com/facebook/react/pull/7232
2365 return '.' + inst._rootNodeID;
2366};
2367
2368/**
2369 * This is a unified interface for event plugins to be installed and configured.
2370 *
2371 * Event plugins can implement the following properties:
2372 *
2373 * `extractEvents` {function(string, DOMEventTarget, string, object): *}
2374 * Required. When a top-level event is fired, this method is expected to
2375 * extract synthetic events that will in turn be queued and dispatched.
2376 *
2377 * `eventTypes` {object}
2378 * Optional, plugins that fire events must publish a mapping of registration
2379 * names that are used to register listeners. Values of this mapping must
2380 * be objects that contain `registrationName` or `phasedRegistrationNames`.
2381 *
2382 * `executeDispatch` {function(object, function, string)}
2383 * Optional, allows plugins to override how an event gets dispatched. By
2384 * default, the listener is simply invoked.
2385 *
2386 * Each plugin that is injected into `EventsPluginHub` is immediately operable.
2387 *
2388 * @public
2389 */
2390var EventPluginHub = {
2391
2392 /**
2393 * Methods for injecting dependencies.
2394 */
2395 injection: {
2396
2397 /**
2398 * @param {array} InjectedEventPluginOrder
2399 * @public
2400 */
2401 injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
2402
2403 /**
2404 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
2405 */
2406 injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
2407
2408 },
2409
2410 /**
2411 * Stores `listener` at `listenerBank[registrationName][key]`. Is idempotent.
2412 *
2413 * @param {object} inst The instance, which is the source of events.
2414 * @param {string} registrationName Name of listener (e.g. `onClick`).
2415 * @param {function} listener The callback to store.
2416 */
2417 putListener: function (inst, registrationName, listener) {
2418 !(typeof listener === 'function') ? "development" !== 'production' ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : _prodInvariant('94', registrationName, typeof listener) : void 0;
2419
2420 var key = getDictionaryKey(inst);
2421 var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
2422 bankForRegistrationName[key] = listener;
2423
2424 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2425 if (PluginModule && PluginModule.didPutListener) {
2426 PluginModule.didPutListener(inst, registrationName, listener);
2427 }
2428 },
2429
2430 /**
2431 * @param {object} inst The instance, which is the source of events.
2432 * @param {string} registrationName Name of listener (e.g. `onClick`).
2433 * @return {?function} The stored callback.
2434 */
2435 getListener: function (inst, registrationName) {
2436 var bankForRegistrationName = listenerBank[registrationName];
2437 var key = getDictionaryKey(inst);
2438 return bankForRegistrationName && bankForRegistrationName[key];
2439 },
2440
2441 /**
2442 * Deletes a listener from the registration bank.
2443 *
2444 * @param {object} inst The instance, which is the source of events.
2445 * @param {string} registrationName Name of listener (e.g. `onClick`).
2446 */
2447 deleteListener: function (inst, registrationName) {
2448 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2449 if (PluginModule && PluginModule.willDeleteListener) {
2450 PluginModule.willDeleteListener(inst, registrationName);
2451 }
2452
2453 var bankForRegistrationName = listenerBank[registrationName];
2454 // TODO: This should never be null -- when is it?
2455 if (bankForRegistrationName) {
2456 var key = getDictionaryKey(inst);
2457 delete bankForRegistrationName[key];
2458 }
2459 },
2460
2461 /**
2462 * Deletes all listeners for the DOM element with the supplied ID.
2463 *
2464 * @param {object} inst The instance, which is the source of events.
2465 */
2466 deleteAllListeners: function (inst) {
2467 var key = getDictionaryKey(inst);
2468 for (var registrationName in listenerBank) {
2469 if (!listenerBank.hasOwnProperty(registrationName)) {
2470 continue;
2471 }
2472
2473 if (!listenerBank[registrationName][key]) {
2474 continue;
2475 }
2476
2477 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2478 if (PluginModule && PluginModule.willDeleteListener) {
2479 PluginModule.willDeleteListener(inst, registrationName);
2480 }
2481
2482 delete listenerBank[registrationName][key];
2483 }
2484 },
2485
2486 /**
2487 * Allows registered plugins an opportunity to extract events from top-level
2488 * native browser events.
2489 *
2490 * @return {*} An accumulation of synthetic events.
2491 * @internal
2492 */
2493 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2494 var events;
2495 var plugins = EventPluginRegistry.plugins;
2496 for (var i = 0; i < plugins.length; i++) {
2497 // Not every plugin in the ordering may be loaded at runtime.
2498 var possiblePlugin = plugins[i];
2499 if (possiblePlugin) {
2500 var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
2501 if (extractedEvents) {
2502 events = accumulateInto(events, extractedEvents);
2503 }
2504 }
2505 }
2506 return events;
2507 },
2508
2509 /**
2510 * Enqueues a synthetic event that should be dispatched when
2511 * `processEventQueue` is invoked.
2512 *
2513 * @param {*} events An accumulation of synthetic events.
2514 * @internal
2515 */
2516 enqueueEvents: function (events) {
2517 if (events) {
2518 eventQueue = accumulateInto(eventQueue, events);
2519 }
2520 },
2521
2522 /**
2523 * Dispatches all synthetic events on the event queue.
2524 *
2525 * @internal
2526 */
2527 processEventQueue: function (simulated) {
2528 // Set `eventQueue` to null before processing it so that we can tell if more
2529 // events get enqueued while processing.
2530 var processingEventQueue = eventQueue;
2531 eventQueue = null;
2532 if (simulated) {
2533 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
2534 } else {
2535 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
2536 }
2537 !!eventQueue ? "development" !== 'production' ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : _prodInvariant('95') : void 0;
2538 // This would be a good time to rethrow if any of the event handlers threw.
2539 ReactErrorUtils.rethrowCaughtError();
2540 },
2541
2542 /**
2543 * These are needed for tests only. Do not use!
2544 */
2545 __purge: function () {
2546 listenerBank = {};
2547 },
2548
2549 __getListenerBank: function () {
2550 return listenerBank;
2551 }
2552
2553};
2554
2555module.exports = EventPluginHub;
2556},{"129":129,"138":138,"153":153,"178":178,"18":18,"19":19,"68":68}],18:[function(_dereq_,module,exports){
2557/**
2558 * Copyright 2013-present, Facebook, Inc.
2559 * All rights reserved.
2560 *
2561 * This source code is licensed under the BSD-style license found in the
2562 * LICENSE file in the root directory of this source tree. An additional grant
2563 * of patent rights can be found in the PATENTS file in the same directory.
2564 *
2565 * @providesModule EventPluginRegistry
2566 */
2567
2568'use strict';
2569
2570var _prodInvariant = _dereq_(153);
2571
2572var invariant = _dereq_(178);
2573
2574/**
2575 * Injectable ordering of event plugins.
2576 */
2577var EventPluginOrder = null;
2578
2579/**
2580 * Injectable mapping from names to event plugin modules.
2581 */
2582var namesToPlugins = {};
2583
2584/**
2585 * Recomputes the plugin list using the injected plugins and plugin ordering.
2586 *
2587 * @private
2588 */
2589function recomputePluginOrdering() {
2590 if (!EventPluginOrder) {
2591 // Wait until an `EventPluginOrder` is injected.
2592 return;
2593 }
2594 for (var pluginName in namesToPlugins) {
2595 var PluginModule = namesToPlugins[pluginName];
2596 var pluginIndex = EventPluginOrder.indexOf(pluginName);
2597 !(pluginIndex > -1) ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0;
2598 if (EventPluginRegistry.plugins[pluginIndex]) {
2599 continue;
2600 }
2601 !PluginModule.extractEvents ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0;
2602 EventPluginRegistry.plugins[pluginIndex] = PluginModule;
2603 var publishedEvents = PluginModule.eventTypes;
2604 for (var eventName in publishedEvents) {
2605 !publishEventForPlugin(publishedEvents[eventName], PluginModule, eventName) ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', eventName, pluginName) : void 0;
2606 }
2607 }
2608}
2609
2610/**
2611 * Publishes an event so that it can be dispatched by the supplied plugin.
2612 *
2613 * @param {object} dispatchConfig Dispatch configuration for the event.
2614 * @param {object} PluginModule Plugin publishing the event.
2615 * @return {boolean} True if the event was successfully published.
2616 * @private
2617 */
2618function publishEventForPlugin(dispatchConfig, PluginModule, eventName) {
2619 !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? "development" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : _prodInvariant('99', eventName) : void 0;
2620 EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
2621
2622 var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
2623 if (phasedRegistrationNames) {
2624 for (var phaseName in phasedRegistrationNames) {
2625 if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
2626 var phasedRegistrationName = phasedRegistrationNames[phaseName];
2627 publishRegistrationName(phasedRegistrationName, PluginModule, eventName);
2628 }
2629 }
2630 return true;
2631 } else if (dispatchConfig.registrationName) {
2632 publishRegistrationName(dispatchConfig.registrationName, PluginModule, eventName);
2633 return true;
2634 }
2635 return false;
2636}
2637
2638/**
2639 * Publishes a registration name that is used to identify dispatched events and
2640 * can be used with `EventPluginHub.putListener` to register listeners.
2641 *
2642 * @param {string} registrationName Registration name to add.
2643 * @param {object} PluginModule Plugin publishing the event.
2644 * @private
2645 */
2646function publishRegistrationName(registrationName, PluginModule, eventName) {
2647 !!EventPluginRegistry.registrationNameModules[registrationName] ? "development" !== 'production' ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : _prodInvariant('100', registrationName) : void 0;
2648 EventPluginRegistry.registrationNameModules[registrationName] = PluginModule;
2649 EventPluginRegistry.registrationNameDependencies[registrationName] = PluginModule.eventTypes[eventName].dependencies;
2650
2651 if ("development" !== 'production') {
2652 var lowerCasedName = registrationName.toLowerCase();
2653 EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
2654
2655 if (registrationName === 'onDoubleClick') {
2656 EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName;
2657 }
2658 }
2659}
2660
2661/**
2662 * Registers plugins so that they can extract and dispatch events.
2663 *
2664 * @see {EventPluginHub}
2665 */
2666var EventPluginRegistry = {
2667
2668 /**
2669 * Ordered list of injected plugins.
2670 */
2671 plugins: [],
2672
2673 /**
2674 * Mapping from event name to dispatch config
2675 */
2676 eventNameDispatchConfigs: {},
2677
2678 /**
2679 * Mapping from registration name to plugin module
2680 */
2681 registrationNameModules: {},
2682
2683 /**
2684 * Mapping from registration name to event name
2685 */
2686 registrationNameDependencies: {},
2687
2688 /**
2689 * Mapping from lowercase registration names to the properly cased version,
2690 * used to warn in the case of missing event handlers. Available
2691 * only in __DEV__.
2692 * @type {Object}
2693 */
2694 possibleRegistrationNames: "development" !== 'production' ? {} : null,
2695
2696 /**
2697 * Injects an ordering of plugins (by plugin name). This allows the ordering
2698 * to be decoupled from injection of the actual plugins so that ordering is
2699 * always deterministic regardless of packaging, on-the-fly injection, etc.
2700 *
2701 * @param {array} InjectedEventPluginOrder
2702 * @internal
2703 * @see {EventPluginHub.injection.injectEventPluginOrder}
2704 */
2705 injectEventPluginOrder: function (InjectedEventPluginOrder) {
2706 !!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.') : _prodInvariant('101') : void 0;
2707 // Clone the ordering so it cannot be dynamically mutated.
2708 EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
2709 recomputePluginOrdering();
2710 },
2711
2712 /**
2713 * Injects plugins to be used by `EventPluginHub`. The plugin names must be
2714 * in the ordering injected by `injectEventPluginOrder`.
2715 *
2716 * Plugins can be injected as part of page initialization or on-the-fly.
2717 *
2718 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
2719 * @internal
2720 * @see {EventPluginHub.injection.injectEventPluginsByName}
2721 */
2722 injectEventPluginsByName: function (injectedNamesToPlugins) {
2723 var isOrderingDirty = false;
2724 for (var pluginName in injectedNamesToPlugins) {
2725 if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
2726 continue;
2727 }
2728 var PluginModule = injectedNamesToPlugins[pluginName];
2729 if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== PluginModule) {
2730 !!namesToPlugins[pluginName] ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0;
2731 namesToPlugins[pluginName] = PluginModule;
2732 isOrderingDirty = true;
2733 }
2734 }
2735 if (isOrderingDirty) {
2736 recomputePluginOrdering();
2737 }
2738 },
2739
2740 /**
2741 * Looks up the plugin for the supplied event.
2742 *
2743 * @param {object} event A synthetic event.
2744 * @return {?object} The plugin that created the supplied event.
2745 * @internal
2746 */
2747 getPluginModuleForEvent: function (event) {
2748 var dispatchConfig = event.dispatchConfig;
2749 if (dispatchConfig.registrationName) {
2750 return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
2751 }
2752 for (var phase in dispatchConfig.phasedRegistrationNames) {
2753 if (!dispatchConfig.phasedRegistrationNames.hasOwnProperty(phase)) {
2754 continue;
2755 }
2756 var PluginModule = EventPluginRegistry.registrationNameModules[dispatchConfig.phasedRegistrationNames[phase]];
2757 if (PluginModule) {
2758 return PluginModule;
2759 }
2760 }
2761 return null;
2762 },
2763
2764 /**
2765 * Exposed for unit testing.
2766 * @private
2767 */
2768 _resetEventPlugins: function () {
2769 EventPluginOrder = null;
2770 for (var pluginName in namesToPlugins) {
2771 if (namesToPlugins.hasOwnProperty(pluginName)) {
2772 delete namesToPlugins[pluginName];
2773 }
2774 }
2775 EventPluginRegistry.plugins.length = 0;
2776
2777 var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
2778 for (var eventName in eventNameDispatchConfigs) {
2779 if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
2780 delete eventNameDispatchConfigs[eventName];
2781 }
2782 }
2783
2784 var registrationNameModules = EventPluginRegistry.registrationNameModules;
2785 for (var registrationName in registrationNameModules) {
2786 if (registrationNameModules.hasOwnProperty(registrationName)) {
2787 delete registrationNameModules[registrationName];
2788 }
2789 }
2790
2791 if ("development" !== 'production') {
2792 var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
2793 for (var lowerCasedName in possibleRegistrationNames) {
2794 if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
2795 delete possibleRegistrationNames[lowerCasedName];
2796 }
2797 }
2798 }
2799 }
2800
2801};
2802
2803module.exports = EventPluginRegistry;
2804},{"153":153,"178":178}],19:[function(_dereq_,module,exports){
2805/**
2806 * Copyright 2013-present, Facebook, Inc.
2807 * All rights reserved.
2808 *
2809 * This source code is licensed under the BSD-style license found in the
2810 * LICENSE file in the root directory of this source tree. An additional grant
2811 * of patent rights can be found in the PATENTS file in the same directory.
2812 *
2813 * @providesModule EventPluginUtils
2814 */
2815
2816'use strict';
2817
2818var _prodInvariant = _dereq_(153);
2819
2820var EventConstants = _dereq_(16);
2821var ReactErrorUtils = _dereq_(68);
2822
2823var invariant = _dereq_(178);
2824var warning = _dereq_(187);
2825
2826/**
2827 * Injected dependencies:
2828 */
2829
2830/**
2831 * - `ComponentTree`: [required] Module that can convert between React instances
2832 * and actual node references.
2833 */
2834var ComponentTree;
2835var TreeTraversal;
2836var injection = {
2837 injectComponentTree: function (Injected) {
2838 ComponentTree = Injected;
2839 if ("development" !== 'production') {
2840 "development" !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
2841 }
2842 },
2843 injectTreeTraversal: function (Injected) {
2844 TreeTraversal = Injected;
2845 if ("development" !== 'production') {
2846 "development" !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
2847 }
2848 }
2849};
2850
2851var topLevelTypes = EventConstants.topLevelTypes;
2852
2853function isEndish(topLevelType) {
2854 return topLevelType === topLevelTypes.topMouseUp || topLevelType === topLevelTypes.topTouchEnd || topLevelType === topLevelTypes.topTouchCancel;
2855}
2856
2857function isMoveish(topLevelType) {
2858 return topLevelType === topLevelTypes.topMouseMove || topLevelType === topLevelTypes.topTouchMove;
2859}
2860function isStartish(topLevelType) {
2861 return topLevelType === topLevelTypes.topMouseDown || topLevelType === topLevelTypes.topTouchStart;
2862}
2863
2864var validateEventDispatches;
2865if ("development" !== 'production') {
2866 validateEventDispatches = function (event) {
2867 var dispatchListeners = event._dispatchListeners;
2868 var dispatchInstances = event._dispatchInstances;
2869
2870 var listenersIsArr = Array.isArray(dispatchListeners);
2871 var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
2872
2873 var instancesIsArr = Array.isArray(dispatchInstances);
2874 var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
2875
2876 "development" !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
2877 };
2878}
2879
2880/**
2881 * Dispatch the event to the listener.
2882 * @param {SyntheticEvent} event SyntheticEvent to handle
2883 * @param {boolean} simulated If the event is simulated (changes exn behavior)
2884 * @param {function} listener Application-level callback
2885 * @param {*} inst Internal component instance
2886 */
2887function executeDispatch(event, simulated, listener, inst) {
2888 var type = event.type || 'unknown-event';
2889 event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
2890 if (simulated) {
2891 ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);
2892 } else {
2893 ReactErrorUtils.invokeGuardedCallback(type, listener, event);
2894 }
2895 event.currentTarget = null;
2896}
2897
2898/**
2899 * Standard/simple iteration through an event's collected dispatches.
2900 */
2901function executeDispatchesInOrder(event, simulated) {
2902 var dispatchListeners = event._dispatchListeners;
2903 var dispatchInstances = event._dispatchInstances;
2904 if ("development" !== 'production') {
2905 validateEventDispatches(event);
2906 }
2907 if (Array.isArray(dispatchListeners)) {
2908 for (var i = 0; i < dispatchListeners.length; i++) {
2909 if (event.isPropagationStopped()) {
2910 break;
2911 }
2912 // Listeners and Instances are two parallel arrays that are always in sync.
2913 executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
2914 }
2915 } else if (dispatchListeners) {
2916 executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
2917 }
2918 event._dispatchListeners = null;
2919 event._dispatchInstances = null;
2920}
2921
2922/**
2923 * Standard/simple iteration through an event's collected dispatches, but stops
2924 * at the first dispatch execution returning true, and returns that id.
2925 *
2926 * @return {?string} id of the first dispatch execution who's listener returns
2927 * true, or null if no listener returned true.
2928 */
2929function executeDispatchesInOrderStopAtTrueImpl(event) {
2930 var dispatchListeners = event._dispatchListeners;
2931 var dispatchInstances = event._dispatchInstances;
2932 if ("development" !== 'production') {
2933 validateEventDispatches(event);
2934 }
2935 if (Array.isArray(dispatchListeners)) {
2936 for (var i = 0; i < dispatchListeners.length; i++) {
2937 if (event.isPropagationStopped()) {
2938 break;
2939 }
2940 // Listeners and Instances are two parallel arrays that are always in sync.
2941 if (dispatchListeners[i](event, dispatchInstances[i])) {
2942 return dispatchInstances[i];
2943 }
2944 }
2945 } else if (dispatchListeners) {
2946 if (dispatchListeners(event, dispatchInstances)) {
2947 return dispatchInstances;
2948 }
2949 }
2950 return null;
2951}
2952
2953/**
2954 * @see executeDispatchesInOrderStopAtTrueImpl
2955 */
2956function executeDispatchesInOrderStopAtTrue(event) {
2957 var ret = executeDispatchesInOrderStopAtTrueImpl(event);
2958 event._dispatchInstances = null;
2959 event._dispatchListeners = null;
2960 return ret;
2961}
2962
2963/**
2964 * Execution of a "direct" dispatch - there must be at most one dispatch
2965 * accumulated on the event or it is considered an error. It doesn't really make
2966 * sense for an event with multiple dispatches (bubbled) to keep track of the
2967 * return values at each dispatch execution, but it does tend to make sense when
2968 * dealing with "direct" dispatches.
2969 *
2970 * @return {*} The return value of executing the single dispatch.
2971 */
2972function executeDirectDispatch(event) {
2973 if ("development" !== 'production') {
2974 validateEventDispatches(event);
2975 }
2976 var dispatchListener = event._dispatchListeners;
2977 var dispatchInstance = event._dispatchInstances;
2978 !!Array.isArray(dispatchListener) ? "development" !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0;
2979 event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
2980 var res = dispatchListener ? dispatchListener(event) : null;
2981 event.currentTarget = null;
2982 event._dispatchListeners = null;
2983 event._dispatchInstances = null;
2984 return res;
2985}
2986
2987/**
2988 * @param {SyntheticEvent} event
2989 * @return {boolean} True iff number of dispatches accumulated is greater than 0.
2990 */
2991function hasDispatches(event) {
2992 return !!event._dispatchListeners;
2993}
2994
2995/**
2996 * General utilities that are useful in creating custom Event Plugins.
2997 */
2998var EventPluginUtils = {
2999 isEndish: isEndish,
3000 isMoveish: isMoveish,
3001 isStartish: isStartish,
3002
3003 executeDirectDispatch: executeDirectDispatch,
3004 executeDispatchesInOrder: executeDispatchesInOrder,
3005 executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
3006 hasDispatches: hasDispatches,
3007
3008 getInstanceFromNode: function (node) {
3009 return ComponentTree.getInstanceFromNode(node);
3010 },
3011 getNodeFromInstance: function (node) {
3012 return ComponentTree.getNodeFromInstance(node);
3013 },
3014 isAncestor: function (a, b) {
3015 return TreeTraversal.isAncestor(a, b);
3016 },
3017 getLowestCommonAncestor: function (a, b) {
3018 return TreeTraversal.getLowestCommonAncestor(a, b);
3019 },
3020 getParentInstance: function (inst) {
3021 return TreeTraversal.getParentInstance(inst);
3022 },
3023 traverseTwoPhase: function (target, fn, arg) {
3024 return TreeTraversal.traverseTwoPhase(target, fn, arg);
3025 },
3026 traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
3027 return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
3028 },
3029
3030 injection: injection
3031};
3032
3033module.exports = EventPluginUtils;
3034},{"153":153,"16":16,"178":178,"187":187,"68":68}],20:[function(_dereq_,module,exports){
3035/**
3036 * Copyright 2013-present, Facebook, Inc.
3037 * All rights reserved.
3038 *
3039 * This source code is licensed under the BSD-style license found in the
3040 * LICENSE file in the root directory of this source tree. An additional grant
3041 * of patent rights can be found in the PATENTS file in the same directory.
3042 *
3043 * @providesModule EventPropagators
3044 */
3045
3046'use strict';
3047
3048var EventConstants = _dereq_(16);
3049var EventPluginHub = _dereq_(17);
3050var EventPluginUtils = _dereq_(19);
3051
3052var accumulateInto = _dereq_(129);
3053var forEachAccumulated = _dereq_(138);
3054var warning = _dereq_(187);
3055
3056var PropagationPhases = EventConstants.PropagationPhases;
3057var getListener = EventPluginHub.getListener;
3058
3059/**
3060 * Some event types have a notion of different registration names for different
3061 * "phases" of propagation. This finds listeners by a given phase.
3062 */
3063function listenerAtPhase(inst, event, propagationPhase) {
3064 var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
3065 return getListener(inst, registrationName);
3066}
3067
3068/**
3069 * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
3070 * here, allows us to not have to bind or create functions for each event.
3071 * Mutating the event's members allows us to not have to create a wrapping
3072 * "dispatch" object that pairs the event with the listener.
3073 */
3074function accumulateDirectionalDispatches(inst, upwards, event) {
3075 if ("development" !== 'production') {
3076 "development" !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
3077 }
3078 var phase = upwards ? PropagationPhases.bubbled : PropagationPhases.captured;
3079 var listener = listenerAtPhase(inst, event, phase);
3080 if (listener) {
3081 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
3082 event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
3083 }
3084}
3085
3086/**
3087 * Collect dispatches (must be entirely collected before dispatching - see unit
3088 * tests). Lazily allocate the array to conserve memory. We must loop through
3089 * each event and perform the traversal for each one. We cannot perform a
3090 * single traversal for the entire collection of events because each event may
3091 * have a different target.
3092 */
3093function accumulateTwoPhaseDispatchesSingle(event) {
3094 if (event && event.dispatchConfig.phasedRegistrationNames) {
3095 EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
3096 }
3097}
3098
3099/**
3100 * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
3101 */
3102function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
3103 if (event && event.dispatchConfig.phasedRegistrationNames) {
3104 var targetInst = event._targetInst;
3105 var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
3106 EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
3107 }
3108}
3109
3110/**
3111 * Accumulates without regard to direction, does not look for phased
3112 * registration names. Same as `accumulateDirectDispatchesSingle` but without
3113 * requiring that the `dispatchMarker` be the same as the dispatched ID.
3114 */
3115function accumulateDispatches(inst, ignoredDirection, event) {
3116 if (event && event.dispatchConfig.registrationName) {
3117 var registrationName = event.dispatchConfig.registrationName;
3118 var listener = getListener(inst, registrationName);
3119 if (listener) {
3120 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
3121 event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
3122 }
3123 }
3124}
3125
3126/**
3127 * Accumulates dispatches on an `SyntheticEvent`, but only for the
3128 * `dispatchMarker`.
3129 * @param {SyntheticEvent} event
3130 */
3131function accumulateDirectDispatchesSingle(event) {
3132 if (event && event.dispatchConfig.registrationName) {
3133 accumulateDispatches(event._targetInst, null, event);
3134 }
3135}
3136
3137function accumulateTwoPhaseDispatches(events) {
3138 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
3139}
3140
3141function accumulateTwoPhaseDispatchesSkipTarget(events) {
3142 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
3143}
3144
3145function accumulateEnterLeaveDispatches(leave, enter, from, to) {
3146 EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
3147}
3148
3149function accumulateDirectDispatches(events) {
3150 forEachAccumulated(events, accumulateDirectDispatchesSingle);
3151}
3152
3153/**
3154 * A small set of propagation patterns, each of which will accept a small amount
3155 * of information, and generate a set of "dispatch ready event objects" - which
3156 * are sets of events that have already been annotated with a set of dispatched
3157 * listener functions/ids. The API is designed this way to discourage these
3158 * propagation strategies from actually executing the dispatches, since we
3159 * always want to collect the entire set of dispatches before executing event a
3160 * single one.
3161 *
3162 * @constructor EventPropagators
3163 */
3164var EventPropagators = {
3165 accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
3166 accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
3167 accumulateDirectDispatches: accumulateDirectDispatches,
3168 accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
3169};
3170
3171module.exports = EventPropagators;
3172},{"129":129,"138":138,"16":16,"17":17,"187":187,"19":19}],21:[function(_dereq_,module,exports){
3173/**
3174 * Copyright 2013-present, Facebook, Inc.
3175 * All rights reserved.
3176 *
3177 * This source code is licensed under the BSD-style license found in the
3178 * LICENSE file in the root directory of this source tree. An additional grant
3179 * of patent rights can be found in the PATENTS file in the same directory.
3180 *
3181 * @providesModule FallbackCompositionState
3182 */
3183
3184'use strict';
3185
3186var _assign = _dereq_(188);
3187
3188var PooledClass = _dereq_(26);
3189
3190var getTextContentAccessor = _dereq_(146);
3191
3192/**
3193 * This helper class stores information about text content of a target node,
3194 * allowing comparison of content before and after a given event.
3195 *
3196 * Identify the node where selection currently begins, then observe
3197 * both its text content and its current position in the DOM. Since the
3198 * browser may natively replace the target node during composition, we can
3199 * use its position to find its replacement.
3200 *
3201 * @param {DOMEventTarget} root
3202 */
3203function FallbackCompositionState(root) {
3204 this._root = root;
3205 this._startText = this.getText();
3206 this._fallbackText = null;
3207}
3208
3209_assign(FallbackCompositionState.prototype, {
3210 destructor: function () {
3211 this._root = null;
3212 this._startText = null;
3213 this._fallbackText = null;
3214 },
3215
3216 /**
3217 * Get current text of input.
3218 *
3219 * @return {string}
3220 */
3221 getText: function () {
3222 if ('value' in this._root) {
3223 return this._root.value;
3224 }
3225 return this._root[getTextContentAccessor()];
3226 },
3227
3228 /**
3229 * Determine the differing substring between the initially stored
3230 * text content and the current content.
3231 *
3232 * @return {string}
3233 */
3234 getData: function () {
3235 if (this._fallbackText) {
3236 return this._fallbackText;
3237 }
3238
3239 var start;
3240 var startValue = this._startText;
3241 var startLength = startValue.length;
3242 var end;
3243 var endValue = this.getText();
3244 var endLength = endValue.length;
3245
3246 for (start = 0; start < startLength; start++) {
3247 if (startValue[start] !== endValue[start]) {
3248 break;
3249 }
3250 }
3251
3252 var minEnd = startLength - start;
3253 for (end = 1; end <= minEnd; end++) {
3254 if (startValue[startLength - end] !== endValue[endLength - end]) {
3255 break;
3256 }
3257 }
3258
3259 var sliceTail = end > 1 ? 1 - end : undefined;
3260 this._fallbackText = endValue.slice(start, sliceTail);
3261 return this._fallbackText;
3262 }
3263});
3264
3265PooledClass.addPoolingTo(FallbackCompositionState);
3266
3267module.exports = FallbackCompositionState;
3268},{"146":146,"188":188,"26":26}],22:[function(_dereq_,module,exports){
3269/**
3270 * Copyright 2013-present, Facebook, Inc.
3271 * All rights reserved.
3272 *
3273 * This source code is licensed under the BSD-style license found in the
3274 * LICENSE file in the root directory of this source tree. An additional grant
3275 * of patent rights can be found in the PATENTS file in the same directory.
3276 *
3277 * @providesModule HTMLDOMPropertyConfig
3278 */
3279
3280'use strict';
3281
3282var DOMProperty = _dereq_(10);
3283
3284var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
3285var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
3286var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
3287var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
3288var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
3289
3290var HTMLDOMPropertyConfig = {
3291 isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
3292 Properties: {
3293 /**
3294 * Standard Properties
3295 */
3296 accept: 0,
3297 acceptCharset: 0,
3298 accessKey: 0,
3299 action: 0,
3300 allowFullScreen: HAS_BOOLEAN_VALUE,
3301 allowTransparency: 0,
3302 alt: 0,
3303 // specifies target context for links with `preload` type
3304 as: 0,
3305 async: HAS_BOOLEAN_VALUE,
3306 autoComplete: 0,
3307 // autoFocus is polyfilled/normalized by AutoFocusUtils
3308 // autoFocus: HAS_BOOLEAN_VALUE,
3309 autoPlay: HAS_BOOLEAN_VALUE,
3310 capture: HAS_BOOLEAN_VALUE,
3311 cellPadding: 0,
3312 cellSpacing: 0,
3313 charSet: 0,
3314 challenge: 0,
3315 checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3316 cite: 0,
3317 classID: 0,
3318 className: 0,
3319 cols: HAS_POSITIVE_NUMERIC_VALUE,
3320 colSpan: 0,
3321 content: 0,
3322 contentEditable: 0,
3323 contextMenu: 0,
3324 controls: HAS_BOOLEAN_VALUE,
3325 coords: 0,
3326 crossOrigin: 0,
3327 data: 0, // For `<object />` acts as `src`.
3328 dateTime: 0,
3329 'default': HAS_BOOLEAN_VALUE,
3330 defer: HAS_BOOLEAN_VALUE,
3331 dir: 0,
3332 disabled: HAS_BOOLEAN_VALUE,
3333 download: HAS_OVERLOADED_BOOLEAN_VALUE,
3334 draggable: 0,
3335 encType: 0,
3336 form: 0,
3337 formAction: 0,
3338 formEncType: 0,
3339 formMethod: 0,
3340 formNoValidate: HAS_BOOLEAN_VALUE,
3341 formTarget: 0,
3342 frameBorder: 0,
3343 headers: 0,
3344 height: 0,
3345 hidden: HAS_BOOLEAN_VALUE,
3346 high: 0,
3347 href: 0,
3348 hrefLang: 0,
3349 htmlFor: 0,
3350 httpEquiv: 0,
3351 icon: 0,
3352 id: 0,
3353 inputMode: 0,
3354 integrity: 0,
3355 is: 0,
3356 keyParams: 0,
3357 keyType: 0,
3358 kind: 0,
3359 label: 0,
3360 lang: 0,
3361 list: 0,
3362 loop: HAS_BOOLEAN_VALUE,
3363 low: 0,
3364 manifest: 0,
3365 marginHeight: 0,
3366 marginWidth: 0,
3367 max: 0,
3368 maxLength: 0,
3369 media: 0,
3370 mediaGroup: 0,
3371 method: 0,
3372 min: 0,
3373 minLength: 0,
3374 // Caution; `option.selected` is not updated if `select.multiple` is
3375 // disabled with `removeAttribute`.
3376 multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3377 muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3378 name: 0,
3379 nonce: 0,
3380 noValidate: HAS_BOOLEAN_VALUE,
3381 open: HAS_BOOLEAN_VALUE,
3382 optimum: 0,
3383 pattern: 0,
3384 placeholder: 0,
3385 playsInline: HAS_BOOLEAN_VALUE,
3386 poster: 0,
3387 preload: 0,
3388 profile: 0,
3389 radioGroup: 0,
3390 readOnly: HAS_BOOLEAN_VALUE,
3391 referrerPolicy: 0,
3392 rel: 0,
3393 required: HAS_BOOLEAN_VALUE,
3394 reversed: HAS_BOOLEAN_VALUE,
3395 role: 0,
3396 rows: HAS_POSITIVE_NUMERIC_VALUE,
3397 rowSpan: HAS_NUMERIC_VALUE,
3398 sandbox: 0,
3399 scope: 0,
3400 scoped: HAS_BOOLEAN_VALUE,
3401 scrolling: 0,
3402 seamless: HAS_BOOLEAN_VALUE,
3403 selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3404 shape: 0,
3405 size: HAS_POSITIVE_NUMERIC_VALUE,
3406 sizes: 0,
3407 span: HAS_POSITIVE_NUMERIC_VALUE,
3408 spellCheck: 0,
3409 src: 0,
3410 srcDoc: 0,
3411 srcLang: 0,
3412 srcSet: 0,
3413 start: HAS_NUMERIC_VALUE,
3414 step: 0,
3415 style: 0,
3416 summary: 0,
3417 tabIndex: 0,
3418 target: 0,
3419 title: 0,
3420 // Setting .type throws on non-<input> tags
3421 type: 0,
3422 useMap: 0,
3423 value: 0,
3424 width: 0,
3425 wmode: 0,
3426 wrap: 0,
3427
3428 /**
3429 * RDFa Properties
3430 */
3431 about: 0,
3432 datatype: 0,
3433 inlist: 0,
3434 prefix: 0,
3435 // property is also supported for OpenGraph in meta tags.
3436 property: 0,
3437 resource: 0,
3438 'typeof': 0,
3439 vocab: 0,
3440
3441 /**
3442 * Non-standard Properties
3443 */
3444 // autoCapitalize and autoCorrect are supported in Mobile Safari for
3445 // keyboard hints.
3446 autoCapitalize: 0,
3447 autoCorrect: 0,
3448 // autoSave allows WebKit/Blink to persist values of input fields on page reloads
3449 autoSave: 0,
3450 // color is for Safari mask-icon link
3451 color: 0,
3452 // itemProp, itemScope, itemType are for
3453 // Microdata support. See http://schema.org/docs/gs.html
3454 itemProp: 0,
3455 itemScope: HAS_BOOLEAN_VALUE,
3456 itemType: 0,
3457 // itemID and itemRef are for Microdata support as well but
3458 // only specified in the WHATWG spec document. See
3459 // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
3460 itemID: 0,
3461 itemRef: 0,
3462 // results show looking glass icon and recent searches on input
3463 // search fields in WebKit/Blink
3464 results: 0,
3465 // IE-only attribute that specifies security restrictions on an iframe
3466 // as an alternative to the sandbox attribute on IE<10
3467 security: 0,
3468 // IE-only attribute that controls focus behavior
3469 unselectable: 0
3470 },
3471 DOMAttributeNames: {
3472 acceptCharset: 'accept-charset',
3473 className: 'class',
3474 htmlFor: 'for',
3475 httpEquiv: 'http-equiv'
3476 },
3477 DOMPropertyNames: {}
3478};
3479
3480module.exports = HTMLDOMPropertyConfig;
3481},{"10":10}],23:[function(_dereq_,module,exports){
3482/**
3483 * Copyright 2013-present, Facebook, Inc.
3484 * All rights reserved.
3485 *
3486 * This source code is licensed under the BSD-style license found in the
3487 * LICENSE file in the root directory of this source tree. An additional grant
3488 * of patent rights can be found in the PATENTS file in the same directory.
3489 *
3490 * @providesModule KeyEscapeUtils
3491 *
3492 */
3493
3494'use strict';
3495
3496/**
3497 * Escape and wrap key so it is safe to use as a reactid
3498 *
3499 * @param {string} key to be escaped.
3500 * @return {string} the escaped key.
3501 */
3502
3503function escape(key) {
3504 var escapeRegex = /[=:]/g;
3505 var escaperLookup = {
3506 '=': '=0',
3507 ':': '=2'
3508 };
3509 var escapedString = ('' + key).replace(escapeRegex, function (match) {
3510 return escaperLookup[match];
3511 });
3512
3513 return '$' + escapedString;
3514}
3515
3516/**
3517 * Unescape and unwrap key for human-readable display
3518 *
3519 * @param {string} key to unescape.
3520 * @return {string} the unescaped key.
3521 */
3522function unescape(key) {
3523 var unescapeRegex = /(=0|=2)/g;
3524 var unescaperLookup = {
3525 '=0': '=',
3526 '=2': ':'
3527 };
3528 var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
3529
3530 return ('' + keySubstring).replace(unescapeRegex, function (match) {
3531 return unescaperLookup[match];
3532 });
3533}
3534
3535var KeyEscapeUtils = {
3536 escape: escape,
3537 unescape: unescape
3538};
3539
3540module.exports = KeyEscapeUtils;
3541},{}],24:[function(_dereq_,module,exports){
3542/**
3543 * Copyright 2013-present, Facebook, Inc.
3544 * All rights reserved.
3545 *
3546 * This source code is licensed under the BSD-style license found in the
3547 * LICENSE file in the root directory of this source tree. An additional grant
3548 * of patent rights can be found in the PATENTS file in the same directory.
3549 *
3550 * @providesModule LinkedStateMixin
3551 */
3552
3553'use strict';
3554
3555var ReactLink = _dereq_(80);
3556var ReactStateSetters = _dereq_(101);
3557
3558/**
3559 * A simple mixin around ReactLink.forState().
3560 * See https://facebook.github.io/react/docs/two-way-binding-helpers.html
3561 */
3562var LinkedStateMixin = {
3563 /**
3564 * Create a ReactLink that's linked to part of this component's state. The
3565 * ReactLink will have the current value of this.state[key] and will call
3566 * setState() when a change is requested.
3567 *
3568 * @param {string} key state key to update. Note: you may want to use keyOf()
3569 * if you're using Google Closure Compiler advanced mode.
3570 * @return {ReactLink} ReactLink instance linking to the state.
3571 */
3572 linkState: function (key) {
3573 return new ReactLink(this.state[key], ReactStateSetters.createStateKeySetter(this, key));
3574 }
3575};
3576
3577module.exports = LinkedStateMixin;
3578},{"101":101,"80":80}],25:[function(_dereq_,module,exports){
3579/**
3580 * Copyright 2013-present, Facebook, Inc.
3581 * All rights reserved.
3582 *
3583 * This source code is licensed under the BSD-style license found in the
3584 * LICENSE file in the root directory of this source tree. An additional grant
3585 * of patent rights can be found in the PATENTS file in the same directory.
3586 *
3587 * @providesModule LinkedValueUtils
3588 */
3589
3590'use strict';
3591
3592var _prodInvariant = _dereq_(153);
3593
3594var ReactPropTypes = _dereq_(91);
3595var ReactPropTypeLocations = _dereq_(90);
3596var ReactPropTypesSecret = _dereq_(92);
3597
3598var invariant = _dereq_(178);
3599var warning = _dereq_(187);
3600
3601var hasReadOnlyValue = {
3602 'button': true,
3603 'checkbox': true,
3604 'image': true,
3605 'hidden': true,
3606 'radio': true,
3607 'reset': true,
3608 'submit': true
3609};
3610
3611function _assertSingleLink(inputProps) {
3612 !(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.') : _prodInvariant('87') : void 0;
3613}
3614function _assertValueLink(inputProps) {
3615 _assertSingleLink(inputProps);
3616 !(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.') : _prodInvariant('88') : void 0;
3617}
3618
3619function _assertCheckedLink(inputProps) {
3620 _assertSingleLink(inputProps);
3621 !(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') : _prodInvariant('89') : void 0;
3622}
3623
3624var propTypes = {
3625 value: function (props, propName, componentName) {
3626 if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
3627 return null;
3628 }
3629 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`.');
3630 },
3631 checked: function (props, propName, componentName) {
3632 if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
3633 return null;
3634 }
3635 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`.');
3636 },
3637 onChange: ReactPropTypes.func
3638};
3639
3640var loggedTypeFailures = {};
3641function getDeclarationErrorAddendum(owner) {
3642 if (owner) {
3643 var name = owner.getName();
3644 if (name) {
3645 return ' Check the render method of `' + name + '`.';
3646 }
3647 }
3648 return '';
3649}
3650
3651/**
3652 * Provide a linked `value` attribute for controlled forms. You should not use
3653 * this outside of the ReactDOM controlled form components.
3654 */
3655var LinkedValueUtils = {
3656 checkPropTypes: function (tagName, props, owner) {
3657 for (var propName in propTypes) {
3658 if (propTypes.hasOwnProperty(propName)) {
3659 var error = propTypes[propName](props, propName, tagName, ReactPropTypeLocations.prop, null, ReactPropTypesSecret);
3660 }
3661 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
3662 // Only monitor this failure once because there tends to be a lot of the
3663 // same error.
3664 loggedTypeFailures[error.message] = true;
3665
3666 var addendum = getDeclarationErrorAddendum(owner);
3667 "development" !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
3668 }
3669 }
3670 },
3671
3672 /**
3673 * @param {object} inputProps Props for form component
3674 * @return {*} current value of the input either from value prop or link.
3675 */
3676 getValue: function (inputProps) {
3677 if (inputProps.valueLink) {
3678 _assertValueLink(inputProps);
3679 return inputProps.valueLink.value;
3680 }
3681 return inputProps.value;
3682 },
3683
3684 /**
3685 * @param {object} inputProps Props for form component
3686 * @return {*} current checked status of the input either from checked prop
3687 * or link.
3688 */
3689 getChecked: function (inputProps) {
3690 if (inputProps.checkedLink) {
3691 _assertCheckedLink(inputProps);
3692 return inputProps.checkedLink.value;
3693 }
3694 return inputProps.checked;
3695 },
3696
3697 /**
3698 * @param {object} inputProps Props for form component
3699 * @param {SyntheticEvent} event change event to handle
3700 */
3701 executeOnChange: function (inputProps, event) {
3702 if (inputProps.valueLink) {
3703 _assertValueLink(inputProps);
3704 return inputProps.valueLink.requestChange(event.target.value);
3705 } else if (inputProps.checkedLink) {
3706 _assertCheckedLink(inputProps);
3707 return inputProps.checkedLink.requestChange(event.target.checked);
3708 } else if (inputProps.onChange) {
3709 return inputProps.onChange.call(undefined, event);
3710 }
3711 }
3712};
3713
3714module.exports = LinkedValueUtils;
3715},{"153":153,"178":178,"187":187,"90":90,"91":91,"92":92}],26:[function(_dereq_,module,exports){
3716/**
3717 * Copyright 2013-present, Facebook, Inc.
3718 * All rights reserved.
3719 *
3720 * This source code is licensed under the BSD-style license found in the
3721 * LICENSE file in the root directory of this source tree. An additional grant
3722 * of patent rights can be found in the PATENTS file in the same directory.
3723 *
3724 * @providesModule PooledClass
3725 */
3726
3727'use strict';
3728
3729var _prodInvariant = _dereq_(153);
3730
3731var invariant = _dereq_(178);
3732
3733/**
3734 * Static poolers. Several custom versions for each potential number of
3735 * arguments. A completely generic pooler is easy to implement, but would
3736 * require accessing the `arguments` object. In each of these, `this` refers to
3737 * the Class itself, not an instance. If any others are needed, simply add them
3738 * here, or in their own files.
3739 */
3740var oneArgumentPooler = function (copyFieldsFrom) {
3741 var Klass = this;
3742 if (Klass.instancePool.length) {
3743 var instance = Klass.instancePool.pop();
3744 Klass.call(instance, copyFieldsFrom);
3745 return instance;
3746 } else {
3747 return new Klass(copyFieldsFrom);
3748 }
3749};
3750
3751var twoArgumentPooler = function (a1, a2) {
3752 var Klass = this;
3753 if (Klass.instancePool.length) {
3754 var instance = Klass.instancePool.pop();
3755 Klass.call(instance, a1, a2);
3756 return instance;
3757 } else {
3758 return new Klass(a1, a2);
3759 }
3760};
3761
3762var threeArgumentPooler = function (a1, a2, a3) {
3763 var Klass = this;
3764 if (Klass.instancePool.length) {
3765 var instance = Klass.instancePool.pop();
3766 Klass.call(instance, a1, a2, a3);
3767 return instance;
3768 } else {
3769 return new Klass(a1, a2, a3);
3770 }
3771};
3772
3773var fourArgumentPooler = function (a1, a2, a3, a4) {
3774 var Klass = this;
3775 if (Klass.instancePool.length) {
3776 var instance = Klass.instancePool.pop();
3777 Klass.call(instance, a1, a2, a3, a4);
3778 return instance;
3779 } else {
3780 return new Klass(a1, a2, a3, a4);
3781 }
3782};
3783
3784var fiveArgumentPooler = function (a1, a2, a3, a4, a5) {
3785 var Klass = this;
3786 if (Klass.instancePool.length) {
3787 var instance = Klass.instancePool.pop();
3788 Klass.call(instance, a1, a2, a3, a4, a5);
3789 return instance;
3790 } else {
3791 return new Klass(a1, a2, a3, a4, a5);
3792 }
3793};
3794
3795var standardReleaser = function (instance) {
3796 var Klass = this;
3797 !(instance instanceof Klass) ? "development" !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
3798 instance.destructor();
3799 if (Klass.instancePool.length < Klass.poolSize) {
3800 Klass.instancePool.push(instance);
3801 }
3802};
3803
3804var DEFAULT_POOL_SIZE = 10;
3805var DEFAULT_POOLER = oneArgumentPooler;
3806
3807/**
3808 * Augments `CopyConstructor` to be a poolable class, augmenting only the class
3809 * itself (statically) not adding any prototypical fields. Any CopyConstructor
3810 * you give this may have a `poolSize` property, and will look for a
3811 * prototypical `destructor` on instances.
3812 *
3813 * @param {Function} CopyConstructor Constructor that can be used to reset.
3814 * @param {Function} pooler Customizable pooler.
3815 */
3816var addPoolingTo = function (CopyConstructor, pooler) {
3817 var NewKlass = CopyConstructor;
3818 NewKlass.instancePool = [];
3819 NewKlass.getPooled = pooler || DEFAULT_POOLER;
3820 if (!NewKlass.poolSize) {
3821 NewKlass.poolSize = DEFAULT_POOL_SIZE;
3822 }
3823 NewKlass.release = standardReleaser;
3824 return NewKlass;
3825};
3826
3827var PooledClass = {
3828 addPoolingTo: addPoolingTo,
3829 oneArgumentPooler: oneArgumentPooler,
3830 twoArgumentPooler: twoArgumentPooler,
3831 threeArgumentPooler: threeArgumentPooler,
3832 fourArgumentPooler: fourArgumentPooler,
3833 fiveArgumentPooler: fiveArgumentPooler
3834};
3835
3836module.exports = PooledClass;
3837},{"153":153,"178":178}],27:[function(_dereq_,module,exports){
3838/**
3839 * Copyright 2013-present, Facebook, Inc.
3840 * All rights reserved.
3841 *
3842 * This source code is licensed under the BSD-style license found in the
3843 * LICENSE file in the root directory of this source tree. An additional grant
3844 * of patent rights can be found in the PATENTS file in the same directory.
3845 *
3846 * @providesModule React
3847 */
3848
3849'use strict';
3850
3851var _assign = _dereq_(188);
3852
3853var ReactChildren = _dereq_(32);
3854var ReactComponent = _dereq_(35);
3855var ReactPureComponent = _dereq_(93);
3856var ReactClass = _dereq_(34);
3857var ReactDOMFactories = _dereq_(49);
3858var ReactElement = _dereq_(65);
3859var ReactPropTypes = _dereq_(91);
3860var ReactVersion = _dereq_(108);
3861
3862var onlyChild = _dereq_(151);
3863var warning = _dereq_(187);
3864
3865var createElement = ReactElement.createElement;
3866var createFactory = ReactElement.createFactory;
3867var cloneElement = ReactElement.cloneElement;
3868
3869if ("development" !== 'production') {
3870 var ReactElementValidator = _dereq_(66);
3871 createElement = ReactElementValidator.createElement;
3872 createFactory = ReactElementValidator.createFactory;
3873 cloneElement = ReactElementValidator.cloneElement;
3874}
3875
3876var __spread = _assign;
3877
3878if ("development" !== 'production') {
3879 var warned = false;
3880 __spread = function () {
3881 "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;
3882 warned = true;
3883 return _assign.apply(null, arguments);
3884 };
3885}
3886
3887var React = {
3888
3889 // Modern
3890
3891 Children: {
3892 map: ReactChildren.map,
3893 forEach: ReactChildren.forEach,
3894 count: ReactChildren.count,
3895 toArray: ReactChildren.toArray,
3896 only: onlyChild
3897 },
3898
3899 Component: ReactComponent,
3900 PureComponent: ReactPureComponent,
3901
3902 createElement: createElement,
3903 cloneElement: cloneElement,
3904 isValidElement: ReactElement.isValidElement,
3905
3906 // Classic
3907
3908 PropTypes: ReactPropTypes,
3909 createClass: ReactClass.createClass,
3910 createFactory: createFactory,
3911 createMixin: function (mixin) {
3912 // Currently a noop. Will be used to validate and trace mixins.
3913 return mixin;
3914 },
3915
3916 // This looks DOM specific but these are actually isomorphic helpers
3917 // since they are just generating DOM strings.
3918 DOM: ReactDOMFactories,
3919
3920 version: ReactVersion,
3921
3922 // Deprecated hook for JSX spread, don't use this for anything.
3923 __spread: __spread
3924};
3925
3926module.exports = React;
3927},{"108":108,"151":151,"187":187,"188":188,"32":32,"34":34,"35":35,"49":49,"65":65,"66":66,"91":91,"93":93}],28:[function(_dereq_,module,exports){
3928/**
3929 * Copyright 2013-present, Facebook, Inc.
3930 * All rights reserved.
3931 *
3932 * This source code is licensed under the BSD-style license found in the
3933 * LICENSE file in the root directory of this source tree. An additional grant
3934 * of patent rights can be found in the PATENTS file in the same directory.
3935 *
3936 * @providesModule ReactBrowserEventEmitter
3937 */
3938
3939'use strict';
3940
3941var _assign = _dereq_(188);
3942
3943var EventConstants = _dereq_(16);
3944var EventPluginRegistry = _dereq_(18);
3945var ReactEventEmitterMixin = _dereq_(69);
3946var ViewportMetrics = _dereq_(128);
3947
3948var getVendorPrefixedEventName = _dereq_(147);
3949var isEventSupported = _dereq_(149);
3950
3951/**
3952 * Summary of `ReactBrowserEventEmitter` event handling:
3953 *
3954 * - Top-level delegation is used to trap most native browser events. This
3955 * may only occur in the main thread and is the responsibility of
3956 * ReactEventListener, which is injected and can therefore support pluggable
3957 * event sources. This is the only work that occurs in the main thread.
3958 *
3959 * - We normalize and de-duplicate events to account for browser quirks. This
3960 * may be done in the worker thread.
3961 *
3962 * - Forward these native events (with the associated top-level type used to
3963 * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
3964 * to extract any synthetic events.
3965 *
3966 * - The `EventPluginHub` will then process each event by annotating them with
3967 * "dispatches", a sequence of listeners and IDs that care about that event.
3968 *
3969 * - The `EventPluginHub` then dispatches the events.
3970 *
3971 * Overview of React and the event system:
3972 *
3973 * +------------+ .
3974 * | DOM | .
3975 * +------------+ .
3976 * | .
3977 * v .
3978 * +------------+ .
3979 * | ReactEvent | .
3980 * | Listener | .
3981 * +------------+ . +-----------+
3982 * | . +--------+|SimpleEvent|
3983 * | . | |Plugin |
3984 * +-----|------+ . v +-----------+
3985 * | | | . +--------------+ +------------+
3986 * | +-----------.--->|EventPluginHub| | Event |
3987 * | | . | | +-----------+ | Propagators|
3988 * | ReactEvent | . | | |TapEvent | |------------|
3989 * | Emitter | . | |<---+|Plugin | |other plugin|
3990 * | | . | | +-----------+ | utilities |
3991 * | +-----------.--->| | +------------+
3992 * | | | . +--------------+
3993 * +-----|------+ . ^ +-----------+
3994 * | . | |Enter/Leave|
3995 * + . +-------+|Plugin |
3996 * +-------------+ . +-----------+
3997 * | application | .
3998 * |-------------| .
3999 * | | .
4000 * | | .
4001 * +-------------+ .
4002 * .
4003 * React Core . General Purpose Event Plugin System
4004 */
4005
4006var hasEventPageXY;
4007var alreadyListeningTo = {};
4008var isMonitoringScrollValue = false;
4009var reactTopListenersCounter = 0;
4010
4011// For events like 'submit' which don't consistently bubble (which we trap at a
4012// lower node than `document`), binding at `document` would cause duplicate
4013// events so we don't include them here
4014var topEventMapping = {
4015 topAbort: 'abort',
4016 topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
4017 topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
4018 topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
4019 topBlur: 'blur',
4020 topCanPlay: 'canplay',
4021 topCanPlayThrough: 'canplaythrough',
4022 topChange: 'change',
4023 topClick: 'click',
4024 topCompositionEnd: 'compositionend',
4025 topCompositionStart: 'compositionstart',
4026 topCompositionUpdate: 'compositionupdate',
4027 topContextMenu: 'contextmenu',
4028 topCopy: 'copy',
4029 topCut: 'cut',
4030 topDoubleClick: 'dblclick',
4031 topDrag: 'drag',
4032 topDragEnd: 'dragend',
4033 topDragEnter: 'dragenter',
4034 topDragExit: 'dragexit',
4035 topDragLeave: 'dragleave',
4036 topDragOver: 'dragover',
4037 topDragStart: 'dragstart',
4038 topDrop: 'drop',
4039 topDurationChange: 'durationchange',
4040 topEmptied: 'emptied',
4041 topEncrypted: 'encrypted',
4042 topEnded: 'ended',
4043 topError: 'error',
4044 topFocus: 'focus',
4045 topInput: 'input',
4046 topKeyDown: 'keydown',
4047 topKeyPress: 'keypress',
4048 topKeyUp: 'keyup',
4049 topLoadedData: 'loadeddata',
4050 topLoadedMetadata: 'loadedmetadata',
4051 topLoadStart: 'loadstart',
4052 topMouseDown: 'mousedown',
4053 topMouseMove: 'mousemove',
4054 topMouseOut: 'mouseout',
4055 topMouseOver: 'mouseover',
4056 topMouseUp: 'mouseup',
4057 topPaste: 'paste',
4058 topPause: 'pause',
4059 topPlay: 'play',
4060 topPlaying: 'playing',
4061 topProgress: 'progress',
4062 topRateChange: 'ratechange',
4063 topScroll: 'scroll',
4064 topSeeked: 'seeked',
4065 topSeeking: 'seeking',
4066 topSelectionChange: 'selectionchange',
4067 topStalled: 'stalled',
4068 topSuspend: 'suspend',
4069 topTextInput: 'textInput',
4070 topTimeUpdate: 'timeupdate',
4071 topTouchCancel: 'touchcancel',
4072 topTouchEnd: 'touchend',
4073 topTouchMove: 'touchmove',
4074 topTouchStart: 'touchstart',
4075 topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
4076 topVolumeChange: 'volumechange',
4077 topWaiting: 'waiting',
4078 topWheel: 'wheel'
4079};
4080
4081/**
4082 * To ensure no conflicts with other potential React instances on the page
4083 */
4084var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
4085
4086function getListeningForDocument(mountAt) {
4087 // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
4088 // directly.
4089 if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
4090 mountAt[topListenersIDKey] = reactTopListenersCounter++;
4091 alreadyListeningTo[mountAt[topListenersIDKey]] = {};
4092 }
4093 return alreadyListeningTo[mountAt[topListenersIDKey]];
4094}
4095
4096/**
4097 * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
4098 * example:
4099 *
4100 * EventPluginHub.putListener('myID', 'onClick', myFunction);
4101 *
4102 * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
4103 *
4104 * @internal
4105 */
4106var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
4107
4108 /**
4109 * Injectable event backend
4110 */
4111 ReactEventListener: null,
4112
4113 injection: {
4114 /**
4115 * @param {object} ReactEventListener
4116 */
4117 injectReactEventListener: function (ReactEventListener) {
4118 ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
4119 ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
4120 }
4121 },
4122
4123 /**
4124 * Sets whether or not any created callbacks should be enabled.
4125 *
4126 * @param {boolean} enabled True if callbacks should be enabled.
4127 */
4128 setEnabled: function (enabled) {
4129 if (ReactBrowserEventEmitter.ReactEventListener) {
4130 ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
4131 }
4132 },
4133
4134 /**
4135 * @return {boolean} True if callbacks are enabled.
4136 */
4137 isEnabled: function () {
4138 return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
4139 },
4140
4141 /**
4142 * We listen for bubbled touch events on the document object.
4143 *
4144 * Firefox v8.01 (and possibly others) exhibited strange behavior when
4145 * mounting `onmousemove` events at some node that was not the document
4146 * element. The symptoms were that if your mouse is not moving over something
4147 * contained within that mount point (for example on the background) the
4148 * top-level listeners for `onmousemove` won't be called. However, if you
4149 * register the `mousemove` on the document object, then it will of course
4150 * catch all `mousemove`s. This along with iOS quirks, justifies restricting
4151 * top-level listeners to the document object only, at least for these
4152 * movement types of events and possibly all events.
4153 *
4154 * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
4155 *
4156 * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
4157 * they bubble to document.
4158 *
4159 * @param {string} registrationName Name of listener (e.g. `onClick`).
4160 * @param {object} contentDocumentHandle Document which owns the container
4161 */
4162 listenTo: function (registrationName, contentDocumentHandle) {
4163 var mountAt = contentDocumentHandle;
4164 var isListening = getListeningForDocument(mountAt);
4165 var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
4166
4167 var topLevelTypes = EventConstants.topLevelTypes;
4168 for (var i = 0; i < dependencies.length; i++) {
4169 var dependency = dependencies[i];
4170 if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
4171 if (dependency === topLevelTypes.topWheel) {
4172 if (isEventSupported('wheel')) {
4173 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'wheel', mountAt);
4174 } else if (isEventSupported('mousewheel')) {
4175 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'mousewheel', mountAt);
4176 } else {
4177 // Firefox needs to capture a different mouse scroll event.
4178 // @see http://www.quirksmode.org/dom/events/tests/scroll.html
4179 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topWheel, 'DOMMouseScroll', mountAt);
4180 }
4181 } else if (dependency === topLevelTypes.topScroll) {
4182
4183 if (isEventSupported('scroll', true)) {
4184 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topScroll, 'scroll', mountAt);
4185 } else {
4186 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topScroll, 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
4187 }
4188 } else if (dependency === topLevelTypes.topFocus || dependency === topLevelTypes.topBlur) {
4189
4190 if (isEventSupported('focus', true)) {
4191 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topFocus, 'focus', mountAt);
4192 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelTypes.topBlur, 'blur', mountAt);
4193 } else if (isEventSupported('focusin')) {
4194 // IE has `focusin` and `focusout` events which bubble.
4195 // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
4196 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topFocus, 'focusin', mountAt);
4197 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelTypes.topBlur, 'focusout', mountAt);
4198 }
4199
4200 // to make sure blur and focus event listeners are only attached once
4201 isListening[topLevelTypes.topBlur] = true;
4202 isListening[topLevelTypes.topFocus] = true;
4203 } else if (topEventMapping.hasOwnProperty(dependency)) {
4204 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
4205 }
4206
4207 isListening[dependency] = true;
4208 }
4209 }
4210 },
4211
4212 trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
4213 return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
4214 },
4215
4216 trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
4217 return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
4218 },
4219
4220 /**
4221 * Protect against document.createEvent() returning null
4222 * Some popup blocker extensions appear to do this:
4223 * https://github.com/facebook/react/issues/6887
4224 */
4225 supportsEventPageXY: function () {
4226 if (!document.createEvent) {
4227 return false;
4228 }
4229 var ev = document.createEvent('MouseEvent');
4230 return ev != null && 'pageX' in ev;
4231 },
4232
4233 /**
4234 * Listens to window scroll and resize events. We cache scroll values so that
4235 * application code can access them without triggering reflows.
4236 *
4237 * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when
4238 * pageX/pageY isn't supported (legacy browsers).
4239 *
4240 * NOTE: Scroll events do not bubble.
4241 *
4242 * @see http://www.quirksmode.org/dom/events/scroll.html
4243 */
4244 ensureScrollValueMonitoring: function () {
4245 if (hasEventPageXY === undefined) {
4246 hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY();
4247 }
4248 if (!hasEventPageXY && !isMonitoringScrollValue) {
4249 var refresh = ViewportMetrics.refreshScrollValues;
4250 ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
4251 isMonitoringScrollValue = true;
4252 }
4253 }
4254
4255});
4256
4257module.exports = ReactBrowserEventEmitter;
4258},{"128":128,"147":147,"149":149,"16":16,"18":18,"188":188,"69":69}],29:[function(_dereq_,module,exports){
4259/**
4260 * Copyright 2013-present, Facebook, Inc.
4261 * All rights reserved.
4262 *
4263 * This source code is licensed under the BSD-style license found in the
4264 * LICENSE file in the root directory of this source tree. An additional grant
4265 * of patent rights can be found in the PATENTS file in the same directory.
4266 *
4267 * @providesModule ReactCSSTransitionGroup
4268 */
4269
4270'use strict';
4271
4272var _assign = _dereq_(188);
4273
4274var React = _dereq_(27);
4275
4276var ReactTransitionGroup = _dereq_(105);
4277var ReactCSSTransitionGroupChild = _dereq_(30);
4278
4279function createTransitionTimeoutPropValidator(transitionType) {
4280 var timeoutPropName = 'transition' + transitionType + 'Timeout';
4281 var enabledPropName = 'transition' + transitionType;
4282
4283 return function (props) {
4284 // If the transition is enabled
4285 if (props[enabledPropName]) {
4286 // If no timeout duration is provided
4287 if (props[timeoutPropName] == null) {
4288 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.');
4289
4290 // If the duration isn't a number
4291 } else if (typeof props[timeoutPropName] !== 'number') {
4292 return new Error(timeoutPropName + ' must be a number (in milliseconds)');
4293 }
4294 }
4295 };
4296}
4297
4298/**
4299 * An easy way to perform CSS transitions and animations when a React component
4300 * enters or leaves the DOM.
4301 * See https://facebook.github.io/react/docs/animation.html#high-level-api-reactcsstransitiongroup
4302 */
4303var ReactCSSTransitionGroup = React.createClass({
4304 displayName: 'ReactCSSTransitionGroup',
4305
4306 propTypes: {
4307 transitionName: ReactCSSTransitionGroupChild.propTypes.name,
4308
4309 transitionAppear: React.PropTypes.bool,
4310 transitionEnter: React.PropTypes.bool,
4311 transitionLeave: React.PropTypes.bool,
4312 transitionAppearTimeout: createTransitionTimeoutPropValidator('Appear'),
4313 transitionEnterTimeout: createTransitionTimeoutPropValidator('Enter'),
4314 transitionLeaveTimeout: createTransitionTimeoutPropValidator('Leave')
4315 },
4316
4317 getDefaultProps: function () {
4318 return {
4319 transitionAppear: false,
4320 transitionEnter: true,
4321 transitionLeave: true
4322 };
4323 },
4324
4325 _wrapChild: function (child) {
4326 // We need to provide this childFactory so that
4327 // ReactCSSTransitionGroupChild can receive updates to name, enter, and
4328 // leave while it is leaving.
4329 return React.createElement(ReactCSSTransitionGroupChild, {
4330 name: this.props.transitionName,
4331 appear: this.props.transitionAppear,
4332 enter: this.props.transitionEnter,
4333 leave: this.props.transitionLeave,
4334 appearTimeout: this.props.transitionAppearTimeout,
4335 enterTimeout: this.props.transitionEnterTimeout,
4336 leaveTimeout: this.props.transitionLeaveTimeout
4337 }, child);
4338 },
4339
4340 render: function () {
4341 return React.createElement(ReactTransitionGroup, _assign({}, this.props, { childFactory: this._wrapChild }));
4342 }
4343});
4344
4345module.exports = ReactCSSTransitionGroup;
4346},{"105":105,"188":188,"27":27,"30":30}],30:[function(_dereq_,module,exports){
4347/**
4348 * Copyright 2013-present, Facebook, Inc.
4349 * All rights reserved.
4350 *
4351 * This source code is licensed under the BSD-style license found in the
4352 * LICENSE file in the root directory of this source tree. An additional grant
4353 * of patent rights can be found in the PATENTS file in the same directory.
4354 *
4355 * @providesModule ReactCSSTransitionGroupChild
4356 */
4357
4358'use strict';
4359
4360var React = _dereq_(27);
4361var ReactDOM = _dereq_(42);
4362
4363var CSSCore = _dereq_(162);
4364var ReactTransitionEvents = _dereq_(104);
4365
4366var onlyChild = _dereq_(151);
4367
4368var TICK = 17;
4369
4370var ReactCSSTransitionGroupChild = React.createClass({
4371 displayName: 'ReactCSSTransitionGroupChild',
4372
4373 propTypes: {
4374 name: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.shape({
4375 enter: React.PropTypes.string,
4376 leave: React.PropTypes.string,
4377 active: React.PropTypes.string
4378 }), React.PropTypes.shape({
4379 enter: React.PropTypes.string,
4380 enterActive: React.PropTypes.string,
4381 leave: React.PropTypes.string,
4382 leaveActive: React.PropTypes.string,
4383 appear: React.PropTypes.string,
4384 appearActive: React.PropTypes.string
4385 })]).isRequired,
4386
4387 // Once we require timeouts to be specified, we can remove the
4388 // boolean flags (appear etc.) and just accept a number
4389 // or a bool for the timeout flags (appearTimeout etc.)
4390 appear: React.PropTypes.bool,
4391 enter: React.PropTypes.bool,
4392 leave: React.PropTypes.bool,
4393 appearTimeout: React.PropTypes.number,
4394 enterTimeout: React.PropTypes.number,
4395 leaveTimeout: React.PropTypes.number
4396 },
4397
4398 transition: function (animationType, finishCallback, userSpecifiedDelay) {
4399 var node = ReactDOM.findDOMNode(this);
4400
4401 if (!node) {
4402 if (finishCallback) {
4403 finishCallback();
4404 }
4405 return;
4406 }
4407
4408 var className = this.props.name[animationType] || this.props.name + '-' + animationType;
4409 var activeClassName = this.props.name[animationType + 'Active'] || className + '-active';
4410 var timeout = null;
4411
4412 var endListener = function (e) {
4413 if (e && e.target !== node) {
4414 return;
4415 }
4416
4417 clearTimeout(timeout);
4418
4419 CSSCore.removeClass(node, className);
4420 CSSCore.removeClass(node, activeClassName);
4421
4422 ReactTransitionEvents.removeEndEventListener(node, endListener);
4423
4424 // Usually this optional callback is used for informing an owner of
4425 // a leave animation and telling it to remove the child.
4426 if (finishCallback) {
4427 finishCallback();
4428 }
4429 };
4430
4431 CSSCore.addClass(node, className);
4432
4433 // Need to do this to actually trigger a transition.
4434 this.queueClassAndNode(activeClassName, node);
4435
4436 // If the user specified a timeout delay.
4437 if (userSpecifiedDelay) {
4438 // Clean-up the animation after the specified delay
4439 timeout = setTimeout(endListener, userSpecifiedDelay);
4440 this.transitionTimeouts.push(timeout);
4441 } else {
4442 // DEPRECATED: this listener will be removed in a future version of react
4443 ReactTransitionEvents.addEndEventListener(node, endListener);
4444 }
4445 },
4446
4447 queueClassAndNode: function (className, node) {
4448 this.classNameAndNodeQueue.push({
4449 className: className,
4450 node: node
4451 });
4452
4453 if (!this.timeout) {
4454 this.timeout = setTimeout(this.flushClassNameAndNodeQueue, TICK);
4455 }
4456 },
4457
4458 flushClassNameAndNodeQueue: function () {
4459 if (this.isMounted()) {
4460 this.classNameAndNodeQueue.forEach(function (obj) {
4461 CSSCore.addClass(obj.node, obj.className);
4462 });
4463 }
4464 this.classNameAndNodeQueue.length = 0;
4465 this.timeout = null;
4466 },
4467
4468 componentWillMount: function () {
4469 this.classNameAndNodeQueue = [];
4470 this.transitionTimeouts = [];
4471 },
4472
4473 componentWillUnmount: function () {
4474 if (this.timeout) {
4475 clearTimeout(this.timeout);
4476 }
4477 this.transitionTimeouts.forEach(function (timeout) {
4478 clearTimeout(timeout);
4479 });
4480
4481 this.classNameAndNodeQueue.length = 0;
4482 },
4483
4484 componentWillAppear: function (done) {
4485 if (this.props.appear) {
4486 this.transition('appear', done, this.props.appearTimeout);
4487 } else {
4488 done();
4489 }
4490 },
4491
4492 componentWillEnter: function (done) {
4493 if (this.props.enter) {
4494 this.transition('enter', done, this.props.enterTimeout);
4495 } else {
4496 done();
4497 }
4498 },
4499
4500 componentWillLeave: function (done) {
4501 if (this.props.leave) {
4502 this.transition('leave', done, this.props.leaveTimeout);
4503 } else {
4504 done();
4505 }
4506 },
4507
4508 render: function () {
4509 return onlyChild(this.props.children);
4510 }
4511});
4512
4513module.exports = ReactCSSTransitionGroupChild;
4514},{"104":104,"151":151,"162":162,"27":27,"42":42}],31:[function(_dereq_,module,exports){
4515(function (process){
4516/**
4517 * Copyright 2014-present, Facebook, Inc.
4518 * All rights reserved.
4519 *
4520 * This source code is licensed under the BSD-style license found in the
4521 * LICENSE file in the root directory of this source tree. An additional grant
4522 * of patent rights can be found in the PATENTS file in the same directory.
4523 *
4524 * @providesModule ReactChildReconciler
4525 */
4526
4527'use strict';
4528
4529var ReactReconciler = _dereq_(95);
4530
4531var instantiateReactComponent = _dereq_(148);
4532var KeyEscapeUtils = _dereq_(23);
4533var shouldUpdateReactComponent = _dereq_(158);
4534var traverseAllChildren = _dereq_(159);
4535var warning = _dereq_(187);
4536
4537var ReactComponentTreeHook;
4538
4539if (typeof process !== 'undefined' && process.env && "development" === 'test') {
4540 // Temporary hack.
4541 // Inline requires don't work well with Jest:
4542 // https://github.com/facebook/react/issues/7240
4543 // Remove the inline requires when we don't need them anymore:
4544 // https://github.com/facebook/react/pull/7178
4545 ReactComponentTreeHook = _dereq_(38);
4546}
4547
4548function instantiateChild(childInstances, child, name, selfDebugID) {
4549 // We found a component instance.
4550 var keyUnique = childInstances[name] === undefined;
4551 if ("development" !== 'production') {
4552 if (!ReactComponentTreeHook) {
4553 ReactComponentTreeHook = _dereq_(38);
4554 }
4555 if (!keyUnique) {
4556 "development" !== 'production' ? warning(false, '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.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
4557 }
4558 }
4559 if (child != null && keyUnique) {
4560 childInstances[name] = instantiateReactComponent(child, true);
4561 }
4562}
4563
4564/**
4565 * ReactChildReconciler provides helpers for initializing or updating a set of
4566 * children. Its output is suitable for passing it onto ReactMultiChild which
4567 * does diffed reordering and insertion.
4568 */
4569var ReactChildReconciler = {
4570 /**
4571 * Generates a "mount image" for each of the supplied children. In the case
4572 * of `ReactDOMComponent`, a mount image is a string of markup.
4573 *
4574 * @param {?object} nestedChildNodes Nested child maps.
4575 * @return {?object} A set of child instances.
4576 * @internal
4577 */
4578 instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID // 0 in production and for roots
4579 ) {
4580 if (nestedChildNodes == null) {
4581 return null;
4582 }
4583 var childInstances = {};
4584
4585 if ("development" !== 'production') {
4586 traverseAllChildren(nestedChildNodes, function (childInsts, child, name) {
4587 return instantiateChild(childInsts, child, name, selfDebugID);
4588 }, childInstances);
4589 } else {
4590 traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
4591 }
4592 return childInstances;
4593 },
4594
4595 /**
4596 * Updates the rendered children and returns a new set of children.
4597 *
4598 * @param {?object} prevChildren Previously initialized set of children.
4599 * @param {?object} nextChildren Flat child element maps.
4600 * @param {ReactReconcileTransaction} transaction
4601 * @param {object} context
4602 * @return {?object} A new set of child instances.
4603 * @internal
4604 */
4605 updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID // 0 in production and for roots
4606 ) {
4607 // We currently don't have a way to track moves here but if we use iterators
4608 // instead of for..in we can zip the iterators and check if an item has
4609 // moved.
4610 // TODO: If nothing has changed, return the prevChildren object so that we
4611 // can quickly bailout if nothing has changed.
4612 if (!nextChildren && !prevChildren) {
4613 return;
4614 }
4615 var name;
4616 var prevChild;
4617 for (name in nextChildren) {
4618 if (!nextChildren.hasOwnProperty(name)) {
4619 continue;
4620 }
4621 prevChild = prevChildren && prevChildren[name];
4622 var prevElement = prevChild && prevChild._currentElement;
4623 var nextElement = nextChildren[name];
4624 if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
4625 ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
4626 nextChildren[name] = prevChild;
4627 } else {
4628 if (prevChild) {
4629 removedNodes[name] = ReactReconciler.getHostNode(prevChild);
4630 ReactReconciler.unmountComponent(prevChild, false);
4631 }
4632 // The child must be instantiated before it's mounted.
4633 var nextChildInstance = instantiateReactComponent(nextElement, true);
4634 nextChildren[name] = nextChildInstance;
4635 // Creating mount image now ensures refs are resolved in right order
4636 // (see https://github.com/facebook/react/pull/7101 for explanation).
4637 var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID);
4638 mountImages.push(nextChildMountImage);
4639 }
4640 }
4641 // Unmount children that are no longer present.
4642 for (name in prevChildren) {
4643 if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
4644 prevChild = prevChildren[name];
4645 removedNodes[name] = ReactReconciler.getHostNode(prevChild);
4646 ReactReconciler.unmountComponent(prevChild, false);
4647 }
4648 }
4649 },
4650
4651 /**
4652 * Unmounts all rendered children. This should be used to clean up children
4653 * when this component is unmounted.
4654 *
4655 * @param {?object} renderedChildren Previously initialized set of children.
4656 * @internal
4657 */
4658 unmountChildren: function (renderedChildren, safely) {
4659 for (var name in renderedChildren) {
4660 if (renderedChildren.hasOwnProperty(name)) {
4661 var renderedChild = renderedChildren[name];
4662 ReactReconciler.unmountComponent(renderedChild, safely);
4663 }
4664 }
4665 }
4666
4667};
4668
4669module.exports = ReactChildReconciler;
4670}).call(this,undefined)
4671},{"148":148,"158":158,"159":159,"187":187,"23":23,"38":38,"95":95}],32:[function(_dereq_,module,exports){
4672/**
4673 * Copyright 2013-present, Facebook, Inc.
4674 * All rights reserved.
4675 *
4676 * This source code is licensed under the BSD-style license found in the
4677 * LICENSE file in the root directory of this source tree. An additional grant
4678 * of patent rights can be found in the PATENTS file in the same directory.
4679 *
4680 * @providesModule ReactChildren
4681 */
4682
4683'use strict';
4684
4685var PooledClass = _dereq_(26);
4686var ReactElement = _dereq_(65);
4687
4688var emptyFunction = _dereq_(170);
4689var traverseAllChildren = _dereq_(159);
4690
4691var twoArgumentPooler = PooledClass.twoArgumentPooler;
4692var fourArgumentPooler = PooledClass.fourArgumentPooler;
4693
4694var userProvidedKeyEscapeRegex = /\/+/g;
4695function escapeUserProvidedKey(text) {
4696 return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
4697}
4698
4699/**
4700 * PooledClass representing the bookkeeping associated with performing a child
4701 * traversal. Allows avoiding binding callbacks.
4702 *
4703 * @constructor ForEachBookKeeping
4704 * @param {!function} forEachFunction Function to perform traversal with.
4705 * @param {?*} forEachContext Context to perform context with.
4706 */
4707function ForEachBookKeeping(forEachFunction, forEachContext) {
4708 this.func = forEachFunction;
4709 this.context = forEachContext;
4710 this.count = 0;
4711}
4712ForEachBookKeeping.prototype.destructor = function () {
4713 this.func = null;
4714 this.context = null;
4715 this.count = 0;
4716};
4717PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
4718
4719function forEachSingleChild(bookKeeping, child, name) {
4720 var func = bookKeeping.func;
4721 var context = bookKeeping.context;
4722
4723 func.call(context, child, bookKeeping.count++);
4724}
4725
4726/**
4727 * Iterates through children that are typically specified as `props.children`.
4728 *
4729 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach
4730 *
4731 * The provided forEachFunc(child, index) will be called for each
4732 * leaf child.
4733 *
4734 * @param {?*} children Children tree container.
4735 * @param {function(*, int)} forEachFunc
4736 * @param {*} forEachContext Context for forEachContext.
4737 */
4738function forEachChildren(children, forEachFunc, forEachContext) {
4739 if (children == null) {
4740 return children;
4741 }
4742 var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
4743 traverseAllChildren(children, forEachSingleChild, traverseContext);
4744 ForEachBookKeeping.release(traverseContext);
4745}
4746
4747/**
4748 * PooledClass representing the bookkeeping associated with performing a child
4749 * mapping. Allows avoiding binding callbacks.
4750 *
4751 * @constructor MapBookKeeping
4752 * @param {!*} mapResult Object containing the ordered map of results.
4753 * @param {!function} mapFunction Function to perform mapping with.
4754 * @param {?*} mapContext Context to perform mapping with.
4755 */
4756function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
4757 this.result = mapResult;
4758 this.keyPrefix = keyPrefix;
4759 this.func = mapFunction;
4760 this.context = mapContext;
4761 this.count = 0;
4762}
4763MapBookKeeping.prototype.destructor = function () {
4764 this.result = null;
4765 this.keyPrefix = null;
4766 this.func = null;
4767 this.context = null;
4768 this.count = 0;
4769};
4770PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler);
4771
4772function mapSingleChildIntoContext(bookKeeping, child, childKey) {
4773 var result = bookKeeping.result;
4774 var keyPrefix = bookKeeping.keyPrefix;
4775 var func = bookKeeping.func;
4776 var context = bookKeeping.context;
4777
4778
4779 var mappedChild = func.call(context, child, bookKeeping.count++);
4780 if (Array.isArray(mappedChild)) {
4781 mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
4782 } else if (mappedChild != null) {
4783 if (ReactElement.isValidElement(mappedChild)) {
4784 mappedChild = ReactElement.cloneAndReplaceKey(mappedChild,
4785 // Keep both the (mapped) and old keys if they differ, just as
4786 // traverseAllChildren used to do for objects as children
4787 keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
4788 }
4789 result.push(mappedChild);
4790 }
4791}
4792
4793function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
4794 var escapedPrefix = '';
4795 if (prefix != null) {
4796 escapedPrefix = escapeUserProvidedKey(prefix) + '/';
4797 }
4798 var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
4799 traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
4800 MapBookKeeping.release(traverseContext);
4801}
4802
4803/**
4804 * Maps children that are typically specified as `props.children`.
4805 *
4806 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map
4807 *
4808 * The provided mapFunction(child, key, index) will be called for each
4809 * leaf child.
4810 *
4811 * @param {?*} children Children tree container.
4812 * @param {function(*, int)} func The map function.
4813 * @param {*} context Context for mapFunction.
4814 * @return {object} Object containing the ordered map of results.
4815 */
4816function mapChildren(children, func, context) {
4817 if (children == null) {
4818 return children;
4819 }
4820 var result = [];
4821 mapIntoWithKeyPrefixInternal(children, result, null, func, context);
4822 return result;
4823}
4824
4825function forEachSingleChildDummy(traverseContext, child, name) {
4826 return null;
4827}
4828
4829/**
4830 * Count the number of children that are typically specified as
4831 * `props.children`.
4832 *
4833 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count
4834 *
4835 * @param {?*} children Children tree container.
4836 * @return {number} The number of children.
4837 */
4838function countChildren(children, context) {
4839 return traverseAllChildren(children, forEachSingleChildDummy, null);
4840}
4841
4842/**
4843 * Flatten a children object (typically specified as `props.children`) and
4844 * return an array with appropriately re-keyed children.
4845 *
4846 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray
4847 */
4848function toArray(children) {
4849 var result = [];
4850 mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
4851 return result;
4852}
4853
4854var ReactChildren = {
4855 forEach: forEachChildren,
4856 map: mapChildren,
4857 mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
4858 count: countChildren,
4859 toArray: toArray
4860};
4861
4862module.exports = ReactChildren;
4863},{"159":159,"170":170,"26":26,"65":65}],33:[function(_dereq_,module,exports){
4864/**
4865 * Copyright 2013-present, Facebook, Inc.
4866 * All rights reserved.
4867 *
4868 * This source code is licensed under the BSD-style license found in the
4869 * LICENSE file in the root directory of this source tree. An additional grant
4870 * of patent rights can be found in the PATENTS file in the same directory.
4871 *
4872 * @providesModule ReactChildrenMutationWarningHook
4873 */
4874
4875'use strict';
4876
4877var ReactComponentTreeHook = _dereq_(38);
4878
4879var warning = _dereq_(187);
4880
4881function handleElement(debugID, element) {
4882 if (element == null) {
4883 return;
4884 }
4885 if (element._shadowChildren === undefined) {
4886 return;
4887 }
4888 if (element._shadowChildren === element.props.children) {
4889 return;
4890 }
4891 var isMutated = false;
4892 if (Array.isArray(element._shadowChildren)) {
4893 if (element._shadowChildren.length === element.props.children.length) {
4894 for (var i = 0; i < element._shadowChildren.length; i++) {
4895 if (element._shadowChildren[i] !== element.props.children[i]) {
4896 isMutated = true;
4897 }
4898 }
4899 } else {
4900 isMutated = true;
4901 }
4902 }
4903 if (!Array.isArray(element._shadowChildren) || isMutated) {
4904 "development" !== 'production' ? warning(false, 'Component\'s children should not be mutated.%s', ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
4905 }
4906}
4907
4908var ReactChildrenMutationWarningHook = {
4909 onMountComponent: function (debugID) {
4910 handleElement(debugID, ReactComponentTreeHook.getElement(debugID));
4911 },
4912 onUpdateComponent: function (debugID) {
4913 handleElement(debugID, ReactComponentTreeHook.getElement(debugID));
4914 }
4915};
4916
4917module.exports = ReactChildrenMutationWarningHook;
4918},{"187":187,"38":38}],34:[function(_dereq_,module,exports){
4919/**
4920 * Copyright 2013-present, Facebook, Inc.
4921 * All rights reserved.
4922 *
4923 * This source code is licensed under the BSD-style license found in the
4924 * LICENSE file in the root directory of this source tree. An additional grant
4925 * of patent rights can be found in the PATENTS file in the same directory.
4926 *
4927 * @providesModule ReactClass
4928 */
4929
4930'use strict';
4931
4932var _prodInvariant = _dereq_(153),
4933 _assign = _dereq_(188);
4934
4935var ReactComponent = _dereq_(35);
4936var ReactElement = _dereq_(65);
4937var ReactPropTypeLocations = _dereq_(90);
4938var ReactPropTypeLocationNames = _dereq_(89);
4939var ReactNoopUpdateQueue = _dereq_(86);
4940
4941var emptyObject = _dereq_(171);
4942var invariant = _dereq_(178);
4943var keyMirror = _dereq_(181);
4944var keyOf = _dereq_(182);
4945var warning = _dereq_(187);
4946
4947var MIXINS_KEY = keyOf({ mixins: null });
4948
4949/**
4950 * Policies that describe methods in `ReactClassInterface`.
4951 */
4952var SpecPolicy = keyMirror({
4953 /**
4954 * These methods may be defined only once by the class specification or mixin.
4955 */
4956 DEFINE_ONCE: null,
4957 /**
4958 * These methods may be defined by both the class specification and mixins.
4959 * Subsequent definitions will be chained. These methods must return void.
4960 */
4961 DEFINE_MANY: null,
4962 /**
4963 * These methods are overriding the base class.
4964 */
4965 OVERRIDE_BASE: null,
4966 /**
4967 * These methods are similar to DEFINE_MANY, except we assume they return
4968 * objects. We try to merge the keys of the return values of all the mixed in
4969 * functions. If there is a key conflict we throw.
4970 */
4971 DEFINE_MANY_MERGED: null
4972});
4973
4974var injectedMixins = [];
4975
4976/**
4977 * Composite components are higher-level components that compose other composite
4978 * or host components.
4979 *
4980 * To create a new type of `ReactClass`, pass a specification of
4981 * your new class to `React.createClass`. The only requirement of your class
4982 * specification is that you implement a `render` method.
4983 *
4984 * var MyComponent = React.createClass({
4985 * render: function() {
4986 * return <div>Hello World</div>;
4987 * }
4988 * });
4989 *
4990 * The class specification supports a specific protocol of methods that have
4991 * special meaning (e.g. `render`). See `ReactClassInterface` for
4992 * more the comprehensive protocol. Any other properties and methods in the
4993 * class specification will be available on the prototype.
4994 *
4995 * @interface ReactClassInterface
4996 * @internal
4997 */
4998var ReactClassInterface = {
4999
5000 /**
5001 * An array of Mixin objects to include when defining your component.
5002 *
5003 * @type {array}
5004 * @optional
5005 */
5006 mixins: SpecPolicy.DEFINE_MANY,
5007
5008 /**
5009 * An object containing properties and methods that should be defined on
5010 * the component's constructor instead of its prototype (static methods).
5011 *
5012 * @type {object}
5013 * @optional
5014 */
5015 statics: SpecPolicy.DEFINE_MANY,
5016
5017 /**
5018 * Definition of prop types for this component.
5019 *
5020 * @type {object}
5021 * @optional
5022 */
5023 propTypes: SpecPolicy.DEFINE_MANY,
5024
5025 /**
5026 * Definition of context types for this component.
5027 *
5028 * @type {object}
5029 * @optional
5030 */
5031 contextTypes: SpecPolicy.DEFINE_MANY,
5032
5033 /**
5034 * Definition of context types this component sets for its children.
5035 *
5036 * @type {object}
5037 * @optional
5038 */
5039 childContextTypes: SpecPolicy.DEFINE_MANY,
5040
5041 // ==== Definition methods ====
5042
5043 /**
5044 * Invoked when the component is mounted. Values in the mapping will be set on
5045 * `this.props` if that prop is not specified (i.e. using an `in` check).
5046 *
5047 * This method is invoked before `getInitialState` and therefore cannot rely
5048 * on `this.state` or use `this.setState`.
5049 *
5050 * @return {object}
5051 * @optional
5052 */
5053 getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED,
5054
5055 /**
5056 * Invoked once before the component is mounted. The return value will be used
5057 * as the initial value of `this.state`.
5058 *
5059 * getInitialState: function() {
5060 * return {
5061 * isOn: false,
5062 * fooBaz: new BazFoo()
5063 * }
5064 * }
5065 *
5066 * @return {object}
5067 * @optional
5068 */
5069 getInitialState: SpecPolicy.DEFINE_MANY_MERGED,
5070
5071 /**
5072 * @return {object}
5073 * @optional
5074 */
5075 getChildContext: SpecPolicy.DEFINE_MANY_MERGED,
5076
5077 /**
5078 * Uses props from `this.props` and state from `this.state` to render the
5079 * structure of the component.
5080 *
5081 * No guarantees are made about when or how often this method is invoked, so
5082 * it must not have side effects.
5083 *
5084 * render: function() {
5085 * var name = this.props.name;
5086 * return <div>Hello, {name}!</div>;
5087 * }
5088 *
5089 * @return {ReactComponent}
5090 * @nosideeffects
5091 * @required
5092 */
5093 render: SpecPolicy.DEFINE_ONCE,
5094
5095 // ==== Delegate methods ====
5096
5097 /**
5098 * Invoked when the component is initially created and about to be mounted.
5099 * This may have side effects, but any external subscriptions or data created
5100 * by this method must be cleaned up in `componentWillUnmount`.
5101 *
5102 * @optional
5103 */
5104 componentWillMount: SpecPolicy.DEFINE_MANY,
5105
5106 /**
5107 * Invoked when the component has been mounted and has a DOM representation.
5108 * However, there is no guarantee that the DOM node is in the document.
5109 *
5110 * Use this as an opportunity to operate on the DOM when the component has
5111 * been mounted (initialized and rendered) for the first time.
5112 *
5113 * @param {DOMElement} rootNode DOM element representing the component.
5114 * @optional
5115 */
5116 componentDidMount: SpecPolicy.DEFINE_MANY,
5117
5118 /**
5119 * Invoked before the component receives new props.
5120 *
5121 * Use this as an opportunity to react to a prop transition by updating the
5122 * state using `this.setState`. Current props are accessed via `this.props`.
5123 *
5124 * componentWillReceiveProps: function(nextProps, nextContext) {
5125 * this.setState({
5126 * likesIncreasing: nextProps.likeCount > this.props.likeCount
5127 * });
5128 * }
5129 *
5130 * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
5131 * transition may cause a state change, but the opposite is not true. If you
5132 * need it, you are probably looking for `componentWillUpdate`.
5133 *
5134 * @param {object} nextProps
5135 * @optional
5136 */
5137 componentWillReceiveProps: SpecPolicy.DEFINE_MANY,
5138
5139 /**
5140 * Invoked while deciding if the component should be updated as a result of
5141 * receiving new props, state and/or context.
5142 *
5143 * Use this as an opportunity to `return false` when you're certain that the
5144 * transition to the new props/state/context will not require a component
5145 * update.
5146 *
5147 * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
5148 * return !equal(nextProps, this.props) ||
5149 * !equal(nextState, this.state) ||
5150 * !equal(nextContext, this.context);
5151 * }
5152 *
5153 * @param {object} nextProps
5154 * @param {?object} nextState
5155 * @param {?object} nextContext
5156 * @return {boolean} True if the component should update.
5157 * @optional
5158 */
5159 shouldComponentUpdate: SpecPolicy.DEFINE_ONCE,
5160
5161 /**
5162 * Invoked when the component is about to update due to a transition from
5163 * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
5164 * and `nextContext`.
5165 *
5166 * Use this as an opportunity to perform preparation before an update occurs.
5167 *
5168 * NOTE: You **cannot** use `this.setState()` in this method.
5169 *
5170 * @param {object} nextProps
5171 * @param {?object} nextState
5172 * @param {?object} nextContext
5173 * @param {ReactReconcileTransaction} transaction
5174 * @optional
5175 */
5176 componentWillUpdate: SpecPolicy.DEFINE_MANY,
5177
5178 /**
5179 * Invoked when the component's DOM representation has been updated.
5180 *
5181 * Use this as an opportunity to operate on the DOM when the component has
5182 * been updated.
5183 *
5184 * @param {object} prevProps
5185 * @param {?object} prevState
5186 * @param {?object} prevContext
5187 * @param {DOMElement} rootNode DOM element representing the component.
5188 * @optional
5189 */
5190 componentDidUpdate: SpecPolicy.DEFINE_MANY,
5191
5192 /**
5193 * Invoked when the component is about to be removed from its parent and have
5194 * its DOM representation destroyed.
5195 *
5196 * Use this as an opportunity to deallocate any external resources.
5197 *
5198 * NOTE: There is no `componentDidUnmount` since your component will have been
5199 * destroyed by that point.
5200 *
5201 * @optional
5202 */
5203 componentWillUnmount: SpecPolicy.DEFINE_MANY,
5204
5205 // ==== Advanced methods ====
5206
5207 /**
5208 * Updates the component's currently mounted DOM representation.
5209 *
5210 * By default, this implements React's rendering and reconciliation algorithm.
5211 * Sophisticated clients may wish to override this.
5212 *
5213 * @param {ReactReconcileTransaction} transaction
5214 * @internal
5215 * @overridable
5216 */
5217 updateComponent: SpecPolicy.OVERRIDE_BASE
5218
5219};
5220
5221/**
5222 * Mapping from class specification keys to special processing functions.
5223 *
5224 * Although these are declared like instance properties in the specification
5225 * when defining classes using `React.createClass`, they are actually static
5226 * and are accessible on the constructor instead of the prototype. Despite
5227 * being static, they must be defined outside of the "statics" key under
5228 * which all other static methods are defined.
5229 */
5230var RESERVED_SPEC_KEYS = {
5231 displayName: function (Constructor, displayName) {
5232 Constructor.displayName = displayName;
5233 },
5234 mixins: function (Constructor, mixins) {
5235 if (mixins) {
5236 for (var i = 0; i < mixins.length; i++) {
5237 mixSpecIntoComponent(Constructor, mixins[i]);
5238 }
5239 }
5240 },
5241 childContextTypes: function (Constructor, childContextTypes) {
5242 if ("development" !== 'production') {
5243 validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext);
5244 }
5245 Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
5246 },
5247 contextTypes: function (Constructor, contextTypes) {
5248 if ("development" !== 'production') {
5249 validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context);
5250 }
5251 Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
5252 },
5253 /**
5254 * Special case getDefaultProps which should move into statics but requires
5255 * automatic merging.
5256 */
5257 getDefaultProps: function (Constructor, getDefaultProps) {
5258 if (Constructor.getDefaultProps) {
5259 Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
5260 } else {
5261 Constructor.getDefaultProps = getDefaultProps;
5262 }
5263 },
5264 propTypes: function (Constructor, propTypes) {
5265 if ("development" !== 'production') {
5266 validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop);
5267 }
5268 Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
5269 },
5270 statics: function (Constructor, statics) {
5271 mixStaticSpecIntoComponent(Constructor, statics);
5272 },
5273 autobind: function () {} };
5274
5275// noop
5276function validateTypeDef(Constructor, typeDef, location) {
5277 for (var propName in typeDef) {
5278 if (typeDef.hasOwnProperty(propName)) {
5279 // use a warning instead of an invariant so components
5280 // don't show up in prod but only in __DEV__
5281 "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;
5282 }
5283 }
5284}
5285
5286function validateMethodOverride(isAlreadyDefined, name) {
5287 var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
5288
5289 // Disallow overriding of base class methods unless explicitly allowed.
5290 if (ReactClassMixin.hasOwnProperty(name)) {
5291 !(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) : _prodInvariant('73', name) : void 0;
5292 }
5293
5294 // Disallow defining methods more than once unless explicitly allowed.
5295 if (isAlreadyDefined) {
5296 !(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) : _prodInvariant('74', name) : void 0;
5297 }
5298}
5299
5300/**
5301 * Mixin helper which handles policy validation and reserved
5302 * specification keys when building React classes.
5303 */
5304function mixSpecIntoComponent(Constructor, spec) {
5305 if (!spec) {
5306 if ("development" !== 'production') {
5307 var typeofSpec = typeof spec;
5308 var isMixinValid = typeofSpec === 'object' && spec !== null;
5309
5310 "development" !== 'production' ? warning(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec) : void 0;
5311 }
5312
5313 return;
5314 }
5315
5316 !(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.') : _prodInvariant('75') : void 0;
5317 !!ReactElement.isValidElement(spec) ? "development" !== 'production' ? invariant(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : _prodInvariant('76') : void 0;
5318
5319 var proto = Constructor.prototype;
5320 var autoBindPairs = proto.__reactAutoBindPairs;
5321
5322 // By handling mixins before any other properties, we ensure the same
5323 // chaining order is applied to methods with DEFINE_MANY policy, whether
5324 // mixins are listed before or after these methods in the spec.
5325 if (spec.hasOwnProperty(MIXINS_KEY)) {
5326 RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
5327 }
5328
5329 for (var name in spec) {
5330 if (!spec.hasOwnProperty(name)) {
5331 continue;
5332 }
5333
5334 if (name === MIXINS_KEY) {
5335 // We have already handled mixins in a special case above.
5336 continue;
5337 }
5338
5339 var property = spec[name];
5340 var isAlreadyDefined = proto.hasOwnProperty(name);
5341 validateMethodOverride(isAlreadyDefined, name);
5342
5343 if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
5344 RESERVED_SPEC_KEYS[name](Constructor, property);
5345 } else {
5346 // Setup methods on prototype:
5347 // The following member methods should not be automatically bound:
5348 // 1. Expected ReactClass methods (in the "interface").
5349 // 2. Overridden methods (that were mixed in).
5350 var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
5351 var isFunction = typeof property === 'function';
5352 var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
5353
5354 if (shouldAutoBind) {
5355 autoBindPairs.push(name, property);
5356 proto[name] = property;
5357 } else {
5358 if (isAlreadyDefined) {
5359 var specPolicy = ReactClassInterface[name];
5360
5361 // These cases should already be caught by validateMethodOverride.
5362 !(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) : _prodInvariant('77', specPolicy, name) : void 0;
5363
5364 // For methods which are defined more than once, call the existing
5365 // methods before calling the new property, merging if appropriate.
5366 if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) {
5367 proto[name] = createMergedResultFunction(proto[name], property);
5368 } else if (specPolicy === SpecPolicy.DEFINE_MANY) {
5369 proto[name] = createChainedFunction(proto[name], property);
5370 }
5371 } else {
5372 proto[name] = property;
5373 if ("development" !== 'production') {
5374 // Add verbose displayName to the function, which helps when looking
5375 // at profiling tools.
5376 if (typeof property === 'function' && spec.displayName) {
5377 proto[name].displayName = spec.displayName + '_' + name;
5378 }
5379 }
5380 }
5381 }
5382 }
5383 }
5384}
5385
5386function mixStaticSpecIntoComponent(Constructor, statics) {
5387 if (!statics) {
5388 return;
5389 }
5390 for (var name in statics) {
5391 var property = statics[name];
5392 if (!statics.hasOwnProperty(name)) {
5393 continue;
5394 }
5395
5396 var isReserved = name in RESERVED_SPEC_KEYS;
5397 !!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) : _prodInvariant('78', name) : void 0;
5398
5399 var isInherited = name in Constructor;
5400 !!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) : _prodInvariant('79', name) : void 0;
5401 Constructor[name] = property;
5402 }
5403}
5404
5405/**
5406 * Merge two objects, but throw if both contain the same key.
5407 *
5408 * @param {object} one The first object, which is mutated.
5409 * @param {object} two The second object
5410 * @return {object} one after it has been mutated to contain everything in two.
5411 */
5412function mergeIntoWithNoDuplicateKeys(one, two) {
5413 !(one && two && typeof one === 'object' && typeof two === 'object') ? "development" !== 'production' ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : _prodInvariant('80') : void 0;
5414
5415 for (var key in two) {
5416 if (two.hasOwnProperty(key)) {
5417 !(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) : _prodInvariant('81', key) : void 0;
5418 one[key] = two[key];
5419 }
5420 }
5421 return one;
5422}
5423
5424/**
5425 * Creates a function that invokes two functions and merges their return values.
5426 *
5427 * @param {function} one Function to invoke first.
5428 * @param {function} two Function to invoke second.
5429 * @return {function} Function that invokes the two argument functions.
5430 * @private
5431 */
5432function createMergedResultFunction(one, two) {
5433 return function mergedResult() {
5434 var a = one.apply(this, arguments);
5435 var b = two.apply(this, arguments);
5436 if (a == null) {
5437 return b;
5438 } else if (b == null) {
5439 return a;
5440 }
5441 var c = {};
5442 mergeIntoWithNoDuplicateKeys(c, a);
5443 mergeIntoWithNoDuplicateKeys(c, b);
5444 return c;
5445 };
5446}
5447
5448/**
5449 * Creates a function that invokes two functions and ignores their return vales.
5450 *
5451 * @param {function} one Function to invoke first.
5452 * @param {function} two Function to invoke second.
5453 * @return {function} Function that invokes the two argument functions.
5454 * @private
5455 */
5456function createChainedFunction(one, two) {
5457 return function chainedFunction() {
5458 one.apply(this, arguments);
5459 two.apply(this, arguments);
5460 };
5461}
5462
5463/**
5464 * Binds a method to the component.
5465 *
5466 * @param {object} component Component whose method is going to be bound.
5467 * @param {function} method Method to be bound.
5468 * @return {function} The bound method.
5469 */
5470function bindAutoBindMethod(component, method) {
5471 var boundMethod = method.bind(component);
5472 if ("development" !== 'production') {
5473 boundMethod.__reactBoundContext = component;
5474 boundMethod.__reactBoundMethod = method;
5475 boundMethod.__reactBoundArguments = null;
5476 var componentName = component.constructor.displayName;
5477 var _bind = boundMethod.bind;
5478 boundMethod.bind = function (newThis) {
5479 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5480 args[_key - 1] = arguments[_key];
5481 }
5482
5483 // User is trying to bind() an autobound method; we effectively will
5484 // ignore the value of "this" that the user is trying to use, so
5485 // let's warn.
5486 if (newThis !== component && newThis !== null) {
5487 "development" !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : void 0;
5488 } else if (!args.length) {
5489 "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;
5490 return boundMethod;
5491 }
5492 var reboundMethod = _bind.apply(boundMethod, arguments);
5493 reboundMethod.__reactBoundContext = component;
5494 reboundMethod.__reactBoundMethod = method;
5495 reboundMethod.__reactBoundArguments = args;
5496 return reboundMethod;
5497 };
5498 }
5499 return boundMethod;
5500}
5501
5502/**
5503 * Binds all auto-bound methods in a component.
5504 *
5505 * @param {object} component Component whose method is going to be bound.
5506 */
5507function bindAutoBindMethods(component) {
5508 var pairs = component.__reactAutoBindPairs;
5509 for (var i = 0; i < pairs.length; i += 2) {
5510 var autoBindKey = pairs[i];
5511 var method = pairs[i + 1];
5512 component[autoBindKey] = bindAutoBindMethod(component, method);
5513 }
5514}
5515
5516/**
5517 * Add more to the ReactClass base class. These are all legacy features and
5518 * therefore not already part of the modern ReactComponent.
5519 */
5520var ReactClassMixin = {
5521
5522 /**
5523 * TODO: This will be deprecated because state should always keep a consistent
5524 * type signature and the only use case for this, is to avoid that.
5525 */
5526 replaceState: function (newState, callback) {
5527 this.updater.enqueueReplaceState(this, newState);
5528 if (callback) {
5529 this.updater.enqueueCallback(this, callback, 'replaceState');
5530 }
5531 },
5532
5533 /**
5534 * Checks whether or not this composite component is mounted.
5535 * @return {boolean} True if mounted, false otherwise.
5536 * @protected
5537 * @final
5538 */
5539 isMounted: function () {
5540 return this.updater.isMounted(this);
5541 }
5542};
5543
5544var ReactClassComponent = function () {};
5545_assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
5546
5547/**
5548 * Module for creating composite components.
5549 *
5550 * @class ReactClass
5551 */
5552var ReactClass = {
5553
5554 /**
5555 * Creates a composite component class given a class specification.
5556 * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
5557 *
5558 * @param {object} spec Class specification (which must define `render`).
5559 * @return {function} Component constructor function.
5560 * @public
5561 */
5562 createClass: function (spec) {
5563 var Constructor = function (props, context, updater) {
5564 // This constructor gets overridden by mocks. The argument is used
5565 // by mocks to assert on what gets mounted.
5566
5567 if ("development" !== 'production') {
5568 "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;
5569 }
5570
5571 // Wire up auto-binding
5572 if (this.__reactAutoBindPairs.length) {
5573 bindAutoBindMethods(this);
5574 }
5575
5576 this.props = props;
5577 this.context = context;
5578 this.refs = emptyObject;
5579 this.updater = updater || ReactNoopUpdateQueue;
5580
5581 this.state = null;
5582
5583 // ReactClasses doesn't have constructors. Instead, they use the
5584 // getInitialState and componentWillMount methods for initialization.
5585
5586 var initialState = this.getInitialState ? this.getInitialState() : null;
5587 if ("development" !== 'production') {
5588 // We allow auto-mocks to proceed as if they're returning null.
5589 if (initialState === undefined && this.getInitialState._isMockFunction) {
5590 // This is probably bad practice. Consider warning here and
5591 // deprecating this convenience.
5592 initialState = null;
5593 }
5594 }
5595 !(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : _prodInvariant('82', Constructor.displayName || 'ReactCompositeComponent') : void 0;
5596
5597 this.state = initialState;
5598 };
5599 Constructor.prototype = new ReactClassComponent();
5600 Constructor.prototype.constructor = Constructor;
5601 Constructor.prototype.__reactAutoBindPairs = [];
5602
5603 injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
5604
5605 mixSpecIntoComponent(Constructor, spec);
5606
5607 // Initialize the defaultProps property after all mixins have been merged.
5608 if (Constructor.getDefaultProps) {
5609 Constructor.defaultProps = Constructor.getDefaultProps();
5610 }
5611
5612 if ("development" !== 'production') {
5613 // This is a tag to indicate that the use of these method names is ok,
5614 // since it's used with createClass. If it's not, then it's likely a
5615 // mistake so we'll warn you to use the static property, property
5616 // initializer or constructor respectively.
5617 if (Constructor.getDefaultProps) {
5618 Constructor.getDefaultProps.isReactClassApproved = {};
5619 }
5620 if (Constructor.prototype.getInitialState) {
5621 Constructor.prototype.getInitialState.isReactClassApproved = {};
5622 }
5623 }
5624
5625 !Constructor.prototype.render ? "development" !== 'production' ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : _prodInvariant('83') : void 0;
5626
5627 if ("development" !== 'production') {
5628 "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;
5629 "development" !== 'production' ? warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component') : void 0;
5630 }
5631
5632 // Reduce time spent doing lookups by setting these on the prototype.
5633 for (var methodName in ReactClassInterface) {
5634 if (!Constructor.prototype[methodName]) {
5635 Constructor.prototype[methodName] = null;
5636 }
5637 }
5638
5639 return Constructor;
5640 },
5641
5642 injection: {
5643 injectMixin: function (mixin) {
5644 injectedMixins.push(mixin);
5645 }
5646 }
5647
5648};
5649
5650module.exports = ReactClass;
5651},{"153":153,"171":171,"178":178,"181":181,"182":182,"187":187,"188":188,"35":35,"65":65,"86":86,"89":89,"90":90}],35:[function(_dereq_,module,exports){
5652/**
5653 * Copyright 2013-present, Facebook, Inc.
5654 * All rights reserved.
5655 *
5656 * This source code is licensed under the BSD-style license found in the
5657 * LICENSE file in the root directory of this source tree. An additional grant
5658 * of patent rights can be found in the PATENTS file in the same directory.
5659 *
5660 * @providesModule ReactComponent
5661 */
5662
5663'use strict';
5664
5665var _prodInvariant = _dereq_(153);
5666
5667var ReactNoopUpdateQueue = _dereq_(86);
5668
5669var canDefineProperty = _dereq_(131);
5670var emptyObject = _dereq_(171);
5671var invariant = _dereq_(178);
5672var warning = _dereq_(187);
5673
5674/**
5675 * Base class helpers for the updating state of a component.
5676 */
5677function ReactComponent(props, context, updater) {
5678 this.props = props;
5679 this.context = context;
5680 this.refs = emptyObject;
5681 // We initialize the default updater but the real one gets injected by the
5682 // renderer.
5683 this.updater = updater || ReactNoopUpdateQueue;
5684}
5685
5686ReactComponent.prototype.isReactComponent = {};
5687
5688/**
5689 * Sets a subset of the state. Always use this to mutate
5690 * state. You should treat `this.state` as immutable.
5691 *
5692 * There is no guarantee that `this.state` will be immediately updated, so
5693 * accessing `this.state` after calling this method may return the old value.
5694 *
5695 * There is no guarantee that calls to `setState` will run synchronously,
5696 * as they may eventually be batched together. You can provide an optional
5697 * callback that will be executed when the call to setState is actually
5698 * completed.
5699 *
5700 * When a function is provided to setState, it will be called at some point in
5701 * the future (not synchronously). It will be called with the up to date
5702 * component arguments (state, props, context). These values can be different
5703 * from this.* because your function may be called after receiveProps but before
5704 * shouldComponentUpdate, and this new state, props, and context will not yet be
5705 * assigned to this.
5706 *
5707 * @param {object|function} partialState Next partial state or function to
5708 * produce next partial state to be merged with current state.
5709 * @param {?function} callback Called after state is updated.
5710 * @final
5711 * @protected
5712 */
5713ReactComponent.prototype.setState = function (partialState, callback) {
5714 !(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.') : _prodInvariant('85') : void 0;
5715 this.updater.enqueueSetState(this, partialState);
5716 if (callback) {
5717 this.updater.enqueueCallback(this, callback, 'setState');
5718 }
5719};
5720
5721/**
5722 * Forces an update. This should only be invoked when it is known with
5723 * certainty that we are **not** in a DOM transaction.
5724 *
5725 * You may want to call this when you know that some deeper aspect of the
5726 * component's state has changed but `setState` was not called.
5727 *
5728 * This will not invoke `shouldComponentUpdate`, but it will invoke
5729 * `componentWillUpdate` and `componentDidUpdate`.
5730 *
5731 * @param {?function} callback Called after update is complete.
5732 * @final
5733 * @protected
5734 */
5735ReactComponent.prototype.forceUpdate = function (callback) {
5736 this.updater.enqueueForceUpdate(this);
5737 if (callback) {
5738 this.updater.enqueueCallback(this, callback, 'forceUpdate');
5739 }
5740};
5741
5742/**
5743 * Deprecated APIs. These APIs used to exist on classic React classes but since
5744 * we would like to deprecate them, we're not going to move them over to this
5745 * modern base class. Instead, we define a getter that warns if it's accessed.
5746 */
5747if ("development" !== 'production') {
5748 var deprecatedAPIs = {
5749 isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
5750 replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
5751 };
5752 var defineDeprecationWarning = function (methodName, info) {
5753 if (canDefineProperty) {
5754 Object.defineProperty(ReactComponent.prototype, methodName, {
5755 get: function () {
5756 "development" !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : void 0;
5757 return undefined;
5758 }
5759 });
5760 }
5761 };
5762 for (var fnName in deprecatedAPIs) {
5763 if (deprecatedAPIs.hasOwnProperty(fnName)) {
5764 defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
5765 }
5766 }
5767}
5768
5769module.exports = ReactComponent;
5770},{"131":131,"153":153,"171":171,"178":178,"187":187,"86":86}],36:[function(_dereq_,module,exports){
5771/**
5772 * Copyright 2013-present, Facebook, Inc.
5773 * All rights reserved.
5774 *
5775 * This source code is licensed under the BSD-style license found in the
5776 * LICENSE file in the root directory of this source tree. An additional grant
5777 * of patent rights can be found in the PATENTS file in the same directory.
5778 *
5779 * @providesModule ReactComponentBrowserEnvironment
5780 */
5781
5782'use strict';
5783
5784var DOMChildrenOperations = _dereq_(7);
5785var ReactDOMIDOperations = _dereq_(51);
5786
5787/**
5788 * Abstracts away all functionality of the reconciler that requires knowledge of
5789 * the browser context. TODO: These callers should be refactored to avoid the
5790 * need for this injection.
5791 */
5792var ReactComponentBrowserEnvironment = {
5793
5794 processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
5795
5796 replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup
5797
5798};
5799
5800module.exports = ReactComponentBrowserEnvironment;
5801},{"51":51,"7":7}],37:[function(_dereq_,module,exports){
5802/**
5803 * Copyright 2014-present, Facebook, Inc.
5804 * All rights reserved.
5805 *
5806 * This source code is licensed under the BSD-style license found in the
5807 * LICENSE file in the root directory of this source tree. An additional grant
5808 * of patent rights can be found in the PATENTS file in the same directory.
5809 *
5810 * @providesModule ReactComponentEnvironment
5811 */
5812
5813'use strict';
5814
5815var _prodInvariant = _dereq_(153);
5816
5817var invariant = _dereq_(178);
5818
5819var injected = false;
5820
5821var ReactComponentEnvironment = {
5822
5823 /**
5824 * Optionally injectable hook for swapping out mount images in the middle of
5825 * the tree.
5826 */
5827 replaceNodeWithMarkup: null,
5828
5829 /**
5830 * Optionally injectable hook for processing a queue of child updates. Will
5831 * later move into MultiChildComponents.
5832 */
5833 processChildrenUpdates: null,
5834
5835 injection: {
5836 injectEnvironment: function (environment) {
5837 !!injected ? "development" !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0;
5838 ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
5839 ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
5840 injected = true;
5841 }
5842 }
5843
5844};
5845
5846module.exports = ReactComponentEnvironment;
5847},{"153":153,"178":178}],38:[function(_dereq_,module,exports){
5848/**
5849 * Copyright 2016-present, Facebook, Inc.
5850 * All rights reserved.
5851 *
5852 * This source code is licensed under the BSD-style license found in the
5853 * LICENSE file in the root directory of this source tree. An additional grant
5854 * of patent rights can be found in the PATENTS file in the same directory.
5855 *
5856 * @providesModule ReactComponentTreeHook
5857 */
5858
5859'use strict';
5860
5861var _prodInvariant = _dereq_(153);
5862
5863var ReactCurrentOwner = _dereq_(41);
5864
5865var invariant = _dereq_(178);
5866var warning = _dereq_(187);
5867
5868function isNative(fn) {
5869 // Based on isNative() from Lodash
5870 var funcToString = Function.prototype.toString;
5871 var hasOwnProperty = Object.prototype.hasOwnProperty;
5872 var reIsNative = RegExp('^' + funcToString
5873 // Take an example native function source for comparison
5874 .call(hasOwnProperty)
5875 // Strip regex characters so we can use it for regex
5876 .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
5877 // Remove hasOwnProperty from the template to make it generic
5878 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
5879 try {
5880 var source = funcToString.call(fn);
5881 return reIsNative.test(source);
5882 } catch (err) {
5883 return false;
5884 }
5885}
5886
5887var canUseCollections =
5888// Array.from
5889typeof Array.from === 'function' &&
5890// Map
5891typeof Map === 'function' && isNative(Map) &&
5892// Map.prototype.keys
5893Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
5894// Set
5895typeof Set === 'function' && isNative(Set) &&
5896// Set.prototype.keys
5897Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
5898
5899var itemMap;
5900var rootIDSet;
5901
5902var itemByKey;
5903var rootByKey;
5904
5905if (canUseCollections) {
5906 itemMap = new Map();
5907 rootIDSet = new Set();
5908} else {
5909 itemByKey = {};
5910 rootByKey = {};
5911}
5912
5913var unmountedIDs = [];
5914
5915// Use non-numeric keys to prevent V8 performance issues:
5916// https://github.com/facebook/react/pull/7232
5917function getKeyFromID(id) {
5918 return '.' + id;
5919}
5920function getIDFromKey(key) {
5921 return parseInt(key.substr(1), 10);
5922}
5923
5924function get(id) {
5925 if (canUseCollections) {
5926 return itemMap.get(id);
5927 } else {
5928 var key = getKeyFromID(id);
5929 return itemByKey[key];
5930 }
5931}
5932
5933function remove(id) {
5934 if (canUseCollections) {
5935 itemMap['delete'](id);
5936 } else {
5937 var key = getKeyFromID(id);
5938 delete itemByKey[key];
5939 }
5940}
5941
5942function create(id, element, parentID) {
5943 var item = {
5944 element: element,
5945 parentID: parentID,
5946 text: null,
5947 childIDs: [],
5948 isMounted: false,
5949 updateCount: 0
5950 };
5951
5952 if (canUseCollections) {
5953 itemMap.set(id, item);
5954 } else {
5955 var key = getKeyFromID(id);
5956 itemByKey[key] = item;
5957 }
5958}
5959
5960function addRoot(id) {
5961 if (canUseCollections) {
5962 rootIDSet.add(id);
5963 } else {
5964 var key = getKeyFromID(id);
5965 rootByKey[key] = true;
5966 }
5967}
5968
5969function removeRoot(id) {
5970 if (canUseCollections) {
5971 rootIDSet['delete'](id);
5972 } else {
5973 var key = getKeyFromID(id);
5974 delete rootByKey[key];
5975 }
5976}
5977
5978function getRegisteredIDs() {
5979 if (canUseCollections) {
5980 return Array.from(itemMap.keys());
5981 } else {
5982 return Object.keys(itemByKey).map(getIDFromKey);
5983 }
5984}
5985
5986function getRootIDs() {
5987 if (canUseCollections) {
5988 return Array.from(rootIDSet.keys());
5989 } else {
5990 return Object.keys(rootByKey).map(getIDFromKey);
5991 }
5992}
5993
5994function purgeDeep(id) {
5995 var item = get(id);
5996 if (item) {
5997 var childIDs = item.childIDs;
5998
5999 remove(id);
6000 childIDs.forEach(purgeDeep);
6001 }
6002}
6003
6004function describeComponentFrame(name, source, ownerName) {
6005 return '\n in ' + name + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
6006}
6007
6008function getDisplayName(element) {
6009 if (element == null) {
6010 return '#empty';
6011 } else if (typeof element === 'string' || typeof element === 'number') {
6012 return '#text';
6013 } else if (typeof element.type === 'string') {
6014 return element.type;
6015 } else {
6016 return element.type.displayName || element.type.name || 'Unknown';
6017 }
6018}
6019
6020function describeID(id) {
6021 var name = ReactComponentTreeHook.getDisplayName(id);
6022 var element = ReactComponentTreeHook.getElement(id);
6023 var ownerID = ReactComponentTreeHook.getOwnerID(id);
6024 var ownerName;
6025 if (ownerID) {
6026 ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
6027 }
6028 "development" !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0;
6029 return describeComponentFrame(name, element && element._source, ownerName);
6030}
6031
6032var ReactComponentTreeHook = {
6033 onSetChildren: function (id, nextChildIDs) {
6034 var item = get(id);
6035 item.childIDs = nextChildIDs;
6036
6037 for (var i = 0; i < nextChildIDs.length; i++) {
6038 var nextChildID = nextChildIDs[i];
6039 var nextChild = get(nextChildID);
6040 !nextChild ? "development" !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0;
6041 !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? "development" !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0;
6042 !nextChild.isMounted ? "development" !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0;
6043 if (nextChild.parentID == null) {
6044 nextChild.parentID = id;
6045 // TODO: This shouldn't be necessary but mounting a new root during in
6046 // componentWillMount currently causes not-yet-mounted components to
6047 // be purged from our tree data so their parent ID is missing.
6048 }
6049 !(nextChild.parentID === id) ? "development" !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0;
6050 }
6051 },
6052 onBeforeMountComponent: function (id, element, parentID) {
6053 create(id, element, parentID);
6054 },
6055 onBeforeUpdateComponent: function (id, element) {
6056 var item = get(id);
6057 if (!item || !item.isMounted) {
6058 // We may end up here as a result of setState() in componentWillUnmount().
6059 // In this case, ignore the element.
6060 return;
6061 }
6062 item.element = element;
6063 },
6064 onMountComponent: function (id) {
6065 var item = get(id);
6066 item.isMounted = true;
6067 var isRoot = item.parentID === 0;
6068 if (isRoot) {
6069 addRoot(id);
6070 }
6071 },
6072 onUpdateComponent: function (id) {
6073 var item = get(id);
6074 if (!item || !item.isMounted) {
6075 // We may end up here as a result of setState() in componentWillUnmount().
6076 // In this case, ignore the element.
6077 return;
6078 }
6079 item.updateCount++;
6080 },
6081 onUnmountComponent: function (id) {
6082 var item = get(id);
6083 if (item) {
6084 // We need to check if it exists.
6085 // `item` might not exist if it is inside an error boundary, and a sibling
6086 // error boundary child threw while mounting. Then this instance never
6087 // got a chance to mount, but it still gets an unmounting event during
6088 // the error boundary cleanup.
6089 item.isMounted = false;
6090 var isRoot = item.parentID === 0;
6091 if (isRoot) {
6092 removeRoot(id);
6093 }
6094 }
6095 unmountedIDs.push(id);
6096 },
6097 purgeUnmountedComponents: function () {
6098 if (ReactComponentTreeHook._preventPurging) {
6099 // Should only be used for testing.
6100 return;
6101 }
6102
6103 for (var i = 0; i < unmountedIDs.length; i++) {
6104 var id = unmountedIDs[i];
6105 purgeDeep(id);
6106 }
6107 unmountedIDs.length = 0;
6108 },
6109 isMounted: function (id) {
6110 var item = get(id);
6111 return item ? item.isMounted : false;
6112 },
6113 getCurrentStackAddendum: function (topElement) {
6114 var info = '';
6115 if (topElement) {
6116 var type = topElement.type;
6117 var name = typeof type === 'function' ? type.displayName || type.name : type;
6118 var owner = topElement._owner;
6119 info += describeComponentFrame(name || 'Unknown', topElement._source, owner && owner.getName());
6120 }
6121
6122 var currentOwner = ReactCurrentOwner.current;
6123 var id = currentOwner && currentOwner._debugID;
6124
6125 info += ReactComponentTreeHook.getStackAddendumByID(id);
6126 return info;
6127 },
6128 getStackAddendumByID: function (id) {
6129 var info = '';
6130 while (id) {
6131 info += describeID(id);
6132 id = ReactComponentTreeHook.getParentID(id);
6133 }
6134 return info;
6135 },
6136 getChildIDs: function (id) {
6137 var item = get(id);
6138 return item ? item.childIDs : [];
6139 },
6140 getDisplayName: function (id) {
6141 var element = ReactComponentTreeHook.getElement(id);
6142 if (!element) {
6143 return null;
6144 }
6145 return getDisplayName(element);
6146 },
6147 getElement: function (id) {
6148 var item = get(id);
6149 return item ? item.element : null;
6150 },
6151 getOwnerID: function (id) {
6152 var element = ReactComponentTreeHook.getElement(id);
6153 if (!element || !element._owner) {
6154 return null;
6155 }
6156 return element._owner._debugID;
6157 },
6158 getParentID: function (id) {
6159 var item = get(id);
6160 return item ? item.parentID : null;
6161 },
6162 getSource: function (id) {
6163 var item = get(id);
6164 var element = item ? item.element : null;
6165 var source = element != null ? element._source : null;
6166 return source;
6167 },
6168 getText: function (id) {
6169 var element = ReactComponentTreeHook.getElement(id);
6170 if (typeof element === 'string') {
6171 return element;
6172 } else if (typeof element === 'number') {
6173 return '' + element;
6174 } else {
6175 return null;
6176 }
6177 },
6178 getUpdateCount: function (id) {
6179 var item = get(id);
6180 return item ? item.updateCount : 0;
6181 },
6182
6183
6184 getRegisteredIDs: getRegisteredIDs,
6185
6186 getRootIDs: getRootIDs
6187};
6188
6189module.exports = ReactComponentTreeHook;
6190},{"153":153,"178":178,"187":187,"41":41}],39:[function(_dereq_,module,exports){
6191/**
6192 * Copyright 2013-present, Facebook, Inc.
6193 * All rights reserved.
6194 *
6195 * This source code is licensed under the BSD-style license found in the
6196 * LICENSE file in the root directory of this source tree. An additional grant
6197 * of patent rights can be found in the PATENTS file in the same directory.
6198 *
6199 * @providesModule ReactComponentWithPureRenderMixin
6200 */
6201
6202'use strict';
6203
6204var shallowCompare = _dereq_(157);
6205
6206/**
6207 * If your React component's render function is "pure", e.g. it will render the
6208 * same result given the same props and state, provide this mixin for a
6209 * considerable performance boost.
6210 *
6211 * Most React components have pure render functions.
6212 *
6213 * Example:
6214 *
6215 * var ReactComponentWithPureRenderMixin =
6216 * require('ReactComponentWithPureRenderMixin');
6217 * React.createClass({
6218 * mixins: [ReactComponentWithPureRenderMixin],
6219 *
6220 * render: function() {
6221 * return <div className={this.props.className}>foo</div>;
6222 * }
6223 * });
6224 *
6225 * Note: This only checks shallow equality for props and state. If these contain
6226 * complex data structures this mixin may have false-negatives for deeper
6227 * differences. Only mixin to components which have simple props and state, or
6228 * use `forceUpdate()` when you know deep data structures have changed.
6229 *
6230 * See https://facebook.github.io/react/docs/pure-render-mixin.html
6231 */
6232var ReactComponentWithPureRenderMixin = {
6233 shouldComponentUpdate: function (nextProps, nextState) {
6234 return shallowCompare(this, nextProps, nextState);
6235 }
6236};
6237
6238module.exports = ReactComponentWithPureRenderMixin;
6239},{"157":157}],40:[function(_dereq_,module,exports){
6240/**
6241 * Copyright 2013-present, Facebook, Inc.
6242 * All rights reserved.
6243 *
6244 * This source code is licensed under the BSD-style license found in the
6245 * LICENSE file in the root directory of this source tree. An additional grant
6246 * of patent rights can be found in the PATENTS file in the same directory.
6247 *
6248 * @providesModule ReactCompositeComponent
6249 */
6250
6251'use strict';
6252
6253var _prodInvariant = _dereq_(153),
6254 _assign = _dereq_(188);
6255
6256var ReactComponentEnvironment = _dereq_(37);
6257var ReactCurrentOwner = _dereq_(41);
6258var ReactElement = _dereq_(65);
6259var ReactErrorUtils = _dereq_(68);
6260var ReactInstanceMap = _dereq_(77);
6261var ReactInstrumentation = _dereq_(78);
6262var ReactNodeTypes = _dereq_(85);
6263var ReactPropTypeLocations = _dereq_(90);
6264var ReactReconciler = _dereq_(95);
6265
6266var checkReactTypeSpec = _dereq_(132);
6267var emptyObject = _dereq_(171);
6268var invariant = _dereq_(178);
6269var shallowEqual = _dereq_(186);
6270var shouldUpdateReactComponent = _dereq_(158);
6271var warning = _dereq_(187);
6272
6273var CompositeTypes = {
6274 ImpureClass: 0,
6275 PureClass: 1,
6276 StatelessFunctional: 2
6277};
6278
6279function StatelessComponent(Component) {}
6280StatelessComponent.prototype.render = function () {
6281 var Component = ReactInstanceMap.get(this)._currentElement.type;
6282 var element = Component(this.props, this.context, this.updater);
6283 warnIfInvalidElement(Component, element);
6284 return element;
6285};
6286
6287function warnIfInvalidElement(Component, element) {
6288 if ("development" !== 'production') {
6289 "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;
6290 "development" !== 'production' ? warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component') : void 0;
6291 }
6292}
6293
6294function shouldConstruct(Component) {
6295 return !!(Component.prototype && Component.prototype.isReactComponent);
6296}
6297
6298function isPureComponent(Component) {
6299 return !!(Component.prototype && Component.prototype.isPureReactComponent);
6300}
6301
6302// Separated into a function to contain deoptimizations caused by try/finally.
6303function measureLifeCyclePerf(fn, debugID, timerType) {
6304 if (debugID === 0) {
6305 // Top-level wrappers (see ReactMount) and empty components (see
6306 // ReactDOMEmptyComponent) are invisible to hooks and devtools.
6307 // Both are implementation details that should go away in the future.
6308 return fn();
6309 }
6310
6311 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType);
6312 try {
6313 return fn();
6314 } finally {
6315 ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType);
6316 }
6317}
6318
6319/**
6320 * ------------------ The Life-Cycle of a Composite Component ------------------
6321 *
6322 * - constructor: Initialization of state. The instance is now retained.
6323 * - componentWillMount
6324 * - render
6325 * - [children's constructors]
6326 * - [children's componentWillMount and render]
6327 * - [children's componentDidMount]
6328 * - componentDidMount
6329 *
6330 * Update Phases:
6331 * - componentWillReceiveProps (only called if parent updated)
6332 * - shouldComponentUpdate
6333 * - componentWillUpdate
6334 * - render
6335 * - [children's constructors or receive props phases]
6336 * - componentDidUpdate
6337 *
6338 * - componentWillUnmount
6339 * - [children's componentWillUnmount]
6340 * - [children destroyed]
6341 * - (destroyed): The instance is now blank, released by React and ready for GC.
6342 *
6343 * -----------------------------------------------------------------------------
6344 */
6345
6346/**
6347 * An incrementing ID assigned to each component when it is mounted. This is
6348 * used to enforce the order in which `ReactUpdates` updates dirty components.
6349 *
6350 * @private
6351 */
6352var nextMountID = 1;
6353
6354/**
6355 * @lends {ReactCompositeComponent.prototype}
6356 */
6357var ReactCompositeComponentMixin = {
6358
6359 /**
6360 * Base constructor for all composite component.
6361 *
6362 * @param {ReactElement} element
6363 * @final
6364 * @internal
6365 */
6366 construct: function (element) {
6367 this._currentElement = element;
6368 this._rootNodeID = 0;
6369 this._compositeType = null;
6370 this._instance = null;
6371 this._hostParent = null;
6372 this._hostContainerInfo = null;
6373
6374 // See ReactUpdateQueue
6375 this._updateBatchNumber = null;
6376 this._pendingElement = null;
6377 this._pendingStateQueue = null;
6378 this._pendingReplaceState = false;
6379 this._pendingForceUpdate = false;
6380
6381 this._renderedNodeType = null;
6382 this._renderedComponent = null;
6383 this._context = null;
6384 this._mountOrder = 0;
6385 this._topLevelWrapper = null;
6386
6387 // See ReactUpdates and ReactUpdateQueue.
6388 this._pendingCallbacks = null;
6389
6390 // ComponentWillUnmount shall only be called once
6391 this._calledComponentWillUnmount = false;
6392
6393 if ("development" !== 'production') {
6394 this._warnedAboutRefsInRender = false;
6395 }
6396 },
6397
6398 /**
6399 * Initializes the component, renders markup, and registers event listeners.
6400 *
6401 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
6402 * @param {?object} hostParent
6403 * @param {?object} hostContainerInfo
6404 * @param {?object} context
6405 * @return {?string} Rendered markup to be inserted into the DOM.
6406 * @final
6407 * @internal
6408 */
6409 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
6410 var _this = this;
6411
6412 this._context = context;
6413 this._mountOrder = nextMountID++;
6414 this._hostParent = hostParent;
6415 this._hostContainerInfo = hostContainerInfo;
6416
6417 var publicProps = this._currentElement.props;
6418 var publicContext = this._processContext(context);
6419
6420 var Component = this._currentElement.type;
6421
6422 var updateQueue = transaction.getUpdateQueue();
6423
6424 // Initialize the public class
6425 var doConstruct = shouldConstruct(Component);
6426 var inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue);
6427 var renderedElement;
6428
6429 // Support functional components
6430 if (!doConstruct && (inst == null || inst.render == null)) {
6431 renderedElement = inst;
6432 warnIfInvalidElement(Component, renderedElement);
6433 !(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') : _prodInvariant('105', Component.displayName || Component.name || 'Component') : void 0;
6434 inst = new StatelessComponent(Component);
6435 this._compositeType = CompositeTypes.StatelessFunctional;
6436 } else {
6437 if (isPureComponent(Component)) {
6438 this._compositeType = CompositeTypes.PureClass;
6439 } else {
6440 this._compositeType = CompositeTypes.ImpureClass;
6441 }
6442 }
6443
6444 if ("development" !== 'production') {
6445 // This will throw later in _renderValidatedComponent, but add an early
6446 // warning now to help debugging
6447 if (inst.render == null) {
6448 "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;
6449 }
6450
6451 var propsMutated = inst.props !== publicProps;
6452 var componentName = Component.displayName || Component.name || 'Component';
6453
6454 "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;
6455 }
6456
6457 // These should be set up in the constructor, but as a convenience for
6458 // simpler class abstractions, we set them up after the fact.
6459 inst.props = publicProps;
6460 inst.context = publicContext;
6461 inst.refs = emptyObject;
6462 inst.updater = updateQueue;
6463
6464 this._instance = inst;
6465
6466 // Store a reference from the instance back to the internal representation
6467 ReactInstanceMap.set(inst, this);
6468
6469 if ("development" !== 'production') {
6470 // Since plain JS classes are defined without any special initialization
6471 // logic, we can not catch common errors early. Therefore, we have to
6472 // catch them here, at initialization time, instead.
6473 "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;
6474 "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;
6475 "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;
6476 "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;
6477 "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;
6478 "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;
6479 "development" !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0;
6480 }
6481
6482 var initialState = inst.state;
6483 if (initialState === undefined) {
6484 inst.state = initialState = null;
6485 }
6486 !(typeof initialState === 'object' && !Array.isArray(initialState)) ? "development" !== 'production' ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : _prodInvariant('106', this.getName() || 'ReactCompositeComponent') : void 0;
6487
6488 this._pendingStateQueue = null;
6489 this._pendingReplaceState = false;
6490 this._pendingForceUpdate = false;
6491
6492 var markup;
6493 if (inst.unstable_handleError) {
6494 markup = this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context);
6495 } else {
6496 markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
6497 }
6498
6499 if (inst.componentDidMount) {
6500 if ("development" !== 'production') {
6501 transaction.getReactMountReady().enqueue(function () {
6502 measureLifeCyclePerf(function () {
6503 return inst.componentDidMount();
6504 }, _this._debugID, 'componentDidMount');
6505 });
6506 } else {
6507 transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
6508 }
6509 }
6510
6511 return markup;
6512 },
6513
6514 _constructComponent: function (doConstruct, publicProps, publicContext, updateQueue) {
6515 if ("development" !== 'production') {
6516 ReactCurrentOwner.current = this;
6517 try {
6518 return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
6519 } finally {
6520 ReactCurrentOwner.current = null;
6521 }
6522 } else {
6523 return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
6524 }
6525 },
6526
6527 _constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) {
6528 var Component = this._currentElement.type;
6529
6530 if (doConstruct) {
6531 if ("development" !== 'production') {
6532 return measureLifeCyclePerf(function () {
6533 return new Component(publicProps, publicContext, updateQueue);
6534 }, this._debugID, 'ctor');
6535 } else {
6536 return new Component(publicProps, publicContext, updateQueue);
6537 }
6538 }
6539
6540 // This can still be an instance in case of factory components
6541 // but we'll count this as time spent rendering as the more common case.
6542 if ("development" !== 'production') {
6543 return measureLifeCyclePerf(function () {
6544 return Component(publicProps, publicContext, updateQueue);
6545 }, this._debugID, 'render');
6546 } else {
6547 return Component(publicProps, publicContext, updateQueue);
6548 }
6549 },
6550
6551 performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
6552 var markup;
6553 var checkpoint = transaction.checkpoint();
6554 try {
6555 markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
6556 } catch (e) {
6557 // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint
6558 transaction.rollback(checkpoint);
6559 this._instance.unstable_handleError(e);
6560 if (this._pendingStateQueue) {
6561 this._instance.state = this._processPendingState(this._instance.props, this._instance.context);
6562 }
6563 checkpoint = transaction.checkpoint();
6564
6565 this._renderedComponent.unmountComponent(true);
6566 transaction.rollback(checkpoint);
6567
6568 // Try again - we've informed the component about the error, so they can render an error message this time.
6569 // If this throws again, the error will bubble up (and can be caught by a higher error boundary).
6570 markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
6571 }
6572 return markup;
6573 },
6574
6575 performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
6576 var inst = this._instance;
6577
6578 var debugID = 0;
6579 if ("development" !== 'production') {
6580 debugID = this._debugID;
6581 }
6582
6583 if (inst.componentWillMount) {
6584 if ("development" !== 'production') {
6585 measureLifeCyclePerf(function () {
6586 return inst.componentWillMount();
6587 }, debugID, 'componentWillMount');
6588 } else {
6589 inst.componentWillMount();
6590 }
6591 // When mounting, calls to `setState` by `componentWillMount` will set
6592 // `this._pendingStateQueue` without triggering a re-render.
6593 if (this._pendingStateQueue) {
6594 inst.state = this._processPendingState(inst.props, inst.context);
6595 }
6596 }
6597
6598 // If not a stateless component, we now render
6599 if (renderedElement === undefined) {
6600 renderedElement = this._renderValidatedComponent();
6601 }
6602
6603 var nodeType = ReactNodeTypes.getType(renderedElement);
6604 this._renderedNodeType = nodeType;
6605 var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
6606 );
6607 this._renderedComponent = child;
6608
6609 var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID);
6610
6611 if ("development" !== 'production') {
6612 if (debugID !== 0) {
6613 var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
6614 ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
6615 }
6616 }
6617
6618 return markup;
6619 },
6620
6621 getHostNode: function () {
6622 return ReactReconciler.getHostNode(this._renderedComponent);
6623 },
6624
6625 /**
6626 * Releases any resources allocated by `mountComponent`.
6627 *
6628 * @final
6629 * @internal
6630 */
6631 unmountComponent: function (safely) {
6632 if (!this._renderedComponent) {
6633 return;
6634 }
6635
6636 var inst = this._instance;
6637
6638 if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
6639 inst._calledComponentWillUnmount = true;
6640
6641 if (safely) {
6642 var name = this.getName() + '.componentWillUnmount()';
6643 ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
6644 } else {
6645 if ("development" !== 'production') {
6646 measureLifeCyclePerf(function () {
6647 return inst.componentWillUnmount();
6648 }, this._debugID, 'componentWillUnmount');
6649 } else {
6650 inst.componentWillUnmount();
6651 }
6652 }
6653 }
6654
6655 if (this._renderedComponent) {
6656 ReactReconciler.unmountComponent(this._renderedComponent, safely);
6657 this._renderedNodeType = null;
6658 this._renderedComponent = null;
6659 this._instance = null;
6660 }
6661
6662 // Reset pending fields
6663 // Even if this component is scheduled for another update in ReactUpdates,
6664 // it would still be ignored because these fields are reset.
6665 this._pendingStateQueue = null;
6666 this._pendingReplaceState = false;
6667 this._pendingForceUpdate = false;
6668 this._pendingCallbacks = null;
6669 this._pendingElement = null;
6670
6671 // These fields do not really need to be reset since this object is no
6672 // longer accessible.
6673 this._context = null;
6674 this._rootNodeID = 0;
6675 this._topLevelWrapper = null;
6676
6677 // Delete the reference from the instance to this internal representation
6678 // which allow the internals to be properly cleaned up even if the user
6679 // leaks a reference to the public instance.
6680 ReactInstanceMap.remove(inst);
6681
6682 // Some existing components rely on inst.props even after they've been
6683 // destroyed (in event handlers).
6684 // TODO: inst.props = null;
6685 // TODO: inst.state = null;
6686 // TODO: inst.context = null;
6687 },
6688
6689 /**
6690 * Filters the context object to only contain keys specified in
6691 * `contextTypes`
6692 *
6693 * @param {object} context
6694 * @return {?object}
6695 * @private
6696 */
6697 _maskContext: function (context) {
6698 var Component = this._currentElement.type;
6699 var contextTypes = Component.contextTypes;
6700 if (!contextTypes) {
6701 return emptyObject;
6702 }
6703 var maskedContext = {};
6704 for (var contextName in contextTypes) {
6705 maskedContext[contextName] = context[contextName];
6706 }
6707 return maskedContext;
6708 },
6709
6710 /**
6711 * Filters the context object to only contain keys specified in
6712 * `contextTypes`, and asserts that they are valid.
6713 *
6714 * @param {object} context
6715 * @return {?object}
6716 * @private
6717 */
6718 _processContext: function (context) {
6719 var maskedContext = this._maskContext(context);
6720 if ("development" !== 'production') {
6721 var Component = this._currentElement.type;
6722 if (Component.contextTypes) {
6723 this._checkContextTypes(Component.contextTypes, maskedContext, ReactPropTypeLocations.context);
6724 }
6725 }
6726 return maskedContext;
6727 },
6728
6729 /**
6730 * @param {object} currentContext
6731 * @return {object}
6732 * @private
6733 */
6734 _processChildContext: function (currentContext) {
6735 var Component = this._currentElement.type;
6736 var inst = this._instance;
6737 var childContext;
6738
6739 if (inst.getChildContext) {
6740 if ("development" !== 'production') {
6741 ReactInstrumentation.debugTool.onBeginProcessingChildContext();
6742 try {
6743 childContext = inst.getChildContext();
6744 } finally {
6745 ReactInstrumentation.debugTool.onEndProcessingChildContext();
6746 }
6747 } else {
6748 childContext = inst.getChildContext();
6749 }
6750 }
6751
6752 if (childContext) {
6753 !(typeof Component.childContextTypes === 'object') ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0;
6754 if ("development" !== 'production') {
6755 this._checkContextTypes(Component.childContextTypes, childContext, ReactPropTypeLocations.childContext);
6756 }
6757 for (var name in childContext) {
6758 !(name in Component.childContextTypes) ? "development" !== 'production' ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : _prodInvariant('108', this.getName() || 'ReactCompositeComponent', name) : void 0;
6759 }
6760 return _assign({}, currentContext, childContext);
6761 }
6762 return currentContext;
6763 },
6764
6765 /**
6766 * Assert that the context types are valid
6767 *
6768 * @param {object} typeSpecs Map of context field to a ReactPropType
6769 * @param {object} values Runtime values that need to be type-checked
6770 * @param {string} location e.g. "prop", "context", "child context"
6771 * @private
6772 */
6773 _checkContextTypes: function (typeSpecs, values, location) {
6774 checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID);
6775 },
6776
6777 receiveComponent: function (nextElement, transaction, nextContext) {
6778 var prevElement = this._currentElement;
6779 var prevContext = this._context;
6780
6781 this._pendingElement = null;
6782
6783 this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
6784 },
6785
6786 /**
6787 * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
6788 * is set, update the component.
6789 *
6790 * @param {ReactReconcileTransaction} transaction
6791 * @internal
6792 */
6793 performUpdateIfNecessary: function (transaction) {
6794 if (this._pendingElement != null) {
6795 ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
6796 } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
6797 this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
6798 } else {
6799 this._updateBatchNumber = null;
6800 }
6801 },
6802
6803 /**
6804 * Perform an update to a mounted component. The componentWillReceiveProps and
6805 * shouldComponentUpdate methods are called, then (assuming the update isn't
6806 * skipped) the remaining update lifecycle methods are called and the DOM
6807 * representation is updated.
6808 *
6809 * By default, this implements React's rendering and reconciliation algorithm.
6810 * Sophisticated clients may wish to override this.
6811 *
6812 * @param {ReactReconcileTransaction} transaction
6813 * @param {ReactElement} prevParentElement
6814 * @param {ReactElement} nextParentElement
6815 * @internal
6816 * @overridable
6817 */
6818 updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
6819 var inst = this._instance;
6820 !(inst != null) ? "development" !== 'production' ? invariant(false, 'Attempted to update component `%s` that has already been unmounted (or failed to mount).', this.getName() || 'ReactCompositeComponent') : _prodInvariant('136', this.getName() || 'ReactCompositeComponent') : void 0;
6821
6822 var willReceive = false;
6823 var nextContext;
6824
6825 // Determine if the context has changed or not
6826 if (this._context === nextUnmaskedContext) {
6827 nextContext = inst.context;
6828 } else {
6829 nextContext = this._processContext(nextUnmaskedContext);
6830 willReceive = true;
6831 }
6832
6833 var prevProps = prevParentElement.props;
6834 var nextProps = nextParentElement.props;
6835
6836 // Not a simple state update but a props update
6837 if (prevParentElement !== nextParentElement) {
6838 willReceive = true;
6839 }
6840
6841 // An update here will schedule an update but immediately set
6842 // _pendingStateQueue which will ensure that any state updates gets
6843 // immediately reconciled instead of waiting for the next batch.
6844 if (willReceive && inst.componentWillReceiveProps) {
6845 if ("development" !== 'production') {
6846 measureLifeCyclePerf(function () {
6847 return inst.componentWillReceiveProps(nextProps, nextContext);
6848 }, this._debugID, 'componentWillReceiveProps');
6849 } else {
6850 inst.componentWillReceiveProps(nextProps, nextContext);
6851 }
6852 }
6853
6854 var nextState = this._processPendingState(nextProps, nextContext);
6855 var shouldUpdate = true;
6856
6857 if (!this._pendingForceUpdate) {
6858 if (inst.shouldComponentUpdate) {
6859 if ("development" !== 'production') {
6860 shouldUpdate = measureLifeCyclePerf(function () {
6861 return inst.shouldComponentUpdate(nextProps, nextState, nextContext);
6862 }, this._debugID, 'shouldComponentUpdate');
6863 } else {
6864 shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
6865 }
6866 } else {
6867 if (this._compositeType === CompositeTypes.PureClass) {
6868 shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState);
6869 }
6870 }
6871 }
6872
6873 if ("development" !== 'production') {
6874 "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;
6875 }
6876
6877 this._updateBatchNumber = null;
6878 if (shouldUpdate) {
6879 this._pendingForceUpdate = false;
6880 // Will set `this.props`, `this.state` and `this.context`.
6881 this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
6882 } else {
6883 // If it's determined that a component should not update, we still want
6884 // to set props and state but we shortcut the rest of the update.
6885 this._currentElement = nextParentElement;
6886 this._context = nextUnmaskedContext;
6887 inst.props = nextProps;
6888 inst.state = nextState;
6889 inst.context = nextContext;
6890 }
6891 },
6892
6893 _processPendingState: function (props, context) {
6894 var inst = this._instance;
6895 var queue = this._pendingStateQueue;
6896 var replace = this._pendingReplaceState;
6897 this._pendingReplaceState = false;
6898 this._pendingStateQueue = null;
6899
6900 if (!queue) {
6901 return inst.state;
6902 }
6903
6904 if (replace && queue.length === 1) {
6905 return queue[0];
6906 }
6907
6908 var nextState = _assign({}, replace ? queue[0] : inst.state);
6909 for (var i = replace ? 1 : 0; i < queue.length; i++) {
6910 var partial = queue[i];
6911 _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
6912 }
6913
6914 return nextState;
6915 },
6916
6917 /**
6918 * Merges new props and state, notifies delegate methods of update and
6919 * performs update.
6920 *
6921 * @param {ReactElement} nextElement Next element
6922 * @param {object} nextProps Next public object to set as properties.
6923 * @param {?object} nextState Next object to set as state.
6924 * @param {?object} nextContext Next public object to set as context.
6925 * @param {ReactReconcileTransaction} transaction
6926 * @param {?object} unmaskedContext
6927 * @private
6928 */
6929 _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
6930 var _this2 = this;
6931
6932 var inst = this._instance;
6933
6934 var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
6935 var prevProps;
6936 var prevState;
6937 var prevContext;
6938 if (hasComponentDidUpdate) {
6939 prevProps = inst.props;
6940 prevState = inst.state;
6941 prevContext = inst.context;
6942 }
6943
6944 if (inst.componentWillUpdate) {
6945 if ("development" !== 'production') {
6946 measureLifeCyclePerf(function () {
6947 return inst.componentWillUpdate(nextProps, nextState, nextContext);
6948 }, this._debugID, 'componentWillUpdate');
6949 } else {
6950 inst.componentWillUpdate(nextProps, nextState, nextContext);
6951 }
6952 }
6953
6954 this._currentElement = nextElement;
6955 this._context = unmaskedContext;
6956 inst.props = nextProps;
6957 inst.state = nextState;
6958 inst.context = nextContext;
6959
6960 this._updateRenderedComponent(transaction, unmaskedContext);
6961
6962 if (hasComponentDidUpdate) {
6963 if ("development" !== 'production') {
6964 transaction.getReactMountReady().enqueue(function () {
6965 measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate');
6966 });
6967 } else {
6968 transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
6969 }
6970 }
6971 },
6972
6973 /**
6974 * Call the component's `render` method and update the DOM accordingly.
6975 *
6976 * @param {ReactReconcileTransaction} transaction
6977 * @internal
6978 */
6979 _updateRenderedComponent: function (transaction, context) {
6980 var prevComponentInstance = this._renderedComponent;
6981 var prevRenderedElement = prevComponentInstance._currentElement;
6982 var nextRenderedElement = this._renderValidatedComponent();
6983
6984 var debugID = 0;
6985 if ("development" !== 'production') {
6986 debugID = this._debugID;
6987 }
6988
6989 if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
6990 ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
6991 } else {
6992 var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance);
6993 ReactReconciler.unmountComponent(prevComponentInstance, false);
6994
6995 var nodeType = ReactNodeTypes.getType(nextRenderedElement);
6996 this._renderedNodeType = nodeType;
6997 var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
6998 );
6999 this._renderedComponent = child;
7000
7001 var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID);
7002
7003 if ("development" !== 'production') {
7004 if (debugID !== 0) {
7005 var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
7006 ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
7007 }
7008 }
7009
7010 this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance);
7011 }
7012 },
7013
7014 /**
7015 * Overridden in shallow rendering.
7016 *
7017 * @protected
7018 */
7019 _replaceNodeWithMarkup: function (oldHostNode, nextMarkup, prevInstance) {
7020 ReactComponentEnvironment.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance);
7021 },
7022
7023 /**
7024 * @protected
7025 */
7026 _renderValidatedComponentWithoutOwnerOrContext: function () {
7027 var inst = this._instance;
7028 var renderedComponent;
7029
7030 if ("development" !== 'production') {
7031 renderedComponent = measureLifeCyclePerf(function () {
7032 return inst.render();
7033 }, this._debugID, 'render');
7034 } else {
7035 renderedComponent = inst.render();
7036 }
7037
7038 if ("development" !== 'production') {
7039 // We allow auto-mocks to proceed as if they're returning null.
7040 if (renderedComponent === undefined && inst.render._isMockFunction) {
7041 // This is probably bad practice. Consider warning here and
7042 // deprecating this convenience.
7043 renderedComponent = null;
7044 }
7045 }
7046
7047 return renderedComponent;
7048 },
7049
7050 /**
7051 * @private
7052 */
7053 _renderValidatedComponent: function () {
7054 var renderedComponent;
7055 if ("development" !== 'production' || this._compositeType !== CompositeTypes.StatelessFunctional) {
7056 ReactCurrentOwner.current = this;
7057 try {
7058 renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
7059 } finally {
7060 ReactCurrentOwner.current = null;
7061 }
7062 } else {
7063 renderedComponent = this._renderValidatedComponentWithoutOwnerOrContext();
7064 }
7065 !(
7066 // TODO: An `isValidNode` function would probably be more appropriate
7067 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') : _prodInvariant('109', this.getName() || 'ReactCompositeComponent') : void 0;
7068
7069 return renderedComponent;
7070 },
7071
7072 /**
7073 * Lazily allocates the refs object and stores `component` as `ref`.
7074 *
7075 * @param {string} ref Reference name.
7076 * @param {component} component Component to store as `ref`.
7077 * @final
7078 * @private
7079 */
7080 attachRef: function (ref, component) {
7081 var inst = this.getPublicInstance();
7082 !(inst != null) ? "development" !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0;
7083 var publicComponentInstance = component.getPublicInstance();
7084 if ("development" !== 'production') {
7085 var componentName = component && component.getName ? component.getName() : 'a component';
7086 "development" !== 'production' ? warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, '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;
7087 }
7088 var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
7089 refs[ref] = publicComponentInstance;
7090 },
7091
7092 /**
7093 * Detaches a reference name.
7094 *
7095 * @param {string} ref Name to dereference.
7096 * @final
7097 * @private
7098 */
7099 detachRef: function (ref) {
7100 var refs = this.getPublicInstance().refs;
7101 delete refs[ref];
7102 },
7103
7104 /**
7105 * Get a text description of the component that can be used to identify it
7106 * in error messages.
7107 * @return {string} The name or null.
7108 * @internal
7109 */
7110 getName: function () {
7111 var type = this._currentElement.type;
7112 var constructor = this._instance && this._instance.constructor;
7113 return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
7114 },
7115
7116 /**
7117 * Get the publicly accessible representation of this component - i.e. what
7118 * is exposed by refs and returned by render. Can be null for stateless
7119 * components.
7120 *
7121 * @return {ReactComponent} the public component instance.
7122 * @internal
7123 */
7124 getPublicInstance: function () {
7125 var inst = this._instance;
7126 if (this._compositeType === CompositeTypes.StatelessFunctional) {
7127 return null;
7128 }
7129 return inst;
7130 },
7131
7132 // Stub
7133 _instantiateReactComponent: null
7134
7135};
7136
7137var ReactCompositeComponent = {
7138
7139 Mixin: ReactCompositeComponentMixin
7140
7141};
7142
7143module.exports = ReactCompositeComponent;
7144},{"132":132,"153":153,"158":158,"171":171,"178":178,"186":186,"187":187,"188":188,"37":37,"41":41,"65":65,"68":68,"77":77,"78":78,"85":85,"90":90,"95":95}],41:[function(_dereq_,module,exports){
7145/**
7146 * Copyright 2013-present, Facebook, Inc.
7147 * All rights reserved.
7148 *
7149 * This source code is licensed under the BSD-style license found in the
7150 * LICENSE file in the root directory of this source tree. An additional grant
7151 * of patent rights can be found in the PATENTS file in the same directory.
7152 *
7153 * @providesModule ReactCurrentOwner
7154 */
7155
7156'use strict';
7157
7158/**
7159 * Keeps track of the current owner.
7160 *
7161 * The current owner is the component who should own any components that are
7162 * currently being constructed.
7163 */
7164
7165var ReactCurrentOwner = {
7166
7167 /**
7168 * @internal
7169 * @type {ReactComponent}
7170 */
7171 current: null
7172
7173};
7174
7175module.exports = ReactCurrentOwner;
7176},{}],42:[function(_dereq_,module,exports){
7177/**
7178 * Copyright 2013-present, Facebook, Inc.
7179 * All rights reserved.
7180 *
7181 * This source code is licensed under the BSD-style license found in the
7182 * LICENSE file in the root directory of this source tree. An additional grant
7183 * of patent rights can be found in the PATENTS file in the same directory.
7184 *
7185 * @providesModule ReactDOM
7186 */
7187
7188/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/
7189
7190'use strict';
7191
7192var ReactDOMComponentTree = _dereq_(46);
7193var ReactDefaultInjection = _dereq_(64);
7194var ReactMount = _dereq_(82);
7195var ReactReconciler = _dereq_(95);
7196var ReactUpdates = _dereq_(107);
7197var ReactVersion = _dereq_(108);
7198
7199var findDOMNode = _dereq_(136);
7200var getHostComponentFromComposite = _dereq_(143);
7201var renderSubtreeIntoContainer = _dereq_(154);
7202var warning = _dereq_(187);
7203
7204ReactDefaultInjection.inject();
7205
7206var ReactDOM = {
7207 findDOMNode: findDOMNode,
7208 render: ReactMount.render,
7209 unmountComponentAtNode: ReactMount.unmountComponentAtNode,
7210 version: ReactVersion,
7211
7212 /* eslint-disable camelcase */
7213 unstable_batchedUpdates: ReactUpdates.batchedUpdates,
7214 unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer
7215};
7216
7217// Inject the runtime into a devtools global hook regardless of browser.
7218// Allows for debugging when the hook is injected on the page.
7219/* eslint-enable camelcase */
7220if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') {
7221 __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
7222 ComponentTree: {
7223 getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode,
7224 getNodeFromInstance: function (inst) {
7225 // inst is an internal instance (but could be a composite)
7226 if (inst._renderedComponent) {
7227 inst = getHostComponentFromComposite(inst);
7228 }
7229 if (inst) {
7230 return ReactDOMComponentTree.getNodeFromInstance(inst);
7231 } else {
7232 return null;
7233 }
7234 }
7235 },
7236 Mount: ReactMount,
7237 Reconciler: ReactReconciler
7238 });
7239}
7240
7241if ("development" !== 'production') {
7242 var ExecutionEnvironment = _dereq_(164);
7243 if (ExecutionEnvironment.canUseDOM && window.top === window.self) {
7244
7245 // First check if devtools is not installed
7246 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
7247 // If we're in Chrome or Firefox, provide a download link if not installed.
7248 if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
7249 // Firefox does not have the issue with devtools loaded over file://
7250 var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1;
7251 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');
7252 }
7253 }
7254
7255 var testFunc = function testFn() {};
7256 "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;
7257
7258 // If we're in IE8, check to see if we are in compatibility mode and provide
7259 // information on preventing compatibility mode
7260 var ieCompatibilityMode = document.documentMode && document.documentMode < 8;
7261
7262 "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;
7263
7264 var expectedFeatures = [
7265 // shims
7266 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];
7267
7268 for (var i = 0; i < expectedFeatures.length; i++) {
7269 if (!expectedFeatures[i]) {
7270 "development" !== 'production' ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0;
7271 break;
7272 }
7273 }
7274 }
7275}
7276
7277if ("development" !== 'production') {
7278 var ReactInstrumentation = _dereq_(78);
7279 var ReactDOMUnknownPropertyHook = _dereq_(61);
7280 var ReactDOMNullInputValuePropHook = _dereq_(53);
7281
7282 ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook);
7283 ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook);
7284}
7285
7286module.exports = ReactDOM;
7287},{"107":107,"108":108,"136":136,"143":143,"154":154,"164":164,"187":187,"46":46,"53":53,"61":61,"64":64,"78":78,"82":82,"95":95}],43:[function(_dereq_,module,exports){
7288/**
7289 * Copyright 2013-present, Facebook, Inc.
7290 * All rights reserved.
7291 *
7292 * This source code is licensed under the BSD-style license found in the
7293 * LICENSE file in the root directory of this source tree. An additional grant
7294 * of patent rights can be found in the PATENTS file in the same directory.
7295 *
7296 * @providesModule ReactDOMButton
7297 */
7298
7299'use strict';
7300
7301var DisabledInputUtils = _dereq_(14);
7302
7303/**
7304 * Implements a <button> host component that does not receive mouse events
7305 * when `disabled` is set.
7306 */
7307var ReactDOMButton = {
7308 getHostProps: DisabledInputUtils.getHostProps
7309};
7310
7311module.exports = ReactDOMButton;
7312},{"14":14}],44:[function(_dereq_,module,exports){
7313/**
7314 * Copyright 2013-present, Facebook, Inc.
7315 * All rights reserved.
7316 *
7317 * This source code is licensed under the BSD-style license found in the
7318 * LICENSE file in the root directory of this source tree. An additional grant
7319 * of patent rights can be found in the PATENTS file in the same directory.
7320 *
7321 * @providesModule ReactDOMComponent
7322 */
7323
7324/* global hasOwnProperty:true */
7325
7326'use strict';
7327
7328var _prodInvariant = _dereq_(153),
7329 _assign = _dereq_(188);
7330
7331var AutoFocusUtils = _dereq_(1);
7332var CSSPropertyOperations = _dereq_(4);
7333var DOMLazyTree = _dereq_(8);
7334var DOMNamespaces = _dereq_(9);
7335var DOMProperty = _dereq_(10);
7336var DOMPropertyOperations = _dereq_(11);
7337var EventConstants = _dereq_(16);
7338var EventPluginHub = _dereq_(17);
7339var EventPluginRegistry = _dereq_(18);
7340var ReactBrowserEventEmitter = _dereq_(28);
7341var ReactDOMButton = _dereq_(43);
7342var ReactDOMComponentFlags = _dereq_(45);
7343var ReactDOMComponentTree = _dereq_(46);
7344var ReactDOMInput = _dereq_(52);
7345var ReactDOMOption = _dereq_(54);
7346var ReactDOMSelect = _dereq_(55);
7347var ReactDOMTextarea = _dereq_(59);
7348var ReactInstrumentation = _dereq_(78);
7349var ReactMultiChild = _dereq_(83);
7350var ReactServerRenderingTransaction = _dereq_(99);
7351
7352var emptyFunction = _dereq_(170);
7353var escapeTextContentForBrowser = _dereq_(135);
7354var invariant = _dereq_(178);
7355var isEventSupported = _dereq_(149);
7356var keyOf = _dereq_(182);
7357var shallowEqual = _dereq_(186);
7358var validateDOMNesting = _dereq_(161);
7359var warning = _dereq_(187);
7360
7361var Flags = ReactDOMComponentFlags;
7362var deleteListener = EventPluginHub.deleteListener;
7363var getNode = ReactDOMComponentTree.getNodeFromInstance;
7364var listenTo = ReactBrowserEventEmitter.listenTo;
7365var registrationNameModules = EventPluginRegistry.registrationNameModules;
7366
7367// For quickly matching children type, to test if can be treated as content.
7368var CONTENT_TYPES = { 'string': true, 'number': true };
7369
7370var STYLE = keyOf({ style: null });
7371var HTML = keyOf({ __html: null });
7372var RESERVED_PROPS = {
7373 children: null,
7374 dangerouslySetInnerHTML: null,
7375 suppressContentEditableWarning: null
7376};
7377
7378// Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
7379var DOC_FRAGMENT_TYPE = 11;
7380
7381function getDeclarationErrorAddendum(internalInstance) {
7382 if (internalInstance) {
7383 var owner = internalInstance._currentElement._owner || null;
7384 if (owner) {
7385 var name = owner.getName();
7386 if (name) {
7387 return ' This DOM node was rendered by `' + name + '`.';
7388 }
7389 }
7390 }
7391 return '';
7392}
7393
7394function friendlyStringify(obj) {
7395 if (typeof obj === 'object') {
7396 if (Array.isArray(obj)) {
7397 return '[' + obj.map(friendlyStringify).join(', ') + ']';
7398 } else {
7399 var pairs = [];
7400 for (var key in obj) {
7401 if (Object.prototype.hasOwnProperty.call(obj, key)) {
7402 var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
7403 pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
7404 }
7405 }
7406 return '{' + pairs.join(', ') + '}';
7407 }
7408 } else if (typeof obj === 'string') {
7409 return JSON.stringify(obj);
7410 } else if (typeof obj === 'function') {
7411 return '[function object]';
7412 }
7413 // Differs from JSON.stringify in that undefined because undefined and that
7414 // inf and nan don't become null
7415 return String(obj);
7416}
7417
7418var styleMutationWarning = {};
7419
7420function checkAndWarnForMutatedStyle(style1, style2, component) {
7421 if (style1 == null || style2 == null) {
7422 return;
7423 }
7424 if (shallowEqual(style1, style2)) {
7425 return;
7426 }
7427
7428 var componentName = component._tag;
7429 var owner = component._currentElement._owner;
7430 var ownerName;
7431 if (owner) {
7432 ownerName = owner.getName();
7433 }
7434
7435 var hash = ownerName + '|' + componentName;
7436
7437 if (styleMutationWarning.hasOwnProperty(hash)) {
7438 return;
7439 }
7440
7441 styleMutationWarning[hash] = true;
7442
7443 "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;
7444}
7445
7446/**
7447 * @param {object} component
7448 * @param {?object} props
7449 */
7450function assertValidProps(component, props) {
7451 if (!props) {
7452 return;
7453 }
7454 // Note the use of `==` which checks for null or undefined.
7455 if (voidElementTags[component._tag]) {
7456 !(props.children == null && props.dangerouslySetInnerHTML == null) ? "development" !== 'production' ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : _prodInvariant('137', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : void 0;
7457 }
7458 if (props.dangerouslySetInnerHTML != null) {
7459 !(props.children == null) ? "development" !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0;
7460 !(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.') : _prodInvariant('61') : void 0;
7461 }
7462 if ("development" !== 'production') {
7463 "development" !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
7464 "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;
7465 "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;
7466 }
7467 !(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)) : _prodInvariant('62', getDeclarationErrorAddendum(component)) : void 0;
7468}
7469
7470function enqueuePutListener(inst, registrationName, listener, transaction) {
7471 if (transaction instanceof ReactServerRenderingTransaction) {
7472 return;
7473 }
7474 if ("development" !== 'production') {
7475 // IE8 has no API for event capturing and the `onScroll` event doesn't
7476 // bubble.
7477 "development" !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), 'This browser doesn\'t support the `onScroll` event') : void 0;
7478 }
7479 var containerInfo = inst._hostContainerInfo;
7480 var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
7481 var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
7482 listenTo(registrationName, doc);
7483 transaction.getReactMountReady().enqueue(putListener, {
7484 inst: inst,
7485 registrationName: registrationName,
7486 listener: listener
7487 });
7488}
7489
7490function putListener() {
7491 var listenerToPut = this;
7492 EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
7493}
7494
7495function inputPostMount() {
7496 var inst = this;
7497 ReactDOMInput.postMountWrapper(inst);
7498}
7499
7500function textareaPostMount() {
7501 var inst = this;
7502 ReactDOMTextarea.postMountWrapper(inst);
7503}
7504
7505function optionPostMount() {
7506 var inst = this;
7507 ReactDOMOption.postMountWrapper(inst);
7508}
7509
7510var setAndValidateContentChildDev = emptyFunction;
7511if ("development" !== 'production') {
7512 setAndValidateContentChildDev = function (content) {
7513 var hasExistingContent = this._contentDebugID != null;
7514 var debugID = this._debugID;
7515 // This ID represents the inlined child that has no backing instance:
7516 var contentDebugID = -debugID;
7517
7518 if (content == null) {
7519 if (hasExistingContent) {
7520 ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
7521 }
7522 this._contentDebugID = null;
7523 return;
7524 }
7525
7526 validateDOMNesting(null, String(content), this, this._ancestorInfo);
7527 this._contentDebugID = contentDebugID;
7528 if (hasExistingContent) {
7529 ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content);
7530 ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID);
7531 } else {
7532 ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID);
7533 ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
7534 ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
7535 }
7536 };
7537}
7538
7539// There are so many media events, it makes sense to just
7540// maintain a list rather than create a `trapBubbledEvent` for each
7541var mediaEvents = {
7542 topAbort: 'abort',
7543 topCanPlay: 'canplay',
7544 topCanPlayThrough: 'canplaythrough',
7545 topDurationChange: 'durationchange',
7546 topEmptied: 'emptied',
7547 topEncrypted: 'encrypted',
7548 topEnded: 'ended',
7549 topError: 'error',
7550 topLoadedData: 'loadeddata',
7551 topLoadedMetadata: 'loadedmetadata',
7552 topLoadStart: 'loadstart',
7553 topPause: 'pause',
7554 topPlay: 'play',
7555 topPlaying: 'playing',
7556 topProgress: 'progress',
7557 topRateChange: 'ratechange',
7558 topSeeked: 'seeked',
7559 topSeeking: 'seeking',
7560 topStalled: 'stalled',
7561 topSuspend: 'suspend',
7562 topTimeUpdate: 'timeupdate',
7563 topVolumeChange: 'volumechange',
7564 topWaiting: 'waiting'
7565};
7566
7567function trapBubbledEventsLocal() {
7568 var inst = this;
7569 // If a component renders to null or if another component fatals and causes
7570 // the state of the tree to be corrupted, `node` here can be null.
7571 !inst._rootNodeID ? "development" !== 'production' ? invariant(false, 'Must be mounted to trap events') : _prodInvariant('63') : void 0;
7572 var node = getNode(inst);
7573 !node ? "development" !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : _prodInvariant('64') : void 0;
7574
7575 switch (inst._tag) {
7576 case 'iframe':
7577 case 'object':
7578 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
7579 break;
7580 case 'video':
7581 case 'audio':
7582
7583 inst._wrapperState.listeners = [];
7584 // Create listener for each media event
7585 for (var event in mediaEvents) {
7586 if (mediaEvents.hasOwnProperty(event)) {
7587 inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes[event], mediaEvents[event], node));
7588 }
7589 }
7590 break;
7591 case 'source':
7592 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node)];
7593 break;
7594 case 'img':
7595 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topError, 'error', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topLoad, 'load', node)];
7596 break;
7597 case 'form':
7598 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topReset, 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topSubmit, 'submit', node)];
7599 break;
7600 case 'input':
7601 case 'select':
7602 case 'textarea':
7603 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent(EventConstants.topLevelTypes.topInvalid, 'invalid', node)];
7604 break;
7605 }
7606}
7607
7608function postUpdateSelectWrapper() {
7609 ReactDOMSelect.postUpdateWrapper(this);
7610}
7611
7612// For HTML, certain tags should omit their close tag. We keep a whitelist for
7613// those special-case tags.
7614
7615var omittedCloseTags = {
7616 'area': true,
7617 'base': true,
7618 'br': true,
7619 'col': true,
7620 'embed': true,
7621 'hr': true,
7622 'img': true,
7623 'input': true,
7624 'keygen': true,
7625 'link': true,
7626 'meta': true,
7627 'param': true,
7628 'source': true,
7629 'track': true,
7630 'wbr': true
7631};
7632
7633// NOTE: menuitem's close tag should be omitted, but that causes problems.
7634var newlineEatingTags = {
7635 'listing': true,
7636 'pre': true,
7637 'textarea': true
7638};
7639
7640// For HTML, certain tags cannot have children. This has the same purpose as
7641// `omittedCloseTags` except that `menuitem` should still have its closing tag.
7642
7643var voidElementTags = _assign({
7644 'menuitem': true
7645}, omittedCloseTags);
7646
7647// We accept any tag to be rendered but since this gets injected into arbitrary
7648// HTML, we want to make sure that it's a safe tag.
7649// http://www.w3.org/TR/REC-xml/#NT-Name
7650
7651var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
7652var validatedTagCache = {};
7653var hasOwnProperty = {}.hasOwnProperty;
7654
7655function validateDangerousTag(tag) {
7656 if (!hasOwnProperty.call(validatedTagCache, tag)) {
7657 !VALID_TAG_REGEX.test(tag) ? "development" !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : _prodInvariant('65', tag) : void 0;
7658 validatedTagCache[tag] = true;
7659 }
7660}
7661
7662function isCustomComponent(tagName, props) {
7663 return tagName.indexOf('-') >= 0 || props.is != null;
7664}
7665
7666var globalIdCounter = 1;
7667
7668/**
7669 * Creates a new React class that is idempotent and capable of containing other
7670 * React components. It accepts event listeners and DOM properties that are
7671 * valid according to `DOMProperty`.
7672 *
7673 * - Event listeners: `onClick`, `onMouseDown`, etc.
7674 * - DOM properties: `className`, `name`, `title`, etc.
7675 *
7676 * The `style` property functions differently from the DOM API. It accepts an
7677 * object mapping of style properties to values.
7678 *
7679 * @constructor ReactDOMComponent
7680 * @extends ReactMultiChild
7681 */
7682function ReactDOMComponent(element) {
7683 var tag = element.type;
7684 validateDangerousTag(tag);
7685 this._currentElement = element;
7686 this._tag = tag.toLowerCase();
7687 this._namespaceURI = null;
7688 this._renderedChildren = null;
7689 this._previousStyle = null;
7690 this._previousStyleCopy = null;
7691 this._hostNode = null;
7692 this._hostParent = null;
7693 this._rootNodeID = 0;
7694 this._domID = 0;
7695 this._hostContainerInfo = null;
7696 this._wrapperState = null;
7697 this._topLevelWrapper = null;
7698 this._flags = 0;
7699 if ("development" !== 'production') {
7700 this._ancestorInfo = null;
7701 setAndValidateContentChildDev.call(this, null);
7702 }
7703}
7704
7705ReactDOMComponent.displayName = 'ReactDOMComponent';
7706
7707ReactDOMComponent.Mixin = {
7708
7709 /**
7710 * Generates root tag markup then recurses. This method has side effects and
7711 * is not idempotent.
7712 *
7713 * @internal
7714 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7715 * @param {?ReactDOMComponent} the parent component instance
7716 * @param {?object} info about the host container
7717 * @param {object} context
7718 * @return {string} The computed markup.
7719 */
7720 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
7721 this._rootNodeID = globalIdCounter++;
7722 this._domID = hostContainerInfo._idCounter++;
7723 this._hostParent = hostParent;
7724 this._hostContainerInfo = hostContainerInfo;
7725
7726 var props = this._currentElement.props;
7727
7728 switch (this._tag) {
7729 case 'audio':
7730 case 'form':
7731 case 'iframe':
7732 case 'img':
7733 case 'link':
7734 case 'object':
7735 case 'source':
7736 case 'video':
7737 this._wrapperState = {
7738 listeners: null
7739 };
7740 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7741 break;
7742 case 'button':
7743 props = ReactDOMButton.getHostProps(this, props, hostParent);
7744 break;
7745 case 'input':
7746 ReactDOMInput.mountWrapper(this, props, hostParent);
7747 props = ReactDOMInput.getHostProps(this, props);
7748 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7749 break;
7750 case 'option':
7751 ReactDOMOption.mountWrapper(this, props, hostParent);
7752 props = ReactDOMOption.getHostProps(this, props);
7753 break;
7754 case 'select':
7755 ReactDOMSelect.mountWrapper(this, props, hostParent);
7756 props = ReactDOMSelect.getHostProps(this, props);
7757 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7758 break;
7759 case 'textarea':
7760 ReactDOMTextarea.mountWrapper(this, props, hostParent);
7761 props = ReactDOMTextarea.getHostProps(this, props);
7762 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
7763 break;
7764 }
7765
7766 assertValidProps(this, props);
7767
7768 // We create tags in the namespace of their parent container, except HTML
7769 // tags get no namespace.
7770 var namespaceURI;
7771 var parentTag;
7772 if (hostParent != null) {
7773 namespaceURI = hostParent._namespaceURI;
7774 parentTag = hostParent._tag;
7775 } else if (hostContainerInfo._tag) {
7776 namespaceURI = hostContainerInfo._namespaceURI;
7777 parentTag = hostContainerInfo._tag;
7778 }
7779 if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
7780 namespaceURI = DOMNamespaces.html;
7781 }
7782 if (namespaceURI === DOMNamespaces.html) {
7783 if (this._tag === 'svg') {
7784 namespaceURI = DOMNamespaces.svg;
7785 } else if (this._tag === 'math') {
7786 namespaceURI = DOMNamespaces.mathml;
7787 }
7788 }
7789 this._namespaceURI = namespaceURI;
7790
7791 if ("development" !== 'production') {
7792 var parentInfo;
7793 if (hostParent != null) {
7794 parentInfo = hostParent._ancestorInfo;
7795 } else if (hostContainerInfo._tag) {
7796 parentInfo = hostContainerInfo._ancestorInfo;
7797 }
7798 if (parentInfo) {
7799 // parentInfo should always be present except for the top-level
7800 // component when server rendering
7801 validateDOMNesting(this._tag, null, this, parentInfo);
7802 }
7803 this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
7804 }
7805
7806 var mountImage;
7807 if (transaction.useCreateElement) {
7808 var ownerDocument = hostContainerInfo._ownerDocument;
7809 var el;
7810 if (namespaceURI === DOMNamespaces.html) {
7811 if (this._tag === 'script') {
7812 // Create the script via .innerHTML so its "parser-inserted" flag is
7813 // set to true and it does not execute
7814 var div = ownerDocument.createElement('div');
7815 var type = this._currentElement.type;
7816 div.innerHTML = '<' + type + '></' + type + '>';
7817 el = div.removeChild(div.firstChild);
7818 } else if (props.is) {
7819 el = ownerDocument.createElement(this._currentElement.type, props.is);
7820 } else {
7821 // Separate else branch instead of using `props.is || undefined` above becuase of a Firefox bug.
7822 // See discussion in https://github.com/facebook/react/pull/6896
7823 // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
7824 el = ownerDocument.createElement(this._currentElement.type);
7825 }
7826 } else {
7827 el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
7828 }
7829 ReactDOMComponentTree.precacheNode(this, el);
7830 this._flags |= Flags.hasCachedChildNodes;
7831 if (!this._hostParent) {
7832 DOMPropertyOperations.setAttributeForRoot(el);
7833 }
7834 this._updateDOMProperties(null, props, transaction);
7835 var lazyTree = DOMLazyTree(el);
7836 this._createInitialChildren(transaction, props, context, lazyTree);
7837 mountImage = lazyTree;
7838 } else {
7839 var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
7840 var tagContent = this._createContentMarkup(transaction, props, context);
7841 if (!tagContent && omittedCloseTags[this._tag]) {
7842 mountImage = tagOpen + '/>';
7843 } else {
7844 mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
7845 }
7846 }
7847
7848 switch (this._tag) {
7849 case 'input':
7850 transaction.getReactMountReady().enqueue(inputPostMount, this);
7851 if (props.autoFocus) {
7852 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
7853 }
7854 break;
7855 case 'textarea':
7856 transaction.getReactMountReady().enqueue(textareaPostMount, this);
7857 if (props.autoFocus) {
7858 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
7859 }
7860 break;
7861 case 'select':
7862 if (props.autoFocus) {
7863 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
7864 }
7865 break;
7866 case 'button':
7867 if (props.autoFocus) {
7868 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
7869 }
7870 break;
7871 case 'option':
7872 transaction.getReactMountReady().enqueue(optionPostMount, this);
7873 break;
7874 }
7875
7876 return mountImage;
7877 },
7878
7879 /**
7880 * Creates markup for the open tag and all attributes.
7881 *
7882 * This method has side effects because events get registered.
7883 *
7884 * Iterating over object properties is faster than iterating over arrays.
7885 * @see http://jsperf.com/obj-vs-arr-iteration
7886 *
7887 * @private
7888 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7889 * @param {object} props
7890 * @return {string} Markup of opening tag.
7891 */
7892 _createOpenTagMarkupAndPutListeners: function (transaction, props) {
7893 var ret = '<' + this._currentElement.type;
7894
7895 for (var propKey in props) {
7896 if (!props.hasOwnProperty(propKey)) {
7897 continue;
7898 }
7899 var propValue = props[propKey];
7900 if (propValue == null) {
7901 continue;
7902 }
7903 if (registrationNameModules.hasOwnProperty(propKey)) {
7904 if (propValue) {
7905 enqueuePutListener(this, propKey, propValue, transaction);
7906 }
7907 } else {
7908 if (propKey === STYLE) {
7909 if (propValue) {
7910 if ("development" !== 'production') {
7911 // See `_updateDOMProperties`. style block
7912 this._previousStyle = propValue;
7913 }
7914 propValue = this._previousStyleCopy = _assign({}, props.style);
7915 }
7916 propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
7917 }
7918 var markup = null;
7919 if (this._tag != null && isCustomComponent(this._tag, props)) {
7920 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
7921 markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
7922 }
7923 } else {
7924 markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
7925 }
7926 if (markup) {
7927 ret += ' ' + markup;
7928 }
7929 }
7930 }
7931
7932 // For static pages, no need to put React ID and checksum. Saves lots of
7933 // bytes.
7934 if (transaction.renderToStaticMarkup) {
7935 return ret;
7936 }
7937
7938 if (!this._hostParent) {
7939 ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
7940 }
7941 ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
7942 return ret;
7943 },
7944
7945 /**
7946 * Creates markup for the content between the tags.
7947 *
7948 * @private
7949 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7950 * @param {object} props
7951 * @param {object} context
7952 * @return {string} Content markup.
7953 */
7954 _createContentMarkup: function (transaction, props, context) {
7955 var ret = '';
7956
7957 // Intentional use of != to avoid catching zero/false.
7958 var innerHTML = props.dangerouslySetInnerHTML;
7959 if (innerHTML != null) {
7960 if (innerHTML.__html != null) {
7961 ret = innerHTML.__html;
7962 }
7963 } else {
7964 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
7965 var childrenToUse = contentToUse != null ? null : props.children;
7966 if (contentToUse != null) {
7967 // TODO: Validate that text is allowed as a child of this node
7968 ret = escapeTextContentForBrowser(contentToUse);
7969 if ("development" !== 'production') {
7970 setAndValidateContentChildDev.call(this, contentToUse);
7971 }
7972 } else if (childrenToUse != null) {
7973 var mountImages = this.mountChildren(childrenToUse, transaction, context);
7974 ret = mountImages.join('');
7975 }
7976 }
7977 if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
7978 // text/html ignores the first character in these tags if it's a newline
7979 // Prefer to break application/xml over text/html (for now) by adding
7980 // a newline specifically to get eaten by the parser. (Alternately for
7981 // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
7982 // \r is normalized out by HTMLTextAreaElement#value.)
7983 // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
7984 // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
7985 // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
7986 // See: Parsing of "textarea" "listing" and "pre" elements
7987 // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
7988 return '\n' + ret;
7989 } else {
7990 return ret;
7991 }
7992 },
7993
7994 _createInitialChildren: function (transaction, props, context, lazyTree) {
7995 // Intentional use of != to avoid catching zero/false.
7996 var innerHTML = props.dangerouslySetInnerHTML;
7997 if (innerHTML != null) {
7998 if (innerHTML.__html != null) {
7999 DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
8000 }
8001 } else {
8002 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
8003 var childrenToUse = contentToUse != null ? null : props.children;
8004 if (contentToUse != null) {
8005 // TODO: Validate that text is allowed as a child of this node
8006 if ("development" !== 'production') {
8007 setAndValidateContentChildDev.call(this, contentToUse);
8008 }
8009 DOMLazyTree.queueText(lazyTree, contentToUse);
8010 } else if (childrenToUse != null) {
8011 var mountImages = this.mountChildren(childrenToUse, transaction, context);
8012 for (var i = 0; i < mountImages.length; i++) {
8013 DOMLazyTree.queueChild(lazyTree, mountImages[i]);
8014 }
8015 }
8016 }
8017 },
8018
8019 /**
8020 * Receives a next element and updates the component.
8021 *
8022 * @internal
8023 * @param {ReactElement} nextElement
8024 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
8025 * @param {object} context
8026 */
8027 receiveComponent: function (nextElement, transaction, context) {
8028 var prevElement = this._currentElement;
8029 this._currentElement = nextElement;
8030 this.updateComponent(transaction, prevElement, nextElement, context);
8031 },
8032
8033 /**
8034 * Updates a DOM component after it has already been allocated and
8035 * attached to the DOM. Reconciles the root DOM node, then recurses.
8036 *
8037 * @param {ReactReconcileTransaction} transaction
8038 * @param {ReactElement} prevElement
8039 * @param {ReactElement} nextElement
8040 * @internal
8041 * @overridable
8042 */
8043 updateComponent: function (transaction, prevElement, nextElement, context) {
8044 var lastProps = prevElement.props;
8045 var nextProps = this._currentElement.props;
8046
8047 switch (this._tag) {
8048 case 'button':
8049 lastProps = ReactDOMButton.getHostProps(this, lastProps);
8050 nextProps = ReactDOMButton.getHostProps(this, nextProps);
8051 break;
8052 case 'input':
8053 lastProps = ReactDOMInput.getHostProps(this, lastProps);
8054 nextProps = ReactDOMInput.getHostProps(this, nextProps);
8055 break;
8056 case 'option':
8057 lastProps = ReactDOMOption.getHostProps(this, lastProps);
8058 nextProps = ReactDOMOption.getHostProps(this, nextProps);
8059 break;
8060 case 'select':
8061 lastProps = ReactDOMSelect.getHostProps(this, lastProps);
8062 nextProps = ReactDOMSelect.getHostProps(this, nextProps);
8063 break;
8064 case 'textarea':
8065 lastProps = ReactDOMTextarea.getHostProps(this, lastProps);
8066 nextProps = ReactDOMTextarea.getHostProps(this, nextProps);
8067 break;
8068 }
8069
8070 assertValidProps(this, nextProps);
8071 this._updateDOMProperties(lastProps, nextProps, transaction);
8072 this._updateDOMChildren(lastProps, nextProps, transaction, context);
8073
8074 switch (this._tag) {
8075 case 'input':
8076 // Update the wrapper around inputs *after* updating props. This has to
8077 // happen after `_updateDOMProperties`. Otherwise HTML5 input validations
8078 // raise warnings and prevent the new value from being assigned.
8079 ReactDOMInput.updateWrapper(this);
8080 break;
8081 case 'textarea':
8082 ReactDOMTextarea.updateWrapper(this);
8083 break;
8084 case 'select':
8085 // <select> value update needs to occur after <option> children
8086 // reconciliation
8087 transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
8088 break;
8089 }
8090 },
8091
8092 /**
8093 * Reconciles the properties by detecting differences in property values and
8094 * updating the DOM as necessary. This function is probably the single most
8095 * critical path for performance optimization.
8096 *
8097 * TODO: Benchmark whether checking for changed values in memory actually
8098 * improves performance (especially statically positioned elements).
8099 * TODO: Benchmark the effects of putting this at the top since 99% of props
8100 * do not change for a given reconciliation.
8101 * TODO: Benchmark areas that can be improved with caching.
8102 *
8103 * @private
8104 * @param {object} lastProps
8105 * @param {object} nextProps
8106 * @param {?DOMElement} node
8107 */
8108 _updateDOMProperties: function (lastProps, nextProps, transaction) {
8109 var propKey;
8110 var styleName;
8111 var styleUpdates;
8112 for (propKey in lastProps) {
8113 if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
8114 continue;
8115 }
8116 if (propKey === STYLE) {
8117 var lastStyle = this._previousStyleCopy;
8118 for (styleName in lastStyle) {
8119 if (lastStyle.hasOwnProperty(styleName)) {
8120 styleUpdates = styleUpdates || {};
8121 styleUpdates[styleName] = '';
8122 }
8123 }
8124 this._previousStyleCopy = null;
8125 } else if (registrationNameModules.hasOwnProperty(propKey)) {
8126 if (lastProps[propKey]) {
8127 // Only call deleteListener if there was a listener previously or
8128 // else willDeleteListener gets called when there wasn't actually a
8129 // listener (e.g., onClick={null})
8130 deleteListener(this, propKey);
8131 }
8132 } else if (isCustomComponent(this._tag, lastProps)) {
8133 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
8134 DOMPropertyOperations.deleteValueForAttribute(getNode(this), propKey);
8135 }
8136 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
8137 DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
8138 }
8139 }
8140 for (propKey in nextProps) {
8141 var nextProp = nextProps[propKey];
8142 var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
8143 if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
8144 continue;
8145 }
8146 if (propKey === STYLE) {
8147 if (nextProp) {
8148 if ("development" !== 'production') {
8149 checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
8150 this._previousStyle = nextProp;
8151 }
8152 nextProp = this._previousStyleCopy = _assign({}, nextProp);
8153 } else {
8154 this._previousStyleCopy = null;
8155 }
8156 if (lastProp) {
8157 // Unset styles on `lastProp` but not on `nextProp`.
8158 for (styleName in lastProp) {
8159 if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
8160 styleUpdates = styleUpdates || {};
8161 styleUpdates[styleName] = '';
8162 }
8163 }
8164 // Update styles that changed since `lastProp`.
8165 for (styleName in nextProp) {
8166 if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
8167 styleUpdates = styleUpdates || {};
8168 styleUpdates[styleName] = nextProp[styleName];
8169 }
8170 }
8171 } else {
8172 // Relies on `updateStylesByID` not mutating `styleUpdates`.
8173 styleUpdates = nextProp;
8174 }
8175 } else if (registrationNameModules.hasOwnProperty(propKey)) {
8176 if (nextProp) {
8177 enqueuePutListener(this, propKey, nextProp, transaction);
8178 } else if (lastProp) {
8179 deleteListener(this, propKey);
8180 }
8181 } else if (isCustomComponent(this._tag, nextProps)) {
8182 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
8183 DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
8184 }
8185 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
8186 var node = getNode(this);
8187 // If we're updating to null or undefined, we should remove the property
8188 // from the DOM node instead of inadvertently setting to a string. This
8189 // brings us in line with the same behavior we have on initial render.
8190 if (nextProp != null) {
8191 DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
8192 } else {
8193 DOMPropertyOperations.deleteValueForProperty(node, propKey);
8194 }
8195 }
8196 }
8197 if (styleUpdates) {
8198 CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
8199 }
8200 },
8201
8202 /**
8203 * Reconciles the children with the various properties that affect the
8204 * children content.
8205 *
8206 * @param {object} lastProps
8207 * @param {object} nextProps
8208 * @param {ReactReconcileTransaction} transaction
8209 * @param {object} context
8210 */
8211 _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
8212 var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
8213 var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
8214
8215 var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
8216 var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
8217
8218 // Note the use of `!=` which checks for null or undefined.
8219 var lastChildren = lastContent != null ? null : lastProps.children;
8220 var nextChildren = nextContent != null ? null : nextProps.children;
8221
8222 // If we're switching from children to content/html or vice versa, remove
8223 // the old content
8224 var lastHasContentOrHtml = lastContent != null || lastHtml != null;
8225 var nextHasContentOrHtml = nextContent != null || nextHtml != null;
8226 if (lastChildren != null && nextChildren == null) {
8227 this.updateChildren(null, transaction, context);
8228 } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
8229 this.updateTextContent('');
8230 if ("development" !== 'production') {
8231 ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
8232 }
8233 }
8234
8235 if (nextContent != null) {
8236 if (lastContent !== nextContent) {
8237 this.updateTextContent('' + nextContent);
8238 if ("development" !== 'production') {
8239 setAndValidateContentChildDev.call(this, nextContent);
8240 }
8241 }
8242 } else if (nextHtml != null) {
8243 if (lastHtml !== nextHtml) {
8244 this.updateMarkup('' + nextHtml);
8245 }
8246 if ("development" !== 'production') {
8247 ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
8248 }
8249 } else if (nextChildren != null) {
8250 if ("development" !== 'production') {
8251 setAndValidateContentChildDev.call(this, null);
8252 }
8253
8254 this.updateChildren(nextChildren, transaction, context);
8255 }
8256 },
8257
8258 getHostNode: function () {
8259 return getNode(this);
8260 },
8261
8262 /**
8263 * Destroys all event registrations for this instance. Does not remove from
8264 * the DOM. That must be done by the parent.
8265 *
8266 * @internal
8267 */
8268 unmountComponent: function (safely) {
8269 switch (this._tag) {
8270 case 'audio':
8271 case 'form':
8272 case 'iframe':
8273 case 'img':
8274 case 'link':
8275 case 'object':
8276 case 'source':
8277 case 'video':
8278 var listeners = this._wrapperState.listeners;
8279 if (listeners) {
8280 for (var i = 0; i < listeners.length; i++) {
8281 listeners[i].remove();
8282 }
8283 }
8284 break;
8285 case 'html':
8286 case 'head':
8287 case 'body':
8288 /**
8289 * Components like <html> <head> and <body> can't be removed or added
8290 * easily in a cross-browser way, however it's valuable to be able to
8291 * take advantage of React's reconciliation for styling and <title>
8292 * management. So we just document it and throw in dangerous cases.
8293 */
8294 !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) : _prodInvariant('66', this._tag) : void 0;
8295 break;
8296 }
8297
8298 this.unmountChildren(safely);
8299 ReactDOMComponentTree.uncacheNode(this);
8300 EventPluginHub.deleteAllListeners(this);
8301 this._rootNodeID = 0;
8302 this._domID = 0;
8303 this._wrapperState = null;
8304
8305 if ("development" !== 'production') {
8306 setAndValidateContentChildDev.call(this, null);
8307 }
8308 },
8309
8310 getPublicInstance: function () {
8311 return getNode(this);
8312 }
8313
8314};
8315
8316_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
8317
8318module.exports = ReactDOMComponent;
8319},{"1":1,"10":10,"11":11,"135":135,"149":149,"153":153,"16":16,"161":161,"17":17,"170":170,"178":178,"18":18,"182":182,"186":186,"187":187,"188":188,"28":28,"4":4,"43":43,"45":45,"46":46,"52":52,"54":54,"55":55,"59":59,"78":78,"8":8,"83":83,"9":9,"99":99}],45:[function(_dereq_,module,exports){
8320/**
8321 * Copyright 2015-present, Facebook, Inc.
8322 * All rights reserved.
8323 *
8324 * This source code is licensed under the BSD-style license found in the
8325 * LICENSE file in the root directory of this source tree. An additional grant
8326 * of patent rights can be found in the PATENTS file in the same directory.
8327 *
8328 * @providesModule ReactDOMComponentFlags
8329 */
8330
8331'use strict';
8332
8333var ReactDOMComponentFlags = {
8334 hasCachedChildNodes: 1 << 0
8335};
8336
8337module.exports = ReactDOMComponentFlags;
8338},{}],46:[function(_dereq_,module,exports){
8339/**
8340 * Copyright 2013-present, Facebook, Inc.
8341 * All rights reserved.
8342 *
8343 * This source code is licensed under the BSD-style license found in the
8344 * LICENSE file in the root directory of this source tree. An additional grant
8345 * of patent rights can be found in the PATENTS file in the same directory.
8346 *
8347 * @providesModule ReactDOMComponentTree
8348 */
8349
8350'use strict';
8351
8352var _prodInvariant = _dereq_(153);
8353
8354var DOMProperty = _dereq_(10);
8355var ReactDOMComponentFlags = _dereq_(45);
8356
8357var invariant = _dereq_(178);
8358
8359var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
8360var Flags = ReactDOMComponentFlags;
8361
8362var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
8363
8364/**
8365 * Drill down (through composites and empty components) until we get a host or
8366 * host text component.
8367 *
8368 * This is pretty polymorphic but unavoidable with the current structure we have
8369 * for `_renderedChildren`.
8370 */
8371function getRenderedHostOrTextFromComponent(component) {
8372 var rendered;
8373 while (rendered = component._renderedComponent) {
8374 component = rendered;
8375 }
8376 return component;
8377}
8378
8379/**
8380 * Populate `_hostNode` on the rendered host/text component with the given
8381 * DOM node. The passed `inst` can be a composite.
8382 */
8383function precacheNode(inst, node) {
8384 var hostInst = getRenderedHostOrTextFromComponent(inst);
8385 hostInst._hostNode = node;
8386 node[internalInstanceKey] = hostInst;
8387}
8388
8389function uncacheNode(inst) {
8390 var node = inst._hostNode;
8391 if (node) {
8392 delete node[internalInstanceKey];
8393 inst._hostNode = null;
8394 }
8395}
8396
8397/**
8398 * Populate `_hostNode` on each child of `inst`, assuming that the children
8399 * match up with the DOM (element) children of `node`.
8400 *
8401 * We cache entire levels at once to avoid an n^2 problem where we access the
8402 * children of a node sequentially and have to walk from the start to our target
8403 * node every time.
8404 *
8405 * Since we update `_renderedChildren` and the actual DOM at (slightly)
8406 * different times, we could race here and see a newer `_renderedChildren` than
8407 * the DOM nodes we see. To avoid this, ReactMultiChild calls
8408 * `prepareToManageChildren` before we change `_renderedChildren`, at which
8409 * time the container's child nodes are always cached (until it unmounts).
8410 */
8411function precacheChildNodes(inst, node) {
8412 if (inst._flags & Flags.hasCachedChildNodes) {
8413 return;
8414 }
8415 var children = inst._renderedChildren;
8416 var childNode = node.firstChild;
8417 outer: for (var name in children) {
8418 if (!children.hasOwnProperty(name)) {
8419 continue;
8420 }
8421 var childInst = children[name];
8422 var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
8423 if (childID === 0) {
8424 // We're currently unmounting this child in ReactMultiChild; skip it.
8425 continue;
8426 }
8427 // We assume the child nodes are in the same order as the child instances.
8428 for (; childNode !== null; childNode = childNode.nextSibling) {
8429 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 + ' ') {
8430 precacheNode(childInst, childNode);
8431 continue outer;
8432 }
8433 }
8434 // We reached the end of the DOM children without finding an ID match.
8435 !false ? "development" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;
8436 }
8437 inst._flags |= Flags.hasCachedChildNodes;
8438}
8439
8440/**
8441 * Given a DOM node, return the closest ReactDOMComponent or
8442 * ReactDOMTextComponent instance ancestor.
8443 */
8444function getClosestInstanceFromNode(node) {
8445 if (node[internalInstanceKey]) {
8446 return node[internalInstanceKey];
8447 }
8448
8449 // Walk up the tree until we find an ancestor whose instance we have cached.
8450 var parents = [];
8451 while (!node[internalInstanceKey]) {
8452 parents.push(node);
8453 if (node.parentNode) {
8454 node = node.parentNode;
8455 } else {
8456 // Top of the tree. This node must not be part of a React tree (or is
8457 // unmounted, potentially).
8458 return null;
8459 }
8460 }
8461
8462 var closest;
8463 var inst;
8464 for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
8465 closest = inst;
8466 if (parents.length) {
8467 precacheChildNodes(inst, node);
8468 }
8469 }
8470
8471 return closest;
8472}
8473
8474/**
8475 * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
8476 * instance, or null if the node was not rendered by this React.
8477 */
8478function getInstanceFromNode(node) {
8479 var inst = getClosestInstanceFromNode(node);
8480 if (inst != null && inst._hostNode === node) {
8481 return inst;
8482 } else {
8483 return null;
8484 }
8485}
8486
8487/**
8488 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
8489 * DOM node.
8490 */
8491function getNodeFromInstance(inst) {
8492 // Without this first invariant, passing a non-DOM-component triggers the next
8493 // invariant for a missing parent, which is super confusing.
8494 !(inst._hostNode !== undefined) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
8495
8496 if (inst._hostNode) {
8497 return inst._hostNode;
8498 }
8499
8500 // Walk up the tree until we find an ancestor whose DOM node we have cached.
8501 var parents = [];
8502 while (!inst._hostNode) {
8503 parents.push(inst);
8504 !inst._hostParent ? "development" !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0;
8505 inst = inst._hostParent;
8506 }
8507
8508 // Now parents contains each ancestor that does *not* have a cached native
8509 // node, and `inst` is the deepest ancestor that does.
8510 for (; parents.length; inst = parents.pop()) {
8511 precacheChildNodes(inst, inst._hostNode);
8512 }
8513
8514 return inst._hostNode;
8515}
8516
8517var ReactDOMComponentTree = {
8518 getClosestInstanceFromNode: getClosestInstanceFromNode,
8519 getInstanceFromNode: getInstanceFromNode,
8520 getNodeFromInstance: getNodeFromInstance,
8521 precacheChildNodes: precacheChildNodes,
8522 precacheNode: precacheNode,
8523 uncacheNode: uncacheNode
8524};
8525
8526module.exports = ReactDOMComponentTree;
8527},{"10":10,"153":153,"178":178,"45":45}],47:[function(_dereq_,module,exports){
8528/**
8529 * Copyright 2013-present, Facebook, Inc.
8530 * All rights reserved.
8531 *
8532 * This source code is licensed under the BSD-style license found in the
8533 * LICENSE file in the root directory of this source tree. An additional grant
8534 * of patent rights can be found in the PATENTS file in the same directory.
8535 *
8536 * @providesModule ReactDOMContainerInfo
8537 */
8538
8539'use strict';
8540
8541var validateDOMNesting = _dereq_(161);
8542
8543var DOC_NODE_TYPE = 9;
8544
8545function ReactDOMContainerInfo(topLevelWrapper, node) {
8546 var info = {
8547 _topLevelWrapper: topLevelWrapper,
8548 _idCounter: 1,
8549 _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,
8550 _node: node,
8551 _tag: node ? node.nodeName.toLowerCase() : null,
8552 _namespaceURI: node ? node.namespaceURI : null
8553 };
8554 if ("development" !== 'production') {
8555 info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
8556 }
8557 return info;
8558}
8559
8560module.exports = ReactDOMContainerInfo;
8561},{"161":161}],48:[function(_dereq_,module,exports){
8562/**
8563 * Copyright 2014-present, Facebook, Inc.
8564 * All rights reserved.
8565 *
8566 * This source code is licensed under the BSD-style license found in the
8567 * LICENSE file in the root directory of this source tree. An additional grant
8568 * of patent rights can be found in the PATENTS file in the same directory.
8569 *
8570 * @providesModule ReactDOMEmptyComponent
8571 */
8572
8573'use strict';
8574
8575var _assign = _dereq_(188);
8576
8577var DOMLazyTree = _dereq_(8);
8578var ReactDOMComponentTree = _dereq_(46);
8579
8580var ReactDOMEmptyComponent = function (instantiate) {
8581 // ReactCompositeComponent uses this:
8582 this._currentElement = null;
8583 // ReactDOMComponentTree uses these:
8584 this._hostNode = null;
8585 this._hostParent = null;
8586 this._hostContainerInfo = null;
8587 this._domID = 0;
8588};
8589_assign(ReactDOMEmptyComponent.prototype, {
8590 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
8591 var domID = hostContainerInfo._idCounter++;
8592 this._domID = domID;
8593 this._hostParent = hostParent;
8594 this._hostContainerInfo = hostContainerInfo;
8595
8596 var nodeValue = ' react-empty: ' + this._domID + ' ';
8597 if (transaction.useCreateElement) {
8598 var ownerDocument = hostContainerInfo._ownerDocument;
8599 var node = ownerDocument.createComment(nodeValue);
8600 ReactDOMComponentTree.precacheNode(this, node);
8601 return DOMLazyTree(node);
8602 } else {
8603 if (transaction.renderToStaticMarkup) {
8604 // Normally we'd insert a comment node, but since this is a situation
8605 // where React won't take over (static pages), we can simply return
8606 // nothing.
8607 return '';
8608 }
8609 return '<!--' + nodeValue + '-->';
8610 }
8611 },
8612 receiveComponent: function () {},
8613 getHostNode: function () {
8614 return ReactDOMComponentTree.getNodeFromInstance(this);
8615 },
8616 unmountComponent: function () {
8617 ReactDOMComponentTree.uncacheNode(this);
8618 }
8619});
8620
8621module.exports = ReactDOMEmptyComponent;
8622},{"188":188,"46":46,"8":8}],49:[function(_dereq_,module,exports){
8623/**
8624 * Copyright 2013-present, Facebook, Inc.
8625 * All rights reserved.
8626 *
8627 * This source code is licensed under the BSD-style license found in the
8628 * LICENSE file in the root directory of this source tree. An additional grant
8629 * of patent rights can be found in the PATENTS file in the same directory.
8630 *
8631 * @providesModule ReactDOMFactories
8632 */
8633
8634'use strict';
8635
8636var ReactElement = _dereq_(65);
8637
8638/**
8639 * Create a factory that creates HTML tag elements.
8640 *
8641 * @private
8642 */
8643var createDOMFactory = ReactElement.createFactory;
8644if ("development" !== 'production') {
8645 var ReactElementValidator = _dereq_(66);
8646 createDOMFactory = ReactElementValidator.createFactory;
8647}
8648
8649/**
8650 * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
8651 * This is also accessible via `React.DOM`.
8652 *
8653 * @public
8654 */
8655var ReactDOMFactories = {
8656 a: createDOMFactory('a'),
8657 abbr: createDOMFactory('abbr'),
8658 address: createDOMFactory('address'),
8659 area: createDOMFactory('area'),
8660 article: createDOMFactory('article'),
8661 aside: createDOMFactory('aside'),
8662 audio: createDOMFactory('audio'),
8663 b: createDOMFactory('b'),
8664 base: createDOMFactory('base'),
8665 bdi: createDOMFactory('bdi'),
8666 bdo: createDOMFactory('bdo'),
8667 big: createDOMFactory('big'),
8668 blockquote: createDOMFactory('blockquote'),
8669 body: createDOMFactory('body'),
8670 br: createDOMFactory('br'),
8671 button: createDOMFactory('button'),
8672 canvas: createDOMFactory('canvas'),
8673 caption: createDOMFactory('caption'),
8674 cite: createDOMFactory('cite'),
8675 code: createDOMFactory('code'),
8676 col: createDOMFactory('col'),
8677 colgroup: createDOMFactory('colgroup'),
8678 data: createDOMFactory('data'),
8679 datalist: createDOMFactory('datalist'),
8680 dd: createDOMFactory('dd'),
8681 del: createDOMFactory('del'),
8682 details: createDOMFactory('details'),
8683 dfn: createDOMFactory('dfn'),
8684 dialog: createDOMFactory('dialog'),
8685 div: createDOMFactory('div'),
8686 dl: createDOMFactory('dl'),
8687 dt: createDOMFactory('dt'),
8688 em: createDOMFactory('em'),
8689 embed: createDOMFactory('embed'),
8690 fieldset: createDOMFactory('fieldset'),
8691 figcaption: createDOMFactory('figcaption'),
8692 figure: createDOMFactory('figure'),
8693 footer: createDOMFactory('footer'),
8694 form: createDOMFactory('form'),
8695 h1: createDOMFactory('h1'),
8696 h2: createDOMFactory('h2'),
8697 h3: createDOMFactory('h3'),
8698 h4: createDOMFactory('h4'),
8699 h5: createDOMFactory('h5'),
8700 h6: createDOMFactory('h6'),
8701 head: createDOMFactory('head'),
8702 header: createDOMFactory('header'),
8703 hgroup: createDOMFactory('hgroup'),
8704 hr: createDOMFactory('hr'),
8705 html: createDOMFactory('html'),
8706 i: createDOMFactory('i'),
8707 iframe: createDOMFactory('iframe'),
8708 img: createDOMFactory('img'),
8709 input: createDOMFactory('input'),
8710 ins: createDOMFactory('ins'),
8711 kbd: createDOMFactory('kbd'),
8712 keygen: createDOMFactory('keygen'),
8713 label: createDOMFactory('label'),
8714 legend: createDOMFactory('legend'),
8715 li: createDOMFactory('li'),
8716 link: createDOMFactory('link'),
8717 main: createDOMFactory('main'),
8718 map: createDOMFactory('map'),
8719 mark: createDOMFactory('mark'),
8720 menu: createDOMFactory('menu'),
8721 menuitem: createDOMFactory('menuitem'),
8722 meta: createDOMFactory('meta'),
8723 meter: createDOMFactory('meter'),
8724 nav: createDOMFactory('nav'),
8725 noscript: createDOMFactory('noscript'),
8726 object: createDOMFactory('object'),
8727 ol: createDOMFactory('ol'),
8728 optgroup: createDOMFactory('optgroup'),
8729 option: createDOMFactory('option'),
8730 output: createDOMFactory('output'),
8731 p: createDOMFactory('p'),
8732 param: createDOMFactory('param'),
8733 picture: createDOMFactory('picture'),
8734 pre: createDOMFactory('pre'),
8735 progress: createDOMFactory('progress'),
8736 q: createDOMFactory('q'),
8737 rp: createDOMFactory('rp'),
8738 rt: createDOMFactory('rt'),
8739 ruby: createDOMFactory('ruby'),
8740 s: createDOMFactory('s'),
8741 samp: createDOMFactory('samp'),
8742 script: createDOMFactory('script'),
8743 section: createDOMFactory('section'),
8744 select: createDOMFactory('select'),
8745 small: createDOMFactory('small'),
8746 source: createDOMFactory('source'),
8747 span: createDOMFactory('span'),
8748 strong: createDOMFactory('strong'),
8749 style: createDOMFactory('style'),
8750 sub: createDOMFactory('sub'),
8751 summary: createDOMFactory('summary'),
8752 sup: createDOMFactory('sup'),
8753 table: createDOMFactory('table'),
8754 tbody: createDOMFactory('tbody'),
8755 td: createDOMFactory('td'),
8756 textarea: createDOMFactory('textarea'),
8757 tfoot: createDOMFactory('tfoot'),
8758 th: createDOMFactory('th'),
8759 thead: createDOMFactory('thead'),
8760 time: createDOMFactory('time'),
8761 title: createDOMFactory('title'),
8762 tr: createDOMFactory('tr'),
8763 track: createDOMFactory('track'),
8764 u: createDOMFactory('u'),
8765 ul: createDOMFactory('ul'),
8766 'var': createDOMFactory('var'),
8767 video: createDOMFactory('video'),
8768 wbr: createDOMFactory('wbr'),
8769
8770 // SVG
8771 circle: createDOMFactory('circle'),
8772 clipPath: createDOMFactory('clipPath'),
8773 defs: createDOMFactory('defs'),
8774 ellipse: createDOMFactory('ellipse'),
8775 g: createDOMFactory('g'),
8776 image: createDOMFactory('image'),
8777 line: createDOMFactory('line'),
8778 linearGradient: createDOMFactory('linearGradient'),
8779 mask: createDOMFactory('mask'),
8780 path: createDOMFactory('path'),
8781 pattern: createDOMFactory('pattern'),
8782 polygon: createDOMFactory('polygon'),
8783 polyline: createDOMFactory('polyline'),
8784 radialGradient: createDOMFactory('radialGradient'),
8785 rect: createDOMFactory('rect'),
8786 stop: createDOMFactory('stop'),
8787 svg: createDOMFactory('svg'),
8788 text: createDOMFactory('text'),
8789 tspan: createDOMFactory('tspan')
8790};
8791
8792module.exports = ReactDOMFactories;
8793},{"65":65,"66":66}],50:[function(_dereq_,module,exports){
8794/**
8795 * Copyright 2013-present, Facebook, Inc.
8796 * All rights reserved.
8797 *
8798 * This source code is licensed under the BSD-style license found in the
8799 * LICENSE file in the root directory of this source tree. An additional grant
8800 * of patent rights can be found in the PATENTS file in the same directory.
8801 *
8802 * @providesModule ReactDOMFeatureFlags
8803 */
8804
8805'use strict';
8806
8807var ReactDOMFeatureFlags = {
8808 useCreateElement: true
8809};
8810
8811module.exports = ReactDOMFeatureFlags;
8812},{}],51:[function(_dereq_,module,exports){
8813/**
8814 * Copyright 2013-present, Facebook, Inc.
8815 * All rights reserved.
8816 *
8817 * This source code is licensed under the BSD-style license found in the
8818 * LICENSE file in the root directory of this source tree. An additional grant
8819 * of patent rights can be found in the PATENTS file in the same directory.
8820 *
8821 * @providesModule ReactDOMIDOperations
8822 */
8823
8824'use strict';
8825
8826var DOMChildrenOperations = _dereq_(7);
8827var ReactDOMComponentTree = _dereq_(46);
8828
8829/**
8830 * Operations used to process updates to DOM nodes.
8831 */
8832var ReactDOMIDOperations = {
8833
8834 /**
8835 * Updates a component's children by processing a series of updates.
8836 *
8837 * @param {array<object>} updates List of update configurations.
8838 * @internal
8839 */
8840 dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
8841 var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
8842 DOMChildrenOperations.processUpdates(node, updates);
8843 }
8844};
8845
8846module.exports = ReactDOMIDOperations;
8847},{"46":46,"7":7}],52:[function(_dereq_,module,exports){
8848/**
8849 * Copyright 2013-present, Facebook, Inc.
8850 * All rights reserved.
8851 *
8852 * This source code is licensed under the BSD-style license found in the
8853 * LICENSE file in the root directory of this source tree. An additional grant
8854 * of patent rights can be found in the PATENTS file in the same directory.
8855 *
8856 * @providesModule ReactDOMInput
8857 */
8858
8859'use strict';
8860
8861var _prodInvariant = _dereq_(153),
8862 _assign = _dereq_(188);
8863
8864var DisabledInputUtils = _dereq_(14);
8865var DOMPropertyOperations = _dereq_(11);
8866var LinkedValueUtils = _dereq_(25);
8867var ReactDOMComponentTree = _dereq_(46);
8868var ReactUpdates = _dereq_(107);
8869
8870var invariant = _dereq_(178);
8871var warning = _dereq_(187);
8872
8873var didWarnValueLink = false;
8874var didWarnCheckedLink = false;
8875var didWarnValueDefaultValue = false;
8876var didWarnCheckedDefaultChecked = false;
8877var didWarnControlledToUncontrolled = false;
8878var didWarnUncontrolledToControlled = false;
8879
8880function forceUpdateIfMounted() {
8881 if (this._rootNodeID) {
8882 // DOM component is still mounted; update
8883 ReactDOMInput.updateWrapper(this);
8884 }
8885}
8886
8887function isControlled(props) {
8888 var usesChecked = props.type === 'checkbox' || props.type === 'radio';
8889 return usesChecked ? props.checked != null : props.value != null;
8890}
8891
8892/**
8893 * Implements an <input> host component that allows setting these optional
8894 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
8895 *
8896 * If `checked` or `value` are not supplied (or null/undefined), user actions
8897 * that affect the checked state or value will trigger updates to the element.
8898 *
8899 * If they are supplied (and not null/undefined), the rendered element will not
8900 * trigger updates to the element. Instead, the props must change in order for
8901 * the rendered element to be updated.
8902 *
8903 * The rendered element will be initialized as unchecked (or `defaultChecked`)
8904 * with an empty value (or `defaultValue`).
8905 *
8906 * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
8907 */
8908var ReactDOMInput = {
8909 getHostProps: function (inst, props) {
8910 var value = LinkedValueUtils.getValue(props);
8911 var checked = LinkedValueUtils.getChecked(props);
8912
8913 var hostProps = _assign({
8914 // Make sure we set .type before any other properties (setting .value
8915 // before .type means .value is lost in IE11 and below)
8916 type: undefined,
8917 // Make sure we set .step before .value (setting .value before .step
8918 // means .value is rounded on mount, based upon step precision)
8919 step: undefined,
8920 // Make sure we set .min & .max before .value (to ensure proper order
8921 // in corner cases such as min or max deriving from value, e.g. Issue #7170)
8922 min: undefined,
8923 max: undefined
8924 }, DisabledInputUtils.getHostProps(inst, props), {
8925 defaultChecked: undefined,
8926 defaultValue: undefined,
8927 value: value != null ? value : inst._wrapperState.initialValue,
8928 checked: checked != null ? checked : inst._wrapperState.initialChecked,
8929 onChange: inst._wrapperState.onChange
8930 });
8931
8932 return hostProps;
8933 },
8934
8935 mountWrapper: function (inst, props) {
8936 if ("development" !== 'production') {
8937 LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
8938
8939 var owner = inst._currentElement._owner;
8940
8941 if (props.valueLink !== undefined && !didWarnValueLink) {
8942 "development" !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
8943 didWarnValueLink = true;
8944 }
8945 if (props.checkedLink !== undefined && !didWarnCheckedLink) {
8946 "development" !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
8947 didWarnCheckedLink = true;
8948 }
8949 if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
8950 "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;
8951 didWarnCheckedDefaultChecked = true;
8952 }
8953 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
8954 "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;
8955 didWarnValueDefaultValue = true;
8956 }
8957 }
8958
8959 var defaultValue = props.defaultValue;
8960 inst._wrapperState = {
8961 initialChecked: props.checked != null ? props.checked : props.defaultChecked,
8962 initialValue: props.value != null ? props.value : defaultValue,
8963 listeners: null,
8964 onChange: _handleChange.bind(inst)
8965 };
8966
8967 if ("development" !== 'production') {
8968 inst._wrapperState.controlled = isControlled(props);
8969 }
8970 },
8971
8972 updateWrapper: function (inst) {
8973 var props = inst._currentElement.props;
8974
8975 if ("development" !== 'production') {
8976 var controlled = isControlled(props);
8977 var owner = inst._currentElement._owner;
8978
8979 if (!inst._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
8980 "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;
8981 didWarnUncontrolledToControlled = true;
8982 }
8983 if (inst._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
8984 "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;
8985 didWarnControlledToUncontrolled = true;
8986 }
8987 }
8988
8989 // TODO: Shouldn't this be getChecked(props)?
8990 var checked = props.checked;
8991 if (checked != null) {
8992 DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
8993 }
8994
8995 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
8996 var value = LinkedValueUtils.getValue(props);
8997 if (value != null) {
8998
8999 // Cast `value` to a string to ensure the value is set correctly. While
9000 // browsers typically do this as necessary, jsdom doesn't.
9001 var newValue = '' + value;
9002
9003 // To avoid side effects (such as losing text selection), only set value if changed
9004 if (newValue !== node.value) {
9005 node.value = newValue;
9006 }
9007 } else {
9008 if (props.value == null && props.defaultValue != null) {
9009 node.defaultValue = '' + props.defaultValue;
9010 }
9011 if (props.checked == null && props.defaultChecked != null) {
9012 node.defaultChecked = !!props.defaultChecked;
9013 }
9014 }
9015 },
9016
9017 postMountWrapper: function (inst) {
9018 var props = inst._currentElement.props;
9019
9020 // This is in postMount because we need access to the DOM node, which is not
9021 // available until after the component has mounted.
9022 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
9023
9024 // Detach value from defaultValue. We won't do anything if we're working on
9025 // submit or reset inputs as those values & defaultValues are linked. They
9026 // are not resetable nodes so this operation doesn't matter and actually
9027 // removes browser-default values (eg "Submit Query") when no value is
9028 // provided.
9029
9030 switch (props.type) {
9031 case 'submit':
9032 case 'reset':
9033 break;
9034 case 'color':
9035 case 'date':
9036 case 'datetime':
9037 case 'datetime-local':
9038 case 'month':
9039 case 'time':
9040 case 'week':
9041 // This fixes the no-show issue on iOS Safari and Android Chrome:
9042 // https://github.com/facebook/react/issues/7233
9043 node.value = '';
9044 node.value = node.defaultValue;
9045 break;
9046 default:
9047 node.value = node.value;
9048 break;
9049 }
9050
9051 // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
9052 // this is needed to work around a chrome bug where setting defaultChecked
9053 // will sometimes influence the value of checked (even after detachment).
9054 // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
9055 // We need to temporarily unset name to avoid disrupting radio button groups.
9056 var name = node.name;
9057 if (name !== '') {
9058 node.name = '';
9059 }
9060 node.defaultChecked = !node.defaultChecked;
9061 node.defaultChecked = !node.defaultChecked;
9062 if (name !== '') {
9063 node.name = name;
9064 }
9065 }
9066};
9067
9068function _handleChange(event) {
9069 var props = this._currentElement.props;
9070
9071 var returnValue = LinkedValueUtils.executeOnChange(props, event);
9072
9073 // Here we use asap to wait until all updates have propagated, which
9074 // is important when using controlled components within layers:
9075 // https://github.com/facebook/react/issues/1698
9076 ReactUpdates.asap(forceUpdateIfMounted, this);
9077
9078 var name = props.name;
9079 if (props.type === 'radio' && name != null) {
9080 var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
9081 var queryRoot = rootNode;
9082
9083 while (queryRoot.parentNode) {
9084 queryRoot = queryRoot.parentNode;
9085 }
9086
9087 // If `rootNode.form` was non-null, then we could try `form.elements`,
9088 // but that sometimes behaves strangely in IE8. We could also try using
9089 // `form.getElementsByName`, but that will only return direct children
9090 // and won't include inputs that use the HTML5 `form=` attribute. Since
9091 // the input might not even be in a form, let's just use the global
9092 // `querySelectorAll` to ensure we don't miss anything.
9093 var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
9094
9095 for (var i = 0; i < group.length; i++) {
9096 var otherNode = group[i];
9097 if (otherNode === rootNode || otherNode.form !== rootNode.form) {
9098 continue;
9099 }
9100 // This will throw if radio buttons rendered by different copies of React
9101 // and the same name are rendered into the same form (same as #1939).
9102 // That's probably okay; we don't support it just as we don't support
9103 // mixing React radio buttons with non-React ones.
9104 var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
9105 !otherInstance ? "development" !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : _prodInvariant('90') : void 0;
9106 // If this is a controlled radio button group, forcing the input that
9107 // was previously checked to update will cause it to be come re-checked
9108 // as appropriate.
9109 ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
9110 }
9111 }
9112
9113 return returnValue;
9114}
9115
9116module.exports = ReactDOMInput;
9117},{"107":107,"11":11,"14":14,"153":153,"178":178,"187":187,"188":188,"25":25,"46":46}],53:[function(_dereq_,module,exports){
9118/**
9119 * Copyright 2013-present, Facebook, Inc.
9120 * All rights reserved.
9121 *
9122 * This source code is licensed under the BSD-style license found in the
9123 * LICENSE file in the root directory of this source tree. An additional grant
9124 * of patent rights can be found in the PATENTS file in the same directory.
9125 *
9126 * @providesModule ReactDOMNullInputValuePropHook
9127 */
9128
9129'use strict';
9130
9131var ReactComponentTreeHook = _dereq_(38);
9132
9133var warning = _dereq_(187);
9134
9135var didWarnValueNull = false;
9136
9137function handleElement(debugID, element) {
9138 if (element == null) {
9139 return;
9140 }
9141 if (element.type !== 'input' && element.type !== 'textarea' && element.type !== 'select') {
9142 return;
9143 }
9144 if (element.props != null && element.props.value === null && !didWarnValueNull) {
9145 "development" !== 'production' ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
9146
9147 didWarnValueNull = true;
9148 }
9149}
9150
9151var ReactDOMNullInputValuePropHook = {
9152 onBeforeMountComponent: function (debugID, element) {
9153 handleElement(debugID, element);
9154 },
9155 onBeforeUpdateComponent: function (debugID, element) {
9156 handleElement(debugID, element);
9157 }
9158};
9159
9160module.exports = ReactDOMNullInputValuePropHook;
9161},{"187":187,"38":38}],54:[function(_dereq_,module,exports){
9162/**
9163 * Copyright 2013-present, Facebook, Inc.
9164 * All rights reserved.
9165 *
9166 * This source code is licensed under the BSD-style license found in the
9167 * LICENSE file in the root directory of this source tree. An additional grant
9168 * of patent rights can be found in the PATENTS file in the same directory.
9169 *
9170 * @providesModule ReactDOMOption
9171 */
9172
9173'use strict';
9174
9175var _assign = _dereq_(188);
9176
9177var ReactChildren = _dereq_(32);
9178var ReactDOMComponentTree = _dereq_(46);
9179var ReactDOMSelect = _dereq_(55);
9180
9181var warning = _dereq_(187);
9182var didWarnInvalidOptionChildren = false;
9183
9184function flattenChildren(children) {
9185 var content = '';
9186
9187 // Flatten children and warn if they aren't strings or numbers;
9188 // invalid types are ignored.
9189 ReactChildren.forEach(children, function (child) {
9190 if (child == null) {
9191 return;
9192 }
9193 if (typeof child === 'string' || typeof child === 'number') {
9194 content += child;
9195 } else if (!didWarnInvalidOptionChildren) {
9196 didWarnInvalidOptionChildren = true;
9197 "development" !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
9198 }
9199 });
9200
9201 return content;
9202}
9203
9204/**
9205 * Implements an <option> host component that warns when `selected` is set.
9206 */
9207var ReactDOMOption = {
9208 mountWrapper: function (inst, props, hostParent) {
9209 // TODO (yungsters): Remove support for `selected` in <option>.
9210 if ("development" !== 'production') {
9211 "development" !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;
9212 }
9213
9214 // Look up whether this option is 'selected'
9215 var selectValue = null;
9216 if (hostParent != null) {
9217 var selectParent = hostParent;
9218
9219 if (selectParent._tag === 'optgroup') {
9220 selectParent = selectParent._hostParent;
9221 }
9222
9223 if (selectParent != null && selectParent._tag === 'select') {
9224 selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
9225 }
9226 }
9227
9228 // If the value is null (e.g., no specified value or after initial mount)
9229 // or missing (e.g., for <datalist>), we don't change props.selected
9230 var selected = null;
9231 if (selectValue != null) {
9232 var value;
9233 if (props.value != null) {
9234 value = props.value + '';
9235 } else {
9236 value = flattenChildren(props.children);
9237 }
9238 selected = false;
9239 if (Array.isArray(selectValue)) {
9240 // multiple
9241 for (var i = 0; i < selectValue.length; i++) {
9242 if ('' + selectValue[i] === value) {
9243 selected = true;
9244 break;
9245 }
9246 }
9247 } else {
9248 selected = '' + selectValue === value;
9249 }
9250 }
9251
9252 inst._wrapperState = { selected: selected };
9253 },
9254
9255 postMountWrapper: function (inst) {
9256 // value="" should make a value attribute (#6219)
9257 var props = inst._currentElement.props;
9258 if (props.value != null) {
9259 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
9260 node.setAttribute('value', props.value);
9261 }
9262 },
9263
9264 getHostProps: function (inst, props) {
9265 var hostProps = _assign({ selected: undefined, children: undefined }, props);
9266
9267 // Read state only from initial mount because <select> updates value
9268 // manually; we need the initial state only for server rendering
9269 if (inst._wrapperState.selected != null) {
9270 hostProps.selected = inst._wrapperState.selected;
9271 }
9272
9273 var content = flattenChildren(props.children);
9274
9275 if (content) {
9276 hostProps.children = content;
9277 }
9278
9279 return hostProps;
9280 }
9281
9282};
9283
9284module.exports = ReactDOMOption;
9285},{"187":187,"188":188,"32":32,"46":46,"55":55}],55:[function(_dereq_,module,exports){
9286/**
9287 * Copyright 2013-present, Facebook, Inc.
9288 * All rights reserved.
9289 *
9290 * This source code is licensed under the BSD-style license found in the
9291 * LICENSE file in the root directory of this source tree. An additional grant
9292 * of patent rights can be found in the PATENTS file in the same directory.
9293 *
9294 * @providesModule ReactDOMSelect
9295 */
9296
9297'use strict';
9298
9299var _assign = _dereq_(188);
9300
9301var DisabledInputUtils = _dereq_(14);
9302var LinkedValueUtils = _dereq_(25);
9303var ReactDOMComponentTree = _dereq_(46);
9304var ReactUpdates = _dereq_(107);
9305
9306var warning = _dereq_(187);
9307
9308var didWarnValueLink = false;
9309var didWarnValueDefaultValue = false;
9310
9311function updateOptionsIfPendingUpdateAndMounted() {
9312 if (this._rootNodeID && this._wrapperState.pendingUpdate) {
9313 this._wrapperState.pendingUpdate = false;
9314
9315 var props = this._currentElement.props;
9316 var value = LinkedValueUtils.getValue(props);
9317
9318 if (value != null) {
9319 updateOptions(this, Boolean(props.multiple), value);
9320 }
9321 }
9322}
9323
9324function getDeclarationErrorAddendum(owner) {
9325 if (owner) {
9326 var name = owner.getName();
9327 if (name) {
9328 return ' Check the render method of `' + name + '`.';
9329 }
9330 }
9331 return '';
9332}
9333
9334var valuePropNames = ['value', 'defaultValue'];
9335
9336/**
9337 * Validation function for `value` and `defaultValue`.
9338 * @private
9339 */
9340function checkSelectPropTypes(inst, props) {
9341 var owner = inst._currentElement._owner;
9342 LinkedValueUtils.checkPropTypes('select', props, owner);
9343
9344 if (props.valueLink !== undefined && !didWarnValueLink) {
9345 "development" !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
9346 didWarnValueLink = true;
9347 }
9348
9349 for (var i = 0; i < valuePropNames.length; i++) {
9350 var propName = valuePropNames[i];
9351 if (props[propName] == null) {
9352 continue;
9353 }
9354 var isArray = Array.isArray(props[propName]);
9355 if (props.multiple && !isArray) {
9356 "development" !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
9357 } else if (!props.multiple && isArray) {
9358 "development" !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
9359 }
9360 }
9361}
9362
9363/**
9364 * @param {ReactDOMComponent} inst
9365 * @param {boolean} multiple
9366 * @param {*} propValue A stringable (with `multiple`, a list of stringables).
9367 * @private
9368 */
9369function updateOptions(inst, multiple, propValue) {
9370 var selectedValue, i;
9371 var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
9372
9373 if (multiple) {
9374 selectedValue = {};
9375 for (i = 0; i < propValue.length; i++) {
9376 selectedValue['' + propValue[i]] = true;
9377 }
9378 for (i = 0; i < options.length; i++) {
9379 var selected = selectedValue.hasOwnProperty(options[i].value);
9380 if (options[i].selected !== selected) {
9381 options[i].selected = selected;
9382 }
9383 }
9384 } else {
9385 // Do not set `select.value` as exact behavior isn't consistent across all
9386 // browsers for all cases.
9387 selectedValue = '' + propValue;
9388 for (i = 0; i < options.length; i++) {
9389 if (options[i].value === selectedValue) {
9390 options[i].selected = true;
9391 return;
9392 }
9393 }
9394 if (options.length) {
9395 options[0].selected = true;
9396 }
9397 }
9398}
9399
9400/**
9401 * Implements a <select> host component that allows optionally setting the
9402 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
9403 * stringable. If `multiple` is true, the prop must be an array of stringables.
9404 *
9405 * If `value` is not supplied (or null/undefined), user actions that change the
9406 * selected option will trigger updates to the rendered options.
9407 *
9408 * If it is supplied (and not null/undefined), the rendered options will not
9409 * update in response to user actions. Instead, the `value` prop must change in
9410 * order for the rendered options to update.
9411 *
9412 * If `defaultValue` is provided, any options with the supplied values will be
9413 * selected.
9414 */
9415var ReactDOMSelect = {
9416 getHostProps: function (inst, props) {
9417 return _assign({}, DisabledInputUtils.getHostProps(inst, props), {
9418 onChange: inst._wrapperState.onChange,
9419 value: undefined
9420 });
9421 },
9422
9423 mountWrapper: function (inst, props) {
9424 if ("development" !== 'production') {
9425 checkSelectPropTypes(inst, props);
9426 }
9427
9428 var value = LinkedValueUtils.getValue(props);
9429 inst._wrapperState = {
9430 pendingUpdate: false,
9431 initialValue: value != null ? value : props.defaultValue,
9432 listeners: null,
9433 onChange: _handleChange.bind(inst),
9434 wasMultiple: Boolean(props.multiple)
9435 };
9436
9437 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
9438 "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;
9439 didWarnValueDefaultValue = true;
9440 }
9441 },
9442
9443 getSelectValueContext: function (inst) {
9444 // ReactDOMOption looks at this initial value so the initial generated
9445 // markup has correct `selected` attributes
9446 return inst._wrapperState.initialValue;
9447 },
9448
9449 postUpdateWrapper: function (inst) {
9450 var props = inst._currentElement.props;
9451
9452 // After the initial mount, we control selected-ness manually so don't pass
9453 // this value down
9454 inst._wrapperState.initialValue = undefined;
9455
9456 var wasMultiple = inst._wrapperState.wasMultiple;
9457 inst._wrapperState.wasMultiple = Boolean(props.multiple);
9458
9459 var value = LinkedValueUtils.getValue(props);
9460 if (value != null) {
9461 inst._wrapperState.pendingUpdate = false;
9462 updateOptions(inst, Boolean(props.multiple), value);
9463 } else if (wasMultiple !== Boolean(props.multiple)) {
9464 // For simplicity, reapply `defaultValue` if `multiple` is toggled.
9465 if (props.defaultValue != null) {
9466 updateOptions(inst, Boolean(props.multiple), props.defaultValue);
9467 } else {
9468 // Revert the select back to its default unselected state.
9469 updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
9470 }
9471 }
9472 }
9473};
9474
9475function _handleChange(event) {
9476 var props = this._currentElement.props;
9477 var returnValue = LinkedValueUtils.executeOnChange(props, event);
9478
9479 if (this._rootNodeID) {
9480 this._wrapperState.pendingUpdate = true;
9481 }
9482 ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
9483 return returnValue;
9484}
9485
9486module.exports = ReactDOMSelect;
9487},{"107":107,"14":14,"187":187,"188":188,"25":25,"46":46}],56:[function(_dereq_,module,exports){
9488/**
9489 * Copyright 2013-present, Facebook, Inc.
9490 * All rights reserved.
9491 *
9492 * This source code is licensed under the BSD-style license found in the
9493 * LICENSE file in the root directory of this source tree. An additional grant
9494 * of patent rights can be found in the PATENTS file in the same directory.
9495 *
9496 * @providesModule ReactDOMSelection
9497 */
9498
9499'use strict';
9500
9501var ExecutionEnvironment = _dereq_(164);
9502
9503var getNodeForCharacterOffset = _dereq_(145);
9504var getTextContentAccessor = _dereq_(146);
9505
9506/**
9507 * While `isCollapsed` is available on the Selection object and `collapsed`
9508 * is available on the Range object, IE11 sometimes gets them wrong.
9509 * If the anchor/focus nodes and offsets are the same, the range is collapsed.
9510 */
9511function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
9512 return anchorNode === focusNode && anchorOffset === focusOffset;
9513}
9514
9515/**
9516 * Get the appropriate anchor and focus node/offset pairs for IE.
9517 *
9518 * The catch here is that IE's selection API doesn't provide information
9519 * about whether the selection is forward or backward, so we have to
9520 * behave as though it's always forward.
9521 *
9522 * IE text differs from modern selection in that it behaves as though
9523 * block elements end with a new line. This means character offsets will
9524 * differ between the two APIs.
9525 *
9526 * @param {DOMElement} node
9527 * @return {object}
9528 */
9529function getIEOffsets(node) {
9530 var selection = document.selection;
9531 var selectedRange = selection.createRange();
9532 var selectedLength = selectedRange.text.length;
9533
9534 // Duplicate selection so we can move range without breaking user selection.
9535 var fromStart = selectedRange.duplicate();
9536 fromStart.moveToElementText(node);
9537 fromStart.setEndPoint('EndToStart', selectedRange);
9538
9539 var startOffset = fromStart.text.length;
9540 var endOffset = startOffset + selectedLength;
9541
9542 return {
9543 start: startOffset,
9544 end: endOffset
9545 };
9546}
9547
9548/**
9549 * @param {DOMElement} node
9550 * @return {?object}
9551 */
9552function getModernOffsets(node) {
9553 var selection = window.getSelection && window.getSelection();
9554
9555 if (!selection || selection.rangeCount === 0) {
9556 return null;
9557 }
9558
9559 var anchorNode = selection.anchorNode;
9560 var anchorOffset = selection.anchorOffset;
9561 var focusNode = selection.focusNode;
9562 var focusOffset = selection.focusOffset;
9563
9564 var currentRange = selection.getRangeAt(0);
9565
9566 // In Firefox, range.startContainer and range.endContainer can be "anonymous
9567 // divs", e.g. the up/down buttons on an <input type="number">. Anonymous
9568 // divs do not seem to expose properties, triggering a "Permission denied
9569 // error" if any of its properties are accessed. The only seemingly possible
9570 // way to avoid erroring is to access a property that typically works for
9571 // non-anonymous divs and catch any error that may otherwise arise. See
9572 // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
9573 try {
9574 /* eslint-disable no-unused-expressions */
9575 currentRange.startContainer.nodeType;
9576 currentRange.endContainer.nodeType;
9577 /* eslint-enable no-unused-expressions */
9578 } catch (e) {
9579 return null;
9580 }
9581
9582 // If the node and offset values are the same, the selection is collapsed.
9583 // `Selection.isCollapsed` is available natively, but IE sometimes gets
9584 // this value wrong.
9585 var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
9586
9587 var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
9588
9589 var tempRange = currentRange.cloneRange();
9590 tempRange.selectNodeContents(node);
9591 tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
9592
9593 var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
9594
9595 var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
9596 var end = start + rangeLength;
9597
9598 // Detect whether the selection is backward.
9599 var detectionRange = document.createRange();
9600 detectionRange.setStart(anchorNode, anchorOffset);
9601 detectionRange.setEnd(focusNode, focusOffset);
9602 var isBackward = detectionRange.collapsed;
9603
9604 return {
9605 start: isBackward ? end : start,
9606 end: isBackward ? start : end
9607 };
9608}
9609
9610/**
9611 * @param {DOMElement|DOMTextNode} node
9612 * @param {object} offsets
9613 */
9614function setIEOffsets(node, offsets) {
9615 var range = document.selection.createRange().duplicate();
9616 var start, end;
9617
9618 if (offsets.end === undefined) {
9619 start = offsets.start;
9620 end = start;
9621 } else if (offsets.start > offsets.end) {
9622 start = offsets.end;
9623 end = offsets.start;
9624 } else {
9625 start = offsets.start;
9626 end = offsets.end;
9627 }
9628
9629 range.moveToElementText(node);
9630 range.moveStart('character', start);
9631 range.setEndPoint('EndToStart', range);
9632 range.moveEnd('character', end - start);
9633 range.select();
9634}
9635
9636/**
9637 * In modern non-IE browsers, we can support both forward and backward
9638 * selections.
9639 *
9640 * Note: IE10+ supports the Selection object, but it does not support
9641 * the `extend` method, which means that even in modern IE, it's not possible
9642 * to programmatically create a backward selection. Thus, for all IE
9643 * versions, we use the old IE API to create our selections.
9644 *
9645 * @param {DOMElement|DOMTextNode} node
9646 * @param {object} offsets
9647 */
9648function setModernOffsets(node, offsets) {
9649 if (!window.getSelection) {
9650 return;
9651 }
9652
9653 var selection = window.getSelection();
9654 var length = node[getTextContentAccessor()].length;
9655 var start = Math.min(offsets.start, length);
9656 var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
9657
9658 // IE 11 uses modern selection, but doesn't support the extend method.
9659 // Flip backward selections, so we can set with a single range.
9660 if (!selection.extend && start > end) {
9661 var temp = end;
9662 end = start;
9663 start = temp;
9664 }
9665
9666 var startMarker = getNodeForCharacterOffset(node, start);
9667 var endMarker = getNodeForCharacterOffset(node, end);
9668
9669 if (startMarker && endMarker) {
9670 var range = document.createRange();
9671 range.setStart(startMarker.node, startMarker.offset);
9672 selection.removeAllRanges();
9673
9674 if (start > end) {
9675 selection.addRange(range);
9676 selection.extend(endMarker.node, endMarker.offset);
9677 } else {
9678 range.setEnd(endMarker.node, endMarker.offset);
9679 selection.addRange(range);
9680 }
9681 }
9682}
9683
9684var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
9685
9686var ReactDOMSelection = {
9687 /**
9688 * @param {DOMElement} node
9689 */
9690 getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
9691
9692 /**
9693 * @param {DOMElement|DOMTextNode} node
9694 * @param {object} offsets
9695 */
9696 setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
9697};
9698
9699module.exports = ReactDOMSelection;
9700},{"145":145,"146":146,"164":164}],57:[function(_dereq_,module,exports){
9701/**
9702 * Copyright 2013-present, Facebook, Inc.
9703 * All rights reserved.
9704 *
9705 * This source code is licensed under the BSD-style license found in the
9706 * LICENSE file in the root directory of this source tree. An additional grant
9707 * of patent rights can be found in the PATENTS file in the same directory.
9708 *
9709 * @providesModule ReactDOMServer
9710 */
9711
9712'use strict';
9713
9714var ReactDefaultInjection = _dereq_(64);
9715var ReactServerRendering = _dereq_(98);
9716var ReactVersion = _dereq_(108);
9717
9718ReactDefaultInjection.inject();
9719
9720var ReactDOMServer = {
9721 renderToString: ReactServerRendering.renderToString,
9722 renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
9723 version: ReactVersion
9724};
9725
9726module.exports = ReactDOMServer;
9727},{"108":108,"64":64,"98":98}],58:[function(_dereq_,module,exports){
9728/**
9729 * Copyright 2013-present, Facebook, Inc.
9730 * All rights reserved.
9731 *
9732 * This source code is licensed under the BSD-style license found in the
9733 * LICENSE file in the root directory of this source tree. An additional grant
9734 * of patent rights can be found in the PATENTS file in the same directory.
9735 *
9736 * @providesModule ReactDOMTextComponent
9737 */
9738
9739'use strict';
9740
9741var _prodInvariant = _dereq_(153),
9742 _assign = _dereq_(188);
9743
9744var DOMChildrenOperations = _dereq_(7);
9745var DOMLazyTree = _dereq_(8);
9746var ReactDOMComponentTree = _dereq_(46);
9747
9748var escapeTextContentForBrowser = _dereq_(135);
9749var invariant = _dereq_(178);
9750var validateDOMNesting = _dereq_(161);
9751
9752/**
9753 * Text nodes violate a couple assumptions that React makes about components:
9754 *
9755 * - When mounting text into the DOM, adjacent text nodes are merged.
9756 * - Text nodes cannot be assigned a React root ID.
9757 *
9758 * This component is used to wrap strings between comment nodes so that they
9759 * can undergo the same reconciliation that is applied to elements.
9760 *
9761 * TODO: Investigate representing React components in the DOM with text nodes.
9762 *
9763 * @class ReactDOMTextComponent
9764 * @extends ReactComponent
9765 * @internal
9766 */
9767var ReactDOMTextComponent = function (text) {
9768 // TODO: This is really a ReactText (ReactNode), not a ReactElement
9769 this._currentElement = text;
9770 this._stringText = '' + text;
9771 // ReactDOMComponentTree uses these:
9772 this._hostNode = null;
9773 this._hostParent = null;
9774
9775 // Properties
9776 this._domID = 0;
9777 this._mountIndex = 0;
9778 this._closingComment = null;
9779 this._commentNodes = null;
9780};
9781
9782_assign(ReactDOMTextComponent.prototype, {
9783
9784 /**
9785 * Creates the markup for this text node. This node is not intended to have
9786 * any features besides containing text content.
9787 *
9788 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
9789 * @return {string} Markup for this text node.
9790 * @internal
9791 */
9792 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
9793 if ("development" !== 'production') {
9794 var parentInfo;
9795 if (hostParent != null) {
9796 parentInfo = hostParent._ancestorInfo;
9797 } else if (hostContainerInfo != null) {
9798 parentInfo = hostContainerInfo._ancestorInfo;
9799 }
9800 if (parentInfo) {
9801 // parentInfo should always be present except for the top-level
9802 // component when server rendering
9803 validateDOMNesting(null, this._stringText, this, parentInfo);
9804 }
9805 }
9806
9807 var domID = hostContainerInfo._idCounter++;
9808 var openingValue = ' react-text: ' + domID + ' ';
9809 var closingValue = ' /react-text ';
9810 this._domID = domID;
9811 this._hostParent = hostParent;
9812 if (transaction.useCreateElement) {
9813 var ownerDocument = hostContainerInfo._ownerDocument;
9814 var openingComment = ownerDocument.createComment(openingValue);
9815 var closingComment = ownerDocument.createComment(closingValue);
9816 var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
9817 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
9818 if (this._stringText) {
9819 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
9820 }
9821 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
9822 ReactDOMComponentTree.precacheNode(this, openingComment);
9823 this._closingComment = closingComment;
9824 return lazyTree;
9825 } else {
9826 var escapedText = escapeTextContentForBrowser(this._stringText);
9827
9828 if (transaction.renderToStaticMarkup) {
9829 // Normally we'd wrap this between comment nodes for the reasons stated
9830 // above, but since this is a situation where React won't take over
9831 // (static pages), we can simply return the text as it is.
9832 return escapedText;
9833 }
9834
9835 return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
9836 }
9837 },
9838
9839 /**
9840 * Updates this component by updating the text content.
9841 *
9842 * @param {ReactText} nextText The next text content
9843 * @param {ReactReconcileTransaction} transaction
9844 * @internal
9845 */
9846 receiveComponent: function (nextText, transaction) {
9847 if (nextText !== this._currentElement) {
9848 this._currentElement = nextText;
9849 var nextStringText = '' + nextText;
9850 if (nextStringText !== this._stringText) {
9851 // TODO: Save this as pending props and use performUpdateIfNecessary
9852 // and/or updateComponent to do the actual update for consistency with
9853 // other component types?
9854 this._stringText = nextStringText;
9855 var commentNodes = this.getHostNode();
9856 DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
9857 }
9858 }
9859 },
9860
9861 getHostNode: function () {
9862 var hostNode = this._commentNodes;
9863 if (hostNode) {
9864 return hostNode;
9865 }
9866 if (!this._closingComment) {
9867 var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
9868 var node = openingComment.nextSibling;
9869 while (true) {
9870 !(node != null) ? "development" !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : _prodInvariant('67', this._domID) : void 0;
9871 if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
9872 this._closingComment = node;
9873 break;
9874 }
9875 node = node.nextSibling;
9876 }
9877 }
9878 hostNode = [this._hostNode, this._closingComment];
9879 this._commentNodes = hostNode;
9880 return hostNode;
9881 },
9882
9883 unmountComponent: function () {
9884 this._closingComment = null;
9885 this._commentNodes = null;
9886 ReactDOMComponentTree.uncacheNode(this);
9887 }
9888
9889});
9890
9891module.exports = ReactDOMTextComponent;
9892},{"135":135,"153":153,"161":161,"178":178,"188":188,"46":46,"7":7,"8":8}],59:[function(_dereq_,module,exports){
9893/**
9894 * Copyright 2013-present, Facebook, Inc.
9895 * All rights reserved.
9896 *
9897 * This source code is licensed under the BSD-style license found in the
9898 * LICENSE file in the root directory of this source tree. An additional grant
9899 * of patent rights can be found in the PATENTS file in the same directory.
9900 *
9901 * @providesModule ReactDOMTextarea
9902 */
9903
9904'use strict';
9905
9906var _prodInvariant = _dereq_(153),
9907 _assign = _dereq_(188);
9908
9909var DisabledInputUtils = _dereq_(14);
9910var LinkedValueUtils = _dereq_(25);
9911var ReactDOMComponentTree = _dereq_(46);
9912var ReactUpdates = _dereq_(107);
9913
9914var invariant = _dereq_(178);
9915var warning = _dereq_(187);
9916
9917var didWarnValueLink = false;
9918var didWarnValDefaultVal = false;
9919
9920function forceUpdateIfMounted() {
9921 if (this._rootNodeID) {
9922 // DOM component is still mounted; update
9923 ReactDOMTextarea.updateWrapper(this);
9924 }
9925}
9926
9927/**
9928 * Implements a <textarea> host component that allows setting `value`, and
9929 * `defaultValue`. This differs from the traditional DOM API because value is
9930 * usually set as PCDATA children.
9931 *
9932 * If `value` is not supplied (or null/undefined), user actions that affect the
9933 * value will trigger updates to the element.
9934 *
9935 * If `value` is supplied (and not null/undefined), the rendered element will
9936 * not trigger updates to the element. Instead, the `value` prop must change in
9937 * order for the rendered element to be updated.
9938 *
9939 * The rendered element will be initialized with an empty value, the prop
9940 * `defaultValue` if specified, or the children content (deprecated).
9941 */
9942var ReactDOMTextarea = {
9943 getHostProps: function (inst, props) {
9944 !(props.dangerouslySetInnerHTML == null) ? "development" !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : _prodInvariant('91') : void 0;
9945
9946 // Always set children to the same thing. In IE9, the selection range will
9947 // get reset if `textContent` is mutated. We could add a check in setTextContent
9948 // to only set the value if/when the value differs from the node value (which would
9949 // completely solve this IE9 bug), but Sebastian+Ben seemed to like this solution.
9950 // The value can be a boolean or object so that's why it's forced to be a string.
9951 var hostProps = _assign({}, DisabledInputUtils.getHostProps(inst, props), {
9952 value: undefined,
9953 defaultValue: undefined,
9954 children: '' + inst._wrapperState.initialValue,
9955 onChange: inst._wrapperState.onChange
9956 });
9957
9958 return hostProps;
9959 },
9960
9961 mountWrapper: function (inst, props) {
9962 if ("development" !== 'production') {
9963 LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
9964 if (props.valueLink !== undefined && !didWarnValueLink) {
9965 "development" !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;
9966 didWarnValueLink = true;
9967 }
9968 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
9969 "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;
9970 didWarnValDefaultVal = true;
9971 }
9972 }
9973
9974 var value = LinkedValueUtils.getValue(props);
9975 var initialValue = value;
9976
9977 // Only bother fetching default value if we're going to use it
9978 if (value == null) {
9979 var defaultValue = props.defaultValue;
9980 // TODO (yungsters): Remove support for children content in <textarea>.
9981 var children = props.children;
9982 if (children != null) {
9983 if ("development" !== 'production') {
9984 "development" !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
9985 }
9986 !(defaultValue == null) ? "development" !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : _prodInvariant('92') : void 0;
9987 if (Array.isArray(children)) {
9988 !(children.length <= 1) ? "development" !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : _prodInvariant('93') : void 0;
9989 children = children[0];
9990 }
9991
9992 defaultValue = '' + children;
9993 }
9994 if (defaultValue == null) {
9995 defaultValue = '';
9996 }
9997 initialValue = defaultValue;
9998 }
9999
10000 inst._wrapperState = {
10001 initialValue: '' + initialValue,
10002 listeners: null,
10003 onChange: _handleChange.bind(inst)
10004 };
10005 },
10006
10007 updateWrapper: function (inst) {
10008 var props = inst._currentElement.props;
10009
10010 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
10011 var value = LinkedValueUtils.getValue(props);
10012 if (value != null) {
10013 // Cast `value` to a string to ensure the value is set correctly. While
10014 // browsers typically do this as necessary, jsdom doesn't.
10015 var newValue = '' + value;
10016
10017 // To avoid side effects (such as losing text selection), only set value if changed
10018 if (newValue !== node.value) {
10019 node.value = newValue;
10020 }
10021 if (props.defaultValue == null) {
10022 node.defaultValue = newValue;
10023 }
10024 }
10025 if (props.defaultValue != null) {
10026 node.defaultValue = props.defaultValue;
10027 }
10028 },
10029
10030 postMountWrapper: function (inst) {
10031 // This is in postMount because we need access to the DOM node, which is not
10032 // available until after the component has mounted.
10033 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
10034
10035 // Warning: node.value may be the empty string at this point (IE11) if placeholder is set.
10036 node.value = node.textContent; // Detach value from defaultValue
10037 }
10038};
10039
10040function _handleChange(event) {
10041 var props = this._currentElement.props;
10042 var returnValue = LinkedValueUtils.executeOnChange(props, event);
10043 ReactUpdates.asap(forceUpdateIfMounted, this);
10044 return returnValue;
10045}
10046
10047module.exports = ReactDOMTextarea;
10048},{"107":107,"14":14,"153":153,"178":178,"187":187,"188":188,"25":25,"46":46}],60:[function(_dereq_,module,exports){
10049/**
10050 * Copyright 2015-present, Facebook, Inc.
10051 * All rights reserved.
10052 *
10053 * This source code is licensed under the BSD-style license found in the
10054 * LICENSE file in the root directory of this source tree. An additional grant
10055 * of patent rights can be found in the PATENTS file in the same directory.
10056 *
10057 * @providesModule ReactDOMTreeTraversal
10058 */
10059
10060'use strict';
10061
10062var _prodInvariant = _dereq_(153);
10063
10064var invariant = _dereq_(178);
10065
10066/**
10067 * Return the lowest common ancestor of A and B, or null if they are in
10068 * different trees.
10069 */
10070function getLowestCommonAncestor(instA, instB) {
10071 !('_hostNode' in instA) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
10072 !('_hostNode' in instB) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
10073
10074 var depthA = 0;
10075 for (var tempA = instA; tempA; tempA = tempA._hostParent) {
10076 depthA++;
10077 }
10078 var depthB = 0;
10079 for (var tempB = instB; tempB; tempB = tempB._hostParent) {
10080 depthB++;
10081 }
10082
10083 // If A is deeper, crawl up.
10084 while (depthA - depthB > 0) {
10085 instA = instA._hostParent;
10086 depthA--;
10087 }
10088
10089 // If B is deeper, crawl up.
10090 while (depthB - depthA > 0) {
10091 instB = instB._hostParent;
10092 depthB--;
10093 }
10094
10095 // Walk in lockstep until we find a match.
10096 var depth = depthA;
10097 while (depth--) {
10098 if (instA === instB) {
10099 return instA;
10100 }
10101 instA = instA._hostParent;
10102 instB = instB._hostParent;
10103 }
10104 return null;
10105}
10106
10107/**
10108 * Return if A is an ancestor of B.
10109 */
10110function isAncestor(instA, instB) {
10111 !('_hostNode' in instA) ? "development" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
10112 !('_hostNode' in instB) ? "development" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
10113
10114 while (instB) {
10115 if (instB === instA) {
10116 return true;
10117 }
10118 instB = instB._hostParent;
10119 }
10120 return false;
10121}
10122
10123/**
10124 * Return the parent instance of the passed-in instance.
10125 */
10126function getParentInstance(inst) {
10127 !('_hostNode' in inst) ? "development" !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : _prodInvariant('36') : void 0;
10128
10129 return inst._hostParent;
10130}
10131
10132/**
10133 * Simulates the traversal of a two-phase, capture/bubble event dispatch.
10134 */
10135function traverseTwoPhase(inst, fn, arg) {
10136 var path = [];
10137 while (inst) {
10138 path.push(inst);
10139 inst = inst._hostParent;
10140 }
10141 var i;
10142 for (i = path.length; i-- > 0;) {
10143 fn(path[i], false, arg);
10144 }
10145 for (i = 0; i < path.length; i++) {
10146 fn(path[i], true, arg);
10147 }
10148}
10149
10150/**
10151 * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
10152 * should would receive a `mouseEnter` or `mouseLeave` event.
10153 *
10154 * Does not invoke the callback on the nearest common ancestor because nothing
10155 * "entered" or "left" that element.
10156 */
10157function traverseEnterLeave(from, to, fn, argFrom, argTo) {
10158 var common = from && to ? getLowestCommonAncestor(from, to) : null;
10159 var pathFrom = [];
10160 while (from && from !== common) {
10161 pathFrom.push(from);
10162 from = from._hostParent;
10163 }
10164 var pathTo = [];
10165 while (to && to !== common) {
10166 pathTo.push(to);
10167 to = to._hostParent;
10168 }
10169 var i;
10170 for (i = 0; i < pathFrom.length; i++) {
10171 fn(pathFrom[i], true, argFrom);
10172 }
10173 for (i = pathTo.length; i-- > 0;) {
10174 fn(pathTo[i], false, argTo);
10175 }
10176}
10177
10178module.exports = {
10179 isAncestor: isAncestor,
10180 getLowestCommonAncestor: getLowestCommonAncestor,
10181 getParentInstance: getParentInstance,
10182 traverseTwoPhase: traverseTwoPhase,
10183 traverseEnterLeave: traverseEnterLeave
10184};
10185},{"153":153,"178":178}],61:[function(_dereq_,module,exports){
10186/**
10187 * Copyright 2013-present, Facebook, Inc.
10188 * All rights reserved.
10189 *
10190 * This source code is licensed under the BSD-style license found in the
10191 * LICENSE file in the root directory of this source tree. An additional grant
10192 * of patent rights can be found in the PATENTS file in the same directory.
10193 *
10194 * @providesModule ReactDOMUnknownPropertyHook
10195 */
10196
10197'use strict';
10198
10199var DOMProperty = _dereq_(10);
10200var EventPluginRegistry = _dereq_(18);
10201var ReactComponentTreeHook = _dereq_(38);
10202
10203var warning = _dereq_(187);
10204
10205if ("development" !== 'production') {
10206 var reactProps = {
10207 children: true,
10208 dangerouslySetInnerHTML: true,
10209 key: true,
10210 ref: true,
10211
10212 autoFocus: true,
10213 defaultValue: true,
10214 valueLink: true,
10215 defaultChecked: true,
10216 checkedLink: true,
10217 innerHTML: true,
10218 suppressContentEditableWarning: true,
10219 onFocusIn: true,
10220 onFocusOut: true
10221 };
10222 var warnedProperties = {};
10223
10224 var validateProperty = function (tagName, name, debugID) {
10225 if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) {
10226 return true;
10227 }
10228 if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) {
10229 return true;
10230 }
10231 if (EventPluginRegistry.registrationNameModules.hasOwnProperty(name)) {
10232 return true;
10233 }
10234 warnedProperties[name] = true;
10235 var lowerCasedName = name.toLowerCase();
10236
10237 // data-* attributes should be lowercase; suggest the lowercase version
10238 var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null;
10239
10240 var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null;
10241
10242 if (standardName != null) {
10243 "development" !== 'production' ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
10244 return true;
10245 } else if (registrationName != null) {
10246 "development" !== 'production' ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
10247 return true;
10248 } else {
10249 // We were unable to guess which prop the user intended.
10250 // It is likely that the user was just blindly spreading/forwarding props
10251 // Components should be careful to only render valid props/attributes.
10252 // Warning will be invoked in warnUnknownProperties to allow grouping.
10253 return false;
10254 }
10255 };
10256}
10257
10258var warnUnknownProperties = function (debugID, element) {
10259 var unknownProps = [];
10260 for (var key in element.props) {
10261 var isValid = validateProperty(element.type, key, debugID);
10262 if (!isValid) {
10263 unknownProps.push(key);
10264 }
10265 }
10266
10267 var unknownPropString = unknownProps.map(function (prop) {
10268 return '`' + prop + '`';
10269 }).join(', ');
10270
10271 if (unknownProps.length === 1) {
10272 "development" !== 'production' ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
10273 } else if (unknownProps.length > 1) {
10274 "development" !== 'production' ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0;
10275 }
10276};
10277
10278function handleElement(debugID, element) {
10279 if (element == null || typeof element.type !== 'string') {
10280 return;
10281 }
10282 if (element.type.indexOf('-') >= 0 || element.props.is) {
10283 return;
10284 }
10285 warnUnknownProperties(debugID, element);
10286}
10287
10288var ReactDOMUnknownPropertyHook = {
10289 onBeforeMountComponent: function (debugID, element) {
10290 handleElement(debugID, element);
10291 },
10292 onBeforeUpdateComponent: function (debugID, element) {
10293 handleElement(debugID, element);
10294 }
10295};
10296
10297module.exports = ReactDOMUnknownPropertyHook;
10298},{"10":10,"18":18,"187":187,"38":38}],62:[function(_dereq_,module,exports){
10299/**
10300 * Copyright 2016-present, Facebook, Inc.
10301 * All rights reserved.
10302 *
10303 * This source code is licensed under the BSD-style license found in the
10304 * LICENSE file in the root directory of this source tree. An additional grant
10305 * of patent rights can be found in the PATENTS file in the same directory.
10306 *
10307 * @providesModule ReactDebugTool
10308 */
10309
10310'use strict';
10311
10312var ReactInvalidSetStateWarningHook = _dereq_(79);
10313var ReactHostOperationHistoryHook = _dereq_(74);
10314var ReactComponentTreeHook = _dereq_(38);
10315var ReactChildrenMutationWarningHook = _dereq_(33);
10316var ExecutionEnvironment = _dereq_(164);
10317
10318var performanceNow = _dereq_(185);
10319var warning = _dereq_(187);
10320
10321var hooks = [];
10322var didHookThrowForEvent = {};
10323
10324function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
10325 try {
10326 fn.call(context, arg1, arg2, arg3, arg4, arg5);
10327 } catch (e) {
10328 "development" !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0;
10329 didHookThrowForEvent[event] = true;
10330 }
10331}
10332
10333function emitEvent(event, arg1, arg2, arg3, arg4, arg5) {
10334 for (var i = 0; i < hooks.length; i++) {
10335 var hook = hooks[i];
10336 var fn = hook[event];
10337 if (fn) {
10338 callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5);
10339 }
10340 }
10341}
10342
10343var isProfiling = false;
10344var flushHistory = [];
10345var lifeCycleTimerStack = [];
10346var currentFlushNesting = 0;
10347var currentFlushMeasurements = null;
10348var currentFlushStartTime = null;
10349var currentTimerDebugID = null;
10350var currentTimerStartTime = null;
10351var currentTimerNestedFlushDuration = null;
10352var currentTimerType = null;
10353
10354var lifeCycleTimerHasWarned = false;
10355
10356function clearHistory() {
10357 ReactComponentTreeHook.purgeUnmountedComponents();
10358 ReactHostOperationHistoryHook.clearHistory();
10359}
10360
10361function getTreeSnapshot(registeredIDs) {
10362 return registeredIDs.reduce(function (tree, id) {
10363 var ownerID = ReactComponentTreeHook.getOwnerID(id);
10364 var parentID = ReactComponentTreeHook.getParentID(id);
10365 tree[id] = {
10366 displayName: ReactComponentTreeHook.getDisplayName(id),
10367 text: ReactComponentTreeHook.getText(id),
10368 updateCount: ReactComponentTreeHook.getUpdateCount(id),
10369 childIDs: ReactComponentTreeHook.getChildIDs(id),
10370 // Text nodes don't have owners but this is close enough.
10371 ownerID: ownerID || ReactComponentTreeHook.getOwnerID(parentID),
10372 parentID: parentID
10373 };
10374 return tree;
10375 }, {});
10376}
10377
10378function resetMeasurements() {
10379 var previousStartTime = currentFlushStartTime;
10380 var previousMeasurements = currentFlushMeasurements || [];
10381 var previousOperations = ReactHostOperationHistoryHook.getHistory();
10382
10383 if (currentFlushNesting === 0) {
10384 currentFlushStartTime = null;
10385 currentFlushMeasurements = null;
10386 clearHistory();
10387 return;
10388 }
10389
10390 if (previousMeasurements.length || previousOperations.length) {
10391 var registeredIDs = ReactComponentTreeHook.getRegisteredIDs();
10392 flushHistory.push({
10393 duration: performanceNow() - previousStartTime,
10394 measurements: previousMeasurements || [],
10395 operations: previousOperations || [],
10396 treeSnapshot: getTreeSnapshot(registeredIDs)
10397 });
10398 }
10399
10400 clearHistory();
10401 currentFlushStartTime = performanceNow();
10402 currentFlushMeasurements = [];
10403}
10404
10405function checkDebugID(debugID) {
10406 var allowRoot = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
10407
10408 if (allowRoot && debugID === 0) {
10409 return;
10410 }
10411 if (!debugID) {
10412 "development" !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;
10413 }
10414}
10415
10416function beginLifeCycleTimer(debugID, timerType) {
10417 if (currentFlushNesting === 0) {
10418 return;
10419 }
10420 if (currentTimerType && !lifeCycleTimerHasWarned) {
10421 "development" !== 'production' ? warning(false, '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;
10422 lifeCycleTimerHasWarned = true;
10423 }
10424 currentTimerStartTime = performanceNow();
10425 currentTimerNestedFlushDuration = 0;
10426 currentTimerDebugID = debugID;
10427 currentTimerType = timerType;
10428}
10429
10430function endLifeCycleTimer(debugID, timerType) {
10431 if (currentFlushNesting === 0) {
10432 return;
10433 }
10434 if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) {
10435 "development" !== 'production' ? warning(false, '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;
10436 lifeCycleTimerHasWarned = true;
10437 }
10438 if (isProfiling) {
10439 currentFlushMeasurements.push({
10440 timerType: timerType,
10441 instanceID: debugID,
10442 duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration
10443 });
10444 }
10445 currentTimerStartTime = null;
10446 currentTimerNestedFlushDuration = null;
10447 currentTimerDebugID = null;
10448 currentTimerType = null;
10449}
10450
10451function pauseCurrentLifeCycleTimer() {
10452 var currentTimer = {
10453 startTime: currentTimerStartTime,
10454 nestedFlushStartTime: performanceNow(),
10455 debugID: currentTimerDebugID,
10456 timerType: currentTimerType
10457 };
10458 lifeCycleTimerStack.push(currentTimer);
10459 currentTimerStartTime = null;
10460 currentTimerNestedFlushDuration = null;
10461 currentTimerDebugID = null;
10462 currentTimerType = null;
10463}
10464
10465function resumeCurrentLifeCycleTimer() {
10466 var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop();
10467
10468 var startTime = _lifeCycleTimerStack$.startTime;
10469 var nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime;
10470 var debugID = _lifeCycleTimerStack$.debugID;
10471 var timerType = _lifeCycleTimerStack$.timerType;
10472
10473 var nestedFlushDuration = performanceNow() - nestedFlushStartTime;
10474 currentTimerStartTime = startTime;
10475 currentTimerNestedFlushDuration += nestedFlushDuration;
10476 currentTimerDebugID = debugID;
10477 currentTimerType = timerType;
10478}
10479
10480var ReactDebugTool = {
10481 addHook: function (hook) {
10482 hooks.push(hook);
10483 },
10484 removeHook: function (hook) {
10485 for (var i = 0; i < hooks.length; i++) {
10486 if (hooks[i] === hook) {
10487 hooks.splice(i, 1);
10488 i--;
10489 }
10490 }
10491 },
10492 isProfiling: function () {
10493 return isProfiling;
10494 },
10495 beginProfiling: function () {
10496 if (isProfiling) {
10497 return;
10498 }
10499
10500 isProfiling = true;
10501 flushHistory.length = 0;
10502 resetMeasurements();
10503 ReactDebugTool.addHook(ReactHostOperationHistoryHook);
10504 },
10505 endProfiling: function () {
10506 if (!isProfiling) {
10507 return;
10508 }
10509
10510 isProfiling = false;
10511 resetMeasurements();
10512 ReactDebugTool.removeHook(ReactHostOperationHistoryHook);
10513 },
10514 getFlushHistory: function () {
10515 return flushHistory;
10516 },
10517 onBeginFlush: function () {
10518 currentFlushNesting++;
10519 resetMeasurements();
10520 pauseCurrentLifeCycleTimer();
10521 emitEvent('onBeginFlush');
10522 },
10523 onEndFlush: function () {
10524 resetMeasurements();
10525 currentFlushNesting--;
10526 resumeCurrentLifeCycleTimer();
10527 emitEvent('onEndFlush');
10528 },
10529 onBeginLifeCycleTimer: function (debugID, timerType) {
10530 checkDebugID(debugID);
10531 emitEvent('onBeginLifeCycleTimer', debugID, timerType);
10532 beginLifeCycleTimer(debugID, timerType);
10533 },
10534 onEndLifeCycleTimer: function (debugID, timerType) {
10535 checkDebugID(debugID);
10536 endLifeCycleTimer(debugID, timerType);
10537 emitEvent('onEndLifeCycleTimer', debugID, timerType);
10538 },
10539 onBeginProcessingChildContext: function () {
10540 emitEvent('onBeginProcessingChildContext');
10541 },
10542 onEndProcessingChildContext: function () {
10543 emitEvent('onEndProcessingChildContext');
10544 },
10545 onHostOperation: function (debugID, type, payload) {
10546 checkDebugID(debugID);
10547 emitEvent('onHostOperation', debugID, type, payload);
10548 },
10549 onSetState: function () {
10550 emitEvent('onSetState');
10551 },
10552 onSetChildren: function (debugID, childDebugIDs) {
10553 checkDebugID(debugID);
10554 childDebugIDs.forEach(checkDebugID);
10555 emitEvent('onSetChildren', debugID, childDebugIDs);
10556 },
10557 onBeforeMountComponent: function (debugID, element, parentDebugID) {
10558 checkDebugID(debugID);
10559 checkDebugID(parentDebugID, true);
10560 emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);
10561 },
10562 onMountComponent: function (debugID) {
10563 checkDebugID(debugID);
10564 emitEvent('onMountComponent', debugID);
10565 },
10566 onBeforeUpdateComponent: function (debugID, element) {
10567 checkDebugID(debugID);
10568 emitEvent('onBeforeUpdateComponent', debugID, element);
10569 },
10570 onUpdateComponent: function (debugID) {
10571 checkDebugID(debugID);
10572 emitEvent('onUpdateComponent', debugID);
10573 },
10574 onBeforeUnmountComponent: function (debugID) {
10575 checkDebugID(debugID);
10576 emitEvent('onBeforeUnmountComponent', debugID);
10577 },
10578 onUnmountComponent: function (debugID) {
10579 checkDebugID(debugID);
10580 emitEvent('onUnmountComponent', debugID);
10581 },
10582 onTestEvent: function () {
10583 emitEvent('onTestEvent');
10584 }
10585};
10586
10587// TODO remove these when RN/www gets updated
10588ReactDebugTool.addDevtool = ReactDebugTool.addHook;
10589ReactDebugTool.removeDevtool = ReactDebugTool.removeHook;
10590
10591ReactDebugTool.addHook(ReactInvalidSetStateWarningHook);
10592ReactDebugTool.addHook(ReactComponentTreeHook);
10593ReactDebugTool.addHook(ReactChildrenMutationWarningHook);
10594var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
10595if (/[?&]react_perf\b/.test(url)) {
10596 ReactDebugTool.beginProfiling();
10597}
10598
10599module.exports = ReactDebugTool;
10600},{"164":164,"185":185,"187":187,"33":33,"38":38,"74":74,"79":79}],63:[function(_dereq_,module,exports){
10601/**
10602 * Copyright 2013-present, Facebook, Inc.
10603 * All rights reserved.
10604 *
10605 * This source code is licensed under the BSD-style license found in the
10606 * LICENSE file in the root directory of this source tree. An additional grant
10607 * of patent rights can be found in the PATENTS file in the same directory.
10608 *
10609 * @providesModule ReactDefaultBatchingStrategy
10610 */
10611
10612'use strict';
10613
10614var _assign = _dereq_(188);
10615
10616var ReactUpdates = _dereq_(107);
10617var Transaction = _dereq_(127);
10618
10619var emptyFunction = _dereq_(170);
10620
10621var RESET_BATCHED_UPDATES = {
10622 initialize: emptyFunction,
10623 close: function () {
10624 ReactDefaultBatchingStrategy.isBatchingUpdates = false;
10625 }
10626};
10627
10628var FLUSH_BATCHED_UPDATES = {
10629 initialize: emptyFunction,
10630 close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
10631};
10632
10633var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
10634
10635function ReactDefaultBatchingStrategyTransaction() {
10636 this.reinitializeTransaction();
10637}
10638
10639_assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction.Mixin, {
10640 getTransactionWrappers: function () {
10641 return TRANSACTION_WRAPPERS;
10642 }
10643});
10644
10645var transaction = new ReactDefaultBatchingStrategyTransaction();
10646
10647var ReactDefaultBatchingStrategy = {
10648 isBatchingUpdates: false,
10649
10650 /**
10651 * Call the provided function in a context within which calls to `setState`
10652 * and friends are batched such that components aren't updated unnecessarily.
10653 */
10654 batchedUpdates: function (callback, a, b, c, d, e) {
10655 var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
10656
10657 ReactDefaultBatchingStrategy.isBatchingUpdates = true;
10658
10659 // The code is written this way to avoid extra allocations
10660 if (alreadyBatchingUpdates) {
10661 callback(a, b, c, d, e);
10662 } else {
10663 transaction.perform(callback, null, a, b, c, d, e);
10664 }
10665 }
10666};
10667
10668module.exports = ReactDefaultBatchingStrategy;
10669},{"107":107,"127":127,"170":170,"188":188}],64:[function(_dereq_,module,exports){
10670/**
10671 * Copyright 2013-present, Facebook, Inc.
10672 * All rights reserved.
10673 *
10674 * This source code is licensed under the BSD-style license found in the
10675 * LICENSE file in the root directory of this source tree. An additional grant
10676 * of patent rights can be found in the PATENTS file in the same directory.
10677 *
10678 * @providesModule ReactDefaultInjection
10679 */
10680
10681'use strict';
10682
10683var BeforeInputEventPlugin = _dereq_(2);
10684var ChangeEventPlugin = _dereq_(6);
10685var DefaultEventPluginOrder = _dereq_(13);
10686var EnterLeaveEventPlugin = _dereq_(15);
10687var HTMLDOMPropertyConfig = _dereq_(22);
10688var ReactComponentBrowserEnvironment = _dereq_(36);
10689var ReactDOMComponent = _dereq_(44);
10690var ReactDOMComponentTree = _dereq_(46);
10691var ReactDOMEmptyComponent = _dereq_(48);
10692var ReactDOMTreeTraversal = _dereq_(60);
10693var ReactDOMTextComponent = _dereq_(58);
10694var ReactDefaultBatchingStrategy = _dereq_(63);
10695var ReactEventListener = _dereq_(70);
10696var ReactInjection = _dereq_(75);
10697var ReactReconcileTransaction = _dereq_(94);
10698var SVGDOMPropertyConfig = _dereq_(111);
10699var SelectEventPlugin = _dereq_(112);
10700var SimpleEventPlugin = _dereq_(113);
10701
10702var alreadyInjected = false;
10703
10704function inject() {
10705 if (alreadyInjected) {
10706 // TODO: This is currently true because these injections are shared between
10707 // the client and the server package. They should be built independently
10708 // and not share any injection state. Then this problem will be solved.
10709 return;
10710 }
10711 alreadyInjected = true;
10712
10713 ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
10714
10715 /**
10716 * Inject modules for resolving DOM hierarchy and plugin ordering.
10717 */
10718 ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
10719 ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
10720 ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
10721
10722 /**
10723 * Some important event plugins included by default (without having to require
10724 * them).
10725 */
10726 ReactInjection.EventPluginHub.injectEventPluginsByName({
10727 SimpleEventPlugin: SimpleEventPlugin,
10728 EnterLeaveEventPlugin: EnterLeaveEventPlugin,
10729 ChangeEventPlugin: ChangeEventPlugin,
10730 SelectEventPlugin: SelectEventPlugin,
10731 BeforeInputEventPlugin: BeforeInputEventPlugin
10732 });
10733
10734 ReactInjection.HostComponent.injectGenericComponentClass(ReactDOMComponent);
10735
10736 ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent);
10737
10738 ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
10739 ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
10740
10741 ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
10742 return new ReactDOMEmptyComponent(instantiate);
10743 });
10744
10745 ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
10746 ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
10747
10748 ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
10749}
10750
10751module.exports = {
10752 inject: inject
10753};
10754},{"111":111,"112":112,"113":113,"13":13,"15":15,"2":2,"22":22,"36":36,"44":44,"46":46,"48":48,"58":58,"6":6,"60":60,"63":63,"70":70,"75":75,"94":94}],65:[function(_dereq_,module,exports){
10755/**
10756 * Copyright 2014-present, Facebook, Inc.
10757 * All rights reserved.
10758 *
10759 * This source code is licensed under the BSD-style license found in the
10760 * LICENSE file in the root directory of this source tree. An additional grant
10761 * of patent rights can be found in the PATENTS file in the same directory.
10762 *
10763 * @providesModule ReactElement
10764 */
10765
10766'use strict';
10767
10768var _assign = _dereq_(188);
10769
10770var ReactCurrentOwner = _dereq_(41);
10771
10772var warning = _dereq_(187);
10773var canDefineProperty = _dereq_(131);
10774var hasOwnProperty = Object.prototype.hasOwnProperty;
10775
10776// The Symbol used to tag the ReactElement type. If there is no native Symbol
10777// nor polyfill, then a plain number is used for performance.
10778var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
10779
10780var RESERVED_PROPS = {
10781 key: true,
10782 ref: true,
10783 __self: true,
10784 __source: true
10785};
10786
10787var specialPropKeyWarningShown, specialPropRefWarningShown;
10788
10789function hasValidRef(config) {
10790 if ("development" !== 'production') {
10791 if (hasOwnProperty.call(config, 'ref')) {
10792 var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
10793 if (getter && getter.isReactWarning) {
10794 return false;
10795 }
10796 }
10797 }
10798 return config.ref !== undefined;
10799}
10800
10801function hasValidKey(config) {
10802 if ("development" !== 'production') {
10803 if (hasOwnProperty.call(config, 'key')) {
10804 var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
10805 if (getter && getter.isReactWarning) {
10806 return false;
10807 }
10808 }
10809 }
10810 return config.key !== undefined;
10811}
10812
10813function defineKeyPropWarningGetter(props, displayName) {
10814 var warnAboutAccessingKey = function () {
10815 if (!specialPropKeyWarningShown) {
10816 specialPropKeyWarningShown = true;
10817 "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)', displayName) : void 0;
10818 }
10819 };
10820 warnAboutAccessingKey.isReactWarning = true;
10821 Object.defineProperty(props, 'key', {
10822 get: warnAboutAccessingKey,
10823 configurable: true
10824 });
10825}
10826
10827function defineRefPropWarningGetter(props, displayName) {
10828 var warnAboutAccessingRef = function () {
10829 if (!specialPropRefWarningShown) {
10830 specialPropRefWarningShown = true;
10831 "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)', displayName) : void 0;
10832 }
10833 };
10834 warnAboutAccessingRef.isReactWarning = true;
10835 Object.defineProperty(props, 'ref', {
10836 get: warnAboutAccessingRef,
10837 configurable: true
10838 });
10839}
10840
10841/**
10842 * Factory method to create a new React element. This no longer adheres to
10843 * the class pattern, so do not use new to call it. Also, no instanceof check
10844 * will work. Instead test $$typeof field against Symbol.for('react.element') to check
10845 * if something is a React Element.
10846 *
10847 * @param {*} type
10848 * @param {*} key
10849 * @param {string|object} ref
10850 * @param {*} self A *temporary* helper to detect places where `this` is
10851 * different from the `owner` when React.createElement is called, so that we
10852 * can warn. We want to get rid of owner and replace string `ref`s with arrow
10853 * functions, and as long as `this` and owner are the same, there will be no
10854 * change in behavior.
10855 * @param {*} source An annotation object (added by a transpiler or otherwise)
10856 * indicating filename, line number, and/or other information.
10857 * @param {*} owner
10858 * @param {*} props
10859 * @internal
10860 */
10861var ReactElement = function (type, key, ref, self, source, owner, props) {
10862 var element = {
10863 // This tag allow us to uniquely identify this as a React Element
10864 $$typeof: REACT_ELEMENT_TYPE,
10865
10866 // Built-in properties that belong on the element
10867 type: type,
10868 key: key,
10869 ref: ref,
10870 props: props,
10871
10872 // Record the component responsible for creating this element.
10873 _owner: owner
10874 };
10875
10876 if ("development" !== 'production') {
10877 // The validation flag is currently mutative. We put it on
10878 // an external backing store so that we can freeze the whole object.
10879 // This can be replaced with a WeakMap once they are implemented in
10880 // commonly used development environments.
10881 element._store = {};
10882 var shadowChildren = Array.isArray(props.children) ? props.children.slice(0) : props.children;
10883
10884 // To make comparing ReactElements easier for testing purposes, we make
10885 // the validation flag non-enumerable (where possible, which should
10886 // include every environment we run tests in), so the test framework
10887 // ignores it.
10888 if (canDefineProperty) {
10889 Object.defineProperty(element._store, 'validated', {
10890 configurable: false,
10891 enumerable: false,
10892 writable: true,
10893 value: false
10894 });
10895 // self and source are DEV only properties.
10896 Object.defineProperty(element, '_self', {
10897 configurable: false,
10898 enumerable: false,
10899 writable: false,
10900 value: self
10901 });
10902 Object.defineProperty(element, '_shadowChildren', {
10903 configurable: false,
10904 enumerable: false,
10905 writable: false,
10906 value: shadowChildren
10907 });
10908 // Two elements created in two different places should be considered
10909 // equal for testing purposes and therefore we hide it from enumeration.
10910 Object.defineProperty(element, '_source', {
10911 configurable: false,
10912 enumerable: false,
10913 writable: false,
10914 value: source
10915 });
10916 } else {
10917 element._store.validated = false;
10918 element._self = self;
10919 element._shadowChildren = shadowChildren;
10920 element._source = source;
10921 }
10922 if (Object.freeze) {
10923 Object.freeze(element.props);
10924 Object.freeze(element);
10925 }
10926 }
10927
10928 return element;
10929};
10930
10931/**
10932 * Create and return a new ReactElement of the given type.
10933 * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement
10934 */
10935ReactElement.createElement = function (type, config, children) {
10936 var propName;
10937
10938 // Reserved names are extracted
10939 var props = {};
10940
10941 var key = null;
10942 var ref = null;
10943 var self = null;
10944 var source = null;
10945
10946 if (config != null) {
10947 if (hasValidRef(config)) {
10948 ref = config.ref;
10949 }
10950 if (hasValidKey(config)) {
10951 key = '' + config.key;
10952 }
10953
10954 self = config.__self === undefined ? null : config.__self;
10955 source = config.__source === undefined ? null : config.__source;
10956 // Remaining properties are added to a new props object
10957 for (propName in config) {
10958 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
10959 props[propName] = config[propName];
10960 }
10961 }
10962 }
10963
10964 // Children can be more than one argument, and those are transferred onto
10965 // the newly allocated props object.
10966 var childrenLength = arguments.length - 2;
10967 if (childrenLength === 1) {
10968 props.children = children;
10969 } else if (childrenLength > 1) {
10970 var childArray = Array(childrenLength);
10971 for (var i = 0; i < childrenLength; i++) {
10972 childArray[i] = arguments[i + 2];
10973 }
10974 props.children = childArray;
10975 }
10976
10977 // Resolve default props
10978 if (type && type.defaultProps) {
10979 var defaultProps = type.defaultProps;
10980 for (propName in defaultProps) {
10981 if (props[propName] === undefined) {
10982 props[propName] = defaultProps[propName];
10983 }
10984 }
10985 }
10986 if ("development" !== 'production') {
10987 if (key || ref) {
10988 if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
10989 var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
10990 if (key) {
10991 defineKeyPropWarningGetter(props, displayName);
10992 }
10993 if (ref) {
10994 defineRefPropWarningGetter(props, displayName);
10995 }
10996 }
10997 }
10998 }
10999 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
11000};
11001
11002/**
11003 * Return a function that produces ReactElements of a given type.
11004 * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory
11005 */
11006ReactElement.createFactory = function (type) {
11007 var factory = ReactElement.createElement.bind(null, type);
11008 // Expose the type on the factory and the prototype so that it can be
11009 // easily accessed on elements. E.g. `<Foo />.type === Foo`.
11010 // This should not be named `constructor` since this may not be the function
11011 // that created the element, and it may not even be a constructor.
11012 // Legacy hook TODO: Warn if this is accessed
11013 factory.type = type;
11014 return factory;
11015};
11016
11017ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
11018 var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
11019
11020 return newElement;
11021};
11022
11023/**
11024 * Clone and return a new ReactElement using element as the starting point.
11025 * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement
11026 */
11027ReactElement.cloneElement = function (element, config, children) {
11028 var propName;
11029
11030 // Original props are copied
11031 var props = _assign({}, element.props);
11032
11033 // Reserved names are extracted
11034 var key = element.key;
11035 var ref = element.ref;
11036 // Self is preserved since the owner is preserved.
11037 var self = element._self;
11038 // Source is preserved since cloneElement is unlikely to be targeted by a
11039 // transpiler, and the original source is probably a better indicator of the
11040 // true owner.
11041 var source = element._source;
11042
11043 // Owner will be preserved, unless ref is overridden
11044 var owner = element._owner;
11045
11046 if (config != null) {
11047 if (hasValidRef(config)) {
11048 // Silently steal the ref from the parent.
11049 ref = config.ref;
11050 owner = ReactCurrentOwner.current;
11051 }
11052 if (hasValidKey(config)) {
11053 key = '' + config.key;
11054 }
11055
11056 // Remaining properties override existing props
11057 var defaultProps;
11058 if (element.type && element.type.defaultProps) {
11059 defaultProps = element.type.defaultProps;
11060 }
11061 for (propName in config) {
11062 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
11063 if (config[propName] === undefined && defaultProps !== undefined) {
11064 // Resolve default props
11065 props[propName] = defaultProps[propName];
11066 } else {
11067 props[propName] = config[propName];
11068 }
11069 }
11070 }
11071 }
11072
11073 // Children can be more than one argument, and those are transferred onto
11074 // the newly allocated props object.
11075 var childrenLength = arguments.length - 2;
11076 if (childrenLength === 1) {
11077 props.children = children;
11078 } else if (childrenLength > 1) {
11079 var childArray = Array(childrenLength);
11080 for (var i = 0; i < childrenLength; i++) {
11081 childArray[i] = arguments[i + 2];
11082 }
11083 props.children = childArray;
11084 }
11085
11086 return ReactElement(element.type, key, ref, self, source, owner, props);
11087};
11088
11089/**
11090 * Verifies the object is a ReactElement.
11091 * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement
11092 * @param {?object} object
11093 * @return {boolean} True if `object` is a valid component.
11094 * @final
11095 */
11096ReactElement.isValidElement = function (object) {
11097 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
11098};
11099
11100ReactElement.REACT_ELEMENT_TYPE = REACT_ELEMENT_TYPE;
11101
11102module.exports = ReactElement;
11103},{"131":131,"187":187,"188":188,"41":41}],66:[function(_dereq_,module,exports){
11104/**
11105 * Copyright 2014-present, Facebook, Inc.
11106 * All rights reserved.
11107 *
11108 * This source code is licensed under the BSD-style license found in the
11109 * LICENSE file in the root directory of this source tree. An additional grant
11110 * of patent rights can be found in the PATENTS file in the same directory.
11111 *
11112 * @providesModule ReactElementValidator
11113 */
11114
11115/**
11116 * ReactElementValidator provides a wrapper around a element factory
11117 * which validates the props passed to the element. This is intended to be
11118 * used only in DEV and could be replaced by a static type checker for languages
11119 * that support it.
11120 */
11121
11122'use strict';
11123
11124var ReactCurrentOwner = _dereq_(41);
11125var ReactComponentTreeHook = _dereq_(38);
11126var ReactElement = _dereq_(65);
11127var ReactPropTypeLocations = _dereq_(90);
11128
11129var checkReactTypeSpec = _dereq_(132);
11130
11131var canDefineProperty = _dereq_(131);
11132var getIteratorFn = _dereq_(144);
11133var warning = _dereq_(187);
11134
11135function getDeclarationErrorAddendum() {
11136 if (ReactCurrentOwner.current) {
11137 var name = ReactCurrentOwner.current.getName();
11138 if (name) {
11139 return ' Check the render method of `' + name + '`.';
11140 }
11141 }
11142 return '';
11143}
11144
11145/**
11146 * Warn if there's no key explicitly set on dynamic arrays of children or
11147 * object keys are not valid. This allows us to keep track of children between
11148 * updates.
11149 */
11150var ownerHasKeyUseWarning = {};
11151
11152function getCurrentComponentErrorInfo(parentType) {
11153 var info = getDeclarationErrorAddendum();
11154
11155 if (!info) {
11156 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
11157 if (parentName) {
11158 info = ' Check the top-level render call using <' + parentName + '>.';
11159 }
11160 }
11161 return info;
11162}
11163
11164/**
11165 * Warn if the element doesn't have an explicit key assigned to it.
11166 * This element is in an array. The array could grow and shrink or be
11167 * reordered. All children that haven't already been validated are required to
11168 * have a "key" property assigned to it. Error statuses are cached so a warning
11169 * will only be shown once.
11170 *
11171 * @internal
11172 * @param {ReactElement} element Element that requires a key.
11173 * @param {*} parentType element's parent's type.
11174 */
11175function validateExplicitKey(element, parentType) {
11176 if (!element._store || element._store.validated || element.key != null) {
11177 return;
11178 }
11179 element._store.validated = true;
11180
11181 var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
11182
11183 var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
11184 if (memoizer[currentComponentErrorInfo]) {
11185 return;
11186 }
11187 memoizer[currentComponentErrorInfo] = true;
11188
11189 // Usually the current owner is the offender, but if it accepts children as a
11190 // property, it may be the creator of the child that's responsible for
11191 // assigning it a key.
11192 var childOwner = '';
11193 if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
11194 // Give the component that originally created this child.
11195 childOwner = ' It was passed a child from ' + element._owner.getName() + '.';
11196 }
11197
11198 "development" !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0;
11199}
11200
11201/**
11202 * Ensure that every element either is passed in a static location, in an
11203 * array with an explicit keys property defined, or in an object literal
11204 * with valid key property.
11205 *
11206 * @internal
11207 * @param {ReactNode} node Statically passed child of any type.
11208 * @param {*} parentType node's parent's type.
11209 */
11210function validateChildKeys(node, parentType) {
11211 if (typeof node !== 'object') {
11212 return;
11213 }
11214 if (Array.isArray(node)) {
11215 for (var i = 0; i < node.length; i++) {
11216 var child = node[i];
11217 if (ReactElement.isValidElement(child)) {
11218 validateExplicitKey(child, parentType);
11219 }
11220 }
11221 } else if (ReactElement.isValidElement(node)) {
11222 // This element was passed in a valid location.
11223 if (node._store) {
11224 node._store.validated = true;
11225 }
11226 } else if (node) {
11227 var iteratorFn = getIteratorFn(node);
11228 // Entry iterators provide implicit keys.
11229 if (iteratorFn) {
11230 if (iteratorFn !== node.entries) {
11231 var iterator = iteratorFn.call(node);
11232 var step;
11233 while (!(step = iterator.next()).done) {
11234 if (ReactElement.isValidElement(step.value)) {
11235 validateExplicitKey(step.value, parentType);
11236 }
11237 }
11238 }
11239 }
11240 }
11241}
11242
11243/**
11244 * Given an element, validate that its props follow the propTypes definition,
11245 * provided by the type.
11246 *
11247 * @param {ReactElement} element
11248 */
11249function validatePropTypes(element) {
11250 var componentClass = element.type;
11251 if (typeof componentClass !== 'function') {
11252 return;
11253 }
11254 var name = componentClass.displayName || componentClass.name;
11255 if (componentClass.propTypes) {
11256 checkReactTypeSpec(componentClass.propTypes, element.props, ReactPropTypeLocations.prop, name, element, null);
11257 }
11258 if (typeof componentClass.getDefaultProps === 'function') {
11259 "development" !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
11260 }
11261}
11262
11263var ReactElementValidator = {
11264
11265 createElement: function (type, props, children) {
11266 var validType = typeof type === 'string' || typeof type === 'function';
11267 // We warn in this case but don't throw. We expect the element creation to
11268 // succeed and there will likely be errors in render.
11269 if (!validType) {
11270 "development" !== 'production' ? warning(false, '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;
11271 }
11272
11273 var element = ReactElement.createElement.apply(this, arguments);
11274
11275 // The result can be nullish if a mock or a custom function is used.
11276 // TODO: Drop this when these are no longer allowed as the type argument.
11277 if (element == null) {
11278 return element;
11279 }
11280
11281 // Skip key warning if the type isn't valid since our key validation logic
11282 // doesn't expect a non-string/function type and can throw confusing errors.
11283 // We don't want exception behavior to differ between dev and prod.
11284 // (Rendering will throw with a helpful message and as soon as the type is
11285 // fixed, the key warnings will appear.)
11286 if (validType) {
11287 for (var i = 2; i < arguments.length; i++) {
11288 validateChildKeys(arguments[i], type);
11289 }
11290 }
11291
11292 validatePropTypes(element);
11293
11294 return element;
11295 },
11296
11297 createFactory: function (type) {
11298 var validatedFactory = ReactElementValidator.createElement.bind(null, type);
11299 // Legacy hook TODO: Warn if this is accessed
11300 validatedFactory.type = type;
11301
11302 if ("development" !== 'production') {
11303 if (canDefineProperty) {
11304 Object.defineProperty(validatedFactory, 'type', {
11305 enumerable: false,
11306 get: function () {
11307 "development" !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0;
11308 Object.defineProperty(this, 'type', {
11309 value: type
11310 });
11311 return type;
11312 }
11313 });
11314 }
11315 }
11316
11317 return validatedFactory;
11318 },
11319
11320 cloneElement: function (element, props, children) {
11321 var newElement = ReactElement.cloneElement.apply(this, arguments);
11322 for (var i = 2; i < arguments.length; i++) {
11323 validateChildKeys(arguments[i], newElement.type);
11324 }
11325 validatePropTypes(newElement);
11326 return newElement;
11327 }
11328
11329};
11330
11331module.exports = ReactElementValidator;
11332},{"131":131,"132":132,"144":144,"187":187,"38":38,"41":41,"65":65,"90":90}],67:[function(_dereq_,module,exports){
11333/**
11334 * Copyright 2014-present, Facebook, Inc.
11335 * All rights reserved.
11336 *
11337 * This source code is licensed under the BSD-style license found in the
11338 * LICENSE file in the root directory of this source tree. An additional grant
11339 * of patent rights can be found in the PATENTS file in the same directory.
11340 *
11341 * @providesModule ReactEmptyComponent
11342 */
11343
11344'use strict';
11345
11346var emptyComponentFactory;
11347
11348var ReactEmptyComponentInjection = {
11349 injectEmptyComponentFactory: function (factory) {
11350 emptyComponentFactory = factory;
11351 }
11352};
11353
11354var ReactEmptyComponent = {
11355 create: function (instantiate) {
11356 return emptyComponentFactory(instantiate);
11357 }
11358};
11359
11360ReactEmptyComponent.injection = ReactEmptyComponentInjection;
11361
11362module.exports = ReactEmptyComponent;
11363},{}],68:[function(_dereq_,module,exports){
11364/**
11365 * Copyright 2013-present, Facebook, Inc.
11366 * All rights reserved.
11367 *
11368 * This source code is licensed under the BSD-style license found in the
11369 * LICENSE file in the root directory of this source tree. An additional grant
11370 * of patent rights can be found in the PATENTS file in the same directory.
11371 *
11372 * @providesModule ReactErrorUtils
11373 */
11374
11375'use strict';
11376
11377var caughtError = null;
11378
11379/**
11380 * Call a function while guarding against errors that happens within it.
11381 *
11382 * @param {?String} name of the guard to use for logging or debugging
11383 * @param {Function} func The function to invoke
11384 * @param {*} a First argument
11385 * @param {*} b Second argument
11386 */
11387function invokeGuardedCallback(name, func, a, b) {
11388 try {
11389 return func(a, b);
11390 } catch (x) {
11391 if (caughtError === null) {
11392 caughtError = x;
11393 }
11394 return undefined;
11395 }
11396}
11397
11398var ReactErrorUtils = {
11399 invokeGuardedCallback: invokeGuardedCallback,
11400
11401 /**
11402 * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
11403 * handler are sure to be rethrown by rethrowCaughtError.
11404 */
11405 invokeGuardedCallbackWithCatch: invokeGuardedCallback,
11406
11407 /**
11408 * During execution of guarded functions we will capture the first error which
11409 * we will rethrow to be handled by the top level error handler.
11410 */
11411 rethrowCaughtError: function () {
11412 if (caughtError) {
11413 var error = caughtError;
11414 caughtError = null;
11415 throw error;
11416 }
11417 }
11418};
11419
11420if ("development" !== 'production') {
11421 /**
11422 * To help development we can get better devtools integration by simulating a
11423 * real browser event.
11424 */
11425 if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
11426 var fakeNode = document.createElement('react');
11427 ReactErrorUtils.invokeGuardedCallback = function (name, func, a, b) {
11428 var boundFunc = func.bind(null, a, b);
11429 var evtType = 'react-' + name;
11430 fakeNode.addEventListener(evtType, boundFunc, false);
11431 var evt = document.createEvent('Event');
11432 evt.initEvent(evtType, false, false);
11433 fakeNode.dispatchEvent(evt);
11434 fakeNode.removeEventListener(evtType, boundFunc, false);
11435 };
11436 }
11437}
11438
11439module.exports = ReactErrorUtils;
11440},{}],69:[function(_dereq_,module,exports){
11441/**
11442 * Copyright 2013-present, Facebook, Inc.
11443 * All rights reserved.
11444 *
11445 * This source code is licensed under the BSD-style license found in the
11446 * LICENSE file in the root directory of this source tree. An additional grant
11447 * of patent rights can be found in the PATENTS file in the same directory.
11448 *
11449 * @providesModule ReactEventEmitterMixin
11450 */
11451
11452'use strict';
11453
11454var EventPluginHub = _dereq_(17);
11455
11456function runEventQueueInBatch(events) {
11457 EventPluginHub.enqueueEvents(events);
11458 EventPluginHub.processEventQueue(false);
11459}
11460
11461var ReactEventEmitterMixin = {
11462
11463 /**
11464 * Streams a fired top-level event to `EventPluginHub` where plugins have the
11465 * opportunity to create `ReactEvent`s to be dispatched.
11466 */
11467 handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
11468 var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
11469 runEventQueueInBatch(events);
11470 }
11471};
11472
11473module.exports = ReactEventEmitterMixin;
11474},{"17":17}],70:[function(_dereq_,module,exports){
11475/**
11476 * Copyright 2013-present, Facebook, Inc.
11477 * All rights reserved.
11478 *
11479 * This source code is licensed under the BSD-style license found in the
11480 * LICENSE file in the root directory of this source tree. An additional grant
11481 * of patent rights can be found in the PATENTS file in the same directory.
11482 *
11483 * @providesModule ReactEventListener
11484 */
11485
11486'use strict';
11487
11488var _assign = _dereq_(188);
11489
11490var EventListener = _dereq_(163);
11491var ExecutionEnvironment = _dereq_(164);
11492var PooledClass = _dereq_(26);
11493var ReactDOMComponentTree = _dereq_(46);
11494var ReactUpdates = _dereq_(107);
11495
11496var getEventTarget = _dereq_(142);
11497var getUnboundedScrollPosition = _dereq_(175);
11498
11499/**
11500 * Find the deepest React component completely containing the root of the
11501 * passed-in instance (for use when entire React trees are nested within each
11502 * other). If React trees are not nested, returns null.
11503 */
11504function findParent(inst) {
11505 // TODO: It may be a good idea to cache this to prevent unnecessary DOM
11506 // traversal, but caching is difficult to do correctly without using a
11507 // mutation observer to listen for all DOM changes.
11508 while (inst._hostParent) {
11509 inst = inst._hostParent;
11510 }
11511 var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
11512 var container = rootNode.parentNode;
11513 return ReactDOMComponentTree.getClosestInstanceFromNode(container);
11514}
11515
11516// Used to store ancestor hierarchy in top level callback
11517function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
11518 this.topLevelType = topLevelType;
11519 this.nativeEvent = nativeEvent;
11520 this.ancestors = [];
11521}
11522_assign(TopLevelCallbackBookKeeping.prototype, {
11523 destructor: function () {
11524 this.topLevelType = null;
11525 this.nativeEvent = null;
11526 this.ancestors.length = 0;
11527 }
11528});
11529PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
11530
11531function handleTopLevelImpl(bookKeeping) {
11532 var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
11533 var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
11534
11535 // Loop through the hierarchy, in case there's any nested components.
11536 // It's important that we build the array of ancestors before calling any
11537 // event handlers, because event handlers can modify the DOM, leading to
11538 // inconsistencies with ReactMount's node cache. See #1105.
11539 var ancestor = targetInst;
11540 do {
11541 bookKeeping.ancestors.push(ancestor);
11542 ancestor = ancestor && findParent(ancestor);
11543 } while (ancestor);
11544
11545 for (var i = 0; i < bookKeeping.ancestors.length; i++) {
11546 targetInst = bookKeeping.ancestors[i];
11547 ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
11548 }
11549}
11550
11551function scrollValueMonitor(cb) {
11552 var scrollPosition = getUnboundedScrollPosition(window);
11553 cb(scrollPosition);
11554}
11555
11556var ReactEventListener = {
11557 _enabled: true,
11558 _handleTopLevel: null,
11559
11560 WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
11561
11562 setHandleTopLevel: function (handleTopLevel) {
11563 ReactEventListener._handleTopLevel = handleTopLevel;
11564 },
11565
11566 setEnabled: function (enabled) {
11567 ReactEventListener._enabled = !!enabled;
11568 },
11569
11570 isEnabled: function () {
11571 return ReactEventListener._enabled;
11572 },
11573
11574 /**
11575 * Traps top-level events by using event bubbling.
11576 *
11577 * @param {string} topLevelType Record from `EventConstants`.
11578 * @param {string} handlerBaseName Event name (e.g. "click").
11579 * @param {object} handle Element on which to attach listener.
11580 * @return {?object} An object with a remove function which will forcefully
11581 * remove the listener.
11582 * @internal
11583 */
11584 trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
11585 var element = handle;
11586 if (!element) {
11587 return null;
11588 }
11589 return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
11590 },
11591
11592 /**
11593 * Traps a top-level event by using event capturing.
11594 *
11595 * @param {string} topLevelType Record from `EventConstants`.
11596 * @param {string} handlerBaseName Event name (e.g. "click").
11597 * @param {object} handle Element on which to attach listener.
11598 * @return {?object} An object with a remove function which will forcefully
11599 * remove the listener.
11600 * @internal
11601 */
11602 trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
11603 var element = handle;
11604 if (!element) {
11605 return null;
11606 }
11607 return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
11608 },
11609
11610 monitorScrollValue: function (refresh) {
11611 var callback = scrollValueMonitor.bind(null, refresh);
11612 EventListener.listen(window, 'scroll', callback);
11613 },
11614
11615 dispatchEvent: function (topLevelType, nativeEvent) {
11616 if (!ReactEventListener._enabled) {
11617 return;
11618 }
11619
11620 var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
11621 try {
11622 // Event queue being processed in the same cycle allows
11623 // `preventDefault`.
11624 ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
11625 } finally {
11626 TopLevelCallbackBookKeeping.release(bookKeeping);
11627 }
11628 }
11629};
11630
11631module.exports = ReactEventListener;
11632},{"107":107,"142":142,"163":163,"164":164,"175":175,"188":188,"26":26,"46":46}],71:[function(_dereq_,module,exports){
11633/**
11634 * Copyright 2013-present, Facebook, Inc.
11635 * All rights reserved.
11636 *
11637 * This source code is licensed under the BSD-style license found in the
11638 * LICENSE file in the root directory of this source tree. An additional grant
11639 * of patent rights can be found in the PATENTS file in the same directory.
11640 *
11641 * @providesModule ReactFeatureFlags
11642 *
11643 */
11644
11645'use strict';
11646
11647var ReactFeatureFlags = {
11648 // When true, call console.time() before and .timeEnd() after each top-level
11649 // render (both initial renders and updates). Useful when looking at prod-mode
11650 // timeline profiles in Chrome, for example.
11651 logTopLevelRenders: false
11652};
11653
11654module.exports = ReactFeatureFlags;
11655},{}],72:[function(_dereq_,module,exports){
11656/**
11657 * Copyright 2015-present, Facebook, Inc.
11658 * All rights reserved.
11659 *
11660 * This source code is licensed under the BSD-style license found in the
11661 * LICENSE file in the root directory of this source tree. An additional grant
11662 * of patent rights can be found in the PATENTS file in the same directory.
11663 *
11664 * @providesModule ReactFragment
11665 */
11666
11667'use strict';
11668
11669var _prodInvariant = _dereq_(153);
11670
11671var ReactChildren = _dereq_(32);
11672var ReactElement = _dereq_(65);
11673
11674var emptyFunction = _dereq_(170);
11675var invariant = _dereq_(178);
11676var warning = _dereq_(187);
11677
11678/**
11679 * We used to allow keyed objects to serve as a collection of ReactElements,
11680 * or nested sets. This allowed us a way to explicitly key a set or fragment of
11681 * components. This is now being replaced with an opaque data structure.
11682 * The upgrade path is to call React.addons.createFragment({ key: value }) to
11683 * create a keyed fragment. The resulting data structure is an array.
11684 */
11685
11686var numericPropertyRegex = /^\d+$/;
11687
11688var warnedAboutNumeric = false;
11689
11690var ReactFragment = {
11691 /**
11692 * Wrap a keyed object in an opaque proxy that warns you if you access any
11693 * of its properties.
11694 * See https://facebook.github.io/react/docs/create-fragment.html
11695 */
11696 create: function (object) {
11697 if (typeof object !== 'object' || !object || Array.isArray(object)) {
11698 "development" !== 'production' ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : void 0;
11699 return object;
11700 }
11701 if (ReactElement.isValidElement(object)) {
11702 "development" !== 'production' ? warning(false, 'React.addons.createFragment does not accept a ReactElement ' + 'without a wrapper object.') : void 0;
11703 return object;
11704 }
11705
11706 !(object.nodeType !== 1) ? "development" !== 'production' ? invariant(false, 'React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.') : _prodInvariant('0') : void 0;
11707
11708 var result = [];
11709
11710 for (var key in object) {
11711 if ("development" !== 'production') {
11712 if (!warnedAboutNumeric && numericPropertyRegex.test(key)) {
11713 "development" !== 'production' ? warning(false, 'React.addons.createFragment(...): Child objects should have ' + 'non-numeric keys so ordering is preserved.') : void 0;
11714 warnedAboutNumeric = true;
11715 }
11716 }
11717 ReactChildren.mapIntoWithKeyPrefixInternal(object[key], result, key, emptyFunction.thatReturnsArgument);
11718 }
11719
11720 return result;
11721 }
11722};
11723
11724module.exports = ReactFragment;
11725},{"153":153,"170":170,"178":178,"187":187,"32":32,"65":65}],73:[function(_dereq_,module,exports){
11726/**
11727 * Copyright 2014-present, Facebook, Inc.
11728 * All rights reserved.
11729 *
11730 * This source code is licensed under the BSD-style license found in the
11731 * LICENSE file in the root directory of this source tree. An additional grant
11732 * of patent rights can be found in the PATENTS file in the same directory.
11733 *
11734 * @providesModule ReactHostComponent
11735 */
11736
11737'use strict';
11738
11739var _prodInvariant = _dereq_(153),
11740 _assign = _dereq_(188);
11741
11742var invariant = _dereq_(178);
11743
11744var genericComponentClass = null;
11745// This registry keeps track of wrapper classes around host tags.
11746var tagToComponentClass = {};
11747var textComponentClass = null;
11748
11749var ReactHostComponentInjection = {
11750 // This accepts a class that receives the tag string. This is a catch all
11751 // that can render any kind of tag.
11752 injectGenericComponentClass: function (componentClass) {
11753 genericComponentClass = componentClass;
11754 },
11755 // This accepts a text component class that takes the text string to be
11756 // rendered as props.
11757 injectTextComponentClass: function (componentClass) {
11758 textComponentClass = componentClass;
11759 },
11760 // This accepts a keyed object with classes as values. Each key represents a
11761 // tag. That particular tag will use this class instead of the generic one.
11762 injectComponentClasses: function (componentClasses) {
11763 _assign(tagToComponentClass, componentClasses);
11764 }
11765};
11766
11767/**
11768 * Get a host internal component class for a specific tag.
11769 *
11770 * @param {ReactElement} element The element to create.
11771 * @return {function} The internal class constructor function.
11772 */
11773function createInternalComponent(element) {
11774 !genericComponentClass ? "development" !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0;
11775 return new genericComponentClass(element);
11776}
11777
11778/**
11779 * @param {ReactText} text
11780 * @return {ReactComponent}
11781 */
11782function createInstanceForText(text) {
11783 return new textComponentClass(text);
11784}
11785
11786/**
11787 * @param {ReactComponent} component
11788 * @return {boolean}
11789 */
11790function isTextComponent(component) {
11791 return component instanceof textComponentClass;
11792}
11793
11794var ReactHostComponent = {
11795 createInternalComponent: createInternalComponent,
11796 createInstanceForText: createInstanceForText,
11797 isTextComponent: isTextComponent,
11798 injection: ReactHostComponentInjection
11799};
11800
11801module.exports = ReactHostComponent;
11802},{"153":153,"178":178,"188":188}],74:[function(_dereq_,module,exports){
11803/**
11804 * Copyright 2016-present, Facebook, Inc.
11805 * All rights reserved.
11806 *
11807 * This source code is licensed under the BSD-style license found in the
11808 * LICENSE file in the root directory of this source tree. An additional grant
11809 * of patent rights can be found in the PATENTS file in the same directory.
11810 *
11811 * @providesModule ReactHostOperationHistoryHook
11812 */
11813
11814'use strict';
11815
11816var history = [];
11817
11818var ReactHostOperationHistoryHook = {
11819 onHostOperation: function (debugID, type, payload) {
11820 history.push({
11821 instanceID: debugID,
11822 type: type,
11823 payload: payload
11824 });
11825 },
11826 clearHistory: function () {
11827 if (ReactHostOperationHistoryHook._preventClearing) {
11828 // Should only be used for tests.
11829 return;
11830 }
11831
11832 history = [];
11833 },
11834 getHistory: function () {
11835 return history;
11836 }
11837};
11838
11839module.exports = ReactHostOperationHistoryHook;
11840},{}],75:[function(_dereq_,module,exports){
11841/**
11842 * Copyright 2013-present, Facebook, Inc.
11843 * All rights reserved.
11844 *
11845 * This source code is licensed under the BSD-style license found in the
11846 * LICENSE file in the root directory of this source tree. An additional grant
11847 * of patent rights can be found in the PATENTS file in the same directory.
11848 *
11849 * @providesModule ReactInjection
11850 */
11851
11852'use strict';
11853
11854var DOMProperty = _dereq_(10);
11855var EventPluginHub = _dereq_(17);
11856var EventPluginUtils = _dereq_(19);
11857var ReactComponentEnvironment = _dereq_(37);
11858var ReactClass = _dereq_(34);
11859var ReactEmptyComponent = _dereq_(67);
11860var ReactBrowserEventEmitter = _dereq_(28);
11861var ReactHostComponent = _dereq_(73);
11862var ReactUpdates = _dereq_(107);
11863
11864var ReactInjection = {
11865 Component: ReactComponentEnvironment.injection,
11866 Class: ReactClass.injection,
11867 DOMProperty: DOMProperty.injection,
11868 EmptyComponent: ReactEmptyComponent.injection,
11869 EventPluginHub: EventPluginHub.injection,
11870 EventPluginUtils: EventPluginUtils.injection,
11871 EventEmitter: ReactBrowserEventEmitter.injection,
11872 HostComponent: ReactHostComponent.injection,
11873 Updates: ReactUpdates.injection
11874};
11875
11876module.exports = ReactInjection;
11877},{"10":10,"107":107,"17":17,"19":19,"28":28,"34":34,"37":37,"67":67,"73":73}],76:[function(_dereq_,module,exports){
11878/**
11879 * Copyright 2013-present, Facebook, Inc.
11880 * All rights reserved.
11881 *
11882 * This source code is licensed under the BSD-style license found in the
11883 * LICENSE file in the root directory of this source tree. An additional grant
11884 * of patent rights can be found in the PATENTS file in the same directory.
11885 *
11886 * @providesModule ReactInputSelection
11887 */
11888
11889'use strict';
11890
11891var ReactDOMSelection = _dereq_(56);
11892
11893var containsNode = _dereq_(167);
11894var focusNode = _dereq_(172);
11895var getActiveElement = _dereq_(173);
11896
11897function isInDocument(node) {
11898 return containsNode(document.documentElement, node);
11899}
11900
11901/**
11902 * @ReactInputSelection: React input selection module. Based on Selection.js,
11903 * but modified to be suitable for react and has a couple of bug fixes (doesn't
11904 * assume buttons have range selections allowed).
11905 * Input selection module for React.
11906 */
11907var ReactInputSelection = {
11908
11909 hasSelectionCapabilities: function (elem) {
11910 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
11911 return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
11912 },
11913
11914 getSelectionInformation: function () {
11915 var focusedElem = getActiveElement();
11916 return {
11917 focusedElem: focusedElem,
11918 selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
11919 };
11920 },
11921
11922 /**
11923 * @restoreSelection: If any selection information was potentially lost,
11924 * restore it. This is useful when performing operations that could remove dom
11925 * nodes and place them back in, resulting in focus being lost.
11926 */
11927 restoreSelection: function (priorSelectionInformation) {
11928 var curFocusedElem = getActiveElement();
11929 var priorFocusedElem = priorSelectionInformation.focusedElem;
11930 var priorSelectionRange = priorSelectionInformation.selectionRange;
11931 if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
11932 if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
11933 ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
11934 }
11935 focusNode(priorFocusedElem);
11936 }
11937 },
11938
11939 /**
11940 * @getSelection: Gets the selection bounds of a focused textarea, input or
11941 * contentEditable node.
11942 * -@input: Look up selection bounds of this input
11943 * -@return {start: selectionStart, end: selectionEnd}
11944 */
11945 getSelection: function (input) {
11946 var selection;
11947
11948 if ('selectionStart' in input) {
11949 // Modern browser with input or textarea.
11950 selection = {
11951 start: input.selectionStart,
11952 end: input.selectionEnd
11953 };
11954 } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
11955 // IE8 input.
11956 var range = document.selection.createRange();
11957 // There can only be one selection per document in IE, so it must
11958 // be in our element.
11959 if (range.parentElement() === input) {
11960 selection = {
11961 start: -range.moveStart('character', -input.value.length),
11962 end: -range.moveEnd('character', -input.value.length)
11963 };
11964 }
11965 } else {
11966 // Content editable or old IE textarea.
11967 selection = ReactDOMSelection.getOffsets(input);
11968 }
11969
11970 return selection || { start: 0, end: 0 };
11971 },
11972
11973 /**
11974 * @setSelection: Sets the selection bounds of a textarea or input and focuses
11975 * the input.
11976 * -@input Set selection bounds of this input or textarea
11977 * -@offsets Object of same form that is returned from get*
11978 */
11979 setSelection: function (input, offsets) {
11980 var start = offsets.start;
11981 var end = offsets.end;
11982 if (end === undefined) {
11983 end = start;
11984 }
11985
11986 if ('selectionStart' in input) {
11987 input.selectionStart = start;
11988 input.selectionEnd = Math.min(end, input.value.length);
11989 } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
11990 var range = input.createTextRange();
11991 range.collapse(true);
11992 range.moveStart('character', start);
11993 range.moveEnd('character', end - start);
11994 range.select();
11995 } else {
11996 ReactDOMSelection.setOffsets(input, offsets);
11997 }
11998 }
11999};
12000
12001module.exports = ReactInputSelection;
12002},{"167":167,"172":172,"173":173,"56":56}],77:[function(_dereq_,module,exports){
12003/**
12004 * Copyright 2013-present, Facebook, Inc.
12005 * All rights reserved.
12006 *
12007 * This source code is licensed under the BSD-style license found in the
12008 * LICENSE file in the root directory of this source tree. An additional grant
12009 * of patent rights can be found in the PATENTS file in the same directory.
12010 *
12011 * @providesModule ReactInstanceMap
12012 */
12013
12014'use strict';
12015
12016/**
12017 * `ReactInstanceMap` maintains a mapping from a public facing stateful
12018 * instance (key) and the internal representation (value). This allows public
12019 * methods to accept the user facing instance as an argument and map them back
12020 * to internal methods.
12021 */
12022
12023// TODO: Replace this with ES6: var ReactInstanceMap = new Map();
12024
12025var ReactInstanceMap = {
12026
12027 /**
12028 * This API should be called `delete` but we'd have to make sure to always
12029 * transform these to strings for IE support. When this transform is fully
12030 * supported we can rename it.
12031 */
12032 remove: function (key) {
12033 key._reactInternalInstance = undefined;
12034 },
12035
12036 get: function (key) {
12037 return key._reactInternalInstance;
12038 },
12039
12040 has: function (key) {
12041 return key._reactInternalInstance !== undefined;
12042 },
12043
12044 set: function (key, value) {
12045 key._reactInternalInstance = value;
12046 }
12047
12048};
12049
12050module.exports = ReactInstanceMap;
12051},{}],78:[function(_dereq_,module,exports){
12052/**
12053 * Copyright 2016-present, Facebook, Inc.
12054 * All rights reserved.
12055 *
12056 * This source code is licensed under the BSD-style license found in the
12057 * LICENSE file in the root directory of this source tree. An additional grant
12058 * of patent rights can be found in the PATENTS file in the same directory.
12059 *
12060 * @providesModule ReactInstrumentation
12061 */
12062
12063'use strict';
12064
12065var debugTool = null;
12066
12067if ("development" !== 'production') {
12068 var ReactDebugTool = _dereq_(62);
12069 debugTool = ReactDebugTool;
12070}
12071
12072module.exports = { debugTool: debugTool };
12073},{"62":62}],79:[function(_dereq_,module,exports){
12074/**
12075 * Copyright 2016-present, Facebook, Inc.
12076 * All rights reserved.
12077 *
12078 * This source code is licensed under the BSD-style license found in the
12079 * LICENSE file in the root directory of this source tree. An additional grant
12080 * of patent rights can be found in the PATENTS file in the same directory.
12081 *
12082 * @providesModule ReactInvalidSetStateWarningHook
12083 */
12084
12085'use strict';
12086
12087var warning = _dereq_(187);
12088
12089if ("development" !== 'production') {
12090 var processingChildContext = false;
12091
12092 var warnInvalidSetState = function () {
12093 "development" !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
12094 };
12095}
12096
12097var ReactInvalidSetStateWarningHook = {
12098 onBeginProcessingChildContext: function () {
12099 processingChildContext = true;
12100 },
12101 onEndProcessingChildContext: function () {
12102 processingChildContext = false;
12103 },
12104 onSetState: function () {
12105 warnInvalidSetState();
12106 }
12107};
12108
12109module.exports = ReactInvalidSetStateWarningHook;
12110},{"187":187}],80:[function(_dereq_,module,exports){
12111/**
12112 * Copyright 2013-present, Facebook, Inc.
12113 * All rights reserved.
12114 *
12115 * This source code is licensed under the BSD-style license found in the
12116 * LICENSE file in the root directory of this source tree. An additional grant
12117 * of patent rights can be found in the PATENTS file in the same directory.
12118 *
12119 * @providesModule ReactLink
12120 */
12121
12122'use strict';
12123
12124/**
12125 * ReactLink encapsulates a common pattern in which a component wants to modify
12126 * a prop received from its parent. ReactLink allows the parent to pass down a
12127 * value coupled with a callback that, when invoked, expresses an intent to
12128 * modify that value. For example:
12129 *
12130 * React.createClass({
12131 * getInitialState: function() {
12132 * return {value: ''};
12133 * },
12134 * render: function() {
12135 * var valueLink = new ReactLink(this.state.value, this._handleValueChange);
12136 * return <input valueLink={valueLink} />;
12137 * },
12138 * _handleValueChange: function(newValue) {
12139 * this.setState({value: newValue});
12140 * }
12141 * });
12142 *
12143 * We have provided some sugary mixins to make the creation and
12144 * consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
12145 */
12146
12147var React = _dereq_(27);
12148
12149/**
12150 * Deprecated: An an easy way to express two-way binding with React.
12151 * See https://facebook.github.io/react/docs/two-way-binding-helpers.html
12152 *
12153 * @param {*} value current value of the link
12154 * @param {function} requestChange callback to request a change
12155 */
12156function ReactLink(value, requestChange) {
12157 this.value = value;
12158 this.requestChange = requestChange;
12159}
12160
12161/**
12162 * Creates a PropType that enforces the ReactLink API and optionally checks the
12163 * type of the value being passed inside the link. Example:
12164 *
12165 * MyComponent.propTypes = {
12166 * tabIndexLink: ReactLink.PropTypes.link(React.PropTypes.number)
12167 * }
12168 */
12169function createLinkTypeChecker(linkType) {
12170 var shapes = {
12171 value: linkType === undefined ? React.PropTypes.any.isRequired : linkType.isRequired,
12172 requestChange: React.PropTypes.func.isRequired
12173 };
12174 return React.PropTypes.shape(shapes);
12175}
12176
12177ReactLink.PropTypes = {
12178 link: createLinkTypeChecker
12179};
12180
12181module.exports = ReactLink;
12182},{"27":27}],81:[function(_dereq_,module,exports){
12183/**
12184 * Copyright 2013-present, Facebook, Inc.
12185 * All rights reserved.
12186 *
12187 * This source code is licensed under the BSD-style license found in the
12188 * LICENSE file in the root directory of this source tree. An additional grant
12189 * of patent rights can be found in the PATENTS file in the same directory.
12190 *
12191 * @providesModule ReactMarkupChecksum
12192 */
12193
12194'use strict';
12195
12196var adler32 = _dereq_(130);
12197
12198var TAG_END = /\/?>/;
12199var COMMENT_START = /^<\!\-\-/;
12200
12201var ReactMarkupChecksum = {
12202 CHECKSUM_ATTR_NAME: 'data-react-checksum',
12203
12204 /**
12205 * @param {string} markup Markup string
12206 * @return {string} Markup string with checksum attribute attached
12207 */
12208 addChecksumToMarkup: function (markup) {
12209 var checksum = adler32(markup);
12210
12211 // Add checksum (handle both parent tags, comments and self-closing tags)
12212 if (COMMENT_START.test(markup)) {
12213 return markup;
12214 } else {
12215 return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
12216 }
12217 },
12218
12219 /**
12220 * @param {string} markup to use
12221 * @param {DOMElement} element root React element
12222 * @returns {boolean} whether or not the markup is the same
12223 */
12224 canReuseMarkup: function (markup, element) {
12225 var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
12226 existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
12227 var markupChecksum = adler32(markup);
12228 return markupChecksum === existingChecksum;
12229 }
12230};
12231
12232module.exports = ReactMarkupChecksum;
12233},{"130":130}],82:[function(_dereq_,module,exports){
12234/**
12235 * Copyright 2013-present, Facebook, Inc.
12236 * All rights reserved.
12237 *
12238 * This source code is licensed under the BSD-style license found in the
12239 * LICENSE file in the root directory of this source tree. An additional grant
12240 * of patent rights can be found in the PATENTS file in the same directory.
12241 *
12242 * @providesModule ReactMount
12243 */
12244
12245'use strict';
12246
12247var _prodInvariant = _dereq_(153);
12248
12249var DOMLazyTree = _dereq_(8);
12250var DOMProperty = _dereq_(10);
12251var ReactBrowserEventEmitter = _dereq_(28);
12252var ReactCurrentOwner = _dereq_(41);
12253var ReactDOMComponentTree = _dereq_(46);
12254var ReactDOMContainerInfo = _dereq_(47);
12255var ReactDOMFeatureFlags = _dereq_(50);
12256var ReactElement = _dereq_(65);
12257var ReactFeatureFlags = _dereq_(71);
12258var ReactInstanceMap = _dereq_(77);
12259var ReactInstrumentation = _dereq_(78);
12260var ReactMarkupChecksum = _dereq_(81);
12261var ReactReconciler = _dereq_(95);
12262var ReactUpdateQueue = _dereq_(106);
12263var ReactUpdates = _dereq_(107);
12264
12265var emptyObject = _dereq_(171);
12266var instantiateReactComponent = _dereq_(148);
12267var invariant = _dereq_(178);
12268var setInnerHTML = _dereq_(155);
12269var shouldUpdateReactComponent = _dereq_(158);
12270var warning = _dereq_(187);
12271
12272var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
12273var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME;
12274
12275var ELEMENT_NODE_TYPE = 1;
12276var DOC_NODE_TYPE = 9;
12277var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
12278
12279var instancesByReactRootID = {};
12280
12281/**
12282 * Finds the index of the first character
12283 * that's not common between the two given strings.
12284 *
12285 * @return {number} the index of the character where the strings diverge
12286 */
12287function firstDifferenceIndex(string1, string2) {
12288 var minLen = Math.min(string1.length, string2.length);
12289 for (var i = 0; i < minLen; i++) {
12290 if (string1.charAt(i) !== string2.charAt(i)) {
12291 return i;
12292 }
12293 }
12294 return string1.length === string2.length ? -1 : minLen;
12295}
12296
12297/**
12298 * @param {DOMElement|DOMDocument} container DOM element that may contain
12299 * a React component
12300 * @return {?*} DOM element that may have the reactRoot ID, or null.
12301 */
12302function getReactRootElementInContainer(container) {
12303 if (!container) {
12304 return null;
12305 }
12306
12307 if (container.nodeType === DOC_NODE_TYPE) {
12308 return container.documentElement;
12309 } else {
12310 return container.firstChild;
12311 }
12312}
12313
12314function internalGetID(node) {
12315 // If node is something like a window, document, or text node, none of
12316 // which support attributes or a .getAttribute method, gracefully return
12317 // the empty string, as if the attribute were missing.
12318 return node.getAttribute && node.getAttribute(ATTR_NAME) || '';
12319}
12320
12321/**
12322 * Mounts this component and inserts it into the DOM.
12323 *
12324 * @param {ReactComponent} componentInstance The instance to mount.
12325 * @param {DOMElement} container DOM element to mount into.
12326 * @param {ReactReconcileTransaction} transaction
12327 * @param {boolean} shouldReuseMarkup If true, do not insert markup
12328 */
12329function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) {
12330 var markerName;
12331 if (ReactFeatureFlags.logTopLevelRenders) {
12332 var wrappedElement = wrapperInstance._currentElement.props;
12333 var type = wrappedElement.type;
12334 markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name);
12335 console.time(markerName);
12336 }
12337
12338 var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0 /* parentDebugID */
12339 );
12340
12341 if (markerName) {
12342 console.timeEnd(markerName);
12343 }
12344
12345 wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance;
12346 ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction);
12347}
12348
12349/**
12350 * Batched mount.
12351 *
12352 * @param {ReactComponent} componentInstance The instance to mount.
12353 * @param {DOMElement} container DOM element to mount into.
12354 * @param {boolean} shouldReuseMarkup If true, do not insert markup
12355 */
12356function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) {
12357 var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(
12358 /* useCreateElement */
12359 !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement);
12360 transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context);
12361 ReactUpdates.ReactReconcileTransaction.release(transaction);
12362}
12363
12364/**
12365 * Unmounts a component and removes it from the DOM.
12366 *
12367 * @param {ReactComponent} instance React component instance.
12368 * @param {DOMElement} container DOM element to unmount from.
12369 * @final
12370 * @internal
12371 * @see {ReactMount.unmountComponentAtNode}
12372 */
12373function unmountComponentFromNode(instance, container, safely) {
12374 if ("development" !== 'production') {
12375 ReactInstrumentation.debugTool.onBeginFlush();
12376 }
12377 ReactReconciler.unmountComponent(instance, safely);
12378 if ("development" !== 'production') {
12379 ReactInstrumentation.debugTool.onEndFlush();
12380 }
12381
12382 if (container.nodeType === DOC_NODE_TYPE) {
12383 container = container.documentElement;
12384 }
12385
12386 // http://jsperf.com/emptying-a-node
12387 while (container.lastChild) {
12388 container.removeChild(container.lastChild);
12389 }
12390}
12391
12392/**
12393 * True if the supplied DOM node has a direct React-rendered child that is
12394 * not a React root element. Useful for warning in `render`,
12395 * `unmountComponentAtNode`, etc.
12396 *
12397 * @param {?DOMElement} node The candidate DOM node.
12398 * @return {boolean} True if the DOM element contains a direct child that was
12399 * rendered by React but is not a root element.
12400 * @internal
12401 */
12402function hasNonRootReactChild(container) {
12403 var rootEl = getReactRootElementInContainer(container);
12404 if (rootEl) {
12405 var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl);
12406 return !!(inst && inst._hostParent);
12407 }
12408}
12409
12410/**
12411 * True if the supplied DOM node is a React DOM element and
12412 * it has been rendered by another copy of React.
12413 *
12414 * @param {?DOMElement} node The candidate DOM node.
12415 * @return {boolean} True if the DOM has been rendered by another copy of React
12416 * @internal
12417 */
12418function nodeIsRenderedByOtherInstance(container) {
12419 var rootEl = getReactRootElementInContainer(container);
12420 return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl));
12421}
12422
12423/**
12424 * True if the supplied DOM node is a valid node element.
12425 *
12426 * @param {?DOMElement} node The candidate DOM node.
12427 * @return {boolean} True if the DOM is a valid DOM node.
12428 * @internal
12429 */
12430function isValidContainer(node) {
12431 return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE));
12432}
12433
12434/**
12435 * True if the supplied DOM node is a valid React node element.
12436 *
12437 * @param {?DOMElement} node The candidate DOM node.
12438 * @return {boolean} True if the DOM is a valid React DOM node.
12439 * @internal
12440 */
12441function isReactNode(node) {
12442 return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME));
12443}
12444
12445function getHostRootInstanceInContainer(container) {
12446 var rootEl = getReactRootElementInContainer(container);
12447 var prevHostInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl);
12448 return prevHostInstance && !prevHostInstance._hostParent ? prevHostInstance : null;
12449}
12450
12451function getTopLevelWrapperInContainer(container) {
12452 var root = getHostRootInstanceInContainer(container);
12453 return root ? root._hostContainerInfo._topLevelWrapper : null;
12454}
12455
12456/**
12457 * Temporary (?) hack so that we can store all top-level pending updates on
12458 * composites instead of having to worry about different types of components
12459 * here.
12460 */
12461var topLevelRootCounter = 1;
12462var TopLevelWrapper = function () {
12463 this.rootID = topLevelRootCounter++;
12464};
12465TopLevelWrapper.prototype.isReactComponent = {};
12466if ("development" !== 'production') {
12467 TopLevelWrapper.displayName = 'TopLevelWrapper';
12468}
12469TopLevelWrapper.prototype.render = function () {
12470 // this.props is actually a ReactElement
12471 return this.props;
12472};
12473
12474/**
12475 * Mounting is the process of initializing a React component by creating its
12476 * representative DOM elements and inserting them into a supplied `container`.
12477 * Any prior content inside `container` is destroyed in the process.
12478 *
12479 * ReactMount.render(
12480 * component,
12481 * document.getElementById('container')
12482 * );
12483 *
12484 * <div id="container"> <-- Supplied `container`.
12485 * <div data-reactid=".3"> <-- Rendered reactRoot of React
12486 * // ... component.
12487 * </div>
12488 * </div>
12489 *
12490 * Inside of `container`, the first element rendered is the "reactRoot".
12491 */
12492var ReactMount = {
12493
12494 TopLevelWrapper: TopLevelWrapper,
12495
12496 /**
12497 * Used by devtools. The keys are not important.
12498 */
12499 _instancesByReactRootID: instancesByReactRootID,
12500
12501 /**
12502 * This is a hook provided to support rendering React components while
12503 * ensuring that the apparent scroll position of its `container` does not
12504 * change.
12505 *
12506 * @param {DOMElement} container The `container` being rendered into.
12507 * @param {function} renderCallback This must be called once to do the render.
12508 */
12509 scrollMonitor: function (container, renderCallback) {
12510 renderCallback();
12511 },
12512
12513 /**
12514 * Take a component that's already mounted into the DOM and replace its props
12515 * @param {ReactComponent} prevComponent component instance already in the DOM
12516 * @param {ReactElement} nextElement component instance to render
12517 * @param {DOMElement} container container to render into
12518 * @param {?function} callback function triggered on completion
12519 */
12520 _updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) {
12521 ReactMount.scrollMonitor(container, function () {
12522 ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext);
12523 if (callback) {
12524 ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback);
12525 }
12526 });
12527
12528 return prevComponent;
12529 },
12530
12531 /**
12532 * Render a new component into the DOM. Hooked by hooks!
12533 *
12534 * @param {ReactElement} nextElement element to render
12535 * @param {DOMElement} container container to render into
12536 * @param {boolean} shouldReuseMarkup if we should skip the markup insertion
12537 * @return {ReactComponent} nextComponent
12538 */
12539 _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) {
12540 // Various parts of our code (such as ReactCompositeComponent's
12541 // _renderValidatedComponent) assume that calls to render aren't nested;
12542 // verify that that's the case.
12543 "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;
12544
12545 !isValidContainer(container) ? "development" !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0;
12546
12547 ReactBrowserEventEmitter.ensureScrollValueMonitoring();
12548 var componentInstance = instantiateReactComponent(nextElement, false);
12549
12550 // The initial render is synchronous but any updates that happen during
12551 // rendering, in componentWillMount or componentDidMount, will be batched
12552 // according to the current batching strategy.
12553
12554 ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context);
12555
12556 var wrapperID = componentInstance._instance.rootID;
12557 instancesByReactRootID[wrapperID] = componentInstance;
12558
12559 return componentInstance;
12560 },
12561
12562 /**
12563 * Renders a React component into the DOM in the supplied `container`.
12564 *
12565 * If the React component was previously rendered into `container`, this will
12566 * perform an update on it and only mutate the DOM as necessary to reflect the
12567 * latest React component.
12568 *
12569 * @param {ReactComponent} parentComponent The conceptual parent of this render tree.
12570 * @param {ReactElement} nextElement Component element to render.
12571 * @param {DOMElement} container DOM element to render into.
12572 * @param {?function} callback function triggered on completion
12573 * @return {ReactComponent} Component instance rendered in `container`.
12574 */
12575 renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
12576 !(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? "development" !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0;
12577 return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
12578 },
12579
12580 _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
12581 ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render');
12582 !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 />.' :
12583 // Check if it quacks like an element
12584 nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : _prodInvariant('39', 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 />.' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0;
12585
12586 "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;
12587
12588 var nextWrappedElement = ReactElement(TopLevelWrapper, null, null, null, null, null, nextElement);
12589
12590 var nextContext;
12591 if (parentComponent) {
12592 var parentInst = ReactInstanceMap.get(parentComponent);
12593 nextContext = parentInst._processChildContext(parentInst._context);
12594 } else {
12595 nextContext = emptyObject;
12596 }
12597
12598 var prevComponent = getTopLevelWrapperInContainer(container);
12599
12600 if (prevComponent) {
12601 var prevWrappedElement = prevComponent._currentElement;
12602 var prevElement = prevWrappedElement.props;
12603 if (shouldUpdateReactComponent(prevElement, nextElement)) {
12604 var publicInst = prevComponent._renderedComponent.getPublicInstance();
12605 var updatedCallback = callback && function () {
12606 callback.call(publicInst);
12607 };
12608 ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback);
12609 return publicInst;
12610 } else {
12611 ReactMount.unmountComponentAtNode(container);
12612 }
12613 }
12614
12615 var reactRootElement = getReactRootElementInContainer(container);
12616 var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement);
12617 var containerHasNonRootReactChild = hasNonRootReactChild(container);
12618
12619 if ("development" !== 'production') {
12620 "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;
12621
12622 if (!containerHasReactMarkup || reactRootElement.nextSibling) {
12623 var rootElementSibling = reactRootElement;
12624 while (rootElementSibling) {
12625 if (internalGetID(rootElementSibling)) {
12626 "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;
12627 break;
12628 }
12629 rootElementSibling = rootElementSibling.nextSibling;
12630 }
12631 }
12632 }
12633
12634 var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild;
12635 var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance();
12636 if (callback) {
12637 callback.call(component);
12638 }
12639 return component;
12640 },
12641
12642 /**
12643 * Renders a React component into the DOM in the supplied `container`.
12644 * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render
12645 *
12646 * If the React component was previously rendered into `container`, this will
12647 * perform an update on it and only mutate the DOM as necessary to reflect the
12648 * latest React component.
12649 *
12650 * @param {ReactElement} nextElement Component element to render.
12651 * @param {DOMElement} container DOM element to render into.
12652 * @param {?function} callback function triggered on completion
12653 * @return {ReactComponent} Component instance rendered in `container`.
12654 */
12655 render: function (nextElement, container, callback) {
12656 return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
12657 },
12658
12659 /**
12660 * Unmounts and destroys the React component rendered in the `container`.
12661 * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode
12662 *
12663 * @param {DOMElement} container DOM element containing a React component.
12664 * @return {boolean} True if a component was found in and unmounted from
12665 * `container`
12666 */
12667 unmountComponentAtNode: function (container) {
12668 // Various parts of our code (such as ReactCompositeComponent's
12669 // _renderValidatedComponent) assume that calls to render aren't nested;
12670 // verify that that's the case. (Strictly speaking, unmounting won't cause a
12671 // render but we still don't expect to be in a render call here.)
12672 "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;
12673
12674 !isValidContainer(container) ? "development" !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0;
12675
12676 if ("development" !== 'production') {
12677 "development" !== 'production' ? warning(!nodeIsRenderedByOtherInstance(container), 'unmountComponentAtNode(): The node you\'re attempting to unmount ' + 'was rendered by another copy of React.') : void 0;
12678 }
12679
12680 var prevComponent = getTopLevelWrapperInContainer(container);
12681 if (!prevComponent) {
12682 // Check if the node being unmounted was rendered by React, but isn't a
12683 // root node.
12684 var containerHasNonRootReactChild = hasNonRootReactChild(container);
12685
12686 // Check if the container itself is a React root node.
12687 var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME);
12688
12689 if ("development" !== 'production') {
12690 "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;
12691 }
12692
12693 return false;
12694 }
12695 delete instancesByReactRootID[prevComponent._instance.rootID];
12696 ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false);
12697 return true;
12698 },
12699
12700 _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) {
12701 !isValidContainer(container) ? "development" !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : _prodInvariant('41') : void 0;
12702
12703 if (shouldReuseMarkup) {
12704 var rootElement = getReactRootElementInContainer(container);
12705 if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) {
12706 ReactDOMComponentTree.precacheNode(instance, rootElement);
12707 return;
12708 } else {
12709 var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
12710 rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
12711
12712 var rootMarkup = rootElement.outerHTML;
12713 rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
12714
12715 var normalizedMarkup = markup;
12716 if ("development" !== 'production') {
12717 // because rootMarkup is retrieved from the DOM, various normalizations
12718 // will have occurred which will not be present in `markup`. Here,
12719 // insert markup into a <div> or <iframe> depending on the container
12720 // type to perform the same normalizations before comparing.
12721 var normalizer;
12722 if (container.nodeType === ELEMENT_NODE_TYPE) {
12723 normalizer = document.createElement('div');
12724 normalizer.innerHTML = markup;
12725 normalizedMarkup = normalizer.innerHTML;
12726 } else {
12727 normalizer = document.createElement('iframe');
12728 document.body.appendChild(normalizer);
12729 normalizer.contentDocument.write(markup);
12730 normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
12731 document.body.removeChild(normalizer);
12732 }
12733 }
12734
12735 var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
12736 var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
12737
12738 !(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) : _prodInvariant('42', difference) : void 0;
12739
12740 if ("development" !== 'production') {
12741 "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;
12742 }
12743 }
12744 }
12745
12746 !(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.') : _prodInvariant('43') : void 0;
12747
12748 if (transaction.useCreateElement) {
12749 while (container.lastChild) {
12750 container.removeChild(container.lastChild);
12751 }
12752 DOMLazyTree.insertTreeBefore(container, markup, null);
12753 } else {
12754 setInnerHTML(container, markup);
12755 ReactDOMComponentTree.precacheNode(instance, container.firstChild);
12756 }
12757
12758 if ("development" !== 'production') {
12759 var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild);
12760 if (hostNode._debugID !== 0) {
12761 ReactInstrumentation.debugTool.onHostOperation(hostNode._debugID, 'mount', markup.toString());
12762 }
12763 }
12764 }
12765};
12766
12767module.exports = ReactMount;
12768},{"10":10,"106":106,"107":107,"148":148,"153":153,"155":155,"158":158,"171":171,"178":178,"187":187,"28":28,"41":41,"46":46,"47":47,"50":50,"65":65,"71":71,"77":77,"78":78,"8":8,"81":81,"95":95}],83:[function(_dereq_,module,exports){
12769/**
12770 * Copyright 2013-present, Facebook, Inc.
12771 * All rights reserved.
12772 *
12773 * This source code is licensed under the BSD-style license found in the
12774 * LICENSE file in the root directory of this source tree. An additional grant
12775 * of patent rights can be found in the PATENTS file in the same directory.
12776 *
12777 * @providesModule ReactMultiChild
12778 */
12779
12780'use strict';
12781
12782var _prodInvariant = _dereq_(153);
12783
12784var ReactComponentEnvironment = _dereq_(37);
12785var ReactInstanceMap = _dereq_(77);
12786var ReactInstrumentation = _dereq_(78);
12787var ReactMultiChildUpdateTypes = _dereq_(84);
12788
12789var ReactCurrentOwner = _dereq_(41);
12790var ReactReconciler = _dereq_(95);
12791var ReactChildReconciler = _dereq_(31);
12792
12793var emptyFunction = _dereq_(170);
12794var flattenChildren = _dereq_(137);
12795var invariant = _dereq_(178);
12796
12797/**
12798 * Make an update for markup to be rendered and inserted at a supplied index.
12799 *
12800 * @param {string} markup Markup that renders into an element.
12801 * @param {number} toIndex Destination index.
12802 * @private
12803 */
12804function makeInsertMarkup(markup, afterNode, toIndex) {
12805 // NOTE: Null values reduce hidden classes.
12806 return {
12807 type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
12808 content: markup,
12809 fromIndex: null,
12810 fromNode: null,
12811 toIndex: toIndex,
12812 afterNode: afterNode
12813 };
12814}
12815
12816/**
12817 * Make an update for moving an existing element to another index.
12818 *
12819 * @param {number} fromIndex Source index of the existing element.
12820 * @param {number} toIndex Destination index of the element.
12821 * @private
12822 */
12823function makeMove(child, afterNode, toIndex) {
12824 // NOTE: Null values reduce hidden classes.
12825 return {
12826 type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
12827 content: null,
12828 fromIndex: child._mountIndex,
12829 fromNode: ReactReconciler.getHostNode(child),
12830 toIndex: toIndex,
12831 afterNode: afterNode
12832 };
12833}
12834
12835/**
12836 * Make an update for removing an element at an index.
12837 *
12838 * @param {number} fromIndex Index of the element to remove.
12839 * @private
12840 */
12841function makeRemove(child, node) {
12842 // NOTE: Null values reduce hidden classes.
12843 return {
12844 type: ReactMultiChildUpdateTypes.REMOVE_NODE,
12845 content: null,
12846 fromIndex: child._mountIndex,
12847 fromNode: node,
12848 toIndex: null,
12849 afterNode: null
12850 };
12851}
12852
12853/**
12854 * Make an update for setting the markup of a node.
12855 *
12856 * @param {string} markup Markup that renders into an element.
12857 * @private
12858 */
12859function makeSetMarkup(markup) {
12860 // NOTE: Null values reduce hidden classes.
12861 return {
12862 type: ReactMultiChildUpdateTypes.SET_MARKUP,
12863 content: markup,
12864 fromIndex: null,
12865 fromNode: null,
12866 toIndex: null,
12867 afterNode: null
12868 };
12869}
12870
12871/**
12872 * Make an update for setting the text content.
12873 *
12874 * @param {string} textContent Text content to set.
12875 * @private
12876 */
12877function makeTextContent(textContent) {
12878 // NOTE: Null values reduce hidden classes.
12879 return {
12880 type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
12881 content: textContent,
12882 fromIndex: null,
12883 fromNode: null,
12884 toIndex: null,
12885 afterNode: null
12886 };
12887}
12888
12889/**
12890 * Push an update, if any, onto the queue. Creates a new queue if none is
12891 * passed and always returns the queue. Mutative.
12892 */
12893function enqueue(queue, update) {
12894 if (update) {
12895 queue = queue || [];
12896 queue.push(update);
12897 }
12898 return queue;
12899}
12900
12901/**
12902 * Processes any enqueued updates.
12903 *
12904 * @private
12905 */
12906function processQueue(inst, updateQueue) {
12907 ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
12908}
12909
12910var setChildrenForInstrumentation = emptyFunction;
12911if ("development" !== 'production') {
12912 var getDebugID = function (inst) {
12913 if (!inst._debugID) {
12914 // Check for ART-like instances. TODO: This is silly/gross.
12915 var internal;
12916 if (internal = ReactInstanceMap.get(inst)) {
12917 inst = internal;
12918 }
12919 }
12920 return inst._debugID;
12921 };
12922 setChildrenForInstrumentation = function (children) {
12923 var debugID = getDebugID(this);
12924 // TODO: React Native empty components are also multichild.
12925 // This means they still get into this method but don't have _debugID.
12926 if (debugID !== 0) {
12927 ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) {
12928 return children[key]._debugID;
12929 }) : []);
12930 }
12931 };
12932}
12933
12934/**
12935 * ReactMultiChild are capable of reconciling multiple children.
12936 *
12937 * @class ReactMultiChild
12938 * @internal
12939 */
12940var ReactMultiChild = {
12941
12942 /**
12943 * Provides common functionality for components that must reconcile multiple
12944 * children. This is used by `ReactDOMComponent` to mount, update, and
12945 * unmount child components.
12946 *
12947 * @lends {ReactMultiChild.prototype}
12948 */
12949 Mixin: {
12950
12951 _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
12952 if ("development" !== 'production') {
12953 var selfDebugID = getDebugID(this);
12954 if (this._currentElement) {
12955 try {
12956 ReactCurrentOwner.current = this._currentElement._owner;
12957 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID);
12958 } finally {
12959 ReactCurrentOwner.current = null;
12960 }
12961 }
12962 }
12963 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
12964 },
12965
12966 _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) {
12967 var nextChildren;
12968 var selfDebugID = 0;
12969 if ("development" !== 'production') {
12970 selfDebugID = getDebugID(this);
12971 if (this._currentElement) {
12972 try {
12973 ReactCurrentOwner.current = this._currentElement._owner;
12974 nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
12975 } finally {
12976 ReactCurrentOwner.current = null;
12977 }
12978 ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
12979 return nextChildren;
12980 }
12981 }
12982 nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
12983 ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
12984 return nextChildren;
12985 },
12986
12987 /**
12988 * Generates a "mount image" for each of the supplied children. In the case
12989 * of `ReactDOMComponent`, a mount image is a string of markup.
12990 *
12991 * @param {?object} nestedChildren Nested child maps.
12992 * @return {array} An array of mounted representations.
12993 * @internal
12994 */
12995 mountChildren: function (nestedChildren, transaction, context) {
12996 var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
12997 this._renderedChildren = children;
12998
12999 var mountImages = [];
13000 var index = 0;
13001 for (var name in children) {
13002 if (children.hasOwnProperty(name)) {
13003 var child = children[name];
13004 var selfDebugID = 0;
13005 if ("development" !== 'production') {
13006 selfDebugID = getDebugID(this);
13007 }
13008 var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID);
13009 child._mountIndex = index++;
13010 mountImages.push(mountImage);
13011 }
13012 }
13013
13014 if ("development" !== 'production') {
13015 setChildrenForInstrumentation.call(this, children);
13016 }
13017
13018 return mountImages;
13019 },
13020
13021 /**
13022 * Replaces any rendered children with a text content string.
13023 *
13024 * @param {string} nextContent String of content.
13025 * @internal
13026 */
13027 updateTextContent: function (nextContent) {
13028 var prevChildren = this._renderedChildren;
13029 // Remove any rendered children.
13030 ReactChildReconciler.unmountChildren(prevChildren, false);
13031 for (var name in prevChildren) {
13032 if (prevChildren.hasOwnProperty(name)) {
13033 !false ? "development" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
13034 }
13035 }
13036 // Set new text content.
13037 var updates = [makeTextContent(nextContent)];
13038 processQueue(this, updates);
13039 },
13040
13041 /**
13042 * Replaces any rendered children with a markup string.
13043 *
13044 * @param {string} nextMarkup String of markup.
13045 * @internal
13046 */
13047 updateMarkup: function (nextMarkup) {
13048 var prevChildren = this._renderedChildren;
13049 // Remove any rendered children.
13050 ReactChildReconciler.unmountChildren(prevChildren, false);
13051 for (var name in prevChildren) {
13052 if (prevChildren.hasOwnProperty(name)) {
13053 !false ? "development" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
13054 }
13055 }
13056 var updates = [makeSetMarkup(nextMarkup)];
13057 processQueue(this, updates);
13058 },
13059
13060 /**
13061 * Updates the rendered children with new children.
13062 *
13063 * @param {?object} nextNestedChildrenElements Nested child element maps.
13064 * @param {ReactReconcileTransaction} transaction
13065 * @internal
13066 */
13067 updateChildren: function (nextNestedChildrenElements, transaction, context) {
13068 // Hook used by React ART
13069 this._updateChildren(nextNestedChildrenElements, transaction, context);
13070 },
13071
13072 /**
13073 * @param {?object} nextNestedChildrenElements Nested child element maps.
13074 * @param {ReactReconcileTransaction} transaction
13075 * @final
13076 * @protected
13077 */
13078 _updateChildren: function (nextNestedChildrenElements, transaction, context) {
13079 var prevChildren = this._renderedChildren;
13080 var removedNodes = {};
13081 var mountImages = [];
13082 var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context);
13083 if (!nextChildren && !prevChildren) {
13084 return;
13085 }
13086 var updates = null;
13087 var name;
13088 // `nextIndex` will increment for each child in `nextChildren`, but
13089 // `lastIndex` will be the last index visited in `prevChildren`.
13090 var nextIndex = 0;
13091 var lastIndex = 0;
13092 // `nextMountIndex` will increment for each newly mounted child.
13093 var nextMountIndex = 0;
13094 var lastPlacedNode = null;
13095 for (name in nextChildren) {
13096 if (!nextChildren.hasOwnProperty(name)) {
13097 continue;
13098 }
13099 var prevChild = prevChildren && prevChildren[name];
13100 var nextChild = nextChildren[name];
13101 if (prevChild === nextChild) {
13102 updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));
13103 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
13104 prevChild._mountIndex = nextIndex;
13105 } else {
13106 if (prevChild) {
13107 // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
13108 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
13109 // The `removedNodes` loop below will actually remove the child.
13110 }
13111 // The child must be instantiated before it's mounted.
13112 updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context));
13113 nextMountIndex++;
13114 }
13115 nextIndex++;
13116 lastPlacedNode = ReactReconciler.getHostNode(nextChild);
13117 }
13118 // Remove children that are no longer present.
13119 for (name in removedNodes) {
13120 if (removedNodes.hasOwnProperty(name)) {
13121 updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
13122 }
13123 }
13124 if (updates) {
13125 processQueue(this, updates);
13126 }
13127 this._renderedChildren = nextChildren;
13128
13129 if ("development" !== 'production') {
13130 setChildrenForInstrumentation.call(this, nextChildren);
13131 }
13132 },
13133
13134 /**
13135 * Unmounts all rendered children. This should be used to clean up children
13136 * when this component is unmounted. It does not actually perform any
13137 * backend operations.
13138 *
13139 * @internal
13140 */
13141 unmountChildren: function (safely) {
13142 var renderedChildren = this._renderedChildren;
13143 ReactChildReconciler.unmountChildren(renderedChildren, safely);
13144 this._renderedChildren = null;
13145 },
13146
13147 /**
13148 * Moves a child component to the supplied index.
13149 *
13150 * @param {ReactComponent} child Component to move.
13151 * @param {number} toIndex Destination index of the element.
13152 * @param {number} lastIndex Last index visited of the siblings of `child`.
13153 * @protected
13154 */
13155 moveChild: function (child, afterNode, toIndex, lastIndex) {
13156 // If the index of `child` is less than `lastIndex`, then it needs to
13157 // be moved. Otherwise, we do not need to move it because a child will be
13158 // inserted or moved before `child`.
13159 if (child._mountIndex < lastIndex) {
13160 return makeMove(child, afterNode, toIndex);
13161 }
13162 },
13163
13164 /**
13165 * Creates a child component.
13166 *
13167 * @param {ReactComponent} child Component to create.
13168 * @param {string} mountImage Markup to insert.
13169 * @protected
13170 */
13171 createChild: function (child, afterNode, mountImage) {
13172 return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
13173 },
13174
13175 /**
13176 * Removes a child component.
13177 *
13178 * @param {ReactComponent} child Child to remove.
13179 * @protected
13180 */
13181 removeChild: function (child, node) {
13182 return makeRemove(child, node);
13183 },
13184
13185 /**
13186 * Mounts a child with the supplied name.
13187 *
13188 * NOTE: This is part of `updateChildren` and is here for readability.
13189 *
13190 * @param {ReactComponent} child Component to mount.
13191 * @param {string} name Name of the child.
13192 * @param {number} index Index at which to insert the child.
13193 * @param {ReactReconcileTransaction} transaction
13194 * @private
13195 */
13196 _mountChildAtIndex: function (child, mountImage, afterNode, index, transaction, context) {
13197 child._mountIndex = index;
13198 return this.createChild(child, afterNode, mountImage);
13199 },
13200
13201 /**
13202 * Unmounts a rendered child.
13203 *
13204 * NOTE: This is part of `updateChildren` and is here for readability.
13205 *
13206 * @param {ReactComponent} child Component to unmount.
13207 * @private
13208 */
13209 _unmountChild: function (child, node) {
13210 var update = this.removeChild(child, node);
13211 child._mountIndex = null;
13212 return update;
13213 }
13214
13215 }
13216
13217};
13218
13219module.exports = ReactMultiChild;
13220},{"137":137,"153":153,"170":170,"178":178,"31":31,"37":37,"41":41,"77":77,"78":78,"84":84,"95":95}],84:[function(_dereq_,module,exports){
13221/**
13222 * Copyright 2013-present, Facebook, Inc.
13223 * All rights reserved.
13224 *
13225 * This source code is licensed under the BSD-style license found in the
13226 * LICENSE file in the root directory of this source tree. An additional grant
13227 * of patent rights can be found in the PATENTS file in the same directory.
13228 *
13229 * @providesModule ReactMultiChildUpdateTypes
13230 */
13231
13232'use strict';
13233
13234var keyMirror = _dereq_(181);
13235
13236/**
13237 * When a component's children are updated, a series of update configuration
13238 * objects are created in order to batch and serialize the required changes.
13239 *
13240 * Enumerates all the possible types of update configurations.
13241 *
13242 * @internal
13243 */
13244var ReactMultiChildUpdateTypes = keyMirror({
13245 INSERT_MARKUP: null,
13246 MOVE_EXISTING: null,
13247 REMOVE_NODE: null,
13248 SET_MARKUP: null,
13249 TEXT_CONTENT: null
13250});
13251
13252module.exports = ReactMultiChildUpdateTypes;
13253},{"181":181}],85:[function(_dereq_,module,exports){
13254/**
13255 * Copyright 2013-present, Facebook, Inc.
13256 * All rights reserved.
13257 *
13258 * This source code is licensed under the BSD-style license found in the
13259 * LICENSE file in the root directory of this source tree. An additional grant
13260 * of patent rights can be found in the PATENTS file in the same directory.
13261 *
13262 * @providesModule ReactNodeTypes
13263 *
13264 */
13265
13266'use strict';
13267
13268var _prodInvariant = _dereq_(153);
13269
13270var ReactElement = _dereq_(65);
13271
13272var invariant = _dereq_(178);
13273
13274var ReactNodeTypes = {
13275 HOST: 0,
13276 COMPOSITE: 1,
13277 EMPTY: 2,
13278
13279 getType: function (node) {
13280 if (node === null || node === false) {
13281 return ReactNodeTypes.EMPTY;
13282 } else if (ReactElement.isValidElement(node)) {
13283 if (typeof node.type === 'function') {
13284 return ReactNodeTypes.COMPOSITE;
13285 } else {
13286 return ReactNodeTypes.HOST;
13287 }
13288 }
13289 !false ? "development" !== 'production' ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0;
13290 }
13291};
13292
13293module.exports = ReactNodeTypes;
13294},{"153":153,"178":178,"65":65}],86:[function(_dereq_,module,exports){
13295/**
13296 * Copyright 2015-present, Facebook, Inc.
13297 * All rights reserved.
13298 *
13299 * This source code is licensed under the BSD-style license found in the
13300 * LICENSE file in the root directory of this source tree. An additional grant
13301 * of patent rights can be found in the PATENTS file in the same directory.
13302 *
13303 * @providesModule ReactNoopUpdateQueue
13304 */
13305
13306'use strict';
13307
13308var warning = _dereq_(187);
13309
13310function warnNoop(publicInstance, callerName) {
13311 if ("development" !== 'production') {
13312 var constructor = publicInstance.constructor;
13313 "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, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
13314 }
13315}
13316
13317/**
13318 * This is the abstract API for an update queue.
13319 */
13320var ReactNoopUpdateQueue = {
13321
13322 /**
13323 * Checks whether or not this composite component is mounted.
13324 * @param {ReactClass} publicInstance The instance we want to test.
13325 * @return {boolean} True if mounted, false otherwise.
13326 * @protected
13327 * @final
13328 */
13329 isMounted: function (publicInstance) {
13330 return false;
13331 },
13332
13333 /**
13334 * Enqueue a callback that will be executed after all the pending updates
13335 * have processed.
13336 *
13337 * @param {ReactClass} publicInstance The instance to use as `this` context.
13338 * @param {?function} callback Called after state is updated.
13339 * @internal
13340 */
13341 enqueueCallback: function (publicInstance, callback) {},
13342
13343 /**
13344 * Forces an update. This should only be invoked when it is known with
13345 * certainty that we are **not** in a DOM transaction.
13346 *
13347 * You may want to call this when you know that some deeper aspect of the
13348 * component's state has changed but `setState` was not called.
13349 *
13350 * This will not invoke `shouldComponentUpdate`, but it will invoke
13351 * `componentWillUpdate` and `componentDidUpdate`.
13352 *
13353 * @param {ReactClass} publicInstance The instance that should rerender.
13354 * @internal
13355 */
13356 enqueueForceUpdate: function (publicInstance) {
13357 warnNoop(publicInstance, 'forceUpdate');
13358 },
13359
13360 /**
13361 * Replaces all of the state. Always use this or `setState` to mutate state.
13362 * You should treat `this.state` as immutable.
13363 *
13364 * There is no guarantee that `this.state` will be immediately updated, so
13365 * accessing `this.state` after calling this method may return the old value.
13366 *
13367 * @param {ReactClass} publicInstance The instance that should rerender.
13368 * @param {object} completeState Next state.
13369 * @internal
13370 */
13371 enqueueReplaceState: function (publicInstance, completeState) {
13372 warnNoop(publicInstance, 'replaceState');
13373 },
13374
13375 /**
13376 * Sets a subset of the state. This only exists because _pendingState is
13377 * internal. This provides a merging strategy that is not available to deep
13378 * properties which is confusing. TODO: Expose pendingState or don't use it
13379 * during the merge.
13380 *
13381 * @param {ReactClass} publicInstance The instance that should rerender.
13382 * @param {object} partialState Next partial state to be merged with state.
13383 * @internal
13384 */
13385 enqueueSetState: function (publicInstance, partialState) {
13386 warnNoop(publicInstance, 'setState');
13387 }
13388};
13389
13390module.exports = ReactNoopUpdateQueue;
13391},{"187":187}],87:[function(_dereq_,module,exports){
13392/**
13393 * Copyright 2013-present, Facebook, Inc.
13394 * All rights reserved.
13395 *
13396 * This source code is licensed under the BSD-style license found in the
13397 * LICENSE file in the root directory of this source tree. An additional grant
13398 * of patent rights can be found in the PATENTS file in the same directory.
13399 *
13400 * @providesModule ReactOwner
13401 */
13402
13403'use strict';
13404
13405var _prodInvariant = _dereq_(153);
13406
13407var invariant = _dereq_(178);
13408
13409/**
13410 * ReactOwners are capable of storing references to owned components.
13411 *
13412 * All components are capable of //being// referenced by owner components, but
13413 * only ReactOwner components are capable of //referencing// owned components.
13414 * The named reference is known as a "ref".
13415 *
13416 * Refs are available when mounted and updated during reconciliation.
13417 *
13418 * var MyComponent = React.createClass({
13419 * render: function() {
13420 * return (
13421 * <div onClick={this.handleClick}>
13422 * <CustomComponent ref="custom" />
13423 * </div>
13424 * );
13425 * },
13426 * handleClick: function() {
13427 * this.refs.custom.handleClick();
13428 * },
13429 * componentDidMount: function() {
13430 * this.refs.custom.initialize();
13431 * }
13432 * });
13433 *
13434 * Refs should rarely be used. When refs are used, they should only be done to
13435 * control data that is not handled by React's data flow.
13436 *
13437 * @class ReactOwner
13438 */
13439var ReactOwner = {
13440
13441 /**
13442 * @param {?object} object
13443 * @return {boolean} True if `object` is a valid owner.
13444 * @final
13445 */
13446 isValidOwner: function (object) {
13447 return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
13448 },
13449
13450 /**
13451 * Adds a component by ref to an owner component.
13452 *
13453 * @param {ReactComponent} component Component to reference.
13454 * @param {string} ref Name by which to refer to the component.
13455 * @param {ReactOwner} owner Component on which to record the ref.
13456 * @final
13457 * @internal
13458 */
13459 addComponentAsRefTo: function (component, ref, owner) {
13460 !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).') : _prodInvariant('119') : void 0;
13461 owner.attachRef(ref, component);
13462 },
13463
13464 /**
13465 * Removes a component by ref from an owner component.
13466 *
13467 * @param {ReactComponent} component Component to dereference.
13468 * @param {string} ref Name of the ref to remove.
13469 * @param {ReactOwner} owner Component on which the ref is recorded.
13470 * @final
13471 * @internal
13472 */
13473 removeComponentAsRefFrom: function (component, ref, owner) {
13474 !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).') : _prodInvariant('120') : void 0;
13475 var ownerPublicInstance = owner.getPublicInstance();
13476 // Check that `component`'s owner is still alive and that `component` is still the current ref
13477 // because we do not want to detach the ref if another component stole it.
13478 if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
13479 owner.detachRef(ref);
13480 }
13481 }
13482
13483};
13484
13485module.exports = ReactOwner;
13486},{"153":153,"178":178}],88:[function(_dereq_,module,exports){
13487/**
13488 * Copyright 2016-present, Facebook, Inc.
13489 * All rights reserved.
13490 *
13491 * This source code is licensed under the BSD-style license found in the
13492 * LICENSE file in the root directory of this source tree. An additional grant
13493 * of patent rights can be found in the PATENTS file in the same directory.
13494 *
13495 * @providesModule ReactPerf
13496 */
13497
13498'use strict';
13499
13500var _assign = _dereq_(188);
13501
13502var _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; };
13503
13504var ReactDebugTool = _dereq_(62);
13505var warning = _dereq_(187);
13506var alreadyWarned = false;
13507
13508function roundFloat(val) {
13509 var base = arguments.length <= 1 || arguments[1] === undefined ? 2 : arguments[1];
13510
13511 var n = Math.pow(10, base);
13512 return Math.floor(val * n) / n;
13513}
13514
13515function warnInProduction() {
13516 if (alreadyWarned) {
13517 return;
13518 }
13519 alreadyWarned = true;
13520 if (typeof console !== 'undefined') {
13521 console.error('ReactPerf is not supported in the production builds of React. ' + 'To collect measurements, please use the development build of React instead.');
13522 }
13523}
13524
13525function getLastMeasurements() {
13526 if (!("development" !== 'production')) {
13527 warnInProduction();
13528 return [];
13529 }
13530
13531 return ReactDebugTool.getFlushHistory();
13532}
13533
13534function getExclusive() {
13535 var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getLastMeasurements() : arguments[0];
13536
13537 if (!("development" !== 'production')) {
13538 warnInProduction();
13539 return [];
13540 }
13541
13542 var aggregatedStats = {};
13543 var affectedIDs = {};
13544
13545 function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) {
13546 var displayName = treeSnapshot[instanceID].displayName;
13547
13548 var key = displayName;
13549 var stats = aggregatedStats[key];
13550 if (!stats) {
13551 affectedIDs[key] = {};
13552 stats = aggregatedStats[key] = {
13553 key: key,
13554 instanceCount: 0,
13555 counts: {},
13556 durations: {},
13557 totalDuration: 0
13558 };
13559 }
13560 if (!stats.durations[timerType]) {
13561 stats.durations[timerType] = 0;
13562 }
13563 if (!stats.counts[timerType]) {
13564 stats.counts[timerType] = 0;
13565 }
13566 affectedIDs[key][instanceID] = true;
13567 applyUpdate(stats);
13568 }
13569
13570 flushHistory.forEach(function (flush) {
13571 var measurements = flush.measurements;
13572 var treeSnapshot = flush.treeSnapshot;
13573
13574 measurements.forEach(function (measurement) {
13575 var duration = measurement.duration;
13576 var instanceID = measurement.instanceID;
13577 var timerType = measurement.timerType;
13578
13579 updateAggregatedStats(treeSnapshot, instanceID, timerType, function (stats) {
13580 stats.totalDuration += duration;
13581 stats.durations[timerType] += duration;
13582 stats.counts[timerType]++;
13583 });
13584 });
13585 });
13586
13587 return Object.keys(aggregatedStats).map(function (key) {
13588 return _extends({}, aggregatedStats[key], {
13589 instanceCount: Object.keys(affectedIDs[key]).length
13590 });
13591 }).sort(function (a, b) {
13592 return b.totalDuration - a.totalDuration;
13593 });
13594}
13595
13596function getInclusive() {
13597 var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getLastMeasurements() : arguments[0];
13598
13599 if (!("development" !== 'production')) {
13600 warnInProduction();
13601 return [];
13602 }
13603
13604 var aggregatedStats = {};
13605 var affectedIDs = {};
13606
13607 function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
13608 var _treeSnapshot$instanc = treeSnapshot[instanceID];
13609 var displayName = _treeSnapshot$instanc.displayName;
13610 var ownerID = _treeSnapshot$instanc.ownerID;
13611
13612 var owner = treeSnapshot[ownerID];
13613 var key = (owner ? owner.displayName + ' > ' : '') + displayName;
13614 var stats = aggregatedStats[key];
13615 if (!stats) {
13616 affectedIDs[key] = {};
13617 stats = aggregatedStats[key] = {
13618 key: key,
13619 instanceCount: 0,
13620 inclusiveRenderDuration: 0,
13621 renderCount: 0
13622 };
13623 }
13624 affectedIDs[key][instanceID] = true;
13625 applyUpdate(stats);
13626 }
13627
13628 var isCompositeByID = {};
13629 flushHistory.forEach(function (flush) {
13630 var measurements = flush.measurements;
13631
13632 measurements.forEach(function (measurement) {
13633 var instanceID = measurement.instanceID;
13634 var timerType = measurement.timerType;
13635
13636 if (timerType !== 'render') {
13637 return;
13638 }
13639 isCompositeByID[instanceID] = true;
13640 });
13641 });
13642
13643 flushHistory.forEach(function (flush) {
13644 var measurements = flush.measurements;
13645 var treeSnapshot = flush.treeSnapshot;
13646
13647 measurements.forEach(function (measurement) {
13648 var duration = measurement.duration;
13649 var instanceID = measurement.instanceID;
13650 var timerType = measurement.timerType;
13651
13652 if (timerType !== 'render') {
13653 return;
13654 }
13655 updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
13656 stats.renderCount++;
13657 });
13658 var nextParentID = instanceID;
13659 while (nextParentID) {
13660 // As we traverse parents, only count inclusive time towards composites.
13661 // We know something is a composite if its render() was called.
13662 if (isCompositeByID[nextParentID]) {
13663 updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
13664 stats.inclusiveRenderDuration += duration;
13665 });
13666 }
13667 nextParentID = treeSnapshot[nextParentID].parentID;
13668 }
13669 });
13670 });
13671
13672 return Object.keys(aggregatedStats).map(function (key) {
13673 return _extends({}, aggregatedStats[key], {
13674 instanceCount: Object.keys(affectedIDs[key]).length
13675 });
13676 }).sort(function (a, b) {
13677 return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
13678 });
13679}
13680
13681function getWasted() {
13682 var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getLastMeasurements() : arguments[0];
13683
13684 if (!("development" !== 'production')) {
13685 warnInProduction();
13686 return [];
13687 }
13688
13689 var aggregatedStats = {};
13690 var affectedIDs = {};
13691
13692 function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) {
13693 var _treeSnapshot$instanc2 = treeSnapshot[instanceID];
13694 var displayName = _treeSnapshot$instanc2.displayName;
13695 var ownerID = _treeSnapshot$instanc2.ownerID;
13696
13697 var owner = treeSnapshot[ownerID];
13698 var key = (owner ? owner.displayName + ' > ' : '') + displayName;
13699 var stats = aggregatedStats[key];
13700 if (!stats) {
13701 affectedIDs[key] = {};
13702 stats = aggregatedStats[key] = {
13703 key: key,
13704 instanceCount: 0,
13705 inclusiveRenderDuration: 0,
13706 renderCount: 0
13707 };
13708 }
13709 affectedIDs[key][instanceID] = true;
13710 applyUpdate(stats);
13711 }
13712
13713 flushHistory.forEach(function (flush) {
13714 var measurements = flush.measurements;
13715 var treeSnapshot = flush.treeSnapshot;
13716 var operations = flush.operations;
13717
13718 var isDefinitelyNotWastedByID = {};
13719
13720 // Find host components associated with an operation in this batch.
13721 // Mark all components in their parent tree as definitely not wasted.
13722 operations.forEach(function (operation) {
13723 var instanceID = operation.instanceID;
13724
13725 var nextParentID = instanceID;
13726 while (nextParentID) {
13727 isDefinitelyNotWastedByID[nextParentID] = true;
13728 nextParentID = treeSnapshot[nextParentID].parentID;
13729 }
13730 });
13731
13732 // Find composite components that rendered in this batch.
13733 // These are potential candidates for being wasted renders.
13734 var renderedCompositeIDs = {};
13735 measurements.forEach(function (measurement) {
13736 var instanceID = measurement.instanceID;
13737 var timerType = measurement.timerType;
13738
13739 if (timerType !== 'render') {
13740 return;
13741 }
13742 renderedCompositeIDs[instanceID] = true;
13743 });
13744
13745 measurements.forEach(function (measurement) {
13746 var duration = measurement.duration;
13747 var instanceID = measurement.instanceID;
13748 var timerType = measurement.timerType;
13749
13750 if (timerType !== 'render') {
13751 return;
13752 }
13753
13754 // If there was a DOM update below this component, or it has just been
13755 // mounted, its render() is not considered wasted.
13756 var updateCount = treeSnapshot[instanceID].updateCount;
13757
13758 if (isDefinitelyNotWastedByID[instanceID] || updateCount === 0) {
13759 return;
13760 }
13761
13762 // We consider this render() wasted.
13763 updateAggregatedStats(treeSnapshot, instanceID, function (stats) {
13764 stats.renderCount++;
13765 });
13766
13767 var nextParentID = instanceID;
13768 while (nextParentID) {
13769 // Any parents rendered during this batch are considered wasted
13770 // unless we previously marked them as dirty.
13771 var isWasted = renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID];
13772 if (isWasted) {
13773 updateAggregatedStats(treeSnapshot, nextParentID, function (stats) {
13774 stats.inclusiveRenderDuration += duration;
13775 });
13776 }
13777 nextParentID = treeSnapshot[nextParentID].parentID;
13778 }
13779 });
13780 });
13781
13782 return Object.keys(aggregatedStats).map(function (key) {
13783 return _extends({}, aggregatedStats[key], {
13784 instanceCount: Object.keys(affectedIDs[key]).length
13785 });
13786 }).sort(function (a, b) {
13787 return b.inclusiveRenderDuration - a.inclusiveRenderDuration;
13788 });
13789}
13790
13791function getOperations() {
13792 var flushHistory = arguments.length <= 0 || arguments[0] === undefined ? getLastMeasurements() : arguments[0];
13793
13794 if (!("development" !== 'production')) {
13795 warnInProduction();
13796 return [];
13797 }
13798
13799 var stats = [];
13800 flushHistory.forEach(function (flush, flushIndex) {
13801 var operations = flush.operations;
13802 var treeSnapshot = flush.treeSnapshot;
13803
13804 operations.forEach(function (operation) {
13805 var instanceID = operation.instanceID;
13806 var type = operation.type;
13807 var payload = operation.payload;
13808 var _treeSnapshot$instanc3 = treeSnapshot[instanceID];
13809 var displayName = _treeSnapshot$instanc3.displayName;
13810 var ownerID = _treeSnapshot$instanc3.ownerID;
13811
13812 var owner = treeSnapshot[ownerID];
13813 var key = (owner ? owner.displayName + ' > ' : '') + displayName;
13814
13815 stats.push({
13816 flushIndex: flushIndex,
13817 instanceID: instanceID,
13818 key: key,
13819 type: type,
13820 ownerID: ownerID,
13821 payload: payload
13822 });
13823 });
13824 });
13825 return stats;
13826}
13827
13828function printExclusive(flushHistory) {
13829 if (!("development" !== 'production')) {
13830 warnInProduction();
13831 return;
13832 }
13833
13834 var stats = getExclusive(flushHistory);
13835 var table = stats.map(function (item) {
13836 var key = item.key;
13837 var instanceCount = item.instanceCount;
13838 var totalDuration = item.totalDuration;
13839
13840 var renderCount = item.counts.render || 0;
13841 var renderDuration = item.durations.render || 0;
13842 return {
13843 'Component': key,
13844 'Total time (ms)': roundFloat(totalDuration),
13845 'Instance count': instanceCount,
13846 'Total render time (ms)': roundFloat(renderDuration),
13847 'Average render time (ms)': renderCount ? roundFloat(renderDuration / renderCount) : undefined,
13848 'Render count': renderCount,
13849 'Total lifecycle time (ms)': roundFloat(totalDuration - renderDuration)
13850 };
13851 });
13852 console.table(table);
13853}
13854
13855function printInclusive(flushHistory) {
13856 if (!("development" !== 'production')) {
13857 warnInProduction();
13858 return;
13859 }
13860
13861 var stats = getInclusive(flushHistory);
13862 var table = stats.map(function (item) {
13863 var key = item.key;
13864 var instanceCount = item.instanceCount;
13865 var inclusiveRenderDuration = item.inclusiveRenderDuration;
13866 var renderCount = item.renderCount;
13867
13868 return {
13869 'Owner > Component': key,
13870 'Inclusive render time (ms)': roundFloat(inclusiveRenderDuration),
13871 'Instance count': instanceCount,
13872 'Render count': renderCount
13873 };
13874 });
13875 console.table(table);
13876}
13877
13878function printWasted(flushHistory) {
13879 if (!("development" !== 'production')) {
13880 warnInProduction();
13881 return;
13882 }
13883
13884 var stats = getWasted(flushHistory);
13885 var table = stats.map(function (item) {
13886 var key = item.key;
13887 var instanceCount = item.instanceCount;
13888 var inclusiveRenderDuration = item.inclusiveRenderDuration;
13889 var renderCount = item.renderCount;
13890
13891 return {
13892 'Owner > Component': key,
13893 'Inclusive wasted time (ms)': roundFloat(inclusiveRenderDuration),
13894 'Instance count': instanceCount,
13895 'Render count': renderCount
13896 };
13897 });
13898 console.table(table);
13899}
13900
13901function printOperations(flushHistory) {
13902 if (!("development" !== 'production')) {
13903 warnInProduction();
13904 return;
13905 }
13906
13907 var stats = getOperations(flushHistory);
13908 var table = stats.map(function (stat) {
13909 return {
13910 'Owner > Node': stat.key,
13911 'Operation': stat.type,
13912 'Payload': typeof stat.payload === 'object' ? JSON.stringify(stat.payload) : stat.payload,
13913 'Flush index': stat.flushIndex,
13914 'Owner Component ID': stat.ownerID,
13915 'DOM Component ID': stat.instanceID
13916 };
13917 });
13918 console.table(table);
13919}
13920
13921var warnedAboutPrintDOM = false;
13922function printDOM(measurements) {
13923 "development" !== 'production' ? warning(warnedAboutPrintDOM, '`ReactPerf.printDOM(...)` is deprecated. Use ' + '`ReactPerf.printOperations(...)` instead.') : void 0;
13924 warnedAboutPrintDOM = true;
13925 return printOperations(measurements);
13926}
13927
13928var warnedAboutGetMeasurementsSummaryMap = false;
13929function getMeasurementsSummaryMap(measurements) {
13930 "development" !== 'production' ? warning(warnedAboutGetMeasurementsSummaryMap, '`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use ' + '`ReactPerf.getWasted(...)` instead.') : void 0;
13931 warnedAboutGetMeasurementsSummaryMap = true;
13932 return getWasted(measurements);
13933}
13934
13935function start() {
13936 if (!("development" !== 'production')) {
13937 warnInProduction();
13938 return;
13939 }
13940
13941 ReactDebugTool.beginProfiling();
13942}
13943
13944function stop() {
13945 if (!("development" !== 'production')) {
13946 warnInProduction();
13947 return;
13948 }
13949
13950 ReactDebugTool.endProfiling();
13951}
13952
13953function isRunning() {
13954 if (!("development" !== 'production')) {
13955 warnInProduction();
13956 return false;
13957 }
13958
13959 return ReactDebugTool.isProfiling();
13960}
13961
13962var ReactPerfAnalysis = {
13963 getLastMeasurements: getLastMeasurements,
13964 getExclusive: getExclusive,
13965 getInclusive: getInclusive,
13966 getWasted: getWasted,
13967 getOperations: getOperations,
13968 printExclusive: printExclusive,
13969 printInclusive: printInclusive,
13970 printWasted: printWasted,
13971 printOperations: printOperations,
13972 start: start,
13973 stop: stop,
13974 isRunning: isRunning,
13975 // Deprecated:
13976 printDOM: printDOM,
13977 getMeasurementsSummaryMap: getMeasurementsSummaryMap
13978};
13979
13980module.exports = ReactPerfAnalysis;
13981},{"187":187,"188":188,"62":62}],89:[function(_dereq_,module,exports){
13982/**
13983 * Copyright 2013-present, Facebook, Inc.
13984 * All rights reserved.
13985 *
13986 * This source code is licensed under the BSD-style license found in the
13987 * LICENSE file in the root directory of this source tree. An additional grant
13988 * of patent rights can be found in the PATENTS file in the same directory.
13989 *
13990 * @providesModule ReactPropTypeLocationNames
13991 */
13992
13993'use strict';
13994
13995var ReactPropTypeLocationNames = {};
13996
13997if ("development" !== 'production') {
13998 ReactPropTypeLocationNames = {
13999 prop: 'prop',
14000 context: 'context',
14001 childContext: 'child context'
14002 };
14003}
14004
14005module.exports = ReactPropTypeLocationNames;
14006},{}],90:[function(_dereq_,module,exports){
14007/**
14008 * Copyright 2013-present, Facebook, Inc.
14009 * All rights reserved.
14010 *
14011 * This source code is licensed under the BSD-style license found in the
14012 * LICENSE file in the root directory of this source tree. An additional grant
14013 * of patent rights can be found in the PATENTS file in the same directory.
14014 *
14015 * @providesModule ReactPropTypeLocations
14016 */
14017
14018'use strict';
14019
14020var keyMirror = _dereq_(181);
14021
14022var ReactPropTypeLocations = keyMirror({
14023 prop: null,
14024 context: null,
14025 childContext: null
14026});
14027
14028module.exports = ReactPropTypeLocations;
14029},{"181":181}],91:[function(_dereq_,module,exports){
14030/**
14031 * Copyright 2013-present, Facebook, Inc.
14032 * All rights reserved.
14033 *
14034 * This source code is licensed under the BSD-style license found in the
14035 * LICENSE file in the root directory of this source tree. An additional grant
14036 * of patent rights can be found in the PATENTS file in the same directory.
14037 *
14038 * @providesModule ReactPropTypes
14039 */
14040
14041'use strict';
14042
14043var ReactElement = _dereq_(65);
14044var ReactPropTypeLocationNames = _dereq_(89);
14045var ReactPropTypesSecret = _dereq_(92);
14046
14047var emptyFunction = _dereq_(170);
14048var getIteratorFn = _dereq_(144);
14049var warning = _dereq_(187);
14050
14051/**
14052 * Collection of methods that allow declaration and validation of props that are
14053 * supplied to React components. Example usage:
14054 *
14055 * var Props = require('ReactPropTypes');
14056 * var MyArticle = React.createClass({
14057 * propTypes: {
14058 * // An optional string prop named "description".
14059 * description: Props.string,
14060 *
14061 * // A required enum prop named "category".
14062 * category: Props.oneOf(['News','Photos']).isRequired,
14063 *
14064 * // A prop named "dialog" that requires an instance of Dialog.
14065 * dialog: Props.instanceOf(Dialog).isRequired
14066 * },
14067 * render: function() { ... }
14068 * });
14069 *
14070 * A more formal specification of how these methods are used:
14071 *
14072 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
14073 * decl := ReactPropTypes.{type}(.isRequired)?
14074 *
14075 * Each and every declaration produces a function with the same signature. This
14076 * allows the creation of custom validation functions. For example:
14077 *
14078 * var MyLink = React.createClass({
14079 * propTypes: {
14080 * // An optional string or URI prop named "href".
14081 * href: function(props, propName, componentName) {
14082 * var propValue = props[propName];
14083 * if (propValue != null && typeof propValue !== 'string' &&
14084 * !(propValue instanceof URI)) {
14085 * return new Error(
14086 * 'Expected a string or an URI for ' + propName + ' in ' +
14087 * componentName
14088 * );
14089 * }
14090 * }
14091 * },
14092 * render: function() {...}
14093 * });
14094 *
14095 * @internal
14096 */
14097
14098var ANONYMOUS = '<<anonymous>>';
14099
14100var ReactPropTypes = {
14101 array: createPrimitiveTypeChecker('array'),
14102 bool: createPrimitiveTypeChecker('boolean'),
14103 func: createPrimitiveTypeChecker('function'),
14104 number: createPrimitiveTypeChecker('number'),
14105 object: createPrimitiveTypeChecker('object'),
14106 string: createPrimitiveTypeChecker('string'),
14107 symbol: createPrimitiveTypeChecker('symbol'),
14108
14109 any: createAnyTypeChecker(),
14110 arrayOf: createArrayOfTypeChecker,
14111 element: createElementTypeChecker(),
14112 instanceOf: createInstanceTypeChecker,
14113 node: createNodeChecker(),
14114 objectOf: createObjectOfTypeChecker,
14115 oneOf: createEnumTypeChecker,
14116 oneOfType: createUnionTypeChecker,
14117 shape: createShapeTypeChecker
14118};
14119
14120/**
14121 * inlined Object.is polyfill to avoid requiring consumers ship their own
14122 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
14123 */
14124/*eslint-disable no-self-compare*/
14125function is(x, y) {
14126 // SameValue algorithm
14127 if (x === y) {
14128 // Steps 1-5, 7-10
14129 // Steps 6.b-6.e: +0 != -0
14130 return x !== 0 || 1 / x === 1 / y;
14131 } else {
14132 // Step 6.a: NaN == NaN
14133 return x !== x && y !== y;
14134 }
14135}
14136/*eslint-enable no-self-compare*/
14137
14138/**
14139 * We use an Error-like object for backward compatibility as people may call
14140 * PropTypes directly and inspect their output. However we don't use real
14141 * Errors anymore. We don't inspect their stack anyway, and creating them
14142 * is prohibitively expensive if they are created too often, such as what
14143 * happens in oneOfType() for any type before the one that matched.
14144 */
14145function PropTypeError(message) {
14146 this.message = message;
14147 this.stack = '';
14148}
14149// Make `instanceof Error` still work for returned errors.
14150PropTypeError.prototype = Error.prototype;
14151
14152function createChainableTypeChecker(validate) {
14153 if ("development" !== 'production') {
14154 var manualPropTypeCallCache = {};
14155 }
14156 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
14157 componentName = componentName || ANONYMOUS;
14158 propFullName = propFullName || propName;
14159 if ("development" !== 'production') {
14160 if (secret !== ReactPropTypesSecret && typeof console !== 'undefined') {
14161 var cacheKey = componentName + ':' + propName;
14162 if (!manualPropTypeCallCache[cacheKey]) {
14163 "development" !== 'production' ? warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in the next major version. You may be ' + 'seeing this warning due to a third-party PropTypes library. ' + 'See https://fb.me/react-warning-dont-call-proptypes for details.', propFullName, componentName) : void 0;
14164 manualPropTypeCallCache[cacheKey] = true;
14165 }
14166 }
14167 }
14168 if (props[propName] == null) {
14169 var locationName = ReactPropTypeLocationNames[location];
14170 if (isRequired) {
14171 return new PropTypeError('Required ' + locationName + ' `' + propFullName + '` was not specified in ' + ('`' + componentName + '`.'));
14172 }
14173 return null;
14174 } else {
14175 return validate(props, propName, componentName, location, propFullName);
14176 }
14177 }
14178
14179 var chainedCheckType = checkType.bind(null, false);
14180 chainedCheckType.isRequired = checkType.bind(null, true);
14181
14182 return chainedCheckType;
14183}
14184
14185function createPrimitiveTypeChecker(expectedType) {
14186 function validate(props, propName, componentName, location, propFullName, secret) {
14187 var propValue = props[propName];
14188 var propType = getPropType(propValue);
14189 if (propType !== expectedType) {
14190 var locationName = ReactPropTypeLocationNames[location];
14191 // `propValue` being instance of, say, date/regexp, pass the 'object'
14192 // check, but we can offer a more precise error message here rather than
14193 // 'of type `object`'.
14194 var preciseType = getPreciseType(propValue);
14195
14196 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
14197 }
14198 return null;
14199 }
14200 return createChainableTypeChecker(validate);
14201}
14202
14203function createAnyTypeChecker() {
14204 return createChainableTypeChecker(emptyFunction.thatReturns(null));
14205}
14206
14207function createArrayOfTypeChecker(typeChecker) {
14208 function validate(props, propName, componentName, location, propFullName) {
14209 if (typeof typeChecker !== 'function') {
14210 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
14211 }
14212 var propValue = props[propName];
14213 if (!Array.isArray(propValue)) {
14214 var locationName = ReactPropTypeLocationNames[location];
14215 var propType = getPropType(propValue);
14216 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
14217 }
14218 for (var i = 0; i < propValue.length; i++) {
14219 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
14220 if (error instanceof Error) {
14221 return error;
14222 }
14223 }
14224 return null;
14225 }
14226 return createChainableTypeChecker(validate);
14227}
14228
14229function createElementTypeChecker() {
14230 function validate(props, propName, componentName, location, propFullName) {
14231 var propValue = props[propName];
14232 if (!ReactElement.isValidElement(propValue)) {
14233 var locationName = ReactPropTypeLocationNames[location];
14234 var propType = getPropType(propValue);
14235 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
14236 }
14237 return null;
14238 }
14239 return createChainableTypeChecker(validate);
14240}
14241
14242function createInstanceTypeChecker(expectedClass) {
14243 function validate(props, propName, componentName, location, propFullName) {
14244 if (!(props[propName] instanceof expectedClass)) {
14245 var locationName = ReactPropTypeLocationNames[location];
14246 var expectedClassName = expectedClass.name || ANONYMOUS;
14247 var actualClassName = getClassName(props[propName]);
14248 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
14249 }
14250 return null;
14251 }
14252 return createChainableTypeChecker(validate);
14253}
14254
14255function createEnumTypeChecker(expectedValues) {
14256 if (!Array.isArray(expectedValues)) {
14257 "development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
14258 return emptyFunction.thatReturnsNull;
14259 }
14260
14261 function validate(props, propName, componentName, location, propFullName) {
14262 var propValue = props[propName];
14263 for (var i = 0; i < expectedValues.length; i++) {
14264 if (is(propValue, expectedValues[i])) {
14265 return null;
14266 }
14267 }
14268
14269 var locationName = ReactPropTypeLocationNames[location];
14270 var valuesString = JSON.stringify(expectedValues);
14271 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
14272 }
14273 return createChainableTypeChecker(validate);
14274}
14275
14276function createObjectOfTypeChecker(typeChecker) {
14277 function validate(props, propName, componentName, location, propFullName) {
14278 if (typeof typeChecker !== 'function') {
14279 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
14280 }
14281 var propValue = props[propName];
14282 var propType = getPropType(propValue);
14283 if (propType !== 'object') {
14284 var locationName = ReactPropTypeLocationNames[location];
14285 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
14286 }
14287 for (var key in propValue) {
14288 if (propValue.hasOwnProperty(key)) {
14289 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
14290 if (error instanceof Error) {
14291 return error;
14292 }
14293 }
14294 }
14295 return null;
14296 }
14297 return createChainableTypeChecker(validate);
14298}
14299
14300function createUnionTypeChecker(arrayOfTypeCheckers) {
14301 if (!Array.isArray(arrayOfTypeCheckers)) {
14302 "development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
14303 return emptyFunction.thatReturnsNull;
14304 }
14305
14306 function validate(props, propName, componentName, location, propFullName) {
14307 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
14308 var checker = arrayOfTypeCheckers[i];
14309 if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
14310 return null;
14311 }
14312 }
14313
14314 var locationName = ReactPropTypeLocationNames[location];
14315 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
14316 }
14317 return createChainableTypeChecker(validate);
14318}
14319
14320function createNodeChecker() {
14321 function validate(props, propName, componentName, location, propFullName) {
14322 if (!isNode(props[propName])) {
14323 var locationName = ReactPropTypeLocationNames[location];
14324 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
14325 }
14326 return null;
14327 }
14328 return createChainableTypeChecker(validate);
14329}
14330
14331function createShapeTypeChecker(shapeTypes) {
14332 function validate(props, propName, componentName, location, propFullName) {
14333 var propValue = props[propName];
14334 var propType = getPropType(propValue);
14335 if (propType !== 'object') {
14336 var locationName = ReactPropTypeLocationNames[location];
14337 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
14338 }
14339 for (var key in shapeTypes) {
14340 var checker = shapeTypes[key];
14341 if (!checker) {
14342 continue;
14343 }
14344 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
14345 if (error) {
14346 return error;
14347 }
14348 }
14349 return null;
14350 }
14351 return createChainableTypeChecker(validate);
14352}
14353
14354function isNode(propValue) {
14355 switch (typeof propValue) {
14356 case 'number':
14357 case 'string':
14358 case 'undefined':
14359 return true;
14360 case 'boolean':
14361 return !propValue;
14362 case 'object':
14363 if (Array.isArray(propValue)) {
14364 return propValue.every(isNode);
14365 }
14366 if (propValue === null || ReactElement.isValidElement(propValue)) {
14367 return true;
14368 }
14369
14370 var iteratorFn = getIteratorFn(propValue);
14371 if (iteratorFn) {
14372 var iterator = iteratorFn.call(propValue);
14373 var step;
14374 if (iteratorFn !== propValue.entries) {
14375 while (!(step = iterator.next()).done) {
14376 if (!isNode(step.value)) {
14377 return false;
14378 }
14379 }
14380 } else {
14381 // Iterator will provide entry [k,v] tuples rather than values.
14382 while (!(step = iterator.next()).done) {
14383 var entry = step.value;
14384 if (entry) {
14385 if (!isNode(entry[1])) {
14386 return false;
14387 }
14388 }
14389 }
14390 }
14391 } else {
14392 return false;
14393 }
14394
14395 return true;
14396 default:
14397 return false;
14398 }
14399}
14400
14401function isSymbol(propType, propValue) {
14402 // Native Symbol.
14403 if (propType === 'symbol') {
14404 return true;
14405 }
14406
14407 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
14408 if (propValue['@@toStringTag'] === 'Symbol') {
14409 return true;
14410 }
14411
14412 // Fallback for non-spec compliant Symbols which are polyfilled.
14413 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
14414 return true;
14415 }
14416
14417 return false;
14418}
14419
14420// Equivalent of `typeof` but with special handling for array and regexp.
14421function getPropType(propValue) {
14422 var propType = typeof propValue;
14423 if (Array.isArray(propValue)) {
14424 return 'array';
14425 }
14426 if (propValue instanceof RegExp) {
14427 // Old webkits (at least until Android 4.0) return 'function' rather than
14428 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
14429 // passes PropTypes.object.
14430 return 'object';
14431 }
14432 if (isSymbol(propType, propValue)) {
14433 return 'symbol';
14434 }
14435 return propType;
14436}
14437
14438// This handles more types than `getPropType`. Only used for error messages.
14439// See `createPrimitiveTypeChecker`.
14440function getPreciseType(propValue) {
14441 var propType = getPropType(propValue);
14442 if (propType === 'object') {
14443 if (propValue instanceof Date) {
14444 return 'date';
14445 } else if (propValue instanceof RegExp) {
14446 return 'regexp';
14447 }
14448 }
14449 return propType;
14450}
14451
14452// Returns class name of the object, if any.
14453function getClassName(propValue) {
14454 if (!propValue.constructor || !propValue.constructor.name) {
14455 return ANONYMOUS;
14456 }
14457 return propValue.constructor.name;
14458}
14459
14460module.exports = ReactPropTypes;
14461},{"144":144,"170":170,"187":187,"65":65,"89":89,"92":92}],92:[function(_dereq_,module,exports){
14462/**
14463 * Copyright 2013-present, Facebook, Inc.
14464 * All rights reserved.
14465 *
14466 * This source code is licensed under the BSD-style license found in the
14467 * LICENSE file in the root directory of this source tree. An additional grant
14468 * of patent rights can be found in the PATENTS file in the same directory.
14469 *
14470 * @providesModule ReactPropTypesSecret
14471 */
14472
14473'use strict';
14474
14475var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
14476
14477module.exports = ReactPropTypesSecret;
14478},{}],93:[function(_dereq_,module,exports){
14479/**
14480 * Copyright 2013-present, Facebook, Inc.
14481 * All rights reserved.
14482 *
14483 * This source code is licensed under the BSD-style license found in the
14484 * LICENSE file in the root directory of this source tree. An additional grant
14485 * of patent rights can be found in the PATENTS file in the same directory.
14486 *
14487 * @providesModule ReactPureComponent
14488 */
14489
14490'use strict';
14491
14492var _assign = _dereq_(188);
14493
14494var ReactComponent = _dereq_(35);
14495var ReactNoopUpdateQueue = _dereq_(86);
14496
14497var emptyObject = _dereq_(171);
14498
14499/**
14500 * Base class helpers for the updating state of a component.
14501 */
14502function ReactPureComponent(props, context, updater) {
14503 // Duplicated from ReactComponent.
14504 this.props = props;
14505 this.context = context;
14506 this.refs = emptyObject;
14507 // We initialize the default updater but the real one gets injected by the
14508 // renderer.
14509 this.updater = updater || ReactNoopUpdateQueue;
14510}
14511
14512function ComponentDummy() {}
14513ComponentDummy.prototype = ReactComponent.prototype;
14514ReactPureComponent.prototype = new ComponentDummy();
14515ReactPureComponent.prototype.constructor = ReactPureComponent;
14516// Avoid an extra prototype jump for these methods.
14517_assign(ReactPureComponent.prototype, ReactComponent.prototype);
14518ReactPureComponent.prototype.isPureReactComponent = true;
14519
14520module.exports = ReactPureComponent;
14521},{"171":171,"188":188,"35":35,"86":86}],94:[function(_dereq_,module,exports){
14522/**
14523 * Copyright 2013-present, Facebook, Inc.
14524 * All rights reserved.
14525 *
14526 * This source code is licensed under the BSD-style license found in the
14527 * LICENSE file in the root directory of this source tree. An additional grant
14528 * of patent rights can be found in the PATENTS file in the same directory.
14529 *
14530 * @providesModule ReactReconcileTransaction
14531 */
14532
14533'use strict';
14534
14535var _assign = _dereq_(188);
14536
14537var CallbackQueue = _dereq_(5);
14538var PooledClass = _dereq_(26);
14539var ReactBrowserEventEmitter = _dereq_(28);
14540var ReactInputSelection = _dereq_(76);
14541var ReactInstrumentation = _dereq_(78);
14542var Transaction = _dereq_(127);
14543var ReactUpdateQueue = _dereq_(106);
14544
14545/**
14546 * Ensures that, when possible, the selection range (currently selected text
14547 * input) is not disturbed by performing the transaction.
14548 */
14549var SELECTION_RESTORATION = {
14550 /**
14551 * @return {Selection} Selection information.
14552 */
14553 initialize: ReactInputSelection.getSelectionInformation,
14554 /**
14555 * @param {Selection} sel Selection information returned from `initialize`.
14556 */
14557 close: ReactInputSelection.restoreSelection
14558};
14559
14560/**
14561 * Suppresses events (blur/focus) that could be inadvertently dispatched due to
14562 * high level DOM manipulations (like temporarily removing a text input from the
14563 * DOM).
14564 */
14565var EVENT_SUPPRESSION = {
14566 /**
14567 * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
14568 * the reconciliation.
14569 */
14570 initialize: function () {
14571 var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
14572 ReactBrowserEventEmitter.setEnabled(false);
14573 return currentlyEnabled;
14574 },
14575
14576 /**
14577 * @param {boolean} previouslyEnabled Enabled status of
14578 * `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
14579 * restores the previous value.
14580 */
14581 close: function (previouslyEnabled) {
14582 ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
14583 }
14584};
14585
14586/**
14587 * Provides a queue for collecting `componentDidMount` and
14588 * `componentDidUpdate` callbacks during the transaction.
14589 */
14590var ON_DOM_READY_QUEUEING = {
14591 /**
14592 * Initializes the internal `onDOMReady` queue.
14593 */
14594 initialize: function () {
14595 this.reactMountReady.reset();
14596 },
14597
14598 /**
14599 * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
14600 */
14601 close: function () {
14602 this.reactMountReady.notifyAll();
14603 }
14604};
14605
14606/**
14607 * Executed within the scope of the `Transaction` instance. Consider these as
14608 * being member methods, but with an implied ordering while being isolated from
14609 * each other.
14610 */
14611var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
14612
14613if ("development" !== 'production') {
14614 TRANSACTION_WRAPPERS.push({
14615 initialize: ReactInstrumentation.debugTool.onBeginFlush,
14616 close: ReactInstrumentation.debugTool.onEndFlush
14617 });
14618}
14619
14620/**
14621 * Currently:
14622 * - The order that these are listed in the transaction is critical:
14623 * - Suppresses events.
14624 * - Restores selection range.
14625 *
14626 * Future:
14627 * - Restore document/overflow scroll positions that were unintentionally
14628 * modified via DOM insertions above the top viewport boundary.
14629 * - Implement/integrate with customized constraint based layout system and keep
14630 * track of which dimensions must be remeasured.
14631 *
14632 * @class ReactReconcileTransaction
14633 */
14634function ReactReconcileTransaction(useCreateElement) {
14635 this.reinitializeTransaction();
14636 // Only server-side rendering really needs this option (see
14637 // `ReactServerRendering`), but server-side uses
14638 // `ReactServerRenderingTransaction` instead. This option is here so that it's
14639 // accessible and defaults to false when `ReactDOMComponent` and
14640 // `ReactDOMTextComponent` checks it in `mountComponent`.`
14641 this.renderToStaticMarkup = false;
14642 this.reactMountReady = CallbackQueue.getPooled(null);
14643 this.useCreateElement = useCreateElement;
14644}
14645
14646var Mixin = {
14647 /**
14648 * @see Transaction
14649 * @abstract
14650 * @final
14651 * @return {array<object>} List of operation wrap procedures.
14652 * TODO: convert to array<TransactionWrapper>
14653 */
14654 getTransactionWrappers: function () {
14655 return TRANSACTION_WRAPPERS;
14656 },
14657
14658 /**
14659 * @return {object} The queue to collect `onDOMReady` callbacks with.
14660 */
14661 getReactMountReady: function () {
14662 return this.reactMountReady;
14663 },
14664
14665 /**
14666 * @return {object} The queue to collect React async events.
14667 */
14668 getUpdateQueue: function () {
14669 return ReactUpdateQueue;
14670 },
14671
14672 /**
14673 * Save current transaction state -- if the return value from this method is
14674 * passed to `rollback`, the transaction will be reset to that state.
14675 */
14676 checkpoint: function () {
14677 // reactMountReady is the our only stateful wrapper
14678 return this.reactMountReady.checkpoint();
14679 },
14680
14681 rollback: function (checkpoint) {
14682 this.reactMountReady.rollback(checkpoint);
14683 },
14684
14685 /**
14686 * `PooledClass` looks for this, and will invoke this before allowing this
14687 * instance to be reused.
14688 */
14689 destructor: function () {
14690 CallbackQueue.release(this.reactMountReady);
14691 this.reactMountReady = null;
14692 }
14693};
14694
14695_assign(ReactReconcileTransaction.prototype, Transaction.Mixin, Mixin);
14696
14697PooledClass.addPoolingTo(ReactReconcileTransaction);
14698
14699module.exports = ReactReconcileTransaction;
14700},{"106":106,"127":127,"188":188,"26":26,"28":28,"5":5,"76":76,"78":78}],95:[function(_dereq_,module,exports){
14701/**
14702 * Copyright 2013-present, Facebook, Inc.
14703 * All rights reserved.
14704 *
14705 * This source code is licensed under the BSD-style license found in the
14706 * LICENSE file in the root directory of this source tree. An additional grant
14707 * of patent rights can be found in the PATENTS file in the same directory.
14708 *
14709 * @providesModule ReactReconciler
14710 */
14711
14712'use strict';
14713
14714var ReactRef = _dereq_(96);
14715var ReactInstrumentation = _dereq_(78);
14716
14717var warning = _dereq_(187);
14718
14719/**
14720 * Helper to call ReactRef.attachRefs with this composite component, split out
14721 * to avoid allocations in the transaction mount-ready queue.
14722 */
14723function attachRefs() {
14724 ReactRef.attachRefs(this, this._currentElement);
14725}
14726
14727var ReactReconciler = {
14728
14729 /**
14730 * Initializes the component, renders markup, and registers event listeners.
14731 *
14732 * @param {ReactComponent} internalInstance
14733 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
14734 * @param {?object} the containing host component instance
14735 * @param {?object} info about the host container
14736 * @return {?string} Rendered markup to be inserted into the DOM.
14737 * @final
14738 * @internal
14739 */
14740 mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID // 0 in production and for roots
14741 ) {
14742 if ("development" !== 'production') {
14743 if (internalInstance._debugID !== 0) {
14744 ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);
14745 }
14746 }
14747 var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);
14748 if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
14749 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
14750 }
14751 if ("development" !== 'production') {
14752 if (internalInstance._debugID !== 0) {
14753 ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
14754 }
14755 }
14756 return markup;
14757 },
14758
14759 /**
14760 * Returns a value that can be passed to
14761 * ReactComponentEnvironment.replaceNodeWithMarkup.
14762 */
14763 getHostNode: function (internalInstance) {
14764 return internalInstance.getHostNode();
14765 },
14766
14767 /**
14768 * Releases any resources allocated by `mountComponent`.
14769 *
14770 * @final
14771 * @internal
14772 */
14773 unmountComponent: function (internalInstance, safely) {
14774 if ("development" !== 'production') {
14775 if (internalInstance._debugID !== 0) {
14776 ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
14777 }
14778 }
14779 ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
14780 internalInstance.unmountComponent(safely);
14781 if ("development" !== 'production') {
14782 if (internalInstance._debugID !== 0) {
14783 ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
14784 }
14785 }
14786 },
14787
14788 /**
14789 * Update a component using a new element.
14790 *
14791 * @param {ReactComponent} internalInstance
14792 * @param {ReactElement} nextElement
14793 * @param {ReactReconcileTransaction} transaction
14794 * @param {object} context
14795 * @internal
14796 */
14797 receiveComponent: function (internalInstance, nextElement, transaction, context) {
14798 var prevElement = internalInstance._currentElement;
14799
14800 if (nextElement === prevElement && context === internalInstance._context) {
14801 // Since elements are immutable after the owner is rendered,
14802 // we can do a cheap identity compare here to determine if this is a
14803 // superfluous reconcile. It's possible for state to be mutable but such
14804 // change should trigger an update of the owner which would recreate
14805 // the element. We explicitly check for the existence of an owner since
14806 // it's possible for an element created outside a composite to be
14807 // deeply mutated and reused.
14808
14809 // TODO: Bailing out early is just a perf optimization right?
14810 // TODO: Removing the return statement should affect correctness?
14811 return;
14812 }
14813
14814 if ("development" !== 'production') {
14815 if (internalInstance._debugID !== 0) {
14816 ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);
14817 }
14818 }
14819
14820 var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
14821
14822 if (refsChanged) {
14823 ReactRef.detachRefs(internalInstance, prevElement);
14824 }
14825
14826 internalInstance.receiveComponent(nextElement, transaction, context);
14827
14828 if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
14829 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
14830 }
14831
14832 if ("development" !== 'production') {
14833 if (internalInstance._debugID !== 0) {
14834 ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
14835 }
14836 }
14837 },
14838
14839 /**
14840 * Flush any dirty changes in a component.
14841 *
14842 * @param {ReactComponent} internalInstance
14843 * @param {ReactReconcileTransaction} transaction
14844 * @internal
14845 */
14846 performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
14847 if (internalInstance._updateBatchNumber !== updateBatchNumber) {
14848 // The component's enqueued batch number should always be the current
14849 // batch or the following one.
14850 "development" !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
14851 return;
14852 }
14853 if ("development" !== 'production') {
14854 if (internalInstance._debugID !== 0) {
14855 ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
14856 }
14857 }
14858 internalInstance.performUpdateIfNecessary(transaction);
14859 if ("development" !== 'production') {
14860 if (internalInstance._debugID !== 0) {
14861 ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
14862 }
14863 }
14864 }
14865
14866};
14867
14868module.exports = ReactReconciler;
14869},{"187":187,"78":78,"96":96}],96:[function(_dereq_,module,exports){
14870/**
14871 * Copyright 2013-present, Facebook, Inc.
14872 * All rights reserved.
14873 *
14874 * This source code is licensed under the BSD-style license found in the
14875 * LICENSE file in the root directory of this source tree. An additional grant
14876 * of patent rights can be found in the PATENTS file in the same directory.
14877 *
14878 * @providesModule ReactRef
14879 */
14880
14881'use strict';
14882
14883var ReactOwner = _dereq_(87);
14884
14885var ReactRef = {};
14886
14887function attachRef(ref, component, owner) {
14888 if (typeof ref === 'function') {
14889 ref(component.getPublicInstance());
14890 } else {
14891 // Legacy ref
14892 ReactOwner.addComponentAsRefTo(component, ref, owner);
14893 }
14894}
14895
14896function detachRef(ref, component, owner) {
14897 if (typeof ref === 'function') {
14898 ref(null);
14899 } else {
14900 // Legacy ref
14901 ReactOwner.removeComponentAsRefFrom(component, ref, owner);
14902 }
14903}
14904
14905ReactRef.attachRefs = function (instance, element) {
14906 if (element === null || element === false) {
14907 return;
14908 }
14909 var ref = element.ref;
14910 if (ref != null) {
14911 attachRef(ref, instance, element._owner);
14912 }
14913};
14914
14915ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
14916 // If either the owner or a `ref` has changed, make sure the newest owner
14917 // has stored a reference to `this`, and the previous owner (if different)
14918 // has forgotten the reference to `this`. We use the element instead
14919 // of the public this.props because the post processing cannot determine
14920 // a ref. The ref conceptually lives on the element.
14921
14922 // TODO: Should this even be possible? The owner cannot change because
14923 // it's forbidden by shouldUpdateReactComponent. The ref can change
14924 // if you swap the keys of but not the refs. Reconsider where this check
14925 // is made. It probably belongs where the key checking and
14926 // instantiateReactComponent is done.
14927
14928 var prevEmpty = prevElement === null || prevElement === false;
14929 var nextEmpty = nextElement === null || nextElement === false;
14930
14931 return (
14932 // This has a few false positives w/r/t empty components.
14933 prevEmpty || nextEmpty || nextElement.ref !== prevElement.ref ||
14934 // If owner changes but we have an unchanged function ref, don't update refs
14935 typeof nextElement.ref === 'string' && nextElement._owner !== prevElement._owner
14936 );
14937};
14938
14939ReactRef.detachRefs = function (instance, element) {
14940 if (element === null || element === false) {
14941 return;
14942 }
14943 var ref = element.ref;
14944 if (ref != null) {
14945 detachRef(ref, instance, element._owner);
14946 }
14947};
14948
14949module.exports = ReactRef;
14950},{"87":87}],97:[function(_dereq_,module,exports){
14951/**
14952 * Copyright 2014-present, Facebook, Inc.
14953 * All rights reserved.
14954 *
14955 * This source code is licensed under the BSD-style license found in the
14956 * LICENSE file in the root directory of this source tree. An additional grant
14957 * of patent rights can be found in the PATENTS file in the same directory.
14958 *
14959 * @providesModule ReactServerBatchingStrategy
14960 */
14961
14962'use strict';
14963
14964var ReactServerBatchingStrategy = {
14965 isBatchingUpdates: false,
14966 batchedUpdates: function (callback) {
14967 // Don't do anything here. During the server rendering we don't want to
14968 // schedule any updates. We will simply ignore them.
14969 }
14970};
14971
14972module.exports = ReactServerBatchingStrategy;
14973},{}],98:[function(_dereq_,module,exports){
14974/**
14975 * Copyright 2013-present, Facebook, Inc.
14976 * All rights reserved.
14977 *
14978 * This source code is licensed under the BSD-style license found in the
14979 * LICENSE file in the root directory of this source tree. An additional grant
14980 * of patent rights can be found in the PATENTS file in the same directory.
14981 *
14982 * @providesModule ReactServerRendering
14983 */
14984'use strict';
14985
14986var _prodInvariant = _dereq_(153);
14987
14988var ReactDOMContainerInfo = _dereq_(47);
14989var ReactDefaultBatchingStrategy = _dereq_(63);
14990var ReactElement = _dereq_(65);
14991var ReactInstrumentation = _dereq_(78);
14992var ReactMarkupChecksum = _dereq_(81);
14993var ReactReconciler = _dereq_(95);
14994var ReactServerBatchingStrategy = _dereq_(97);
14995var ReactServerRenderingTransaction = _dereq_(99);
14996var ReactUpdates = _dereq_(107);
14997
14998var emptyObject = _dereq_(171);
14999var instantiateReactComponent = _dereq_(148);
15000var invariant = _dereq_(178);
15001
15002var pendingTransactions = 0;
15003
15004/**
15005 * @param {ReactElement} element
15006 * @return {string} the HTML markup
15007 */
15008function renderToStringImpl(element, makeStaticMarkup) {
15009 var transaction;
15010 try {
15011 ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
15012
15013 transaction = ReactServerRenderingTransaction.getPooled(makeStaticMarkup);
15014
15015 pendingTransactions++;
15016
15017 return transaction.perform(function () {
15018 var componentInstance = instantiateReactComponent(element, true);
15019 var markup = ReactReconciler.mountComponent(componentInstance, transaction, null, ReactDOMContainerInfo(), emptyObject, 0 /* parentDebugID */
15020 );
15021 if ("development" !== 'production') {
15022 ReactInstrumentation.debugTool.onUnmountComponent(componentInstance._debugID);
15023 }
15024 if (!makeStaticMarkup) {
15025 markup = ReactMarkupChecksum.addChecksumToMarkup(markup);
15026 }
15027 return markup;
15028 }, null);
15029 } finally {
15030 pendingTransactions--;
15031 ReactServerRenderingTransaction.release(transaction);
15032 // Revert to the DOM batching strategy since these two renderers
15033 // currently share these stateful modules.
15034 if (!pendingTransactions) {
15035 ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
15036 }
15037 }
15038}
15039
15040/**
15041 * Render a ReactElement to its initial HTML. This should only be used on the
15042 * server.
15043 * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostring
15044 */
15045function renderToString(element) {
15046 !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : _prodInvariant('46') : void 0;
15047 return renderToStringImpl(element, false);
15048}
15049
15050/**
15051 * Similar to renderToString, except this doesn't create extra DOM attributes
15052 * such as data-react-id that React uses internally.
15053 * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostaticmarkup
15054 */
15055function renderToStaticMarkup(element) {
15056 !ReactElement.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : _prodInvariant('47') : void 0;
15057 return renderToStringImpl(element, true);
15058}
15059
15060module.exports = {
15061 renderToString: renderToString,
15062 renderToStaticMarkup: renderToStaticMarkup
15063};
15064},{"107":107,"148":148,"153":153,"171":171,"178":178,"47":47,"63":63,"65":65,"78":78,"81":81,"95":95,"97":97,"99":99}],99:[function(_dereq_,module,exports){
15065/**
15066 * Copyright 2014-present, Facebook, Inc.
15067 * All rights reserved.
15068 *
15069 * This source code is licensed under the BSD-style license found in the
15070 * LICENSE file in the root directory of this source tree. An additional grant
15071 * of patent rights can be found in the PATENTS file in the same directory.
15072 *
15073 * @providesModule ReactServerRenderingTransaction
15074 */
15075
15076'use strict';
15077
15078var _assign = _dereq_(188);
15079
15080var PooledClass = _dereq_(26);
15081var Transaction = _dereq_(127);
15082var ReactInstrumentation = _dereq_(78);
15083var ReactServerUpdateQueue = _dereq_(100);
15084
15085/**
15086 * Executed within the scope of the `Transaction` instance. Consider these as
15087 * being member methods, but with an implied ordering while being isolated from
15088 * each other.
15089 */
15090var TRANSACTION_WRAPPERS = [];
15091
15092if ("development" !== 'production') {
15093 TRANSACTION_WRAPPERS.push({
15094 initialize: ReactInstrumentation.debugTool.onBeginFlush,
15095 close: ReactInstrumentation.debugTool.onEndFlush
15096 });
15097}
15098
15099var noopCallbackQueue = {
15100 enqueue: function () {}
15101};
15102
15103/**
15104 * @class ReactServerRenderingTransaction
15105 * @param {boolean} renderToStaticMarkup
15106 */
15107function ReactServerRenderingTransaction(renderToStaticMarkup) {
15108 this.reinitializeTransaction();
15109 this.renderToStaticMarkup = renderToStaticMarkup;
15110 this.useCreateElement = false;
15111 this.updateQueue = new ReactServerUpdateQueue(this);
15112}
15113
15114var Mixin = {
15115 /**
15116 * @see Transaction
15117 * @abstract
15118 * @final
15119 * @return {array} Empty list of operation wrap procedures.
15120 */
15121 getTransactionWrappers: function () {
15122 return TRANSACTION_WRAPPERS;
15123 },
15124
15125 /**
15126 * @return {object} The queue to collect `onDOMReady` callbacks with.
15127 */
15128 getReactMountReady: function () {
15129 return noopCallbackQueue;
15130 },
15131
15132 /**
15133 * @return {object} The queue to collect React async events.
15134 */
15135 getUpdateQueue: function () {
15136 return this.updateQueue;
15137 },
15138
15139 /**
15140 * `PooledClass` looks for this, and will invoke this before allowing this
15141 * instance to be reused.
15142 */
15143 destructor: function () {},
15144
15145 checkpoint: function () {},
15146
15147 rollback: function () {}
15148};
15149
15150_assign(ReactServerRenderingTransaction.prototype, Transaction.Mixin, Mixin);
15151
15152PooledClass.addPoolingTo(ReactServerRenderingTransaction);
15153
15154module.exports = ReactServerRenderingTransaction;
15155},{"100":100,"127":127,"188":188,"26":26,"78":78}],100:[function(_dereq_,module,exports){
15156/**
15157 * Copyright 2015-present, Facebook, Inc.
15158 * All rights reserved.
15159 *
15160 * This source code is licensed under the BSD-style license found in the
15161 * LICENSE file in the root directory of this source tree. An additional grant
15162 * of patent rights can be found in the PATENTS file in the same directory.
15163 *
15164 * @providesModule ReactServerUpdateQueue
15165 *
15166 */
15167
15168'use strict';
15169
15170function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15171
15172var ReactUpdateQueue = _dereq_(106);
15173var Transaction = _dereq_(127);
15174var warning = _dereq_(187);
15175
15176function warnNoop(publicInstance, callerName) {
15177 if ("development" !== 'production') {
15178 var constructor = publicInstance.constructor;
15179 "development" !== 'production' ? warning(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0;
15180 }
15181}
15182
15183/**
15184 * This is the update queue used for server rendering.
15185 * It delegates to ReactUpdateQueue while server rendering is in progress and
15186 * switches to ReactNoopUpdateQueue after the transaction has completed.
15187 * @class ReactServerUpdateQueue
15188 * @param {Transaction} transaction
15189 */
15190
15191var ReactServerUpdateQueue = function () {
15192 /* :: transaction: Transaction; */
15193
15194 function ReactServerUpdateQueue(transaction) {
15195 _classCallCheck(this, ReactServerUpdateQueue);
15196
15197 this.transaction = transaction;
15198 }
15199
15200 /**
15201 * Checks whether or not this composite component is mounted.
15202 * @param {ReactClass} publicInstance The instance we want to test.
15203 * @return {boolean} True if mounted, false otherwise.
15204 * @protected
15205 * @final
15206 */
15207
15208
15209 ReactServerUpdateQueue.prototype.isMounted = function isMounted(publicInstance) {
15210 return false;
15211 };
15212
15213 /**
15214 * Enqueue a callback that will be executed after all the pending updates
15215 * have processed.
15216 *
15217 * @param {ReactClass} publicInstance The instance to use as `this` context.
15218 * @param {?function} callback Called after state is updated.
15219 * @internal
15220 */
15221
15222
15223 ReactServerUpdateQueue.prototype.enqueueCallback = function enqueueCallback(publicInstance, callback, callerName) {
15224 if (this.transaction.isInTransaction()) {
15225 ReactUpdateQueue.enqueueCallback(publicInstance, callback, callerName);
15226 }
15227 };
15228
15229 /**
15230 * Forces an update. This should only be invoked when it is known with
15231 * certainty that we are **not** in a DOM transaction.
15232 *
15233 * You may want to call this when you know that some deeper aspect of the
15234 * component's state has changed but `setState` was not called.
15235 *
15236 * This will not invoke `shouldComponentUpdate`, but it will invoke
15237 * `componentWillUpdate` and `componentDidUpdate`.
15238 *
15239 * @param {ReactClass} publicInstance The instance that should rerender.
15240 * @internal
15241 */
15242
15243
15244 ReactServerUpdateQueue.prototype.enqueueForceUpdate = function enqueueForceUpdate(publicInstance) {
15245 if (this.transaction.isInTransaction()) {
15246 ReactUpdateQueue.enqueueForceUpdate(publicInstance);
15247 } else {
15248 warnNoop(publicInstance, 'forceUpdate');
15249 }
15250 };
15251
15252 /**
15253 * Replaces all of the state. Always use this or `setState` to mutate state.
15254 * You should treat `this.state` as immutable.
15255 *
15256 * There is no guarantee that `this.state` will be immediately updated, so
15257 * accessing `this.state` after calling this method may return the old value.
15258 *
15259 * @param {ReactClass} publicInstance The instance that should rerender.
15260 * @param {object|function} completeState Next state.
15261 * @internal
15262 */
15263
15264
15265 ReactServerUpdateQueue.prototype.enqueueReplaceState = function enqueueReplaceState(publicInstance, completeState) {
15266 if (this.transaction.isInTransaction()) {
15267 ReactUpdateQueue.enqueueReplaceState(publicInstance, completeState);
15268 } else {
15269 warnNoop(publicInstance, 'replaceState');
15270 }
15271 };
15272
15273 /**
15274 * Sets a subset of the state. This only exists because _pendingState is
15275 * internal. This provides a merging strategy that is not available to deep
15276 * properties which is confusing. TODO: Expose pendingState or don't use it
15277 * during the merge.
15278 *
15279 * @param {ReactClass} publicInstance The instance that should rerender.
15280 * @param {object|function} partialState Next partial state to be merged with state.
15281 * @internal
15282 */
15283
15284
15285 ReactServerUpdateQueue.prototype.enqueueSetState = function enqueueSetState(publicInstance, partialState) {
15286 if (this.transaction.isInTransaction()) {
15287 ReactUpdateQueue.enqueueSetState(publicInstance, partialState);
15288 } else {
15289 warnNoop(publicInstance, 'setState');
15290 }
15291 };
15292
15293 return ReactServerUpdateQueue;
15294}();
15295
15296module.exports = ReactServerUpdateQueue;
15297},{"106":106,"127":127,"187":187}],101:[function(_dereq_,module,exports){
15298/**
15299 * Copyright 2013-present, Facebook, Inc.
15300 * All rights reserved.
15301 *
15302 * This source code is licensed under the BSD-style license found in the
15303 * LICENSE file in the root directory of this source tree. An additional grant
15304 * of patent rights can be found in the PATENTS file in the same directory.
15305 *
15306 * @providesModule ReactStateSetters
15307 */
15308
15309'use strict';
15310
15311var ReactStateSetters = {
15312 /**
15313 * Returns a function that calls the provided function, and uses the result
15314 * of that to set the component's state.
15315 *
15316 * @param {ReactCompositeComponent} component
15317 * @param {function} funcReturningState Returned callback uses this to
15318 * determine how to update state.
15319 * @return {function} callback that when invoked uses funcReturningState to
15320 * determined the object literal to setState.
15321 */
15322 createStateSetter: function (component, funcReturningState) {
15323 return function (a, b, c, d, e, f) {
15324 var partialState = funcReturningState.call(component, a, b, c, d, e, f);
15325 if (partialState) {
15326 component.setState(partialState);
15327 }
15328 };
15329 },
15330
15331 /**
15332 * Returns a single-argument callback that can be used to update a single
15333 * key in the component's state.
15334 *
15335 * Note: this is memoized function, which makes it inexpensive to call.
15336 *
15337 * @param {ReactCompositeComponent} component
15338 * @param {string} key The key in the state that you should update.
15339 * @return {function} callback of 1 argument which calls setState() with
15340 * the provided keyName and callback argument.
15341 */
15342 createStateKeySetter: function (component, key) {
15343 // Memoize the setters.
15344 var cache = component.__keySetters || (component.__keySetters = {});
15345 return cache[key] || (cache[key] = createStateKeySetter(component, key));
15346 }
15347};
15348
15349function createStateKeySetter(component, key) {
15350 // Partial state is allocated outside of the function closure so it can be
15351 // reused with every call, avoiding memory allocation when this function
15352 // is called.
15353 var partialState = {};
15354 return function stateKeySetter(value) {
15355 partialState[key] = value;
15356 component.setState(partialState);
15357 };
15358}
15359
15360ReactStateSetters.Mixin = {
15361 /**
15362 * Returns a function that calls the provided function, and uses the result
15363 * of that to set the component's state.
15364 *
15365 * For example, these statements are equivalent:
15366 *
15367 * this.setState({x: 1});
15368 * this.createStateSetter(function(xValue) {
15369 * return {x: xValue};
15370 * })(1);
15371 *
15372 * @param {function} funcReturningState Returned callback uses this to
15373 * determine how to update state.
15374 * @return {function} callback that when invoked uses funcReturningState to
15375 * determined the object literal to setState.
15376 */
15377 createStateSetter: function (funcReturningState) {
15378 return ReactStateSetters.createStateSetter(this, funcReturningState);
15379 },
15380
15381 /**
15382 * Returns a single-argument callback that can be used to update a single
15383 * key in the component's state.
15384 *
15385 * For example, these statements are equivalent:
15386 *
15387 * this.setState({x: 1});
15388 * this.createStateKeySetter('x')(1);
15389 *
15390 * Note: this is memoized function, which makes it inexpensive to call.
15391 *
15392 * @param {string} key The key in the state that you should update.
15393 * @return {function} callback of 1 argument which calls setState() with
15394 * the provided keyName and callback argument.
15395 */
15396 createStateKeySetter: function (key) {
15397 return ReactStateSetters.createStateKeySetter(this, key);
15398 }
15399};
15400
15401module.exports = ReactStateSetters;
15402},{}],102:[function(_dereq_,module,exports){
15403/**
15404 * Copyright 2013-present, Facebook, Inc.
15405 * All rights reserved.
15406 *
15407 * This source code is licensed under the BSD-style license found in the
15408 * LICENSE file in the root directory of this source tree. An additional grant
15409 * of patent rights can be found in the PATENTS file in the same directory.
15410 *
15411 * @providesModule ReactTestUtils
15412 */
15413
15414'use strict';
15415
15416var _prodInvariant = _dereq_(153),
15417 _assign = _dereq_(188);
15418
15419var EventConstants = _dereq_(16);
15420var EventPluginHub = _dereq_(17);
15421var EventPluginRegistry = _dereq_(18);
15422var EventPropagators = _dereq_(20);
15423var React = _dereq_(27);
15424var ReactDefaultInjection = _dereq_(64);
15425var ReactDOM = _dereq_(42);
15426var ReactDOMComponentTree = _dereq_(46);
15427var ReactElement = _dereq_(65);
15428var ReactBrowserEventEmitter = _dereq_(28);
15429var ReactCompositeComponent = _dereq_(40);
15430var ReactInstanceMap = _dereq_(77);
15431var ReactReconciler = _dereq_(95);
15432var ReactUpdates = _dereq_(107);
15433var SyntheticEvent = _dereq_(118);
15434
15435var emptyObject = _dereq_(171);
15436var findDOMNode = _dereq_(136);
15437var invariant = _dereq_(178);
15438
15439var topLevelTypes = EventConstants.topLevelTypes;
15440
15441function Event(suffix) {}
15442
15443/**
15444 * @class ReactTestUtils
15445 */
15446
15447function findAllInRenderedTreeInternal(inst, test) {
15448 if (!inst || !inst.getPublicInstance) {
15449 return [];
15450 }
15451 var publicInst = inst.getPublicInstance();
15452 var ret = test(publicInst) ? [publicInst] : [];
15453 var currentElement = inst._currentElement;
15454 if (ReactTestUtils.isDOMComponent(publicInst)) {
15455 var renderedChildren = inst._renderedChildren;
15456 var key;
15457 for (key in renderedChildren) {
15458 if (!renderedChildren.hasOwnProperty(key)) {
15459 continue;
15460 }
15461 ret = ret.concat(findAllInRenderedTreeInternal(renderedChildren[key], test));
15462 }
15463 } else if (ReactElement.isValidElement(currentElement) && typeof currentElement.type === 'function') {
15464 ret = ret.concat(findAllInRenderedTreeInternal(inst._renderedComponent, test));
15465 }
15466 return ret;
15467}
15468
15469/**
15470 * Utilities for making it easy to test React components.
15471 *
15472 * See https://facebook.github.io/react/docs/test-utils.html
15473 *
15474 * Todo: Support the entire DOM.scry query syntax. For now, these simple
15475 * utilities will suffice for testing purposes.
15476 * @lends ReactTestUtils
15477 */
15478var ReactTestUtils = {
15479 renderIntoDocument: function (instance) {
15480 var div = document.createElement('div');
15481 // None of our tests actually require attaching the container to the
15482 // DOM, and doing so creates a mess that we rely on test isolation to
15483 // clean up, so we're going to stop honoring the name of this method
15484 // (and probably rename it eventually) if no problems arise.
15485 // document.documentElement.appendChild(div);
15486 return ReactDOM.render(instance, div);
15487 },
15488
15489 isElement: function (element) {
15490 return ReactElement.isValidElement(element);
15491 },
15492
15493 isElementOfType: function (inst, convenienceConstructor) {
15494 return ReactElement.isValidElement(inst) && inst.type === convenienceConstructor;
15495 },
15496
15497 isDOMComponent: function (inst) {
15498 return !!(inst && inst.nodeType === 1 && inst.tagName);
15499 },
15500
15501 isDOMComponentElement: function (inst) {
15502 return !!(inst && ReactElement.isValidElement(inst) && !!inst.tagName);
15503 },
15504
15505 isCompositeComponent: function (inst) {
15506 if (ReactTestUtils.isDOMComponent(inst)) {
15507 // Accessing inst.setState warns; just return false as that'll be what
15508 // this returns when we have DOM nodes as refs directly
15509 return false;
15510 }
15511 return inst != null && typeof inst.render === 'function' && typeof inst.setState === 'function';
15512 },
15513
15514 isCompositeComponentWithType: function (inst, type) {
15515 if (!ReactTestUtils.isCompositeComponent(inst)) {
15516 return false;
15517 }
15518 var internalInstance = ReactInstanceMap.get(inst);
15519 var constructor = internalInstance._currentElement.type;
15520
15521 return constructor === type;
15522 },
15523
15524 isCompositeComponentElement: function (inst) {
15525 if (!ReactElement.isValidElement(inst)) {
15526 return false;
15527 }
15528 // We check the prototype of the type that will get mounted, not the
15529 // instance itself. This is a future proof way of duck typing.
15530 var prototype = inst.type.prototype;
15531 return typeof prototype.render === 'function' && typeof prototype.setState === 'function';
15532 },
15533
15534 isCompositeComponentElementWithType: function (inst, type) {
15535 var internalInstance = ReactInstanceMap.get(inst);
15536 var constructor = internalInstance._currentElement.type;
15537
15538 return !!(ReactTestUtils.isCompositeComponentElement(inst) && constructor === type);
15539 },
15540
15541 getRenderedChildOfCompositeComponent: function (inst) {
15542 if (!ReactTestUtils.isCompositeComponent(inst)) {
15543 return null;
15544 }
15545 var internalInstance = ReactInstanceMap.get(inst);
15546 return internalInstance._renderedComponent.getPublicInstance();
15547 },
15548
15549 findAllInRenderedTree: function (inst, test) {
15550 if (!inst) {
15551 return [];
15552 }
15553 !ReactTestUtils.isCompositeComponent(inst) ? "development" !== 'production' ? invariant(false, 'findAllInRenderedTree(...): instance must be a composite component') : _prodInvariant('10') : void 0;
15554 return findAllInRenderedTreeInternal(ReactInstanceMap.get(inst), test);
15555 },
15556
15557 /**
15558 * Finds all instance of components in the rendered tree that are DOM
15559 * components with the class name matching `className`.
15560 * @return {array} an array of all the matches.
15561 */
15562 scryRenderedDOMComponentsWithClass: function (root, classNames) {
15563 return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
15564 if (ReactTestUtils.isDOMComponent(inst)) {
15565 var className = inst.className;
15566 if (typeof className !== 'string') {
15567 // SVG, probably.
15568 className = inst.getAttribute('class') || '';
15569 }
15570 var classList = className.split(/\s+/);
15571
15572 if (!Array.isArray(classNames)) {
15573 !(classNames !== undefined) ? "development" !== 'production' ? invariant(false, 'TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.') : _prodInvariant('11') : void 0;
15574 classNames = classNames.split(/\s+/);
15575 }
15576 return classNames.every(function (name) {
15577 return classList.indexOf(name) !== -1;
15578 });
15579 }
15580 return false;
15581 });
15582 },
15583
15584 /**
15585 * Like scryRenderedDOMComponentsWithClass but expects there to be one result,
15586 * and returns that one result, or throws exception if there is any other
15587 * number of matches besides one.
15588 * @return {!ReactDOMComponent} The one match.
15589 */
15590 findRenderedDOMComponentWithClass: function (root, className) {
15591 var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);
15592 if (all.length !== 1) {
15593 throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for class:' + className);
15594 }
15595 return all[0];
15596 },
15597
15598 /**
15599 * Finds all instance of components in the rendered tree that are DOM
15600 * components with the tag name matching `tagName`.
15601 * @return {array} an array of all the matches.
15602 */
15603 scryRenderedDOMComponentsWithTag: function (root, tagName) {
15604 return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
15605 return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase();
15606 });
15607 },
15608
15609 /**
15610 * Like scryRenderedDOMComponentsWithTag but expects there to be one result,
15611 * and returns that one result, or throws exception if there is any other
15612 * number of matches besides one.
15613 * @return {!ReactDOMComponent} The one match.
15614 */
15615 findRenderedDOMComponentWithTag: function (root, tagName) {
15616 var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName);
15617 if (all.length !== 1) {
15618 throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for tag:' + tagName);
15619 }
15620 return all[0];
15621 },
15622
15623 /**
15624 * Finds all instances of components with type equal to `componentType`.
15625 * @return {array} an array of all the matches.
15626 */
15627 scryRenderedComponentsWithType: function (root, componentType) {
15628 return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
15629 return ReactTestUtils.isCompositeComponentWithType(inst, componentType);
15630 });
15631 },
15632
15633 /**
15634 * Same as `scryRenderedComponentsWithType` but expects there to be one result
15635 * and returns that one result, or throws exception if there is any other
15636 * number of matches besides one.
15637 * @return {!ReactComponent} The one match.
15638 */
15639 findRenderedComponentWithType: function (root, componentType) {
15640 var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType);
15641 if (all.length !== 1) {
15642 throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for componentType:' + componentType);
15643 }
15644 return all[0];
15645 },
15646
15647 /**
15648 * Pass a mocked component module to this method to augment it with
15649 * useful methods that allow it to be used as a dummy React component.
15650 * Instead of rendering as usual, the component will become a simple
15651 * <div> containing any provided children.
15652 *
15653 * @param {object} module the mock function object exported from a
15654 * module that defines the component to be mocked
15655 * @param {?string} mockTagName optional dummy root tag name to return
15656 * from render method (overrides
15657 * module.mockTagName if provided)
15658 * @return {object} the ReactTestUtils object (for chaining)
15659 */
15660 mockComponent: function (module, mockTagName) {
15661 mockTagName = mockTagName || module.mockTagName || 'div';
15662
15663 module.prototype.render.mockImplementation(function () {
15664 return React.createElement(mockTagName, null, this.props.children);
15665 });
15666
15667 return this;
15668 },
15669
15670 /**
15671 * Simulates a top level event being dispatched from a raw event that occurred
15672 * on an `Element` node.
15673 * @param {Object} topLevelType A type from `EventConstants.topLevelTypes`
15674 * @param {!Element} node The dom to simulate an event occurring on.
15675 * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
15676 */
15677 simulateNativeEventOnNode: function (topLevelType, node, fakeNativeEvent) {
15678 fakeNativeEvent.target = node;
15679 ReactBrowserEventEmitter.ReactEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
15680 },
15681
15682 /**
15683 * Simulates a top level event being dispatched from a raw event that occurred
15684 * on the `ReactDOMComponent` `comp`.
15685 * @param {Object} topLevelType A type from `EventConstants.topLevelTypes`.
15686 * @param {!ReactDOMComponent} comp
15687 * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
15688 */
15689 simulateNativeEventOnDOMComponent: function (topLevelType, comp, fakeNativeEvent) {
15690 ReactTestUtils.simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent);
15691 },
15692
15693 nativeTouchData: function (x, y) {
15694 return {
15695 touches: [{ pageX: x, pageY: y }]
15696 };
15697 },
15698
15699 createRenderer: function () {
15700 return new ReactShallowRenderer();
15701 },
15702
15703 Simulate: null,
15704 SimulateNative: {}
15705};
15706
15707/**
15708 * @class ReactShallowRenderer
15709 */
15710var ReactShallowRenderer = function () {
15711 this._instance = null;
15712};
15713
15714ReactShallowRenderer.prototype.getMountedInstance = function () {
15715 return this._instance ? this._instance._instance : null;
15716};
15717
15718var nextDebugID = 1;
15719
15720var NoopInternalComponent = function (element) {
15721 this._renderedOutput = element;
15722 this._currentElement = element;
15723
15724 if ("development" !== 'production') {
15725 this._debugID = nextDebugID++;
15726 }
15727};
15728
15729NoopInternalComponent.prototype = {
15730
15731 mountComponent: function () {},
15732
15733 receiveComponent: function (element) {
15734 this._renderedOutput = element;
15735 this._currentElement = element;
15736 },
15737
15738 getHostNode: function () {
15739 return undefined;
15740 },
15741
15742 unmountComponent: function () {},
15743
15744 getPublicInstance: function () {
15745 return null;
15746 }
15747};
15748
15749var ShallowComponentWrapper = function (element) {
15750 // TODO: Consolidate with instantiateReactComponent
15751 if ("development" !== 'production') {
15752 this._debugID = nextDebugID++;
15753 }
15754
15755 this.construct(element);
15756};
15757_assign(ShallowComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
15758 _constructComponent: ReactCompositeComponent.Mixin._constructComponentWithoutOwner,
15759 _instantiateReactComponent: function (element) {
15760 return new NoopInternalComponent(element);
15761 },
15762 _replaceNodeWithMarkup: function () {},
15763 _renderValidatedComponent: ReactCompositeComponent.Mixin._renderValidatedComponentWithoutOwnerOrContext
15764});
15765
15766ReactShallowRenderer.prototype.render = function (element, context) {
15767 // Ensure we've done the default injections. This might not be true in the
15768 // case of a simple test that only requires React and the TestUtils in
15769 // conjunction with an inline-requires transform.
15770 ReactDefaultInjection.inject();
15771
15772 !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.' : '') : _prodInvariant('12', typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') : void 0;
15773 !(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) : _prodInvariant('13', element.type) : void 0;
15774
15775 if (!context) {
15776 context = emptyObject;
15777 }
15778 ReactUpdates.batchedUpdates(_batchedRender, this, element, context);
15779
15780 return this.getRenderOutput();
15781};
15782
15783function _batchedRender(renderer, element, context) {
15784 var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(true);
15785 renderer._render(element, transaction, context);
15786 ReactUpdates.ReactReconcileTransaction.release(transaction);
15787}
15788
15789ReactShallowRenderer.prototype.getRenderOutput = function () {
15790 return this._instance && this._instance._renderedComponent && this._instance._renderedComponent._renderedOutput || null;
15791};
15792
15793ReactShallowRenderer.prototype.unmount = function () {
15794 if (this._instance) {
15795 ReactReconciler.unmountComponent(this._instance, false);
15796 }
15797};
15798
15799ReactShallowRenderer.prototype._render = function (element, transaction, context) {
15800 if (this._instance) {
15801 ReactReconciler.receiveComponent(this._instance, element, transaction, context);
15802 } else {
15803 var instance = new ShallowComponentWrapper(element);
15804 ReactReconciler.mountComponent(instance, transaction, null, null, context, 0);
15805 this._instance = instance;
15806 }
15807};
15808
15809/**
15810 * Exports:
15811 *
15812 * - `ReactTestUtils.Simulate.click(Element/ReactDOMComponent)`
15813 * - `ReactTestUtils.Simulate.mouseMove(Element/ReactDOMComponent)`
15814 * - `ReactTestUtils.Simulate.change(Element/ReactDOMComponent)`
15815 * - ... (All keys from event plugin `eventTypes` objects)
15816 */
15817function makeSimulator(eventType) {
15818 return function (domComponentOrNode, eventData) {
15819 var node;
15820 !!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.') : _prodInvariant('14') : void 0;
15821 if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
15822 node = findDOMNode(domComponentOrNode);
15823 } else if (domComponentOrNode.tagName) {
15824 node = domComponentOrNode;
15825 }
15826
15827 var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];
15828
15829 var fakeNativeEvent = new Event();
15830 fakeNativeEvent.target = node;
15831 fakeNativeEvent.type = eventType.toLowerCase();
15832
15833 // We don't use SyntheticEvent.getPooled in order to not have to worry about
15834 // properly destroying any properties assigned from `eventData` upon release
15835 var event = new SyntheticEvent(dispatchConfig, ReactDOMComponentTree.getInstanceFromNode(node), fakeNativeEvent, node);
15836 // Since we aren't using pooling, always persist the event. This will make
15837 // sure it's marked and won't warn when setting additional properties.
15838 event.persist();
15839 _assign(event, eventData);
15840
15841 if (dispatchConfig.phasedRegistrationNames) {
15842 EventPropagators.accumulateTwoPhaseDispatches(event);
15843 } else {
15844 EventPropagators.accumulateDirectDispatches(event);
15845 }
15846
15847 ReactUpdates.batchedUpdates(function () {
15848 EventPluginHub.enqueueEvents(event);
15849 EventPluginHub.processEventQueue(true);
15850 });
15851 };
15852}
15853
15854function buildSimulators() {
15855 ReactTestUtils.Simulate = {};
15856
15857 var eventType;
15858 for (eventType in EventPluginRegistry.eventNameDispatchConfigs) {
15859 /**
15860 * @param {!Element|ReactDOMComponent} domComponentOrNode
15861 * @param {?object} eventData Fake event data to use in SyntheticEvent.
15862 */
15863 ReactTestUtils.Simulate[eventType] = makeSimulator(eventType);
15864 }
15865}
15866
15867// Rebuild ReactTestUtils.Simulate whenever event plugins are injected
15868var oldInjectEventPluginOrder = EventPluginHub.injection.injectEventPluginOrder;
15869EventPluginHub.injection.injectEventPluginOrder = function () {
15870 oldInjectEventPluginOrder.apply(this, arguments);
15871 buildSimulators();
15872};
15873var oldInjectEventPlugins = EventPluginHub.injection.injectEventPluginsByName;
15874EventPluginHub.injection.injectEventPluginsByName = function () {
15875 oldInjectEventPlugins.apply(this, arguments);
15876 buildSimulators();
15877};
15878
15879buildSimulators();
15880
15881/**
15882 * Exports:
15883 *
15884 * - `ReactTestUtils.SimulateNative.click(Element/ReactDOMComponent)`
15885 * - `ReactTestUtils.SimulateNative.mouseMove(Element/ReactDOMComponent)`
15886 * - `ReactTestUtils.SimulateNative.mouseIn/ReactDOMComponent)`
15887 * - `ReactTestUtils.SimulateNative.mouseOut(Element/ReactDOMComponent)`
15888 * - ... (All keys from `EventConstants.topLevelTypes`)
15889 *
15890 * Note: Top level event types are a subset of the entire set of handler types
15891 * (which include a broader set of "synthetic" events). For example, onDragDone
15892 * is a synthetic event. Except when testing an event plugin or React's event
15893 * handling code specifically, you probably want to use ReactTestUtils.Simulate
15894 * to dispatch synthetic events.
15895 */
15896
15897function makeNativeSimulator(eventType) {
15898 return function (domComponentOrNode, nativeEventData) {
15899 var fakeNativeEvent = new Event(eventType);
15900 _assign(fakeNativeEvent, nativeEventData);
15901 if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
15902 ReactTestUtils.simulateNativeEventOnDOMComponent(eventType, domComponentOrNode, fakeNativeEvent);
15903 } else if (domComponentOrNode.tagName) {
15904 // Will allow on actual dom nodes.
15905 ReactTestUtils.simulateNativeEventOnNode(eventType, domComponentOrNode, fakeNativeEvent);
15906 }
15907 };
15908}
15909
15910Object.keys(topLevelTypes).forEach(function (eventType) {
15911 // Event type is stored as 'topClick' - we transform that to 'click'
15912 var convenienceName = eventType.indexOf('top') === 0 ? eventType.charAt(3).toLowerCase() + eventType.substr(4) : eventType;
15913 /**
15914 * @param {!Element|ReactDOMComponent} domComponentOrNode
15915 * @param {?Event} nativeEventData Fake native event to use in SyntheticEvent.
15916 */
15917 ReactTestUtils.SimulateNative[convenienceName] = makeNativeSimulator(eventType);
15918});
15919
15920module.exports = ReactTestUtils;
15921},{"107":107,"118":118,"136":136,"153":153,"16":16,"17":17,"171":171,"178":178,"18":18,"188":188,"20":20,"27":27,"28":28,"40":40,"42":42,"46":46,"64":64,"65":65,"77":77,"95":95}],103:[function(_dereq_,module,exports){
15922/**
15923 * Copyright 2013-present, Facebook, Inc.
15924 * All rights reserved.
15925 *
15926 * This source code is licensed under the BSD-style license found in the
15927 * LICENSE file in the root directory of this source tree. An additional grant
15928 * of patent rights can be found in the PATENTS file in the same directory.
15929 *
15930 * @providesModule ReactTransitionChildMapping
15931 */
15932
15933'use strict';
15934
15935var flattenChildren = _dereq_(137);
15936
15937var ReactTransitionChildMapping = {
15938 /**
15939 * Given `this.props.children`, return an object mapping key to child. Just
15940 * simple syntactic sugar around flattenChildren().
15941 *
15942 * @param {*} children `this.props.children`
15943 * @param {number=} selfDebugID Optional debugID of the current internal instance.
15944 * @return {object} Mapping of key to child
15945 */
15946 getChildMapping: function (children, selfDebugID) {
15947 if (!children) {
15948 return children;
15949 }
15950
15951 if ("development" !== 'production') {
15952 return flattenChildren(children, selfDebugID);
15953 }
15954
15955 return flattenChildren(children);
15956 },
15957
15958 /**
15959 * When you're adding or removing children some may be added or removed in the
15960 * same render pass. We want to show *both* since we want to simultaneously
15961 * animate elements in and out. This function takes a previous set of keys
15962 * and a new set of keys and merges them with its best guess of the correct
15963 * ordering. In the future we may expose some of the utilities in
15964 * ReactMultiChild to make this easy, but for now React itself does not
15965 * directly have this concept of the union of prevChildren and nextChildren
15966 * so we implement it here.
15967 *
15968 * @param {object} prev prev children as returned from
15969 * `ReactTransitionChildMapping.getChildMapping()`.
15970 * @param {object} next next children as returned from
15971 * `ReactTransitionChildMapping.getChildMapping()`.
15972 * @return {object} a key set that contains all keys in `prev` and all keys
15973 * in `next` in a reasonable order.
15974 */
15975 mergeChildMappings: function (prev, next) {
15976 prev = prev || {};
15977 next = next || {};
15978
15979 function getValueForKey(key) {
15980 if (next.hasOwnProperty(key)) {
15981 return next[key];
15982 } else {
15983 return prev[key];
15984 }
15985 }
15986
15987 // For each key of `next`, the list of keys to insert before that key in
15988 // the combined list
15989 var nextKeysPending = {};
15990
15991 var pendingKeys = [];
15992 for (var prevKey in prev) {
15993 if (next.hasOwnProperty(prevKey)) {
15994 if (pendingKeys.length) {
15995 nextKeysPending[prevKey] = pendingKeys;
15996 pendingKeys = [];
15997 }
15998 } else {
15999 pendingKeys.push(prevKey);
16000 }
16001 }
16002
16003 var i;
16004 var childMapping = {};
16005 for (var nextKey in next) {
16006 if (nextKeysPending.hasOwnProperty(nextKey)) {
16007 for (i = 0; i < nextKeysPending[nextKey].length; i++) {
16008 var pendingNextKey = nextKeysPending[nextKey][i];
16009 childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
16010 }
16011 }
16012 childMapping[nextKey] = getValueForKey(nextKey);
16013 }
16014
16015 // Finally, add the keys which didn't appear before any key in `next`
16016 for (i = 0; i < pendingKeys.length; i++) {
16017 childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
16018 }
16019
16020 return childMapping;
16021 }
16022};
16023
16024module.exports = ReactTransitionChildMapping;
16025},{"137":137}],104:[function(_dereq_,module,exports){
16026/**
16027 * Copyright 2013-present, Facebook, Inc.
16028 * All rights reserved.
16029 *
16030 * This source code is licensed under the BSD-style license found in the
16031 * LICENSE file in the root directory of this source tree. An additional grant
16032 * of patent rights can be found in the PATENTS file in the same directory.
16033 *
16034 * @providesModule ReactTransitionEvents
16035 */
16036
16037'use strict';
16038
16039var ExecutionEnvironment = _dereq_(164);
16040
16041var getVendorPrefixedEventName = _dereq_(147);
16042
16043var endEvents = [];
16044
16045function detectEvents() {
16046 var animEnd = getVendorPrefixedEventName('animationend');
16047 var transEnd = getVendorPrefixedEventName('transitionend');
16048
16049 if (animEnd) {
16050 endEvents.push(animEnd);
16051 }
16052
16053 if (transEnd) {
16054 endEvents.push(transEnd);
16055 }
16056}
16057
16058if (ExecutionEnvironment.canUseDOM) {
16059 detectEvents();
16060}
16061
16062// We use the raw {add|remove}EventListener() call because EventListener
16063// does not know how to remove event listeners and we really should
16064// clean up. Also, these events are not triggered in older browsers
16065// so we should be A-OK here.
16066
16067function addEventListener(node, eventName, eventListener) {
16068 node.addEventListener(eventName, eventListener, false);
16069}
16070
16071function removeEventListener(node, eventName, eventListener) {
16072 node.removeEventListener(eventName, eventListener, false);
16073}
16074
16075var ReactTransitionEvents = {
16076 addEndEventListener: function (node, eventListener) {
16077 if (endEvents.length === 0) {
16078 // If CSS transitions are not supported, trigger an "end animation"
16079 // event immediately.
16080 window.setTimeout(eventListener, 0);
16081 return;
16082 }
16083 endEvents.forEach(function (endEvent) {
16084 addEventListener(node, endEvent, eventListener);
16085 });
16086 },
16087
16088 removeEndEventListener: function (node, eventListener) {
16089 if (endEvents.length === 0) {
16090 return;
16091 }
16092 endEvents.forEach(function (endEvent) {
16093 removeEventListener(node, endEvent, eventListener);
16094 });
16095 }
16096};
16097
16098module.exports = ReactTransitionEvents;
16099},{"147":147,"164":164}],105:[function(_dereq_,module,exports){
16100/**
16101 * Copyright 2013-present, Facebook, Inc.
16102 * All rights reserved.
16103 *
16104 * This source code is licensed under the BSD-style license found in the
16105 * LICENSE file in the root directory of this source tree. An additional grant
16106 * of patent rights can be found in the PATENTS file in the same directory.
16107 *
16108 * @providesModule ReactTransitionGroup
16109 */
16110
16111'use strict';
16112
16113var _assign = _dereq_(188);
16114
16115var React = _dereq_(27);
16116var ReactInstanceMap = _dereq_(77);
16117var ReactTransitionChildMapping = _dereq_(103);
16118
16119var emptyFunction = _dereq_(170);
16120
16121/**
16122 * A basis for animations. When children are declaratively added or removed,
16123 * special lifecycle hooks are called.
16124 * See https://facebook.github.io/react/docs/animation.html#low-level-api-reacttransitiongroup
16125 */
16126var ReactTransitionGroup = React.createClass({
16127 displayName: 'ReactTransitionGroup',
16128
16129 propTypes: {
16130 component: React.PropTypes.any,
16131 childFactory: React.PropTypes.func
16132 },
16133
16134 getDefaultProps: function () {
16135 return {
16136 component: 'span',
16137 childFactory: emptyFunction.thatReturnsArgument
16138 };
16139 },
16140
16141 getInitialState: function () {
16142 return {
16143 // TODO: can we get useful debug information to show at this point?
16144 children: ReactTransitionChildMapping.getChildMapping(this.props.children)
16145 };
16146 },
16147
16148 componentWillMount: function () {
16149 this.currentlyTransitioningKeys = {};
16150 this.keysToEnter = [];
16151 this.keysToLeave = [];
16152 },
16153
16154 componentDidMount: function () {
16155 var initialChildMapping = this.state.children;
16156 for (var key in initialChildMapping) {
16157 if (initialChildMapping[key]) {
16158 this.performAppear(key);
16159 }
16160 }
16161 },
16162
16163 componentWillReceiveProps: function (nextProps) {
16164 var nextChildMapping;
16165 if ("development" !== 'production') {
16166 nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children, ReactInstanceMap.get(this)._debugID);
16167 } else {
16168 nextChildMapping = ReactTransitionChildMapping.getChildMapping(nextProps.children);
16169 }
16170 var prevChildMapping = this.state.children;
16171
16172 this.setState({
16173 children: ReactTransitionChildMapping.mergeChildMappings(prevChildMapping, nextChildMapping)
16174 });
16175
16176 var key;
16177
16178 for (key in nextChildMapping) {
16179 var hasPrev = prevChildMapping && prevChildMapping.hasOwnProperty(key);
16180 if (nextChildMapping[key] && !hasPrev && !this.currentlyTransitioningKeys[key]) {
16181 this.keysToEnter.push(key);
16182 }
16183 }
16184
16185 for (key in prevChildMapping) {
16186 var hasNext = nextChildMapping && nextChildMapping.hasOwnProperty(key);
16187 if (prevChildMapping[key] && !hasNext && !this.currentlyTransitioningKeys[key]) {
16188 this.keysToLeave.push(key);
16189 }
16190 }
16191
16192 // If we want to someday check for reordering, we could do it here.
16193 },
16194
16195 componentDidUpdate: function () {
16196 var keysToEnter = this.keysToEnter;
16197 this.keysToEnter = [];
16198 keysToEnter.forEach(this.performEnter);
16199
16200 var keysToLeave = this.keysToLeave;
16201 this.keysToLeave = [];
16202 keysToLeave.forEach(this.performLeave);
16203 },
16204
16205 performAppear: function (key) {
16206 this.currentlyTransitioningKeys[key] = true;
16207
16208 var component = this.refs[key];
16209
16210 if (component.componentWillAppear) {
16211 component.componentWillAppear(this._handleDoneAppearing.bind(this, key));
16212 } else {
16213 this._handleDoneAppearing(key);
16214 }
16215 },
16216
16217 _handleDoneAppearing: function (key) {
16218 var component = this.refs[key];
16219 if (component.componentDidAppear) {
16220 component.componentDidAppear();
16221 }
16222
16223 delete this.currentlyTransitioningKeys[key];
16224
16225 var currentChildMapping;
16226 if ("development" !== 'production') {
16227 currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children, ReactInstanceMap.get(this)._debugID);
16228 } else {
16229 currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
16230 }
16231
16232 if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
16233 // This was removed before it had fully appeared. Remove it.
16234 this.performLeave(key);
16235 }
16236 },
16237
16238 performEnter: function (key) {
16239 this.currentlyTransitioningKeys[key] = true;
16240
16241 var component = this.refs[key];
16242
16243 if (component.componentWillEnter) {
16244 component.componentWillEnter(this._handleDoneEntering.bind(this, key));
16245 } else {
16246 this._handleDoneEntering(key);
16247 }
16248 },
16249
16250 _handleDoneEntering: function (key) {
16251 var component = this.refs[key];
16252 if (component.componentDidEnter) {
16253 component.componentDidEnter();
16254 }
16255
16256 delete this.currentlyTransitioningKeys[key];
16257
16258 var currentChildMapping;
16259 if ("development" !== 'production') {
16260 currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children, ReactInstanceMap.get(this)._debugID);
16261 } else {
16262 currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
16263 }
16264
16265 if (!currentChildMapping || !currentChildMapping.hasOwnProperty(key)) {
16266 // This was removed before it had fully entered. Remove it.
16267 this.performLeave(key);
16268 }
16269 },
16270
16271 performLeave: function (key) {
16272 this.currentlyTransitioningKeys[key] = true;
16273
16274 var component = this.refs[key];
16275 if (component.componentWillLeave) {
16276 component.componentWillLeave(this._handleDoneLeaving.bind(this, key));
16277 } else {
16278 // Note that this is somewhat dangerous b/c it calls setState()
16279 // again, effectively mutating the component before all the work
16280 // is done.
16281 this._handleDoneLeaving(key);
16282 }
16283 },
16284
16285 _handleDoneLeaving: function (key) {
16286 var component = this.refs[key];
16287
16288 if (component.componentDidLeave) {
16289 component.componentDidLeave();
16290 }
16291
16292 delete this.currentlyTransitioningKeys[key];
16293
16294 var currentChildMapping;
16295 if ("development" !== 'production') {
16296 currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children, ReactInstanceMap.get(this)._debugID);
16297 } else {
16298 currentChildMapping = ReactTransitionChildMapping.getChildMapping(this.props.children);
16299 }
16300
16301 if (currentChildMapping && currentChildMapping.hasOwnProperty(key)) {
16302 // This entered again before it fully left. Add it again.
16303 this.performEnter(key);
16304 } else {
16305 this.setState(function (state) {
16306 var newChildren = _assign({}, state.children);
16307 delete newChildren[key];
16308 return { children: newChildren };
16309 });
16310 }
16311 },
16312
16313 render: function () {
16314 // TODO: we could get rid of the need for the wrapper node
16315 // by cloning a single child
16316 var childrenToRender = [];
16317 for (var key in this.state.children) {
16318 var child = this.state.children[key];
16319 if (child) {
16320 // You may need to apply reactive updates to a child as it is leaving.
16321 // The normal React way to do it won't work since the child will have
16322 // already been removed. In case you need this behavior you can provide
16323 // a childFactory function to wrap every child, even the ones that are
16324 // leaving.
16325 childrenToRender.push(React.cloneElement(this.props.childFactory(child), { ref: key, key: key }));
16326 }
16327 }
16328
16329 // Do not forward ReactTransitionGroup props to primitive DOM nodes
16330 var props = _assign({}, this.props);
16331 delete props.transitionLeave;
16332 delete props.transitionName;
16333 delete props.transitionAppear;
16334 delete props.transitionEnter;
16335 delete props.childFactory;
16336 delete props.transitionLeaveTimeout;
16337 delete props.transitionEnterTimeout;
16338 delete props.transitionAppearTimeout;
16339 delete props.component;
16340
16341 return React.createElement(this.props.component, props, childrenToRender);
16342 }
16343});
16344
16345module.exports = ReactTransitionGroup;
16346},{"103":103,"170":170,"188":188,"27":27,"77":77}],106:[function(_dereq_,module,exports){
16347/**
16348 * Copyright 2015-present, Facebook, Inc.
16349 * All rights reserved.
16350 *
16351 * This source code is licensed under the BSD-style license found in the
16352 * LICENSE file in the root directory of this source tree. An additional grant
16353 * of patent rights can be found in the PATENTS file in the same directory.
16354 *
16355 * @providesModule ReactUpdateQueue
16356 */
16357
16358'use strict';
16359
16360var _prodInvariant = _dereq_(153);
16361
16362var ReactCurrentOwner = _dereq_(41);
16363var ReactInstanceMap = _dereq_(77);
16364var ReactInstrumentation = _dereq_(78);
16365var ReactUpdates = _dereq_(107);
16366
16367var invariant = _dereq_(178);
16368var warning = _dereq_(187);
16369
16370function enqueueUpdate(internalInstance) {
16371 ReactUpdates.enqueueUpdate(internalInstance);
16372}
16373
16374function formatUnexpectedArgument(arg) {
16375 var type = typeof arg;
16376 if (type !== 'object') {
16377 return type;
16378 }
16379 var displayName = arg.constructor && arg.constructor.name || type;
16380 var keys = Object.keys(arg);
16381 if (keys.length > 0 && keys.length < 20) {
16382 return displayName + ' (keys: ' + keys.join(', ') + ')';
16383 }
16384 return displayName;
16385}
16386
16387function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
16388 var internalInstance = ReactInstanceMap.get(publicInstance);
16389 if (!internalInstance) {
16390 if ("development" !== 'production') {
16391 var ctor = publicInstance.constructor;
16392 // Only warn when we have a callerName. Otherwise we should be silent.
16393 // We're probably calling from enqueueCallback. We don't want to warn
16394 // there because we already warned for the corresponding lifecycle method.
16395 "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, ctor && (ctor.displayName || ctor.name) || 'ReactClass') : void 0;
16396 }
16397 return null;
16398 }
16399
16400 if ("development" !== 'production') {
16401 "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;
16402 }
16403
16404 return internalInstance;
16405}
16406
16407/**
16408 * ReactUpdateQueue allows for state updates to be scheduled into a later
16409 * reconciliation step.
16410 */
16411var ReactUpdateQueue = {
16412
16413 /**
16414 * Checks whether or not this composite component is mounted.
16415 * @param {ReactClass} publicInstance The instance we want to test.
16416 * @return {boolean} True if mounted, false otherwise.
16417 * @protected
16418 * @final
16419 */
16420 isMounted: function (publicInstance) {
16421 if ("development" !== 'production') {
16422 var owner = ReactCurrentOwner.current;
16423 if (owner !== null) {
16424 "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;
16425 owner._warnedAboutRefsInRender = true;
16426 }
16427 }
16428 var internalInstance = ReactInstanceMap.get(publicInstance);
16429 if (internalInstance) {
16430 // During componentWillMount and render this will still be null but after
16431 // that will always render to something. At least for now. So we can use
16432 // this hack.
16433 return !!internalInstance._renderedComponent;
16434 } else {
16435 return false;
16436 }
16437 },
16438
16439 /**
16440 * Enqueue a callback that will be executed after all the pending updates
16441 * have processed.
16442 *
16443 * @param {ReactClass} publicInstance The instance to use as `this` context.
16444 * @param {?function} callback Called after state is updated.
16445 * @param {string} callerName Name of the calling function in the public API.
16446 * @internal
16447 */
16448 enqueueCallback: function (publicInstance, callback, callerName) {
16449 ReactUpdateQueue.validateCallback(callback, callerName);
16450 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
16451
16452 // Previously we would throw an error if we didn't have an internal
16453 // instance. Since we want to make it a no-op instead, we mirror the same
16454 // behavior we have in other enqueue* methods.
16455 // We also need to ignore callbacks in componentWillMount. See
16456 // enqueueUpdates.
16457 if (!internalInstance) {
16458 return null;
16459 }
16460
16461 if (internalInstance._pendingCallbacks) {
16462 internalInstance._pendingCallbacks.push(callback);
16463 } else {
16464 internalInstance._pendingCallbacks = [callback];
16465 }
16466 // TODO: The callback here is ignored when setState is called from
16467 // componentWillMount. Either fix it or disallow doing so completely in
16468 // favor of getInitialState. Alternatively, we can disallow
16469 // componentWillMount during server-side rendering.
16470 enqueueUpdate(internalInstance);
16471 },
16472
16473 enqueueCallbackInternal: function (internalInstance, callback) {
16474 if (internalInstance._pendingCallbacks) {
16475 internalInstance._pendingCallbacks.push(callback);
16476 } else {
16477 internalInstance._pendingCallbacks = [callback];
16478 }
16479 enqueueUpdate(internalInstance);
16480 },
16481
16482 /**
16483 * Forces an update. This should only be invoked when it is known with
16484 * certainty that we are **not** in a DOM transaction.
16485 *
16486 * You may want to call this when you know that some deeper aspect of the
16487 * component's state has changed but `setState` was not called.
16488 *
16489 * This will not invoke `shouldComponentUpdate`, but it will invoke
16490 * `componentWillUpdate` and `componentDidUpdate`.
16491 *
16492 * @param {ReactClass} publicInstance The instance that should rerender.
16493 * @internal
16494 */
16495 enqueueForceUpdate: function (publicInstance) {
16496 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
16497
16498 if (!internalInstance) {
16499 return;
16500 }
16501
16502 internalInstance._pendingForceUpdate = true;
16503
16504 enqueueUpdate(internalInstance);
16505 },
16506
16507 /**
16508 * Replaces all of the state. Always use this or `setState` to mutate state.
16509 * You should treat `this.state` as immutable.
16510 *
16511 * There is no guarantee that `this.state` will be immediately updated, so
16512 * accessing `this.state` after calling this method may return the old value.
16513 *
16514 * @param {ReactClass} publicInstance The instance that should rerender.
16515 * @param {object} completeState Next state.
16516 * @internal
16517 */
16518 enqueueReplaceState: function (publicInstance, completeState) {
16519 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
16520
16521 if (!internalInstance) {
16522 return;
16523 }
16524
16525 internalInstance._pendingStateQueue = [completeState];
16526 internalInstance._pendingReplaceState = true;
16527
16528 enqueueUpdate(internalInstance);
16529 },
16530
16531 /**
16532 * Sets a subset of the state. This only exists because _pendingState is
16533 * internal. This provides a merging strategy that is not available to deep
16534 * properties which is confusing. TODO: Expose pendingState or don't use it
16535 * during the merge.
16536 *
16537 * @param {ReactClass} publicInstance The instance that should rerender.
16538 * @param {object} partialState Next partial state to be merged with state.
16539 * @internal
16540 */
16541 enqueueSetState: function (publicInstance, partialState) {
16542 if ("development" !== 'production') {
16543 ReactInstrumentation.debugTool.onSetState();
16544 "development" !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
16545 }
16546
16547 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
16548
16549 if (!internalInstance) {
16550 return;
16551 }
16552
16553 var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
16554 queue.push(partialState);
16555
16556 enqueueUpdate(internalInstance);
16557 },
16558
16559 enqueueElementInternal: function (internalInstance, nextElement, nextContext) {
16560 internalInstance._pendingElement = nextElement;
16561 // TODO: introduce _pendingContext instead of setting it directly.
16562 internalInstance._context = nextContext;
16563 enqueueUpdate(internalInstance);
16564 },
16565
16566 validateCallback: function (callback, callerName) {
16567 !(!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)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0;
16568 }
16569
16570};
16571
16572module.exports = ReactUpdateQueue;
16573},{"107":107,"153":153,"178":178,"187":187,"41":41,"77":77,"78":78}],107:[function(_dereq_,module,exports){
16574/**
16575 * Copyright 2013-present, Facebook, Inc.
16576 * All rights reserved.
16577 *
16578 * This source code is licensed under the BSD-style license found in the
16579 * LICENSE file in the root directory of this source tree. An additional grant
16580 * of patent rights can be found in the PATENTS file in the same directory.
16581 *
16582 * @providesModule ReactUpdates
16583 */
16584
16585'use strict';
16586
16587var _prodInvariant = _dereq_(153),
16588 _assign = _dereq_(188);
16589
16590var CallbackQueue = _dereq_(5);
16591var PooledClass = _dereq_(26);
16592var ReactFeatureFlags = _dereq_(71);
16593var ReactReconciler = _dereq_(95);
16594var Transaction = _dereq_(127);
16595
16596var invariant = _dereq_(178);
16597
16598var dirtyComponents = [];
16599var updateBatchNumber = 0;
16600var asapCallbackQueue = CallbackQueue.getPooled();
16601var asapEnqueued = false;
16602
16603var batchingStrategy = null;
16604
16605function ensureInjected() {
16606 !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0;
16607}
16608
16609var NESTED_UPDATES = {
16610 initialize: function () {
16611 this.dirtyComponentsLength = dirtyComponents.length;
16612 },
16613 close: function () {
16614 if (this.dirtyComponentsLength !== dirtyComponents.length) {
16615 // Additional updates were enqueued by componentDidUpdate handlers or
16616 // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
16617 // these new updates so that if A's componentDidUpdate calls setState on
16618 // B, B will update before the callback A's updater provided when calling
16619 // setState.
16620 dirtyComponents.splice(0, this.dirtyComponentsLength);
16621 flushBatchedUpdates();
16622 } else {
16623 dirtyComponents.length = 0;
16624 }
16625 }
16626};
16627
16628var UPDATE_QUEUEING = {
16629 initialize: function () {
16630 this.callbackQueue.reset();
16631 },
16632 close: function () {
16633 this.callbackQueue.notifyAll();
16634 }
16635};
16636
16637var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
16638
16639function ReactUpdatesFlushTransaction() {
16640 this.reinitializeTransaction();
16641 this.dirtyComponentsLength = null;
16642 this.callbackQueue = CallbackQueue.getPooled();
16643 this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
16644 /* useCreateElement */true);
16645}
16646
16647_assign(ReactUpdatesFlushTransaction.prototype, Transaction.Mixin, {
16648 getTransactionWrappers: function () {
16649 return TRANSACTION_WRAPPERS;
16650 },
16651
16652 destructor: function () {
16653 this.dirtyComponentsLength = null;
16654 CallbackQueue.release(this.callbackQueue);
16655 this.callbackQueue = null;
16656 ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
16657 this.reconcileTransaction = null;
16658 },
16659
16660 perform: function (method, scope, a) {
16661 // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
16662 // with this transaction's wrappers around it.
16663 return Transaction.Mixin.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
16664 }
16665});
16666
16667PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
16668
16669function batchedUpdates(callback, a, b, c, d, e) {
16670 ensureInjected();
16671 batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
16672}
16673
16674/**
16675 * Array comparator for ReactComponents by mount ordering.
16676 *
16677 * @param {ReactComponent} c1 first component you're comparing
16678 * @param {ReactComponent} c2 second component you're comparing
16679 * @return {number} Return value usable by Array.prototype.sort().
16680 */
16681function mountOrderComparator(c1, c2) {
16682 return c1._mountOrder - c2._mountOrder;
16683}
16684
16685function runBatchedUpdates(transaction) {
16686 var len = transaction.dirtyComponentsLength;
16687 !(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) : _prodInvariant('124', len, dirtyComponents.length) : void 0;
16688
16689 // Since reconciling a component higher in the owner hierarchy usually (not
16690 // always -- see shouldComponentUpdate()) will reconcile children, reconcile
16691 // them before their children by sorting the array.
16692 dirtyComponents.sort(mountOrderComparator);
16693
16694 // Any updates enqueued while reconciling must be performed after this entire
16695 // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
16696 // C, B could update twice in a single batch if C's render enqueues an update
16697 // to B (since B would have already updated, we should skip it, and the only
16698 // way we can know to do so is by checking the batch counter).
16699 updateBatchNumber++;
16700
16701 for (var i = 0; i < len; i++) {
16702 // If a component is unmounted before pending changes apply, it will still
16703 // be here, but we assume that it has cleared its _pendingCallbacks and
16704 // that performUpdateIfNecessary is a noop.
16705 var component = dirtyComponents[i];
16706
16707 // If performUpdateIfNecessary happens to enqueue any new updates, we
16708 // shouldn't execute the callbacks until the next render happens, so
16709 // stash the callbacks first
16710 var callbacks = component._pendingCallbacks;
16711 component._pendingCallbacks = null;
16712
16713 var markerName;
16714 if (ReactFeatureFlags.logTopLevelRenders) {
16715 var namedComponent = component;
16716 // Duck type TopLevelWrapper. This is probably always true.
16717 if (component._currentElement.props === component._renderedComponent._currentElement) {
16718 namedComponent = component._renderedComponent;
16719 }
16720 markerName = 'React update: ' + namedComponent.getName();
16721 console.time(markerName);
16722 }
16723
16724 ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
16725
16726 if (markerName) {
16727 console.timeEnd(markerName);
16728 }
16729
16730 if (callbacks) {
16731 for (var j = 0; j < callbacks.length; j++) {
16732 transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
16733 }
16734 }
16735 }
16736}
16737
16738var flushBatchedUpdates = function () {
16739 // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
16740 // array and perform any updates enqueued by mount-ready handlers (i.e.,
16741 // componentDidUpdate) but we need to check here too in order to catch
16742 // updates enqueued by setState callbacks and asap calls.
16743 while (dirtyComponents.length || asapEnqueued) {
16744 if (dirtyComponents.length) {
16745 var transaction = ReactUpdatesFlushTransaction.getPooled();
16746 transaction.perform(runBatchedUpdates, null, transaction);
16747 ReactUpdatesFlushTransaction.release(transaction);
16748 }
16749
16750 if (asapEnqueued) {
16751 asapEnqueued = false;
16752 var queue = asapCallbackQueue;
16753 asapCallbackQueue = CallbackQueue.getPooled();
16754 queue.notifyAll();
16755 CallbackQueue.release(queue);
16756 }
16757 }
16758};
16759
16760/**
16761 * Mark a component as needing a rerender, adding an optional callback to a
16762 * list of functions which will be executed once the rerender occurs.
16763 */
16764function enqueueUpdate(component) {
16765 ensureInjected();
16766
16767 // Various parts of our code (such as ReactCompositeComponent's
16768 // _renderValidatedComponent) assume that calls to render aren't nested;
16769 // verify that that's the case. (This is called by each top-level update
16770 // function, like setState, forceUpdate, etc.; creation and
16771 // destruction of top-level components is guarded in ReactMount.)
16772
16773 if (!batchingStrategy.isBatchingUpdates) {
16774 batchingStrategy.batchedUpdates(enqueueUpdate, component);
16775 return;
16776 }
16777
16778 dirtyComponents.push(component);
16779 if (component._updateBatchNumber == null) {
16780 component._updateBatchNumber = updateBatchNumber + 1;
16781 }
16782}
16783
16784/**
16785 * Enqueue a callback to be run at the end of the current batching cycle. Throws
16786 * if no updates are currently being performed.
16787 */
16788function asap(callback, context) {
16789 !batchingStrategy.isBatchingUpdates ? "development" !== 'production' ? invariant(false, 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context whereupdates are not being batched.') : _prodInvariant('125') : void 0;
16790 asapCallbackQueue.enqueue(callback, context);
16791 asapEnqueued = true;
16792}
16793
16794var ReactUpdatesInjection = {
16795 injectReconcileTransaction: function (ReconcileTransaction) {
16796 !ReconcileTransaction ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0;
16797 ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
16798 },
16799
16800 injectBatchingStrategy: function (_batchingStrategy) {
16801 !_batchingStrategy ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0;
16802 !(typeof _batchingStrategy.batchedUpdates === 'function') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0;
16803 !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0;
16804 batchingStrategy = _batchingStrategy;
16805 }
16806};
16807
16808var ReactUpdates = {
16809 /**
16810 * React references `ReactReconcileTransaction` using this property in order
16811 * to allow dependency injection.
16812 *
16813 * @internal
16814 */
16815 ReactReconcileTransaction: null,
16816
16817 batchedUpdates: batchedUpdates,
16818 enqueueUpdate: enqueueUpdate,
16819 flushBatchedUpdates: flushBatchedUpdates,
16820 injection: ReactUpdatesInjection,
16821 asap: asap
16822};
16823
16824module.exports = ReactUpdates;
16825},{"127":127,"153":153,"178":178,"188":188,"26":26,"5":5,"71":71,"95":95}],108:[function(_dereq_,module,exports){
16826/**
16827 * Copyright 2013-present, Facebook, Inc.
16828 * All rights reserved.
16829 *
16830 * This source code is licensed under the BSD-style license found in the
16831 * LICENSE file in the root directory of this source tree. An additional grant
16832 * of patent rights can be found in the PATENTS file in the same directory.
16833 *
16834 * @providesModule ReactVersion
16835 */
16836
16837'use strict';
16838
16839module.exports = '15.3.2';
16840},{}],109:[function(_dereq_,module,exports){
16841/**
16842 * Copyright 2013-present, Facebook, Inc.
16843 * All rights reserved.
16844 *
16845 * This source code is licensed under the BSD-style license found in the
16846 * LICENSE file in the root directory of this source tree. An additional grant
16847 * of patent rights can be found in the PATENTS file in the same directory.
16848 *
16849 * @providesModule ReactWithAddons
16850 */
16851
16852'use strict';
16853
16854var LinkedStateMixin = _dereq_(24);
16855var React = _dereq_(27);
16856var ReactComponentWithPureRenderMixin = _dereq_(39);
16857var ReactCSSTransitionGroup = _dereq_(29);
16858var ReactFragment = _dereq_(72);
16859var ReactTransitionGroup = _dereq_(105);
16860
16861var shallowCompare = _dereq_(157);
16862var update = _dereq_(160);
16863
16864React.addons = {
16865 CSSTransitionGroup: ReactCSSTransitionGroup,
16866 LinkedStateMixin: LinkedStateMixin,
16867 PureRenderMixin: ReactComponentWithPureRenderMixin,
16868 TransitionGroup: ReactTransitionGroup,
16869
16870 createFragment: ReactFragment.create,
16871 shallowCompare: shallowCompare,
16872 update: update
16873};
16874
16875if ("development" !== 'production') {
16876 React.addons.Perf = _dereq_(88);
16877 React.addons.TestUtils = _dereq_(102);
16878}
16879
16880module.exports = React;
16881},{"102":102,"105":105,"157":157,"160":160,"24":24,"27":27,"29":29,"39":39,"72":72,"88":88}],110:[function(_dereq_,module,exports){
16882/**
16883 * Copyright 2013-present, Facebook, Inc.
16884 * All rights reserved.
16885 *
16886 * This source code is licensed under the BSD-style license found in the
16887 * LICENSE file in the root directory of this source tree. An additional grant
16888 * of patent rights can be found in the PATENTS file in the same directory.
16889 *
16890 * @providesModule ReactWithAddonsUMDEntry
16891 */
16892
16893'use strict';
16894
16895var _assign = _dereq_(188);
16896
16897var ReactDOM = _dereq_(42);
16898var ReactDOMServer = _dereq_(57);
16899var ReactWithAddons = _dereq_(109);
16900
16901// `version` will be added here by ReactIsomorphic.
16902var ReactWithAddonsUMDEntry = _assign({
16903 __SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOM,
16904 __SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactDOMServer
16905}, ReactWithAddons);
16906
16907module.exports = ReactWithAddonsUMDEntry;
16908},{"109":109,"188":188,"42":42,"57":57}],111:[function(_dereq_,module,exports){
16909/**
16910 * Copyright 2013-present, Facebook, Inc.
16911 * All rights reserved.
16912 *
16913 * This source code is licensed under the BSD-style license found in the
16914 * LICENSE file in the root directory of this source tree. An additional grant
16915 * of patent rights can be found in the PATENTS file in the same directory.
16916 *
16917 * @providesModule SVGDOMPropertyConfig
16918 */
16919
16920'use strict';
16921
16922var NS = {
16923 xlink: 'http://www.w3.org/1999/xlink',
16924 xml: 'http://www.w3.org/XML/1998/namespace'
16925};
16926
16927// We use attributes for everything SVG so let's avoid some duplication and run
16928// code instead.
16929// The following are all specified in the HTML config already so we exclude here.
16930// - class (as className)
16931// - color
16932// - height
16933// - id
16934// - lang
16935// - max
16936// - media
16937// - method
16938// - min
16939// - name
16940// - style
16941// - target
16942// - type
16943// - width
16944var ATTRS = {
16945 accentHeight: 'accent-height',
16946 accumulate: 0,
16947 additive: 0,
16948 alignmentBaseline: 'alignment-baseline',
16949 allowReorder: 'allowReorder',
16950 alphabetic: 0,
16951 amplitude: 0,
16952 arabicForm: 'arabic-form',
16953 ascent: 0,
16954 attributeName: 'attributeName',
16955 attributeType: 'attributeType',
16956 autoReverse: 'autoReverse',
16957 azimuth: 0,
16958 baseFrequency: 'baseFrequency',
16959 baseProfile: 'baseProfile',
16960 baselineShift: 'baseline-shift',
16961 bbox: 0,
16962 begin: 0,
16963 bias: 0,
16964 by: 0,
16965 calcMode: 'calcMode',
16966 capHeight: 'cap-height',
16967 clip: 0,
16968 clipPath: 'clip-path',
16969 clipRule: 'clip-rule',
16970 clipPathUnits: 'clipPathUnits',
16971 colorInterpolation: 'color-interpolation',
16972 colorInterpolationFilters: 'color-interpolation-filters',
16973 colorProfile: 'color-profile',
16974 colorRendering: 'color-rendering',
16975 contentScriptType: 'contentScriptType',
16976 contentStyleType: 'contentStyleType',
16977 cursor: 0,
16978 cx: 0,
16979 cy: 0,
16980 d: 0,
16981 decelerate: 0,
16982 descent: 0,
16983 diffuseConstant: 'diffuseConstant',
16984 direction: 0,
16985 display: 0,
16986 divisor: 0,
16987 dominantBaseline: 'dominant-baseline',
16988 dur: 0,
16989 dx: 0,
16990 dy: 0,
16991 edgeMode: 'edgeMode',
16992 elevation: 0,
16993 enableBackground: 'enable-background',
16994 end: 0,
16995 exponent: 0,
16996 externalResourcesRequired: 'externalResourcesRequired',
16997 fill: 0,
16998 fillOpacity: 'fill-opacity',
16999 fillRule: 'fill-rule',
17000 filter: 0,
17001 filterRes: 'filterRes',
17002 filterUnits: 'filterUnits',
17003 floodColor: 'flood-color',
17004 floodOpacity: 'flood-opacity',
17005 focusable: 0,
17006 fontFamily: 'font-family',
17007 fontSize: 'font-size',
17008 fontSizeAdjust: 'font-size-adjust',
17009 fontStretch: 'font-stretch',
17010 fontStyle: 'font-style',
17011 fontVariant: 'font-variant',
17012 fontWeight: 'font-weight',
17013 format: 0,
17014 from: 0,
17015 fx: 0,
17016 fy: 0,
17017 g1: 0,
17018 g2: 0,
17019 glyphName: 'glyph-name',
17020 glyphOrientationHorizontal: 'glyph-orientation-horizontal',
17021 glyphOrientationVertical: 'glyph-orientation-vertical',
17022 glyphRef: 'glyphRef',
17023 gradientTransform: 'gradientTransform',
17024 gradientUnits: 'gradientUnits',
17025 hanging: 0,
17026 horizAdvX: 'horiz-adv-x',
17027 horizOriginX: 'horiz-origin-x',
17028 ideographic: 0,
17029 imageRendering: 'image-rendering',
17030 'in': 0,
17031 in2: 0,
17032 intercept: 0,
17033 k: 0,
17034 k1: 0,
17035 k2: 0,
17036 k3: 0,
17037 k4: 0,
17038 kernelMatrix: 'kernelMatrix',
17039 kernelUnitLength: 'kernelUnitLength',
17040 kerning: 0,
17041 keyPoints: 'keyPoints',
17042 keySplines: 'keySplines',
17043 keyTimes: 'keyTimes',
17044 lengthAdjust: 'lengthAdjust',
17045 letterSpacing: 'letter-spacing',
17046 lightingColor: 'lighting-color',
17047 limitingConeAngle: 'limitingConeAngle',
17048 local: 0,
17049 markerEnd: 'marker-end',
17050 markerMid: 'marker-mid',
17051 markerStart: 'marker-start',
17052 markerHeight: 'markerHeight',
17053 markerUnits: 'markerUnits',
17054 markerWidth: 'markerWidth',
17055 mask: 0,
17056 maskContentUnits: 'maskContentUnits',
17057 maskUnits: 'maskUnits',
17058 mathematical: 0,
17059 mode: 0,
17060 numOctaves: 'numOctaves',
17061 offset: 0,
17062 opacity: 0,
17063 operator: 0,
17064 order: 0,
17065 orient: 0,
17066 orientation: 0,
17067 origin: 0,
17068 overflow: 0,
17069 overlinePosition: 'overline-position',
17070 overlineThickness: 'overline-thickness',
17071 paintOrder: 'paint-order',
17072 panose1: 'panose-1',
17073 pathLength: 'pathLength',
17074 patternContentUnits: 'patternContentUnits',
17075 patternTransform: 'patternTransform',
17076 patternUnits: 'patternUnits',
17077 pointerEvents: 'pointer-events',
17078 points: 0,
17079 pointsAtX: 'pointsAtX',
17080 pointsAtY: 'pointsAtY',
17081 pointsAtZ: 'pointsAtZ',
17082 preserveAlpha: 'preserveAlpha',
17083 preserveAspectRatio: 'preserveAspectRatio',
17084 primitiveUnits: 'primitiveUnits',
17085 r: 0,
17086 radius: 0,
17087 refX: 'refX',
17088 refY: 'refY',
17089 renderingIntent: 'rendering-intent',
17090 repeatCount: 'repeatCount',
17091 repeatDur: 'repeatDur',
17092 requiredExtensions: 'requiredExtensions',
17093 requiredFeatures: 'requiredFeatures',
17094 restart: 0,
17095 result: 0,
17096 rotate: 0,
17097 rx: 0,
17098 ry: 0,
17099 scale: 0,
17100 seed: 0,
17101 shapeRendering: 'shape-rendering',
17102 slope: 0,
17103 spacing: 0,
17104 specularConstant: 'specularConstant',
17105 specularExponent: 'specularExponent',
17106 speed: 0,
17107 spreadMethod: 'spreadMethod',
17108 startOffset: 'startOffset',
17109 stdDeviation: 'stdDeviation',
17110 stemh: 0,
17111 stemv: 0,
17112 stitchTiles: 'stitchTiles',
17113 stopColor: 'stop-color',
17114 stopOpacity: 'stop-opacity',
17115 strikethroughPosition: 'strikethrough-position',
17116 strikethroughThickness: 'strikethrough-thickness',
17117 string: 0,
17118 stroke: 0,
17119 strokeDasharray: 'stroke-dasharray',
17120 strokeDashoffset: 'stroke-dashoffset',
17121 strokeLinecap: 'stroke-linecap',
17122 strokeLinejoin: 'stroke-linejoin',
17123 strokeMiterlimit: 'stroke-miterlimit',
17124 strokeOpacity: 'stroke-opacity',
17125 strokeWidth: 'stroke-width',
17126 surfaceScale: 'surfaceScale',
17127 systemLanguage: 'systemLanguage',
17128 tableValues: 'tableValues',
17129 targetX: 'targetX',
17130 targetY: 'targetY',
17131 textAnchor: 'text-anchor',
17132 textDecoration: 'text-decoration',
17133 textRendering: 'text-rendering',
17134 textLength: 'textLength',
17135 to: 0,
17136 transform: 0,
17137 u1: 0,
17138 u2: 0,
17139 underlinePosition: 'underline-position',
17140 underlineThickness: 'underline-thickness',
17141 unicode: 0,
17142 unicodeBidi: 'unicode-bidi',
17143 unicodeRange: 'unicode-range',
17144 unitsPerEm: 'units-per-em',
17145 vAlphabetic: 'v-alphabetic',
17146 vHanging: 'v-hanging',
17147 vIdeographic: 'v-ideographic',
17148 vMathematical: 'v-mathematical',
17149 values: 0,
17150 vectorEffect: 'vector-effect',
17151 version: 0,
17152 vertAdvY: 'vert-adv-y',
17153 vertOriginX: 'vert-origin-x',
17154 vertOriginY: 'vert-origin-y',
17155 viewBox: 'viewBox',
17156 viewTarget: 'viewTarget',
17157 visibility: 0,
17158 widths: 0,
17159 wordSpacing: 'word-spacing',
17160 writingMode: 'writing-mode',
17161 x: 0,
17162 xHeight: 'x-height',
17163 x1: 0,
17164 x2: 0,
17165 xChannelSelector: 'xChannelSelector',
17166 xlinkActuate: 'xlink:actuate',
17167 xlinkArcrole: 'xlink:arcrole',
17168 xlinkHref: 'xlink:href',
17169 xlinkRole: 'xlink:role',
17170 xlinkShow: 'xlink:show',
17171 xlinkTitle: 'xlink:title',
17172 xlinkType: 'xlink:type',
17173 xmlBase: 'xml:base',
17174 xmlns: 0,
17175 xmlnsXlink: 'xmlns:xlink',
17176 xmlLang: 'xml:lang',
17177 xmlSpace: 'xml:space',
17178 y: 0,
17179 y1: 0,
17180 y2: 0,
17181 yChannelSelector: 'yChannelSelector',
17182 z: 0,
17183 zoomAndPan: 'zoomAndPan'
17184};
17185
17186var SVGDOMPropertyConfig = {
17187 Properties: {},
17188 DOMAttributeNamespaces: {
17189 xlinkActuate: NS.xlink,
17190 xlinkArcrole: NS.xlink,
17191 xlinkHref: NS.xlink,
17192 xlinkRole: NS.xlink,
17193 xlinkShow: NS.xlink,
17194 xlinkTitle: NS.xlink,
17195 xlinkType: NS.xlink,
17196 xmlBase: NS.xml,
17197 xmlLang: NS.xml,
17198 xmlSpace: NS.xml
17199 },
17200 DOMAttributeNames: {}
17201};
17202
17203Object.keys(ATTRS).forEach(function (key) {
17204 SVGDOMPropertyConfig.Properties[key] = 0;
17205 if (ATTRS[key]) {
17206 SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
17207 }
17208});
17209
17210module.exports = SVGDOMPropertyConfig;
17211},{}],112:[function(_dereq_,module,exports){
17212/**
17213 * Copyright 2013-present, Facebook, Inc.
17214 * All rights reserved.
17215 *
17216 * This source code is licensed under the BSD-style license found in the
17217 * LICENSE file in the root directory of this source tree. An additional grant
17218 * of patent rights can be found in the PATENTS file in the same directory.
17219 *
17220 * @providesModule SelectEventPlugin
17221 */
17222
17223'use strict';
17224
17225var EventConstants = _dereq_(16);
17226var EventPropagators = _dereq_(20);
17227var ExecutionEnvironment = _dereq_(164);
17228var ReactDOMComponentTree = _dereq_(46);
17229var ReactInputSelection = _dereq_(76);
17230var SyntheticEvent = _dereq_(118);
17231
17232var getActiveElement = _dereq_(173);
17233var isTextInputElement = _dereq_(150);
17234var keyOf = _dereq_(182);
17235var shallowEqual = _dereq_(186);
17236
17237var topLevelTypes = EventConstants.topLevelTypes;
17238
17239var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
17240
17241var eventTypes = {
17242 select: {
17243 phasedRegistrationNames: {
17244 bubbled: keyOf({ onSelect: null }),
17245 captured: keyOf({ onSelectCapture: null })
17246 },
17247 dependencies: [topLevelTypes.topBlur, topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, topLevelTypes.topKeyUp, topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange]
17248 }
17249};
17250
17251var activeElement = null;
17252var activeElementInst = null;
17253var lastSelection = null;
17254var mouseDown = false;
17255
17256// Track whether a listener exists for this plugin. If none exist, we do
17257// not extract events. See #3639.
17258var hasListener = false;
17259var ON_SELECT_KEY = keyOf({ onSelect: null });
17260
17261/**
17262 * Get an object which is a unique representation of the current selection.
17263 *
17264 * The return value will not be consistent across nodes or browsers, but
17265 * two identical selections on the same node will return identical objects.
17266 *
17267 * @param {DOMElement} node
17268 * @return {object}
17269 */
17270function getSelection(node) {
17271 if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
17272 return {
17273 start: node.selectionStart,
17274 end: node.selectionEnd
17275 };
17276 } else if (window.getSelection) {
17277 var selection = window.getSelection();
17278 return {
17279 anchorNode: selection.anchorNode,
17280 anchorOffset: selection.anchorOffset,
17281 focusNode: selection.focusNode,
17282 focusOffset: selection.focusOffset
17283 };
17284 } else if (document.selection) {
17285 var range = document.selection.createRange();
17286 return {
17287 parentElement: range.parentElement(),
17288 text: range.text,
17289 top: range.boundingTop,
17290 left: range.boundingLeft
17291 };
17292 }
17293}
17294
17295/**
17296 * Poll selection to see whether it's changed.
17297 *
17298 * @param {object} nativeEvent
17299 * @return {?SyntheticEvent}
17300 */
17301function constructSelectEvent(nativeEvent, nativeEventTarget) {
17302 // Ensure we have the right element, and that the user is not dragging a
17303 // selection (this matches native `select` event behavior). In HTML5, select
17304 // fires only on input and textarea thus if there's no focused element we
17305 // won't dispatch.
17306 if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
17307 return null;
17308 }
17309
17310 // Only fire when selection has actually changed.
17311 var currentSelection = getSelection(activeElement);
17312 if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
17313 lastSelection = currentSelection;
17314
17315 var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);
17316
17317 syntheticEvent.type = 'select';
17318 syntheticEvent.target = activeElement;
17319
17320 EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
17321
17322 return syntheticEvent;
17323 }
17324
17325 return null;
17326}
17327
17328/**
17329 * This plugin creates an `onSelect` event that normalizes select events
17330 * across form elements.
17331 *
17332 * Supported elements are:
17333 * - input (see `isTextInputElement`)
17334 * - textarea
17335 * - contentEditable
17336 *
17337 * This differs from native browser implementations in the following ways:
17338 * - Fires on contentEditable fields as well as inputs.
17339 * - Fires for collapsed selection.
17340 * - Fires after user input.
17341 */
17342var SelectEventPlugin = {
17343
17344 eventTypes: eventTypes,
17345
17346 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
17347 if (!hasListener) {
17348 return null;
17349 }
17350
17351 var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
17352
17353 switch (topLevelType) {
17354 // Track the input node that has focus.
17355 case topLevelTypes.topFocus:
17356 if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
17357 activeElement = targetNode;
17358 activeElementInst = targetInst;
17359 lastSelection = null;
17360 }
17361 break;
17362 case topLevelTypes.topBlur:
17363 activeElement = null;
17364 activeElementInst = null;
17365 lastSelection = null;
17366 break;
17367
17368 // Don't fire the event while the user is dragging. This matches the
17369 // semantics of the native select event.
17370 case topLevelTypes.topMouseDown:
17371 mouseDown = true;
17372 break;
17373 case topLevelTypes.topContextMenu:
17374 case topLevelTypes.topMouseUp:
17375 mouseDown = false;
17376 return constructSelectEvent(nativeEvent, nativeEventTarget);
17377
17378 // Chrome and IE fire non-standard event when selection is changed (and
17379 // sometimes when it hasn't). IE's event fires out of order with respect
17380 // to key and input events on deletion, so we discard it.
17381 //
17382 // Firefox doesn't support selectionchange, so check selection status
17383 // after each key entry. The selection changes after keydown and before
17384 // keyup, but we check on keydown as well in the case of holding down a
17385 // key, when multiple keydown events are fired but only one keyup is.
17386 // This is also our approach for IE handling, for the reason above.
17387 case topLevelTypes.topSelectionChange:
17388 if (skipSelectionChangeEvent) {
17389 break;
17390 }
17391 // falls through
17392 case topLevelTypes.topKeyDown:
17393 case topLevelTypes.topKeyUp:
17394 return constructSelectEvent(nativeEvent, nativeEventTarget);
17395 }
17396
17397 return null;
17398 },
17399
17400 didPutListener: function (inst, registrationName, listener) {
17401 if (registrationName === ON_SELECT_KEY) {
17402 hasListener = true;
17403 }
17404 }
17405};
17406
17407module.exports = SelectEventPlugin;
17408},{"118":118,"150":150,"16":16,"164":164,"173":173,"182":182,"186":186,"20":20,"46":46,"76":76}],113:[function(_dereq_,module,exports){
17409/**
17410 * Copyright 2013-present, Facebook, Inc.
17411 * All rights reserved.
17412 *
17413 * This source code is licensed under the BSD-style license found in the
17414 * LICENSE file in the root directory of this source tree. An additional grant
17415 * of patent rights can be found in the PATENTS file in the same directory.
17416 *
17417 * @providesModule SimpleEventPlugin
17418 */
17419
17420'use strict';
17421
17422var _prodInvariant = _dereq_(153);
17423
17424var EventConstants = _dereq_(16);
17425var EventListener = _dereq_(163);
17426var EventPropagators = _dereq_(20);
17427var ReactDOMComponentTree = _dereq_(46);
17428var SyntheticAnimationEvent = _dereq_(114);
17429var SyntheticClipboardEvent = _dereq_(115);
17430var SyntheticEvent = _dereq_(118);
17431var SyntheticFocusEvent = _dereq_(119);
17432var SyntheticKeyboardEvent = _dereq_(121);
17433var SyntheticMouseEvent = _dereq_(122);
17434var SyntheticDragEvent = _dereq_(117);
17435var SyntheticTouchEvent = _dereq_(123);
17436var SyntheticTransitionEvent = _dereq_(124);
17437var SyntheticUIEvent = _dereq_(125);
17438var SyntheticWheelEvent = _dereq_(126);
17439
17440var emptyFunction = _dereq_(170);
17441var getEventCharCode = _dereq_(139);
17442var invariant = _dereq_(178);
17443var keyOf = _dereq_(182);
17444
17445var topLevelTypes = EventConstants.topLevelTypes;
17446
17447var eventTypes = {
17448 abort: {
17449 phasedRegistrationNames: {
17450 bubbled: keyOf({ onAbort: true }),
17451 captured: keyOf({ onAbortCapture: true })
17452 }
17453 },
17454 animationEnd: {
17455 phasedRegistrationNames: {
17456 bubbled: keyOf({ onAnimationEnd: true }),
17457 captured: keyOf({ onAnimationEndCapture: true })
17458 }
17459 },
17460 animationIteration: {
17461 phasedRegistrationNames: {
17462 bubbled: keyOf({ onAnimationIteration: true }),
17463 captured: keyOf({ onAnimationIterationCapture: true })
17464 }
17465 },
17466 animationStart: {
17467 phasedRegistrationNames: {
17468 bubbled: keyOf({ onAnimationStart: true }),
17469 captured: keyOf({ onAnimationStartCapture: true })
17470 }
17471 },
17472 blur: {
17473 phasedRegistrationNames: {
17474 bubbled: keyOf({ onBlur: true }),
17475 captured: keyOf({ onBlurCapture: true })
17476 }
17477 },
17478 canPlay: {
17479 phasedRegistrationNames: {
17480 bubbled: keyOf({ onCanPlay: true }),
17481 captured: keyOf({ onCanPlayCapture: true })
17482 }
17483 },
17484 canPlayThrough: {
17485 phasedRegistrationNames: {
17486 bubbled: keyOf({ onCanPlayThrough: true }),
17487 captured: keyOf({ onCanPlayThroughCapture: true })
17488 }
17489 },
17490 click: {
17491 phasedRegistrationNames: {
17492 bubbled: keyOf({ onClick: true }),
17493 captured: keyOf({ onClickCapture: true })
17494 }
17495 },
17496 contextMenu: {
17497 phasedRegistrationNames: {
17498 bubbled: keyOf({ onContextMenu: true }),
17499 captured: keyOf({ onContextMenuCapture: true })
17500 }
17501 },
17502 copy: {
17503 phasedRegistrationNames: {
17504 bubbled: keyOf({ onCopy: true }),
17505 captured: keyOf({ onCopyCapture: true })
17506 }
17507 },
17508 cut: {
17509 phasedRegistrationNames: {
17510 bubbled: keyOf({ onCut: true }),
17511 captured: keyOf({ onCutCapture: true })
17512 }
17513 },
17514 doubleClick: {
17515 phasedRegistrationNames: {
17516 bubbled: keyOf({ onDoubleClick: true }),
17517 captured: keyOf({ onDoubleClickCapture: true })
17518 }
17519 },
17520 drag: {
17521 phasedRegistrationNames: {
17522 bubbled: keyOf({ onDrag: true }),
17523 captured: keyOf({ onDragCapture: true })
17524 }
17525 },
17526 dragEnd: {
17527 phasedRegistrationNames: {
17528 bubbled: keyOf({ onDragEnd: true }),
17529 captured: keyOf({ onDragEndCapture: true })
17530 }
17531 },
17532 dragEnter: {
17533 phasedRegistrationNames: {
17534 bubbled: keyOf({ onDragEnter: true }),
17535 captured: keyOf({ onDragEnterCapture: true })
17536 }
17537 },
17538 dragExit: {
17539 phasedRegistrationNames: {
17540 bubbled: keyOf({ onDragExit: true }),
17541 captured: keyOf({ onDragExitCapture: true })
17542 }
17543 },
17544 dragLeave: {
17545 phasedRegistrationNames: {
17546 bubbled: keyOf({ onDragLeave: true }),
17547 captured: keyOf({ onDragLeaveCapture: true })
17548 }
17549 },
17550 dragOver: {
17551 phasedRegistrationNames: {
17552 bubbled: keyOf({ onDragOver: true }),
17553 captured: keyOf({ onDragOverCapture: true })
17554 }
17555 },
17556 dragStart: {
17557 phasedRegistrationNames: {
17558 bubbled: keyOf({ onDragStart: true }),
17559 captured: keyOf({ onDragStartCapture: true })
17560 }
17561 },
17562 drop: {
17563 phasedRegistrationNames: {
17564 bubbled: keyOf({ onDrop: true }),
17565 captured: keyOf({ onDropCapture: true })
17566 }
17567 },
17568 durationChange: {
17569 phasedRegistrationNames: {
17570 bubbled: keyOf({ onDurationChange: true }),
17571 captured: keyOf({ onDurationChangeCapture: true })
17572 }
17573 },
17574 emptied: {
17575 phasedRegistrationNames: {
17576 bubbled: keyOf({ onEmptied: true }),
17577 captured: keyOf({ onEmptiedCapture: true })
17578 }
17579 },
17580 encrypted: {
17581 phasedRegistrationNames: {
17582 bubbled: keyOf({ onEncrypted: true }),
17583 captured: keyOf({ onEncryptedCapture: true })
17584 }
17585 },
17586 ended: {
17587 phasedRegistrationNames: {
17588 bubbled: keyOf({ onEnded: true }),
17589 captured: keyOf({ onEndedCapture: true })
17590 }
17591 },
17592 error: {
17593 phasedRegistrationNames: {
17594 bubbled: keyOf({ onError: true }),
17595 captured: keyOf({ onErrorCapture: true })
17596 }
17597 },
17598 focus: {
17599 phasedRegistrationNames: {
17600 bubbled: keyOf({ onFocus: true }),
17601 captured: keyOf({ onFocusCapture: true })
17602 }
17603 },
17604 input: {
17605 phasedRegistrationNames: {
17606 bubbled: keyOf({ onInput: true }),
17607 captured: keyOf({ onInputCapture: true })
17608 }
17609 },
17610 invalid: {
17611 phasedRegistrationNames: {
17612 bubbled: keyOf({ onInvalid: true }),
17613 captured: keyOf({ onInvalidCapture: true })
17614 }
17615 },
17616 keyDown: {
17617 phasedRegistrationNames: {
17618 bubbled: keyOf({ onKeyDown: true }),
17619 captured: keyOf({ onKeyDownCapture: true })
17620 }
17621 },
17622 keyPress: {
17623 phasedRegistrationNames: {
17624 bubbled: keyOf({ onKeyPress: true }),
17625 captured: keyOf({ onKeyPressCapture: true })
17626 }
17627 },
17628 keyUp: {
17629 phasedRegistrationNames: {
17630 bubbled: keyOf({ onKeyUp: true }),
17631 captured: keyOf({ onKeyUpCapture: true })
17632 }
17633 },
17634 load: {
17635 phasedRegistrationNames: {
17636 bubbled: keyOf({ onLoad: true }),
17637 captured: keyOf({ onLoadCapture: true })
17638 }
17639 },
17640 loadedData: {
17641 phasedRegistrationNames: {
17642 bubbled: keyOf({ onLoadedData: true }),
17643 captured: keyOf({ onLoadedDataCapture: true })
17644 }
17645 },
17646 loadedMetadata: {
17647 phasedRegistrationNames: {
17648 bubbled: keyOf({ onLoadedMetadata: true }),
17649 captured: keyOf({ onLoadedMetadataCapture: true })
17650 }
17651 },
17652 loadStart: {
17653 phasedRegistrationNames: {
17654 bubbled: keyOf({ onLoadStart: true }),
17655 captured: keyOf({ onLoadStartCapture: true })
17656 }
17657 },
17658 // Note: We do not allow listening to mouseOver events. Instead, use the
17659 // onMouseEnter/onMouseLeave created by `EnterLeaveEventPlugin`.
17660 mouseDown: {
17661 phasedRegistrationNames: {
17662 bubbled: keyOf({ onMouseDown: true }),
17663 captured: keyOf({ onMouseDownCapture: true })
17664 }
17665 },
17666 mouseMove: {
17667 phasedRegistrationNames: {
17668 bubbled: keyOf({ onMouseMove: true }),
17669 captured: keyOf({ onMouseMoveCapture: true })
17670 }
17671 },
17672 mouseOut: {
17673 phasedRegistrationNames: {
17674 bubbled: keyOf({ onMouseOut: true }),
17675 captured: keyOf({ onMouseOutCapture: true })
17676 }
17677 },
17678 mouseOver: {
17679 phasedRegistrationNames: {
17680 bubbled: keyOf({ onMouseOver: true }),
17681 captured: keyOf({ onMouseOverCapture: true })
17682 }
17683 },
17684 mouseUp: {
17685 phasedRegistrationNames: {
17686 bubbled: keyOf({ onMouseUp: true }),
17687 captured: keyOf({ onMouseUpCapture: true })
17688 }
17689 },
17690 paste: {
17691 phasedRegistrationNames: {
17692 bubbled: keyOf({ onPaste: true }),
17693 captured: keyOf({ onPasteCapture: true })
17694 }
17695 },
17696 pause: {
17697 phasedRegistrationNames: {
17698 bubbled: keyOf({ onPause: true }),
17699 captured: keyOf({ onPauseCapture: true })
17700 }
17701 },
17702 play: {
17703 phasedRegistrationNames: {
17704 bubbled: keyOf({ onPlay: true }),
17705 captured: keyOf({ onPlayCapture: true })
17706 }
17707 },
17708 playing: {
17709 phasedRegistrationNames: {
17710 bubbled: keyOf({ onPlaying: true }),
17711 captured: keyOf({ onPlayingCapture: true })
17712 }
17713 },
17714 progress: {
17715 phasedRegistrationNames: {
17716 bubbled: keyOf({ onProgress: true }),
17717 captured: keyOf({ onProgressCapture: true })
17718 }
17719 },
17720 rateChange: {
17721 phasedRegistrationNames: {
17722 bubbled: keyOf({ onRateChange: true }),
17723 captured: keyOf({ onRateChangeCapture: true })
17724 }
17725 },
17726 reset: {
17727 phasedRegistrationNames: {
17728 bubbled: keyOf({ onReset: true }),
17729 captured: keyOf({ onResetCapture: true })
17730 }
17731 },
17732 scroll: {
17733 phasedRegistrationNames: {
17734 bubbled: keyOf({ onScroll: true }),
17735 captured: keyOf({ onScrollCapture: true })
17736 }
17737 },
17738 seeked: {
17739 phasedRegistrationNames: {
17740 bubbled: keyOf({ onSeeked: true }),
17741 captured: keyOf({ onSeekedCapture: true })
17742 }
17743 },
17744 seeking: {
17745 phasedRegistrationNames: {
17746 bubbled: keyOf({ onSeeking: true }),
17747 captured: keyOf({ onSeekingCapture: true })
17748 }
17749 },
17750 stalled: {
17751 phasedRegistrationNames: {
17752 bubbled: keyOf({ onStalled: true }),
17753 captured: keyOf({ onStalledCapture: true })
17754 }
17755 },
17756 submit: {
17757 phasedRegistrationNames: {
17758 bubbled: keyOf({ onSubmit: true }),
17759 captured: keyOf({ onSubmitCapture: true })
17760 }
17761 },
17762 suspend: {
17763 phasedRegistrationNames: {
17764 bubbled: keyOf({ onSuspend: true }),
17765 captured: keyOf({ onSuspendCapture: true })
17766 }
17767 },
17768 timeUpdate: {
17769 phasedRegistrationNames: {
17770 bubbled: keyOf({ onTimeUpdate: true }),
17771 captured: keyOf({ onTimeUpdateCapture: true })
17772 }
17773 },
17774 touchCancel: {
17775 phasedRegistrationNames: {
17776 bubbled: keyOf({ onTouchCancel: true }),
17777 captured: keyOf({ onTouchCancelCapture: true })
17778 }
17779 },
17780 touchEnd: {
17781 phasedRegistrationNames: {
17782 bubbled: keyOf({ onTouchEnd: true }),
17783 captured: keyOf({ onTouchEndCapture: true })
17784 }
17785 },
17786 touchMove: {
17787 phasedRegistrationNames: {
17788 bubbled: keyOf({ onTouchMove: true }),
17789 captured: keyOf({ onTouchMoveCapture: true })
17790 }
17791 },
17792 touchStart: {
17793 phasedRegistrationNames: {
17794 bubbled: keyOf({ onTouchStart: true }),
17795 captured: keyOf({ onTouchStartCapture: true })
17796 }
17797 },
17798 transitionEnd: {
17799 phasedRegistrationNames: {
17800 bubbled: keyOf({ onTransitionEnd: true }),
17801 captured: keyOf({ onTransitionEndCapture: true })
17802 }
17803 },
17804 volumeChange: {
17805 phasedRegistrationNames: {
17806 bubbled: keyOf({ onVolumeChange: true }),
17807 captured: keyOf({ onVolumeChangeCapture: true })
17808 }
17809 },
17810 waiting: {
17811 phasedRegistrationNames: {
17812 bubbled: keyOf({ onWaiting: true }),
17813 captured: keyOf({ onWaitingCapture: true })
17814 }
17815 },
17816 wheel: {
17817 phasedRegistrationNames: {
17818 bubbled: keyOf({ onWheel: true }),
17819 captured: keyOf({ onWheelCapture: true })
17820 }
17821 }
17822};
17823
17824var topLevelEventsToDispatchConfig = {
17825 topAbort: eventTypes.abort,
17826 topAnimationEnd: eventTypes.animationEnd,
17827 topAnimationIteration: eventTypes.animationIteration,
17828 topAnimationStart: eventTypes.animationStart,
17829 topBlur: eventTypes.blur,
17830 topCanPlay: eventTypes.canPlay,
17831 topCanPlayThrough: eventTypes.canPlayThrough,
17832 topClick: eventTypes.click,
17833 topContextMenu: eventTypes.contextMenu,
17834 topCopy: eventTypes.copy,
17835 topCut: eventTypes.cut,
17836 topDoubleClick: eventTypes.doubleClick,
17837 topDrag: eventTypes.drag,
17838 topDragEnd: eventTypes.dragEnd,
17839 topDragEnter: eventTypes.dragEnter,
17840 topDragExit: eventTypes.dragExit,
17841 topDragLeave: eventTypes.dragLeave,
17842 topDragOver: eventTypes.dragOver,
17843 topDragStart: eventTypes.dragStart,
17844 topDrop: eventTypes.drop,
17845 topDurationChange: eventTypes.durationChange,
17846 topEmptied: eventTypes.emptied,
17847 topEncrypted: eventTypes.encrypted,
17848 topEnded: eventTypes.ended,
17849 topError: eventTypes.error,
17850 topFocus: eventTypes.focus,
17851 topInput: eventTypes.input,
17852 topInvalid: eventTypes.invalid,
17853 topKeyDown: eventTypes.keyDown,
17854 topKeyPress: eventTypes.keyPress,
17855 topKeyUp: eventTypes.keyUp,
17856 topLoad: eventTypes.load,
17857 topLoadedData: eventTypes.loadedData,
17858 topLoadedMetadata: eventTypes.loadedMetadata,
17859 topLoadStart: eventTypes.loadStart,
17860 topMouseDown: eventTypes.mouseDown,
17861 topMouseMove: eventTypes.mouseMove,
17862 topMouseOut: eventTypes.mouseOut,
17863 topMouseOver: eventTypes.mouseOver,
17864 topMouseUp: eventTypes.mouseUp,
17865 topPaste: eventTypes.paste,
17866 topPause: eventTypes.pause,
17867 topPlay: eventTypes.play,
17868 topPlaying: eventTypes.playing,
17869 topProgress: eventTypes.progress,
17870 topRateChange: eventTypes.rateChange,
17871 topReset: eventTypes.reset,
17872 topScroll: eventTypes.scroll,
17873 topSeeked: eventTypes.seeked,
17874 topSeeking: eventTypes.seeking,
17875 topStalled: eventTypes.stalled,
17876 topSubmit: eventTypes.submit,
17877 topSuspend: eventTypes.suspend,
17878 topTimeUpdate: eventTypes.timeUpdate,
17879 topTouchCancel: eventTypes.touchCancel,
17880 topTouchEnd: eventTypes.touchEnd,
17881 topTouchMove: eventTypes.touchMove,
17882 topTouchStart: eventTypes.touchStart,
17883 topTransitionEnd: eventTypes.transitionEnd,
17884 topVolumeChange: eventTypes.volumeChange,
17885 topWaiting: eventTypes.waiting,
17886 topWheel: eventTypes.wheel
17887};
17888
17889for (var type in topLevelEventsToDispatchConfig) {
17890 topLevelEventsToDispatchConfig[type].dependencies = [type];
17891}
17892
17893var ON_CLICK_KEY = keyOf({ onClick: null });
17894var onClickListeners = {};
17895
17896function getDictionaryKey(inst) {
17897 // Prevents V8 performance issue:
17898 // https://github.com/facebook/react/pull/7232
17899 return '.' + inst._rootNodeID;
17900}
17901
17902var SimpleEventPlugin = {
17903
17904 eventTypes: eventTypes,
17905
17906 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
17907 var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
17908 if (!dispatchConfig) {
17909 return null;
17910 }
17911 var EventConstructor;
17912 switch (topLevelType) {
17913 case topLevelTypes.topAbort:
17914 case topLevelTypes.topCanPlay:
17915 case topLevelTypes.topCanPlayThrough:
17916 case topLevelTypes.topDurationChange:
17917 case topLevelTypes.topEmptied:
17918 case topLevelTypes.topEncrypted:
17919 case topLevelTypes.topEnded:
17920 case topLevelTypes.topError:
17921 case topLevelTypes.topInput:
17922 case topLevelTypes.topInvalid:
17923 case topLevelTypes.topLoad:
17924 case topLevelTypes.topLoadedData:
17925 case topLevelTypes.topLoadedMetadata:
17926 case topLevelTypes.topLoadStart:
17927 case topLevelTypes.topPause:
17928 case topLevelTypes.topPlay:
17929 case topLevelTypes.topPlaying:
17930 case topLevelTypes.topProgress:
17931 case topLevelTypes.topRateChange:
17932 case topLevelTypes.topReset:
17933 case topLevelTypes.topSeeked:
17934 case topLevelTypes.topSeeking:
17935 case topLevelTypes.topStalled:
17936 case topLevelTypes.topSubmit:
17937 case topLevelTypes.topSuspend:
17938 case topLevelTypes.topTimeUpdate:
17939 case topLevelTypes.topVolumeChange:
17940 case topLevelTypes.topWaiting:
17941 // HTML Events
17942 // @see http://www.w3.org/TR/html5/index.html#events-0
17943 EventConstructor = SyntheticEvent;
17944 break;
17945 case topLevelTypes.topKeyPress:
17946 // Firefox creates a keypress event for function keys too. This removes
17947 // the unwanted keypress events. Enter is however both printable and
17948 // non-printable. One would expect Tab to be as well (but it isn't).
17949 if (getEventCharCode(nativeEvent) === 0) {
17950 return null;
17951 }
17952 /* falls through */
17953 case topLevelTypes.topKeyDown:
17954 case topLevelTypes.topKeyUp:
17955 EventConstructor = SyntheticKeyboardEvent;
17956 break;
17957 case topLevelTypes.topBlur:
17958 case topLevelTypes.topFocus:
17959 EventConstructor = SyntheticFocusEvent;
17960 break;
17961 case topLevelTypes.topClick:
17962 // Firefox creates a click event on right mouse clicks. This removes the
17963 // unwanted click events.
17964 if (nativeEvent.button === 2) {
17965 return null;
17966 }
17967 /* falls through */
17968 case topLevelTypes.topContextMenu:
17969 case topLevelTypes.topDoubleClick:
17970 case topLevelTypes.topMouseDown:
17971 case topLevelTypes.topMouseMove:
17972 case topLevelTypes.topMouseOut:
17973 case topLevelTypes.topMouseOver:
17974 case topLevelTypes.topMouseUp:
17975 EventConstructor = SyntheticMouseEvent;
17976 break;
17977 case topLevelTypes.topDrag:
17978 case topLevelTypes.topDragEnd:
17979 case topLevelTypes.topDragEnter:
17980 case topLevelTypes.topDragExit:
17981 case topLevelTypes.topDragLeave:
17982 case topLevelTypes.topDragOver:
17983 case topLevelTypes.topDragStart:
17984 case topLevelTypes.topDrop:
17985 EventConstructor = SyntheticDragEvent;
17986 break;
17987 case topLevelTypes.topTouchCancel:
17988 case topLevelTypes.topTouchEnd:
17989 case topLevelTypes.topTouchMove:
17990 case topLevelTypes.topTouchStart:
17991 EventConstructor = SyntheticTouchEvent;
17992 break;
17993 case topLevelTypes.topAnimationEnd:
17994 case topLevelTypes.topAnimationIteration:
17995 case topLevelTypes.topAnimationStart:
17996 EventConstructor = SyntheticAnimationEvent;
17997 break;
17998 case topLevelTypes.topTransitionEnd:
17999 EventConstructor = SyntheticTransitionEvent;
18000 break;
18001 case topLevelTypes.topScroll:
18002 EventConstructor = SyntheticUIEvent;
18003 break;
18004 case topLevelTypes.topWheel:
18005 EventConstructor = SyntheticWheelEvent;
18006 break;
18007 case topLevelTypes.topCopy:
18008 case topLevelTypes.topCut:
18009 case topLevelTypes.topPaste:
18010 EventConstructor = SyntheticClipboardEvent;
18011 break;
18012 }
18013 !EventConstructor ? "development" !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : _prodInvariant('86', topLevelType) : void 0;
18014 var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
18015 EventPropagators.accumulateTwoPhaseDispatches(event);
18016 return event;
18017 },
18018
18019 didPutListener: function (inst, registrationName, listener) {
18020 // Mobile Safari does not fire properly bubble click events on
18021 // non-interactive elements, which means delegated click listeners do not
18022 // fire. The workaround for this bug involves attaching an empty click
18023 // listener on the target node.
18024 if (registrationName === ON_CLICK_KEY) {
18025 var key = getDictionaryKey(inst);
18026 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
18027 if (!onClickListeners[key]) {
18028 onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction);
18029 }
18030 }
18031 },
18032
18033 willDeleteListener: function (inst, registrationName) {
18034 if (registrationName === ON_CLICK_KEY) {
18035 var key = getDictionaryKey(inst);
18036 onClickListeners[key].remove();
18037 delete onClickListeners[key];
18038 }
18039 }
18040
18041};
18042
18043module.exports = SimpleEventPlugin;
18044},{"114":114,"115":115,"117":117,"118":118,"119":119,"121":121,"122":122,"123":123,"124":124,"125":125,"126":126,"139":139,"153":153,"16":16,"163":163,"170":170,"178":178,"182":182,"20":20,"46":46}],114:[function(_dereq_,module,exports){
18045/**
18046 * Copyright 2013-present, Facebook, Inc.
18047 * All rights reserved.
18048 *
18049 * This source code is licensed under the BSD-style license found in the
18050 * LICENSE file in the root directory of this source tree. An additional grant
18051 * of patent rights can be found in the PATENTS file in the same directory.
18052 *
18053 * @providesModule SyntheticAnimationEvent
18054 */
18055
18056'use strict';
18057
18058var SyntheticEvent = _dereq_(118);
18059
18060/**
18061 * @interface Event
18062 * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
18063 * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
18064 */
18065var AnimationEventInterface = {
18066 animationName: null,
18067 elapsedTime: null,
18068 pseudoElement: null
18069};
18070
18071/**
18072 * @param {object} dispatchConfig Configuration used to dispatch this event.
18073 * @param {string} dispatchMarker Marker identifying the event target.
18074 * @param {object} nativeEvent Native browser event.
18075 * @extends {SyntheticEvent}
18076 */
18077function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18078 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18079}
18080
18081SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
18082
18083module.exports = SyntheticAnimationEvent;
18084},{"118":118}],115:[function(_dereq_,module,exports){
18085/**
18086 * Copyright 2013-present, Facebook, Inc.
18087 * All rights reserved.
18088 *
18089 * This source code is licensed under the BSD-style license found in the
18090 * LICENSE file in the root directory of this source tree. An additional grant
18091 * of patent rights can be found in the PATENTS file in the same directory.
18092 *
18093 * @providesModule SyntheticClipboardEvent
18094 */
18095
18096'use strict';
18097
18098var SyntheticEvent = _dereq_(118);
18099
18100/**
18101 * @interface Event
18102 * @see http://www.w3.org/TR/clipboard-apis/
18103 */
18104var ClipboardEventInterface = {
18105 clipboardData: function (event) {
18106 return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
18107 }
18108};
18109
18110/**
18111 * @param {object} dispatchConfig Configuration used to dispatch this event.
18112 * @param {string} dispatchMarker Marker identifying the event target.
18113 * @param {object} nativeEvent Native browser event.
18114 * @extends {SyntheticUIEvent}
18115 */
18116function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18117 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18118}
18119
18120SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
18121
18122module.exports = SyntheticClipboardEvent;
18123},{"118":118}],116:[function(_dereq_,module,exports){
18124/**
18125 * Copyright 2013-present, Facebook, Inc.
18126 * All rights reserved.
18127 *
18128 * This source code is licensed under the BSD-style license found in the
18129 * LICENSE file in the root directory of this source tree. An additional grant
18130 * of patent rights can be found in the PATENTS file in the same directory.
18131 *
18132 * @providesModule SyntheticCompositionEvent
18133 */
18134
18135'use strict';
18136
18137var SyntheticEvent = _dereq_(118);
18138
18139/**
18140 * @interface Event
18141 * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
18142 */
18143var CompositionEventInterface = {
18144 data: null
18145};
18146
18147/**
18148 * @param {object} dispatchConfig Configuration used to dispatch this event.
18149 * @param {string} dispatchMarker Marker identifying the event target.
18150 * @param {object} nativeEvent Native browser event.
18151 * @extends {SyntheticUIEvent}
18152 */
18153function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18154 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18155}
18156
18157SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
18158
18159module.exports = SyntheticCompositionEvent;
18160},{"118":118}],117:[function(_dereq_,module,exports){
18161/**
18162 * Copyright 2013-present, Facebook, Inc.
18163 * All rights reserved.
18164 *
18165 * This source code is licensed under the BSD-style license found in the
18166 * LICENSE file in the root directory of this source tree. An additional grant
18167 * of patent rights can be found in the PATENTS file in the same directory.
18168 *
18169 * @providesModule SyntheticDragEvent
18170 */
18171
18172'use strict';
18173
18174var SyntheticMouseEvent = _dereq_(122);
18175
18176/**
18177 * @interface DragEvent
18178 * @see http://www.w3.org/TR/DOM-Level-3-Events/
18179 */
18180var DragEventInterface = {
18181 dataTransfer: null
18182};
18183
18184/**
18185 * @param {object} dispatchConfig Configuration used to dispatch this event.
18186 * @param {string} dispatchMarker Marker identifying the event target.
18187 * @param {object} nativeEvent Native browser event.
18188 * @extends {SyntheticUIEvent}
18189 */
18190function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18191 return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18192}
18193
18194SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
18195
18196module.exports = SyntheticDragEvent;
18197},{"122":122}],118:[function(_dereq_,module,exports){
18198/**
18199 * Copyright 2013-present, Facebook, Inc.
18200 * All rights reserved.
18201 *
18202 * This source code is licensed under the BSD-style license found in the
18203 * LICENSE file in the root directory of this source tree. An additional grant
18204 * of patent rights can be found in the PATENTS file in the same directory.
18205 *
18206 * @providesModule SyntheticEvent
18207 */
18208
18209'use strict';
18210
18211var _assign = _dereq_(188);
18212
18213var PooledClass = _dereq_(26);
18214
18215var emptyFunction = _dereq_(170);
18216var warning = _dereq_(187);
18217
18218var didWarnForAddedNewProperty = false;
18219var isProxySupported = typeof Proxy === 'function';
18220
18221var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
18222
18223/**
18224 * @interface Event
18225 * @see http://www.w3.org/TR/DOM-Level-3-Events/
18226 */
18227var EventInterface = {
18228 type: null,
18229 target: null,
18230 // currentTarget is set when dispatching; no use in copying it here
18231 currentTarget: emptyFunction.thatReturnsNull,
18232 eventPhase: null,
18233 bubbles: null,
18234 cancelable: null,
18235 timeStamp: function (event) {
18236 return event.timeStamp || Date.now();
18237 },
18238 defaultPrevented: null,
18239 isTrusted: null
18240};
18241
18242/**
18243 * Synthetic events are dispatched by event plugins, typically in response to a
18244 * top-level event delegation handler.
18245 *
18246 * These systems should generally use pooling to reduce the frequency of garbage
18247 * collection. The system should check `isPersistent` to determine whether the
18248 * event should be released into the pool after being dispatched. Users that
18249 * need a persisted event should invoke `persist`.
18250 *
18251 * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
18252 * normalizing browser quirks. Subclasses do not necessarily have to implement a
18253 * DOM interface; custom application-specific events can also subclass this.
18254 *
18255 * @param {object} dispatchConfig Configuration used to dispatch this event.
18256 * @param {*} targetInst Marker identifying the event target.
18257 * @param {object} nativeEvent Native browser event.
18258 * @param {DOMEventTarget} nativeEventTarget Target node.
18259 */
18260function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
18261 if ("development" !== 'production') {
18262 // these have a getter/setter for warnings
18263 delete this.nativeEvent;
18264 delete this.preventDefault;
18265 delete this.stopPropagation;
18266 }
18267
18268 this.dispatchConfig = dispatchConfig;
18269 this._targetInst = targetInst;
18270 this.nativeEvent = nativeEvent;
18271
18272 var Interface = this.constructor.Interface;
18273 for (var propName in Interface) {
18274 if (!Interface.hasOwnProperty(propName)) {
18275 continue;
18276 }
18277 if ("development" !== 'production') {
18278 delete this[propName]; // this has a getter/setter for warnings
18279 }
18280 var normalize = Interface[propName];
18281 if (normalize) {
18282 this[propName] = normalize(nativeEvent);
18283 } else {
18284 if (propName === 'target') {
18285 this.target = nativeEventTarget;
18286 } else {
18287 this[propName] = nativeEvent[propName];
18288 }
18289 }
18290 }
18291
18292 var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
18293 if (defaultPrevented) {
18294 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
18295 } else {
18296 this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
18297 }
18298 this.isPropagationStopped = emptyFunction.thatReturnsFalse;
18299 return this;
18300}
18301
18302_assign(SyntheticEvent.prototype, {
18303
18304 preventDefault: function () {
18305 this.defaultPrevented = true;
18306 var event = this.nativeEvent;
18307 if (!event) {
18308 return;
18309 }
18310
18311 if (event.preventDefault) {
18312 event.preventDefault();
18313 } else if (typeof event.returnValue !== 'unknown') {
18314 // eslint-disable-line valid-typeof
18315 event.returnValue = false;
18316 }
18317 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
18318 },
18319
18320 stopPropagation: function () {
18321 var event = this.nativeEvent;
18322 if (!event) {
18323 return;
18324 }
18325
18326 if (event.stopPropagation) {
18327 event.stopPropagation();
18328 } else if (typeof event.cancelBubble !== 'unknown') {
18329 // eslint-disable-line valid-typeof
18330 // The ChangeEventPlugin registers a "propertychange" event for
18331 // IE. This event does not support bubbling or cancelling, and
18332 // any references to cancelBubble throw "Member not found". A
18333 // typeof check of "unknown" circumvents this issue (and is also
18334 // IE specific).
18335 event.cancelBubble = true;
18336 }
18337
18338 this.isPropagationStopped = emptyFunction.thatReturnsTrue;
18339 },
18340
18341 /**
18342 * We release all dispatched `SyntheticEvent`s after each event loop, adding
18343 * them back into the pool. This allows a way to hold onto a reference that
18344 * won't be added back into the pool.
18345 */
18346 persist: function () {
18347 this.isPersistent = emptyFunction.thatReturnsTrue;
18348 },
18349
18350 /**
18351 * Checks if this event should be released back into the pool.
18352 *
18353 * @return {boolean} True if this should not be released, false otherwise.
18354 */
18355 isPersistent: emptyFunction.thatReturnsFalse,
18356
18357 /**
18358 * `PooledClass` looks for `destructor` on each instance it releases.
18359 */
18360 destructor: function () {
18361 var Interface = this.constructor.Interface;
18362 for (var propName in Interface) {
18363 if ("development" !== 'production') {
18364 Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
18365 } else {
18366 this[propName] = null;
18367 }
18368 }
18369 for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
18370 this[shouldBeReleasedProperties[i]] = null;
18371 }
18372 if ("development" !== 'production') {
18373 Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
18374 Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
18375 Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
18376 }
18377 }
18378
18379});
18380
18381SyntheticEvent.Interface = EventInterface;
18382
18383if ("development" !== 'production') {
18384 if (isProxySupported) {
18385 /*eslint-disable no-func-assign */
18386 SyntheticEvent = new Proxy(SyntheticEvent, {
18387 construct: function (target, args) {
18388 return this.apply(target, Object.create(target.prototype), args);
18389 },
18390 apply: function (constructor, that, args) {
18391 return new Proxy(constructor.apply(that, args), {
18392 set: function (target, prop, value) {
18393 if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
18394 "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;
18395 didWarnForAddedNewProperty = true;
18396 }
18397 target[prop] = value;
18398 return true;
18399 }
18400 });
18401 }
18402 });
18403 /*eslint-enable no-func-assign */
18404 }
18405}
18406/**
18407 * Helper to reduce boilerplate when creating subclasses.
18408 *
18409 * @param {function} Class
18410 * @param {?object} Interface
18411 */
18412SyntheticEvent.augmentClass = function (Class, Interface) {
18413 var Super = this;
18414
18415 var E = function () {};
18416 E.prototype = Super.prototype;
18417 var prototype = new E();
18418
18419 _assign(prototype, Class.prototype);
18420 Class.prototype = prototype;
18421 Class.prototype.constructor = Class;
18422
18423 Class.Interface = _assign({}, Super.Interface, Interface);
18424 Class.augmentClass = Super.augmentClass;
18425
18426 PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
18427};
18428
18429PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
18430
18431module.exports = SyntheticEvent;
18432
18433/**
18434 * Helper to nullify syntheticEvent instance properties when destructing
18435 *
18436 * @param {object} SyntheticEvent
18437 * @param {String} propName
18438 * @return {object} defineProperty object
18439 */
18440function getPooledWarningPropertyDefinition(propName, getVal) {
18441 var isFunction = typeof getVal === 'function';
18442 return {
18443 configurable: true,
18444 set: set,
18445 get: get
18446 };
18447
18448 function set(val) {
18449 var action = isFunction ? 'setting the method' : 'setting the property';
18450 warn(action, 'This is effectively a no-op');
18451 return val;
18452 }
18453
18454 function get() {
18455 var action = isFunction ? 'accessing the method' : 'accessing the property';
18456 var result = isFunction ? 'This is a no-op function' : 'This is set to null';
18457 warn(action, result);
18458 return getVal;
18459 }
18460
18461 function warn(action, result) {
18462 var warningCondition = false;
18463 "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;
18464 }
18465}
18466},{"170":170,"187":187,"188":188,"26":26}],119:[function(_dereq_,module,exports){
18467/**
18468 * Copyright 2013-present, Facebook, Inc.
18469 * All rights reserved.
18470 *
18471 * This source code is licensed under the BSD-style license found in the
18472 * LICENSE file in the root directory of this source tree. An additional grant
18473 * of patent rights can be found in the PATENTS file in the same directory.
18474 *
18475 * @providesModule SyntheticFocusEvent
18476 */
18477
18478'use strict';
18479
18480var SyntheticUIEvent = _dereq_(125);
18481
18482/**
18483 * @interface FocusEvent
18484 * @see http://www.w3.org/TR/DOM-Level-3-Events/
18485 */
18486var FocusEventInterface = {
18487 relatedTarget: null
18488};
18489
18490/**
18491 * @param {object} dispatchConfig Configuration used to dispatch this event.
18492 * @param {string} dispatchMarker Marker identifying the event target.
18493 * @param {object} nativeEvent Native browser event.
18494 * @extends {SyntheticUIEvent}
18495 */
18496function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18497 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18498}
18499
18500SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
18501
18502module.exports = SyntheticFocusEvent;
18503},{"125":125}],120:[function(_dereq_,module,exports){
18504/**
18505 * Copyright 2013-present, Facebook, Inc.
18506 * All rights reserved.
18507 *
18508 * This source code is licensed under the BSD-style license found in the
18509 * LICENSE file in the root directory of this source tree. An additional grant
18510 * of patent rights can be found in the PATENTS file in the same directory.
18511 *
18512 * @providesModule SyntheticInputEvent
18513 */
18514
18515'use strict';
18516
18517var SyntheticEvent = _dereq_(118);
18518
18519/**
18520 * @interface Event
18521 * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
18522 * /#events-inputevents
18523 */
18524var InputEventInterface = {
18525 data: null
18526};
18527
18528/**
18529 * @param {object} dispatchConfig Configuration used to dispatch this event.
18530 * @param {string} dispatchMarker Marker identifying the event target.
18531 * @param {object} nativeEvent Native browser event.
18532 * @extends {SyntheticUIEvent}
18533 */
18534function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18535 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18536}
18537
18538SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
18539
18540module.exports = SyntheticInputEvent;
18541},{"118":118}],121:[function(_dereq_,module,exports){
18542/**
18543 * Copyright 2013-present, Facebook, Inc.
18544 * All rights reserved.
18545 *
18546 * This source code is licensed under the BSD-style license found in the
18547 * LICENSE file in the root directory of this source tree. An additional grant
18548 * of patent rights can be found in the PATENTS file in the same directory.
18549 *
18550 * @providesModule SyntheticKeyboardEvent
18551 */
18552
18553'use strict';
18554
18555var SyntheticUIEvent = _dereq_(125);
18556
18557var getEventCharCode = _dereq_(139);
18558var getEventKey = _dereq_(140);
18559var getEventModifierState = _dereq_(141);
18560
18561/**
18562 * @interface KeyboardEvent
18563 * @see http://www.w3.org/TR/DOM-Level-3-Events/
18564 */
18565var KeyboardEventInterface = {
18566 key: getEventKey,
18567 location: null,
18568 ctrlKey: null,
18569 shiftKey: null,
18570 altKey: null,
18571 metaKey: null,
18572 repeat: null,
18573 locale: null,
18574 getModifierState: getEventModifierState,
18575 // Legacy Interface
18576 charCode: function (event) {
18577 // `charCode` is the result of a KeyPress event and represents the value of
18578 // the actual printable character.
18579
18580 // KeyPress is deprecated, but its replacement is not yet final and not
18581 // implemented in any major browser. Only KeyPress has charCode.
18582 if (event.type === 'keypress') {
18583 return getEventCharCode(event);
18584 }
18585 return 0;
18586 },
18587 keyCode: function (event) {
18588 // `keyCode` is the result of a KeyDown/Up event and represents the value of
18589 // physical keyboard key.
18590
18591 // The actual meaning of the value depends on the users' keyboard layout
18592 // which cannot be detected. Assuming that it is a US keyboard layout
18593 // provides a surprisingly accurate mapping for US and European users.
18594 // Due to this, it is left to the user to implement at this time.
18595 if (event.type === 'keydown' || event.type === 'keyup') {
18596 return event.keyCode;
18597 }
18598 return 0;
18599 },
18600 which: function (event) {
18601 // `which` is an alias for either `keyCode` or `charCode` depending on the
18602 // type of the event.
18603 if (event.type === 'keypress') {
18604 return getEventCharCode(event);
18605 }
18606 if (event.type === 'keydown' || event.type === 'keyup') {
18607 return event.keyCode;
18608 }
18609 return 0;
18610 }
18611};
18612
18613/**
18614 * @param {object} dispatchConfig Configuration used to dispatch this event.
18615 * @param {string} dispatchMarker Marker identifying the event target.
18616 * @param {object} nativeEvent Native browser event.
18617 * @extends {SyntheticUIEvent}
18618 */
18619function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18620 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18621}
18622
18623SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
18624
18625module.exports = SyntheticKeyboardEvent;
18626},{"125":125,"139":139,"140":140,"141":141}],122:[function(_dereq_,module,exports){
18627/**
18628 * Copyright 2013-present, Facebook, Inc.
18629 * All rights reserved.
18630 *
18631 * This source code is licensed under the BSD-style license found in the
18632 * LICENSE file in the root directory of this source tree. An additional grant
18633 * of patent rights can be found in the PATENTS file in the same directory.
18634 *
18635 * @providesModule SyntheticMouseEvent
18636 */
18637
18638'use strict';
18639
18640var SyntheticUIEvent = _dereq_(125);
18641var ViewportMetrics = _dereq_(128);
18642
18643var getEventModifierState = _dereq_(141);
18644
18645/**
18646 * @interface MouseEvent
18647 * @see http://www.w3.org/TR/DOM-Level-3-Events/
18648 */
18649var MouseEventInterface = {
18650 screenX: null,
18651 screenY: null,
18652 clientX: null,
18653 clientY: null,
18654 ctrlKey: null,
18655 shiftKey: null,
18656 altKey: null,
18657 metaKey: null,
18658 getModifierState: getEventModifierState,
18659 button: function (event) {
18660 // Webkit, Firefox, IE9+
18661 // which: 1 2 3
18662 // button: 0 1 2 (standard)
18663 var button = event.button;
18664 if ('which' in event) {
18665 return button;
18666 }
18667 // IE<9
18668 // which: undefined
18669 // button: 0 0 0
18670 // button: 1 4 2 (onmouseup)
18671 return button === 2 ? 2 : button === 4 ? 1 : 0;
18672 },
18673 buttons: null,
18674 relatedTarget: function (event) {
18675 return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
18676 },
18677 // "Proprietary" Interface.
18678 pageX: function (event) {
18679 return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
18680 },
18681 pageY: function (event) {
18682 return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
18683 }
18684};
18685
18686/**
18687 * @param {object} dispatchConfig Configuration used to dispatch this event.
18688 * @param {string} dispatchMarker Marker identifying the event target.
18689 * @param {object} nativeEvent Native browser event.
18690 * @extends {SyntheticUIEvent}
18691 */
18692function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18693 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18694}
18695
18696SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
18697
18698module.exports = SyntheticMouseEvent;
18699},{"125":125,"128":128,"141":141}],123:[function(_dereq_,module,exports){
18700/**
18701 * Copyright 2013-present, Facebook, Inc.
18702 * All rights reserved.
18703 *
18704 * This source code is licensed under the BSD-style license found in the
18705 * LICENSE file in the root directory of this source tree. An additional grant
18706 * of patent rights can be found in the PATENTS file in the same directory.
18707 *
18708 * @providesModule SyntheticTouchEvent
18709 */
18710
18711'use strict';
18712
18713var SyntheticUIEvent = _dereq_(125);
18714
18715var getEventModifierState = _dereq_(141);
18716
18717/**
18718 * @interface TouchEvent
18719 * @see http://www.w3.org/TR/touch-events/
18720 */
18721var TouchEventInterface = {
18722 touches: null,
18723 targetTouches: null,
18724 changedTouches: null,
18725 altKey: null,
18726 metaKey: null,
18727 ctrlKey: null,
18728 shiftKey: null,
18729 getModifierState: getEventModifierState
18730};
18731
18732/**
18733 * @param {object} dispatchConfig Configuration used to dispatch this event.
18734 * @param {string} dispatchMarker Marker identifying the event target.
18735 * @param {object} nativeEvent Native browser event.
18736 * @extends {SyntheticUIEvent}
18737 */
18738function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18739 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18740}
18741
18742SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
18743
18744module.exports = SyntheticTouchEvent;
18745},{"125":125,"141":141}],124:[function(_dereq_,module,exports){
18746/**
18747 * Copyright 2013-present, Facebook, Inc.
18748 * All rights reserved.
18749 *
18750 * This source code is licensed under the BSD-style license found in the
18751 * LICENSE file in the root directory of this source tree. An additional grant
18752 * of patent rights can be found in the PATENTS file in the same directory.
18753 *
18754 * @providesModule SyntheticTransitionEvent
18755 */
18756
18757'use strict';
18758
18759var SyntheticEvent = _dereq_(118);
18760
18761/**
18762 * @interface Event
18763 * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
18764 * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
18765 */
18766var TransitionEventInterface = {
18767 propertyName: null,
18768 elapsedTime: null,
18769 pseudoElement: null
18770};
18771
18772/**
18773 * @param {object} dispatchConfig Configuration used to dispatch this event.
18774 * @param {string} dispatchMarker Marker identifying the event target.
18775 * @param {object} nativeEvent Native browser event.
18776 * @extends {SyntheticEvent}
18777 */
18778function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18779 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18780}
18781
18782SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
18783
18784module.exports = SyntheticTransitionEvent;
18785},{"118":118}],125:[function(_dereq_,module,exports){
18786/**
18787 * Copyright 2013-present, Facebook, Inc.
18788 * All rights reserved.
18789 *
18790 * This source code is licensed under the BSD-style license found in the
18791 * LICENSE file in the root directory of this source tree. An additional grant
18792 * of patent rights can be found in the PATENTS file in the same directory.
18793 *
18794 * @providesModule SyntheticUIEvent
18795 */
18796
18797'use strict';
18798
18799var SyntheticEvent = _dereq_(118);
18800
18801var getEventTarget = _dereq_(142);
18802
18803/**
18804 * @interface UIEvent
18805 * @see http://www.w3.org/TR/DOM-Level-3-Events/
18806 */
18807var UIEventInterface = {
18808 view: function (event) {
18809 if (event.view) {
18810 return event.view;
18811 }
18812
18813 var target = getEventTarget(event);
18814 if (target.window === target) {
18815 // target is a window object
18816 return target;
18817 }
18818
18819 var doc = target.ownerDocument;
18820 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
18821 if (doc) {
18822 return doc.defaultView || doc.parentWindow;
18823 } else {
18824 return window;
18825 }
18826 },
18827 detail: function (event) {
18828 return event.detail || 0;
18829 }
18830};
18831
18832/**
18833 * @param {object} dispatchConfig Configuration used to dispatch this event.
18834 * @param {string} dispatchMarker Marker identifying the event target.
18835 * @param {object} nativeEvent Native browser event.
18836 * @extends {SyntheticEvent}
18837 */
18838function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18839 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18840}
18841
18842SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
18843
18844module.exports = SyntheticUIEvent;
18845},{"118":118,"142":142}],126:[function(_dereq_,module,exports){
18846/**
18847 * Copyright 2013-present, Facebook, Inc.
18848 * All rights reserved.
18849 *
18850 * This source code is licensed under the BSD-style license found in the
18851 * LICENSE file in the root directory of this source tree. An additional grant
18852 * of patent rights can be found in the PATENTS file in the same directory.
18853 *
18854 * @providesModule SyntheticWheelEvent
18855 */
18856
18857'use strict';
18858
18859var SyntheticMouseEvent = _dereq_(122);
18860
18861/**
18862 * @interface WheelEvent
18863 * @see http://www.w3.org/TR/DOM-Level-3-Events/
18864 */
18865var WheelEventInterface = {
18866 deltaX: function (event) {
18867 return 'deltaX' in event ? event.deltaX :
18868 // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
18869 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
18870 },
18871 deltaY: function (event) {
18872 return 'deltaY' in event ? event.deltaY :
18873 // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
18874 'wheelDeltaY' in event ? -event.wheelDeltaY :
18875 // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
18876 'wheelDelta' in event ? -event.wheelDelta : 0;
18877 },
18878 deltaZ: null,
18879
18880 // Browsers without "deltaMode" is reporting in raw wheel delta where one
18881 // notch on the scroll is always +/- 120, roughly equivalent to pixels.
18882 // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
18883 // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
18884 deltaMode: null
18885};
18886
18887/**
18888 * @param {object} dispatchConfig Configuration used to dispatch this event.
18889 * @param {string} dispatchMarker Marker identifying the event target.
18890 * @param {object} nativeEvent Native browser event.
18891 * @extends {SyntheticMouseEvent}
18892 */
18893function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
18894 return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
18895}
18896
18897SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
18898
18899module.exports = SyntheticWheelEvent;
18900},{"122":122}],127:[function(_dereq_,module,exports){
18901/**
18902 * Copyright 2013-present, Facebook, Inc.
18903 * All rights reserved.
18904 *
18905 * This source code is licensed under the BSD-style license found in the
18906 * LICENSE file in the root directory of this source tree. An additional grant
18907 * of patent rights can be found in the PATENTS file in the same directory.
18908 *
18909 * @providesModule Transaction
18910 */
18911
18912'use strict';
18913
18914var _prodInvariant = _dereq_(153);
18915
18916var invariant = _dereq_(178);
18917
18918/**
18919 * `Transaction` creates a black box that is able to wrap any method such that
18920 * certain invariants are maintained before and after the method is invoked
18921 * (Even if an exception is thrown while invoking the wrapped method). Whoever
18922 * instantiates a transaction can provide enforcers of the invariants at
18923 * creation time. The `Transaction` class itself will supply one additional
18924 * automatic invariant for you - the invariant that any transaction instance
18925 * should not be run while it is already being run. You would typically create a
18926 * single instance of a `Transaction` for reuse multiple times, that potentially
18927 * is used to wrap several different methods. Wrappers are extremely simple -
18928 * they only require implementing two methods.
18929 *
18930 * <pre>
18931 * wrappers (injected at creation time)
18932 * + +
18933 * | |
18934 * +-----------------|--------|--------------+
18935 * | v | |
18936 * | +---------------+ | |
18937 * | +--| wrapper1 |---|----+ |
18938 * | | +---------------+ v | |
18939 * | | +-------------+ | |
18940 * | | +----| wrapper2 |--------+ |
18941 * | | | +-------------+ | | |
18942 * | | | | | |
18943 * | v v v v | wrapper
18944 * | +---+ +---+ +---------+ +---+ +---+ | invariants
18945 * perform(anyMethod) | | | | | | | | | | | | maintained
18946 * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
18947 * | | | | | | | | | | | |
18948 * | | | | | | | | | | | |
18949 * | | | | | | | | | | | |
18950 * | +---+ +---+ +---------+ +---+ +---+ |
18951 * | initialize close |
18952 * +-----------------------------------------+
18953 * </pre>
18954 *
18955 * Use cases:
18956 * - Preserving the input selection ranges before/after reconciliation.
18957 * Restoring selection even in the event of an unexpected error.
18958 * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
18959 * while guaranteeing that afterwards, the event system is reactivated.
18960 * - Flushing a queue of collected DOM mutations to the main UI thread after a
18961 * reconciliation takes place in a worker thread.
18962 * - Invoking any collected `componentDidUpdate` callbacks after rendering new
18963 * content.
18964 * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
18965 * to preserve the `scrollTop` (an automatic scroll aware DOM).
18966 * - (Future use case): Layout calculations before and after DOM updates.
18967 *
18968 * Transactional plugin API:
18969 * - A module that has an `initialize` method that returns any precomputation.
18970 * - and a `close` method that accepts the precomputation. `close` is invoked
18971 * when the wrapped process is completed, or has failed.
18972 *
18973 * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
18974 * that implement `initialize` and `close`.
18975 * @return {Transaction} Single transaction for reuse in thread.
18976 *
18977 * @class Transaction
18978 */
18979var Mixin = {
18980 /**
18981 * Sets up this instance so that it is prepared for collecting metrics. Does
18982 * so such that this setup method may be used on an instance that is already
18983 * initialized, in a way that does not consume additional memory upon reuse.
18984 * That can be useful if you decide to make your subclass of this mixin a
18985 * "PooledClass".
18986 */
18987 reinitializeTransaction: function () {
18988 this.transactionWrappers = this.getTransactionWrappers();
18989 if (this.wrapperInitData) {
18990 this.wrapperInitData.length = 0;
18991 } else {
18992 this.wrapperInitData = [];
18993 }
18994 this._isInTransaction = false;
18995 },
18996
18997 _isInTransaction: false,
18998
18999 /**
19000 * @abstract
19001 * @return {Array<TransactionWrapper>} Array of transaction wrappers.
19002 */
19003 getTransactionWrappers: null,
19004
19005 isInTransaction: function () {
19006 return !!this._isInTransaction;
19007 },
19008
19009 /**
19010 * Executes the function within a safety window. Use this for the top level
19011 * methods that result in large amounts of computation/mutations that would
19012 * need to be safety checked. The optional arguments helps prevent the need
19013 * to bind in many cases.
19014 *
19015 * @param {function} method Member of scope to call.
19016 * @param {Object} scope Scope to invoke from.
19017 * @param {Object?=} a Argument to pass to the method.
19018 * @param {Object?=} b Argument to pass to the method.
19019 * @param {Object?=} c Argument to pass to the method.
19020 * @param {Object?=} d Argument to pass to the method.
19021 * @param {Object?=} e Argument to pass to the method.
19022 * @param {Object?=} f Argument to pass to the method.
19023 *
19024 * @return {*} Return value from `method`.
19025 */
19026 perform: function (method, scope, a, b, c, d, e, f) {
19027 !!this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0;
19028 var errorThrown;
19029 var ret;
19030 try {
19031 this._isInTransaction = true;
19032 // Catching errors makes debugging more difficult, so we start with
19033 // errorThrown set to true before setting it to false after calling
19034 // close -- if it's still set to true in the finally block, it means
19035 // one of these calls threw.
19036 errorThrown = true;
19037 this.initializeAll(0);
19038 ret = method.call(scope, a, b, c, d, e, f);
19039 errorThrown = false;
19040 } finally {
19041 try {
19042 if (errorThrown) {
19043 // If `method` throws, prefer to show that stack trace over any thrown
19044 // by invoking `closeAll`.
19045 try {
19046 this.closeAll(0);
19047 } catch (err) {}
19048 } else {
19049 // Since `method` didn't throw, we don't want to silence the exception
19050 // here.
19051 this.closeAll(0);
19052 }
19053 } finally {
19054 this._isInTransaction = false;
19055 }
19056 }
19057 return ret;
19058 },
19059
19060 initializeAll: function (startIndex) {
19061 var transactionWrappers = this.transactionWrappers;
19062 for (var i = startIndex; i < transactionWrappers.length; i++) {
19063 var wrapper = transactionWrappers[i];
19064 try {
19065 // Catching errors makes debugging more difficult, so we start with the
19066 // OBSERVED_ERROR state before overwriting it with the real return value
19067 // of initialize -- if it's still set to OBSERVED_ERROR in the finally
19068 // block, it means wrapper.initialize threw.
19069 this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
19070 this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
19071 } finally {
19072 if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
19073 // The initializer for wrapper i threw an error; initialize the
19074 // remaining wrappers but silence any exceptions from them to ensure
19075 // that the first error is the one to bubble up.
19076 try {
19077 this.initializeAll(i + 1);
19078 } catch (err) {}
19079 }
19080 }
19081 }
19082 },
19083
19084 /**
19085 * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
19086 * them the respective return values of `this.transactionWrappers.init[i]`
19087 * (`close`rs that correspond to initializers that failed will not be
19088 * invoked).
19089 */
19090 closeAll: function (startIndex) {
19091 !this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0;
19092 var transactionWrappers = this.transactionWrappers;
19093 for (var i = startIndex; i < transactionWrappers.length; i++) {
19094 var wrapper = transactionWrappers[i];
19095 var initData = this.wrapperInitData[i];
19096 var errorThrown;
19097 try {
19098 // Catching errors makes debugging more difficult, so we start with
19099 // errorThrown set to true before setting it to false after calling
19100 // close -- if it's still set to true in the finally block, it means
19101 // wrapper.close threw.
19102 errorThrown = true;
19103 if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
19104 wrapper.close.call(this, initData);
19105 }
19106 errorThrown = false;
19107 } finally {
19108 if (errorThrown) {
19109 // The closer for wrapper i threw an error; close the remaining
19110 // wrappers but silence any exceptions from them to ensure that the
19111 // first error is the one to bubble up.
19112 try {
19113 this.closeAll(i + 1);
19114 } catch (e) {}
19115 }
19116 }
19117 }
19118 this.wrapperInitData.length = 0;
19119 }
19120};
19121
19122var Transaction = {
19123
19124 Mixin: Mixin,
19125
19126 /**
19127 * Token to look for to determine if an error occurred.
19128 */
19129 OBSERVED_ERROR: {}
19130
19131};
19132
19133module.exports = Transaction;
19134},{"153":153,"178":178}],128:[function(_dereq_,module,exports){
19135/**
19136 * Copyright 2013-present, Facebook, Inc.
19137 * All rights reserved.
19138 *
19139 * This source code is licensed under the BSD-style license found in the
19140 * LICENSE file in the root directory of this source tree. An additional grant
19141 * of patent rights can be found in the PATENTS file in the same directory.
19142 *
19143 * @providesModule ViewportMetrics
19144 */
19145
19146'use strict';
19147
19148var ViewportMetrics = {
19149
19150 currentScrollLeft: 0,
19151
19152 currentScrollTop: 0,
19153
19154 refreshScrollValues: function (scrollPosition) {
19155 ViewportMetrics.currentScrollLeft = scrollPosition.x;
19156 ViewportMetrics.currentScrollTop = scrollPosition.y;
19157 }
19158
19159};
19160
19161module.exports = ViewportMetrics;
19162},{}],129:[function(_dereq_,module,exports){
19163/**
19164 * Copyright 2014-present, Facebook, Inc.
19165 * All rights reserved.
19166 *
19167 * This source code is licensed under the BSD-style license found in the
19168 * LICENSE file in the root directory of this source tree. An additional grant
19169 * of patent rights can be found in the PATENTS file in the same directory.
19170 *
19171 * @providesModule accumulateInto
19172 *
19173 */
19174
19175'use strict';
19176
19177var _prodInvariant = _dereq_(153);
19178
19179var invariant = _dereq_(178);
19180
19181/**
19182 * Accumulates items that must not be null or undefined into the first one. This
19183 * is used to conserve memory by avoiding array allocations, and thus sacrifices
19184 * API cleanness. Since `current` can be null before being passed in and not
19185 * null after this function, make sure to assign it back to `current`:
19186 *
19187 * `a = accumulateInto(a, b);`
19188 *
19189 * This API should be sparingly used. Try `accumulate` for something cleaner.
19190 *
19191 * @return {*|array<*>} An accumulation of items.
19192 */
19193
19194function accumulateInto(current, next) {
19195 !(next != null) ? "development" !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0;
19196
19197 if (current == null) {
19198 return next;
19199 }
19200
19201 // Both are not empty. Warning: Never call x.concat(y) when you are not
19202 // certain that x is an Array (x could be a string with concat method).
19203 if (Array.isArray(current)) {
19204 if (Array.isArray(next)) {
19205 current.push.apply(current, next);
19206 return current;
19207 }
19208 current.push(next);
19209 return current;
19210 }
19211
19212 if (Array.isArray(next)) {
19213 // A bit too dangerous to mutate `next`.
19214 return [current].concat(next);
19215 }
19216
19217 return [current, next];
19218}
19219
19220module.exports = accumulateInto;
19221},{"153":153,"178":178}],130:[function(_dereq_,module,exports){
19222/**
19223 * Copyright 2013-present, Facebook, Inc.
19224 * All rights reserved.
19225 *
19226 * This source code is licensed under the BSD-style license found in the
19227 * LICENSE file in the root directory of this source tree. An additional grant
19228 * of patent rights can be found in the PATENTS file in the same directory.
19229 *
19230 * @providesModule adler32
19231 *
19232 */
19233
19234'use strict';
19235
19236var MOD = 65521;
19237
19238// adler32 is not cryptographically strong, and is only used to sanity check that
19239// markup generated on the server matches the markup generated on the client.
19240// This implementation (a modified version of the SheetJS version) has been optimized
19241// for our use case, at the expense of conforming to the adler32 specification
19242// for non-ascii inputs.
19243function adler32(data) {
19244 var a = 1;
19245 var b = 0;
19246 var i = 0;
19247 var l = data.length;
19248 var m = l & ~0x3;
19249 while (i < m) {
19250 var n = Math.min(i + 4096, m);
19251 for (; i < n; i += 4) {
19252 b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
19253 }
19254 a %= MOD;
19255 b %= MOD;
19256 }
19257 for (; i < l; i++) {
19258 b += a += data.charCodeAt(i);
19259 }
19260 a %= MOD;
19261 b %= MOD;
19262 return a | b << 16;
19263}
19264
19265module.exports = adler32;
19266},{}],131:[function(_dereq_,module,exports){
19267/**
19268 * Copyright 2013-present, Facebook, Inc.
19269 * All rights reserved.
19270 *
19271 * This source code is licensed under the BSD-style license found in the
19272 * LICENSE file in the root directory of this source tree. An additional grant
19273 * of patent rights can be found in the PATENTS file in the same directory.
19274 *
19275 * @providesModule canDefineProperty
19276 */
19277
19278'use strict';
19279
19280var canDefineProperty = false;
19281if ("development" !== 'production') {
19282 try {
19283 Object.defineProperty({}, 'x', { get: function () {} });
19284 canDefineProperty = true;
19285 } catch (x) {
19286 // IE will fail on defineProperty
19287 }
19288}
19289
19290module.exports = canDefineProperty;
19291},{}],132:[function(_dereq_,module,exports){
19292(function (process){
19293/**
19294 * Copyright 2013-present, Facebook, Inc.
19295 * All rights reserved.
19296 *
19297 * This source code is licensed under the BSD-style license found in the
19298 * LICENSE file in the root directory of this source tree. An additional grant
19299 * of patent rights can be found in the PATENTS file in the same directory.
19300 *
19301 * @providesModule checkReactTypeSpec
19302 */
19303
19304'use strict';
19305
19306var _prodInvariant = _dereq_(153);
19307
19308var ReactPropTypeLocationNames = _dereq_(89);
19309var ReactPropTypesSecret = _dereq_(92);
19310
19311var invariant = _dereq_(178);
19312var warning = _dereq_(187);
19313
19314var ReactComponentTreeHook;
19315
19316if (typeof process !== 'undefined' && process.env && "development" === 'test') {
19317 // Temporary hack.
19318 // Inline requires don't work well with Jest:
19319 // https://github.com/facebook/react/issues/7240
19320 // Remove the inline requires when we don't need them anymore:
19321 // https://github.com/facebook/react/pull/7178
19322 ReactComponentTreeHook = _dereq_(38);
19323}
19324
19325var loggedTypeFailures = {};
19326
19327/**
19328 * Assert that the values match with the type specs.
19329 * Error messages are memorized and will only be shown once.
19330 *
19331 * @param {object} typeSpecs Map of name to a ReactPropType
19332 * @param {object} values Runtime values that need to be type-checked
19333 * @param {string} location e.g. "prop", "context", "child context"
19334 * @param {string} componentName Name of the component for error messages.
19335 * @param {?object} element The React element that is being type-checked
19336 * @param {?number} debugID The React component instance that is being type-checked
19337 * @private
19338 */
19339function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
19340 for (var typeSpecName in typeSpecs) {
19341 if (typeSpecs.hasOwnProperty(typeSpecName)) {
19342 var error;
19343 // Prop type validation may throw. In case they do, we don't want to
19344 // fail the render phase where it didn't fail before. So we log it.
19345 // After these have been cleaned up, we'll let them throw.
19346 try {
19347 // This is intentionally an invariant that gets caught. It's the same
19348 // behavior as without this statement except with a better message.
19349 !(typeof typeSpecs[typeSpecName] === '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], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0;
19350 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
19351 } catch (ex) {
19352 error = ex;
19353 }
19354 "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], typeSpecName, typeof error) : void 0;
19355 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
19356 // Only monitor this failure once because there tends to be a lot of the
19357 // same error.
19358 loggedTypeFailures[error.message] = true;
19359
19360 var componentStackInfo = '';
19361
19362 if ("development" !== 'production') {
19363 if (!ReactComponentTreeHook) {
19364 ReactComponentTreeHook = _dereq_(38);
19365 }
19366 if (debugID !== null) {
19367 componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
19368 } else if (element !== null) {
19369 componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
19370 }
19371 }
19372
19373 "development" !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
19374 }
19375 }
19376 }
19377}
19378
19379module.exports = checkReactTypeSpec;
19380}).call(this,undefined)
19381},{"153":153,"178":178,"187":187,"38":38,"89":89,"92":92}],133:[function(_dereq_,module,exports){
19382/**
19383 * Copyright 2013-present, Facebook, Inc.
19384 * All rights reserved.
19385 *
19386 * This source code is licensed under the BSD-style license found in the
19387 * LICENSE file in the root directory of this source tree. An additional grant
19388 * of patent rights can be found in the PATENTS file in the same directory.
19389 *
19390 * @providesModule createMicrosoftUnsafeLocalFunction
19391 */
19392
19393/* globals MSApp */
19394
19395'use strict';
19396
19397/**
19398 * Create a function which has 'unsafe' privileges (required by windows8 apps)
19399 */
19400
19401var createMicrosoftUnsafeLocalFunction = function (func) {
19402 if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
19403 return function (arg0, arg1, arg2, arg3) {
19404 MSApp.execUnsafeLocalFunction(function () {
19405 return func(arg0, arg1, arg2, arg3);
19406 });
19407 };
19408 } else {
19409 return func;
19410 }
19411};
19412
19413module.exports = createMicrosoftUnsafeLocalFunction;
19414},{}],134:[function(_dereq_,module,exports){
19415/**
19416 * Copyright 2013-present, Facebook, Inc.
19417 * All rights reserved.
19418 *
19419 * This source code is licensed under the BSD-style license found in the
19420 * LICENSE file in the root directory of this source tree. An additional grant
19421 * of patent rights can be found in the PATENTS file in the same directory.
19422 *
19423 * @providesModule dangerousStyleValue
19424 */
19425
19426'use strict';
19427
19428var CSSProperty = _dereq_(3);
19429var warning = _dereq_(187);
19430
19431var isUnitlessNumber = CSSProperty.isUnitlessNumber;
19432var styleWarnings = {};
19433
19434/**
19435 * Convert a value into the proper css writable value. The style name `name`
19436 * should be logical (no hyphens), as specified
19437 * in `CSSProperty.isUnitlessNumber`.
19438 *
19439 * @param {string} name CSS property name such as `topMargin`.
19440 * @param {*} value CSS property value such as `10px`.
19441 * @param {ReactDOMComponent} component
19442 * @return {string} Normalized style value with dimensions applied.
19443 */
19444function dangerousStyleValue(name, value, component) {
19445 // Note that we've removed escapeTextForBrowser() calls here since the
19446 // whole string will be escaped when the attribute is injected into
19447 // the markup. If you provide unsafe user data here they can inject
19448 // arbitrary CSS which may be problematic (I couldn't repro this):
19449 // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
19450 // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
19451 // This is not an XSS hole but instead a potential CSS injection issue
19452 // which has lead to a greater discussion about how we're going to
19453 // trust URLs moving forward. See #2115901
19454
19455 var isEmpty = value == null || typeof value === 'boolean' || value === '';
19456 if (isEmpty) {
19457 return '';
19458 }
19459
19460 var isNonNumeric = isNaN(value);
19461 if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
19462 return '' + value; // cast to string
19463 }
19464
19465 if (typeof value === 'string') {
19466 if ("development" !== 'production') {
19467 // Allow '0' to pass through without warning. 0 is already special and
19468 // doesn't require units, so we don't need to warn about it.
19469 if (component && value !== '0') {
19470 var owner = component._currentElement._owner;
19471 var ownerName = owner ? owner.getName() : null;
19472 if (ownerName && !styleWarnings[ownerName]) {
19473 styleWarnings[ownerName] = {};
19474 }
19475 var warned = false;
19476 if (ownerName) {
19477 var warnings = styleWarnings[ownerName];
19478 warned = warnings[name];
19479 if (!warned) {
19480 warnings[name] = true;
19481 }
19482 }
19483 if (!warned) {
19484 "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;
19485 }
19486 }
19487 }
19488 value = value.trim();
19489 }
19490 return value + 'px';
19491}
19492
19493module.exports = dangerousStyleValue;
19494},{"187":187,"3":3}],135:[function(_dereq_,module,exports){
19495/**
19496 * Copyright 2016-present, Facebook, Inc.
19497 * All rights reserved.
19498 *
19499 * This source code is licensed under the BSD-style license found in the
19500 * LICENSE file in the root directory of this source tree. An additional grant
19501 * of patent rights can be found in the PATENTS file in the same directory.
19502 *
19503 * Based on the escape-html library, which is used under the MIT License below:
19504 *
19505 * Copyright (c) 2012-2013 TJ Holowaychuk
19506 * Copyright (c) 2015 Andreas Lubbe
19507 * Copyright (c) 2015 Tiancheng "Timothy" Gu
19508 *
19509 * Permission is hereby granted, free of charge, to any person obtaining
19510 * a copy of this software and associated documentation files (the
19511 * 'Software'), to deal in the Software without restriction, including
19512 * without limitation the rights to use, copy, modify, merge, publish,
19513 * distribute, sublicense, and/or sell copies of the Software, and to
19514 * permit persons to whom the Software is furnished to do so, subject to
19515 * the following conditions:
19516 *
19517 * The above copyright notice and this permission notice shall be
19518 * included in all copies or substantial portions of the Software.
19519 *
19520 * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
19521 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19522 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19523 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19524 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19525 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19526 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19527 *
19528 * @providesModule escapeTextContentForBrowser
19529 */
19530
19531'use strict';
19532
19533// code copied and modified from escape-html
19534/**
19535 * Module variables.
19536 * @private
19537 */
19538
19539var matchHtmlRegExp = /["'&<>]/;
19540
19541/**
19542 * Escape special characters in the given string of html.
19543 *
19544 * @param {string} string The string to escape for inserting into HTML
19545 * @return {string}
19546 * @public
19547 */
19548
19549function escapeHtml(string) {
19550 var str = '' + string;
19551 var match = matchHtmlRegExp.exec(str);
19552
19553 if (!match) {
19554 return str;
19555 }
19556
19557 var escape;
19558 var html = '';
19559 var index = 0;
19560 var lastIndex = 0;
19561
19562 for (index = match.index; index < str.length; index++) {
19563 switch (str.charCodeAt(index)) {
19564 case 34:
19565 // "
19566 escape = '&quot;';
19567 break;
19568 case 38:
19569 // &
19570 escape = '&amp;';
19571 break;
19572 case 39:
19573 // '
19574 escape = '&#x27;'; // modified from escape-html; used to be '&#39'
19575 break;
19576 case 60:
19577 // <
19578 escape = '&lt;';
19579 break;
19580 case 62:
19581 // >
19582 escape = '&gt;';
19583 break;
19584 default:
19585 continue;
19586 }
19587
19588 if (lastIndex !== index) {
19589 html += str.substring(lastIndex, index);
19590 }
19591
19592 lastIndex = index + 1;
19593 html += escape;
19594 }
19595
19596 return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
19597}
19598// end code copied and modified from escape-html
19599
19600
19601/**
19602 * Escapes text to prevent scripting attacks.
19603 *
19604 * @param {*} text Text value to escape.
19605 * @return {string} An escaped string.
19606 */
19607function escapeTextContentForBrowser(text) {
19608 if (typeof text === 'boolean' || typeof text === 'number') {
19609 // this shortcircuit helps perf for types that we know will never have
19610 // special characters, especially given that this function is used often
19611 // for numeric dom ids.
19612 return '' + text;
19613 }
19614 return escapeHtml(text);
19615}
19616
19617module.exports = escapeTextContentForBrowser;
19618},{}],136:[function(_dereq_,module,exports){
19619/**
19620 * Copyright 2013-present, Facebook, Inc.
19621 * All rights reserved.
19622 *
19623 * This source code is licensed under the BSD-style license found in the
19624 * LICENSE file in the root directory of this source tree. An additional grant
19625 * of patent rights can be found in the PATENTS file in the same directory.
19626 *
19627 * @providesModule findDOMNode
19628 */
19629
19630'use strict';
19631
19632var _prodInvariant = _dereq_(153);
19633
19634var ReactCurrentOwner = _dereq_(41);
19635var ReactDOMComponentTree = _dereq_(46);
19636var ReactInstanceMap = _dereq_(77);
19637
19638var getHostComponentFromComposite = _dereq_(143);
19639var invariant = _dereq_(178);
19640var warning = _dereq_(187);
19641
19642/**
19643 * Returns the DOM node rendered by this element.
19644 *
19645 * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode
19646 *
19647 * @param {ReactComponent|DOMElement} componentOrElement
19648 * @return {?DOMElement} The root node of this element.
19649 */
19650function findDOMNode(componentOrElement) {
19651 if ("development" !== 'production') {
19652 var owner = ReactCurrentOwner.current;
19653 if (owner !== null) {
19654 "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;
19655 owner._warnedAboutRefsInRender = true;
19656 }
19657 }
19658 if (componentOrElement == null) {
19659 return null;
19660 }
19661 if (componentOrElement.nodeType === 1) {
19662 return componentOrElement;
19663 }
19664
19665 var inst = ReactInstanceMap.get(componentOrElement);
19666 if (inst) {
19667 inst = getHostComponentFromComposite(inst);
19668 return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null;
19669 }
19670
19671 if (typeof componentOrElement.render === 'function') {
19672 !false ? "development" !== 'production' ? invariant(false, 'findDOMNode was called on an unmounted component.') : _prodInvariant('44') : void 0;
19673 } else {
19674 !false ? "development" !== 'production' ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : _prodInvariant('45', Object.keys(componentOrElement)) : void 0;
19675 }
19676}
19677
19678module.exports = findDOMNode;
19679},{"143":143,"153":153,"178":178,"187":187,"41":41,"46":46,"77":77}],137:[function(_dereq_,module,exports){
19680(function (process){
19681/**
19682 * Copyright 2013-present, Facebook, Inc.
19683 * All rights reserved.
19684 *
19685 * This source code is licensed under the BSD-style license found in the
19686 * LICENSE file in the root directory of this source tree. An additional grant
19687 * of patent rights can be found in the PATENTS file in the same directory.
19688 *
19689 * @providesModule flattenChildren
19690 *
19691 */
19692
19693'use strict';
19694
19695var KeyEscapeUtils = _dereq_(23);
19696var traverseAllChildren = _dereq_(159);
19697var warning = _dereq_(187);
19698
19699var ReactComponentTreeHook;
19700
19701if (typeof process !== 'undefined' && process.env && "development" === 'test') {
19702 // Temporary hack.
19703 // Inline requires don't work well with Jest:
19704 // https://github.com/facebook/react/issues/7240
19705 // Remove the inline requires when we don't need them anymore:
19706 // https://github.com/facebook/react/pull/7178
19707 ReactComponentTreeHook = _dereq_(38);
19708}
19709
19710/**
19711 * @param {function} traverseContext Context passed through traversal.
19712 * @param {?ReactComponent} child React child component.
19713 * @param {!string} name String name of key path to child.
19714 * @param {number=} selfDebugID Optional debugID of the current internal instance.
19715 */
19716function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) {
19717 // We found a component instance.
19718 if (traverseContext && typeof traverseContext === 'object') {
19719 var result = traverseContext;
19720 var keyUnique = result[name] === undefined;
19721 if ("development" !== 'production') {
19722 if (!ReactComponentTreeHook) {
19723 ReactComponentTreeHook = _dereq_(38);
19724 }
19725 if (!keyUnique) {
19726 "development" !== 'production' ? warning(false, '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.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0;
19727 }
19728 }
19729 if (keyUnique && child != null) {
19730 result[name] = child;
19731 }
19732 }
19733}
19734
19735/**
19736 * Flattens children that are typically specified as `props.children`. Any null
19737 * children will not be included in the resulting object.
19738 * @return {!object} flattened children keyed by name.
19739 */
19740function flattenChildren(children, selfDebugID) {
19741 if (children == null) {
19742 return children;
19743 }
19744 var result = {};
19745
19746 if ("development" !== 'production') {
19747 traverseAllChildren(children, function (traverseContext, child, name) {
19748 return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID);
19749 }, result);
19750 } else {
19751 traverseAllChildren(children, flattenSingleChildIntoContext, result);
19752 }
19753 return result;
19754}
19755
19756module.exports = flattenChildren;
19757}).call(this,undefined)
19758},{"159":159,"187":187,"23":23,"38":38}],138:[function(_dereq_,module,exports){
19759/**
19760 * Copyright 2013-present, Facebook, Inc.
19761 * All rights reserved.
19762 *
19763 * This source code is licensed under the BSD-style license found in the
19764 * LICENSE file in the root directory of this source tree. An additional grant
19765 * of patent rights can be found in the PATENTS file in the same directory.
19766 *
19767 * @providesModule forEachAccumulated
19768 *
19769 */
19770
19771'use strict';
19772
19773/**
19774 * @param {array} arr an "accumulation" of items which is either an Array or
19775 * a single item. Useful when paired with the `accumulate` module. This is a
19776 * simple utility that allows us to reason about a collection of items, but
19777 * handling the case when there is exactly one item (and we do not need to
19778 * allocate an array).
19779 */
19780
19781function forEachAccumulated(arr, cb, scope) {
19782 if (Array.isArray(arr)) {
19783 arr.forEach(cb, scope);
19784 } else if (arr) {
19785 cb.call(scope, arr);
19786 }
19787}
19788
19789module.exports = forEachAccumulated;
19790},{}],139:[function(_dereq_,module,exports){
19791/**
19792 * Copyright 2013-present, Facebook, Inc.
19793 * All rights reserved.
19794 *
19795 * This source code is licensed under the BSD-style license found in the
19796 * LICENSE file in the root directory of this source tree. An additional grant
19797 * of patent rights can be found in the PATENTS file in the same directory.
19798 *
19799 * @providesModule getEventCharCode
19800 */
19801
19802'use strict';
19803
19804/**
19805 * `charCode` represents the actual "character code" and is safe to use with
19806 * `String.fromCharCode`. As such, only keys that correspond to printable
19807 * characters produce a valid `charCode`, the only exception to this is Enter.
19808 * The Tab-key is considered non-printable and does not have a `charCode`,
19809 * presumably because it does not produce a tab-character in browsers.
19810 *
19811 * @param {object} nativeEvent Native browser event.
19812 * @return {number} Normalized `charCode` property.
19813 */
19814
19815function getEventCharCode(nativeEvent) {
19816 var charCode;
19817 var keyCode = nativeEvent.keyCode;
19818
19819 if ('charCode' in nativeEvent) {
19820 charCode = nativeEvent.charCode;
19821
19822 // FF does not set `charCode` for the Enter-key, check against `keyCode`.
19823 if (charCode === 0 && keyCode === 13) {
19824 charCode = 13;
19825 }
19826 } else {
19827 // IE8 does not implement `charCode`, but `keyCode` has the correct value.
19828 charCode = keyCode;
19829 }
19830
19831 // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
19832 // Must not discard the (non-)printable Enter-key.
19833 if (charCode >= 32 || charCode === 13) {
19834 return charCode;
19835 }
19836
19837 return 0;
19838}
19839
19840module.exports = getEventCharCode;
19841},{}],140:[function(_dereq_,module,exports){
19842/**
19843 * Copyright 2013-present, Facebook, Inc.
19844 * All rights reserved.
19845 *
19846 * This source code is licensed under the BSD-style license found in the
19847 * LICENSE file in the root directory of this source tree. An additional grant
19848 * of patent rights can be found in the PATENTS file in the same directory.
19849 *
19850 * @providesModule getEventKey
19851 */
19852
19853'use strict';
19854
19855var getEventCharCode = _dereq_(139);
19856
19857/**
19858 * Normalization of deprecated HTML5 `key` values
19859 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
19860 */
19861var normalizeKey = {
19862 'Esc': 'Escape',
19863 'Spacebar': ' ',
19864 'Left': 'ArrowLeft',
19865 'Up': 'ArrowUp',
19866 'Right': 'ArrowRight',
19867 'Down': 'ArrowDown',
19868 'Del': 'Delete',
19869 'Win': 'OS',
19870 'Menu': 'ContextMenu',
19871 'Apps': 'ContextMenu',
19872 'Scroll': 'ScrollLock',
19873 'MozPrintableKey': 'Unidentified'
19874};
19875
19876/**
19877 * Translation from legacy `keyCode` to HTML5 `key`
19878 * Only special keys supported, all others depend on keyboard layout or browser
19879 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
19880 */
19881var translateToKey = {
19882 8: 'Backspace',
19883 9: 'Tab',
19884 12: 'Clear',
19885 13: 'Enter',
19886 16: 'Shift',
19887 17: 'Control',
19888 18: 'Alt',
19889 19: 'Pause',
19890 20: 'CapsLock',
19891 27: 'Escape',
19892 32: ' ',
19893 33: 'PageUp',
19894 34: 'PageDown',
19895 35: 'End',
19896 36: 'Home',
19897 37: 'ArrowLeft',
19898 38: 'ArrowUp',
19899 39: 'ArrowRight',
19900 40: 'ArrowDown',
19901 45: 'Insert',
19902 46: 'Delete',
19903 112: 'F1', 113: 'F2', 114: 'F3', 115: 'F4', 116: 'F5', 117: 'F6',
19904 118: 'F7', 119: 'F8', 120: 'F9', 121: 'F10', 122: 'F11', 123: 'F12',
19905 144: 'NumLock',
19906 145: 'ScrollLock',
19907 224: 'Meta'
19908};
19909
19910/**
19911 * @param {object} nativeEvent Native browser event.
19912 * @return {string} Normalized `key` property.
19913 */
19914function getEventKey(nativeEvent) {
19915 if (nativeEvent.key) {
19916 // Normalize inconsistent values reported by browsers due to
19917 // implementations of a working draft specification.
19918
19919 // FireFox implements `key` but returns `MozPrintableKey` for all
19920 // printable characters (normalized to `Unidentified`), ignore it.
19921 var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
19922 if (key !== 'Unidentified') {
19923 return key;
19924 }
19925 }
19926
19927 // Browser does not implement `key`, polyfill as much of it as we can.
19928 if (nativeEvent.type === 'keypress') {
19929 var charCode = getEventCharCode(nativeEvent);
19930
19931 // The enter-key is technically both printable and non-printable and can
19932 // thus be captured by `keypress`, no other non-printable key should.
19933 return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
19934 }
19935 if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
19936 // While user keyboard layout determines the actual meaning of each
19937 // `keyCode` value, almost all function keys have a universal value.
19938 return translateToKey[nativeEvent.keyCode] || 'Unidentified';
19939 }
19940 return '';
19941}
19942
19943module.exports = getEventKey;
19944},{"139":139}],141:[function(_dereq_,module,exports){
19945/**
19946 * Copyright 2013-present, Facebook, Inc.
19947 * All rights reserved.
19948 *
19949 * This source code is licensed under the BSD-style license found in the
19950 * LICENSE file in the root directory of this source tree. An additional grant
19951 * of patent rights can be found in the PATENTS file in the same directory.
19952 *
19953 * @providesModule getEventModifierState
19954 */
19955
19956'use strict';
19957
19958/**
19959 * Translation from modifier key to the associated property in the event.
19960 * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
19961 */
19962
19963var modifierKeyToProp = {
19964 'Alt': 'altKey',
19965 'Control': 'ctrlKey',
19966 'Meta': 'metaKey',
19967 'Shift': 'shiftKey'
19968};
19969
19970// IE8 does not implement getModifierState so we simply map it to the only
19971// modifier keys exposed by the event itself, does not support Lock-keys.
19972// Currently, all major browsers except Chrome seems to support Lock-keys.
19973function modifierStateGetter(keyArg) {
19974 var syntheticEvent = this;
19975 var nativeEvent = syntheticEvent.nativeEvent;
19976 if (nativeEvent.getModifierState) {
19977 return nativeEvent.getModifierState(keyArg);
19978 }
19979 var keyProp = modifierKeyToProp[keyArg];
19980 return keyProp ? !!nativeEvent[keyProp] : false;
19981}
19982
19983function getEventModifierState(nativeEvent) {
19984 return modifierStateGetter;
19985}
19986
19987module.exports = getEventModifierState;
19988},{}],142:[function(_dereq_,module,exports){
19989/**
19990 * Copyright 2013-present, Facebook, Inc.
19991 * All rights reserved.
19992 *
19993 * This source code is licensed under the BSD-style license found in the
19994 * LICENSE file in the root directory of this source tree. An additional grant
19995 * of patent rights can be found in the PATENTS file in the same directory.
19996 *
19997 * @providesModule getEventTarget
19998 */
19999
20000'use strict';
20001
20002/**
20003 * Gets the target node from a native browser event by accounting for
20004 * inconsistencies in browser DOM APIs.
20005 *
20006 * @param {object} nativeEvent Native browser event.
20007 * @return {DOMEventTarget} Target node.
20008 */
20009
20010function getEventTarget(nativeEvent) {
20011 var target = nativeEvent.target || nativeEvent.srcElement || window;
20012
20013 // Normalize SVG <use> element events #4963
20014 if (target.correspondingUseElement) {
20015 target = target.correspondingUseElement;
20016 }
20017
20018 // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
20019 // @see http://www.quirksmode.org/js/events_properties.html
20020 return target.nodeType === 3 ? target.parentNode : target;
20021}
20022
20023module.exports = getEventTarget;
20024},{}],143:[function(_dereq_,module,exports){
20025/**
20026 * Copyright 2013-present, Facebook, Inc.
20027 * All rights reserved.
20028 *
20029 * This source code is licensed under the BSD-style license found in the
20030 * LICENSE file in the root directory of this source tree. An additional grant
20031 * of patent rights can be found in the PATENTS file in the same directory.
20032 *
20033 * @providesModule getHostComponentFromComposite
20034 */
20035
20036'use strict';
20037
20038var ReactNodeTypes = _dereq_(85);
20039
20040function getHostComponentFromComposite(inst) {
20041 var type;
20042
20043 while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) {
20044 inst = inst._renderedComponent;
20045 }
20046
20047 if (type === ReactNodeTypes.HOST) {
20048 return inst._renderedComponent;
20049 } else if (type === ReactNodeTypes.EMPTY) {
20050 return null;
20051 }
20052}
20053
20054module.exports = getHostComponentFromComposite;
20055},{"85":85}],144:[function(_dereq_,module,exports){
20056/**
20057 * Copyright 2013-present, Facebook, Inc.
20058 * All rights reserved.
20059 *
20060 * This source code is licensed under the BSD-style license found in the
20061 * LICENSE file in the root directory of this source tree. An additional grant
20062 * of patent rights can be found in the PATENTS file in the same directory.
20063 *
20064 * @providesModule getIteratorFn
20065 *
20066 */
20067
20068'use strict';
20069
20070/* global Symbol */
20071
20072var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
20073var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
20074
20075/**
20076 * Returns the iterator method function contained on the iterable object.
20077 *
20078 * Be sure to invoke the function with the iterable as context:
20079 *
20080 * var iteratorFn = getIteratorFn(myIterable);
20081 * if (iteratorFn) {
20082 * var iterator = iteratorFn.call(myIterable);
20083 * ...
20084 * }
20085 *
20086 * @param {?object} maybeIterable
20087 * @return {?function}
20088 */
20089function getIteratorFn(maybeIterable) {
20090 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
20091 if (typeof iteratorFn === 'function') {
20092 return iteratorFn;
20093 }
20094}
20095
20096module.exports = getIteratorFn;
20097},{}],145:[function(_dereq_,module,exports){
20098/**
20099 * Copyright 2013-present, Facebook, Inc.
20100 * All rights reserved.
20101 *
20102 * This source code is licensed under the BSD-style license found in the
20103 * LICENSE file in the root directory of this source tree. An additional grant
20104 * of patent rights can be found in the PATENTS file in the same directory.
20105 *
20106 * @providesModule getNodeForCharacterOffset
20107 */
20108
20109'use strict';
20110
20111/**
20112 * Given any node return the first leaf node without children.
20113 *
20114 * @param {DOMElement|DOMTextNode} node
20115 * @return {DOMElement|DOMTextNode}
20116 */
20117
20118function getLeafNode(node) {
20119 while (node && node.firstChild) {
20120 node = node.firstChild;
20121 }
20122 return node;
20123}
20124
20125/**
20126 * Get the next sibling within a container. This will walk up the
20127 * DOM if a node's siblings have been exhausted.
20128 *
20129 * @param {DOMElement|DOMTextNode} node
20130 * @return {?DOMElement|DOMTextNode}
20131 */
20132function getSiblingNode(node) {
20133 while (node) {
20134 if (node.nextSibling) {
20135 return node.nextSibling;
20136 }
20137 node = node.parentNode;
20138 }
20139}
20140
20141/**
20142 * Get object describing the nodes which contain characters at offset.
20143 *
20144 * @param {DOMElement|DOMTextNode} root
20145 * @param {number} offset
20146 * @return {?object}
20147 */
20148function getNodeForCharacterOffset(root, offset) {
20149 var node = getLeafNode(root);
20150 var nodeStart = 0;
20151 var nodeEnd = 0;
20152
20153 while (node) {
20154 if (node.nodeType === 3) {
20155 nodeEnd = nodeStart + node.textContent.length;
20156
20157 if (nodeStart <= offset && nodeEnd >= offset) {
20158 return {
20159 node: node,
20160 offset: offset - nodeStart
20161 };
20162 }
20163
20164 nodeStart = nodeEnd;
20165 }
20166
20167 node = getLeafNode(getSiblingNode(node));
20168 }
20169}
20170
20171module.exports = getNodeForCharacterOffset;
20172},{}],146:[function(_dereq_,module,exports){
20173/**
20174 * Copyright 2013-present, Facebook, Inc.
20175 * All rights reserved.
20176 *
20177 * This source code is licensed under the BSD-style license found in the
20178 * LICENSE file in the root directory of this source tree. An additional grant
20179 * of patent rights can be found in the PATENTS file in the same directory.
20180 *
20181 * @providesModule getTextContentAccessor
20182 */
20183
20184'use strict';
20185
20186var ExecutionEnvironment = _dereq_(164);
20187
20188var contentKey = null;
20189
20190/**
20191 * Gets the key used to access text content on a DOM node.
20192 *
20193 * @return {?string} Key used to access text content.
20194 * @internal
20195 */
20196function getTextContentAccessor() {
20197 if (!contentKey && ExecutionEnvironment.canUseDOM) {
20198 // Prefer textContent to innerText because many browsers support both but
20199 // SVG <text> elements don't support innerText even when <div> does.
20200 contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
20201 }
20202 return contentKey;
20203}
20204
20205module.exports = getTextContentAccessor;
20206},{"164":164}],147:[function(_dereq_,module,exports){
20207/**
20208 * Copyright 2013-present, Facebook, Inc.
20209 * All rights reserved.
20210 *
20211 * This source code is licensed under the BSD-style license found in the
20212 * LICENSE file in the root directory of this source tree. An additional grant
20213 * of patent rights can be found in the PATENTS file in the same directory.
20214 *
20215 * @providesModule getVendorPrefixedEventName
20216 */
20217
20218'use strict';
20219
20220var ExecutionEnvironment = _dereq_(164);
20221
20222/**
20223 * Generate a mapping of standard vendor prefixes using the defined style property and event name.
20224 *
20225 * @param {string} styleProp
20226 * @param {string} eventName
20227 * @returns {object}
20228 */
20229function makePrefixMap(styleProp, eventName) {
20230 var prefixes = {};
20231
20232 prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
20233 prefixes['Webkit' + styleProp] = 'webkit' + eventName;
20234 prefixes['Moz' + styleProp] = 'moz' + eventName;
20235 prefixes['ms' + styleProp] = 'MS' + eventName;
20236 prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
20237
20238 return prefixes;
20239}
20240
20241/**
20242 * A list of event names to a configurable list of vendor prefixes.
20243 */
20244var vendorPrefixes = {
20245 animationend: makePrefixMap('Animation', 'AnimationEnd'),
20246 animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
20247 animationstart: makePrefixMap('Animation', 'AnimationStart'),
20248 transitionend: makePrefixMap('Transition', 'TransitionEnd')
20249};
20250
20251/**
20252 * Event names that have already been detected and prefixed (if applicable).
20253 */
20254var prefixedEventNames = {};
20255
20256/**
20257 * Element to check for prefixes on.
20258 */
20259var style = {};
20260
20261/**
20262 * Bootstrap if a DOM exists.
20263 */
20264if (ExecutionEnvironment.canUseDOM) {
20265 style = document.createElement('div').style;
20266
20267 // On some platforms, in particular some releases of Android 4.x,
20268 // the un-prefixed "animation" and "transition" properties are defined on the
20269 // style object but the events that fire will still be prefixed, so we need
20270 // to check if the un-prefixed events are usable, and if not remove them from the map.
20271 if (!('AnimationEvent' in window)) {
20272 delete vendorPrefixes.animationend.animation;
20273 delete vendorPrefixes.animationiteration.animation;
20274 delete vendorPrefixes.animationstart.animation;
20275 }
20276
20277 // Same as above
20278 if (!('TransitionEvent' in window)) {
20279 delete vendorPrefixes.transitionend.transition;
20280 }
20281}
20282
20283/**
20284 * Attempts to determine the correct vendor prefixed event name.
20285 *
20286 * @param {string} eventName
20287 * @returns {string}
20288 */
20289function getVendorPrefixedEventName(eventName) {
20290 if (prefixedEventNames[eventName]) {
20291 return prefixedEventNames[eventName];
20292 } else if (!vendorPrefixes[eventName]) {
20293 return eventName;
20294 }
20295
20296 var prefixMap = vendorPrefixes[eventName];
20297
20298 for (var styleProp in prefixMap) {
20299 if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
20300 return prefixedEventNames[eventName] = prefixMap[styleProp];
20301 }
20302 }
20303
20304 return '';
20305}
20306
20307module.exports = getVendorPrefixedEventName;
20308},{"164":164}],148:[function(_dereq_,module,exports){
20309/**
20310 * Copyright 2013-present, Facebook, Inc.
20311 * All rights reserved.
20312 *
20313 * This source code is licensed under the BSD-style license found in the
20314 * LICENSE file in the root directory of this source tree. An additional grant
20315 * of patent rights can be found in the PATENTS file in the same directory.
20316 *
20317 * @providesModule instantiateReactComponent
20318 */
20319
20320'use strict';
20321
20322var _prodInvariant = _dereq_(153),
20323 _assign = _dereq_(188);
20324
20325var ReactCompositeComponent = _dereq_(40);
20326var ReactEmptyComponent = _dereq_(67);
20327var ReactHostComponent = _dereq_(73);
20328
20329var invariant = _dereq_(178);
20330var warning = _dereq_(187);
20331
20332// To avoid a cyclic dependency, we create the final class in this module
20333var ReactCompositeComponentWrapper = function (element) {
20334 this.construct(element);
20335};
20336_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
20337 _instantiateReactComponent: instantiateReactComponent
20338});
20339
20340function getDeclarationErrorAddendum(owner) {
20341 if (owner) {
20342 var name = owner.getName();
20343 if (name) {
20344 return ' Check the render method of `' + name + '`.';
20345 }
20346 }
20347 return '';
20348}
20349
20350/**
20351 * Check if the type reference is a known internal type. I.e. not a user
20352 * provided composite type.
20353 *
20354 * @param {function} type
20355 * @return {boolean} Returns true if this is a valid internal type.
20356 */
20357function isInternalComponentType(type) {
20358 return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
20359}
20360
20361var nextDebugID = 1;
20362
20363/**
20364 * Given a ReactNode, create an instance that will actually be mounted.
20365 *
20366 * @param {ReactNode} node
20367 * @param {boolean} shouldHaveDebugID
20368 * @return {object} A new instance of the element's constructor.
20369 * @protected
20370 */
20371function instantiateReactComponent(node, shouldHaveDebugID) {
20372 var instance;
20373
20374 if (node === null || node === false) {
20375 instance = ReactEmptyComponent.create(instantiateReactComponent);
20376 } else if (typeof node === 'object') {
20377 var element = node;
20378 !(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)) : _prodInvariant('130', element.type == null ? element.type : typeof element.type, getDeclarationErrorAddendum(element._owner)) : void 0;
20379
20380 // Special case string values
20381 if (typeof element.type === 'string') {
20382 instance = ReactHostComponent.createInternalComponent(element);
20383 } else if (isInternalComponentType(element.type)) {
20384 // This is temporarily available for custom components that are not string
20385 // representations. I.e. ART. Once those are updated to use the string
20386 // representation, we can drop this code path.
20387 instance = new element.type(element);
20388
20389 // We renamed this. Allow the old name for compat. :(
20390 if (!instance.getHostNode) {
20391 instance.getHostNode = instance.getNativeNode;
20392 }
20393 } else {
20394 instance = new ReactCompositeComponentWrapper(element);
20395 }
20396 } else if (typeof node === 'string' || typeof node === 'number') {
20397 instance = ReactHostComponent.createInstanceForText(node);
20398 } else {
20399 !false ? "development" !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0;
20400 }
20401
20402 if ("development" !== 'production') {
20403 "development" !== 'production' ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0;
20404 }
20405
20406 // These two fields are used by the DOM and ART diffing algorithms
20407 // respectively. Instead of using expandos on components, we should be
20408 // storing the state needed by the diffing algorithms elsewhere.
20409 instance._mountIndex = 0;
20410 instance._mountImage = null;
20411
20412 if ("development" !== 'production') {
20413 instance._debugID = shouldHaveDebugID ? nextDebugID++ : 0;
20414 }
20415
20416 // Internal instances should fully constructed at this point, so they should
20417 // not get any new fields added to them at this point.
20418 if ("development" !== 'production') {
20419 if (Object.preventExtensions) {
20420 Object.preventExtensions(instance);
20421 }
20422 }
20423
20424 return instance;
20425}
20426
20427module.exports = instantiateReactComponent;
20428},{"153":153,"178":178,"187":187,"188":188,"40":40,"67":67,"73":73}],149:[function(_dereq_,module,exports){
20429/**
20430 * Copyright 2013-present, Facebook, Inc.
20431 * All rights reserved.
20432 *
20433 * This source code is licensed under the BSD-style license found in the
20434 * LICENSE file in the root directory of this source tree. An additional grant
20435 * of patent rights can be found in the PATENTS file in the same directory.
20436 *
20437 * @providesModule isEventSupported
20438 */
20439
20440'use strict';
20441
20442var ExecutionEnvironment = _dereq_(164);
20443
20444var useHasFeature;
20445if (ExecutionEnvironment.canUseDOM) {
20446 useHasFeature = document.implementation && document.implementation.hasFeature &&
20447 // always returns true in newer browsers as per the standard.
20448 // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
20449 document.implementation.hasFeature('', '') !== true;
20450}
20451
20452/**
20453 * Checks if an event is supported in the current execution environment.
20454 *
20455 * NOTE: This will not work correctly for non-generic events such as `change`,
20456 * `reset`, `load`, `error`, and `select`.
20457 *
20458 * Borrows from Modernizr.
20459 *
20460 * @param {string} eventNameSuffix Event name, e.g. "click".
20461 * @param {?boolean} capture Check if the capture phase is supported.
20462 * @return {boolean} True if the event is supported.
20463 * @internal
20464 * @license Modernizr 3.0.0pre (Custom Build) | MIT
20465 */
20466function isEventSupported(eventNameSuffix, capture) {
20467 if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
20468 return false;
20469 }
20470
20471 var eventName = 'on' + eventNameSuffix;
20472 var isSupported = eventName in document;
20473
20474 if (!isSupported) {
20475 var element = document.createElement('div');
20476 element.setAttribute(eventName, 'return;');
20477 isSupported = typeof element[eventName] === 'function';
20478 }
20479
20480 if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
20481 // This is the only way to test support for the `wheel` event in IE9+.
20482 isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
20483 }
20484
20485 return isSupported;
20486}
20487
20488module.exports = isEventSupported;
20489},{"164":164}],150:[function(_dereq_,module,exports){
20490/**
20491 * Copyright 2013-present, Facebook, Inc.
20492 * All rights reserved.
20493 *
20494 * This source code is licensed under the BSD-style license found in the
20495 * LICENSE file in the root directory of this source tree. An additional grant
20496 * of patent rights can be found in the PATENTS file in the same directory.
20497 *
20498 * @providesModule isTextInputElement
20499 *
20500 */
20501
20502'use strict';
20503
20504/**
20505 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
20506 */
20507
20508var supportedInputTypes = {
20509 'color': true,
20510 'date': true,
20511 'datetime': true,
20512 'datetime-local': true,
20513 'email': true,
20514 'month': true,
20515 'number': true,
20516 'password': true,
20517 'range': true,
20518 'search': true,
20519 'tel': true,
20520 'text': true,
20521 'time': true,
20522 'url': true,
20523 'week': true
20524};
20525
20526function isTextInputElement(elem) {
20527 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
20528
20529 if (nodeName === 'input') {
20530 return !!supportedInputTypes[elem.type];
20531 }
20532
20533 if (nodeName === 'textarea') {
20534 return true;
20535 }
20536
20537 return false;
20538}
20539
20540module.exports = isTextInputElement;
20541},{}],151:[function(_dereq_,module,exports){
20542/**
20543 * Copyright 2013-present, Facebook, Inc.
20544 * All rights reserved.
20545 *
20546 * This source code is licensed under the BSD-style license found in the
20547 * LICENSE file in the root directory of this source tree. An additional grant
20548 * of patent rights can be found in the PATENTS file in the same directory.
20549 *
20550 * @providesModule onlyChild
20551 */
20552'use strict';
20553
20554var _prodInvariant = _dereq_(153);
20555
20556var ReactElement = _dereq_(65);
20557
20558var invariant = _dereq_(178);
20559
20560/**
20561 * Returns the first child in a collection of children and verifies that there
20562 * is only one child in the collection.
20563 *
20564 * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only
20565 *
20566 * The current implementation of this function assumes that a single child gets
20567 * passed without a wrapper, but the purpose of this helper function is to
20568 * abstract away the particular structure of children.
20569 *
20570 * @param {?object} children Child collection structure.
20571 * @return {ReactElement} The first and only `ReactElement` contained in the
20572 * structure.
20573 */
20574function onlyChild(children) {
20575 !ReactElement.isValidElement(children) ? "development" !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0;
20576 return children;
20577}
20578
20579module.exports = onlyChild;
20580},{"153":153,"178":178,"65":65}],152:[function(_dereq_,module,exports){
20581/**
20582 * Copyright 2013-present, Facebook, Inc.
20583 * All rights reserved.
20584 *
20585 * This source code is licensed under the BSD-style license found in the
20586 * LICENSE file in the root directory of this source tree. An additional grant
20587 * of patent rights can be found in the PATENTS file in the same directory.
20588 *
20589 * @providesModule quoteAttributeValueForBrowser
20590 */
20591
20592'use strict';
20593
20594var escapeTextContentForBrowser = _dereq_(135);
20595
20596/**
20597 * Escapes attribute value to prevent scripting attacks.
20598 *
20599 * @param {*} value Value to escape.
20600 * @return {string} An escaped string.
20601 */
20602function quoteAttributeValueForBrowser(value) {
20603 return '"' + escapeTextContentForBrowser(value) + '"';
20604}
20605
20606module.exports = quoteAttributeValueForBrowser;
20607},{"135":135}],153:[function(_dereq_,module,exports){
20608/**
20609 * Copyright (c) 2013-present, Facebook, Inc.
20610 * All rights reserved.
20611 *
20612 * This source code is licensed under the BSD-style license found in the
20613 * LICENSE file in the root directory of this source tree. An additional grant
20614 * of patent rights can be found in the PATENTS file in the same directory.
20615 *
20616 * @providesModule reactProdInvariant
20617 *
20618 */
20619'use strict';
20620
20621/**
20622 * WARNING: DO NOT manually require this module.
20623 * This is a replacement for `invariant(...)` used by the error code system
20624 * and will _only_ be required by the corresponding babel pass.
20625 * It always throws.
20626 */
20627
20628function reactProdInvariant(code) {
20629 var argCount = arguments.length - 1;
20630
20631 var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
20632
20633 for (var argIdx = 0; argIdx < argCount; argIdx++) {
20634 message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
20635 }
20636
20637 message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
20638
20639 var error = new Error(message);
20640 error.name = 'Invariant Violation';
20641 error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
20642
20643 throw error;
20644}
20645
20646module.exports = reactProdInvariant;
20647},{}],154:[function(_dereq_,module,exports){
20648/**
20649 * Copyright 2013-present, Facebook, Inc.
20650 * All rights reserved.
20651 *
20652 * This source code is licensed under the BSD-style license found in the
20653 * LICENSE file in the root directory of this source tree. An additional grant
20654 * of patent rights can be found in the PATENTS file in the same directory.
20655 *
20656* @providesModule renderSubtreeIntoContainer
20657*/
20658
20659'use strict';
20660
20661var ReactMount = _dereq_(82);
20662
20663module.exports = ReactMount.renderSubtreeIntoContainer;
20664},{"82":82}],155:[function(_dereq_,module,exports){
20665/**
20666 * Copyright 2013-present, Facebook, Inc.
20667 * All rights reserved.
20668 *
20669 * This source code is licensed under the BSD-style license found in the
20670 * LICENSE file in the root directory of this source tree. An additional grant
20671 * of patent rights can be found in the PATENTS file in the same directory.
20672 *
20673 * @providesModule setInnerHTML
20674 */
20675
20676'use strict';
20677
20678var ExecutionEnvironment = _dereq_(164);
20679var DOMNamespaces = _dereq_(9);
20680
20681var WHITESPACE_TEST = /^[ \r\n\t\f]/;
20682var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
20683
20684var createMicrosoftUnsafeLocalFunction = _dereq_(133);
20685
20686// SVG temp container for IE lacking innerHTML
20687var reusableSVGContainer;
20688
20689/**
20690 * Set the innerHTML property of a node, ensuring that whitespace is preserved
20691 * even in IE8.
20692 *
20693 * @param {DOMElement} node
20694 * @param {string} html
20695 * @internal
20696 */
20697var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
20698 // IE does not have innerHTML for SVG nodes, so instead we inject the
20699 // new markup in a temp node and then move the child nodes across into
20700 // the target node
20701 if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) {
20702 reusableSVGContainer = reusableSVGContainer || document.createElement('div');
20703 reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
20704 var svgNode = reusableSVGContainer.firstChild;
20705 while (svgNode.firstChild) {
20706 node.appendChild(svgNode.firstChild);
20707 }
20708 } else {
20709 node.innerHTML = html;
20710 }
20711});
20712
20713if (ExecutionEnvironment.canUseDOM) {
20714 // IE8: When updating a just created node with innerHTML only leading
20715 // whitespace is removed. When updating an existing node with innerHTML
20716 // whitespace in root TextNodes is also collapsed.
20717 // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
20718
20719 // Feature detection; only IE8 is known to behave improperly like this.
20720 var testElement = document.createElement('div');
20721 testElement.innerHTML = ' ';
20722 if (testElement.innerHTML === '') {
20723 setInnerHTML = function (node, html) {
20724 // Magic theory: IE8 supposedly differentiates between added and updated
20725 // nodes when processing innerHTML, innerHTML on updated nodes suffers
20726 // from worse whitespace behavior. Re-adding a node like this triggers
20727 // the initial and more favorable whitespace behavior.
20728 // TODO: What to do on a detached node?
20729 if (node.parentNode) {
20730 node.parentNode.replaceChild(node, node);
20731 }
20732
20733 // We also implement a workaround for non-visible tags disappearing into
20734 // thin air on IE8, this only happens if there is no visible text
20735 // in-front of the non-visible tags. Piggyback on the whitespace fix
20736 // and simply check if any non-visible tags appear in the source.
20737 if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
20738 // Recover leading whitespace by temporarily prepending any character.
20739 // \uFEFF has the potential advantage of being zero-width/invisible.
20740 // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
20741 // in hopes that this is preserved even if "\uFEFF" is transformed to
20742 // the actual Unicode character (by Babel, for example).
20743 // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
20744 node.innerHTML = String.fromCharCode(0xFEFF) + html;
20745
20746 // deleteData leaves an empty `TextNode` which offsets the index of all
20747 // children. Definitely want to avoid this.
20748 var textNode = node.firstChild;
20749 if (textNode.data.length === 1) {
20750 node.removeChild(textNode);
20751 } else {
20752 textNode.deleteData(0, 1);
20753 }
20754 } else {
20755 node.innerHTML = html;
20756 }
20757 };
20758 }
20759 testElement = null;
20760}
20761
20762module.exports = setInnerHTML;
20763},{"133":133,"164":164,"9":9}],156:[function(_dereq_,module,exports){
20764/**
20765 * Copyright 2013-present, Facebook, Inc.
20766 * All rights reserved.
20767 *
20768 * This source code is licensed under the BSD-style license found in the
20769 * LICENSE file in the root directory of this source tree. An additional grant
20770 * of patent rights can be found in the PATENTS file in the same directory.
20771 *
20772 * @providesModule setTextContent
20773 */
20774
20775'use strict';
20776
20777var ExecutionEnvironment = _dereq_(164);
20778var escapeTextContentForBrowser = _dereq_(135);
20779var setInnerHTML = _dereq_(155);
20780
20781/**
20782 * Set the textContent property of a node, ensuring that whitespace is preserved
20783 * even in IE8. innerText is a poor substitute for textContent and, among many
20784 * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
20785 * as it should.
20786 *
20787 * @param {DOMElement} node
20788 * @param {string} text
20789 * @internal
20790 */
20791var setTextContent = function (node, text) {
20792 if (text) {
20793 var firstChild = node.firstChild;
20794
20795 if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) {
20796 firstChild.nodeValue = text;
20797 return;
20798 }
20799 }
20800 node.textContent = text;
20801};
20802
20803if (ExecutionEnvironment.canUseDOM) {
20804 if (!('textContent' in document.documentElement)) {
20805 setTextContent = function (node, text) {
20806 setInnerHTML(node, escapeTextContentForBrowser(text));
20807 };
20808 }
20809}
20810
20811module.exports = setTextContent;
20812},{"135":135,"155":155,"164":164}],157:[function(_dereq_,module,exports){
20813/**
20814 * Copyright 2013-present, Facebook, Inc.
20815 * All rights reserved.
20816 *
20817 * This source code is licensed under the BSD-style license found in the
20818 * LICENSE file in the root directory of this source tree. An additional grant
20819 * of patent rights can be found in the PATENTS file in the same directory.
20820 *
20821* @providesModule shallowCompare
20822*/
20823
20824'use strict';
20825
20826var shallowEqual = _dereq_(186);
20827
20828/**
20829 * Does a shallow comparison for props and state.
20830 * See ReactComponentWithPureRenderMixin
20831 * See also https://facebook.github.io/react/docs/shallow-compare.html
20832 */
20833function shallowCompare(instance, nextProps, nextState) {
20834 return !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState);
20835}
20836
20837module.exports = shallowCompare;
20838},{"186":186}],158:[function(_dereq_,module,exports){
20839/**
20840 * Copyright 2013-present, Facebook, Inc.
20841 * All rights reserved.
20842 *
20843 * This source code is licensed under the BSD-style license found in the
20844 * LICENSE file in the root directory of this source tree. An additional grant
20845 * of patent rights can be found in the PATENTS file in the same directory.
20846 *
20847 * @providesModule shouldUpdateReactComponent
20848 */
20849
20850'use strict';
20851
20852/**
20853 * Given a `prevElement` and `nextElement`, determines if the existing
20854 * instance should be updated as opposed to being destroyed or replaced by a new
20855 * instance. Both arguments are elements. This ensures that this logic can
20856 * operate on stateless trees without any backing instance.
20857 *
20858 * @param {?object} prevElement
20859 * @param {?object} nextElement
20860 * @return {boolean} True if the existing instance should be updated.
20861 * @protected
20862 */
20863
20864function shouldUpdateReactComponent(prevElement, nextElement) {
20865 var prevEmpty = prevElement === null || prevElement === false;
20866 var nextEmpty = nextElement === null || nextElement === false;
20867 if (prevEmpty || nextEmpty) {
20868 return prevEmpty === nextEmpty;
20869 }
20870
20871 var prevType = typeof prevElement;
20872 var nextType = typeof nextElement;
20873 if (prevType === 'string' || prevType === 'number') {
20874 return nextType === 'string' || nextType === 'number';
20875 } else {
20876 return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
20877 }
20878}
20879
20880module.exports = shouldUpdateReactComponent;
20881},{}],159:[function(_dereq_,module,exports){
20882/**
20883 * Copyright 2013-present, Facebook, Inc.
20884 * All rights reserved.
20885 *
20886 * This source code is licensed under the BSD-style license found in the
20887 * LICENSE file in the root directory of this source tree. An additional grant
20888 * of patent rights can be found in the PATENTS file in the same directory.
20889 *
20890 * @providesModule traverseAllChildren
20891 */
20892
20893'use strict';
20894
20895var _prodInvariant = _dereq_(153);
20896
20897var ReactCurrentOwner = _dereq_(41);
20898var ReactElement = _dereq_(65);
20899
20900var getIteratorFn = _dereq_(144);
20901var invariant = _dereq_(178);
20902var KeyEscapeUtils = _dereq_(23);
20903var warning = _dereq_(187);
20904
20905var SEPARATOR = '.';
20906var SUBSEPARATOR = ':';
20907
20908/**
20909 * TODO: Test that a single child and an array with one item have the same key
20910 * pattern.
20911 */
20912
20913var didWarnAboutMaps = false;
20914
20915/**
20916 * Generate a key string that identifies a component within a set.
20917 *
20918 * @param {*} component A component that could contain a manual key.
20919 * @param {number} index Index that is used if a manual key is not provided.
20920 * @return {string}
20921 */
20922function getComponentKey(component, index) {
20923 // Do some typechecking here since we call this blindly. We want to ensure
20924 // that we don't block potential future ES APIs.
20925 if (component && typeof component === 'object' && component.key != null) {
20926 // Explicit key
20927 return KeyEscapeUtils.escape(component.key);
20928 }
20929 // Implicit key determined by the index in the set
20930 return index.toString(36);
20931}
20932
20933/**
20934 * @param {?*} children Children tree container.
20935 * @param {!string} nameSoFar Name of the key path so far.
20936 * @param {!function} callback Callback to invoke with each child found.
20937 * @param {?*} traverseContext Used to pass information throughout the traversal
20938 * process.
20939 * @return {!number} The number of children in this subtree.
20940 */
20941function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
20942 var type = typeof children;
20943
20944 if (type === 'undefined' || type === 'boolean') {
20945 // All of the above are perceived as null.
20946 children = null;
20947 }
20948
20949 if (children === null || type === 'string' || type === 'number' || ReactElement.isValidElement(children)) {
20950 callback(traverseContext, children,
20951 // If it's the only child, treat the name as if it was wrapped in an array
20952 // so that it's consistent if the number of children grows.
20953 nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
20954 return 1;
20955 }
20956
20957 var child;
20958 var nextName;
20959 var subtreeCount = 0; // Count of children found in the current subtree.
20960 var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
20961
20962 if (Array.isArray(children)) {
20963 for (var i = 0; i < children.length; i++) {
20964 child = children[i];
20965 nextName = nextNamePrefix + getComponentKey(child, i);
20966 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
20967 }
20968 } else {
20969 var iteratorFn = getIteratorFn(children);
20970 if (iteratorFn) {
20971 var iterator = iteratorFn.call(children);
20972 var step;
20973 if (iteratorFn !== children.entries) {
20974 var ii = 0;
20975 while (!(step = iterator.next()).done) {
20976 child = step.value;
20977 nextName = nextNamePrefix + getComponentKey(child, ii++);
20978 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
20979 }
20980 } else {
20981 if ("development" !== 'production') {
20982 var mapsAsChildrenAddendum = '';
20983 if (ReactCurrentOwner.current) {
20984 var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
20985 if (mapsAsChildrenOwnerName) {
20986 mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
20987 }
20988 }
20989 "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.%s', mapsAsChildrenAddendum) : void 0;
20990 didWarnAboutMaps = true;
20991 }
20992 // Iterator will provide entry [k,v] tuples rather than values.
20993 while (!(step = iterator.next()).done) {
20994 var entry = step.value;
20995 if (entry) {
20996 child = entry[1];
20997 nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
20998 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
20999 }
21000 }
21001 }
21002 } else if (type === 'object') {
21003 var addendum = '';
21004 if ("development" !== 'production') {
21005 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.';
21006 if (children._isReactElement) {
21007 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.';
21008 }
21009 if (ReactCurrentOwner.current) {
21010 var name = ReactCurrentOwner.current.getName();
21011 if (name) {
21012 addendum += ' Check the render method of `' + name + '`.';
21013 }
21014 }
21015 }
21016 var childrenString = String(children);
21017 !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) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0;
21018 }
21019 }
21020
21021 return subtreeCount;
21022}
21023
21024/**
21025 * Traverses children that are typically specified as `props.children`, but
21026 * might also be specified through attributes:
21027 *
21028 * - `traverseAllChildren(this.props.children, ...)`
21029 * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
21030 *
21031 * The `traverseContext` is an optional argument that is passed through the
21032 * entire traversal. It can be used to store accumulations or anything else that
21033 * the callback might find relevant.
21034 *
21035 * @param {?*} children Children tree object.
21036 * @param {!function} callback To invoke upon traversing each child.
21037 * @param {?*} traverseContext Context for traversal.
21038 * @return {!number} The number of children in this subtree.
21039 */
21040function traverseAllChildren(children, callback, traverseContext) {
21041 if (children == null) {
21042 return 0;
21043 }
21044
21045 return traverseAllChildrenImpl(children, '', callback, traverseContext);
21046}
21047
21048module.exports = traverseAllChildren;
21049},{"144":144,"153":153,"178":178,"187":187,"23":23,"41":41,"65":65}],160:[function(_dereq_,module,exports){
21050/**
21051 * Copyright 2013-present, Facebook, Inc.
21052 * All rights reserved.
21053 *
21054 * This source code is licensed under the BSD-style license found in the
21055 * LICENSE file in the root directory of this source tree. An additional grant
21056 * of patent rights can be found in the PATENTS file in the same directory.
21057 *
21058 * @providesModule update
21059 */
21060
21061/* global hasOwnProperty:true */
21062
21063'use strict';
21064
21065var _prodInvariant = _dereq_(153),
21066 _assign = _dereq_(188);
21067
21068var keyOf = _dereq_(182);
21069var invariant = _dereq_(178);
21070var hasOwnProperty = {}.hasOwnProperty;
21071
21072function shallowCopy(x) {
21073 if (Array.isArray(x)) {
21074 return x.concat();
21075 } else if (x && typeof x === 'object') {
21076 return _assign(new x.constructor(), x);
21077 } else {
21078 return x;
21079 }
21080}
21081
21082var COMMAND_PUSH = keyOf({ $push: null });
21083var COMMAND_UNSHIFT = keyOf({ $unshift: null });
21084var COMMAND_SPLICE = keyOf({ $splice: null });
21085var COMMAND_SET = keyOf({ $set: null });
21086var COMMAND_MERGE = keyOf({ $merge: null });
21087var COMMAND_APPLY = keyOf({ $apply: null });
21088
21089var ALL_COMMANDS_LIST = [COMMAND_PUSH, COMMAND_UNSHIFT, COMMAND_SPLICE, COMMAND_SET, COMMAND_MERGE, COMMAND_APPLY];
21090
21091var ALL_COMMANDS_SET = {};
21092
21093ALL_COMMANDS_LIST.forEach(function (command) {
21094 ALL_COMMANDS_SET[command] = true;
21095});
21096
21097function invariantArrayCase(value, spec, command) {
21098 !Array.isArray(value) ? "development" !== 'production' ? invariant(false, 'update(): expected target of %s to be an array; got %s.', command, value) : _prodInvariant('1', command, value) : void 0;
21099 var specValue = spec[command];
21100 !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) : _prodInvariant('2', command, specValue) : void 0;
21101}
21102
21103/**
21104 * Returns a updated shallow copy of an object without mutating the original.
21105 * See https://facebook.github.io/react/docs/update.html for details.
21106 */
21107function update(value, spec) {
21108 !(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) : _prodInvariant('3', ALL_COMMANDS_LIST.join(', '), COMMAND_SET) : void 0;
21109
21110 if (hasOwnProperty.call(spec, COMMAND_SET)) {
21111 !(Object.keys(spec).length === 1) ? "development" !== 'production' ? invariant(false, 'Cannot have more than one key in an object with %s', COMMAND_SET) : _prodInvariant('4', COMMAND_SET) : void 0;
21112
21113 return spec[COMMAND_SET];
21114 }
21115
21116 var nextValue = shallowCopy(value);
21117
21118 if (hasOwnProperty.call(spec, COMMAND_MERGE)) {
21119 var mergeObj = spec[COMMAND_MERGE];
21120 !(mergeObj && typeof mergeObj === 'object') ? "development" !== 'production' ? invariant(false, 'update(): %s expects a spec of type \'object\'; got %s', COMMAND_MERGE, mergeObj) : _prodInvariant('5', COMMAND_MERGE, mergeObj) : void 0;
21121 !(nextValue && typeof nextValue === 'object') ? "development" !== 'production' ? invariant(false, 'update(): %s expects a target of type \'object\'; got %s', COMMAND_MERGE, nextValue) : _prodInvariant('6', COMMAND_MERGE, nextValue) : void 0;
21122 _assign(nextValue, spec[COMMAND_MERGE]);
21123 }
21124
21125 if (hasOwnProperty.call(spec, COMMAND_PUSH)) {
21126 invariantArrayCase(value, spec, COMMAND_PUSH);
21127 spec[COMMAND_PUSH].forEach(function (item) {
21128 nextValue.push(item);
21129 });
21130 }
21131
21132 if (hasOwnProperty.call(spec, COMMAND_UNSHIFT)) {
21133 invariantArrayCase(value, spec, COMMAND_UNSHIFT);
21134 spec[COMMAND_UNSHIFT].forEach(function (item) {
21135 nextValue.unshift(item);
21136 });
21137 }
21138
21139 if (hasOwnProperty.call(spec, COMMAND_SPLICE)) {
21140 !Array.isArray(value) ? "development" !== 'production' ? invariant(false, 'Expected %s target to be an array; got %s', COMMAND_SPLICE, value) : _prodInvariant('7', COMMAND_SPLICE, value) : void 0;
21141 !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]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0;
21142 spec[COMMAND_SPLICE].forEach(function (args) {
21143 !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]) : _prodInvariant('8', COMMAND_SPLICE, spec[COMMAND_SPLICE]) : void 0;
21144 nextValue.splice.apply(nextValue, args);
21145 });
21146 }
21147
21148 if (hasOwnProperty.call(spec, COMMAND_APPLY)) {
21149 !(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]) : _prodInvariant('9', COMMAND_APPLY, spec[COMMAND_APPLY]) : void 0;
21150 nextValue = spec[COMMAND_APPLY](nextValue);
21151 }
21152
21153 for (var k in spec) {
21154 if (!(ALL_COMMANDS_SET.hasOwnProperty(k) && ALL_COMMANDS_SET[k])) {
21155 nextValue[k] = update(value[k], spec[k]);
21156 }
21157 }
21158
21159 return nextValue;
21160}
21161
21162module.exports = update;
21163},{"153":153,"178":178,"182":182,"188":188}],161:[function(_dereq_,module,exports){
21164/**
21165 * Copyright 2015-present, Facebook, Inc.
21166 * All rights reserved.
21167 *
21168 * This source code is licensed under the BSD-style license found in the
21169 * LICENSE file in the root directory of this source tree. An additional grant
21170 * of patent rights can be found in the PATENTS file in the same directory.
21171 *
21172 * @providesModule validateDOMNesting
21173 */
21174
21175'use strict';
21176
21177var _assign = _dereq_(188);
21178
21179var emptyFunction = _dereq_(170);
21180var warning = _dereq_(187);
21181
21182var validateDOMNesting = emptyFunction;
21183
21184if ("development" !== 'production') {
21185 // This validation code was written based on the HTML5 parsing spec:
21186 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
21187 //
21188 // Note: this does not catch all invalid nesting, nor does it try to (as it's
21189 // not clear what practical benefit doing so provides); instead, we warn only
21190 // for cases where the parser will give a parse tree differing from what React
21191 // intended. For example, <b><div></div></b> is invalid but we don't warn
21192 // because it still parses correctly; we do warn for other cases like nested
21193 // <p> tags where the beginning of the second element implicitly closes the
21194 // first, causing a confusing mess.
21195
21196 // https://html.spec.whatwg.org/multipage/syntax.html#special
21197 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'];
21198
21199 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
21200 var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
21201
21202 // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
21203 // TODO: Distinguish by namespace here -- for <title>, including it here
21204 // errs on the side of fewer warnings
21205 'foreignObject', 'desc', 'title'];
21206
21207 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
21208 var buttonScopeTags = inScopeTags.concat(['button']);
21209
21210 // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
21211 var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
21212
21213 var emptyAncestorInfo = {
21214 current: null,
21215
21216 formTag: null,
21217 aTagInScope: null,
21218 buttonTagInScope: null,
21219 nobrTagInScope: null,
21220 pTagInButtonScope: null,
21221
21222 listItemTagAutoclosing: null,
21223 dlItemTagAutoclosing: null
21224 };
21225
21226 var updatedAncestorInfo = function (oldInfo, tag, instance) {
21227 var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
21228 var info = { tag: tag, instance: instance };
21229
21230 if (inScopeTags.indexOf(tag) !== -1) {
21231 ancestorInfo.aTagInScope = null;
21232 ancestorInfo.buttonTagInScope = null;
21233 ancestorInfo.nobrTagInScope = null;
21234 }
21235 if (buttonScopeTags.indexOf(tag) !== -1) {
21236 ancestorInfo.pTagInButtonScope = null;
21237 }
21238
21239 // See rules for 'li', 'dd', 'dt' start tags in
21240 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
21241 if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
21242 ancestorInfo.listItemTagAutoclosing = null;
21243 ancestorInfo.dlItemTagAutoclosing = null;
21244 }
21245
21246 ancestorInfo.current = info;
21247
21248 if (tag === 'form') {
21249 ancestorInfo.formTag = info;
21250 }
21251 if (tag === 'a') {
21252 ancestorInfo.aTagInScope = info;
21253 }
21254 if (tag === 'button') {
21255 ancestorInfo.buttonTagInScope = info;
21256 }
21257 if (tag === 'nobr') {
21258 ancestorInfo.nobrTagInScope = info;
21259 }
21260 if (tag === 'p') {
21261 ancestorInfo.pTagInButtonScope = info;
21262 }
21263 if (tag === 'li') {
21264 ancestorInfo.listItemTagAutoclosing = info;
21265 }
21266 if (tag === 'dd' || tag === 'dt') {
21267 ancestorInfo.dlItemTagAutoclosing = info;
21268 }
21269
21270 return ancestorInfo;
21271 };
21272
21273 /**
21274 * Returns whether
21275 */
21276 var isTagValidWithParent = function (tag, parentTag) {
21277 // First, let's check if we're in an unusual parsing mode...
21278 switch (parentTag) {
21279 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
21280 case 'select':
21281 return tag === 'option' || tag === 'optgroup' || tag === '#text';
21282 case 'optgroup':
21283 return tag === 'option' || tag === '#text';
21284 // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
21285 // but
21286 case 'option':
21287 return tag === '#text';
21288
21289 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
21290 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
21291 // No special behavior since these rules fall back to "in body" mode for
21292 // all except special table nodes which cause bad parsing behavior anyway.
21293
21294 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
21295 case 'tr':
21296 return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
21297
21298 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
21299 case 'tbody':
21300 case 'thead':
21301 case 'tfoot':
21302 return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
21303
21304 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
21305 case 'colgroup':
21306 return tag === 'col' || tag === 'template';
21307
21308 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
21309 case 'table':
21310 return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
21311
21312 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
21313 case 'head':
21314 return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
21315
21316 // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
21317 case 'html':
21318 return tag === 'head' || tag === 'body';
21319 case '#document':
21320 return tag === 'html';
21321 }
21322
21323 // Probably in the "in body" parsing mode, so we outlaw only tag combos
21324 // where the parsing rules cause implicit opens or closes to be added.
21325 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
21326 switch (tag) {
21327 case 'h1':
21328 case 'h2':
21329 case 'h3':
21330 case 'h4':
21331 case 'h5':
21332 case 'h6':
21333 return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
21334
21335 case 'rp':
21336 case 'rt':
21337 return impliedEndTags.indexOf(parentTag) === -1;
21338
21339 case 'body':
21340 case 'caption':
21341 case 'col':
21342 case 'colgroup':
21343 case 'frame':
21344 case 'head':
21345 case 'html':
21346 case 'tbody':
21347 case 'td':
21348 case 'tfoot':
21349 case 'th':
21350 case 'thead':
21351 case 'tr':
21352 // These tags are only valid with a few parents that have special child
21353 // parsing rules -- if we're down here, then none of those matched and
21354 // so we allow it only if we don't know what the parent is, as all other
21355 // cases are invalid.
21356 return parentTag == null;
21357 }
21358
21359 return true;
21360 };
21361
21362 /**
21363 * Returns whether
21364 */
21365 var findInvalidAncestorForTag = function (tag, ancestorInfo) {
21366 switch (tag) {
21367 case 'address':
21368 case 'article':
21369 case 'aside':
21370 case 'blockquote':
21371 case 'center':
21372 case 'details':
21373 case 'dialog':
21374 case 'dir':
21375 case 'div':
21376 case 'dl':
21377 case 'fieldset':
21378 case 'figcaption':
21379 case 'figure':
21380 case 'footer':
21381 case 'header':
21382 case 'hgroup':
21383 case 'main':
21384 case 'menu':
21385 case 'nav':
21386 case 'ol':
21387 case 'p':
21388 case 'section':
21389 case 'summary':
21390 case 'ul':
21391
21392 case 'pre':
21393 case 'listing':
21394
21395 case 'table':
21396
21397 case 'hr':
21398
21399 case 'xmp':
21400
21401 case 'h1':
21402 case 'h2':
21403 case 'h3':
21404 case 'h4':
21405 case 'h5':
21406 case 'h6':
21407 return ancestorInfo.pTagInButtonScope;
21408
21409 case 'form':
21410 return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
21411
21412 case 'li':
21413 return ancestorInfo.listItemTagAutoclosing;
21414
21415 case 'dd':
21416 case 'dt':
21417 return ancestorInfo.dlItemTagAutoclosing;
21418
21419 case 'button':
21420 return ancestorInfo.buttonTagInScope;
21421
21422 case 'a':
21423 // Spec says something about storing a list of markers, but it sounds
21424 // equivalent to this check.
21425 return ancestorInfo.aTagInScope;
21426
21427 case 'nobr':
21428 return ancestorInfo.nobrTagInScope;
21429 }
21430
21431 return null;
21432 };
21433
21434 /**
21435 * Given a ReactCompositeComponent instance, return a list of its recursive
21436 * owners, starting at the root and ending with the instance itself.
21437 */
21438 var findOwnerStack = function (instance) {
21439 if (!instance) {
21440 return [];
21441 }
21442
21443 var stack = [];
21444 do {
21445 stack.push(instance);
21446 } while (instance = instance._currentElement._owner);
21447 stack.reverse();
21448 return stack;
21449 };
21450
21451 var didWarn = {};
21452
21453 validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) {
21454 ancestorInfo = ancestorInfo || emptyAncestorInfo;
21455 var parentInfo = ancestorInfo.current;
21456 var parentTag = parentInfo && parentInfo.tag;
21457
21458 if (childText != null) {
21459 "development" !== 'production' ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
21460 childTag = '#text';
21461 }
21462
21463 var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
21464 var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
21465 var problematic = invalidParent || invalidAncestor;
21466
21467 if (problematic) {
21468 var ancestorTag = problematic.tag;
21469 var ancestorInstance = problematic.instance;
21470
21471 var childOwner = childInstance && childInstance._currentElement._owner;
21472 var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
21473
21474 var childOwners = findOwnerStack(childOwner);
21475 var ancestorOwners = findOwnerStack(ancestorOwner);
21476
21477 var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
21478 var i;
21479
21480 var deepestCommon = -1;
21481 for (i = 0; i < minStackLen; i++) {
21482 if (childOwners[i] === ancestorOwners[i]) {
21483 deepestCommon = i;
21484 } else {
21485 break;
21486 }
21487 }
21488
21489 var UNKNOWN = '(unknown)';
21490 var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
21491 return inst.getName() || UNKNOWN;
21492 });
21493 var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
21494 return inst.getName() || UNKNOWN;
21495 });
21496 var ownerInfo = [].concat(
21497 // If the parent and child instances have a common owner ancestor, start
21498 // with that -- otherwise we just start with the parent's owners.
21499 deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
21500 // If we're warning about an invalid (non-parent) ancestry, add '...'
21501 invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
21502
21503 var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
21504 if (didWarn[warnKey]) {
21505 return;
21506 }
21507 didWarn[warnKey] = true;
21508
21509 var tagDisplayName = childTag;
21510 var whitespaceInfo = '';
21511 if (childTag === '#text') {
21512 if (/\S/.test(childText)) {
21513 tagDisplayName = 'Text nodes';
21514 } else {
21515 tagDisplayName = 'Whitespace text nodes';
21516 whitespaceInfo = ' Make sure you don\'t have any extra whitespace between tags on ' + 'each line of your source code.';
21517 }
21518 } else {
21519 tagDisplayName = '<' + childTag + '>';
21520 }
21521
21522 if (invalidParent) {
21523 var info = '';
21524 if (ancestorTag === 'table' && childTag === 'tr') {
21525 info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
21526 }
21527 "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0;
21528 } else {
21529 "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
21530 }
21531 }
21532 };
21533
21534 validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
21535
21536 // For testing
21537 validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
21538 ancestorInfo = ancestorInfo || emptyAncestorInfo;
21539 var parentInfo = ancestorInfo.current;
21540 var parentTag = parentInfo && parentInfo.tag;
21541 return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
21542 };
21543}
21544
21545module.exports = validateDOMNesting;
21546},{"170":170,"187":187,"188":188}],162:[function(_dereq_,module,exports){
21547'use strict';
21548
21549/**
21550 * Copyright (c) 2013-present, Facebook, Inc.
21551 * All rights reserved.
21552 *
21553 * This source code is licensed under the BSD-style license found in the
21554 * LICENSE file in the root directory of this source tree. An additional grant
21555 * of patent rights can be found in the PATENTS file in the same directory.
21556 *
21557 * @typechecks
21558 */
21559
21560var invariant = _dereq_(178);
21561
21562/**
21563 * The CSSCore module specifies the API (and implements most of the methods)
21564 * that should be used when dealing with the display of elements (via their
21565 * CSS classes and visibility on screen. It is an API focused on mutating the
21566 * display and not reading it as no logical state should be encoded in the
21567 * display of elements.
21568 */
21569
21570/* Slow implementation for browsers that don't natively support .matches() */
21571function matchesSelector_SLOW(element, selector) {
21572 var root = element;
21573 while (root.parentNode) {
21574 root = root.parentNode;
21575 }
21576
21577 var all = root.querySelectorAll(selector);
21578 return Array.prototype.indexOf.call(all, element) !== -1;
21579}
21580
21581var CSSCore = {
21582
21583 /**
21584 * Adds the class passed in to the element if it doesn't already have it.
21585 *
21586 * @param {DOMElement} element the element to set the class on
21587 * @param {string} className the CSS className
21588 * @return {DOMElement} the element passed in
21589 */
21590 addClass: function addClass(element, className) {
21591 !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSSCore.addClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0;
21592
21593 if (className) {
21594 if (element.classList) {
21595 element.classList.add(className);
21596 } else if (!CSSCore.hasClass(element, className)) {
21597 element.className = element.className + ' ' + className;
21598 }
21599 }
21600 return element;
21601 },
21602
21603 /**
21604 * Removes the class passed in from the element
21605 *
21606 * @param {DOMElement} element the element to set the class on
21607 * @param {string} className the CSS className
21608 * @return {DOMElement} the element passed in
21609 */
21610 removeClass: function removeClass(element, className) {
21611 !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSSCore.removeClass takes only a single class name. "%s" contains ' + 'multiple classes.', className) : invariant(false) : void 0;
21612
21613 if (className) {
21614 if (element.classList) {
21615 element.classList.remove(className);
21616 } else if (CSSCore.hasClass(element, className)) {
21617 element.className = element.className.replace(new RegExp('(^|\\s)' + className + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ') // multiple spaces to one
21618 .replace(/^\s*|\s*$/g, ''); // trim the ends
21619 }
21620 }
21621 return element;
21622 },
21623
21624 /**
21625 * Helper to add or remove a class from an element based on a condition.
21626 *
21627 * @param {DOMElement} element the element to set the class on
21628 * @param {string} className the CSS className
21629 * @param {*} bool condition to whether to add or remove the class
21630 * @return {DOMElement} the element passed in
21631 */
21632 conditionClass: function conditionClass(element, className, bool) {
21633 return (bool ? CSSCore.addClass : CSSCore.removeClass)(element, className);
21634 },
21635
21636 /**
21637 * Tests whether the element has the class specified.
21638 *
21639 * @param {DOMNode|DOMWindow} element the element to check the class on
21640 * @param {string} className the CSS className
21641 * @return {boolean} true if the element has the class, false if not
21642 */
21643 hasClass: function hasClass(element, className) {
21644 !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSS.hasClass takes only a single class name.') : invariant(false) : void 0;
21645 if (element.classList) {
21646 return !!className && element.classList.contains(className);
21647 }
21648 return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;
21649 },
21650
21651 /**
21652 * Tests whether the element matches the selector specified
21653 *
21654 * @param {DOMNode|DOMWindow} element the element that we are querying
21655 * @param {string} selector the CSS selector
21656 * @return {boolean} true if the element matches the selector, false if not
21657 */
21658 matchesSelector: function matchesSelector(element, selector) {
21659 var matchesImpl = element.matches || element.webkitMatchesSelector || element.mozMatchesSelector || element.msMatchesSelector || function (s) {
21660 return matchesSelector_SLOW(element, s);
21661 };
21662 return matchesImpl.call(element, selector);
21663 }
21664
21665};
21666
21667module.exports = CSSCore;
21668},{"178":178}],163:[function(_dereq_,module,exports){
21669'use strict';
21670
21671/**
21672 * Copyright (c) 2013-present, Facebook, Inc.
21673 *
21674 * Licensed under the Apache License, Version 2.0 (the "License");
21675 * you may not use this file except in compliance with the License.
21676 * You may obtain a copy of the License at
21677 *
21678 * http://www.apache.org/licenses/LICENSE-2.0
21679 *
21680 * Unless required by applicable law or agreed to in writing, software
21681 * distributed under the License is distributed on an "AS IS" BASIS,
21682 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21683 * See the License for the specific language governing permissions and
21684 * limitations under the License.
21685 *
21686 * @typechecks
21687 */
21688
21689var emptyFunction = _dereq_(170);
21690
21691/**
21692 * Upstream version of event listener. Does not take into account specific
21693 * nature of platform.
21694 */
21695var EventListener = {
21696 /**
21697 * Listen to DOM events during the bubble phase.
21698 *
21699 * @param {DOMEventTarget} target DOM element to register listener on.
21700 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
21701 * @param {function} callback Callback function.
21702 * @return {object} Object with a `remove` method.
21703 */
21704 listen: function listen(target, eventType, callback) {
21705 if (target.addEventListener) {
21706 target.addEventListener(eventType, callback, false);
21707 return {
21708 remove: function remove() {
21709 target.removeEventListener(eventType, callback, false);
21710 }
21711 };
21712 } else if (target.attachEvent) {
21713 target.attachEvent('on' + eventType, callback);
21714 return {
21715 remove: function remove() {
21716 target.detachEvent('on' + eventType, callback);
21717 }
21718 };
21719 }
21720 },
21721
21722 /**
21723 * Listen to DOM events during the capture phase.
21724 *
21725 * @param {DOMEventTarget} target DOM element to register listener on.
21726 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
21727 * @param {function} callback Callback function.
21728 * @return {object} Object with a `remove` method.
21729 */
21730 capture: function capture(target, eventType, callback) {
21731 if (target.addEventListener) {
21732 target.addEventListener(eventType, callback, true);
21733 return {
21734 remove: function remove() {
21735 target.removeEventListener(eventType, callback, true);
21736 }
21737 };
21738 } else {
21739 if ("development" !== 'production') {
21740 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.');
21741 }
21742 return {
21743 remove: emptyFunction
21744 };
21745 }
21746 },
21747
21748 registerDefault: function registerDefault() {}
21749};
21750
21751module.exports = EventListener;
21752},{"170":170}],164:[function(_dereq_,module,exports){
21753/**
21754 * Copyright (c) 2013-present, Facebook, Inc.
21755 * All rights reserved.
21756 *
21757 * This source code is licensed under the BSD-style license found in the
21758 * LICENSE file in the root directory of this source tree. An additional grant
21759 * of patent rights can be found in the PATENTS file in the same directory.
21760 *
21761 */
21762
21763'use strict';
21764
21765var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
21766
21767/**
21768 * Simple, lightweight module assisting with the detection and context of
21769 * Worker. Helps avoid circular dependencies and allows code to reason about
21770 * whether or not they are in a Worker, even if they never include the main
21771 * `ReactWorker` dependency.
21772 */
21773var ExecutionEnvironment = {
21774
21775 canUseDOM: canUseDOM,
21776
21777 canUseWorkers: typeof Worker !== 'undefined',
21778
21779 canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
21780
21781 canUseViewport: canUseDOM && !!window.screen,
21782
21783 isInWorker: !canUseDOM // For now, this is true - might change in the future.
21784
21785};
21786
21787module.exports = ExecutionEnvironment;
21788},{}],165:[function(_dereq_,module,exports){
21789"use strict";
21790
21791/**
21792 * Copyright (c) 2013-present, Facebook, Inc.
21793 * All rights reserved.
21794 *
21795 * This source code is licensed under the BSD-style license found in the
21796 * LICENSE file in the root directory of this source tree. An additional grant
21797 * of patent rights can be found in the PATENTS file in the same directory.
21798 *
21799 * @typechecks
21800 */
21801
21802var _hyphenPattern = /-(.)/g;
21803
21804/**
21805 * Camelcases a hyphenated string, for example:
21806 *
21807 * > camelize('background-color')
21808 * < "backgroundColor"
21809 *
21810 * @param {string} string
21811 * @return {string}
21812 */
21813function camelize(string) {
21814 return string.replace(_hyphenPattern, function (_, character) {
21815 return character.toUpperCase();
21816 });
21817}
21818
21819module.exports = camelize;
21820},{}],166:[function(_dereq_,module,exports){
21821/**
21822 * Copyright (c) 2013-present, Facebook, Inc.
21823 * All rights reserved.
21824 *
21825 * This source code is licensed under the BSD-style license found in the
21826 * LICENSE file in the root directory of this source tree. An additional grant
21827 * of patent rights can be found in the PATENTS file in the same directory.
21828 *
21829 * @typechecks
21830 */
21831
21832'use strict';
21833
21834var camelize = _dereq_(165);
21835
21836var msPattern = /^-ms-/;
21837
21838/**
21839 * Camelcases a hyphenated CSS property name, for example:
21840 *
21841 * > camelizeStyleName('background-color')
21842 * < "backgroundColor"
21843 * > camelizeStyleName('-moz-transition')
21844 * < "MozTransition"
21845 * > camelizeStyleName('-ms-transition')
21846 * < "msTransition"
21847 *
21848 * As Andi Smith suggests
21849 * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
21850 * is converted to lowercase `ms`.
21851 *
21852 * @param {string} string
21853 * @return {string}
21854 */
21855function camelizeStyleName(string) {
21856 return camelize(string.replace(msPattern, 'ms-'));
21857}
21858
21859module.exports = camelizeStyleName;
21860},{"165":165}],167:[function(_dereq_,module,exports){
21861'use strict';
21862
21863/**
21864 * Copyright (c) 2013-present, Facebook, Inc.
21865 * All rights reserved.
21866 *
21867 * This source code is licensed under the BSD-style license found in the
21868 * LICENSE file in the root directory of this source tree. An additional grant
21869 * of patent rights can be found in the PATENTS file in the same directory.
21870 *
21871 *
21872 */
21873
21874var isTextNode = _dereq_(180);
21875
21876/*eslint-disable no-bitwise */
21877
21878/**
21879 * Checks if a given DOM node contains or is another DOM node.
21880 */
21881function containsNode(outerNode, innerNode) {
21882 if (!outerNode || !innerNode) {
21883 return false;
21884 } else if (outerNode === innerNode) {
21885 return true;
21886 } else if (isTextNode(outerNode)) {
21887 return false;
21888 } else if (isTextNode(innerNode)) {
21889 return containsNode(outerNode, innerNode.parentNode);
21890 } else if ('contains' in outerNode) {
21891 return outerNode.contains(innerNode);
21892 } else if (outerNode.compareDocumentPosition) {
21893 return !!(outerNode.compareDocumentPosition(innerNode) & 16);
21894 } else {
21895 return false;
21896 }
21897}
21898
21899module.exports = containsNode;
21900},{"180":180}],168:[function(_dereq_,module,exports){
21901'use strict';
21902
21903/**
21904 * Copyright (c) 2013-present, Facebook, Inc.
21905 * All rights reserved.
21906 *
21907 * This source code is licensed under the BSD-style license found in the
21908 * LICENSE file in the root directory of this source tree. An additional grant
21909 * of patent rights can be found in the PATENTS file in the same directory.
21910 *
21911 * @typechecks
21912 */
21913
21914var invariant = _dereq_(178);
21915
21916/**
21917 * Convert array-like objects to arrays.
21918 *
21919 * This API assumes the caller knows the contents of the data type. For less
21920 * well defined inputs use createArrayFromMixed.
21921 *
21922 * @param {object|function|filelist} obj
21923 * @return {array}
21924 */
21925function toArray(obj) {
21926 var length = obj.length;
21927
21928 // Some browsers builtin objects can report typeof 'function' (e.g. NodeList
21929 // in old versions of Safari).
21930 !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? "development" !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
21931
21932 !(typeof length === 'number') ? "development" !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
21933
21934 !(length === 0 || length - 1 in obj) ? "development" !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
21935
21936 !(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;
21937
21938 // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
21939 // without method will throw during the slice call and skip straight to the
21940 // fallback.
21941 if (obj.hasOwnProperty) {
21942 try {
21943 return Array.prototype.slice.call(obj);
21944 } catch (e) {
21945 // IE < 9 does not support Array#slice on collections objects
21946 }
21947 }
21948
21949 // Fall back to copying key by key. This assumes all keys have a value,
21950 // so will not preserve sparsely populated inputs.
21951 var ret = Array(length);
21952 for (var ii = 0; ii < length; ii++) {
21953 ret[ii] = obj[ii];
21954 }
21955 return ret;
21956}
21957
21958/**
21959 * Perform a heuristic test to determine if an object is "array-like".
21960 *
21961 * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
21962 * Joshu replied: "Mu."
21963 *
21964 * This function determines if its argument has "array nature": it returns
21965 * true if the argument is an actual array, an `arguments' object, or an
21966 * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
21967 *
21968 * It will return false for other array-like objects like Filelist.
21969 *
21970 * @param {*} obj
21971 * @return {boolean}
21972 */
21973function hasArrayNature(obj) {
21974 return (
21975 // not null/false
21976 !!obj && (
21977 // arrays are objects, NodeLists are functions in Safari
21978 typeof obj == 'object' || typeof obj == 'function') &&
21979 // quacks like an array
21980 'length' in obj &&
21981 // not window
21982 !('setInterval' in obj) &&
21983 // no DOM node should be considered an array-like
21984 // a 'select' element has 'length' and 'item' properties on IE8
21985 typeof obj.nodeType != 'number' && (
21986 // a real array
21987 Array.isArray(obj) ||
21988 // arguments
21989 'callee' in obj ||
21990 // HTMLCollection/NodeList
21991 'item' in obj)
21992 );
21993}
21994
21995/**
21996 * Ensure that the argument is an array by wrapping it in an array if it is not.
21997 * Creates a copy of the argument if it is already an array.
21998 *
21999 * This is mostly useful idiomatically:
22000 *
22001 * var createArrayFromMixed = require('createArrayFromMixed');
22002 *
22003 * function takesOneOrMoreThings(things) {
22004 * things = createArrayFromMixed(things);
22005 * ...
22006 * }
22007 *
22008 * This allows you to treat `things' as an array, but accept scalars in the API.
22009 *
22010 * If you need to convert an array-like object, like `arguments`, into an array
22011 * use toArray instead.
22012 *
22013 * @param {*} obj
22014 * @return {array}
22015 */
22016function createArrayFromMixed(obj) {
22017 if (!hasArrayNature(obj)) {
22018 return [obj];
22019 } else if (Array.isArray(obj)) {
22020 return obj.slice();
22021 } else {
22022 return toArray(obj);
22023 }
22024}
22025
22026module.exports = createArrayFromMixed;
22027},{"178":178}],169:[function(_dereq_,module,exports){
22028'use strict';
22029
22030/**
22031 * Copyright (c) 2013-present, Facebook, Inc.
22032 * All rights reserved.
22033 *
22034 * This source code is licensed under the BSD-style license found in the
22035 * LICENSE file in the root directory of this source tree. An additional grant
22036 * of patent rights can be found in the PATENTS file in the same directory.
22037 *
22038 * @typechecks
22039 */
22040
22041/*eslint-disable fb-www/unsafe-html*/
22042
22043var ExecutionEnvironment = _dereq_(164);
22044
22045var createArrayFromMixed = _dereq_(168);
22046var getMarkupWrap = _dereq_(174);
22047var invariant = _dereq_(178);
22048
22049/**
22050 * Dummy container used to render all markup.
22051 */
22052var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
22053
22054/**
22055 * Pattern used by `getNodeName`.
22056 */
22057var nodeNamePattern = /^\s*<(\w+)/;
22058
22059/**
22060 * Extracts the `nodeName` of the first element in a string of markup.
22061 *
22062 * @param {string} markup String of markup.
22063 * @return {?string} Node name of the supplied markup.
22064 */
22065function getNodeName(markup) {
22066 var nodeNameMatch = markup.match(nodeNamePattern);
22067 return nodeNameMatch && nodeNameMatch[1].toLowerCase();
22068}
22069
22070/**
22071 * Creates an array containing the nodes rendered from the supplied markup. The
22072 * optionally supplied `handleScript` function will be invoked once for each
22073 * <script> element that is rendered. If no `handleScript` function is supplied,
22074 * an exception is thrown if any <script> elements are rendered.
22075 *
22076 * @param {string} markup A string of valid HTML markup.
22077 * @param {?function} handleScript Invoked once for each rendered <script>.
22078 * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
22079 */
22080function createNodesFromMarkup(markup, handleScript) {
22081 var node = dummyNode;
22082 !!!dummyNode ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
22083 var nodeName = getNodeName(markup);
22084
22085 var wrap = nodeName && getMarkupWrap(nodeName);
22086 if (wrap) {
22087 node.innerHTML = wrap[1] + markup + wrap[2];
22088
22089 var wrapDepth = wrap[0];
22090 while (wrapDepth--) {
22091 node = node.lastChild;
22092 }
22093 } else {
22094 node.innerHTML = markup;
22095 }
22096
22097 var scripts = node.getElementsByTagName('script');
22098 if (scripts.length) {
22099 !handleScript ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;
22100 createArrayFromMixed(scripts).forEach(handleScript);
22101 }
22102
22103 var nodes = Array.from(node.childNodes);
22104 while (node.lastChild) {
22105 node.removeChild(node.lastChild);
22106 }
22107 return nodes;
22108}
22109
22110module.exports = createNodesFromMarkup;
22111},{"164":164,"168":168,"174":174,"178":178}],170:[function(_dereq_,module,exports){
22112"use strict";
22113
22114/**
22115 * Copyright (c) 2013-present, Facebook, Inc.
22116 * All rights reserved.
22117 *
22118 * This source code is licensed under the BSD-style license found in the
22119 * LICENSE file in the root directory of this source tree. An additional grant
22120 * of patent rights can be found in the PATENTS file in the same directory.
22121 *
22122 *
22123 */
22124
22125function makeEmptyFunction(arg) {
22126 return function () {
22127 return arg;
22128 };
22129}
22130
22131/**
22132 * This function accepts and discards inputs; it has no side effects. This is
22133 * primarily useful idiomatically for overridable function endpoints which
22134 * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
22135 */
22136var emptyFunction = function emptyFunction() {};
22137
22138emptyFunction.thatReturns = makeEmptyFunction;
22139emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
22140emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
22141emptyFunction.thatReturnsNull = makeEmptyFunction(null);
22142emptyFunction.thatReturnsThis = function () {
22143 return this;
22144};
22145emptyFunction.thatReturnsArgument = function (arg) {
22146 return arg;
22147};
22148
22149module.exports = emptyFunction;
22150},{}],171:[function(_dereq_,module,exports){
22151/**
22152 * Copyright (c) 2013-present, Facebook, Inc.
22153 * All rights reserved.
22154 *
22155 * This source code is licensed under the BSD-style license found in the
22156 * LICENSE file in the root directory of this source tree. An additional grant
22157 * of patent rights can be found in the PATENTS file in the same directory.
22158 *
22159 */
22160
22161'use strict';
22162
22163var emptyObject = {};
22164
22165if ("development" !== 'production') {
22166 Object.freeze(emptyObject);
22167}
22168
22169module.exports = emptyObject;
22170},{}],172:[function(_dereq_,module,exports){
22171/**
22172 * Copyright (c) 2013-present, Facebook, Inc.
22173 * All rights reserved.
22174 *
22175 * This source code is licensed under the BSD-style license found in the
22176 * LICENSE file in the root directory of this source tree. An additional grant
22177 * of patent rights can be found in the PATENTS file in the same directory.
22178 *
22179 */
22180
22181'use strict';
22182
22183/**
22184 * @param {DOMElement} node input/textarea to focus
22185 */
22186
22187function focusNode(node) {
22188 // IE8 can throw "Can't move focus to the control because it is invisible,
22189 // not enabled, or of a type that does not accept the focus." for all kinds of
22190 // reasons that are too expensive and fragile to test.
22191 try {
22192 node.focus();
22193 } catch (e) {}
22194}
22195
22196module.exports = focusNode;
22197},{}],173:[function(_dereq_,module,exports){
22198'use strict';
22199
22200/**
22201 * Copyright (c) 2013-present, Facebook, Inc.
22202 * All rights reserved.
22203 *
22204 * This source code is licensed under the BSD-style license found in the
22205 * LICENSE file in the root directory of this source tree. An additional grant
22206 * of patent rights can be found in the PATENTS file in the same directory.
22207 *
22208 * @typechecks
22209 */
22210
22211/* eslint-disable fb-www/typeof-undefined */
22212
22213/**
22214 * Same as document.activeElement but wraps in a try-catch block. In IE it is
22215 * not safe to call document.activeElement if there is nothing focused.
22216 *
22217 * The activeElement will be null only if the document or document body is not
22218 * yet defined.
22219 */
22220function getActiveElement() /*?DOMElement*/{
22221 if (typeof document === 'undefined') {
22222 return null;
22223 }
22224 try {
22225 return document.activeElement || document.body;
22226 } catch (e) {
22227 return document.body;
22228 }
22229}
22230
22231module.exports = getActiveElement;
22232},{}],174:[function(_dereq_,module,exports){
22233'use strict';
22234
22235/**
22236 * Copyright (c) 2013-present, Facebook, Inc.
22237 * All rights reserved.
22238 *
22239 * This source code is licensed under the BSD-style license found in the
22240 * LICENSE file in the root directory of this source tree. An additional grant
22241 * of patent rights can be found in the PATENTS file in the same directory.
22242 *
22243 */
22244
22245/*eslint-disable fb-www/unsafe-html */
22246
22247var ExecutionEnvironment = _dereq_(164);
22248
22249var invariant = _dereq_(178);
22250
22251/**
22252 * Dummy container used to detect which wraps are necessary.
22253 */
22254var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
22255
22256/**
22257 * Some browsers cannot use `innerHTML` to render certain elements standalone,
22258 * so we wrap them, render the wrapped nodes, then extract the desired node.
22259 *
22260 * In IE8, certain elements cannot render alone, so wrap all elements ('*').
22261 */
22262
22263var shouldWrap = {};
22264
22265var selectWrap = [1, '<select multiple="true">', '</select>'];
22266var tableWrap = [1, '<table>', '</table>'];
22267var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
22268
22269var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
22270
22271var markupWrap = {
22272 '*': [1, '?<div>', '</div>'],
22273
22274 'area': [1, '<map>', '</map>'],
22275 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
22276 'legend': [1, '<fieldset>', '</fieldset>'],
22277 'param': [1, '<object>', '</object>'],
22278 'tr': [2, '<table><tbody>', '</tbody></table>'],
22279
22280 'optgroup': selectWrap,
22281 'option': selectWrap,
22282
22283 'caption': tableWrap,
22284 'colgroup': tableWrap,
22285 'tbody': tableWrap,
22286 'tfoot': tableWrap,
22287 'thead': tableWrap,
22288
22289 'td': trWrap,
22290 'th': trWrap
22291};
22292
22293// Initialize the SVG elements since we know they'll always need to be wrapped
22294// consistently. If they are created inside a <div> they will be initialized in
22295// the wrong namespace (and will not display).
22296var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
22297svgElements.forEach(function (nodeName) {
22298 markupWrap[nodeName] = svgWrap;
22299 shouldWrap[nodeName] = true;
22300});
22301
22302/**
22303 * Gets the markup wrap configuration for the supplied `nodeName`.
22304 *
22305 * NOTE: This lazily detects which wraps are necessary for the current browser.
22306 *
22307 * @param {string} nodeName Lowercase `nodeName`.
22308 * @return {?array} Markup wrap configuration, if applicable.
22309 */
22310function getMarkupWrap(nodeName) {
22311 !!!dummyNode ? "development" !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
22312 if (!markupWrap.hasOwnProperty(nodeName)) {
22313 nodeName = '*';
22314 }
22315 if (!shouldWrap.hasOwnProperty(nodeName)) {
22316 if (nodeName === '*') {
22317 dummyNode.innerHTML = '<link />';
22318 } else {
22319 dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
22320 }
22321 shouldWrap[nodeName] = !dummyNode.firstChild;
22322 }
22323 return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
22324}
22325
22326module.exports = getMarkupWrap;
22327},{"164":164,"178":178}],175:[function(_dereq_,module,exports){
22328/**
22329 * Copyright (c) 2013-present, Facebook, Inc.
22330 * All rights reserved.
22331 *
22332 * This source code is licensed under the BSD-style license found in the
22333 * LICENSE file in the root directory of this source tree. An additional grant
22334 * of patent rights can be found in the PATENTS file in the same directory.
22335 *
22336 * @typechecks
22337 */
22338
22339'use strict';
22340
22341/**
22342 * Gets the scroll position of the supplied element or window.
22343 *
22344 * The return values are unbounded, unlike `getScrollPosition`. This means they
22345 * may be negative or exceed the element boundaries (which is possible using
22346 * inertial scrolling).
22347 *
22348 * @param {DOMWindow|DOMElement} scrollable
22349 * @return {object} Map with `x` and `y` keys.
22350 */
22351
22352function getUnboundedScrollPosition(scrollable) {
22353 if (scrollable === window) {
22354 return {
22355 x: window.pageXOffset || document.documentElement.scrollLeft,
22356 y: window.pageYOffset || document.documentElement.scrollTop
22357 };
22358 }
22359 return {
22360 x: scrollable.scrollLeft,
22361 y: scrollable.scrollTop
22362 };
22363}
22364
22365module.exports = getUnboundedScrollPosition;
22366},{}],176:[function(_dereq_,module,exports){
22367'use strict';
22368
22369/**
22370 * Copyright (c) 2013-present, Facebook, Inc.
22371 * All rights reserved.
22372 *
22373 * This source code is licensed under the BSD-style license found in the
22374 * LICENSE file in the root directory of this source tree. An additional grant
22375 * of patent rights can be found in the PATENTS file in the same directory.
22376 *
22377 * @typechecks
22378 */
22379
22380var _uppercasePattern = /([A-Z])/g;
22381
22382/**
22383 * Hyphenates a camelcased string, for example:
22384 *
22385 * > hyphenate('backgroundColor')
22386 * < "background-color"
22387 *
22388 * For CSS style names, use `hyphenateStyleName` instead which works properly
22389 * with all vendor prefixes, including `ms`.
22390 *
22391 * @param {string} string
22392 * @return {string}
22393 */
22394function hyphenate(string) {
22395 return string.replace(_uppercasePattern, '-$1').toLowerCase();
22396}
22397
22398module.exports = hyphenate;
22399},{}],177:[function(_dereq_,module,exports){
22400/**
22401 * Copyright (c) 2013-present, Facebook, Inc.
22402 * All rights reserved.
22403 *
22404 * This source code is licensed under the BSD-style license found in the
22405 * LICENSE file in the root directory of this source tree. An additional grant
22406 * of patent rights can be found in the PATENTS file in the same directory.
22407 *
22408 * @typechecks
22409 */
22410
22411'use strict';
22412
22413var hyphenate = _dereq_(176);
22414
22415var msPattern = /^ms-/;
22416
22417/**
22418 * Hyphenates a camelcased CSS property name, for example:
22419 *
22420 * > hyphenateStyleName('backgroundColor')
22421 * < "background-color"
22422 * > hyphenateStyleName('MozTransition')
22423 * < "-moz-transition"
22424 * > hyphenateStyleName('msTransition')
22425 * < "-ms-transition"
22426 *
22427 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
22428 * is converted to `-ms-`.
22429 *
22430 * @param {string} string
22431 * @return {string}
22432 */
22433function hyphenateStyleName(string) {
22434 return hyphenate(string).replace(msPattern, '-ms-');
22435}
22436
22437module.exports = hyphenateStyleName;
22438},{"176":176}],178:[function(_dereq_,module,exports){
22439/**
22440 * Copyright (c) 2013-present, Facebook, Inc.
22441 * All rights reserved.
22442 *
22443 * This source code is licensed under the BSD-style license found in the
22444 * LICENSE file in the root directory of this source tree. An additional grant
22445 * of patent rights can be found in the PATENTS file in the same directory.
22446 *
22447 */
22448
22449'use strict';
22450
22451/**
22452 * Use invariant() to assert state which your program assumes to be true.
22453 *
22454 * Provide sprintf-style format (only %s is supported) and arguments
22455 * to provide information about what broke and what you were
22456 * expecting.
22457 *
22458 * The invariant message will be stripped in production, but the invariant
22459 * will remain to ensure logic does not differ in production.
22460 */
22461
22462function invariant(condition, format, a, b, c, d, e, f) {
22463 if ("development" !== 'production') {
22464 if (format === undefined) {
22465 throw new Error('invariant requires an error message argument');
22466 }
22467 }
22468
22469 if (!condition) {
22470 var error;
22471 if (format === undefined) {
22472 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
22473 } else {
22474 var args = [a, b, c, d, e, f];
22475 var argIndex = 0;
22476 error = new Error(format.replace(/%s/g, function () {
22477 return args[argIndex++];
22478 }));
22479 error.name = 'Invariant Violation';
22480 }
22481
22482 error.framesToPop = 1; // we don't care about invariant's own frame
22483 throw error;
22484 }
22485}
22486
22487module.exports = invariant;
22488},{}],179:[function(_dereq_,module,exports){
22489'use strict';
22490
22491/**
22492 * Copyright (c) 2013-present, Facebook, Inc.
22493 * All rights reserved.
22494 *
22495 * This source code is licensed under the BSD-style license found in the
22496 * LICENSE file in the root directory of this source tree. An additional grant
22497 * of patent rights can be found in the PATENTS file in the same directory.
22498 *
22499 * @typechecks
22500 */
22501
22502/**
22503 * @param {*} object The object to check.
22504 * @return {boolean} Whether or not the object is a DOM node.
22505 */
22506function isNode(object) {
22507 return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
22508}
22509
22510module.exports = isNode;
22511},{}],180:[function(_dereq_,module,exports){
22512'use strict';
22513
22514/**
22515 * Copyright (c) 2013-present, Facebook, Inc.
22516 * All rights reserved.
22517 *
22518 * This source code is licensed under the BSD-style license found in the
22519 * LICENSE file in the root directory of this source tree. An additional grant
22520 * of patent rights can be found in the PATENTS file in the same directory.
22521 *
22522 * @typechecks
22523 */
22524
22525var isNode = _dereq_(179);
22526
22527/**
22528 * @param {*} object The object to check.
22529 * @return {boolean} Whether or not the object is a DOM text node.
22530 */
22531function isTextNode(object) {
22532 return isNode(object) && object.nodeType == 3;
22533}
22534
22535module.exports = isTextNode;
22536},{"179":179}],181:[function(_dereq_,module,exports){
22537/**
22538 * Copyright (c) 2013-present, Facebook, Inc.
22539 * All rights reserved.
22540 *
22541 * This source code is licensed under the BSD-style license found in the
22542 * LICENSE file in the root directory of this source tree. An additional grant
22543 * of patent rights can be found in the PATENTS file in the same directory.
22544 *
22545 * @typechecks static-only
22546 */
22547
22548'use strict';
22549
22550var invariant = _dereq_(178);
22551
22552/**
22553 * Constructs an enumeration with keys equal to their value.
22554 *
22555 * For example:
22556 *
22557 * var COLORS = keyMirror({blue: null, red: null});
22558 * var myColor = COLORS.blue;
22559 * var isColorValid = !!COLORS[myColor];
22560 *
22561 * The last line could not be performed if the values of the generated enum were
22562 * not equal to their keys.
22563 *
22564 * Input: {key1: val1, key2: val2}
22565 * Output: {key1: key1, key2: key2}
22566 *
22567 * @param {object} obj
22568 * @return {object}
22569 */
22570var keyMirror = function keyMirror(obj) {
22571 var ret = {};
22572 var key;
22573 !(obj instanceof Object && !Array.isArray(obj)) ? "development" !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0;
22574 for (key in obj) {
22575 if (!obj.hasOwnProperty(key)) {
22576 continue;
22577 }
22578 ret[key] = key;
22579 }
22580 return ret;
22581};
22582
22583module.exports = keyMirror;
22584},{"178":178}],182:[function(_dereq_,module,exports){
22585"use strict";
22586
22587/**
22588 * Copyright (c) 2013-present, Facebook, Inc.
22589 * All rights reserved.
22590 *
22591 * This source code is licensed under the BSD-style license found in the
22592 * LICENSE file in the root directory of this source tree. An additional grant
22593 * of patent rights can be found in the PATENTS file in the same directory.
22594 *
22595 */
22596
22597/**
22598 * Allows extraction of a minified key. Let's the build system minify keys
22599 * without losing the ability to dynamically use key strings as values
22600 * themselves. Pass in an object with a single key/val pair and it will return
22601 * you the string key of that single record. Suppose you want to grab the
22602 * value for a key 'className' inside of an object. Key/val minification may
22603 * have aliased that key to be 'xa12'. keyOf({className: null}) will return
22604 * 'xa12' in that case. Resolve keys you want to use once at startup time, then
22605 * reuse those resolutions.
22606 */
22607var keyOf = function keyOf(oneKeyObj) {
22608 var key;
22609 for (key in oneKeyObj) {
22610 if (!oneKeyObj.hasOwnProperty(key)) {
22611 continue;
22612 }
22613 return key;
22614 }
22615 return null;
22616};
22617
22618module.exports = keyOf;
22619},{}],183:[function(_dereq_,module,exports){
22620/**
22621 * Copyright (c) 2013-present, Facebook, Inc.
22622 * All rights reserved.
22623 *
22624 * This source code is licensed under the BSD-style license found in the
22625 * LICENSE file in the root directory of this source tree. An additional grant
22626 * of patent rights can be found in the PATENTS file in the same directory.
22627 *
22628 *
22629 * @typechecks static-only
22630 */
22631
22632'use strict';
22633
22634/**
22635 * Memoizes the return value of a function that accepts one string argument.
22636 */
22637
22638function memoizeStringOnly(callback) {
22639 var cache = {};
22640 return function (string) {
22641 if (!cache.hasOwnProperty(string)) {
22642 cache[string] = callback.call(this, string);
22643 }
22644 return cache[string];
22645 };
22646}
22647
22648module.exports = memoizeStringOnly;
22649},{}],184:[function(_dereq_,module,exports){
22650/**
22651 * Copyright (c) 2013-present, Facebook, Inc.
22652 * All rights reserved.
22653 *
22654 * This source code is licensed under the BSD-style license found in the
22655 * LICENSE file in the root directory of this source tree. An additional grant
22656 * of patent rights can be found in the PATENTS file in the same directory.
22657 *
22658 * @typechecks
22659 */
22660
22661'use strict';
22662
22663var ExecutionEnvironment = _dereq_(164);
22664
22665var performance;
22666
22667if (ExecutionEnvironment.canUseDOM) {
22668 performance = window.performance || window.msPerformance || window.webkitPerformance;
22669}
22670
22671module.exports = performance || {};
22672},{"164":164}],185:[function(_dereq_,module,exports){
22673'use strict';
22674
22675/**
22676 * Copyright (c) 2013-present, Facebook, Inc.
22677 * All rights reserved.
22678 *
22679 * This source code is licensed under the BSD-style license found in the
22680 * LICENSE file in the root directory of this source tree. An additional grant
22681 * of patent rights can be found in the PATENTS file in the same directory.
22682 *
22683 * @typechecks
22684 */
22685
22686var performance = _dereq_(184);
22687
22688var performanceNow;
22689
22690/**
22691 * Detect if we can use `window.performance.now()` and gracefully fallback to
22692 * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
22693 * because of Facebook's testing infrastructure.
22694 */
22695if (performance.now) {
22696 performanceNow = function performanceNow() {
22697 return performance.now();
22698 };
22699} else {
22700 performanceNow = function performanceNow() {
22701 return Date.now();
22702 };
22703}
22704
22705module.exports = performanceNow;
22706},{"184":184}],186:[function(_dereq_,module,exports){
22707/**
22708 * Copyright (c) 2013-present, Facebook, Inc.
22709 * All rights reserved.
22710 *
22711 * This source code is licensed under the BSD-style license found in the
22712 * LICENSE file in the root directory of this source tree. An additional grant
22713 * of patent rights can be found in the PATENTS file in the same directory.
22714 *
22715 * @typechecks
22716 *
22717 */
22718
22719/*eslint-disable no-self-compare */
22720
22721'use strict';
22722
22723var hasOwnProperty = Object.prototype.hasOwnProperty;
22724
22725/**
22726 * inlined Object.is polyfill to avoid requiring consumers ship their own
22727 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
22728 */
22729function is(x, y) {
22730 // SameValue algorithm
22731 if (x === y) {
22732 // Steps 1-5, 7-10
22733 // Steps 6.b-6.e: +0 != -0
22734 return x !== 0 || 1 / x === 1 / y;
22735 } else {
22736 // Step 6.a: NaN == NaN
22737 return x !== x && y !== y;
22738 }
22739}
22740
22741/**
22742 * Performs equality by iterating through keys on an object and returning false
22743 * when any key has values which are not strictly equal between the arguments.
22744 * Returns true when the values of all keys are strictly equal.
22745 */
22746function shallowEqual(objA, objB) {
22747 if (is(objA, objB)) {
22748 return true;
22749 }
22750
22751 if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
22752 return false;
22753 }
22754
22755 var keysA = Object.keys(objA);
22756 var keysB = Object.keys(objB);
22757
22758 if (keysA.length !== keysB.length) {
22759 return false;
22760 }
22761
22762 // Test for A's keys different from B.
22763 for (var i = 0; i < keysA.length; i++) {
22764 if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
22765 return false;
22766 }
22767 }
22768
22769 return true;
22770}
22771
22772module.exports = shallowEqual;
22773},{}],187:[function(_dereq_,module,exports){
22774/**
22775 * Copyright 2014-2015, Facebook, Inc.
22776 * All rights reserved.
22777 *
22778 * This source code is licensed under the BSD-style license found in the
22779 * LICENSE file in the root directory of this source tree. An additional grant
22780 * of patent rights can be found in the PATENTS file in the same directory.
22781 *
22782 */
22783
22784'use strict';
22785
22786var emptyFunction = _dereq_(170);
22787
22788/**
22789 * Similar to invariant but only logs a warning if the condition is not met.
22790 * This can be used to log issues in development environments in critical
22791 * paths. Removing the logging code for production environments will keep the
22792 * same logic and follow the same code paths.
22793 */
22794
22795var warning = emptyFunction;
22796
22797if ("development" !== 'production') {
22798 (function () {
22799 var printWarning = function printWarning(format) {
22800 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
22801 args[_key - 1] = arguments[_key];
22802 }
22803
22804 var argIndex = 0;
22805 var message = 'Warning: ' + format.replace(/%s/g, function () {
22806 return args[argIndex++];
22807 });
22808 if (typeof console !== 'undefined') {
22809 console.error(message);
22810 }
22811 try {
22812 // --- Welcome to debugging React ---
22813 // This error was thrown as a convenience so that you can use this stack
22814 // to find the callsite that caused this warning to fire.
22815 throw new Error(message);
22816 } catch (x) {}
22817 };
22818
22819 warning = function warning(condition, format) {
22820 if (format === undefined) {
22821 throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
22822 }
22823
22824 if (format.indexOf('Failed Composite propType: ') === 0) {
22825 return; // Ignore CompositeComponent proptype check.
22826 }
22827
22828 if (!condition) {
22829 for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
22830 args[_key2 - 2] = arguments[_key2];
22831 }
22832
22833 printWarning.apply(undefined, [format].concat(args));
22834 }
22835 };
22836 })();
22837}
22838
22839module.exports = warning;
22840},{"170":170}],188:[function(_dereq_,module,exports){
22841'use strict';
22842/* eslint-disable no-unused-vars */
22843var hasOwnProperty = Object.prototype.hasOwnProperty;
22844var propIsEnumerable = Object.prototype.propertyIsEnumerable;
22845
22846function toObject(val) {
22847 if (val === null || val === undefined) {
22848 throw new TypeError('Object.assign cannot be called with null or undefined');
22849 }
22850
22851 return Object(val);
22852}
22853
22854function shouldUseNative() {
22855 try {
22856 if (!Object.assign) {
22857 return false;
22858 }
22859
22860 // Detect buggy property enumeration order in older V8 versions.
22861
22862 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
22863 var test1 = new String('abc'); // eslint-disable-line
22864 test1[5] = 'de';
22865 if (Object.getOwnPropertyNames(test1)[0] === '5') {
22866 return false;
22867 }
22868
22869 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
22870 var test2 = {};
22871 for (var i = 0; i < 10; i++) {
22872 test2['_' + String.fromCharCode(i)] = i;
22873 }
22874 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
22875 return test2[n];
22876 });
22877 if (order2.join('') !== '0123456789') {
22878 return false;
22879 }
22880
22881 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
22882 var test3 = {};
22883 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
22884 test3[letter] = letter;
22885 });
22886 if (Object.keys(Object.assign({}, test3)).join('') !==
22887 'abcdefghijklmnopqrst') {
22888 return false;
22889 }
22890
22891 return true;
22892 } catch (e) {
22893 // We don't expect any of the above to throw, but better to be safe.
22894 return false;
22895 }
22896}
22897
22898module.exports = shouldUseNative() ? Object.assign : function (target, source) {
22899 var from;
22900 var to = toObject(target);
22901 var symbols;
22902
22903 for (var s = 1; s < arguments.length; s++) {
22904 from = Object(arguments[s]);
22905
22906 for (var key in from) {
22907 if (hasOwnProperty.call(from, key)) {
22908 to[key] = from[key];
22909 }
22910 }
22911
22912 if (Object.getOwnPropertySymbols) {
22913 symbols = Object.getOwnPropertySymbols(from);
22914 for (var i = 0; i < symbols.length; i++) {
22915 if (propIsEnumerable.call(from, symbols[i])) {
22916 to[symbols[i]] = from[symbols[i]];
22917 }
22918 }
22919 }
22920 }
22921
22922 return to;
22923};
22924
22925},{}]},{},[110])(110)
22926});
\No newline at end of file