UNPKG

558 kBJavaScriptView Raw
1 /**
2 * ReactDOMServer v15.7.0
3 */
4
5;(function(f) {
6 // CommonJS
7 if (typeof exports === "object" && typeof module !== "undefined") {
8 module.exports = f(require('react'));
9
10 // RequireJS
11 } else if (typeof define === "function" && define.amd) {
12 define(['react'], f);
13
14 // <script>
15 } else {
16 var g;
17 if (typeof window !== "undefined") {
18 g = window;
19 } else if (typeof global !== "undefined") {
20 g = global;
21 } else if (typeof self !== "undefined") {
22 g = self;
23 } else {
24 // works providing we're not in "use strict";
25 // needed for Java 8 Nashorn
26 // see https://github.com/facebook/react/issues/3037
27 g = this;
28 }
29 g.ReactDOMServer = f(g.React);
30 }
31})(function(React) {
32 return (function(f){return 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){
33/**
34 * Copyright (c) 2013-present, Facebook, Inc.
35 *
36 * This source code is licensed under the MIT license found in the
37 * LICENSE file in the root directory of this source tree.
38 *
39 */
40
41'use strict';
42
43var ARIADOMPropertyConfig = {
44 Properties: {
45 // Global States and Properties
46 'aria-current': 0, // state
47 'aria-details': 0,
48 'aria-disabled': 0, // state
49 'aria-hidden': 0, // state
50 'aria-invalid': 0, // state
51 'aria-keyshortcuts': 0,
52 'aria-label': 0,
53 'aria-roledescription': 0,
54 // Widget Attributes
55 'aria-autocomplete': 0,
56 'aria-checked': 0,
57 'aria-expanded': 0,
58 'aria-haspopup': 0,
59 'aria-level': 0,
60 'aria-modal': 0,
61 'aria-multiline': 0,
62 'aria-multiselectable': 0,
63 'aria-orientation': 0,
64 'aria-placeholder': 0,
65 'aria-pressed': 0,
66 'aria-readonly': 0,
67 'aria-required': 0,
68 'aria-selected': 0,
69 'aria-sort': 0,
70 'aria-valuemax': 0,
71 'aria-valuemin': 0,
72 'aria-valuenow': 0,
73 'aria-valuetext': 0,
74 // Live Region Attributes
75 'aria-atomic': 0,
76 'aria-busy': 0,
77 'aria-live': 0,
78 'aria-relevant': 0,
79 // Drag-and-Drop Attributes
80 'aria-dropeffect': 0,
81 'aria-grabbed': 0,
82 // Relationship Attributes
83 'aria-activedescendant': 0,
84 'aria-colcount': 0,
85 'aria-colindex': 0,
86 'aria-colspan': 0,
87 'aria-controls': 0,
88 'aria-describedby': 0,
89 'aria-errormessage': 0,
90 'aria-flowto': 0,
91 'aria-labelledby': 0,
92 'aria-owns': 0,
93 'aria-posinset': 0,
94 'aria-rowcount': 0,
95 'aria-rowindex': 0,
96 'aria-rowspan': 0,
97 'aria-setsize': 0
98 },
99 DOMAttributeNames: {},
100 DOMPropertyNames: {}
101};
102
103module.exports = ARIADOMPropertyConfig;
104},{}],2:[function(_dereq_,module,exports){
105/**
106 * Copyright (c) 2013-present, Facebook, Inc.
107 *
108 * This source code is licensed under the MIT license found in the
109 * LICENSE file in the root directory of this source tree.
110 *
111 */
112
113'use strict';
114
115var ReactDOMComponentTree = _dereq_(32);
116
117var focusNode = _dereq_(135);
118
119var AutoFocusUtils = {
120 focusDOMComponent: function () {
121 focusNode(ReactDOMComponentTree.getNodeFromInstance(this));
122 }
123};
124
125module.exports = AutoFocusUtils;
126},{"135":135,"32":32}],3:[function(_dereq_,module,exports){
127/**
128 * Copyright (c) 2013-present, Facebook, Inc.
129 *
130 * This source code is licensed under the MIT license found in the
131 * LICENSE file in the root directory of this source tree.
132 *
133 */
134
135'use strict';
136
137var EventPropagators = _dereq_(19);
138var ExecutionEnvironment = _dereq_(127);
139var FallbackCompositionState = _dereq_(20);
140var SyntheticCompositionEvent = _dereq_(82);
141var SyntheticInputEvent = _dereq_(86);
142
143var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
144var START_KEYCODE = 229;
145
146var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;
147
148var documentMode = null;
149if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {
150 documentMode = document.documentMode;
151}
152
153// Webkit offers a very useful `textInput` event that can be used to
154// directly represent `beforeInput`. The IE `textinput` event is not as
155// useful, so we don't use it.
156var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();
157
158// In IE9+, we have access to composition events, but the data supplied
159// by the native compositionend event may be incorrect. Japanese ideographic
160// spaces, for instance (\u3000) are not recorded correctly.
161var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
162
163/**
164 * Opera <= 12 includes TextEvent in window, but does not fire
165 * text input events. Rely on keypress instead.
166 */
167function isPresto() {
168 var opera = window.opera;
169 return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;
170}
171
172var SPACEBAR_CODE = 32;
173var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
174
175// Events and their corresponding property names.
176var eventTypes = {
177 beforeInput: {
178 phasedRegistrationNames: {
179 bubbled: 'onBeforeInput',
180 captured: 'onBeforeInputCapture'
181 },
182 dependencies: ['topCompositionEnd', 'topKeyPress', 'topTextInput', 'topPaste']
183 },
184 compositionEnd: {
185 phasedRegistrationNames: {
186 bubbled: 'onCompositionEnd',
187 captured: 'onCompositionEndCapture'
188 },
189 dependencies: ['topBlur', 'topCompositionEnd', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
190 },
191 compositionStart: {
192 phasedRegistrationNames: {
193 bubbled: 'onCompositionStart',
194 captured: 'onCompositionStartCapture'
195 },
196 dependencies: ['topBlur', 'topCompositionStart', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
197 },
198 compositionUpdate: {
199 phasedRegistrationNames: {
200 bubbled: 'onCompositionUpdate',
201 captured: 'onCompositionUpdateCapture'
202 },
203 dependencies: ['topBlur', 'topCompositionUpdate', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']
204 }
205};
206
207// Track whether we've ever handled a keypress on the space key.
208var hasSpaceKeypress = false;
209
210/**
211 * Return whether a native keypress event is assumed to be a command.
212 * This is required because Firefox fires `keypress` events for key commands
213 * (cut, copy, select-all, etc.) even though no character is inserted.
214 */
215function isKeypressCommand(nativeEvent) {
216 return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
217 // ctrlKey && altKey is equivalent to AltGr, and is not a command.
218 !(nativeEvent.ctrlKey && nativeEvent.altKey);
219}
220
221/**
222 * Translate native top level events into event types.
223 *
224 * @param {string} topLevelType
225 * @return {object}
226 */
227function getCompositionEventType(topLevelType) {
228 switch (topLevelType) {
229 case 'topCompositionStart':
230 return eventTypes.compositionStart;
231 case 'topCompositionEnd':
232 return eventTypes.compositionEnd;
233 case 'topCompositionUpdate':
234 return eventTypes.compositionUpdate;
235 }
236}
237
238/**
239 * Does our fallback best-guess model think this event signifies that
240 * composition has begun?
241 *
242 * @param {string} topLevelType
243 * @param {object} nativeEvent
244 * @return {boolean}
245 */
246function isFallbackCompositionStart(topLevelType, nativeEvent) {
247 return topLevelType === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE;
248}
249
250/**
251 * Does our fallback mode think that this event is the end of composition?
252 *
253 * @param {string} topLevelType
254 * @param {object} nativeEvent
255 * @return {boolean}
256 */
257function isFallbackCompositionEnd(topLevelType, nativeEvent) {
258 switch (topLevelType) {
259 case 'topKeyUp':
260 // Command keys insert or clear IME input.
261 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
262 case 'topKeyDown':
263 // Expect IME keyCode on each keydown. If we get any other
264 // code we must have exited earlier.
265 return nativeEvent.keyCode !== START_KEYCODE;
266 case 'topKeyPress':
267 case 'topMouseDown':
268 case 'topBlur':
269 // Events are not possible without cancelling IME.
270 return true;
271 default:
272 return false;
273 }
274}
275
276/**
277 * Google Input Tools provides composition data via a CustomEvent,
278 * with the `data` property populated in the `detail` object. If this
279 * is available on the event object, use it. If not, this is a plain
280 * composition event and we have nothing special to extract.
281 *
282 * @param {object} nativeEvent
283 * @return {?string}
284 */
285function getDataFromCustomEvent(nativeEvent) {
286 var detail = nativeEvent.detail;
287 if (typeof detail === 'object' && 'data' in detail) {
288 return detail.data;
289 }
290 return null;
291}
292
293// Track the current IME composition fallback object, if any.
294var currentComposition = null;
295
296/**
297 * @return {?object} A SyntheticCompositionEvent.
298 */
299function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
300 var eventType;
301 var fallbackData;
302
303 if (canUseCompositionEvent) {
304 eventType = getCompositionEventType(topLevelType);
305 } else if (!currentComposition) {
306 if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
307 eventType = eventTypes.compositionStart;
308 }
309 } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
310 eventType = eventTypes.compositionEnd;
311 }
312
313 if (!eventType) {
314 return null;
315 }
316
317 if (useFallbackCompositionData) {
318 // The current composition is stored statically and must not be
319 // overwritten while composition continues.
320 if (!currentComposition && eventType === eventTypes.compositionStart) {
321 currentComposition = FallbackCompositionState.getPooled(nativeEventTarget);
322 } else if (eventType === eventTypes.compositionEnd) {
323 if (currentComposition) {
324 fallbackData = currentComposition.getData();
325 }
326 }
327 }
328
329 var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
330
331 if (fallbackData) {
332 // Inject data generated from fallback path into the synthetic event.
333 // This matches the property of native CompositionEventInterface.
334 event.data = fallbackData;
335 } else {
336 var customData = getDataFromCustomEvent(nativeEvent);
337 if (customData !== null) {
338 event.data = customData;
339 }
340 }
341
342 EventPropagators.accumulateTwoPhaseDispatches(event);
343 return event;
344}
345
346/**
347 * @param {string} topLevelType Record from `EventConstants`.
348 * @param {object} nativeEvent Native browser event.
349 * @return {?string} The string corresponding to this `beforeInput` event.
350 */
351function getNativeBeforeInputChars(topLevelType, nativeEvent) {
352 switch (topLevelType) {
353 case 'topCompositionEnd':
354 return getDataFromCustomEvent(nativeEvent);
355 case 'topKeyPress':
356 /**
357 * If native `textInput` events are available, our goal is to make
358 * use of them. However, there is a special case: the spacebar key.
359 * In Webkit, preventing default on a spacebar `textInput` event
360 * cancels character insertion, but it *also* causes the browser
361 * to fall back to its default spacebar behavior of scrolling the
362 * page.
363 *
364 * Tracking at:
365 * https://code.google.com/p/chromium/issues/detail?id=355103
366 *
367 * To avoid this issue, use the keypress event as if no `textInput`
368 * event is available.
369 */
370 var which = nativeEvent.which;
371 if (which !== SPACEBAR_CODE) {
372 return null;
373 }
374
375 hasSpaceKeypress = true;
376 return SPACEBAR_CHAR;
377
378 case 'topTextInput':
379 // Record the characters to be added to the DOM.
380 var chars = nativeEvent.data;
381
382 // If it's a spacebar character, assume that we have already handled
383 // it at the keypress level and bail immediately. Android Chrome
384 // doesn't give us keycodes, so we need to blacklist it.
385 if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
386 return null;
387 }
388
389 return chars;
390
391 default:
392 // For other native event types, do nothing.
393 return null;
394 }
395}
396
397/**
398 * For browsers that do not provide the `textInput` event, extract the
399 * appropriate string to use for SyntheticInputEvent.
400 *
401 * @param {string} topLevelType Record from `EventConstants`.
402 * @param {object} nativeEvent Native browser event.
403 * @return {?string} The fallback string for this `beforeInput` event.
404 */
405function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
406 // If we are currently composing (IME) and using a fallback to do so,
407 // try to extract the composed characters from the fallback object.
408 // If composition event is available, we extract a string only at
409 // compositionevent, otherwise extract it at fallback events.
410 if (currentComposition) {
411 if (topLevelType === 'topCompositionEnd' || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
412 var chars = currentComposition.getData();
413 FallbackCompositionState.release(currentComposition);
414 currentComposition = null;
415 return chars;
416 }
417 return null;
418 }
419
420 switch (topLevelType) {
421 case 'topPaste':
422 // If a paste event occurs after a keypress, throw out the input
423 // chars. Paste events should not lead to BeforeInput events.
424 return null;
425 case 'topKeyPress':
426 /**
427 * As of v27, Firefox may fire keypress events even when no character
428 * will be inserted. A few possibilities:
429 *
430 * - `which` is `0`. Arrow keys, Esc key, etc.
431 *
432 * - `which` is the pressed key code, but no char is available.
433 * Ex: 'AltGr + d` in Polish. There is no modified character for
434 * this key combination and no character is inserted into the
435 * document, but FF fires the keypress for char code `100` anyway.
436 * No `input` event will occur.
437 *
438 * - `which` is the pressed key code, but a command combination is
439 * being used. Ex: `Cmd+C`. No character is inserted, and no
440 * `input` event will occur.
441 */
442 if (nativeEvent.which && !isKeypressCommand(nativeEvent)) {
443 return String.fromCharCode(nativeEvent.which);
444 }
445 return null;
446 case 'topCompositionEnd':
447 return useFallbackCompositionData ? null : nativeEvent.data;
448 default:
449 return null;
450 }
451}
452
453/**
454 * Extract a SyntheticInputEvent for `beforeInput`, based on either native
455 * `textInput` or fallback behavior.
456 *
457 * @return {?object} A SyntheticInputEvent.
458 */
459function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
460 var chars;
461
462 if (canUseTextInputEvent) {
463 chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
464 } else {
465 chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
466 }
467
468 // If no characters are being inserted, no BeforeInput event should
469 // be fired.
470 if (!chars) {
471 return null;
472 }
473
474 var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
475
476 event.data = chars;
477 EventPropagators.accumulateTwoPhaseDispatches(event);
478 return event;
479}
480
481/**
482 * Create an `onBeforeInput` event to match
483 * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
484 *
485 * This event plugin is based on the native `textInput` event
486 * available in Chrome, Safari, Opera, and IE. This event fires after
487 * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
488 *
489 * `beforeInput` is spec'd but not implemented in any browsers, and
490 * the `input` event does not provide any useful information about what has
491 * actually been added, contrary to the spec. Thus, `textInput` is the best
492 * available event to identify the characters that have actually been inserted
493 * into the target node.
494 *
495 * This plugin is also responsible for emitting `composition` events, thus
496 * allowing us to share composition fallback code for both `beforeInput` and
497 * `composition` event types.
498 */
499var BeforeInputEventPlugin = {
500 eventTypes: eventTypes,
501
502 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
503 return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];
504 }
505};
506
507module.exports = BeforeInputEventPlugin;
508},{"127":127,"19":19,"20":20,"82":82,"86":86}],4:[function(_dereq_,module,exports){
509/**
510 * Copyright (c) 2013-present, Facebook, Inc.
511 *
512 * This source code is licensed under the MIT license found in the
513 * LICENSE file in the root directory of this source tree.
514 *
515 */
516
517'use strict';
518
519/**
520 * CSS properties which accept numbers but are not in units of "px".
521 */
522
523var isUnitlessNumber = {
524 animationIterationCount: true,
525 borderImageOutset: true,
526 borderImageSlice: true,
527 borderImageWidth: true,
528 boxFlex: true,
529 boxFlexGroup: true,
530 boxOrdinalGroup: true,
531 columnCount: true,
532 columns: true,
533 flex: true,
534 flexGrow: true,
535 flexPositive: true,
536 flexShrink: true,
537 flexNegative: true,
538 flexOrder: true,
539 gridRow: true,
540 gridRowEnd: true,
541 gridRowSpan: true,
542 gridRowStart: true,
543 gridColumn: true,
544 gridColumnEnd: true,
545 gridColumnSpan: true,
546 gridColumnStart: true,
547 fontWeight: true,
548 lineClamp: true,
549 lineHeight: true,
550 opacity: true,
551 order: true,
552 orphans: true,
553 tabSize: true,
554 widows: true,
555 zIndex: true,
556 zoom: true,
557
558 // SVG-related properties
559 fillOpacity: true,
560 floodOpacity: true,
561 stopOpacity: true,
562 strokeDasharray: true,
563 strokeDashoffset: true,
564 strokeMiterlimit: true,
565 strokeOpacity: true,
566 strokeWidth: true
567};
568
569/**
570 * @param {string} prefix vendor-specific prefix, eg: Webkit
571 * @param {string} key style name, eg: transitionDuration
572 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
573 * WebkitTransitionDuration
574 */
575function prefixKey(prefix, key) {
576 return prefix + key.charAt(0).toUpperCase() + key.substring(1);
577}
578
579/**
580 * Support style names that may come passed in prefixed by adding permutations
581 * of vendor prefixes.
582 */
583var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
584
585// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
586// infinite loop, because it iterates over the newly added props too.
587Object.keys(isUnitlessNumber).forEach(function (prop) {
588 prefixes.forEach(function (prefix) {
589 isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
590 });
591});
592
593/**
594 * Most style properties can be unset by doing .style[prop] = '' but IE8
595 * doesn't like doing that with shorthand properties so for the properties that
596 * IE8 breaks on, which are listed here, we instead unset each of the
597 * individual properties. See http://bugs.jquery.com/ticket/12385.
598 * The 4-value 'clock' properties like margin, padding, border-width seem to
599 * behave without any problems. Curiously, list-style works too without any
600 * special prodding.
601 */
602var shorthandPropertyExpansions = {
603 background: {
604 backgroundAttachment: true,
605 backgroundColor: true,
606 backgroundImage: true,
607 backgroundPositionX: true,
608 backgroundPositionY: true,
609 backgroundRepeat: true
610 },
611 backgroundPosition: {
612 backgroundPositionX: true,
613 backgroundPositionY: true
614 },
615 border: {
616 borderWidth: true,
617 borderStyle: true,
618 borderColor: true
619 },
620 borderBottom: {
621 borderBottomWidth: true,
622 borderBottomStyle: true,
623 borderBottomColor: true
624 },
625 borderLeft: {
626 borderLeftWidth: true,
627 borderLeftStyle: true,
628 borderLeftColor: true
629 },
630 borderRight: {
631 borderRightWidth: true,
632 borderRightStyle: true,
633 borderRightColor: true
634 },
635 borderTop: {
636 borderTopWidth: true,
637 borderTopStyle: true,
638 borderTopColor: true
639 },
640 font: {
641 fontStyle: true,
642 fontVariant: true,
643 fontWeight: true,
644 fontSize: true,
645 lineHeight: true,
646 fontFamily: true
647 },
648 outline: {
649 outlineWidth: true,
650 outlineStyle: true,
651 outlineColor: true
652 }
653};
654
655var CSSProperty = {
656 isUnitlessNumber: isUnitlessNumber,
657 shorthandPropertyExpansions: shorthandPropertyExpansions
658};
659
660module.exports = CSSProperty;
661},{}],5:[function(_dereq_,module,exports){
662/**
663 * Copyright (c) 2013-present, Facebook, Inc.
664 *
665 * This source code is licensed under the MIT license found in the
666 * LICENSE file in the root directory of this source tree.
667 *
668 */
669
670'use strict';
671
672var CSSProperty = _dereq_(4);
673var ExecutionEnvironment = _dereq_(127);
674var ReactInstrumentation = _dereq_(59);
675
676var camelizeStyleName = _dereq_(129);
677var dangerousStyleValue = _dereq_(99);
678var hyphenateStyleName = _dereq_(140);
679var memoizeStringOnly = _dereq_(144);
680var warning = _dereq_(148);
681
682var processStyleName = memoizeStringOnly(function (styleName) {
683 return hyphenateStyleName(styleName);
684});
685
686var hasShorthandPropertyBug = false;
687var styleFloatAccessor = 'cssFloat';
688if (ExecutionEnvironment.canUseDOM) {
689 var tempStyle = document.createElement('div').style;
690 try {
691 // IE8 throws "Invalid argument." if resetting shorthand style properties.
692 tempStyle.font = '';
693 } catch (e) {
694 hasShorthandPropertyBug = true;
695 }
696 // IE8 only supports accessing cssFloat (standard) as styleFloat
697 if (document.documentElement.style.cssFloat === undefined) {
698 styleFloatAccessor = 'styleFloat';
699 }
700}
701
702if ("development" !== 'production') {
703 // 'msTransform' is correct, but the other prefixes should be capitalized
704 var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
705
706 // style values shouldn't contain a semicolon
707 var badStyleValueWithSemicolonPattern = /;\s*$/;
708
709 var warnedStyleNames = {};
710 var warnedStyleValues = {};
711 var warnedForNaNValue = false;
712
713 var warnHyphenatedStyleName = function (name, owner) {
714 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
715 return;
716 }
717
718 warnedStyleNames[name] = true;
719 "development" !== 'production' ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0;
720 };
721
722 var warnBadVendoredStyleName = function (name, owner) {
723 if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
724 return;
725 }
726
727 warnedStyleNames[name] = true;
728 "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;
729 };
730
731 var warnStyleValueWithSemicolon = function (name, value, owner) {
732 if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
733 return;
734 }
735
736 warnedStyleValues[value] = true;
737 "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;
738 };
739
740 var warnStyleValueIsNaN = function (name, value, owner) {
741 if (warnedForNaNValue) {
742 return;
743 }
744
745 warnedForNaNValue = true;
746 "development" !== 'production' ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0;
747 };
748
749 var checkRenderMessage = function (owner) {
750 if (owner) {
751 var name = owner.getName();
752 if (name) {
753 return ' Check the render method of `' + name + '`.';
754 }
755 }
756 return '';
757 };
758
759 /**
760 * @param {string} name
761 * @param {*} value
762 * @param {ReactDOMComponent} component
763 */
764 var warnValidStyle = function (name, value, component) {
765 var owner;
766 if (component) {
767 owner = component._currentElement._owner;
768 }
769 if (name.indexOf('-') > -1) {
770 warnHyphenatedStyleName(name, owner);
771 } else if (badVendoredStyleNamePattern.test(name)) {
772 warnBadVendoredStyleName(name, owner);
773 } else if (badStyleValueWithSemicolonPattern.test(value)) {
774 warnStyleValueWithSemicolon(name, value, owner);
775 }
776
777 if (typeof value === 'number' && isNaN(value)) {
778 warnStyleValueIsNaN(name, value, owner);
779 }
780 };
781}
782
783/**
784 * Operations for dealing with CSS properties.
785 */
786var CSSPropertyOperations = {
787 /**
788 * Serializes a mapping of style properties for use as inline styles:
789 *
790 * > createMarkupForStyles({width: '200px', height: 0})
791 * "width:200px;height:0;"
792 *
793 * Undefined values are ignored so that declarative programming is easier.
794 * The result should be HTML-escaped before insertion into the DOM.
795 *
796 * @param {object} styles
797 * @param {ReactDOMComponent} component
798 * @return {?string}
799 */
800 createMarkupForStyles: function (styles, component) {
801 var serialized = '';
802 for (var styleName in styles) {
803 if (!styles.hasOwnProperty(styleName)) {
804 continue;
805 }
806 var isCustomProperty = styleName.indexOf('--') === 0;
807 var styleValue = styles[styleName];
808 if ("development" !== 'production') {
809 if (!isCustomProperty) {
810 warnValidStyle(styleName, styleValue, component);
811 }
812 }
813 if (styleValue != null) {
814 serialized += processStyleName(styleName) + ':';
815 serialized += dangerousStyleValue(styleName, styleValue, component, isCustomProperty) + ';';
816 }
817 }
818 return serialized || null;
819 },
820
821 /**
822 * Sets the value for multiple styles on a node. If a value is specified as
823 * '' (empty string), the corresponding style property will be unset.
824 *
825 * @param {DOMElement} node
826 * @param {object} styles
827 * @param {ReactDOMComponent} component
828 */
829 setValueForStyles: function (node, styles, component) {
830 if ("development" !== 'production') {
831 ReactInstrumentation.debugTool.onHostOperation({
832 instanceID: component._debugID,
833 type: 'update styles',
834 payload: styles
835 });
836 }
837
838 var style = node.style;
839 for (var styleName in styles) {
840 if (!styles.hasOwnProperty(styleName)) {
841 continue;
842 }
843 var isCustomProperty = styleName.indexOf('--') === 0;
844 if ("development" !== 'production') {
845 if (!isCustomProperty) {
846 warnValidStyle(styleName, styles[styleName], component);
847 }
848 }
849 var styleValue = dangerousStyleValue(styleName, styles[styleName], component, isCustomProperty);
850 if (styleName === 'float' || styleName === 'cssFloat') {
851 styleName = styleFloatAccessor;
852 }
853 if (isCustomProperty) {
854 style.setProperty(styleName, styleValue);
855 } else if (styleValue) {
856 style[styleName] = styleValue;
857 } else {
858 var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName];
859 if (expansion) {
860 // Shorthand property that IE8 won't like unsetting, so unset each
861 // component to placate it
862 for (var individualStyleName in expansion) {
863 style[individualStyleName] = '';
864 }
865 } else {
866 style[styleName] = '';
867 }
868 }
869 }
870 }
871};
872
873module.exports = CSSPropertyOperations;
874},{"127":127,"129":129,"140":140,"144":144,"148":148,"4":4,"59":59,"99":99}],6:[function(_dereq_,module,exports){
875/**
876 * Copyright (c) 2013-present, Facebook, Inc.
877 *
878 * This source code is licensed under the MIT license found in the
879 * LICENSE file in the root directory of this source tree.
880 *
881 *
882 */
883
884'use strict';
885
886var _prodInvariant = _dereq_(116);
887
888function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
889
890var PooledClass = _dereq_(24);
891
892var invariant = _dereq_(141);
893
894/**
895 * A specialized pseudo-event module to help keep track of components waiting to
896 * be notified when their DOM representations are available for use.
897 *
898 * This implements `PooledClass`, so you should never need to instantiate this.
899 * Instead, use `CallbackQueue.getPooled()`.
900 *
901 * @class ReactMountReady
902 * @implements PooledClass
903 * @internal
904 */
905
906var CallbackQueue = function () {
907 function CallbackQueue(arg) {
908 _classCallCheck(this, CallbackQueue);
909
910 this._callbacks = null;
911 this._contexts = null;
912 this._arg = arg;
913 }
914
915 /**
916 * Enqueues a callback to be invoked when `notifyAll` is invoked.
917 *
918 * @param {function} callback Invoked when `notifyAll` is invoked.
919 * @param {?object} context Context to call `callback` with.
920 * @internal
921 */
922
923
924 CallbackQueue.prototype.enqueue = function enqueue(callback, context) {
925 this._callbacks = this._callbacks || [];
926 this._callbacks.push(callback);
927 this._contexts = this._contexts || [];
928 this._contexts.push(context);
929 };
930
931 /**
932 * Invokes all enqueued callbacks and clears the queue. This is invoked after
933 * the DOM representation of a component has been created or updated.
934 *
935 * @internal
936 */
937
938
939 CallbackQueue.prototype.notifyAll = function notifyAll() {
940 var callbacks = this._callbacks;
941 var contexts = this._contexts;
942 var arg = this._arg;
943 if (callbacks && contexts) {
944 !(callbacks.length === contexts.length) ? "development" !== 'production' ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0;
945 this._callbacks = null;
946 this._contexts = null;
947 for (var i = 0; i < callbacks.length; i++) {
948 callbacks[i].call(contexts[i], arg);
949 }
950 callbacks.length = 0;
951 contexts.length = 0;
952 }
953 };
954
955 CallbackQueue.prototype.checkpoint = function checkpoint() {
956 return this._callbacks ? this._callbacks.length : 0;
957 };
958
959 CallbackQueue.prototype.rollback = function rollback(len) {
960 if (this._callbacks && this._contexts) {
961 this._callbacks.length = len;
962 this._contexts.length = len;
963 }
964 };
965
966 /**
967 * Resets the internal queue.
968 *
969 * @internal
970 */
971
972
973 CallbackQueue.prototype.reset = function reset() {
974 this._callbacks = null;
975 this._contexts = null;
976 };
977
978 /**
979 * `PooledClass` looks for this.
980 */
981
982
983 CallbackQueue.prototype.destructor = function destructor() {
984 this.reset();
985 };
986
987 return CallbackQueue;
988}();
989
990module.exports = PooledClass.addPoolingTo(CallbackQueue);
991},{"116":116,"141":141,"24":24}],7:[function(_dereq_,module,exports){
992/**
993 * Copyright (c) 2013-present, Facebook, Inc.
994 *
995 * This source code is licensed under the MIT license found in the
996 * LICENSE file in the root directory of this source tree.
997 *
998 */
999
1000'use strict';
1001
1002var EventPluginHub = _dereq_(16);
1003var EventPropagators = _dereq_(19);
1004var ExecutionEnvironment = _dereq_(127);
1005var ReactDOMComponentTree = _dereq_(32);
1006var ReactUpdates = _dereq_(75);
1007var SyntheticEvent = _dereq_(84);
1008
1009var inputValueTracking = _dereq_(111);
1010var getEventTarget = _dereq_(106);
1011var isEventSupported = _dereq_(113);
1012var isTextInputElement = _dereq_(114);
1013
1014var eventTypes = {
1015 change: {
1016 phasedRegistrationNames: {
1017 bubbled: 'onChange',
1018 captured: 'onChangeCapture'
1019 },
1020 dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange']
1021 }
1022};
1023
1024function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
1025 var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, target);
1026 event.type = 'change';
1027 EventPropagators.accumulateTwoPhaseDispatches(event);
1028 return event;
1029}
1030/**
1031 * For IE shims
1032 */
1033var activeElement = null;
1034var activeElementInst = null;
1035
1036/**
1037 * SECTION: handle `change` event
1038 */
1039function shouldUseChangeEvent(elem) {
1040 var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
1041 return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
1042}
1043
1044var doesChangeEventBubble = false;
1045if (ExecutionEnvironment.canUseDOM) {
1046 // See `handleChange` comment below
1047 doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8);
1048}
1049
1050function manualDispatchChangeEvent(nativeEvent) {
1051 var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent));
1052
1053 // If change and propertychange bubbled, we'd just bind to it like all the
1054 // other events and have it go through ReactBrowserEventEmitter. Since it
1055 // doesn't, we manually listen for the events and so we have to enqueue and
1056 // process the abstract event manually.
1057 //
1058 // Batching is necessary here in order to ensure that all event handlers run
1059 // before the next rerender (including event handlers attached to ancestor
1060 // elements instead of directly on the input). Without this, controlled
1061 // components don't work properly in conjunction with event bubbling because
1062 // the component is rerendered and the value reverted before all the event
1063 // handlers can run. See https://github.com/facebook/react/issues/708.
1064 ReactUpdates.batchedUpdates(runEventInBatch, event);
1065}
1066
1067function runEventInBatch(event) {
1068 EventPluginHub.enqueueEvents(event);
1069 EventPluginHub.processEventQueue(false);
1070}
1071
1072function startWatchingForChangeEventIE8(target, targetInst) {
1073 activeElement = target;
1074 activeElementInst = targetInst;
1075 activeElement.attachEvent('onchange', manualDispatchChangeEvent);
1076}
1077
1078function stopWatchingForChangeEventIE8() {
1079 if (!activeElement) {
1080 return;
1081 }
1082 activeElement.detachEvent('onchange', manualDispatchChangeEvent);
1083 activeElement = null;
1084 activeElementInst = null;
1085}
1086
1087function getInstIfValueChanged(targetInst, nativeEvent) {
1088 var updated = inputValueTracking.updateValueIfChanged(targetInst);
1089 var simulated = nativeEvent.simulated === true && ChangeEventPlugin._allowSimulatedPassThrough;
1090
1091 if (updated || simulated) {
1092 return targetInst;
1093 }
1094}
1095
1096function getTargetInstForChangeEvent(topLevelType, targetInst) {
1097 if (topLevelType === 'topChange') {
1098 return targetInst;
1099 }
1100}
1101
1102function handleEventsForChangeEventIE8(topLevelType, target, targetInst) {
1103 if (topLevelType === 'topFocus') {
1104 // stopWatching() should be a noop here but we call it just in case we
1105 // missed a blur event somehow.
1106 stopWatchingForChangeEventIE8();
1107 startWatchingForChangeEventIE8(target, targetInst);
1108 } else if (topLevelType === 'topBlur') {
1109 stopWatchingForChangeEventIE8();
1110 }
1111}
1112
1113/**
1114 * SECTION: handle `input` event
1115 */
1116var isInputEventSupported = false;
1117if (ExecutionEnvironment.canUseDOM) {
1118 // IE9 claims to support the input event but fails to trigger it when
1119 // deleting text, so we ignore its input events.
1120
1121 isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
1122}
1123
1124/**
1125 * (For IE <=9) Starts tracking propertychange events on the passed-in element
1126 * and override the value property so that we can distinguish user events from
1127 * value changes in JS.
1128 */
1129function startWatchingForValueChange(target, targetInst) {
1130 activeElement = target;
1131 activeElementInst = targetInst;
1132 activeElement.attachEvent('onpropertychange', handlePropertyChange);
1133}
1134
1135/**
1136 * (For IE <=9) Removes the event listeners from the currently-tracked element,
1137 * if any exists.
1138 */
1139function stopWatchingForValueChange() {
1140 if (!activeElement) {
1141 return;
1142 }
1143 activeElement.detachEvent('onpropertychange', handlePropertyChange);
1144
1145 activeElement = null;
1146 activeElementInst = null;
1147}
1148
1149/**
1150 * (For IE <=9) Handles a propertychange event, sending a `change` event if
1151 * the value of the active element has changed.
1152 */
1153function handlePropertyChange(nativeEvent) {
1154 if (nativeEvent.propertyName !== 'value') {
1155 return;
1156 }
1157 if (getInstIfValueChanged(activeElementInst, nativeEvent)) {
1158 manualDispatchChangeEvent(nativeEvent);
1159 }
1160}
1161
1162function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
1163 if (topLevelType === 'topFocus') {
1164 // In IE8, we can capture almost all .value changes by adding a
1165 // propertychange handler and looking for events with propertyName
1166 // equal to 'value'
1167 // In IE9, propertychange fires for most input events but is buggy and
1168 // doesn't fire when text is deleted, but conveniently, selectionchange
1169 // appears to fire in all of the remaining cases so we catch those and
1170 // forward the event if the value has changed
1171 // In either case, we don't want to call the event handler if the value
1172 // is changed from JS so we redefine a setter for `.value` that updates
1173 // our activeElementValue variable, allowing us to ignore those changes
1174 //
1175 // stopWatching() should be a noop here but we call it just in case we
1176 // missed a blur event somehow.
1177 stopWatchingForValueChange();
1178 startWatchingForValueChange(target, targetInst);
1179 } else if (topLevelType === 'topBlur') {
1180 stopWatchingForValueChange();
1181 }
1182}
1183
1184// For IE8 and IE9.
1185function getTargetInstForInputEventPolyfill(topLevelType, targetInst, nativeEvent) {
1186 if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {
1187 // On the selectionchange event, the target is just document which isn't
1188 // helpful for us so just check activeElement instead.
1189 //
1190 // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
1191 // propertychange on the first input event after setting `value` from a
1192 // script and fires only keydown, keypress, keyup. Catching keyup usually
1193 // gets it and catching keydown lets us fire an event for the first
1194 // keystroke if user does a key repeat (it'll be a little delayed: right
1195 // before the second keystroke). Other input methods (e.g., paste) seem to
1196 // fire selectionchange normally.
1197 return getInstIfValueChanged(activeElementInst, nativeEvent);
1198 }
1199}
1200
1201/**
1202 * SECTION: handle `click` event
1203 */
1204function shouldUseClickEvent(elem) {
1205 // Use the `click` event to detect changes to checkbox and radio inputs.
1206 // This approach works across all browsers, whereas `change` does not fire
1207 // until `blur` in IE8.
1208 var nodeName = elem.nodeName;
1209 return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
1210}
1211
1212function getTargetInstForClickEvent(topLevelType, targetInst, nativeEvent) {
1213 if (topLevelType === 'topClick') {
1214 return getInstIfValueChanged(targetInst, nativeEvent);
1215 }
1216}
1217
1218function getTargetInstForInputOrChangeEvent(topLevelType, targetInst, nativeEvent) {
1219 if (topLevelType === 'topInput' || topLevelType === 'topChange') {
1220 return getInstIfValueChanged(targetInst, nativeEvent);
1221 }
1222}
1223
1224function handleControlledInputBlur(inst, node) {
1225 // TODO: In IE, inst is occasionally null. Why?
1226 if (inst == null) {
1227 return;
1228 }
1229
1230 // Fiber and ReactDOM keep wrapper state in separate places
1231 var state = inst._wrapperState || node._wrapperState;
1232
1233 if (!state || !state.controlled || node.type !== 'number') {
1234 return;
1235 }
1236
1237 // If controlled, assign the value attribute to the current value on blur
1238 var value = '' + node.value;
1239 if (node.getAttribute('value') !== value) {
1240 node.setAttribute('value', value);
1241 }
1242}
1243
1244/**
1245 * This plugin creates an `onChange` event that normalizes change events
1246 * across form elements. This event fires at a time when it's possible to
1247 * change the element's value without seeing a flicker.
1248 *
1249 * Supported elements are:
1250 * - input (see `isTextInputElement`)
1251 * - textarea
1252 * - select
1253 */
1254var ChangeEventPlugin = {
1255 eventTypes: eventTypes,
1256
1257 _allowSimulatedPassThrough: true,
1258 _isInputEventSupported: isInputEventSupported,
1259
1260 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
1261 var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
1262
1263 var getTargetInstFunc, handleEventFunc;
1264 if (shouldUseChangeEvent(targetNode)) {
1265 if (doesChangeEventBubble) {
1266 getTargetInstFunc = getTargetInstForChangeEvent;
1267 } else {
1268 handleEventFunc = handleEventsForChangeEventIE8;
1269 }
1270 } else if (isTextInputElement(targetNode)) {
1271 if (isInputEventSupported) {
1272 getTargetInstFunc = getTargetInstForInputOrChangeEvent;
1273 } else {
1274 getTargetInstFunc = getTargetInstForInputEventPolyfill;
1275 handleEventFunc = handleEventsForInputEventPolyfill;
1276 }
1277 } else if (shouldUseClickEvent(targetNode)) {
1278 getTargetInstFunc = getTargetInstForClickEvent;
1279 }
1280
1281 if (getTargetInstFunc) {
1282 var inst = getTargetInstFunc(topLevelType, targetInst, nativeEvent);
1283 if (inst) {
1284 var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
1285 return event;
1286 }
1287 }
1288
1289 if (handleEventFunc) {
1290 handleEventFunc(topLevelType, targetNode, targetInst);
1291 }
1292
1293 // When blurring, set the value attribute for number inputs
1294 if (topLevelType === 'topBlur') {
1295 handleControlledInputBlur(targetInst, targetNode);
1296 }
1297 }
1298};
1299
1300module.exports = ChangeEventPlugin;
1301},{"106":106,"111":111,"113":113,"114":114,"127":127,"16":16,"19":19,"32":32,"75":75,"84":84}],8:[function(_dereq_,module,exports){
1302/**
1303 * Copyright (c) 2013-present, Facebook, Inc.
1304 *
1305 * This source code is licensed under the MIT license found in the
1306 * LICENSE file in the root directory of this source tree.
1307 *
1308 */
1309
1310'use strict';
1311
1312var DOMLazyTree = _dereq_(9);
1313var Danger = _dereq_(13);
1314var ReactDOMComponentTree = _dereq_(32);
1315var ReactInstrumentation = _dereq_(59);
1316
1317var createMicrosoftUnsafeLocalFunction = _dereq_(98);
1318var setInnerHTML = _dereq_(117);
1319var setTextContent = _dereq_(118);
1320
1321function getNodeAfter(parentNode, node) {
1322 // Special case for text components, which return [open, close] comments
1323 // from getHostNode.
1324 if (Array.isArray(node)) {
1325 node = node[1];
1326 }
1327 return node ? node.nextSibling : parentNode.firstChild;
1328}
1329
1330/**
1331 * Inserts `childNode` as a child of `parentNode` at the `index`.
1332 *
1333 * @param {DOMElement} parentNode Parent node in which to insert.
1334 * @param {DOMElement} childNode Child node to insert.
1335 * @param {number} index Index at which to insert the child.
1336 * @internal
1337 */
1338var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) {
1339 // We rely exclusively on `insertBefore(node, null)` instead of also using
1340 // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so
1341 // we are careful to use `null`.)
1342 parentNode.insertBefore(childNode, referenceNode);
1343});
1344
1345function insertLazyTreeChildAt(parentNode, childTree, referenceNode) {
1346 DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode);
1347}
1348
1349function moveChild(parentNode, childNode, referenceNode) {
1350 if (Array.isArray(childNode)) {
1351 moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode);
1352 } else {
1353 insertChildAt(parentNode, childNode, referenceNode);
1354 }
1355}
1356
1357function removeChild(parentNode, childNode) {
1358 if (Array.isArray(childNode)) {
1359 var closingComment = childNode[1];
1360 childNode = childNode[0];
1361 removeDelimitedText(parentNode, childNode, closingComment);
1362 parentNode.removeChild(closingComment);
1363 }
1364 parentNode.removeChild(childNode);
1365}
1366
1367function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) {
1368 var node = openingComment;
1369 while (true) {
1370 var nextNode = node.nextSibling;
1371 insertChildAt(parentNode, node, referenceNode);
1372 if (node === closingComment) {
1373 break;
1374 }
1375 node = nextNode;
1376 }
1377}
1378
1379function removeDelimitedText(parentNode, startNode, closingComment) {
1380 while (true) {
1381 var node = startNode.nextSibling;
1382 if (node === closingComment) {
1383 // The closing comment is removed by ReactMultiChild.
1384 break;
1385 } else {
1386 parentNode.removeChild(node);
1387 }
1388 }
1389}
1390
1391function replaceDelimitedText(openingComment, closingComment, stringText) {
1392 var parentNode = openingComment.parentNode;
1393 var nodeAfterComment = openingComment.nextSibling;
1394 if (nodeAfterComment === closingComment) {
1395 // There are no text nodes between the opening and closing comments; insert
1396 // a new one if stringText isn't empty.
1397 if (stringText) {
1398 insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment);
1399 }
1400 } else {
1401 if (stringText) {
1402 // Set the text content of the first node after the opening comment, and
1403 // remove all following nodes up until the closing comment.
1404 setTextContent(nodeAfterComment, stringText);
1405 removeDelimitedText(parentNode, nodeAfterComment, closingComment);
1406 } else {
1407 removeDelimitedText(parentNode, openingComment, closingComment);
1408 }
1409 }
1410
1411 if ("development" !== 'production') {
1412 ReactInstrumentation.debugTool.onHostOperation({
1413 instanceID: ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID,
1414 type: 'replace text',
1415 payload: stringText
1416 });
1417 }
1418}
1419
1420var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup;
1421if ("development" !== 'production') {
1422 dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) {
1423 Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup);
1424 if (prevInstance._debugID !== 0) {
1425 ReactInstrumentation.debugTool.onHostOperation({
1426 instanceID: prevInstance._debugID,
1427 type: 'replace with',
1428 payload: markup.toString()
1429 });
1430 } else {
1431 var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node);
1432 if (nextInstance._debugID !== 0) {
1433 ReactInstrumentation.debugTool.onHostOperation({
1434 instanceID: nextInstance._debugID,
1435 type: 'mount',
1436 payload: markup.toString()
1437 });
1438 }
1439 }
1440 };
1441}
1442
1443/**
1444 * Operations for updating with DOM children.
1445 */
1446var DOMChildrenOperations = {
1447 dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup,
1448
1449 replaceDelimitedText: replaceDelimitedText,
1450
1451 /**
1452 * Updates a component's children by processing a series of updates. The
1453 * update configurations are each expected to have a `parentNode` property.
1454 *
1455 * @param {array<object>} updates List of update configurations.
1456 * @internal
1457 */
1458 processUpdates: function (parentNode, updates) {
1459 if ("development" !== 'production') {
1460 var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID;
1461 }
1462
1463 for (var k = 0; k < updates.length; k++) {
1464 var update = updates[k];
1465 switch (update.type) {
1466 case 'INSERT_MARKUP':
1467 insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode));
1468 if ("development" !== 'production') {
1469 ReactInstrumentation.debugTool.onHostOperation({
1470 instanceID: parentNodeDebugID,
1471 type: 'insert child',
1472 payload: {
1473 toIndex: update.toIndex,
1474 content: update.content.toString()
1475 }
1476 });
1477 }
1478 break;
1479 case 'MOVE_EXISTING':
1480 moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode));
1481 if ("development" !== 'production') {
1482 ReactInstrumentation.debugTool.onHostOperation({
1483 instanceID: parentNodeDebugID,
1484 type: 'move child',
1485 payload: { fromIndex: update.fromIndex, toIndex: update.toIndex }
1486 });
1487 }
1488 break;
1489 case 'SET_MARKUP':
1490 setInnerHTML(parentNode, update.content);
1491 if ("development" !== 'production') {
1492 ReactInstrumentation.debugTool.onHostOperation({
1493 instanceID: parentNodeDebugID,
1494 type: 'replace children',
1495 payload: update.content.toString()
1496 });
1497 }
1498 break;
1499 case 'TEXT_CONTENT':
1500 setTextContent(parentNode, update.content);
1501 if ("development" !== 'production') {
1502 ReactInstrumentation.debugTool.onHostOperation({
1503 instanceID: parentNodeDebugID,
1504 type: 'replace text',
1505 payload: update.content.toString()
1506 });
1507 }
1508 break;
1509 case 'REMOVE_NODE':
1510 removeChild(parentNode, update.fromNode);
1511 if ("development" !== 'production') {
1512 ReactInstrumentation.debugTool.onHostOperation({
1513 instanceID: parentNodeDebugID,
1514 type: 'remove child',
1515 payload: { fromIndex: update.fromIndex }
1516 });
1517 }
1518 break;
1519 }
1520 }
1521 }
1522};
1523
1524module.exports = DOMChildrenOperations;
1525},{"117":117,"118":118,"13":13,"32":32,"59":59,"9":9,"98":98}],9:[function(_dereq_,module,exports){
1526/**
1527 * Copyright (c) 2015-present, Facebook, Inc.
1528 *
1529 * This source code is licensed under the MIT license found in the
1530 * LICENSE file in the root directory of this source tree.
1531 *
1532 */
1533
1534'use strict';
1535
1536var DOMNamespaces = _dereq_(10);
1537var setInnerHTML = _dereq_(117);
1538
1539var createMicrosoftUnsafeLocalFunction = _dereq_(98);
1540var setTextContent = _dereq_(118);
1541
1542var ELEMENT_NODE_TYPE = 1;
1543var DOCUMENT_FRAGMENT_NODE_TYPE = 11;
1544
1545/**
1546 * In IE (8-11) and Edge, appending nodes with no children is dramatically
1547 * faster than appending a full subtree, so we essentially queue up the
1548 * .appendChild calls here and apply them so each node is added to its parent
1549 * before any children are added.
1550 *
1551 * In other browsers, doing so is slower or neutral compared to the other order
1552 * (in Firefox, twice as slow) so we only do this inversion in IE.
1553 *
1554 * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode.
1555 */
1556var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent);
1557
1558function insertTreeChildren(tree) {
1559 if (!enableLazy) {
1560 return;
1561 }
1562 var node = tree.node;
1563 var children = tree.children;
1564 if (children.length) {
1565 for (var i = 0; i < children.length; i++) {
1566 insertTreeBefore(node, children[i], null);
1567 }
1568 } else if (tree.html != null) {
1569 setInnerHTML(node, tree.html);
1570 } else if (tree.text != null) {
1571 setTextContent(node, tree.text);
1572 }
1573}
1574
1575var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) {
1576 // DocumentFragments aren't actually part of the DOM after insertion so
1577 // appending children won't update the DOM. We need to ensure the fragment
1578 // is properly populated first, breaking out of our lazy approach for just
1579 // this level. Also, some <object> plugins (like Flash Player) will read
1580 // <param> nodes immediately upon insertion into the DOM, so <object>
1581 // must also be populated prior to insertion into the DOM.
1582 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)) {
1583 insertTreeChildren(tree);
1584 parentNode.insertBefore(tree.node, referenceNode);
1585 } else {
1586 parentNode.insertBefore(tree.node, referenceNode);
1587 insertTreeChildren(tree);
1588 }
1589});
1590
1591function replaceChildWithTree(oldNode, newTree) {
1592 oldNode.parentNode.replaceChild(newTree.node, oldNode);
1593 insertTreeChildren(newTree);
1594}
1595
1596function queueChild(parentTree, childTree) {
1597 if (enableLazy) {
1598 parentTree.children.push(childTree);
1599 } else {
1600 parentTree.node.appendChild(childTree.node);
1601 }
1602}
1603
1604function queueHTML(tree, html) {
1605 if (enableLazy) {
1606 tree.html = html;
1607 } else {
1608 setInnerHTML(tree.node, html);
1609 }
1610}
1611
1612function queueText(tree, text) {
1613 if (enableLazy) {
1614 tree.text = text;
1615 } else {
1616 setTextContent(tree.node, text);
1617 }
1618}
1619
1620function toString() {
1621 return this.node.nodeName;
1622}
1623
1624function DOMLazyTree(node) {
1625 return {
1626 node: node,
1627 children: [],
1628 html: null,
1629 text: null,
1630 toString: toString
1631 };
1632}
1633
1634DOMLazyTree.insertTreeBefore = insertTreeBefore;
1635DOMLazyTree.replaceChildWithTree = replaceChildWithTree;
1636DOMLazyTree.queueChild = queueChild;
1637DOMLazyTree.queueHTML = queueHTML;
1638DOMLazyTree.queueText = queueText;
1639
1640module.exports = DOMLazyTree;
1641},{"10":10,"117":117,"118":118,"98":98}],10:[function(_dereq_,module,exports){
1642/**
1643 * Copyright (c) 2013-present, Facebook, Inc.
1644 *
1645 * This source code is licensed under the MIT license found in the
1646 * LICENSE file in the root directory of this source tree.
1647 *
1648 */
1649
1650'use strict';
1651
1652var DOMNamespaces = {
1653 html: 'http://www.w3.org/1999/xhtml',
1654 mathml: 'http://www.w3.org/1998/Math/MathML',
1655 svg: 'http://www.w3.org/2000/svg'
1656};
1657
1658module.exports = DOMNamespaces;
1659},{}],11:[function(_dereq_,module,exports){
1660/**
1661 * Copyright (c) 2013-present, Facebook, Inc.
1662 *
1663 * This source code is licensed under the MIT license found in the
1664 * LICENSE file in the root directory of this source tree.
1665 *
1666 */
1667
1668'use strict';
1669
1670var _prodInvariant = _dereq_(116);
1671
1672var invariant = _dereq_(141);
1673
1674function checkMask(value, bitmask) {
1675 return (value & bitmask) === bitmask;
1676}
1677
1678var DOMPropertyInjection = {
1679 /**
1680 * Mapping from normalized, camelcased property names to a configuration that
1681 * specifies how the associated DOM property should be accessed or rendered.
1682 */
1683 MUST_USE_PROPERTY: 0x1,
1684 HAS_BOOLEAN_VALUE: 0x4,
1685 HAS_NUMERIC_VALUE: 0x8,
1686 HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,
1687 HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,
1688
1689 /**
1690 * Inject some specialized knowledge about the DOM. This takes a config object
1691 * with the following properties:
1692 *
1693 * isCustomAttribute: function that given an attribute name will return true
1694 * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*
1695 * attributes where it's impossible to enumerate all of the possible
1696 * attribute names,
1697 *
1698 * Properties: object mapping DOM property name to one of the
1699 * DOMPropertyInjection constants or null. If your attribute isn't in here,
1700 * it won't get written to the DOM.
1701 *
1702 * DOMAttributeNames: object mapping React attribute name to the DOM
1703 * attribute name. Attribute names not specified use the **lowercase**
1704 * normalized name.
1705 *
1706 * DOMAttributeNamespaces: object mapping React attribute name to the DOM
1707 * attribute namespace URL. (Attribute names not specified use no namespace.)
1708 *
1709 * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.
1710 * Property names not specified use the normalized name.
1711 *
1712 * DOMMutationMethods: Properties that require special mutation methods. If
1713 * `value` is undefined, the mutation method should unset the property.
1714 *
1715 * @param {object} domPropertyConfig the config as described above.
1716 */
1717 injectDOMPropertyConfig: function (domPropertyConfig) {
1718 var Injection = DOMPropertyInjection;
1719 var Properties = domPropertyConfig.Properties || {};
1720 var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};
1721 var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};
1722 var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};
1723 var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};
1724
1725 if (domPropertyConfig.isCustomAttribute) {
1726 DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);
1727 }
1728
1729 for (var propName in Properties) {
1730 !!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;
1731
1732 var lowerCased = propName.toLowerCase();
1733 var propConfig = Properties[propName];
1734
1735 var propertyInfo = {
1736 attributeName: lowerCased,
1737 attributeNamespace: null,
1738 propertyName: propName,
1739 mutationMethod: null,
1740
1741 mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),
1742 hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),
1743 hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),
1744 hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),
1745 hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)
1746 };
1747 !(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;
1748
1749 if ("development" !== 'production') {
1750 DOMProperty.getPossibleStandardName[lowerCased] = propName;
1751 }
1752
1753 if (DOMAttributeNames.hasOwnProperty(propName)) {
1754 var attributeName = DOMAttributeNames[propName];
1755 propertyInfo.attributeName = attributeName;
1756 if ("development" !== 'production') {
1757 DOMProperty.getPossibleStandardName[attributeName] = propName;
1758 }
1759 }
1760
1761 if (DOMAttributeNamespaces.hasOwnProperty(propName)) {
1762 propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];
1763 }
1764
1765 if (DOMPropertyNames.hasOwnProperty(propName)) {
1766 propertyInfo.propertyName = DOMPropertyNames[propName];
1767 }
1768
1769 if (DOMMutationMethods.hasOwnProperty(propName)) {
1770 propertyInfo.mutationMethod = DOMMutationMethods[propName];
1771 }
1772
1773 DOMProperty.properties[propName] = propertyInfo;
1774 }
1775 }
1776};
1777
1778/* eslint-disable max-len */
1779var 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';
1780/* eslint-enable max-len */
1781
1782/**
1783 * DOMProperty exports lookup objects that can be used like functions:
1784 *
1785 * > DOMProperty.isValid['id']
1786 * true
1787 * > DOMProperty.isValid['foobar']
1788 * undefined
1789 *
1790 * Although this may be confusing, it performs better in general.
1791 *
1792 * @see http://jsperf.com/key-exists
1793 * @see http://jsperf.com/key-missing
1794 */
1795var DOMProperty = {
1796 ID_ATTRIBUTE_NAME: 'data-reactid',
1797 ROOT_ATTRIBUTE_NAME: 'data-reactroot',
1798
1799 ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,
1800 ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040',
1801
1802 /**
1803 * Map from property "standard name" to an object with info about how to set
1804 * the property in the DOM. Each object contains:
1805 *
1806 * attributeName:
1807 * Used when rendering markup or with `*Attribute()`.
1808 * attributeNamespace
1809 * propertyName:
1810 * Used on DOM node instances. (This includes properties that mutate due to
1811 * external factors.)
1812 * mutationMethod:
1813 * If non-null, used instead of the property or `setAttribute()` after
1814 * initial render.
1815 * mustUseProperty:
1816 * Whether the property must be accessed and mutated as an object property.
1817 * hasBooleanValue:
1818 * Whether the property should be removed when set to a falsey value.
1819 * hasNumericValue:
1820 * Whether the property must be numeric or parse as a numeric and should be
1821 * removed when set to a falsey value.
1822 * hasPositiveNumericValue:
1823 * Whether the property must be positive numeric or parse as a positive
1824 * numeric and should be removed when set to a falsey value.
1825 * hasOverloadedBooleanValue:
1826 * Whether the property can be used as a flag as well as with a value.
1827 * Removed when strictly equal to false; present without a value when
1828 * strictly equal to true; present with a value otherwise.
1829 */
1830 properties: {},
1831
1832 /**
1833 * Mapping from lowercase property names to the properly cased version, used
1834 * to warn in the case of missing properties. Available only in __DEV__.
1835 *
1836 * autofocus is predefined, because adding it to the property whitelist
1837 * causes unintended side effects.
1838 *
1839 * @type {Object}
1840 */
1841 getPossibleStandardName: "development" !== 'production' ? { autofocus: 'autoFocus' } : null,
1842
1843 /**
1844 * All of the isCustomAttribute() functions that have been injected.
1845 */
1846 _isCustomAttributeFunctions: [],
1847
1848 /**
1849 * Checks whether a property name is a custom attribute.
1850 * @method
1851 */
1852 isCustomAttribute: function (attributeName) {
1853 for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {
1854 var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];
1855 if (isCustomAttributeFn(attributeName)) {
1856 return true;
1857 }
1858 }
1859 return false;
1860 },
1861
1862 injection: DOMPropertyInjection
1863};
1864
1865module.exports = DOMProperty;
1866},{"116":116,"141":141}],12:[function(_dereq_,module,exports){
1867/**
1868 * Copyright (c) 2013-present, Facebook, Inc.
1869 *
1870 * This source code is licensed under the MIT license found in the
1871 * LICENSE file in the root directory of this source tree.
1872 *
1873 */
1874
1875'use strict';
1876
1877var DOMProperty = _dereq_(11);
1878var ReactDOMComponentTree = _dereq_(32);
1879var ReactInstrumentation = _dereq_(59);
1880
1881var quoteAttributeValueForBrowser = _dereq_(115);
1882var warning = _dereq_(148);
1883
1884var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');
1885var illegalAttributeNameCache = {};
1886var validatedAttributeNameCache = {};
1887
1888function isAttributeNameSafe(attributeName) {
1889 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
1890 return true;
1891 }
1892 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
1893 return false;
1894 }
1895 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
1896 validatedAttributeNameCache[attributeName] = true;
1897 return true;
1898 }
1899 illegalAttributeNameCache[attributeName] = true;
1900 "development" !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
1901 return false;
1902}
1903
1904function shouldIgnoreValue(propertyInfo, value) {
1905 return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;
1906}
1907
1908/**
1909 * Operations for dealing with DOM properties.
1910 */
1911var DOMPropertyOperations = {
1912 /**
1913 * Creates markup for the ID property.
1914 *
1915 * @param {string} id Unescaped ID.
1916 * @return {string} Markup string.
1917 */
1918 createMarkupForID: function (id) {
1919 return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);
1920 },
1921
1922 setAttributeForID: function (node, id) {
1923 node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);
1924 },
1925
1926 createMarkupForRoot: function () {
1927 return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""';
1928 },
1929
1930 setAttributeForRoot: function (node) {
1931 node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');
1932 },
1933
1934 /**
1935 * Creates markup for a property.
1936 *
1937 * @param {string} name
1938 * @param {*} value
1939 * @return {?string} Markup string, or null if the property was invalid.
1940 */
1941 createMarkupForProperty: function (name, value) {
1942 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1943 if (propertyInfo) {
1944 if (shouldIgnoreValue(propertyInfo, value)) {
1945 return '';
1946 }
1947 var attributeName = propertyInfo.attributeName;
1948 if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
1949 return attributeName + '=""';
1950 }
1951 return attributeName + '=' + quoteAttributeValueForBrowser(value);
1952 } else if (DOMProperty.isCustomAttribute(name)) {
1953 if (value == null) {
1954 return '';
1955 }
1956 return name + '=' + quoteAttributeValueForBrowser(value);
1957 }
1958 return null;
1959 },
1960
1961 /**
1962 * Creates markup for a custom property.
1963 *
1964 * @param {string} name
1965 * @param {*} value
1966 * @return {string} Markup string, or empty string if the property was invalid.
1967 */
1968 createMarkupForCustomAttribute: function (name, value) {
1969 if (!isAttributeNameSafe(name) || value == null) {
1970 return '';
1971 }
1972 return name + '=' + quoteAttributeValueForBrowser(value);
1973 },
1974
1975 /**
1976 * Sets the value for a property on a node.
1977 *
1978 * @param {DOMElement} node
1979 * @param {string} name
1980 * @param {*} value
1981 */
1982 setValueForProperty: function (node, name, value) {
1983 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
1984 if (propertyInfo) {
1985 var mutationMethod = propertyInfo.mutationMethod;
1986 if (mutationMethod) {
1987 mutationMethod(node, value);
1988 } else if (shouldIgnoreValue(propertyInfo, value)) {
1989 this.deleteValueForProperty(node, name);
1990 return;
1991 } else if (propertyInfo.mustUseProperty) {
1992 // Contrary to `setAttribute`, object properties are properly
1993 // `toString`ed by IE8/9.
1994 node[propertyInfo.propertyName] = value;
1995 } else {
1996 var attributeName = propertyInfo.attributeName;
1997 var namespace = propertyInfo.attributeNamespace;
1998 // `setAttribute` with objects becomes only `[object]` in IE8/9,
1999 // ('' + value) makes it output the correct toString()-value.
2000 if (namespace) {
2001 node.setAttributeNS(namespace, attributeName, '' + value);
2002 } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {
2003 node.setAttribute(attributeName, '');
2004 } else {
2005 node.setAttribute(attributeName, '' + value);
2006 }
2007 }
2008 } else if (DOMProperty.isCustomAttribute(name)) {
2009 DOMPropertyOperations.setValueForAttribute(node, name, value);
2010 return;
2011 }
2012
2013 if ("development" !== 'production') {
2014 var payload = {};
2015 payload[name] = value;
2016 ReactInstrumentation.debugTool.onHostOperation({
2017 instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
2018 type: 'update attribute',
2019 payload: payload
2020 });
2021 }
2022 },
2023
2024 setValueForAttribute: function (node, name, value) {
2025 if (!isAttributeNameSafe(name)) {
2026 return;
2027 }
2028 if (value == null) {
2029 node.removeAttribute(name);
2030 } else {
2031 node.setAttribute(name, '' + value);
2032 }
2033
2034 if ("development" !== 'production') {
2035 var payload = {};
2036 payload[name] = value;
2037 ReactInstrumentation.debugTool.onHostOperation({
2038 instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
2039 type: 'update attribute',
2040 payload: payload
2041 });
2042 }
2043 },
2044
2045 /**
2046 * Deletes an attributes from a node.
2047 *
2048 * @param {DOMElement} node
2049 * @param {string} name
2050 */
2051 deleteValueForAttribute: function (node, name) {
2052 node.removeAttribute(name);
2053 if ("development" !== 'production') {
2054 ReactInstrumentation.debugTool.onHostOperation({
2055 instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
2056 type: 'remove attribute',
2057 payload: name
2058 });
2059 }
2060 },
2061
2062 /**
2063 * Deletes the value for a property on a node.
2064 *
2065 * @param {DOMElement} node
2066 * @param {string} name
2067 */
2068 deleteValueForProperty: function (node, name) {
2069 var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;
2070 if (propertyInfo) {
2071 var mutationMethod = propertyInfo.mutationMethod;
2072 if (mutationMethod) {
2073 mutationMethod(node, undefined);
2074 } else if (propertyInfo.mustUseProperty) {
2075 var propName = propertyInfo.propertyName;
2076 if (propertyInfo.hasBooleanValue) {
2077 node[propName] = false;
2078 } else {
2079 node[propName] = '';
2080 }
2081 } else {
2082 node.removeAttribute(propertyInfo.attributeName);
2083 }
2084 } else if (DOMProperty.isCustomAttribute(name)) {
2085 node.removeAttribute(name);
2086 }
2087
2088 if ("development" !== 'production') {
2089 ReactInstrumentation.debugTool.onHostOperation({
2090 instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,
2091 type: 'remove attribute',
2092 payload: name
2093 });
2094 }
2095 }
2096};
2097
2098module.exports = DOMPropertyOperations;
2099},{"11":11,"115":115,"148":148,"32":32,"59":59}],13:[function(_dereq_,module,exports){
2100/**
2101 * Copyright (c) 2013-present, Facebook, Inc.
2102 *
2103 * This source code is licensed under the MIT license found in the
2104 * LICENSE file in the root directory of this source tree.
2105 *
2106 */
2107
2108'use strict';
2109
2110var _prodInvariant = _dereq_(116);
2111
2112var DOMLazyTree = _dereq_(9);
2113var ExecutionEnvironment = _dereq_(127);
2114
2115var createNodesFromMarkup = _dereq_(132);
2116var emptyFunction = _dereq_(133);
2117var invariant = _dereq_(141);
2118
2119var Danger = {
2120 /**
2121 * Replaces a node with a string of markup at its current position within its
2122 * parent. The markup must render into a single root node.
2123 *
2124 * @param {DOMElement} oldChild Child node to replace.
2125 * @param {string} markup Markup to render in place of the child node.
2126 * @internal
2127 */
2128 dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) {
2129 !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;
2130 !markup ? "development" !== 'production' ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0;
2131 !(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;
2132
2133 if (typeof markup === 'string') {
2134 var newChild = createNodesFromMarkup(markup, emptyFunction)[0];
2135 oldChild.parentNode.replaceChild(newChild, oldChild);
2136 } else {
2137 DOMLazyTree.replaceChildWithTree(oldChild, markup);
2138 }
2139 }
2140};
2141
2142module.exports = Danger;
2143},{"116":116,"127":127,"132":132,"133":133,"141":141,"9":9}],14:[function(_dereq_,module,exports){
2144/**
2145 * Copyright (c) 2013-present, Facebook, Inc.
2146 *
2147 * This source code is licensed under the MIT license found in the
2148 * LICENSE file in the root directory of this source tree.
2149 *
2150 */
2151
2152'use strict';
2153
2154/**
2155 * Module that is injectable into `EventPluginHub`, that specifies a
2156 * deterministic ordering of `EventPlugin`s. A convenient way to reason about
2157 * plugins, without having to package every one of them. This is better than
2158 * having plugins be ordered in the same order that they are injected because
2159 * that ordering would be influenced by the packaging order.
2160 * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
2161 * preventing default on events is convenient in `SimpleEventPlugin` handlers.
2162 */
2163
2164var DefaultEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
2165
2166module.exports = DefaultEventPluginOrder;
2167},{}],15:[function(_dereq_,module,exports){
2168/**
2169 * Copyright (c) 2013-present, Facebook, Inc.
2170 *
2171 * This source code is licensed under the MIT license found in the
2172 * LICENSE file in the root directory of this source tree.
2173 *
2174 */
2175
2176'use strict';
2177
2178var EventPropagators = _dereq_(19);
2179var ReactDOMComponentTree = _dereq_(32);
2180var SyntheticMouseEvent = _dereq_(88);
2181
2182var eventTypes = {
2183 mouseEnter: {
2184 registrationName: 'onMouseEnter',
2185 dependencies: ['topMouseOut', 'topMouseOver']
2186 },
2187 mouseLeave: {
2188 registrationName: 'onMouseLeave',
2189 dependencies: ['topMouseOut', 'topMouseOver']
2190 }
2191};
2192
2193var EnterLeaveEventPlugin = {
2194 eventTypes: eventTypes,
2195
2196 /**
2197 * For almost every interaction we care about, there will be both a top-level
2198 * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
2199 * we do not extract duplicate events. However, moving the mouse into the
2200 * browser from outside will not fire a `mouseout` event. In this case, we use
2201 * the `mouseover` top-level event.
2202 */
2203 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2204 if (topLevelType === 'topMouseOver' && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
2205 return null;
2206 }
2207 if (topLevelType !== 'topMouseOut' && topLevelType !== 'topMouseOver') {
2208 // Must not be a mouse in or mouse out - ignoring.
2209 return null;
2210 }
2211
2212 var win;
2213 if (nativeEventTarget.window === nativeEventTarget) {
2214 // `nativeEventTarget` is probably a window object.
2215 win = nativeEventTarget;
2216 } else {
2217 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
2218 var doc = nativeEventTarget.ownerDocument;
2219 if (doc) {
2220 win = doc.defaultView || doc.parentWindow;
2221 } else {
2222 win = window;
2223 }
2224 }
2225
2226 var from;
2227 var to;
2228 if (topLevelType === 'topMouseOut') {
2229 from = targetInst;
2230 var related = nativeEvent.relatedTarget || nativeEvent.toElement;
2231 to = related ? ReactDOMComponentTree.getClosestInstanceFromNode(related) : null;
2232 } else {
2233 // Moving to a node from outside the window.
2234 from = null;
2235 to = targetInst;
2236 }
2237
2238 if (from === to) {
2239 // Nothing pertains to our managed components.
2240 return null;
2241 }
2242
2243 var fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from);
2244 var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to);
2245
2246 var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget);
2247 leave.type = 'mouseleave';
2248 leave.target = fromNode;
2249 leave.relatedTarget = toNode;
2250
2251 var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget);
2252 enter.type = 'mouseenter';
2253 enter.target = toNode;
2254 enter.relatedTarget = fromNode;
2255
2256 EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to);
2257
2258 return [leave, enter];
2259 }
2260};
2261
2262module.exports = EnterLeaveEventPlugin;
2263},{"19":19,"32":32,"88":88}],16:[function(_dereq_,module,exports){
2264/**
2265 * Copyright (c) 2013-present, Facebook, Inc.
2266 *
2267 * This source code is licensed under the MIT license found in the
2268 * LICENSE file in the root directory of this source tree.
2269 *
2270 */
2271
2272'use strict';
2273
2274var _prodInvariant = _dereq_(116);
2275
2276var EventPluginRegistry = _dereq_(17);
2277var EventPluginUtils = _dereq_(18);
2278var ReactErrorUtils = _dereq_(50);
2279
2280var accumulateInto = _dereq_(95);
2281var forEachAccumulated = _dereq_(102);
2282var invariant = _dereq_(141);
2283
2284/**
2285 * Internal store for event listeners
2286 */
2287var listenerBank = {};
2288
2289/**
2290 * Internal queue of events that have accumulated their dispatches and are
2291 * waiting to have their dispatches executed.
2292 */
2293var eventQueue = null;
2294
2295/**
2296 * Dispatches an event and releases it back into the pool, unless persistent.
2297 *
2298 * @param {?object} event Synthetic event to be dispatched.
2299 * @param {boolean} simulated If the event is simulated (changes exn behavior)
2300 * @private
2301 */
2302var executeDispatchesAndRelease = function (event, simulated) {
2303 if (event) {
2304 EventPluginUtils.executeDispatchesInOrder(event, simulated);
2305
2306 if (!event.isPersistent()) {
2307 event.constructor.release(event);
2308 }
2309 }
2310};
2311var executeDispatchesAndReleaseSimulated = function (e) {
2312 return executeDispatchesAndRelease(e, true);
2313};
2314var executeDispatchesAndReleaseTopLevel = function (e) {
2315 return executeDispatchesAndRelease(e, false);
2316};
2317
2318var getDictionaryKey = function (inst) {
2319 // Prevents V8 performance issue:
2320 // https://github.com/facebook/react/pull/7232
2321 return '.' + inst._rootNodeID;
2322};
2323
2324function isInteractive(tag) {
2325 return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
2326}
2327
2328function shouldPreventMouseEvent(name, type, props) {
2329 switch (name) {
2330 case 'onClick':
2331 case 'onClickCapture':
2332 case 'onDoubleClick':
2333 case 'onDoubleClickCapture':
2334 case 'onMouseDown':
2335 case 'onMouseDownCapture':
2336 case 'onMouseMove':
2337 case 'onMouseMoveCapture':
2338 case 'onMouseUp':
2339 case 'onMouseUpCapture':
2340 return !!(props.disabled && isInteractive(type));
2341 default:
2342 return false;
2343 }
2344}
2345
2346/**
2347 * This is a unified interface for event plugins to be installed and configured.
2348 *
2349 * Event plugins can implement the following properties:
2350 *
2351 * `extractEvents` {function(string, DOMEventTarget, string, object): *}
2352 * Required. When a top-level event is fired, this method is expected to
2353 * extract synthetic events that will in turn be queued and dispatched.
2354 *
2355 * `eventTypes` {object}
2356 * Optional, plugins that fire events must publish a mapping of registration
2357 * names that are used to register listeners. Values of this mapping must
2358 * be objects that contain `registrationName` or `phasedRegistrationNames`.
2359 *
2360 * `executeDispatch` {function(object, function, string)}
2361 * Optional, allows plugins to override how an event gets dispatched. By
2362 * default, the listener is simply invoked.
2363 *
2364 * Each plugin that is injected into `EventsPluginHub` is immediately operable.
2365 *
2366 * @public
2367 */
2368var EventPluginHub = {
2369 /**
2370 * Methods for injecting dependencies.
2371 */
2372 injection: {
2373 /**
2374 * @param {array} InjectedEventPluginOrder
2375 * @public
2376 */
2377 injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder,
2378
2379 /**
2380 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
2381 */
2382 injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName
2383 },
2384
2385 /**
2386 * Stores `listener` at `listenerBank[registrationName][key]`. Is idempotent.
2387 *
2388 * @param {object} inst The instance, which is the source of events.
2389 * @param {string} registrationName Name of listener (e.g. `onClick`).
2390 * @param {function} listener The callback to store.
2391 */
2392 putListener: function (inst, registrationName, listener) {
2393 !(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;
2394
2395 var key = getDictionaryKey(inst);
2396 var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {});
2397 bankForRegistrationName[key] = listener;
2398
2399 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2400 if (PluginModule && PluginModule.didPutListener) {
2401 PluginModule.didPutListener(inst, registrationName, listener);
2402 }
2403 },
2404
2405 /**
2406 * @param {object} inst The instance, which is the source of events.
2407 * @param {string} registrationName Name of listener (e.g. `onClick`).
2408 * @return {?function} The stored callback.
2409 */
2410 getListener: function (inst, registrationName) {
2411 // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
2412 // live here; needs to be moved to a better place soon
2413 var bankForRegistrationName = listenerBank[registrationName];
2414 if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, inst._currentElement.props)) {
2415 return null;
2416 }
2417 var key = getDictionaryKey(inst);
2418 return bankForRegistrationName && bankForRegistrationName[key];
2419 },
2420
2421 /**
2422 * Deletes a listener from the registration bank.
2423 *
2424 * @param {object} inst The instance, which is the source of events.
2425 * @param {string} registrationName Name of listener (e.g. `onClick`).
2426 */
2427 deleteListener: function (inst, registrationName) {
2428 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2429 if (PluginModule && PluginModule.willDeleteListener) {
2430 PluginModule.willDeleteListener(inst, registrationName);
2431 }
2432
2433 var bankForRegistrationName = listenerBank[registrationName];
2434 // TODO: This should never be null -- when is it?
2435 if (bankForRegistrationName) {
2436 var key = getDictionaryKey(inst);
2437 delete bankForRegistrationName[key];
2438 }
2439 },
2440
2441 /**
2442 * Deletes all listeners for the DOM element with the supplied ID.
2443 *
2444 * @param {object} inst The instance, which is the source of events.
2445 */
2446 deleteAllListeners: function (inst) {
2447 var key = getDictionaryKey(inst);
2448 for (var registrationName in listenerBank) {
2449 if (!listenerBank.hasOwnProperty(registrationName)) {
2450 continue;
2451 }
2452
2453 if (!listenerBank[registrationName][key]) {
2454 continue;
2455 }
2456
2457 var PluginModule = EventPluginRegistry.registrationNameModules[registrationName];
2458 if (PluginModule && PluginModule.willDeleteListener) {
2459 PluginModule.willDeleteListener(inst, registrationName);
2460 }
2461
2462 delete listenerBank[registrationName][key];
2463 }
2464 },
2465
2466 /**
2467 * Allows registered plugins an opportunity to extract events from top-level
2468 * native browser events.
2469 *
2470 * @return {*} An accumulation of synthetic events.
2471 * @internal
2472 */
2473 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
2474 var events;
2475 var plugins = EventPluginRegistry.plugins;
2476 for (var i = 0; i < plugins.length; i++) {
2477 // Not every plugin in the ordering may be loaded at runtime.
2478 var possiblePlugin = plugins[i];
2479 if (possiblePlugin) {
2480 var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
2481 if (extractedEvents) {
2482 events = accumulateInto(events, extractedEvents);
2483 }
2484 }
2485 }
2486 return events;
2487 },
2488
2489 /**
2490 * Enqueues a synthetic event that should be dispatched when
2491 * `processEventQueue` is invoked.
2492 *
2493 * @param {*} events An accumulation of synthetic events.
2494 * @internal
2495 */
2496 enqueueEvents: function (events) {
2497 if (events) {
2498 eventQueue = accumulateInto(eventQueue, events);
2499 }
2500 },
2501
2502 /**
2503 * Dispatches all synthetic events on the event queue.
2504 *
2505 * @internal
2506 */
2507 processEventQueue: function (simulated) {
2508 // Set `eventQueue` to null before processing it so that we can tell if more
2509 // events get enqueued while processing.
2510 var processingEventQueue = eventQueue;
2511 eventQueue = null;
2512 if (simulated) {
2513 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
2514 } else {
2515 forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
2516 }
2517 !!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;
2518 // This would be a good time to rethrow if any of the event handlers threw.
2519 ReactErrorUtils.rethrowCaughtError();
2520 },
2521
2522 /**
2523 * These are needed for tests only. Do not use!
2524 */
2525 __purge: function () {
2526 listenerBank = {};
2527 },
2528
2529 __getListenerBank: function () {
2530 return listenerBank;
2531 }
2532};
2533
2534module.exports = EventPluginHub;
2535},{"102":102,"116":116,"141":141,"17":17,"18":18,"50":50,"95":95}],17:[function(_dereq_,module,exports){
2536/**
2537 * Copyright (c) 2013-present, Facebook, Inc.
2538 *
2539 * This source code is licensed under the MIT license found in the
2540 * LICENSE file in the root directory of this source tree.
2541 *
2542 *
2543 */
2544
2545'use strict';
2546
2547var _prodInvariant = _dereq_(116);
2548
2549var invariant = _dereq_(141);
2550
2551/**
2552 * Injectable ordering of event plugins.
2553 */
2554var eventPluginOrder = null;
2555
2556/**
2557 * Injectable mapping from names to event plugin modules.
2558 */
2559var namesToPlugins = {};
2560
2561/**
2562 * Recomputes the plugin list using the injected plugins and plugin ordering.
2563 *
2564 * @private
2565 */
2566function recomputePluginOrdering() {
2567 if (!eventPluginOrder) {
2568 // Wait until an `eventPluginOrder` is injected.
2569 return;
2570 }
2571 for (var pluginName in namesToPlugins) {
2572 var pluginModule = namesToPlugins[pluginName];
2573 var pluginIndex = eventPluginOrder.indexOf(pluginName);
2574 !(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;
2575 if (EventPluginRegistry.plugins[pluginIndex]) {
2576 continue;
2577 }
2578 !pluginModule.extractEvents ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0;
2579 EventPluginRegistry.plugins[pluginIndex] = pluginModule;
2580 var publishedEvents = pluginModule.eventTypes;
2581 for (var eventName in publishedEvents) {
2582 !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;
2583 }
2584 }
2585}
2586
2587/**
2588 * Publishes an event so that it can be dispatched by the supplied plugin.
2589 *
2590 * @param {object} dispatchConfig Dispatch configuration for the event.
2591 * @param {object} PluginModule Plugin publishing the event.
2592 * @return {boolean} True if the event was successfully published.
2593 * @private
2594 */
2595function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
2596 !!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;
2597 EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig;
2598
2599 var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
2600 if (phasedRegistrationNames) {
2601 for (var phaseName in phasedRegistrationNames) {
2602 if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
2603 var phasedRegistrationName = phasedRegistrationNames[phaseName];
2604 publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
2605 }
2606 }
2607 return true;
2608 } else if (dispatchConfig.registrationName) {
2609 publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
2610 return true;
2611 }
2612 return false;
2613}
2614
2615/**
2616 * Publishes a registration name that is used to identify dispatched events and
2617 * can be used with `EventPluginHub.putListener` to register listeners.
2618 *
2619 * @param {string} registrationName Registration name to add.
2620 * @param {object} PluginModule Plugin publishing the event.
2621 * @private
2622 */
2623function publishRegistrationName(registrationName, pluginModule, eventName) {
2624 !!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;
2625 EventPluginRegistry.registrationNameModules[registrationName] = pluginModule;
2626 EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
2627
2628 if ("development" !== 'production') {
2629 var lowerCasedName = registrationName.toLowerCase();
2630 EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName;
2631
2632 if (registrationName === 'onDoubleClick') {
2633 EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName;
2634 }
2635 }
2636}
2637
2638/**
2639 * Registers plugins so that they can extract and dispatch events.
2640 *
2641 * @see {EventPluginHub}
2642 */
2643var EventPluginRegistry = {
2644 /**
2645 * Ordered list of injected plugins.
2646 */
2647 plugins: [],
2648
2649 /**
2650 * Mapping from event name to dispatch config
2651 */
2652 eventNameDispatchConfigs: {},
2653
2654 /**
2655 * Mapping from registration name to plugin module
2656 */
2657 registrationNameModules: {},
2658
2659 /**
2660 * Mapping from registration name to event name
2661 */
2662 registrationNameDependencies: {},
2663
2664 /**
2665 * Mapping from lowercase registration names to the properly cased version,
2666 * used to warn in the case of missing event handlers. Available
2667 * only in __DEV__.
2668 * @type {Object}
2669 */
2670 possibleRegistrationNames: "development" !== 'production' ? {} : null,
2671 // Trust the developer to only use possibleRegistrationNames in __DEV__
2672
2673 /**
2674 * Injects an ordering of plugins (by plugin name). This allows the ordering
2675 * to be decoupled from injection of the actual plugins so that ordering is
2676 * always deterministic regardless of packaging, on-the-fly injection, etc.
2677 *
2678 * @param {array} InjectedEventPluginOrder
2679 * @internal
2680 * @see {EventPluginHub.injection.injectEventPluginOrder}
2681 */
2682 injectEventPluginOrder: function (injectedEventPluginOrder) {
2683 !!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;
2684 // Clone the ordering so it cannot be dynamically mutated.
2685 eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
2686 recomputePluginOrdering();
2687 },
2688
2689 /**
2690 * Injects plugins to be used by `EventPluginHub`. The plugin names must be
2691 * in the ordering injected by `injectEventPluginOrder`.
2692 *
2693 * Plugins can be injected as part of page initialization or on-the-fly.
2694 *
2695 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
2696 * @internal
2697 * @see {EventPluginHub.injection.injectEventPluginsByName}
2698 */
2699 injectEventPluginsByName: function (injectedNamesToPlugins) {
2700 var isOrderingDirty = false;
2701 for (var pluginName in injectedNamesToPlugins) {
2702 if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
2703 continue;
2704 }
2705 var pluginModule = injectedNamesToPlugins[pluginName];
2706 if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
2707 !!namesToPlugins[pluginName] ? "development" !== 'production' ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0;
2708 namesToPlugins[pluginName] = pluginModule;
2709 isOrderingDirty = true;
2710 }
2711 }
2712 if (isOrderingDirty) {
2713 recomputePluginOrdering();
2714 }
2715 },
2716
2717 /**
2718 * Looks up the plugin for the supplied event.
2719 *
2720 * @param {object} event A synthetic event.
2721 * @return {?object} The plugin that created the supplied event.
2722 * @internal
2723 */
2724 getPluginModuleForEvent: function (event) {
2725 var dispatchConfig = event.dispatchConfig;
2726 if (dispatchConfig.registrationName) {
2727 return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null;
2728 }
2729 if (dispatchConfig.phasedRegistrationNames !== undefined) {
2730 // pulling phasedRegistrationNames out of dispatchConfig helps Flow see
2731 // that it is not undefined.
2732 var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
2733
2734 for (var phase in phasedRegistrationNames) {
2735 if (!phasedRegistrationNames.hasOwnProperty(phase)) {
2736 continue;
2737 }
2738 var pluginModule = EventPluginRegistry.registrationNameModules[phasedRegistrationNames[phase]];
2739 if (pluginModule) {
2740 return pluginModule;
2741 }
2742 }
2743 }
2744 return null;
2745 },
2746
2747 /**
2748 * Exposed for unit testing.
2749 * @private
2750 */
2751 _resetEventPlugins: function () {
2752 eventPluginOrder = null;
2753 for (var pluginName in namesToPlugins) {
2754 if (namesToPlugins.hasOwnProperty(pluginName)) {
2755 delete namesToPlugins[pluginName];
2756 }
2757 }
2758 EventPluginRegistry.plugins.length = 0;
2759
2760 var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs;
2761 for (var eventName in eventNameDispatchConfigs) {
2762 if (eventNameDispatchConfigs.hasOwnProperty(eventName)) {
2763 delete eventNameDispatchConfigs[eventName];
2764 }
2765 }
2766
2767 var registrationNameModules = EventPluginRegistry.registrationNameModules;
2768 for (var registrationName in registrationNameModules) {
2769 if (registrationNameModules.hasOwnProperty(registrationName)) {
2770 delete registrationNameModules[registrationName];
2771 }
2772 }
2773
2774 if ("development" !== 'production') {
2775 var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames;
2776 for (var lowerCasedName in possibleRegistrationNames) {
2777 if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) {
2778 delete possibleRegistrationNames[lowerCasedName];
2779 }
2780 }
2781 }
2782 }
2783};
2784
2785module.exports = EventPluginRegistry;
2786},{"116":116,"141":141}],18:[function(_dereq_,module,exports){
2787/**
2788 * Copyright (c) 2013-present, Facebook, Inc.
2789 *
2790 * This source code is licensed under the MIT license found in the
2791 * LICENSE file in the root directory of this source tree.
2792 *
2793 */
2794
2795'use strict';
2796
2797var _prodInvariant = _dereq_(116);
2798
2799var ReactErrorUtils = _dereq_(50);
2800
2801var invariant = _dereq_(141);
2802var warning = _dereq_(148);
2803
2804/**
2805 * Injected dependencies:
2806 */
2807
2808/**
2809 * - `ComponentTree`: [required] Module that can convert between React instances
2810 * and actual node references.
2811 */
2812var ComponentTree;
2813var TreeTraversal;
2814var injection = {
2815 injectComponentTree: function (Injected) {
2816 ComponentTree = Injected;
2817 if ("development" !== 'production') {
2818 "development" !== 'production' ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
2819 }
2820 },
2821 injectTreeTraversal: function (Injected) {
2822 TreeTraversal = Injected;
2823 if ("development" !== 'production') {
2824 "development" !== 'production' ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0;
2825 }
2826 }
2827};
2828
2829function isEndish(topLevelType) {
2830 return topLevelType === 'topMouseUp' || topLevelType === 'topTouchEnd' || topLevelType === 'topTouchCancel';
2831}
2832
2833function isMoveish(topLevelType) {
2834 return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove';
2835}
2836function isStartish(topLevelType) {
2837 return topLevelType === 'topMouseDown' || topLevelType === 'topTouchStart';
2838}
2839
2840var validateEventDispatches;
2841if ("development" !== 'production') {
2842 validateEventDispatches = function (event) {
2843 var dispatchListeners = event._dispatchListeners;
2844 var dispatchInstances = event._dispatchInstances;
2845
2846 var listenersIsArr = Array.isArray(dispatchListeners);
2847 var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
2848
2849 var instancesIsArr = Array.isArray(dispatchInstances);
2850 var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
2851
2852 "development" !== 'production' ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0;
2853 };
2854}
2855
2856/**
2857 * Dispatch the event to the listener.
2858 * @param {SyntheticEvent} event SyntheticEvent to handle
2859 * @param {boolean} simulated If the event is simulated (changes exn behavior)
2860 * @param {function} listener Application-level callback
2861 * @param {*} inst Internal component instance
2862 */
2863function executeDispatch(event, simulated, listener, inst) {
2864 var type = event.type || 'unknown-event';
2865 event.currentTarget = EventPluginUtils.getNodeFromInstance(inst);
2866 if (simulated) {
2867 ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event);
2868 } else {
2869 ReactErrorUtils.invokeGuardedCallback(type, listener, event);
2870 }
2871 event.currentTarget = null;
2872}
2873
2874/**
2875 * Standard/simple iteration through an event's collected dispatches.
2876 */
2877function executeDispatchesInOrder(event, simulated) {
2878 var dispatchListeners = event._dispatchListeners;
2879 var dispatchInstances = event._dispatchInstances;
2880 if ("development" !== 'production') {
2881 validateEventDispatches(event);
2882 }
2883 if (Array.isArray(dispatchListeners)) {
2884 for (var i = 0; i < dispatchListeners.length; i++) {
2885 if (event.isPropagationStopped()) {
2886 break;
2887 }
2888 // Listeners and Instances are two parallel arrays that are always in sync.
2889 executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
2890 }
2891 } else if (dispatchListeners) {
2892 executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
2893 }
2894 event._dispatchListeners = null;
2895 event._dispatchInstances = null;
2896}
2897
2898/**
2899 * Standard/simple iteration through an event's collected dispatches, but stops
2900 * at the first dispatch execution returning true, and returns that id.
2901 *
2902 * @return {?string} id of the first dispatch execution who's listener returns
2903 * true, or null if no listener returned true.
2904 */
2905function executeDispatchesInOrderStopAtTrueImpl(event) {
2906 var dispatchListeners = event._dispatchListeners;
2907 var dispatchInstances = event._dispatchInstances;
2908 if ("development" !== 'production') {
2909 validateEventDispatches(event);
2910 }
2911 if (Array.isArray(dispatchListeners)) {
2912 for (var i = 0; i < dispatchListeners.length; i++) {
2913 if (event.isPropagationStopped()) {
2914 break;
2915 }
2916 // Listeners and Instances are two parallel arrays that are always in sync.
2917 if (dispatchListeners[i](event, dispatchInstances[i])) {
2918 return dispatchInstances[i];
2919 }
2920 }
2921 } else if (dispatchListeners) {
2922 if (dispatchListeners(event, dispatchInstances)) {
2923 return dispatchInstances;
2924 }
2925 }
2926 return null;
2927}
2928
2929/**
2930 * @see executeDispatchesInOrderStopAtTrueImpl
2931 */
2932function executeDispatchesInOrderStopAtTrue(event) {
2933 var ret = executeDispatchesInOrderStopAtTrueImpl(event);
2934 event._dispatchInstances = null;
2935 event._dispatchListeners = null;
2936 return ret;
2937}
2938
2939/**
2940 * Execution of a "direct" dispatch - there must be at most one dispatch
2941 * accumulated on the event or it is considered an error. It doesn't really make
2942 * sense for an event with multiple dispatches (bubbled) to keep track of the
2943 * return values at each dispatch execution, but it does tend to make sense when
2944 * dealing with "direct" dispatches.
2945 *
2946 * @return {*} The return value of executing the single dispatch.
2947 */
2948function executeDirectDispatch(event) {
2949 if ("development" !== 'production') {
2950 validateEventDispatches(event);
2951 }
2952 var dispatchListener = event._dispatchListeners;
2953 var dispatchInstance = event._dispatchInstances;
2954 !!Array.isArray(dispatchListener) ? "development" !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0;
2955 event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null;
2956 var res = dispatchListener ? dispatchListener(event) : null;
2957 event.currentTarget = null;
2958 event._dispatchListeners = null;
2959 event._dispatchInstances = null;
2960 return res;
2961}
2962
2963/**
2964 * @param {SyntheticEvent} event
2965 * @return {boolean} True iff number of dispatches accumulated is greater than 0.
2966 */
2967function hasDispatches(event) {
2968 return !!event._dispatchListeners;
2969}
2970
2971/**
2972 * General utilities that are useful in creating custom Event Plugins.
2973 */
2974var EventPluginUtils = {
2975 isEndish: isEndish,
2976 isMoveish: isMoveish,
2977 isStartish: isStartish,
2978
2979 executeDirectDispatch: executeDirectDispatch,
2980 executeDispatchesInOrder: executeDispatchesInOrder,
2981 executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue,
2982 hasDispatches: hasDispatches,
2983
2984 getInstanceFromNode: function (node) {
2985 return ComponentTree.getInstanceFromNode(node);
2986 },
2987 getNodeFromInstance: function (node) {
2988 return ComponentTree.getNodeFromInstance(node);
2989 },
2990 isAncestor: function (a, b) {
2991 return TreeTraversal.isAncestor(a, b);
2992 },
2993 getLowestCommonAncestor: function (a, b) {
2994 return TreeTraversal.getLowestCommonAncestor(a, b);
2995 },
2996 getParentInstance: function (inst) {
2997 return TreeTraversal.getParentInstance(inst);
2998 },
2999 traverseTwoPhase: function (target, fn, arg) {
3000 return TreeTraversal.traverseTwoPhase(target, fn, arg);
3001 },
3002 traverseEnterLeave: function (from, to, fn, argFrom, argTo) {
3003 return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo);
3004 },
3005
3006 injection: injection
3007};
3008
3009module.exports = EventPluginUtils;
3010},{"116":116,"141":141,"148":148,"50":50}],19:[function(_dereq_,module,exports){
3011/**
3012 * Copyright (c) 2013-present, Facebook, Inc.
3013 *
3014 * This source code is licensed under the MIT license found in the
3015 * LICENSE file in the root directory of this source tree.
3016 *
3017 */
3018
3019'use strict';
3020
3021var EventPluginHub = _dereq_(16);
3022var EventPluginUtils = _dereq_(18);
3023
3024var accumulateInto = _dereq_(95);
3025var forEachAccumulated = _dereq_(102);
3026var warning = _dereq_(148);
3027
3028var getListener = EventPluginHub.getListener;
3029
3030/**
3031 * Some event types have a notion of different registration names for different
3032 * "phases" of propagation. This finds listeners by a given phase.
3033 */
3034function listenerAtPhase(inst, event, propagationPhase) {
3035 var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
3036 return getListener(inst, registrationName);
3037}
3038
3039/**
3040 * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
3041 * here, allows us to not have to bind or create functions for each event.
3042 * Mutating the event's members allows us to not have to create a wrapping
3043 * "dispatch" object that pairs the event with the listener.
3044 */
3045function accumulateDirectionalDispatches(inst, phase, event) {
3046 if ("development" !== 'production') {
3047 "development" !== 'production' ? warning(inst, 'Dispatching inst must not be null') : void 0;
3048 }
3049 var listener = listenerAtPhase(inst, event, phase);
3050 if (listener) {
3051 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
3052 event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
3053 }
3054}
3055
3056/**
3057 * Collect dispatches (must be entirely collected before dispatching - see unit
3058 * tests). Lazily allocate the array to conserve memory. We must loop through
3059 * each event and perform the traversal for each one. We cannot perform a
3060 * single traversal for the entire collection of events because each event may
3061 * have a different target.
3062 */
3063function accumulateTwoPhaseDispatchesSingle(event) {
3064 if (event && event.dispatchConfig.phasedRegistrationNames) {
3065 EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
3066 }
3067}
3068
3069/**
3070 * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
3071 */
3072function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
3073 if (event && event.dispatchConfig.phasedRegistrationNames) {
3074 var targetInst = event._targetInst;
3075 var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null;
3076 EventPluginUtils.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
3077 }
3078}
3079
3080/**
3081 * Accumulates without regard to direction, does not look for phased
3082 * registration names. Same as `accumulateDirectDispatchesSingle` but without
3083 * requiring that the `dispatchMarker` be the same as the dispatched ID.
3084 */
3085function accumulateDispatches(inst, ignoredDirection, event) {
3086 if (event && event.dispatchConfig.registrationName) {
3087 var registrationName = event.dispatchConfig.registrationName;
3088 var listener = getListener(inst, registrationName);
3089 if (listener) {
3090 event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
3091 event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
3092 }
3093 }
3094}
3095
3096/**
3097 * Accumulates dispatches on an `SyntheticEvent`, but only for the
3098 * `dispatchMarker`.
3099 * @param {SyntheticEvent} event
3100 */
3101function accumulateDirectDispatchesSingle(event) {
3102 if (event && event.dispatchConfig.registrationName) {
3103 accumulateDispatches(event._targetInst, null, event);
3104 }
3105}
3106
3107function accumulateTwoPhaseDispatches(events) {
3108 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
3109}
3110
3111function accumulateTwoPhaseDispatchesSkipTarget(events) {
3112 forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
3113}
3114
3115function accumulateEnterLeaveDispatches(leave, enter, from, to) {
3116 EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
3117}
3118
3119function accumulateDirectDispatches(events) {
3120 forEachAccumulated(events, accumulateDirectDispatchesSingle);
3121}
3122
3123/**
3124 * A small set of propagation patterns, each of which will accept a small amount
3125 * of information, and generate a set of "dispatch ready event objects" - which
3126 * are sets of events that have already been annotated with a set of dispatched
3127 * listener functions/ids. The API is designed this way to discourage these
3128 * propagation strategies from actually executing the dispatches, since we
3129 * always want to collect the entire set of dispatches before executing event a
3130 * single one.
3131 *
3132 * @constructor EventPropagators
3133 */
3134var EventPropagators = {
3135 accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
3136 accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
3137 accumulateDirectDispatches: accumulateDirectDispatches,
3138 accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches
3139};
3140
3141module.exports = EventPropagators;
3142},{"102":102,"148":148,"16":16,"18":18,"95":95}],20:[function(_dereq_,module,exports){
3143/**
3144 * Copyright (c) 2013-present, Facebook, Inc.
3145 *
3146 * This source code is licensed under the MIT license found in the
3147 * LICENSE file in the root directory of this source tree.
3148 *
3149 */
3150
3151'use strict';
3152
3153var _assign = _dereq_(149);
3154
3155var PooledClass = _dereq_(24);
3156
3157var getTextContentAccessor = _dereq_(109);
3158
3159/**
3160 * This helper class stores information about text content of a target node,
3161 * allowing comparison of content before and after a given event.
3162 *
3163 * Identify the node where selection currently begins, then observe
3164 * both its text content and its current position in the DOM. Since the
3165 * browser may natively replace the target node during composition, we can
3166 * use its position to find its replacement.
3167 *
3168 * @param {DOMEventTarget} root
3169 */
3170function FallbackCompositionState(root) {
3171 this._root = root;
3172 this._startText = this.getText();
3173 this._fallbackText = null;
3174}
3175
3176_assign(FallbackCompositionState.prototype, {
3177 destructor: function () {
3178 this._root = null;
3179 this._startText = null;
3180 this._fallbackText = null;
3181 },
3182
3183 /**
3184 * Get current text of input.
3185 *
3186 * @return {string}
3187 */
3188 getText: function () {
3189 if ('value' in this._root) {
3190 return this._root.value;
3191 }
3192 return this._root[getTextContentAccessor()];
3193 },
3194
3195 /**
3196 * Determine the differing substring between the initially stored
3197 * text content and the current content.
3198 *
3199 * @return {string}
3200 */
3201 getData: function () {
3202 if (this._fallbackText) {
3203 return this._fallbackText;
3204 }
3205
3206 var start;
3207 var startValue = this._startText;
3208 var startLength = startValue.length;
3209 var end;
3210 var endValue = this.getText();
3211 var endLength = endValue.length;
3212
3213 for (start = 0; start < startLength; start++) {
3214 if (startValue[start] !== endValue[start]) {
3215 break;
3216 }
3217 }
3218
3219 var minEnd = startLength - start;
3220 for (end = 1; end <= minEnd; end++) {
3221 if (startValue[startLength - end] !== endValue[endLength - end]) {
3222 break;
3223 }
3224 }
3225
3226 var sliceTail = end > 1 ? 1 - end : undefined;
3227 this._fallbackText = endValue.slice(start, sliceTail);
3228 return this._fallbackText;
3229 }
3230});
3231
3232PooledClass.addPoolingTo(FallbackCompositionState);
3233
3234module.exports = FallbackCompositionState;
3235},{"109":109,"149":149,"24":24}],21:[function(_dereq_,module,exports){
3236/**
3237 * Copyright (c) 2013-present, Facebook, Inc.
3238 *
3239 * This source code is licensed under the MIT license found in the
3240 * LICENSE file in the root directory of this source tree.
3241 *
3242 */
3243
3244'use strict';
3245
3246var DOMProperty = _dereq_(11);
3247
3248var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;
3249var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;
3250var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;
3251var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;
3252var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;
3253
3254var HTMLDOMPropertyConfig = {
3255 isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),
3256 Properties: {
3257 /**
3258 * Standard Properties
3259 */
3260 accept: 0,
3261 acceptCharset: 0,
3262 accessKey: 0,
3263 action: 0,
3264 allowFullScreen: HAS_BOOLEAN_VALUE,
3265 allowTransparency: 0,
3266 alt: 0,
3267 // specifies target context for links with `preload` type
3268 as: 0,
3269 async: HAS_BOOLEAN_VALUE,
3270 autoComplete: 0,
3271 // autoFocus is polyfilled/normalized by AutoFocusUtils
3272 // autoFocus: HAS_BOOLEAN_VALUE,
3273 autoPlay: HAS_BOOLEAN_VALUE,
3274 capture: HAS_BOOLEAN_VALUE,
3275 cellPadding: 0,
3276 cellSpacing: 0,
3277 charSet: 0,
3278 challenge: 0,
3279 checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3280 cite: 0,
3281 classID: 0,
3282 className: 0,
3283 cols: HAS_POSITIVE_NUMERIC_VALUE,
3284 colSpan: 0,
3285 content: 0,
3286 contentEditable: 0,
3287 contextMenu: 0,
3288 controls: HAS_BOOLEAN_VALUE,
3289 controlsList: 0,
3290 coords: 0,
3291 crossOrigin: 0,
3292 data: 0, // For `<object />` acts as `src`.
3293 dateTime: 0,
3294 'default': HAS_BOOLEAN_VALUE,
3295 defer: HAS_BOOLEAN_VALUE,
3296 dir: 0,
3297 disabled: HAS_BOOLEAN_VALUE,
3298 download: HAS_OVERLOADED_BOOLEAN_VALUE,
3299 draggable: 0,
3300 encType: 0,
3301 form: 0,
3302 formAction: 0,
3303 formEncType: 0,
3304 formMethod: 0,
3305 formNoValidate: HAS_BOOLEAN_VALUE,
3306 formTarget: 0,
3307 frameBorder: 0,
3308 headers: 0,
3309 height: 0,
3310 hidden: HAS_BOOLEAN_VALUE,
3311 high: 0,
3312 href: 0,
3313 hrefLang: 0,
3314 htmlFor: 0,
3315 httpEquiv: 0,
3316 icon: 0,
3317 id: 0,
3318 inputMode: 0,
3319 integrity: 0,
3320 is: 0,
3321 keyParams: 0,
3322 keyType: 0,
3323 kind: 0,
3324 label: 0,
3325 lang: 0,
3326 list: 0,
3327 loop: HAS_BOOLEAN_VALUE,
3328 low: 0,
3329 manifest: 0,
3330 marginHeight: 0,
3331 marginWidth: 0,
3332 max: 0,
3333 maxLength: 0,
3334 media: 0,
3335 mediaGroup: 0,
3336 method: 0,
3337 min: 0,
3338 minLength: 0,
3339 // Caution; `option.selected` is not updated if `select.multiple` is
3340 // disabled with `removeAttribute`.
3341 multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3342 muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3343 name: 0,
3344 nonce: 0,
3345 noValidate: HAS_BOOLEAN_VALUE,
3346 open: HAS_BOOLEAN_VALUE,
3347 optimum: 0,
3348 pattern: 0,
3349 placeholder: 0,
3350 playsInline: HAS_BOOLEAN_VALUE,
3351 poster: 0,
3352 preload: 0,
3353 profile: 0,
3354 radioGroup: 0,
3355 readOnly: HAS_BOOLEAN_VALUE,
3356 referrerPolicy: 0,
3357 rel: 0,
3358 required: HAS_BOOLEAN_VALUE,
3359 reversed: HAS_BOOLEAN_VALUE,
3360 role: 0,
3361 rows: HAS_POSITIVE_NUMERIC_VALUE,
3362 rowSpan: HAS_NUMERIC_VALUE,
3363 sandbox: 0,
3364 scope: 0,
3365 scoped: HAS_BOOLEAN_VALUE,
3366 scrolling: 0,
3367 seamless: HAS_BOOLEAN_VALUE,
3368 selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
3369 shape: 0,
3370 size: HAS_POSITIVE_NUMERIC_VALUE,
3371 sizes: 0,
3372 span: HAS_POSITIVE_NUMERIC_VALUE,
3373 spellCheck: 0,
3374 src: 0,
3375 srcDoc: 0,
3376 srcLang: 0,
3377 srcSet: 0,
3378 start: HAS_NUMERIC_VALUE,
3379 step: 0,
3380 style: 0,
3381 summary: 0,
3382 tabIndex: 0,
3383 target: 0,
3384 title: 0,
3385 // Setting .type throws on non-<input> tags
3386 type: 0,
3387 useMap: 0,
3388 value: 0,
3389 width: 0,
3390 wmode: 0,
3391 wrap: 0,
3392
3393 /**
3394 * RDFa Properties
3395 */
3396 about: 0,
3397 datatype: 0,
3398 inlist: 0,
3399 prefix: 0,
3400 // property is also supported for OpenGraph in meta tags.
3401 property: 0,
3402 resource: 0,
3403 'typeof': 0,
3404 vocab: 0,
3405
3406 /**
3407 * Non-standard Properties
3408 */
3409 // autoCapitalize and autoCorrect are supported in Mobile Safari for
3410 // keyboard hints.
3411 autoCapitalize: 0,
3412 autoCorrect: 0,
3413 // autoSave allows WebKit/Blink to persist values of input fields on page reloads
3414 autoSave: 0,
3415 // color is for Safari mask-icon link
3416 color: 0,
3417 // itemProp, itemScope, itemType are for
3418 // Microdata support. See http://schema.org/docs/gs.html
3419 itemProp: 0,
3420 itemScope: HAS_BOOLEAN_VALUE,
3421 itemType: 0,
3422 // itemID and itemRef are for Microdata support as well but
3423 // only specified in the WHATWG spec document. See
3424 // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
3425 itemID: 0,
3426 itemRef: 0,
3427 // results show looking glass icon and recent searches on input
3428 // search fields in WebKit/Blink
3429 results: 0,
3430 // IE-only attribute that specifies security restrictions on an iframe
3431 // as an alternative to the sandbox attribute on IE<10
3432 security: 0,
3433 // IE-only attribute that controls focus behavior
3434 unselectable: 0
3435 },
3436 DOMAttributeNames: {
3437 acceptCharset: 'accept-charset',
3438 className: 'class',
3439 htmlFor: 'for',
3440 httpEquiv: 'http-equiv'
3441 },
3442 DOMPropertyNames: {},
3443 DOMMutationMethods: {
3444 value: function (node, value) {
3445 if (value == null) {
3446 return node.removeAttribute('value');
3447 }
3448
3449 // Number inputs get special treatment due to some edge cases in
3450 // Chrome. Let everything else assign the value attribute as normal.
3451 // https://github.com/facebook/react/issues/7253#issuecomment-236074326
3452 if (node.type !== 'number' || node.hasAttribute('value') === false) {
3453 node.setAttribute('value', '' + value);
3454 } else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) {
3455 // Don't assign an attribute if validation reports bad
3456 // input. Chrome will clear the value. Additionally, don't
3457 // operate on inputs that have focus, otherwise Chrome might
3458 // strip off trailing decimal places and cause the user's
3459 // cursor position to jump to the beginning of the input.
3460 //
3461 // In ReactDOMInput, we have an onBlur event that will trigger
3462 // this function again when focus is lost.
3463 node.setAttribute('value', '' + value);
3464 }
3465 }
3466 }
3467};
3468
3469module.exports = HTMLDOMPropertyConfig;
3470},{"11":11}],22:[function(_dereq_,module,exports){
3471/**
3472 * Copyright (c) 2013-present, Facebook, Inc.
3473 *
3474 * This source code is licensed under the MIT license found in the
3475 * LICENSE file in the root directory of this source tree.
3476 *
3477 *
3478 */
3479
3480'use strict';
3481
3482/**
3483 * Escape and wrap key so it is safe to use as a reactid
3484 *
3485 * @param {string} key to be escaped.
3486 * @return {string} the escaped key.
3487 */
3488
3489function escape(key) {
3490 var escapeRegex = /[=:]/g;
3491 var escaperLookup = {
3492 '=': '=0',
3493 ':': '=2'
3494 };
3495 var escapedString = ('' + key).replace(escapeRegex, function (match) {
3496 return escaperLookup[match];
3497 });
3498
3499 return '$' + escapedString;
3500}
3501
3502/**
3503 * Unescape and unwrap key for human-readable display
3504 *
3505 * @param {string} key to unescape.
3506 * @return {string} the unescaped key.
3507 */
3508function unescape(key) {
3509 var unescapeRegex = /(=0|=2)/g;
3510 var unescaperLookup = {
3511 '=0': '=',
3512 '=2': ':'
3513 };
3514 var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
3515
3516 return ('' + keySubstring).replace(unescapeRegex, function (match) {
3517 return unescaperLookup[match];
3518 });
3519}
3520
3521var KeyEscapeUtils = {
3522 escape: escape,
3523 unescape: unescape
3524};
3525
3526module.exports = KeyEscapeUtils;
3527},{}],23:[function(_dereq_,module,exports){
3528/**
3529 * Copyright (c) 2013-present, Facebook, Inc.
3530 *
3531 * This source code is licensed under the MIT license found in the
3532 * LICENSE file in the root directory of this source tree.
3533 *
3534 */
3535
3536'use strict';
3537
3538var _prodInvariant = _dereq_(116);
3539
3540var ReactPropTypesSecret = _dereq_(66);
3541var propTypesFactory = _dereq_(151);
3542
3543var React = _dereq_(124);
3544var PropTypes = propTypesFactory(React.isValidElement);
3545
3546var invariant = _dereq_(141);
3547var warning = _dereq_(148);
3548
3549var hasReadOnlyValue = {
3550 button: true,
3551 checkbox: true,
3552 image: true,
3553 hidden: true,
3554 radio: true,
3555 reset: true,
3556 submit: true
3557};
3558
3559function _assertSingleLink(inputProps) {
3560 !(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;
3561}
3562function _assertValueLink(inputProps) {
3563 _assertSingleLink(inputProps);
3564 !(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;
3565}
3566
3567function _assertCheckedLink(inputProps) {
3568 _assertSingleLink(inputProps);
3569 !(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;
3570}
3571
3572var propTypes = {
3573 value: function (props, propName, componentName) {
3574 if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) {
3575 return null;
3576 }
3577 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`.');
3578 },
3579 checked: function (props, propName, componentName) {
3580 if (!props[propName] || props.onChange || props.readOnly || props.disabled) {
3581 return null;
3582 }
3583 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`.');
3584 },
3585 onChange: PropTypes.func
3586};
3587
3588var loggedTypeFailures = {};
3589function getDeclarationErrorAddendum(owner) {
3590 if (owner) {
3591 var name = owner.getName();
3592 if (name) {
3593 return ' Check the render method of `' + name + '`.';
3594 }
3595 }
3596 return '';
3597}
3598
3599/**
3600 * Provide a linked `value` attribute for controlled forms. You should not use
3601 * this outside of the ReactDOM controlled form components.
3602 */
3603var LinkedValueUtils = {
3604 checkPropTypes: function (tagName, props, owner) {
3605 for (var propName in propTypes) {
3606 if (propTypes.hasOwnProperty(propName)) {
3607 var error = propTypes[propName](props, propName, tagName, 'prop', null, ReactPropTypesSecret);
3608 }
3609 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
3610 // Only monitor this failure once because there tends to be a lot of the
3611 // same error.
3612 loggedTypeFailures[error.message] = true;
3613
3614 var addendum = getDeclarationErrorAddendum(owner);
3615 "development" !== 'production' ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0;
3616 }
3617 }
3618 },
3619
3620 /**
3621 * @param {object} inputProps Props for form component
3622 * @return {*} current value of the input either from value prop or link.
3623 */
3624 getValue: function (inputProps) {
3625 if (inputProps.valueLink) {
3626 _assertValueLink(inputProps);
3627 return inputProps.valueLink.value;
3628 }
3629 return inputProps.value;
3630 },
3631
3632 /**
3633 * @param {object} inputProps Props for form component
3634 * @return {*} current checked status of the input either from checked prop
3635 * or link.
3636 */
3637 getChecked: function (inputProps) {
3638 if (inputProps.checkedLink) {
3639 _assertCheckedLink(inputProps);
3640 return inputProps.checkedLink.value;
3641 }
3642 return inputProps.checked;
3643 },
3644
3645 /**
3646 * @param {object} inputProps Props for form component
3647 * @param {SyntheticEvent} event change event to handle
3648 */
3649 executeOnChange: function (inputProps, event) {
3650 if (inputProps.valueLink) {
3651 _assertValueLink(inputProps);
3652 return inputProps.valueLink.requestChange(event.target.value);
3653 } else if (inputProps.checkedLink) {
3654 _assertCheckedLink(inputProps);
3655 return inputProps.checkedLink.requestChange(event.target.checked);
3656 } else if (inputProps.onChange) {
3657 return inputProps.onChange.call(undefined, event);
3658 }
3659 }
3660};
3661
3662module.exports = LinkedValueUtils;
3663},{"116":116,"124":124,"141":141,"148":148,"151":151,"66":66}],24:[function(_dereq_,module,exports){
3664/**
3665 * Copyright (c) 2013-present, Facebook, Inc.
3666 *
3667 * This source code is licensed under the MIT license found in the
3668 * LICENSE file in the root directory of this source tree.
3669 *
3670 *
3671 */
3672
3673'use strict';
3674
3675var _prodInvariant = _dereq_(116);
3676
3677var invariant = _dereq_(141);
3678
3679/**
3680 * Static poolers. Several custom versions for each potential number of
3681 * arguments. A completely generic pooler is easy to implement, but would
3682 * require accessing the `arguments` object. In each of these, `this` refers to
3683 * the Class itself, not an instance. If any others are needed, simply add them
3684 * here, or in their own files.
3685 */
3686var oneArgumentPooler = function (copyFieldsFrom) {
3687 var Klass = this;
3688 if (Klass.instancePool.length) {
3689 var instance = Klass.instancePool.pop();
3690 Klass.call(instance, copyFieldsFrom);
3691 return instance;
3692 } else {
3693 return new Klass(copyFieldsFrom);
3694 }
3695};
3696
3697var twoArgumentPooler = function (a1, a2) {
3698 var Klass = this;
3699 if (Klass.instancePool.length) {
3700 var instance = Klass.instancePool.pop();
3701 Klass.call(instance, a1, a2);
3702 return instance;
3703 } else {
3704 return new Klass(a1, a2);
3705 }
3706};
3707
3708var threeArgumentPooler = function (a1, a2, a3) {
3709 var Klass = this;
3710 if (Klass.instancePool.length) {
3711 var instance = Klass.instancePool.pop();
3712 Klass.call(instance, a1, a2, a3);
3713 return instance;
3714 } else {
3715 return new Klass(a1, a2, a3);
3716 }
3717};
3718
3719var fourArgumentPooler = function (a1, a2, a3, a4) {
3720 var Klass = this;
3721 if (Klass.instancePool.length) {
3722 var instance = Klass.instancePool.pop();
3723 Klass.call(instance, a1, a2, a3, a4);
3724 return instance;
3725 } else {
3726 return new Klass(a1, a2, a3, a4);
3727 }
3728};
3729
3730var standardReleaser = function (instance) {
3731 var Klass = this;
3732 !(instance instanceof Klass) ? "development" !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0;
3733 instance.destructor();
3734 if (Klass.instancePool.length < Klass.poolSize) {
3735 Klass.instancePool.push(instance);
3736 }
3737};
3738
3739var DEFAULT_POOL_SIZE = 10;
3740var DEFAULT_POOLER = oneArgumentPooler;
3741
3742/**
3743 * Augments `CopyConstructor` to be a poolable class, augmenting only the class
3744 * itself (statically) not adding any prototypical fields. Any CopyConstructor
3745 * you give this may have a `poolSize` property, and will look for a
3746 * prototypical `destructor` on instances.
3747 *
3748 * @param {Function} CopyConstructor Constructor that can be used to reset.
3749 * @param {Function} pooler Customizable pooler.
3750 */
3751var addPoolingTo = function (CopyConstructor, pooler) {
3752 // Casting as any so that flow ignores the actual implementation and trusts
3753 // it to match the type we declared
3754 var NewKlass = CopyConstructor;
3755 NewKlass.instancePool = [];
3756 NewKlass.getPooled = pooler || DEFAULT_POOLER;
3757 if (!NewKlass.poolSize) {
3758 NewKlass.poolSize = DEFAULT_POOL_SIZE;
3759 }
3760 NewKlass.release = standardReleaser;
3761 return NewKlass;
3762};
3763
3764var PooledClass = {
3765 addPoolingTo: addPoolingTo,
3766 oneArgumentPooler: oneArgumentPooler,
3767 twoArgumentPooler: twoArgumentPooler,
3768 threeArgumentPooler: threeArgumentPooler,
3769 fourArgumentPooler: fourArgumentPooler
3770};
3771
3772module.exports = PooledClass;
3773},{"116":116,"141":141}],25:[function(_dereq_,module,exports){
3774/**
3775 * Copyright (c) 2013-present, Facebook, Inc.
3776 *
3777 * This source code is licensed under the MIT license found in the
3778 * LICENSE file in the root directory of this source tree.
3779 *
3780 */
3781
3782'use strict';
3783
3784var _assign = _dereq_(149);
3785
3786var EventPluginRegistry = _dereq_(17);
3787var ReactEventEmitterMixin = _dereq_(51);
3788var ViewportMetrics = _dereq_(94);
3789
3790var getVendorPrefixedEventName = _dereq_(110);
3791var isEventSupported = _dereq_(113);
3792
3793/**
3794 * Summary of `ReactBrowserEventEmitter` event handling:
3795 *
3796 * - Top-level delegation is used to trap most native browser events. This
3797 * may only occur in the main thread and is the responsibility of
3798 * ReactEventListener, which is injected and can therefore support pluggable
3799 * event sources. This is the only work that occurs in the main thread.
3800 *
3801 * - We normalize and de-duplicate events to account for browser quirks. This
3802 * may be done in the worker thread.
3803 *
3804 * - Forward these native events (with the associated top-level type used to
3805 * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
3806 * to extract any synthetic events.
3807 *
3808 * - The `EventPluginHub` will then process each event by annotating them with
3809 * "dispatches", a sequence of listeners and IDs that care about that event.
3810 *
3811 * - The `EventPluginHub` then dispatches the events.
3812 *
3813 * Overview of React and the event system:
3814 *
3815 * +------------+ .
3816 * | DOM | .
3817 * +------------+ .
3818 * | .
3819 * v .
3820 * +------------+ .
3821 * | ReactEvent | .
3822 * | Listener | .
3823 * +------------+ . +-----------+
3824 * | . +--------+|SimpleEvent|
3825 * | . | |Plugin |
3826 * +-----|------+ . v +-----------+
3827 * | | | . +--------------+ +------------+
3828 * | +-----------.--->|EventPluginHub| | Event |
3829 * | | . | | +-----------+ | Propagators|
3830 * | ReactEvent | . | | |TapEvent | |------------|
3831 * | Emitter | . | |<---+|Plugin | |other plugin|
3832 * | | . | | +-----------+ | utilities |
3833 * | +-----------.--->| | +------------+
3834 * | | | . +--------------+
3835 * +-----|------+ . ^ +-----------+
3836 * | . | |Enter/Leave|
3837 * + . +-------+|Plugin |
3838 * +-------------+ . +-----------+
3839 * | application | .
3840 * |-------------| .
3841 * | | .
3842 * | | .
3843 * +-------------+ .
3844 * .
3845 * React Core . General Purpose Event Plugin System
3846 */
3847
3848var hasEventPageXY;
3849var alreadyListeningTo = {};
3850var isMonitoringScrollValue = false;
3851var reactTopListenersCounter = 0;
3852
3853// For events like 'submit' which don't consistently bubble (which we trap at a
3854// lower node than `document`), binding at `document` would cause duplicate
3855// events so we don't include them here
3856var topEventMapping = {
3857 topAbort: 'abort',
3858 topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend',
3859 topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration',
3860 topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart',
3861 topBlur: 'blur',
3862 topCanPlay: 'canplay',
3863 topCanPlayThrough: 'canplaythrough',
3864 topChange: 'change',
3865 topClick: 'click',
3866 topCompositionEnd: 'compositionend',
3867 topCompositionStart: 'compositionstart',
3868 topCompositionUpdate: 'compositionupdate',
3869 topContextMenu: 'contextmenu',
3870 topCopy: 'copy',
3871 topCut: 'cut',
3872 topDoubleClick: 'dblclick',
3873 topDrag: 'drag',
3874 topDragEnd: 'dragend',
3875 topDragEnter: 'dragenter',
3876 topDragExit: 'dragexit',
3877 topDragLeave: 'dragleave',
3878 topDragOver: 'dragover',
3879 topDragStart: 'dragstart',
3880 topDrop: 'drop',
3881 topDurationChange: 'durationchange',
3882 topEmptied: 'emptied',
3883 topEncrypted: 'encrypted',
3884 topEnded: 'ended',
3885 topError: 'error',
3886 topFocus: 'focus',
3887 topInput: 'input',
3888 topKeyDown: 'keydown',
3889 topKeyPress: 'keypress',
3890 topKeyUp: 'keyup',
3891 topLoadedData: 'loadeddata',
3892 topLoadedMetadata: 'loadedmetadata',
3893 topLoadStart: 'loadstart',
3894 topMouseDown: 'mousedown',
3895 topMouseMove: 'mousemove',
3896 topMouseOut: 'mouseout',
3897 topMouseOver: 'mouseover',
3898 topMouseUp: 'mouseup',
3899 topPaste: 'paste',
3900 topPause: 'pause',
3901 topPlay: 'play',
3902 topPlaying: 'playing',
3903 topProgress: 'progress',
3904 topRateChange: 'ratechange',
3905 topScroll: 'scroll',
3906 topSeeked: 'seeked',
3907 topSeeking: 'seeking',
3908 topSelectionChange: 'selectionchange',
3909 topStalled: 'stalled',
3910 topSuspend: 'suspend',
3911 topTextInput: 'textInput',
3912 topTimeUpdate: 'timeupdate',
3913 topTouchCancel: 'touchcancel',
3914 topTouchEnd: 'touchend',
3915 topTouchMove: 'touchmove',
3916 topTouchStart: 'touchstart',
3917 topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend',
3918 topVolumeChange: 'volumechange',
3919 topWaiting: 'waiting',
3920 topWheel: 'wheel'
3921};
3922
3923/**
3924 * To ensure no conflicts with other potential React instances on the page
3925 */
3926var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2);
3927
3928function getListeningForDocument(mountAt) {
3929 // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
3930 // directly.
3931 if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
3932 mountAt[topListenersIDKey] = reactTopListenersCounter++;
3933 alreadyListeningTo[mountAt[topListenersIDKey]] = {};
3934 }
3935 return alreadyListeningTo[mountAt[topListenersIDKey]];
3936}
3937
3938/**
3939 * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For
3940 * example:
3941 *
3942 * EventPluginHub.putListener('myID', 'onClick', myFunction);
3943 *
3944 * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'.
3945 *
3946 * @internal
3947 */
3948var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, {
3949 /**
3950 * Injectable event backend
3951 */
3952 ReactEventListener: null,
3953
3954 injection: {
3955 /**
3956 * @param {object} ReactEventListener
3957 */
3958 injectReactEventListener: function (ReactEventListener) {
3959 ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel);
3960 ReactBrowserEventEmitter.ReactEventListener = ReactEventListener;
3961 }
3962 },
3963
3964 /**
3965 * Sets whether or not any created callbacks should be enabled.
3966 *
3967 * @param {boolean} enabled True if callbacks should be enabled.
3968 */
3969 setEnabled: function (enabled) {
3970 if (ReactBrowserEventEmitter.ReactEventListener) {
3971 ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled);
3972 }
3973 },
3974
3975 /**
3976 * @return {boolean} True if callbacks are enabled.
3977 */
3978 isEnabled: function () {
3979 return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled());
3980 },
3981
3982 /**
3983 * We listen for bubbled touch events on the document object.
3984 *
3985 * Firefox v8.01 (and possibly others) exhibited strange behavior when
3986 * mounting `onmousemove` events at some node that was not the document
3987 * element. The symptoms were that if your mouse is not moving over something
3988 * contained within that mount point (for example on the background) the
3989 * top-level listeners for `onmousemove` won't be called. However, if you
3990 * register the `mousemove` on the document object, then it will of course
3991 * catch all `mousemove`s. This along with iOS quirks, justifies restricting
3992 * top-level listeners to the document object only, at least for these
3993 * movement types of events and possibly all events.
3994 *
3995 * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
3996 *
3997 * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
3998 * they bubble to document.
3999 *
4000 * @param {string} registrationName Name of listener (e.g. `onClick`).
4001 * @param {object} contentDocumentHandle Document which owns the container
4002 */
4003 listenTo: function (registrationName, contentDocumentHandle) {
4004 var mountAt = contentDocumentHandle;
4005 var isListening = getListeningForDocument(mountAt);
4006 var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName];
4007
4008 for (var i = 0; i < dependencies.length; i++) {
4009 var dependency = dependencies[i];
4010 if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
4011 if (dependency === 'topWheel') {
4012 if (isEventSupported('wheel')) {
4013 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'wheel', mountAt);
4014 } else if (isEventSupported('mousewheel')) {
4015 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'mousewheel', mountAt);
4016 } else {
4017 // Firefox needs to capture a different mouse scroll event.
4018 // @see http://www.quirksmode.org/dom/events/tests/scroll.html
4019 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt);
4020 }
4021 } else if (dependency === 'topScroll') {
4022 if (isEventSupported('scroll', true)) {
4023 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topScroll', 'scroll', mountAt);
4024 } else {
4025 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topScroll', 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE);
4026 }
4027 } else if (dependency === 'topFocus' || dependency === 'topBlur') {
4028 if (isEventSupported('focus', true)) {
4029 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topFocus', 'focus', mountAt);
4030 ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topBlur', 'blur', mountAt);
4031 } else if (isEventSupported('focusin')) {
4032 // IE has `focusin` and `focusout` events which bubble.
4033 // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
4034 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topFocus', 'focusin', mountAt);
4035 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topBlur', 'focusout', mountAt);
4036 }
4037
4038 // to make sure blur and focus event listeners are only attached once
4039 isListening.topBlur = true;
4040 isListening.topFocus = true;
4041 } else if (topEventMapping.hasOwnProperty(dependency)) {
4042 ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt);
4043 }
4044
4045 isListening[dependency] = true;
4046 }
4047 }
4048 },
4049
4050 trapBubbledEvent: function (topLevelType, handlerBaseName, handle) {
4051 return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle);
4052 },
4053
4054 trapCapturedEvent: function (topLevelType, handlerBaseName, handle) {
4055 return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle);
4056 },
4057
4058 /**
4059 * Protect against document.createEvent() returning null
4060 * Some popup blocker extensions appear to do this:
4061 * https://github.com/facebook/react/issues/6887
4062 */
4063 supportsEventPageXY: function () {
4064 if (!document.createEvent) {
4065 return false;
4066 }
4067 var ev = document.createEvent('MouseEvent');
4068 return ev != null && 'pageX' in ev;
4069 },
4070
4071 /**
4072 * Listens to window scroll and resize events. We cache scroll values so that
4073 * application code can access them without triggering reflows.
4074 *
4075 * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when
4076 * pageX/pageY isn't supported (legacy browsers).
4077 *
4078 * NOTE: Scroll events do not bubble.
4079 *
4080 * @see http://www.quirksmode.org/dom/events/scroll.html
4081 */
4082 ensureScrollValueMonitoring: function () {
4083 if (hasEventPageXY === undefined) {
4084 hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY();
4085 }
4086 if (!hasEventPageXY && !isMonitoringScrollValue) {
4087 var refresh = ViewportMetrics.refreshScrollValues;
4088 ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh);
4089 isMonitoringScrollValue = true;
4090 }
4091 }
4092});
4093
4094module.exports = ReactBrowserEventEmitter;
4095},{"110":110,"113":113,"149":149,"17":17,"51":51,"94":94}],26:[function(_dereq_,module,exports){
4096(function (process){
4097/**
4098 * Copyright (c) 2014-present, Facebook, Inc.
4099 *
4100 * This source code is licensed under the MIT license found in the
4101 * LICENSE file in the root directory of this source tree.
4102 *
4103 */
4104
4105'use strict';
4106
4107var ReactReconciler = _dereq_(68);
4108
4109var instantiateReactComponent = _dereq_(112);
4110var KeyEscapeUtils = _dereq_(22);
4111var shouldUpdateReactComponent = _dereq_(119);
4112var traverseAllChildren = _dereq_(120);
4113var warning = _dereq_(148);
4114
4115var ReactComponentTreeHook;
4116
4117if (typeof process !== 'undefined' && process.env && "development" === 'test') {
4118 // Temporary hack.
4119 // Inline requires don't work well with Jest:
4120 // https://github.com/facebook/react/issues/7240
4121 // Remove the inline requires when we don't need them anymore:
4122 // https://github.com/facebook/react/pull/7178
4123 ReactComponentTreeHook = _dereq_(122);
4124}
4125
4126function instantiateChild(childInstances, child, name, selfDebugID) {
4127 // We found a component instance.
4128 var keyUnique = childInstances[name] === undefined;
4129 if ("development" !== 'production') {
4130 if (!ReactComponentTreeHook) {
4131 ReactComponentTreeHook = _dereq_(122);
4132 }
4133 if (!keyUnique) {
4134 "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;
4135 }
4136 }
4137 if (child != null && keyUnique) {
4138 childInstances[name] = instantiateReactComponent(child, true);
4139 }
4140}
4141
4142/**
4143 * ReactChildReconciler provides helpers for initializing or updating a set of
4144 * children. Its output is suitable for passing it onto ReactMultiChild which
4145 * does diffed reordering and insertion.
4146 */
4147var ReactChildReconciler = {
4148 /**
4149 * Generates a "mount image" for each of the supplied children. In the case
4150 * of `ReactDOMComponent`, a mount image is a string of markup.
4151 *
4152 * @param {?object} nestedChildNodes Nested child maps.
4153 * @return {?object} A set of child instances.
4154 * @internal
4155 */
4156 instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID) // 0 in production and for roots
4157 {
4158 if (nestedChildNodes == null) {
4159 return null;
4160 }
4161 var childInstances = {};
4162
4163 if ("development" !== 'production') {
4164 traverseAllChildren(nestedChildNodes, function (childInsts, child, name) {
4165 return instantiateChild(childInsts, child, name, selfDebugID);
4166 }, childInstances);
4167 } else {
4168 traverseAllChildren(nestedChildNodes, instantiateChild, childInstances);
4169 }
4170 return childInstances;
4171 },
4172
4173 /**
4174 * Updates the rendered children and returns a new set of children.
4175 *
4176 * @param {?object} prevChildren Previously initialized set of children.
4177 * @param {?object} nextChildren Flat child element maps.
4178 * @param {ReactReconcileTransaction} transaction
4179 * @param {object} context
4180 * @return {?object} A new set of child instances.
4181 * @internal
4182 */
4183 updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID) // 0 in production and for roots
4184 {
4185 // We currently don't have a way to track moves here but if we use iterators
4186 // instead of for..in we can zip the iterators and check if an item has
4187 // moved.
4188 // TODO: If nothing has changed, return the prevChildren object so that we
4189 // can quickly bailout if nothing has changed.
4190 if (!nextChildren && !prevChildren) {
4191 return;
4192 }
4193 var name;
4194 var prevChild;
4195 for (name in nextChildren) {
4196 if (!nextChildren.hasOwnProperty(name)) {
4197 continue;
4198 }
4199 prevChild = prevChildren && prevChildren[name];
4200 var prevElement = prevChild && prevChild._currentElement;
4201 var nextElement = nextChildren[name];
4202 if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) {
4203 ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context);
4204 nextChildren[name] = prevChild;
4205 } else {
4206 if (prevChild) {
4207 removedNodes[name] = ReactReconciler.getHostNode(prevChild);
4208 ReactReconciler.unmountComponent(prevChild, false);
4209 }
4210 // The child must be instantiated before it's mounted.
4211 var nextChildInstance = instantiateReactComponent(nextElement, true);
4212 nextChildren[name] = nextChildInstance;
4213 // Creating mount image now ensures refs are resolved in right order
4214 // (see https://github.com/facebook/react/pull/7101 for explanation).
4215 var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID);
4216 mountImages.push(nextChildMountImage);
4217 }
4218 }
4219 // Unmount children that are no longer present.
4220 for (name in prevChildren) {
4221 if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
4222 prevChild = prevChildren[name];
4223 removedNodes[name] = ReactReconciler.getHostNode(prevChild);
4224 ReactReconciler.unmountComponent(prevChild, false);
4225 }
4226 }
4227 },
4228
4229 /**
4230 * Unmounts all rendered children. This should be used to clean up children
4231 * when this component is unmounted.
4232 *
4233 * @param {?object} renderedChildren Previously initialized set of children.
4234 * @internal
4235 */
4236 unmountChildren: function (renderedChildren, safely) {
4237 for (var name in renderedChildren) {
4238 if (renderedChildren.hasOwnProperty(name)) {
4239 var renderedChild = renderedChildren[name];
4240 ReactReconciler.unmountComponent(renderedChild, safely);
4241 }
4242 }
4243 }
4244};
4245
4246module.exports = ReactChildReconciler;
4247}).call(this,undefined)
4248},{"112":112,"119":119,"120":120,"122":122,"148":148,"22":22,"68":68}],27:[function(_dereq_,module,exports){
4249/**
4250 * Copyright (c) 2013-present, Facebook, Inc.
4251 *
4252 * This source code is licensed under the MIT license found in the
4253 * LICENSE file in the root directory of this source tree.
4254 *
4255 */
4256
4257'use strict';
4258
4259var DOMChildrenOperations = _dereq_(8);
4260var ReactDOMIDOperations = _dereq_(35);
4261
4262/**
4263 * Abstracts away all functionality of the reconciler that requires knowledge of
4264 * the browser context. TODO: These callers should be refactored to avoid the
4265 * need for this injection.
4266 */
4267var ReactComponentBrowserEnvironment = {
4268 processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates,
4269
4270 replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup
4271};
4272
4273module.exports = ReactComponentBrowserEnvironment;
4274},{"35":35,"8":8}],28:[function(_dereq_,module,exports){
4275/**
4276 * Copyright (c) 2014-present, Facebook, Inc.
4277 *
4278 * This source code is licensed under the MIT license found in the
4279 * LICENSE file in the root directory of this source tree.
4280 *
4281 *
4282 */
4283
4284'use strict';
4285
4286var _prodInvariant = _dereq_(116);
4287
4288var invariant = _dereq_(141);
4289
4290var injected = false;
4291
4292var ReactComponentEnvironment = {
4293 /**
4294 * Optionally injectable hook for swapping out mount images in the middle of
4295 * the tree.
4296 */
4297 replaceNodeWithMarkup: null,
4298
4299 /**
4300 * Optionally injectable hook for processing a queue of child updates. Will
4301 * later move into MultiChildComponents.
4302 */
4303 processChildrenUpdates: null,
4304
4305 injection: {
4306 injectEnvironment: function (environment) {
4307 !!injected ? "development" !== 'production' ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0;
4308 ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup;
4309 ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates;
4310 injected = true;
4311 }
4312 }
4313};
4314
4315module.exports = ReactComponentEnvironment;
4316},{"116":116,"141":141}],29:[function(_dereq_,module,exports){
4317/**
4318 * Copyright (c) 2013-present, Facebook, Inc.
4319 *
4320 * This source code is licensed under the MIT license found in the
4321 * LICENSE file in the root directory of this source tree.
4322 *
4323 */
4324
4325'use strict';
4326
4327var _prodInvariant = _dereq_(116),
4328 _assign = _dereq_(149);
4329
4330var React = _dereq_(124);
4331var ReactComponentEnvironment = _dereq_(28);
4332var ReactCurrentOwner = _dereq_(123);
4333var ReactErrorUtils = _dereq_(50);
4334var ReactInstanceMap = _dereq_(58);
4335var ReactInstrumentation = _dereq_(59);
4336var ReactNodeTypes = _dereq_(63);
4337var ReactReconciler = _dereq_(68);
4338
4339if ("development" !== 'production') {
4340 var checkReactTypeSpec = _dereq_(97);
4341}
4342
4343var emptyObject = _dereq_(134);
4344var invariant = _dereq_(141);
4345var shallowEqual = _dereq_(147);
4346var shouldUpdateReactComponent = _dereq_(119);
4347var warning = _dereq_(148);
4348
4349var CompositeTypes = {
4350 ImpureClass: 0,
4351 PureClass: 1,
4352 StatelessFunctional: 2
4353};
4354
4355function StatelessComponent(Component) {}
4356StatelessComponent.prototype.render = function () {
4357 var Component = ReactInstanceMap.get(this)._currentElement.type;
4358 var element = Component(this.props, this.context, this.updater);
4359 warnIfInvalidElement(Component, element);
4360 return element;
4361};
4362
4363function warnIfInvalidElement(Component, element) {
4364 if ("development" !== 'production') {
4365 "development" !== 'production' ? warning(element === null || element === false || React.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;
4366 "development" !== 'production' ? warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component') : void 0;
4367 }
4368}
4369
4370function shouldConstruct(Component) {
4371 return !!(Component.prototype && Component.prototype.isReactComponent);
4372}
4373
4374function isPureComponent(Component) {
4375 return !!(Component.prototype && Component.prototype.isPureReactComponent);
4376}
4377
4378// Separated into a function to contain deoptimizations caused by try/finally.
4379function measureLifeCyclePerf(fn, debugID, timerType) {
4380 if (debugID === 0) {
4381 // Top-level wrappers (see ReactMount) and empty components (see
4382 // ReactDOMEmptyComponent) are invisible to hooks and devtools.
4383 // Both are implementation details that should go away in the future.
4384 return fn();
4385 }
4386
4387 ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType);
4388 try {
4389 return fn();
4390 } finally {
4391 ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType);
4392 }
4393}
4394
4395/**
4396 * ------------------ The Life-Cycle of a Composite Component ------------------
4397 *
4398 * - constructor: Initialization of state. The instance is now retained.
4399 * - componentWillMount
4400 * - render
4401 * - [children's constructors]
4402 * - [children's componentWillMount and render]
4403 * - [children's componentDidMount]
4404 * - componentDidMount
4405 *
4406 * Update Phases:
4407 * - componentWillReceiveProps (only called if parent updated)
4408 * - shouldComponentUpdate
4409 * - componentWillUpdate
4410 * - render
4411 * - [children's constructors or receive props phases]
4412 * - componentDidUpdate
4413 *
4414 * - componentWillUnmount
4415 * - [children's componentWillUnmount]
4416 * - [children destroyed]
4417 * - (destroyed): The instance is now blank, released by React and ready for GC.
4418 *
4419 * -----------------------------------------------------------------------------
4420 */
4421
4422/**
4423 * An incrementing ID assigned to each component when it is mounted. This is
4424 * used to enforce the order in which `ReactUpdates` updates dirty components.
4425 *
4426 * @private
4427 */
4428var nextMountID = 1;
4429
4430/**
4431 * @lends {ReactCompositeComponent.prototype}
4432 */
4433var ReactCompositeComponent = {
4434 /**
4435 * Base constructor for all composite component.
4436 *
4437 * @param {ReactElement} element
4438 * @final
4439 * @internal
4440 */
4441 construct: function (element) {
4442 this._currentElement = element;
4443 this._rootNodeID = 0;
4444 this._compositeType = null;
4445 this._instance = null;
4446 this._hostParent = null;
4447 this._hostContainerInfo = null;
4448
4449 // See ReactUpdateQueue
4450 this._updateBatchNumber = null;
4451 this._pendingElement = null;
4452 this._pendingStateQueue = null;
4453 this._pendingReplaceState = false;
4454 this._pendingForceUpdate = false;
4455
4456 this._renderedNodeType = null;
4457 this._renderedComponent = null;
4458 this._context = null;
4459 this._mountOrder = 0;
4460 this._topLevelWrapper = null;
4461
4462 // See ReactUpdates and ReactUpdateQueue.
4463 this._pendingCallbacks = null;
4464
4465 // ComponentWillUnmount shall only be called once
4466 this._calledComponentWillUnmount = false;
4467
4468 if ("development" !== 'production') {
4469 this._warnedAboutRefsInRender = false;
4470 }
4471 },
4472
4473 /**
4474 * Initializes the component, renders markup, and registers event listeners.
4475 *
4476 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
4477 * @param {?object} hostParent
4478 * @param {?object} hostContainerInfo
4479 * @param {?object} context
4480 * @return {?string} Rendered markup to be inserted into the DOM.
4481 * @final
4482 * @internal
4483 */
4484 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
4485 var _this = this;
4486
4487 this._context = context;
4488 this._mountOrder = nextMountID++;
4489 this._hostParent = hostParent;
4490 this._hostContainerInfo = hostContainerInfo;
4491
4492 var publicProps = this._currentElement.props;
4493 var publicContext = this._processContext(context);
4494
4495 var Component = this._currentElement.type;
4496
4497 var updateQueue = transaction.getUpdateQueue();
4498
4499 // Initialize the public class
4500 var doConstruct = shouldConstruct(Component);
4501 var inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue);
4502 var renderedElement;
4503
4504 // Support functional components
4505 if (!doConstruct && (inst == null || inst.render == null)) {
4506 renderedElement = inst;
4507 warnIfInvalidElement(Component, renderedElement);
4508 !(inst === null || inst === false || React.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;
4509 inst = new StatelessComponent(Component);
4510 this._compositeType = CompositeTypes.StatelessFunctional;
4511 } else {
4512 if (isPureComponent(Component)) {
4513 this._compositeType = CompositeTypes.PureClass;
4514 } else {
4515 this._compositeType = CompositeTypes.ImpureClass;
4516 }
4517 }
4518
4519 if ("development" !== 'production') {
4520 // This will throw later in _renderValidatedComponent, but add an early
4521 // warning now to help debugging
4522 if (inst.render == null) {
4523 "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;
4524 }
4525
4526 var propsMutated = inst.props !== publicProps;
4527 var componentName = Component.displayName || Component.name || 'Component';
4528
4529 "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;
4530 }
4531
4532 // These should be set up in the constructor, but as a convenience for
4533 // simpler class abstractions, we set them up after the fact.
4534 inst.props = publicProps;
4535 inst.context = publicContext;
4536 inst.refs = emptyObject;
4537 inst.updater = updateQueue;
4538
4539 this._instance = inst;
4540
4541 // Store a reference from the instance back to the internal representation
4542 ReactInstanceMap.set(inst, this);
4543
4544 if ("development" !== 'production') {
4545 // Since plain JS classes are defined without any special initialization
4546 // logic, we can not catch common errors early. Therefore, we have to
4547 // catch them here, at initialization time, instead.
4548 "development" !== 'production' ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, '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;
4549 "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;
4550 "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;
4551 "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;
4552 "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;
4553 "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;
4554 "development" !== 'production' ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0;
4555 }
4556
4557 var initialState = inst.state;
4558 if (initialState === undefined) {
4559 inst.state = initialState = null;
4560 }
4561 !(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;
4562
4563 this._pendingStateQueue = null;
4564 this._pendingReplaceState = false;
4565 this._pendingForceUpdate = false;
4566
4567 var markup;
4568 if (inst.unstable_handleError) {
4569 markup = this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context);
4570 } else {
4571 markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
4572 }
4573
4574 if (inst.componentDidMount) {
4575 if ("development" !== 'production') {
4576 transaction.getReactMountReady().enqueue(function () {
4577 measureLifeCyclePerf(function () {
4578 return inst.componentDidMount();
4579 }, _this._debugID, 'componentDidMount');
4580 });
4581 } else {
4582 transaction.getReactMountReady().enqueue(inst.componentDidMount, inst);
4583 }
4584 }
4585
4586 return markup;
4587 },
4588
4589 _constructComponent: function (doConstruct, publicProps, publicContext, updateQueue) {
4590 if ("development" !== 'production' && !doConstruct) {
4591 ReactCurrentOwner.current = this;
4592 try {
4593 return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
4594 } finally {
4595 ReactCurrentOwner.current = null;
4596 }
4597 } else {
4598 return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue);
4599 }
4600 },
4601
4602 _constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) {
4603 var Component = this._currentElement.type;
4604
4605 if (doConstruct) {
4606 if ("development" !== 'production') {
4607 return measureLifeCyclePerf(function () {
4608 return new Component(publicProps, publicContext, updateQueue);
4609 }, this._debugID, 'ctor');
4610 } else {
4611 return new Component(publicProps, publicContext, updateQueue);
4612 }
4613 }
4614
4615 // This can still be an instance in case of factory components
4616 // but we'll count this as time spent rendering as the more common case.
4617 if ("development" !== 'production') {
4618 return measureLifeCyclePerf(function () {
4619 return Component(publicProps, publicContext, updateQueue);
4620 }, this._debugID, 'render');
4621 } else {
4622 return Component(publicProps, publicContext, updateQueue);
4623 }
4624 },
4625
4626 performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
4627 var markup;
4628 var checkpoint = transaction.checkpoint();
4629 try {
4630 markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
4631 } catch (e) {
4632 // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint
4633 transaction.rollback(checkpoint);
4634 this._instance.unstable_handleError(e);
4635 if (this._pendingStateQueue) {
4636 this._instance.state = this._processPendingState(this._instance.props, this._instance.context);
4637 }
4638 checkpoint = transaction.checkpoint();
4639
4640 this._renderedComponent.unmountComponent(true);
4641 transaction.rollback(checkpoint);
4642
4643 // Try again - we've informed the component about the error, so they can render an error message this time.
4644 // If this throws again, the error will bubble up (and can be caught by a higher error boundary).
4645 markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context);
4646 }
4647 return markup;
4648 },
4649
4650 performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) {
4651 var inst = this._instance;
4652
4653 var debugID = 0;
4654 if ("development" !== 'production') {
4655 debugID = this._debugID;
4656 }
4657
4658 if (inst.componentWillMount) {
4659 if ("development" !== 'production') {
4660 measureLifeCyclePerf(function () {
4661 return inst.componentWillMount();
4662 }, debugID, 'componentWillMount');
4663 } else {
4664 inst.componentWillMount();
4665 }
4666 // When mounting, calls to `setState` by `componentWillMount` will set
4667 // `this._pendingStateQueue` without triggering a re-render.
4668 if (this._pendingStateQueue) {
4669 inst.state = this._processPendingState(inst.props, inst.context);
4670 }
4671 }
4672
4673 // If not a stateless component, we now render
4674 if (renderedElement === undefined) {
4675 renderedElement = this._renderValidatedComponent();
4676 }
4677
4678 var nodeType = ReactNodeTypes.getType(renderedElement);
4679 this._renderedNodeType = nodeType;
4680 var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
4681 );
4682 this._renderedComponent = child;
4683
4684 var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID);
4685
4686 if ("development" !== 'production') {
4687 if (debugID !== 0) {
4688 var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
4689 ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
4690 }
4691 }
4692
4693 return markup;
4694 },
4695
4696 getHostNode: function () {
4697 return ReactReconciler.getHostNode(this._renderedComponent);
4698 },
4699
4700 /**
4701 * Releases any resources allocated by `mountComponent`.
4702 *
4703 * @final
4704 * @internal
4705 */
4706 unmountComponent: function (safely) {
4707 if (!this._renderedComponent) {
4708 return;
4709 }
4710
4711 var inst = this._instance;
4712
4713 if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) {
4714 inst._calledComponentWillUnmount = true;
4715
4716 if (safely) {
4717 var name = this.getName() + '.componentWillUnmount()';
4718 ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst));
4719 } else {
4720 if ("development" !== 'production') {
4721 measureLifeCyclePerf(function () {
4722 return inst.componentWillUnmount();
4723 }, this._debugID, 'componentWillUnmount');
4724 } else {
4725 inst.componentWillUnmount();
4726 }
4727 }
4728 }
4729
4730 if (this._renderedComponent) {
4731 ReactReconciler.unmountComponent(this._renderedComponent, safely);
4732 this._renderedNodeType = null;
4733 this._renderedComponent = null;
4734 this._instance = null;
4735 }
4736
4737 // Reset pending fields
4738 // Even if this component is scheduled for another update in ReactUpdates,
4739 // it would still be ignored because these fields are reset.
4740 this._pendingStateQueue = null;
4741 this._pendingReplaceState = false;
4742 this._pendingForceUpdate = false;
4743 this._pendingCallbacks = null;
4744 this._pendingElement = null;
4745
4746 // These fields do not really need to be reset since this object is no
4747 // longer accessible.
4748 this._context = null;
4749 this._rootNodeID = 0;
4750 this._topLevelWrapper = null;
4751
4752 // Delete the reference from the instance to this internal representation
4753 // which allow the internals to be properly cleaned up even if the user
4754 // leaks a reference to the public instance.
4755 ReactInstanceMap.remove(inst);
4756
4757 // Some existing components rely on inst.props even after they've been
4758 // destroyed (in event handlers).
4759 // TODO: inst.props = null;
4760 // TODO: inst.state = null;
4761 // TODO: inst.context = null;
4762 },
4763
4764 /**
4765 * Filters the context object to only contain keys specified in
4766 * `contextTypes`
4767 *
4768 * @param {object} context
4769 * @return {?object}
4770 * @private
4771 */
4772 _maskContext: function (context) {
4773 var Component = this._currentElement.type;
4774 var contextTypes = Component.contextTypes;
4775 if (!contextTypes) {
4776 return emptyObject;
4777 }
4778 var maskedContext = {};
4779 for (var contextName in contextTypes) {
4780 maskedContext[contextName] = context[contextName];
4781 }
4782 return maskedContext;
4783 },
4784
4785 /**
4786 * Filters the context object to only contain keys specified in
4787 * `contextTypes`, and asserts that they are valid.
4788 *
4789 * @param {object} context
4790 * @return {?object}
4791 * @private
4792 */
4793 _processContext: function (context) {
4794 var maskedContext = this._maskContext(context);
4795 if ("development" !== 'production') {
4796 var Component = this._currentElement.type;
4797 if (Component.contextTypes) {
4798 this._checkContextTypes(Component.contextTypes, maskedContext, 'context');
4799 }
4800 }
4801 return maskedContext;
4802 },
4803
4804 /**
4805 * @param {object} currentContext
4806 * @return {object}
4807 * @private
4808 */
4809 _processChildContext: function (currentContext) {
4810 var Component = this._currentElement.type;
4811 var inst = this._instance;
4812 var childContext;
4813
4814 if (inst.getChildContext) {
4815 if ("development" !== 'production') {
4816 ReactInstrumentation.debugTool.onBeginProcessingChildContext();
4817 try {
4818 childContext = inst.getChildContext();
4819 } finally {
4820 ReactInstrumentation.debugTool.onEndProcessingChildContext();
4821 }
4822 } else {
4823 childContext = inst.getChildContext();
4824 }
4825 }
4826
4827 if (childContext) {
4828 !(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;
4829 if ("development" !== 'production') {
4830 this._checkContextTypes(Component.childContextTypes, childContext, 'child context');
4831 }
4832 for (var name in childContext) {
4833 !(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;
4834 }
4835 return _assign({}, currentContext, childContext);
4836 }
4837 return currentContext;
4838 },
4839
4840 /**
4841 * Assert that the context types are valid
4842 *
4843 * @param {object} typeSpecs Map of context field to a ReactPropType
4844 * @param {object} values Runtime values that need to be type-checked
4845 * @param {string} location e.g. "prop", "context", "child context"
4846 * @private
4847 */
4848 _checkContextTypes: function (typeSpecs, values, location) {
4849 if ("development" !== 'production') {
4850 checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID);
4851 }
4852 },
4853
4854 receiveComponent: function (nextElement, transaction, nextContext) {
4855 var prevElement = this._currentElement;
4856 var prevContext = this._context;
4857
4858 this._pendingElement = null;
4859
4860 this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext);
4861 },
4862
4863 /**
4864 * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate`
4865 * is set, update the component.
4866 *
4867 * @param {ReactReconcileTransaction} transaction
4868 * @internal
4869 */
4870 performUpdateIfNecessary: function (transaction) {
4871 if (this._pendingElement != null) {
4872 ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context);
4873 } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) {
4874 this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context);
4875 } else {
4876 this._updateBatchNumber = null;
4877 }
4878 },
4879
4880 /**
4881 * Perform an update to a mounted component. The componentWillReceiveProps and
4882 * shouldComponentUpdate methods are called, then (assuming the update isn't
4883 * skipped) the remaining update lifecycle methods are called and the DOM
4884 * representation is updated.
4885 *
4886 * By default, this implements React's rendering and reconciliation algorithm.
4887 * Sophisticated clients may wish to override this.
4888 *
4889 * @param {ReactReconcileTransaction} transaction
4890 * @param {ReactElement} prevParentElement
4891 * @param {ReactElement} nextParentElement
4892 * @internal
4893 * @overridable
4894 */
4895 updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) {
4896 var inst = this._instance;
4897 !(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;
4898
4899 var willReceive = false;
4900 var nextContext;
4901
4902 // Determine if the context has changed or not
4903 if (this._context === nextUnmaskedContext) {
4904 nextContext = inst.context;
4905 } else {
4906 nextContext = this._processContext(nextUnmaskedContext);
4907 willReceive = true;
4908 }
4909
4910 var prevProps = prevParentElement.props;
4911 var nextProps = nextParentElement.props;
4912
4913 // Not a simple state update but a props update
4914 if (prevParentElement !== nextParentElement) {
4915 willReceive = true;
4916 }
4917
4918 // An update here will schedule an update but immediately set
4919 // _pendingStateQueue which will ensure that any state updates gets
4920 // immediately reconciled instead of waiting for the next batch.
4921 if (willReceive && inst.componentWillReceiveProps) {
4922 if ("development" !== 'production') {
4923 measureLifeCyclePerf(function () {
4924 return inst.componentWillReceiveProps(nextProps, nextContext);
4925 }, this._debugID, 'componentWillReceiveProps');
4926 } else {
4927 inst.componentWillReceiveProps(nextProps, nextContext);
4928 }
4929 }
4930
4931 var nextState = this._processPendingState(nextProps, nextContext);
4932 var shouldUpdate = true;
4933
4934 if (!this._pendingForceUpdate) {
4935 if (inst.shouldComponentUpdate) {
4936 if ("development" !== 'production') {
4937 shouldUpdate = measureLifeCyclePerf(function () {
4938 return inst.shouldComponentUpdate(nextProps, nextState, nextContext);
4939 }, this._debugID, 'shouldComponentUpdate');
4940 } else {
4941 shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext);
4942 }
4943 } else {
4944 if (this._compositeType === CompositeTypes.PureClass) {
4945 shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState);
4946 }
4947 }
4948 }
4949
4950 if ("development" !== 'production') {
4951 "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;
4952 }
4953
4954 this._updateBatchNumber = null;
4955 if (shouldUpdate) {
4956 this._pendingForceUpdate = false;
4957 // Will set `this.props`, `this.state` and `this.context`.
4958 this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext);
4959 } else {
4960 // If it's determined that a component should not update, we still want
4961 // to set props and state but we shortcut the rest of the update.
4962 this._currentElement = nextParentElement;
4963 this._context = nextUnmaskedContext;
4964 inst.props = nextProps;
4965 inst.state = nextState;
4966 inst.context = nextContext;
4967 }
4968 },
4969
4970 _processPendingState: function (props, context) {
4971 var inst = this._instance;
4972 var queue = this._pendingStateQueue;
4973 var replace = this._pendingReplaceState;
4974 this._pendingReplaceState = false;
4975 this._pendingStateQueue = null;
4976
4977 if (!queue) {
4978 return inst.state;
4979 }
4980
4981 if (replace && queue.length === 1) {
4982 return queue[0];
4983 }
4984
4985 var nextState = _assign({}, replace ? queue[0] : inst.state);
4986 for (var i = replace ? 1 : 0; i < queue.length; i++) {
4987 var partial = queue[i];
4988 _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial);
4989 }
4990
4991 return nextState;
4992 },
4993
4994 /**
4995 * Merges new props and state, notifies delegate methods of update and
4996 * performs update.
4997 *
4998 * @param {ReactElement} nextElement Next element
4999 * @param {object} nextProps Next public object to set as properties.
5000 * @param {?object} nextState Next object to set as state.
5001 * @param {?object} nextContext Next public object to set as context.
5002 * @param {ReactReconcileTransaction} transaction
5003 * @param {?object} unmaskedContext
5004 * @private
5005 */
5006 _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) {
5007 var _this2 = this;
5008
5009 var inst = this._instance;
5010
5011 var hasComponentDidUpdate = Boolean(inst.componentDidUpdate);
5012 var prevProps;
5013 var prevState;
5014 var prevContext;
5015 if (hasComponentDidUpdate) {
5016 prevProps = inst.props;
5017 prevState = inst.state;
5018 prevContext = inst.context;
5019 }
5020
5021 if (inst.componentWillUpdate) {
5022 if ("development" !== 'production') {
5023 measureLifeCyclePerf(function () {
5024 return inst.componentWillUpdate(nextProps, nextState, nextContext);
5025 }, this._debugID, 'componentWillUpdate');
5026 } else {
5027 inst.componentWillUpdate(nextProps, nextState, nextContext);
5028 }
5029 }
5030
5031 this._currentElement = nextElement;
5032 this._context = unmaskedContext;
5033 inst.props = nextProps;
5034 inst.state = nextState;
5035 inst.context = nextContext;
5036
5037 this._updateRenderedComponent(transaction, unmaskedContext);
5038
5039 if (hasComponentDidUpdate) {
5040 if ("development" !== 'production') {
5041 transaction.getReactMountReady().enqueue(function () {
5042 measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate');
5043 });
5044 } else {
5045 transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst);
5046 }
5047 }
5048 },
5049
5050 /**
5051 * Call the component's `render` method and update the DOM accordingly.
5052 *
5053 * @param {ReactReconcileTransaction} transaction
5054 * @internal
5055 */
5056 _updateRenderedComponent: function (transaction, context) {
5057 var prevComponentInstance = this._renderedComponent;
5058 var prevRenderedElement = prevComponentInstance._currentElement;
5059 var nextRenderedElement = this._renderValidatedComponent();
5060
5061 var debugID = 0;
5062 if ("development" !== 'production') {
5063 debugID = this._debugID;
5064 }
5065
5066 if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) {
5067 ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context));
5068 } else {
5069 var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance);
5070 ReactReconciler.unmountComponent(prevComponentInstance, false);
5071
5072 var nodeType = ReactNodeTypes.getType(nextRenderedElement);
5073 this._renderedNodeType = nodeType;
5074 var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */
5075 );
5076 this._renderedComponent = child;
5077
5078 var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID);
5079
5080 if ("development" !== 'production') {
5081 if (debugID !== 0) {
5082 var childDebugIDs = child._debugID !== 0 ? [child._debugID] : [];
5083 ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs);
5084 }
5085 }
5086
5087 this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance);
5088 }
5089 },
5090
5091 /**
5092 * Overridden in shallow rendering.
5093 *
5094 * @protected
5095 */
5096 _replaceNodeWithMarkup: function (oldHostNode, nextMarkup, prevInstance) {
5097 ReactComponentEnvironment.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance);
5098 },
5099
5100 /**
5101 * @protected
5102 */
5103 _renderValidatedComponentWithoutOwnerOrContext: function () {
5104 var inst = this._instance;
5105 var renderedElement;
5106
5107 if ("development" !== 'production') {
5108 renderedElement = measureLifeCyclePerf(function () {
5109 return inst.render();
5110 }, this._debugID, 'render');
5111 } else {
5112 renderedElement = inst.render();
5113 }
5114
5115 if ("development" !== 'production') {
5116 // We allow auto-mocks to proceed as if they're returning null.
5117 if (renderedElement === undefined && inst.render._isMockFunction) {
5118 // This is probably bad practice. Consider warning here and
5119 // deprecating this convenience.
5120 renderedElement = null;
5121 }
5122 }
5123
5124 return renderedElement;
5125 },
5126
5127 /**
5128 * @private
5129 */
5130 _renderValidatedComponent: function () {
5131 var renderedElement;
5132 if ("development" !== 'production' || this._compositeType !== CompositeTypes.StatelessFunctional) {
5133 ReactCurrentOwner.current = this;
5134 try {
5135 renderedElement = this._renderValidatedComponentWithoutOwnerOrContext();
5136 } finally {
5137 ReactCurrentOwner.current = null;
5138 }
5139 } else {
5140 renderedElement = this._renderValidatedComponentWithoutOwnerOrContext();
5141 }
5142 !(
5143 // TODO: An `isValidNode` function would probably be more appropriate
5144 renderedElement === null || renderedElement === false || React.isValidElement(renderedElement)) ? "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;
5145
5146 return renderedElement;
5147 },
5148
5149 /**
5150 * Lazily allocates the refs object and stores `component` as `ref`.
5151 *
5152 * @param {string} ref Reference name.
5153 * @param {component} component Component to store as `ref`.
5154 * @final
5155 * @private
5156 */
5157 attachRef: function (ref, component) {
5158 var inst = this.getPublicInstance();
5159 !(inst != null) ? "development" !== 'production' ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0;
5160 var publicComponentInstance = component.getPublicInstance();
5161 if ("development" !== 'production') {
5162 var componentName = component && component.getName ? component.getName() : 'a component';
5163 "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;
5164 }
5165 var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs;
5166 refs[ref] = publicComponentInstance;
5167 },
5168
5169 /**
5170 * Detaches a reference name.
5171 *
5172 * @param {string} ref Name to dereference.
5173 * @final
5174 * @private
5175 */
5176 detachRef: function (ref) {
5177 var refs = this.getPublicInstance().refs;
5178 delete refs[ref];
5179 },
5180
5181 /**
5182 * Get a text description of the component that can be used to identify it
5183 * in error messages.
5184 * @return {string} The name or null.
5185 * @internal
5186 */
5187 getName: function () {
5188 var type = this._currentElement.type;
5189 var constructor = this._instance && this._instance.constructor;
5190 return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
5191 },
5192
5193 /**
5194 * Get the publicly accessible representation of this component - i.e. what
5195 * is exposed by refs and returned by render. Can be null for stateless
5196 * components.
5197 *
5198 * @return {ReactComponent} the public component instance.
5199 * @internal
5200 */
5201 getPublicInstance: function () {
5202 var inst = this._instance;
5203 if (this._compositeType === CompositeTypes.StatelessFunctional) {
5204 return null;
5205 }
5206 return inst;
5207 },
5208
5209 // Stub
5210 _instantiateReactComponent: null
5211};
5212
5213module.exports = ReactCompositeComponent;
5214},{"116":116,"119":119,"123":123,"124":124,"134":134,"141":141,"147":147,"148":148,"149":149,"28":28,"50":50,"58":58,"59":59,"63":63,"68":68,"97":97}],30:[function(_dereq_,module,exports){
5215/**
5216 * Copyright (c) 2013-present, Facebook, Inc.
5217 *
5218 * This source code is licensed under the MIT license found in the
5219 * LICENSE file in the root directory of this source tree.
5220 *
5221 */
5222
5223/* global hasOwnProperty:true */
5224
5225'use strict';
5226
5227var _prodInvariant = _dereq_(116),
5228 _assign = _dereq_(149);
5229
5230var AutoFocusUtils = _dereq_(2);
5231var CSSPropertyOperations = _dereq_(5);
5232var DOMLazyTree = _dereq_(9);
5233var DOMNamespaces = _dereq_(10);
5234var DOMProperty = _dereq_(11);
5235var DOMPropertyOperations = _dereq_(12);
5236var EventPluginHub = _dereq_(16);
5237var EventPluginRegistry = _dereq_(17);
5238var ReactBrowserEventEmitter = _dereq_(25);
5239var ReactDOMComponentFlags = _dereq_(31);
5240var ReactDOMComponentTree = _dereq_(32);
5241var ReactDOMInput = _dereq_(36);
5242var ReactDOMOption = _dereq_(37);
5243var ReactDOMSelect = _dereq_(38);
5244var ReactDOMTextarea = _dereq_(43);
5245var ReactInstrumentation = _dereq_(59);
5246var ReactMultiChild = _dereq_(62);
5247var ReactServerRenderingTransaction = _dereq_(72);
5248
5249var emptyFunction = _dereq_(133);
5250var escapeTextContentForBrowser = _dereq_(100);
5251var invariant = _dereq_(141);
5252var isEventSupported = _dereq_(113);
5253var shallowEqual = _dereq_(147);
5254var inputValueTracking = _dereq_(111);
5255var validateDOMNesting = _dereq_(121);
5256var warning = _dereq_(148);
5257
5258var Flags = ReactDOMComponentFlags;
5259var deleteListener = EventPluginHub.deleteListener;
5260var getNode = ReactDOMComponentTree.getNodeFromInstance;
5261var listenTo = ReactBrowserEventEmitter.listenTo;
5262var registrationNameModules = EventPluginRegistry.registrationNameModules;
5263
5264// For quickly matching children type, to test if can be treated as content.
5265var CONTENT_TYPES = { string: true, number: true };
5266
5267var STYLE = 'style';
5268var HTML = '__html';
5269var RESERVED_PROPS = {
5270 children: null,
5271 dangerouslySetInnerHTML: null,
5272 suppressContentEditableWarning: null
5273};
5274
5275// Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE).
5276var DOC_FRAGMENT_TYPE = 11;
5277
5278function getDeclarationErrorAddendum(internalInstance) {
5279 if (internalInstance) {
5280 var owner = internalInstance._currentElement._owner || null;
5281 if (owner) {
5282 var name = owner.getName();
5283 if (name) {
5284 return ' This DOM node was rendered by `' + name + '`.';
5285 }
5286 }
5287 }
5288 return '';
5289}
5290
5291function friendlyStringify(obj) {
5292 if (typeof obj === 'object') {
5293 if (Array.isArray(obj)) {
5294 return '[' + obj.map(friendlyStringify).join(', ') + ']';
5295 } else {
5296 var pairs = [];
5297 for (var key in obj) {
5298 if (Object.prototype.hasOwnProperty.call(obj, key)) {
5299 var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key);
5300 pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key]));
5301 }
5302 }
5303 return '{' + pairs.join(', ') + '}';
5304 }
5305 } else if (typeof obj === 'string') {
5306 return JSON.stringify(obj);
5307 } else if (typeof obj === 'function') {
5308 return '[function object]';
5309 }
5310 // Differs from JSON.stringify in that undefined because undefined and that
5311 // inf and nan don't become null
5312 return String(obj);
5313}
5314
5315var styleMutationWarning = {};
5316
5317function checkAndWarnForMutatedStyle(style1, style2, component) {
5318 if (style1 == null || style2 == null) {
5319 return;
5320 }
5321 if (shallowEqual(style1, style2)) {
5322 return;
5323 }
5324
5325 var componentName = component._tag;
5326 var owner = component._currentElement._owner;
5327 var ownerName;
5328 if (owner) {
5329 ownerName = owner.getName();
5330 }
5331
5332 var hash = ownerName + '|' + componentName;
5333
5334 if (styleMutationWarning.hasOwnProperty(hash)) {
5335 return;
5336 }
5337
5338 styleMutationWarning[hash] = true;
5339
5340 "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;
5341}
5342
5343/**
5344 * @param {object} component
5345 * @param {?object} props
5346 */
5347function assertValidProps(component, props) {
5348 if (!props) {
5349 return;
5350 }
5351 // Note the use of `==` which checks for null or undefined.
5352 if (voidElementTags[component._tag]) {
5353 !(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;
5354 }
5355 if (props.dangerouslySetInnerHTML != null) {
5356 !(props.children == null) ? "development" !== 'production' ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0;
5357 !(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;
5358 }
5359 if ("development" !== 'production') {
5360 "development" !== 'production' ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0;
5361 "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;
5362 "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;
5363 }
5364 !(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;
5365}
5366
5367function enqueuePutListener(inst, registrationName, listener, transaction) {
5368 if (transaction instanceof ReactServerRenderingTransaction) {
5369 return;
5370 }
5371 if ("development" !== 'production') {
5372 // IE8 has no API for event capturing and the `onScroll` event doesn't
5373 // bubble.
5374 "development" !== 'production' ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), "This browser doesn't support the `onScroll` event") : void 0;
5375 }
5376 var containerInfo = inst._hostContainerInfo;
5377 var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE;
5378 var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument;
5379 listenTo(registrationName, doc);
5380 transaction.getReactMountReady().enqueue(putListener, {
5381 inst: inst,
5382 registrationName: registrationName,
5383 listener: listener
5384 });
5385}
5386
5387function putListener() {
5388 var listenerToPut = this;
5389 EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener);
5390}
5391
5392function inputPostMount() {
5393 var inst = this;
5394 ReactDOMInput.postMountWrapper(inst);
5395}
5396
5397function textareaPostMount() {
5398 var inst = this;
5399 ReactDOMTextarea.postMountWrapper(inst);
5400}
5401
5402function optionPostMount() {
5403 var inst = this;
5404 ReactDOMOption.postMountWrapper(inst);
5405}
5406
5407var setAndValidateContentChildDev = emptyFunction;
5408if ("development" !== 'production') {
5409 setAndValidateContentChildDev = function (content) {
5410 var hasExistingContent = this._contentDebugID != null;
5411 var debugID = this._debugID;
5412 // This ID represents the inlined child that has no backing instance:
5413 var contentDebugID = -debugID;
5414
5415 if (content == null) {
5416 if (hasExistingContent) {
5417 ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID);
5418 }
5419 this._contentDebugID = null;
5420 return;
5421 }
5422
5423 validateDOMNesting(null, String(content), this, this._ancestorInfo);
5424 this._contentDebugID = contentDebugID;
5425 if (hasExistingContent) {
5426 ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content);
5427 ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID);
5428 } else {
5429 ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID);
5430 ReactInstrumentation.debugTool.onMountComponent(contentDebugID);
5431 ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]);
5432 }
5433 };
5434}
5435
5436// There are so many media events, it makes sense to just
5437// maintain a list rather than create a `trapBubbledEvent` for each
5438var mediaEvents = {
5439 topAbort: 'abort',
5440 topCanPlay: 'canplay',
5441 topCanPlayThrough: 'canplaythrough',
5442 topDurationChange: 'durationchange',
5443 topEmptied: 'emptied',
5444 topEncrypted: 'encrypted',
5445 topEnded: 'ended',
5446 topError: 'error',
5447 topLoadedData: 'loadeddata',
5448 topLoadedMetadata: 'loadedmetadata',
5449 topLoadStart: 'loadstart',
5450 topPause: 'pause',
5451 topPlay: 'play',
5452 topPlaying: 'playing',
5453 topProgress: 'progress',
5454 topRateChange: 'ratechange',
5455 topSeeked: 'seeked',
5456 topSeeking: 'seeking',
5457 topStalled: 'stalled',
5458 topSuspend: 'suspend',
5459 topTimeUpdate: 'timeupdate',
5460 topVolumeChange: 'volumechange',
5461 topWaiting: 'waiting'
5462};
5463
5464function trackInputValue() {
5465 inputValueTracking.track(this);
5466}
5467
5468function trapBubbledEventsLocal() {
5469 var inst = this;
5470 // If a component renders to null or if another component fatals and causes
5471 // the state of the tree to be corrupted, `node` here can be null.
5472 !inst._rootNodeID ? "development" !== 'production' ? invariant(false, 'Must be mounted to trap events') : _prodInvariant('63') : void 0;
5473 var node = getNode(inst);
5474 !node ? "development" !== 'production' ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : _prodInvariant('64') : void 0;
5475
5476 switch (inst._tag) {
5477 case 'iframe':
5478 case 'object':
5479 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)];
5480 break;
5481 case 'video':
5482 case 'audio':
5483 inst._wrapperState.listeners = [];
5484 // Create listener for each media event
5485 for (var event in mediaEvents) {
5486 if (mediaEvents.hasOwnProperty(event)) {
5487 inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(event, mediaEvents[event], node));
5488 }
5489 }
5490 break;
5491 case 'source':
5492 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node)];
5493 break;
5494 case 'img':
5495 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node), ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)];
5496 break;
5497 case 'form':
5498 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topReset', 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent('topSubmit', 'submit', node)];
5499 break;
5500 case 'input':
5501 case 'select':
5502 case 'textarea':
5503 inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topInvalid', 'invalid', node)];
5504 break;
5505 }
5506}
5507
5508function postUpdateSelectWrapper() {
5509 ReactDOMSelect.postUpdateWrapper(this);
5510}
5511
5512// For HTML, certain tags should omit their close tag. We keep a whitelist for
5513// those special-case tags.
5514
5515var omittedCloseTags = {
5516 area: true,
5517 base: true,
5518 br: true,
5519 col: true,
5520 embed: true,
5521 hr: true,
5522 img: true,
5523 input: true,
5524 keygen: true,
5525 link: true,
5526 meta: true,
5527 param: true,
5528 source: true,
5529 track: true,
5530 wbr: true
5531 // NOTE: menuitem's close tag should be omitted, but that causes problems.
5532};
5533
5534var newlineEatingTags = {
5535 listing: true,
5536 pre: true,
5537 textarea: true
5538};
5539
5540// For HTML, certain tags cannot have children. This has the same purpose as
5541// `omittedCloseTags` except that `menuitem` should still have its closing tag.
5542
5543var voidElementTags = _assign({
5544 menuitem: true
5545}, omittedCloseTags);
5546
5547// We accept any tag to be rendered but since this gets injected into arbitrary
5548// HTML, we want to make sure that it's a safe tag.
5549// http://www.w3.org/TR/REC-xml/#NT-Name
5550
5551var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
5552var validatedTagCache = {};
5553var hasOwnProperty = {}.hasOwnProperty;
5554
5555function validateDangerousTag(tag) {
5556 if (!hasOwnProperty.call(validatedTagCache, tag)) {
5557 !VALID_TAG_REGEX.test(tag) ? "development" !== 'production' ? invariant(false, 'Invalid tag: %s', tag) : _prodInvariant('65', tag) : void 0;
5558 validatedTagCache[tag] = true;
5559 }
5560}
5561
5562function isCustomComponent(tagName, props) {
5563 return tagName.indexOf('-') >= 0 || props.is != null;
5564}
5565
5566var globalIdCounter = 1;
5567
5568/**
5569 * Creates a new React class that is idempotent and capable of containing other
5570 * React components. It accepts event listeners and DOM properties that are
5571 * valid according to `DOMProperty`.
5572 *
5573 * - Event listeners: `onClick`, `onMouseDown`, etc.
5574 * - DOM properties: `className`, `name`, `title`, etc.
5575 *
5576 * The `style` property functions differently from the DOM API. It accepts an
5577 * object mapping of style properties to values.
5578 *
5579 * @constructor ReactDOMComponent
5580 * @extends ReactMultiChild
5581 */
5582function ReactDOMComponent(element) {
5583 var tag = element.type;
5584 validateDangerousTag(tag);
5585 this._currentElement = element;
5586 this._tag = tag.toLowerCase();
5587 this._namespaceURI = null;
5588 this._renderedChildren = null;
5589 this._previousStyle = null;
5590 this._previousStyleCopy = null;
5591 this._hostNode = null;
5592 this._hostParent = null;
5593 this._rootNodeID = 0;
5594 this._domID = 0;
5595 this._hostContainerInfo = null;
5596 this._wrapperState = null;
5597 this._topLevelWrapper = null;
5598 this._flags = 0;
5599 if ("development" !== 'production') {
5600 this._ancestorInfo = null;
5601 setAndValidateContentChildDev.call(this, null);
5602 }
5603}
5604
5605ReactDOMComponent.displayName = 'ReactDOMComponent';
5606
5607ReactDOMComponent.Mixin = {
5608 /**
5609 * Generates root tag markup then recurses. This method has side effects and
5610 * is not idempotent.
5611 *
5612 * @internal
5613 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
5614 * @param {?ReactDOMComponent} the parent component instance
5615 * @param {?object} info about the host container
5616 * @param {object} context
5617 * @return {string} The computed markup.
5618 */
5619 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
5620 this._rootNodeID = globalIdCounter++;
5621 this._domID = hostContainerInfo._idCounter++;
5622 this._hostParent = hostParent;
5623 this._hostContainerInfo = hostContainerInfo;
5624
5625 var props = this._currentElement.props;
5626
5627 switch (this._tag) {
5628 case 'audio':
5629 case 'form':
5630 case 'iframe':
5631 case 'img':
5632 case 'link':
5633 case 'object':
5634 case 'source':
5635 case 'video':
5636 this._wrapperState = {
5637 listeners: null
5638 };
5639 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
5640 break;
5641 case 'input':
5642 ReactDOMInput.mountWrapper(this, props, hostParent);
5643 props = ReactDOMInput.getHostProps(this, props);
5644 transaction.getReactMountReady().enqueue(trackInputValue, this);
5645 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
5646 break;
5647 case 'option':
5648 ReactDOMOption.mountWrapper(this, props, hostParent);
5649 props = ReactDOMOption.getHostProps(this, props);
5650 break;
5651 case 'select':
5652 ReactDOMSelect.mountWrapper(this, props, hostParent);
5653 props = ReactDOMSelect.getHostProps(this, props);
5654 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
5655 break;
5656 case 'textarea':
5657 ReactDOMTextarea.mountWrapper(this, props, hostParent);
5658 props = ReactDOMTextarea.getHostProps(this, props);
5659 transaction.getReactMountReady().enqueue(trackInputValue, this);
5660 transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
5661 break;
5662 }
5663
5664 assertValidProps(this, props);
5665
5666 // We create tags in the namespace of their parent container, except HTML
5667 // tags get no namespace.
5668 var namespaceURI;
5669 var parentTag;
5670 if (hostParent != null) {
5671 namespaceURI = hostParent._namespaceURI;
5672 parentTag = hostParent._tag;
5673 } else if (hostContainerInfo._tag) {
5674 namespaceURI = hostContainerInfo._namespaceURI;
5675 parentTag = hostContainerInfo._tag;
5676 }
5677 if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') {
5678 namespaceURI = DOMNamespaces.html;
5679 }
5680 if (namespaceURI === DOMNamespaces.html) {
5681 if (this._tag === 'svg') {
5682 namespaceURI = DOMNamespaces.svg;
5683 } else if (this._tag === 'math') {
5684 namespaceURI = DOMNamespaces.mathml;
5685 }
5686 }
5687 this._namespaceURI = namespaceURI;
5688
5689 if ("development" !== 'production') {
5690 var parentInfo;
5691 if (hostParent != null) {
5692 parentInfo = hostParent._ancestorInfo;
5693 } else if (hostContainerInfo._tag) {
5694 parentInfo = hostContainerInfo._ancestorInfo;
5695 }
5696 if (parentInfo) {
5697 // parentInfo should always be present except for the top-level
5698 // component when server rendering
5699 validateDOMNesting(this._tag, null, this, parentInfo);
5700 }
5701 this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this);
5702 }
5703
5704 var mountImage;
5705 if (transaction.useCreateElement) {
5706 var ownerDocument = hostContainerInfo._ownerDocument;
5707 var el;
5708 if (namespaceURI === DOMNamespaces.html) {
5709 if (this._tag === 'script') {
5710 // Create the script via .innerHTML so its "parser-inserted" flag is
5711 // set to true and it does not execute
5712 var div = ownerDocument.createElement('div');
5713 var type = this._currentElement.type;
5714 div.innerHTML = '<' + type + '></' + type + '>';
5715 el = div.removeChild(div.firstChild);
5716 } else if (props.is) {
5717 el = ownerDocument.createElement(this._currentElement.type, props.is);
5718 } else {
5719 // Separate else branch instead of using `props.is || undefined` above becuase of a Firefox bug.
5720 // See discussion in https://github.com/facebook/react/pull/6896
5721 // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
5722 el = ownerDocument.createElement(this._currentElement.type);
5723 }
5724 } else {
5725 el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type);
5726 }
5727 ReactDOMComponentTree.precacheNode(this, el);
5728 this._flags |= Flags.hasCachedChildNodes;
5729 if (!this._hostParent) {
5730 DOMPropertyOperations.setAttributeForRoot(el);
5731 }
5732 this._updateDOMProperties(null, props, transaction);
5733 var lazyTree = DOMLazyTree(el);
5734 this._createInitialChildren(transaction, props, context, lazyTree);
5735 mountImage = lazyTree;
5736 } else {
5737 var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props);
5738 var tagContent = this._createContentMarkup(transaction, props, context);
5739 if (!tagContent && omittedCloseTags[this._tag]) {
5740 mountImage = tagOpen + '/>';
5741 } else {
5742 mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>';
5743 }
5744 }
5745
5746 switch (this._tag) {
5747 case 'input':
5748 transaction.getReactMountReady().enqueue(inputPostMount, this);
5749 if (props.autoFocus) {
5750 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
5751 }
5752 break;
5753 case 'textarea':
5754 transaction.getReactMountReady().enqueue(textareaPostMount, this);
5755 if (props.autoFocus) {
5756 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
5757 }
5758 break;
5759 case 'select':
5760 if (props.autoFocus) {
5761 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
5762 }
5763 break;
5764 case 'button':
5765 if (props.autoFocus) {
5766 transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this);
5767 }
5768 break;
5769 case 'option':
5770 transaction.getReactMountReady().enqueue(optionPostMount, this);
5771 break;
5772 }
5773
5774 return mountImage;
5775 },
5776
5777 /**
5778 * Creates markup for the open tag and all attributes.
5779 *
5780 * This method has side effects because events get registered.
5781 *
5782 * Iterating over object properties is faster than iterating over arrays.
5783 * @see http://jsperf.com/obj-vs-arr-iteration
5784 *
5785 * @private
5786 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
5787 * @param {object} props
5788 * @return {string} Markup of opening tag.
5789 */
5790 _createOpenTagMarkupAndPutListeners: function (transaction, props) {
5791 var ret = '<' + this._currentElement.type;
5792
5793 for (var propKey in props) {
5794 if (!props.hasOwnProperty(propKey)) {
5795 continue;
5796 }
5797 var propValue = props[propKey];
5798 if (propValue == null) {
5799 continue;
5800 }
5801 if (registrationNameModules.hasOwnProperty(propKey)) {
5802 if (propValue) {
5803 enqueuePutListener(this, propKey, propValue, transaction);
5804 }
5805 } else {
5806 if (propKey === STYLE) {
5807 if (propValue) {
5808 if ("development" !== 'production') {
5809 // See `_updateDOMProperties`. style block
5810 this._previousStyle = propValue;
5811 }
5812 propValue = this._previousStyleCopy = _assign({}, props.style);
5813 }
5814 propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this);
5815 }
5816 var markup = null;
5817 if (this._tag != null && isCustomComponent(this._tag, props)) {
5818 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
5819 markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue);
5820 }
5821 } else {
5822 markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue);
5823 }
5824 if (markup) {
5825 ret += ' ' + markup;
5826 }
5827 }
5828 }
5829
5830 // For static pages, no need to put React ID and checksum. Saves lots of
5831 // bytes.
5832 if (transaction.renderToStaticMarkup) {
5833 return ret;
5834 }
5835
5836 if (!this._hostParent) {
5837 ret += ' ' + DOMPropertyOperations.createMarkupForRoot();
5838 }
5839 ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID);
5840 return ret;
5841 },
5842
5843 /**
5844 * Creates markup for the content between the tags.
5845 *
5846 * @private
5847 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
5848 * @param {object} props
5849 * @param {object} context
5850 * @return {string} Content markup.
5851 */
5852 _createContentMarkup: function (transaction, props, context) {
5853 var ret = '';
5854
5855 // Intentional use of != to avoid catching zero/false.
5856 var innerHTML = props.dangerouslySetInnerHTML;
5857 if (innerHTML != null) {
5858 if (innerHTML.__html != null) {
5859 ret = innerHTML.__html;
5860 }
5861 } else {
5862 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
5863 var childrenToUse = contentToUse != null ? null : props.children;
5864 if (contentToUse != null) {
5865 // TODO: Validate that text is allowed as a child of this node
5866 ret = escapeTextContentForBrowser(contentToUse);
5867 if ("development" !== 'production') {
5868 setAndValidateContentChildDev.call(this, contentToUse);
5869 }
5870 } else if (childrenToUse != null) {
5871 var mountImages = this.mountChildren(childrenToUse, transaction, context);
5872 ret = mountImages.join('');
5873 }
5874 }
5875 if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') {
5876 // text/html ignores the first character in these tags if it's a newline
5877 // Prefer to break application/xml over text/html (for now) by adding
5878 // a newline specifically to get eaten by the parser. (Alternately for
5879 // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
5880 // \r is normalized out by HTMLTextAreaElement#value.)
5881 // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
5882 // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
5883 // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
5884 // See: Parsing of "textarea" "listing" and "pre" elements
5885 // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
5886 return '\n' + ret;
5887 } else {
5888 return ret;
5889 }
5890 },
5891
5892 _createInitialChildren: function (transaction, props, context, lazyTree) {
5893 // Intentional use of != to avoid catching zero/false.
5894 var innerHTML = props.dangerouslySetInnerHTML;
5895 if (innerHTML != null) {
5896 if (innerHTML.__html != null) {
5897 DOMLazyTree.queueHTML(lazyTree, innerHTML.__html);
5898 }
5899 } else {
5900 var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null;
5901 var childrenToUse = contentToUse != null ? null : props.children;
5902 // TODO: Validate that text is allowed as a child of this node
5903 if (contentToUse != null) {
5904 // Avoid setting textContent when the text is empty. In IE11 setting
5905 // textContent on a text area will cause the placeholder to not
5906 // show within the textarea until it has been focused and blurred again.
5907 // https://github.com/facebook/react/issues/6731#issuecomment-254874553
5908 if (contentToUse !== '') {
5909 if ("development" !== 'production') {
5910 setAndValidateContentChildDev.call(this, contentToUse);
5911 }
5912 DOMLazyTree.queueText(lazyTree, contentToUse);
5913 }
5914 } else if (childrenToUse != null) {
5915 var mountImages = this.mountChildren(childrenToUse, transaction, context);
5916 for (var i = 0; i < mountImages.length; i++) {
5917 DOMLazyTree.queueChild(lazyTree, mountImages[i]);
5918 }
5919 }
5920 }
5921 },
5922
5923 /**
5924 * Receives a next element and updates the component.
5925 *
5926 * @internal
5927 * @param {ReactElement} nextElement
5928 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
5929 * @param {object} context
5930 */
5931 receiveComponent: function (nextElement, transaction, context) {
5932 var prevElement = this._currentElement;
5933 this._currentElement = nextElement;
5934 this.updateComponent(transaction, prevElement, nextElement, context);
5935 },
5936
5937 /**
5938 * Updates a DOM component after it has already been allocated and
5939 * attached to the DOM. Reconciles the root DOM node, then recurses.
5940 *
5941 * @param {ReactReconcileTransaction} transaction
5942 * @param {ReactElement} prevElement
5943 * @param {ReactElement} nextElement
5944 * @internal
5945 * @overridable
5946 */
5947 updateComponent: function (transaction, prevElement, nextElement, context) {
5948 var lastProps = prevElement.props;
5949 var nextProps = this._currentElement.props;
5950
5951 switch (this._tag) {
5952 case 'input':
5953 lastProps = ReactDOMInput.getHostProps(this, lastProps);
5954 nextProps = ReactDOMInput.getHostProps(this, nextProps);
5955 break;
5956 case 'option':
5957 lastProps = ReactDOMOption.getHostProps(this, lastProps);
5958 nextProps = ReactDOMOption.getHostProps(this, nextProps);
5959 break;
5960 case 'select':
5961 lastProps = ReactDOMSelect.getHostProps(this, lastProps);
5962 nextProps = ReactDOMSelect.getHostProps(this, nextProps);
5963 break;
5964 case 'textarea':
5965 lastProps = ReactDOMTextarea.getHostProps(this, lastProps);
5966 nextProps = ReactDOMTextarea.getHostProps(this, nextProps);
5967 break;
5968 }
5969
5970 assertValidProps(this, nextProps);
5971 this._updateDOMProperties(lastProps, nextProps, transaction);
5972 this._updateDOMChildren(lastProps, nextProps, transaction, context);
5973
5974 switch (this._tag) {
5975 case 'input':
5976 // Update the wrapper around inputs *after* updating props. This has to
5977 // happen after `_updateDOMProperties`. Otherwise HTML5 input validations
5978 // raise warnings and prevent the new value from being assigned.
5979 ReactDOMInput.updateWrapper(this);
5980
5981 // We also check that we haven't missed a value update, such as a
5982 // Radio group shifting the checked value to another named radio input.
5983 inputValueTracking.updateValueIfChanged(this);
5984 break;
5985 case 'textarea':
5986 ReactDOMTextarea.updateWrapper(this);
5987 break;
5988 case 'select':
5989 // <select> value update needs to occur after <option> children
5990 // reconciliation
5991 transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this);
5992 break;
5993 }
5994 },
5995
5996 /**
5997 * Reconciles the properties by detecting differences in property values and
5998 * updating the DOM as necessary. This function is probably the single most
5999 * critical path for performance optimization.
6000 *
6001 * TODO: Benchmark whether checking for changed values in memory actually
6002 * improves performance (especially statically positioned elements).
6003 * TODO: Benchmark the effects of putting this at the top since 99% of props
6004 * do not change for a given reconciliation.
6005 * TODO: Benchmark areas that can be improved with caching.
6006 *
6007 * @private
6008 * @param {object} lastProps
6009 * @param {object} nextProps
6010 * @param {?DOMElement} node
6011 */
6012 _updateDOMProperties: function (lastProps, nextProps, transaction) {
6013 var propKey;
6014 var styleName;
6015 var styleUpdates;
6016 for (propKey in lastProps) {
6017 if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
6018 continue;
6019 }
6020 if (propKey === STYLE) {
6021 var lastStyle = this._previousStyleCopy;
6022 for (styleName in lastStyle) {
6023 if (lastStyle.hasOwnProperty(styleName)) {
6024 styleUpdates = styleUpdates || {};
6025 styleUpdates[styleName] = '';
6026 }
6027 }
6028 this._previousStyleCopy = null;
6029 } else if (registrationNameModules.hasOwnProperty(propKey)) {
6030 if (lastProps[propKey]) {
6031 // Only call deleteListener if there was a listener previously or
6032 // else willDeleteListener gets called when there wasn't actually a
6033 // listener (e.g., onClick={null})
6034 deleteListener(this, propKey);
6035 }
6036 } else if (isCustomComponent(this._tag, lastProps)) {
6037 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
6038 DOMPropertyOperations.deleteValueForAttribute(getNode(this), propKey);
6039 }
6040 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
6041 DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey);
6042 }
6043 }
6044 for (propKey in nextProps) {
6045 var nextProp = nextProps[propKey];
6046 var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined;
6047 if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
6048 continue;
6049 }
6050 if (propKey === STYLE) {
6051 if (nextProp) {
6052 if ("development" !== 'production') {
6053 checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this);
6054 this._previousStyle = nextProp;
6055 }
6056 nextProp = this._previousStyleCopy = _assign({}, nextProp);
6057 } else {
6058 this._previousStyleCopy = null;
6059 }
6060 if (lastProp) {
6061 // Unset styles on `lastProp` but not on `nextProp`.
6062 for (styleName in lastProp) {
6063 if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
6064 styleUpdates = styleUpdates || {};
6065 styleUpdates[styleName] = '';
6066 }
6067 }
6068 // Update styles that changed since `lastProp`.
6069 for (styleName in nextProp) {
6070 if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
6071 styleUpdates = styleUpdates || {};
6072 styleUpdates[styleName] = nextProp[styleName];
6073 }
6074 }
6075 } else {
6076 // Relies on `updateStylesByID` not mutating `styleUpdates`.
6077 styleUpdates = nextProp;
6078 }
6079 } else if (registrationNameModules.hasOwnProperty(propKey)) {
6080 if (nextProp) {
6081 enqueuePutListener(this, propKey, nextProp, transaction);
6082 } else if (lastProp) {
6083 deleteListener(this, propKey);
6084 }
6085 } else if (isCustomComponent(this._tag, nextProps)) {
6086 if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
6087 DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp);
6088 }
6089 } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) {
6090 var node = getNode(this);
6091 // If we're updating to null or undefined, we should remove the property
6092 // from the DOM node instead of inadvertently setting to a string. This
6093 // brings us in line with the same behavior we have on initial render.
6094 if (nextProp != null) {
6095 DOMPropertyOperations.setValueForProperty(node, propKey, nextProp);
6096 } else {
6097 DOMPropertyOperations.deleteValueForProperty(node, propKey);
6098 }
6099 }
6100 }
6101 if (styleUpdates) {
6102 CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this);
6103 }
6104 },
6105
6106 /**
6107 * Reconciles the children with the various properties that affect the
6108 * children content.
6109 *
6110 * @param {object} lastProps
6111 * @param {object} nextProps
6112 * @param {ReactReconcileTransaction} transaction
6113 * @param {object} context
6114 */
6115 _updateDOMChildren: function (lastProps, nextProps, transaction, context) {
6116 var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null;
6117 var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null;
6118
6119 var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html;
6120 var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html;
6121
6122 // Note the use of `!=` which checks for null or undefined.
6123 var lastChildren = lastContent != null ? null : lastProps.children;
6124 var nextChildren = nextContent != null ? null : nextProps.children;
6125
6126 // If we're switching from children to content/html or vice versa, remove
6127 // the old content
6128 var lastHasContentOrHtml = lastContent != null || lastHtml != null;
6129 var nextHasContentOrHtml = nextContent != null || nextHtml != null;
6130 if (lastChildren != null && nextChildren == null) {
6131 this.updateChildren(null, transaction, context);
6132 } else if (lastHasContentOrHtml && !nextHasContentOrHtml) {
6133 this.updateTextContent('');
6134 if ("development" !== 'production') {
6135 ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
6136 }
6137 }
6138
6139 if (nextContent != null) {
6140 if (lastContent !== nextContent) {
6141 this.updateTextContent('' + nextContent);
6142 if ("development" !== 'production') {
6143 setAndValidateContentChildDev.call(this, nextContent);
6144 }
6145 }
6146 } else if (nextHtml != null) {
6147 if (lastHtml !== nextHtml) {
6148 this.updateMarkup('' + nextHtml);
6149 }
6150 if ("development" !== 'production') {
6151 ReactInstrumentation.debugTool.onSetChildren(this._debugID, []);
6152 }
6153 } else if (nextChildren != null) {
6154 if ("development" !== 'production') {
6155 setAndValidateContentChildDev.call(this, null);
6156 }
6157
6158 this.updateChildren(nextChildren, transaction, context);
6159 }
6160 },
6161
6162 getHostNode: function () {
6163 return getNode(this);
6164 },
6165
6166 /**
6167 * Destroys all event registrations for this instance. Does not remove from
6168 * the DOM. That must be done by the parent.
6169 *
6170 * @internal
6171 */
6172 unmountComponent: function (safely) {
6173 switch (this._tag) {
6174 case 'audio':
6175 case 'form':
6176 case 'iframe':
6177 case 'img':
6178 case 'link':
6179 case 'object':
6180 case 'source':
6181 case 'video':
6182 var listeners = this._wrapperState.listeners;
6183 if (listeners) {
6184 for (var i = 0; i < listeners.length; i++) {
6185 listeners[i].remove();
6186 }
6187 }
6188 break;
6189 case 'input':
6190 case 'textarea':
6191 inputValueTracking.stopTracking(this);
6192 break;
6193 case 'html':
6194 case 'head':
6195 case 'body':
6196 /**
6197 * Components like <html> <head> and <body> can't be removed or added
6198 * easily in a cross-browser way, however it's valuable to be able to
6199 * take advantage of React's reconciliation for styling and <title>
6200 * management. So we just document it and throw in dangerous cases.
6201 */
6202 !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;
6203 break;
6204 }
6205
6206 this.unmountChildren(safely);
6207 ReactDOMComponentTree.uncacheNode(this);
6208 EventPluginHub.deleteAllListeners(this);
6209 this._rootNodeID = 0;
6210 this._domID = 0;
6211 this._wrapperState = null;
6212
6213 if ("development" !== 'production') {
6214 setAndValidateContentChildDev.call(this, null);
6215 }
6216 },
6217
6218 getPublicInstance: function () {
6219 return getNode(this);
6220 }
6221};
6222
6223_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin);
6224
6225module.exports = ReactDOMComponent;
6226},{"10":10,"100":100,"11":11,"111":111,"113":113,"116":116,"12":12,"121":121,"133":133,"141":141,"147":147,"148":148,"149":149,"16":16,"17":17,"2":2,"25":25,"31":31,"32":32,"36":36,"37":37,"38":38,"43":43,"5":5,"59":59,"62":62,"72":72,"9":9}],31:[function(_dereq_,module,exports){
6227/**
6228 * Copyright (c) 2015-present, Facebook, Inc.
6229 *
6230 * This source code is licensed under the MIT license found in the
6231 * LICENSE file in the root directory of this source tree.
6232 *
6233 */
6234
6235'use strict';
6236
6237var ReactDOMComponentFlags = {
6238 hasCachedChildNodes: 1 << 0
6239};
6240
6241module.exports = ReactDOMComponentFlags;
6242},{}],32:[function(_dereq_,module,exports){
6243/**
6244 * Copyright (c) 2013-present, Facebook, Inc.
6245 *
6246 * This source code is licensed under the MIT license found in the
6247 * LICENSE file in the root directory of this source tree.
6248 *
6249 */
6250
6251'use strict';
6252
6253var _prodInvariant = _dereq_(116);
6254
6255var DOMProperty = _dereq_(11);
6256var ReactDOMComponentFlags = _dereq_(31);
6257
6258var invariant = _dereq_(141);
6259
6260var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME;
6261var Flags = ReactDOMComponentFlags;
6262
6263var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2);
6264
6265/**
6266 * Check if a given node should be cached.
6267 */
6268function shouldPrecacheNode(node, nodeID) {
6269 return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' ';
6270}
6271
6272/**
6273 * Drill down (through composites and empty components) until we get a host or
6274 * host text component.
6275 *
6276 * This is pretty polymorphic but unavoidable with the current structure we have
6277 * for `_renderedChildren`.
6278 */
6279function getRenderedHostOrTextFromComponent(component) {
6280 var rendered;
6281 while (rendered = component._renderedComponent) {
6282 component = rendered;
6283 }
6284 return component;
6285}
6286
6287/**
6288 * Populate `_hostNode` on the rendered host/text component with the given
6289 * DOM node. The passed `inst` can be a composite.
6290 */
6291function precacheNode(inst, node) {
6292 var hostInst = getRenderedHostOrTextFromComponent(inst);
6293 hostInst._hostNode = node;
6294 node[internalInstanceKey] = hostInst;
6295}
6296
6297function uncacheNode(inst) {
6298 var node = inst._hostNode;
6299 if (node) {
6300 delete node[internalInstanceKey];
6301 inst._hostNode = null;
6302 }
6303}
6304
6305/**
6306 * Populate `_hostNode` on each child of `inst`, assuming that the children
6307 * match up with the DOM (element) children of `node`.
6308 *
6309 * We cache entire levels at once to avoid an n^2 problem where we access the
6310 * children of a node sequentially and have to walk from the start to our target
6311 * node every time.
6312 *
6313 * Since we update `_renderedChildren` and the actual DOM at (slightly)
6314 * different times, we could race here and see a newer `_renderedChildren` than
6315 * the DOM nodes we see. To avoid this, ReactMultiChild calls
6316 * `prepareToManageChildren` before we change `_renderedChildren`, at which
6317 * time the container's child nodes are always cached (until it unmounts).
6318 */
6319function precacheChildNodes(inst, node) {
6320 if (inst._flags & Flags.hasCachedChildNodes) {
6321 return;
6322 }
6323 var children = inst._renderedChildren;
6324 var childNode = node.firstChild;
6325 outer: for (var name in children) {
6326 if (!children.hasOwnProperty(name)) {
6327 continue;
6328 }
6329 var childInst = children[name];
6330 var childID = getRenderedHostOrTextFromComponent(childInst)._domID;
6331 if (childID === 0) {
6332 // We're currently unmounting this child in ReactMultiChild; skip it.
6333 continue;
6334 }
6335 // We assume the child nodes are in the same order as the child instances.
6336 for (; childNode !== null; childNode = childNode.nextSibling) {
6337 if (shouldPrecacheNode(childNode, childID)) {
6338 precacheNode(childInst, childNode);
6339 continue outer;
6340 }
6341 }
6342 // We reached the end of the DOM children without finding an ID match.
6343 !false ? "development" !== 'production' ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0;
6344 }
6345 inst._flags |= Flags.hasCachedChildNodes;
6346}
6347
6348/**
6349 * Given a DOM node, return the closest ReactDOMComponent or
6350 * ReactDOMTextComponent instance ancestor.
6351 */
6352function getClosestInstanceFromNode(node) {
6353 if (node[internalInstanceKey]) {
6354 return node[internalInstanceKey];
6355 }
6356
6357 // Walk up the tree until we find an ancestor whose instance we have cached.
6358 var parents = [];
6359 while (!node[internalInstanceKey]) {
6360 parents.push(node);
6361 if (node.parentNode) {
6362 node = node.parentNode;
6363 } else {
6364 // Top of the tree. This node must not be part of a React tree (or is
6365 // unmounted, potentially).
6366 return null;
6367 }
6368 }
6369
6370 var closest;
6371 var inst;
6372 for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
6373 closest = inst;
6374 if (parents.length) {
6375 precacheChildNodes(inst, node);
6376 }
6377 }
6378
6379 return closest;
6380}
6381
6382/**
6383 * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
6384 * instance, or null if the node was not rendered by this React.
6385 */
6386function getInstanceFromNode(node) {
6387 var inst = getClosestInstanceFromNode(node);
6388 if (inst != null && inst._hostNode === node) {
6389 return inst;
6390 } else {
6391 return null;
6392 }
6393}
6394
6395/**
6396 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
6397 * DOM node.
6398 */
6399function getNodeFromInstance(inst) {
6400 // Without this first invariant, passing a non-DOM-component triggers the next
6401 // invariant for a missing parent, which is super confusing.
6402 !(inst._hostNode !== undefined) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
6403
6404 if (inst._hostNode) {
6405 return inst._hostNode;
6406 }
6407
6408 // Walk up the tree until we find an ancestor whose DOM node we have cached.
6409 var parents = [];
6410 while (!inst._hostNode) {
6411 parents.push(inst);
6412 !inst._hostParent ? "development" !== 'production' ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0;
6413 inst = inst._hostParent;
6414 }
6415
6416 // Now parents contains each ancestor that does *not* have a cached native
6417 // node, and `inst` is the deepest ancestor that does.
6418 for (; parents.length; inst = parents.pop()) {
6419 precacheChildNodes(inst, inst._hostNode);
6420 }
6421
6422 return inst._hostNode;
6423}
6424
6425var ReactDOMComponentTree = {
6426 getClosestInstanceFromNode: getClosestInstanceFromNode,
6427 getInstanceFromNode: getInstanceFromNode,
6428 getNodeFromInstance: getNodeFromInstance,
6429 precacheChildNodes: precacheChildNodes,
6430 precacheNode: precacheNode,
6431 uncacheNode: uncacheNode
6432};
6433
6434module.exports = ReactDOMComponentTree;
6435},{"11":11,"116":116,"141":141,"31":31}],33:[function(_dereq_,module,exports){
6436/**
6437 * Copyright (c) 2013-present, Facebook, Inc.
6438 *
6439 * This source code is licensed under the MIT license found in the
6440 * LICENSE file in the root directory of this source tree.
6441 *
6442 */
6443
6444'use strict';
6445
6446var validateDOMNesting = _dereq_(121);
6447
6448var DOC_NODE_TYPE = 9;
6449
6450function ReactDOMContainerInfo(topLevelWrapper, node) {
6451 var info = {
6452 _topLevelWrapper: topLevelWrapper,
6453 _idCounter: 1,
6454 _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null,
6455 _node: node,
6456 _tag: node ? node.nodeName.toLowerCase() : null,
6457 _namespaceURI: node ? node.namespaceURI : null
6458 };
6459 if ("development" !== 'production') {
6460 info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null;
6461 }
6462 return info;
6463}
6464
6465module.exports = ReactDOMContainerInfo;
6466},{"121":121}],34:[function(_dereq_,module,exports){
6467/**
6468 * Copyright (c) 2014-present, Facebook, Inc.
6469 *
6470 * This source code is licensed under the MIT license found in the
6471 * LICENSE file in the root directory of this source tree.
6472 *
6473 */
6474
6475'use strict';
6476
6477var _assign = _dereq_(149);
6478
6479var DOMLazyTree = _dereq_(9);
6480var ReactDOMComponentTree = _dereq_(32);
6481
6482var ReactDOMEmptyComponent = function (instantiate) {
6483 // ReactCompositeComponent uses this:
6484 this._currentElement = null;
6485 // ReactDOMComponentTree uses these:
6486 this._hostNode = null;
6487 this._hostParent = null;
6488 this._hostContainerInfo = null;
6489 this._domID = 0;
6490};
6491_assign(ReactDOMEmptyComponent.prototype, {
6492 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
6493 var domID = hostContainerInfo._idCounter++;
6494 this._domID = domID;
6495 this._hostParent = hostParent;
6496 this._hostContainerInfo = hostContainerInfo;
6497
6498 var nodeValue = ' react-empty: ' + this._domID + ' ';
6499 if (transaction.useCreateElement) {
6500 var ownerDocument = hostContainerInfo._ownerDocument;
6501 var node = ownerDocument.createComment(nodeValue);
6502 ReactDOMComponentTree.precacheNode(this, node);
6503 return DOMLazyTree(node);
6504 } else {
6505 if (transaction.renderToStaticMarkup) {
6506 // Normally we'd insert a comment node, but since this is a situation
6507 // where React won't take over (static pages), we can simply return
6508 // nothing.
6509 return '';
6510 }
6511 return '<!--' + nodeValue + '-->';
6512 }
6513 },
6514 receiveComponent: function () {},
6515 getHostNode: function () {
6516 return ReactDOMComponentTree.getNodeFromInstance(this);
6517 },
6518 unmountComponent: function () {
6519 ReactDOMComponentTree.uncacheNode(this);
6520 }
6521});
6522
6523module.exports = ReactDOMEmptyComponent;
6524},{"149":149,"32":32,"9":9}],35:[function(_dereq_,module,exports){
6525/**
6526 * Copyright (c) 2013-present, Facebook, Inc.
6527 *
6528 * This source code is licensed under the MIT license found in the
6529 * LICENSE file in the root directory of this source tree.
6530 *
6531 */
6532
6533'use strict';
6534
6535var DOMChildrenOperations = _dereq_(8);
6536var ReactDOMComponentTree = _dereq_(32);
6537
6538/**
6539 * Operations used to process updates to DOM nodes.
6540 */
6541var ReactDOMIDOperations = {
6542 /**
6543 * Updates a component's children by processing a series of updates.
6544 *
6545 * @param {array<object>} updates List of update configurations.
6546 * @internal
6547 */
6548 dangerouslyProcessChildrenUpdates: function (parentInst, updates) {
6549 var node = ReactDOMComponentTree.getNodeFromInstance(parentInst);
6550 DOMChildrenOperations.processUpdates(node, updates);
6551 }
6552};
6553
6554module.exports = ReactDOMIDOperations;
6555},{"32":32,"8":8}],36:[function(_dereq_,module,exports){
6556/**
6557 * Copyright (c) 2013-present, Facebook, Inc.
6558 *
6559 * This source code is licensed under the MIT license found in the
6560 * LICENSE file in the root directory of this source tree.
6561 *
6562 */
6563
6564'use strict';
6565
6566var _prodInvariant = _dereq_(116),
6567 _assign = _dereq_(149);
6568
6569var DOMPropertyOperations = _dereq_(12);
6570var LinkedValueUtils = _dereq_(23);
6571var ReactDOMComponentTree = _dereq_(32);
6572var ReactUpdates = _dereq_(75);
6573
6574var invariant = _dereq_(141);
6575var warning = _dereq_(148);
6576
6577var didWarnValueLink = false;
6578var didWarnCheckedLink = false;
6579var didWarnValueDefaultValue = false;
6580var didWarnCheckedDefaultChecked = false;
6581var didWarnControlledToUncontrolled = false;
6582var didWarnUncontrolledToControlled = false;
6583
6584function forceUpdateIfMounted() {
6585 if (this._rootNodeID) {
6586 // DOM component is still mounted; update
6587 ReactDOMInput.updateWrapper(this);
6588 }
6589}
6590
6591function isControlled(props) {
6592 var usesChecked = props.type === 'checkbox' || props.type === 'radio';
6593 return usesChecked ? props.checked != null : props.value != null;
6594}
6595
6596/**
6597 * Implements an <input> host component that allows setting these optional
6598 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
6599 *
6600 * If `checked` or `value` are not supplied (or null/undefined), user actions
6601 * that affect the checked state or value will trigger updates to the element.
6602 *
6603 * If they are supplied (and not null/undefined), the rendered element will not
6604 * trigger updates to the element. Instead, the props must change in order for
6605 * the rendered element to be updated.
6606 *
6607 * The rendered element will be initialized as unchecked (or `defaultChecked`)
6608 * with an empty value (or `defaultValue`).
6609 *
6610 * @see http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
6611 */
6612var ReactDOMInput = {
6613 getHostProps: function (inst, props) {
6614 var value = LinkedValueUtils.getValue(props);
6615 var checked = LinkedValueUtils.getChecked(props);
6616
6617 var hostProps = _assign({
6618 // Make sure we set .type before any other properties (setting .value
6619 // before .type means .value is lost in IE11 and below)
6620 type: undefined,
6621 // Make sure we set .step before .value (setting .value before .step
6622 // means .value is rounded on mount, based upon step precision)
6623 step: undefined,
6624 // Make sure we set .min & .max before .value (to ensure proper order
6625 // in corner cases such as min or max deriving from value, e.g. Issue #7170)
6626 min: undefined,
6627 max: undefined
6628 }, props, {
6629 defaultChecked: undefined,
6630 defaultValue: undefined,
6631 value: value != null ? value : inst._wrapperState.initialValue,
6632 checked: checked != null ? checked : inst._wrapperState.initialChecked,
6633 onChange: inst._wrapperState.onChange
6634 });
6635
6636 return hostProps;
6637 },
6638
6639 mountWrapper: function (inst, props) {
6640 if ("development" !== 'production') {
6641 LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner);
6642
6643 var owner = inst._currentElement._owner;
6644
6645 if (props.valueLink !== undefined && !didWarnValueLink) {
6646 "development" !== 'production' ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
6647 didWarnValueLink = true;
6648 }
6649 if (props.checkedLink !== undefined && !didWarnCheckedLink) {
6650 "development" !== 'production' ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0;
6651 didWarnCheckedLink = true;
6652 }
6653 if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
6654 "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;
6655 didWarnCheckedDefaultChecked = true;
6656 }
6657 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
6658 "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;
6659 didWarnValueDefaultValue = true;
6660 }
6661 }
6662
6663 var defaultValue = props.defaultValue;
6664 inst._wrapperState = {
6665 initialChecked: props.checked != null ? props.checked : props.defaultChecked,
6666 initialValue: props.value != null ? props.value : defaultValue,
6667 listeners: null,
6668 onChange: _handleChange.bind(inst),
6669 controlled: isControlled(props)
6670 };
6671 },
6672
6673 updateWrapper: function (inst) {
6674 var props = inst._currentElement.props;
6675
6676 if ("development" !== 'production') {
6677 var controlled = isControlled(props);
6678 var owner = inst._currentElement._owner;
6679
6680 if (!inst._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
6681 "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;
6682 didWarnUncontrolledToControlled = true;
6683 }
6684 if (inst._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
6685 "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;
6686 didWarnControlledToUncontrolled = true;
6687 }
6688 }
6689
6690 // TODO: Shouldn't this be getChecked(props)?
6691 var checked = props.checked;
6692 if (checked != null) {
6693 DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false);
6694 }
6695
6696 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
6697 var value = LinkedValueUtils.getValue(props);
6698 if (value != null) {
6699 if (value === 0 && node.value === '') {
6700 node.value = '0';
6701 // Note: IE9 reports a number inputs as 'text', so check props instead.
6702 } else if (props.type === 'number') {
6703 // Simulate `input.valueAsNumber`. IE9 does not support it
6704 var valueAsNumber = parseFloat(node.value, 10) || 0;
6705
6706 if (
6707 // eslint-disable-next-line
6708 value != valueAsNumber ||
6709 // eslint-disable-next-line
6710 value == valueAsNumber && node.value != value) {
6711 // Cast `value` to a string to ensure the value is set correctly. While
6712 // browsers typically do this as necessary, jsdom doesn't.
6713 node.value = '' + value;
6714 }
6715 } else if (node.value !== '' + value) {
6716 // Cast `value` to a string to ensure the value is set correctly. While
6717 // browsers typically do this as necessary, jsdom doesn't.
6718 node.value = '' + value;
6719 }
6720 } else {
6721 if (props.value == null && props.defaultValue != null) {
6722 // In Chrome, assigning defaultValue to certain input types triggers input validation.
6723 // For number inputs, the display value loses trailing decimal points. For email inputs,
6724 // Chrome raises "The specified value <x> is not a valid email address".
6725 //
6726 // Here we check to see if the defaultValue has actually changed, avoiding these problems
6727 // when the user is inputting text
6728 //
6729 // https://github.com/facebook/react/issues/7253
6730 if (node.defaultValue !== '' + props.defaultValue) {
6731 node.defaultValue = '' + props.defaultValue;
6732 }
6733 }
6734 if (props.checked == null && props.defaultChecked != null) {
6735 node.defaultChecked = !!props.defaultChecked;
6736 }
6737 }
6738 },
6739
6740 postMountWrapper: function (inst) {
6741 var props = inst._currentElement.props;
6742
6743 // This is in postMount because we need access to the DOM node, which is not
6744 // available until after the component has mounted.
6745 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
6746
6747 // Detach value from defaultValue. We won't do anything if we're working on
6748 // submit or reset inputs as those values & defaultValues are linked. They
6749 // are not resetable nodes so this operation doesn't matter and actually
6750 // removes browser-default values (eg "Submit Query") when no value is
6751 // provided.
6752
6753 switch (props.type) {
6754 case 'submit':
6755 case 'reset':
6756 break;
6757 case 'color':
6758 case 'date':
6759 case 'datetime':
6760 case 'datetime-local':
6761 case 'month':
6762 case 'time':
6763 case 'week':
6764 // This fixes the no-show issue on iOS Safari and Android Chrome:
6765 // https://github.com/facebook/react/issues/7233
6766 node.value = '';
6767 node.value = node.defaultValue;
6768 break;
6769 default:
6770 node.value = node.value;
6771 break;
6772 }
6773
6774 // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
6775 // this is needed to work around a chrome bug where setting defaultChecked
6776 // will sometimes influence the value of checked (even after detachment).
6777 // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
6778 // We need to temporarily unset name to avoid disrupting radio button groups.
6779 var name = node.name;
6780 if (name !== '') {
6781 node.name = '';
6782 }
6783 node.defaultChecked = !node.defaultChecked;
6784 node.defaultChecked = !node.defaultChecked;
6785 if (name !== '') {
6786 node.name = name;
6787 }
6788 }
6789};
6790
6791function _handleChange(event) {
6792 var props = this._currentElement.props;
6793
6794 var returnValue = LinkedValueUtils.executeOnChange(props, event);
6795
6796 // Here we use asap to wait until all updates have propagated, which
6797 // is important when using controlled components within layers:
6798 // https://github.com/facebook/react/issues/1698
6799 ReactUpdates.asap(forceUpdateIfMounted, this);
6800
6801 var name = props.name;
6802 if (props.type === 'radio' && name != null) {
6803 var rootNode = ReactDOMComponentTree.getNodeFromInstance(this);
6804 var queryRoot = rootNode;
6805
6806 while (queryRoot.parentNode) {
6807 queryRoot = queryRoot.parentNode;
6808 }
6809
6810 // If `rootNode.form` was non-null, then we could try `form.elements`,
6811 // but that sometimes behaves strangely in IE8. We could also try using
6812 // `form.getElementsByName`, but that will only return direct children
6813 // and won't include inputs that use the HTML5 `form=` attribute. Since
6814 // the input might not even be in a form, let's just use the global
6815 // `querySelectorAll` to ensure we don't miss anything.
6816 var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
6817
6818 for (var i = 0; i < group.length; i++) {
6819 var otherNode = group[i];
6820 if (otherNode === rootNode || otherNode.form !== rootNode.form) {
6821 continue;
6822 }
6823 // This will throw if radio buttons rendered by different copies of React
6824 // and the same name are rendered into the same form (same as #1939).
6825 // That's probably okay; we don't support it just as we don't support
6826 // mixing React radio buttons with non-React ones.
6827 var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
6828 !otherInstance ? "development" !== 'production' ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : _prodInvariant('90') : void 0;
6829 // If this is a controlled radio button group, forcing the input that
6830 // was previously checked to update will cause it to be come re-checked
6831 // as appropriate.
6832 ReactUpdates.asap(forceUpdateIfMounted, otherInstance);
6833 }
6834 }
6835
6836 return returnValue;
6837}
6838
6839module.exports = ReactDOMInput;
6840},{"116":116,"12":12,"141":141,"148":148,"149":149,"23":23,"32":32,"75":75}],37:[function(_dereq_,module,exports){
6841/**
6842 * Copyright (c) 2013-present, Facebook, Inc.
6843 *
6844 * This source code is licensed under the MIT license found in the
6845 * LICENSE file in the root directory of this source tree.
6846 *
6847 */
6848
6849'use strict';
6850
6851var _assign = _dereq_(149);
6852
6853var React = _dereq_(124);
6854var ReactDOMComponentTree = _dereq_(32);
6855var ReactDOMSelect = _dereq_(38);
6856
6857var warning = _dereq_(148);
6858var didWarnInvalidOptionChildren = false;
6859
6860function flattenChildren(children) {
6861 var content = '';
6862
6863 // Flatten children and warn if they aren't strings or numbers;
6864 // invalid types are ignored.
6865 React.Children.forEach(children, function (child) {
6866 if (child == null) {
6867 return;
6868 }
6869 if (typeof child === 'string' || typeof child === 'number') {
6870 content += child;
6871 } else if (!didWarnInvalidOptionChildren) {
6872 didWarnInvalidOptionChildren = true;
6873 "development" !== 'production' ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0;
6874 }
6875 });
6876
6877 return content;
6878}
6879
6880/**
6881 * Implements an <option> host component that warns when `selected` is set.
6882 */
6883var ReactDOMOption = {
6884 mountWrapper: function (inst, props, hostParent) {
6885 // TODO (yungsters): Remove support for `selected` in <option>.
6886 if ("development" !== 'production') {
6887 "development" !== 'production' ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0;
6888 }
6889
6890 // Look up whether this option is 'selected'
6891 var selectValue = null;
6892 if (hostParent != null) {
6893 var selectParent = hostParent;
6894
6895 if (selectParent._tag === 'optgroup') {
6896 selectParent = selectParent._hostParent;
6897 }
6898
6899 if (selectParent != null && selectParent._tag === 'select') {
6900 selectValue = ReactDOMSelect.getSelectValueContext(selectParent);
6901 }
6902 }
6903
6904 // If the value is null (e.g., no specified value or after initial mount)
6905 // or missing (e.g., for <datalist>), we don't change props.selected
6906 var selected = null;
6907 if (selectValue != null) {
6908 var value;
6909 if (props.value != null) {
6910 value = props.value + '';
6911 } else {
6912 value = flattenChildren(props.children);
6913 }
6914 selected = false;
6915 if (Array.isArray(selectValue)) {
6916 // multiple
6917 for (var i = 0; i < selectValue.length; i++) {
6918 if ('' + selectValue[i] === value) {
6919 selected = true;
6920 break;
6921 }
6922 }
6923 } else {
6924 selected = '' + selectValue === value;
6925 }
6926 }
6927
6928 inst._wrapperState = { selected: selected };
6929 },
6930
6931 postMountWrapper: function (inst) {
6932 // value="" should make a value attribute (#6219)
6933 var props = inst._currentElement.props;
6934 if (props.value != null) {
6935 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
6936 node.setAttribute('value', props.value);
6937 }
6938 },
6939
6940 getHostProps: function (inst, props) {
6941 var hostProps = _assign({ selected: undefined, children: undefined }, props);
6942
6943 // Read state only from initial mount because <select> updates value
6944 // manually; we need the initial state only for server rendering
6945 if (inst._wrapperState.selected != null) {
6946 hostProps.selected = inst._wrapperState.selected;
6947 }
6948
6949 var content = flattenChildren(props.children);
6950
6951 if (content) {
6952 hostProps.children = content;
6953 }
6954
6955 return hostProps;
6956 }
6957};
6958
6959module.exports = ReactDOMOption;
6960},{"124":124,"148":148,"149":149,"32":32,"38":38}],38:[function(_dereq_,module,exports){
6961/**
6962 * Copyright (c) 2013-present, Facebook, Inc.
6963 *
6964 * This source code is licensed under the MIT license found in the
6965 * LICENSE file in the root directory of this source tree.
6966 *
6967 */
6968
6969'use strict';
6970
6971var _assign = _dereq_(149);
6972
6973var LinkedValueUtils = _dereq_(23);
6974var ReactDOMComponentTree = _dereq_(32);
6975var ReactUpdates = _dereq_(75);
6976
6977var warning = _dereq_(148);
6978
6979var didWarnValueLink = false;
6980var didWarnValueDefaultValue = false;
6981
6982function updateOptionsIfPendingUpdateAndMounted() {
6983 if (this._rootNodeID && this._wrapperState.pendingUpdate) {
6984 this._wrapperState.pendingUpdate = false;
6985
6986 var props = this._currentElement.props;
6987 var value = LinkedValueUtils.getValue(props);
6988
6989 if (value != null) {
6990 updateOptions(this, Boolean(props.multiple), value);
6991 }
6992 }
6993}
6994
6995function getDeclarationErrorAddendum(owner) {
6996 if (owner) {
6997 var name = owner.getName();
6998 if (name) {
6999 return ' Check the render method of `' + name + '`.';
7000 }
7001 }
7002 return '';
7003}
7004
7005var valuePropNames = ['value', 'defaultValue'];
7006
7007/**
7008 * Validation function for `value` and `defaultValue`.
7009 * @private
7010 */
7011function checkSelectPropTypes(inst, props) {
7012 var owner = inst._currentElement._owner;
7013 LinkedValueUtils.checkPropTypes('select', props, owner);
7014
7015 if (props.valueLink !== undefined && !didWarnValueLink) {
7016 "development" !== 'production' ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
7017 didWarnValueLink = true;
7018 }
7019
7020 for (var i = 0; i < valuePropNames.length; i++) {
7021 var propName = valuePropNames[i];
7022 if (props[propName] == null) {
7023 continue;
7024 }
7025 var isArray = Array.isArray(props[propName]);
7026 if (props.multiple && !isArray) {
7027 "development" !== 'production' ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
7028 } else if (!props.multiple && isArray) {
7029 "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;
7030 }
7031 }
7032}
7033
7034/**
7035 * @param {ReactDOMComponent} inst
7036 * @param {boolean} multiple
7037 * @param {*} propValue A stringable (with `multiple`, a list of stringables).
7038 * @private
7039 */
7040function updateOptions(inst, multiple, propValue) {
7041 var selectedValue, i;
7042 var options = ReactDOMComponentTree.getNodeFromInstance(inst).options;
7043
7044 if (multiple) {
7045 selectedValue = {};
7046 for (i = 0; i < propValue.length; i++) {
7047 selectedValue['' + propValue[i]] = true;
7048 }
7049 for (i = 0; i < options.length; i++) {
7050 var selected = selectedValue.hasOwnProperty(options[i].value);
7051 if (options[i].selected !== selected) {
7052 options[i].selected = selected;
7053 }
7054 }
7055 } else {
7056 // Do not set `select.value` as exact behavior isn't consistent across all
7057 // browsers for all cases.
7058 selectedValue = '' + propValue;
7059 for (i = 0; i < options.length; i++) {
7060 if (options[i].value === selectedValue) {
7061 options[i].selected = true;
7062 return;
7063 }
7064 }
7065 if (options.length) {
7066 options[0].selected = true;
7067 }
7068 }
7069}
7070
7071/**
7072 * Implements a <select> host component that allows optionally setting the
7073 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
7074 * stringable. If `multiple` is true, the prop must be an array of stringables.
7075 *
7076 * If `value` is not supplied (or null/undefined), user actions that change the
7077 * selected option will trigger updates to the rendered options.
7078 *
7079 * If it is supplied (and not null/undefined), the rendered options will not
7080 * update in response to user actions. Instead, the `value` prop must change in
7081 * order for the rendered options to update.
7082 *
7083 * If `defaultValue` is provided, any options with the supplied values will be
7084 * selected.
7085 */
7086var ReactDOMSelect = {
7087 getHostProps: function (inst, props) {
7088 return _assign({}, props, {
7089 onChange: inst._wrapperState.onChange,
7090 value: undefined
7091 });
7092 },
7093
7094 mountWrapper: function (inst, props) {
7095 if ("development" !== 'production') {
7096 checkSelectPropTypes(inst, props);
7097 }
7098
7099 var value = LinkedValueUtils.getValue(props);
7100 inst._wrapperState = {
7101 pendingUpdate: false,
7102 initialValue: value != null ? value : props.defaultValue,
7103 listeners: null,
7104 onChange: _handleChange.bind(inst),
7105 wasMultiple: Boolean(props.multiple)
7106 };
7107
7108 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
7109 "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;
7110 didWarnValueDefaultValue = true;
7111 }
7112 },
7113
7114 getSelectValueContext: function (inst) {
7115 // ReactDOMOption looks at this initial value so the initial generated
7116 // markup has correct `selected` attributes
7117 return inst._wrapperState.initialValue;
7118 },
7119
7120 postUpdateWrapper: function (inst) {
7121 var props = inst._currentElement.props;
7122
7123 // After the initial mount, we control selected-ness manually so don't pass
7124 // this value down
7125 inst._wrapperState.initialValue = undefined;
7126
7127 var wasMultiple = inst._wrapperState.wasMultiple;
7128 inst._wrapperState.wasMultiple = Boolean(props.multiple);
7129
7130 var value = LinkedValueUtils.getValue(props);
7131 if (value != null) {
7132 inst._wrapperState.pendingUpdate = false;
7133 updateOptions(inst, Boolean(props.multiple), value);
7134 } else if (wasMultiple !== Boolean(props.multiple)) {
7135 // For simplicity, reapply `defaultValue` if `multiple` is toggled.
7136 if (props.defaultValue != null) {
7137 updateOptions(inst, Boolean(props.multiple), props.defaultValue);
7138 } else {
7139 // Revert the select back to its default unselected state.
7140 updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : '');
7141 }
7142 }
7143 }
7144};
7145
7146function _handleChange(event) {
7147 var props = this._currentElement.props;
7148 var returnValue = LinkedValueUtils.executeOnChange(props, event);
7149
7150 if (this._rootNodeID) {
7151 this._wrapperState.pendingUpdate = true;
7152 }
7153 ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this);
7154 return returnValue;
7155}
7156
7157module.exports = ReactDOMSelect;
7158},{"148":148,"149":149,"23":23,"32":32,"75":75}],39:[function(_dereq_,module,exports){
7159/**
7160 * Copyright (c) 2013-present, Facebook, Inc.
7161 *
7162 * This source code is licensed under the MIT license found in the
7163 * LICENSE file in the root directory of this source tree.
7164 *
7165 */
7166
7167'use strict';
7168
7169var ExecutionEnvironment = _dereq_(127);
7170
7171var getNodeForCharacterOffset = _dereq_(108);
7172var getTextContentAccessor = _dereq_(109);
7173
7174/**
7175 * While `isCollapsed` is available on the Selection object and `collapsed`
7176 * is available on the Range object, IE11 sometimes gets them wrong.
7177 * If the anchor/focus nodes and offsets are the same, the range is collapsed.
7178 */
7179function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {
7180 return anchorNode === focusNode && anchorOffset === focusOffset;
7181}
7182
7183/**
7184 * Get the appropriate anchor and focus node/offset pairs for IE.
7185 *
7186 * The catch here is that IE's selection API doesn't provide information
7187 * about whether the selection is forward or backward, so we have to
7188 * behave as though it's always forward.
7189 *
7190 * IE text differs from modern selection in that it behaves as though
7191 * block elements end with a new line. This means character offsets will
7192 * differ between the two APIs.
7193 *
7194 * @param {DOMElement} node
7195 * @return {object}
7196 */
7197function getIEOffsets(node) {
7198 var selection = document.selection;
7199 var selectedRange = selection.createRange();
7200 var selectedLength = selectedRange.text.length;
7201
7202 // Duplicate selection so we can move range without breaking user selection.
7203 var fromStart = selectedRange.duplicate();
7204 fromStart.moveToElementText(node);
7205 fromStart.setEndPoint('EndToStart', selectedRange);
7206
7207 var startOffset = fromStart.text.length;
7208 var endOffset = startOffset + selectedLength;
7209
7210 return {
7211 start: startOffset,
7212 end: endOffset
7213 };
7214}
7215
7216/**
7217 * @param {DOMElement} node
7218 * @return {?object}
7219 */
7220function getModernOffsets(node) {
7221 var selection = window.getSelection && window.getSelection();
7222
7223 if (!selection || selection.rangeCount === 0) {
7224 return null;
7225 }
7226
7227 var anchorNode = selection.anchorNode;
7228 var anchorOffset = selection.anchorOffset;
7229 var focusNode = selection.focusNode;
7230 var focusOffset = selection.focusOffset;
7231
7232 var currentRange = selection.getRangeAt(0);
7233
7234 // In Firefox, range.startContainer and range.endContainer can be "anonymous
7235 // divs", e.g. the up/down buttons on an <input type="number">. Anonymous
7236 // divs do not seem to expose properties, triggering a "Permission denied
7237 // error" if any of its properties are accessed. The only seemingly possible
7238 // way to avoid erroring is to access a property that typically works for
7239 // non-anonymous divs and catch any error that may otherwise arise. See
7240 // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
7241 try {
7242 /* eslint-disable no-unused-expressions */
7243 currentRange.startContainer.nodeType;
7244 currentRange.endContainer.nodeType;
7245 /* eslint-enable no-unused-expressions */
7246 } catch (e) {
7247 return null;
7248 }
7249
7250 // If the node and offset values are the same, the selection is collapsed.
7251 // `Selection.isCollapsed` is available natively, but IE sometimes gets
7252 // this value wrong.
7253 var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
7254
7255 var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length;
7256
7257 var tempRange = currentRange.cloneRange();
7258 tempRange.selectNodeContents(node);
7259 tempRange.setEnd(currentRange.startContainer, currentRange.startOffset);
7260
7261 var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset);
7262
7263 var start = isTempRangeCollapsed ? 0 : tempRange.toString().length;
7264 var end = start + rangeLength;
7265
7266 // Detect whether the selection is backward.
7267 var detectionRange = document.createRange();
7268 detectionRange.setStart(anchorNode, anchorOffset);
7269 detectionRange.setEnd(focusNode, focusOffset);
7270 var isBackward = detectionRange.collapsed;
7271
7272 return {
7273 start: isBackward ? end : start,
7274 end: isBackward ? start : end
7275 };
7276}
7277
7278/**
7279 * @param {DOMElement|DOMTextNode} node
7280 * @param {object} offsets
7281 */
7282function setIEOffsets(node, offsets) {
7283 var range = document.selection.createRange().duplicate();
7284 var start, end;
7285
7286 if (offsets.end === undefined) {
7287 start = offsets.start;
7288 end = start;
7289 } else if (offsets.start > offsets.end) {
7290 start = offsets.end;
7291 end = offsets.start;
7292 } else {
7293 start = offsets.start;
7294 end = offsets.end;
7295 }
7296
7297 range.moveToElementText(node);
7298 range.moveStart('character', start);
7299 range.setEndPoint('EndToStart', range);
7300 range.moveEnd('character', end - start);
7301 range.select();
7302}
7303
7304/**
7305 * In modern non-IE browsers, we can support both forward and backward
7306 * selections.
7307 *
7308 * Note: IE10+ supports the Selection object, but it does not support
7309 * the `extend` method, which means that even in modern IE, it's not possible
7310 * to programmatically create a backward selection. Thus, for all IE
7311 * versions, we use the old IE API to create our selections.
7312 *
7313 * @param {DOMElement|DOMTextNode} node
7314 * @param {object} offsets
7315 */
7316function setModernOffsets(node, offsets) {
7317 if (!window.getSelection) {
7318 return;
7319 }
7320
7321 var selection = window.getSelection();
7322 var length = node[getTextContentAccessor()].length;
7323 var start = Math.min(offsets.start, length);
7324 var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
7325
7326 // IE 11 uses modern selection, but doesn't support the extend method.
7327 // Flip backward selections, so we can set with a single range.
7328 if (!selection.extend && start > end) {
7329 var temp = end;
7330 end = start;
7331 start = temp;
7332 }
7333
7334 var startMarker = getNodeForCharacterOffset(node, start);
7335 var endMarker = getNodeForCharacterOffset(node, end);
7336
7337 if (startMarker && endMarker) {
7338 var range = document.createRange();
7339 range.setStart(startMarker.node, startMarker.offset);
7340 selection.removeAllRanges();
7341
7342 if (start > end) {
7343 selection.addRange(range);
7344 selection.extend(endMarker.node, endMarker.offset);
7345 } else {
7346 range.setEnd(endMarker.node, endMarker.offset);
7347 selection.addRange(range);
7348 }
7349 }
7350}
7351
7352var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window);
7353
7354var ReactDOMSelection = {
7355 /**
7356 * @param {DOMElement} node
7357 */
7358 getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets,
7359
7360 /**
7361 * @param {DOMElement|DOMTextNode} node
7362 * @param {object} offsets
7363 */
7364 setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets
7365};
7366
7367module.exports = ReactDOMSelection;
7368},{"108":108,"109":109,"127":127}],40:[function(_dereq_,module,exports){
7369/**
7370 * Copyright (c) 2013-present, Facebook, Inc.
7371 *
7372 * This source code is licensed under the MIT license found in the
7373 * LICENSE file in the root directory of this source tree.
7374 *
7375 */
7376
7377'use strict';
7378
7379var ReactDefaultInjection = _dereq_(47);
7380var ReactServerRendering = _dereq_(71);
7381var ReactVersion = _dereq_(76);
7382
7383ReactDefaultInjection.inject();
7384
7385var ReactDOMServer = {
7386 renderToString: ReactServerRendering.renderToString,
7387 renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup,
7388 version: ReactVersion
7389};
7390
7391module.exports = ReactDOMServer;
7392},{"47":47,"71":71,"76":76}],41:[function(_dereq_,module,exports){
7393/**
7394 * Copyright (c) 2013-present, Facebook, Inc.
7395 *
7396 * This source code is licensed under the MIT license found in the
7397 * LICENSE file in the root directory of this source tree.
7398 *
7399 */
7400
7401'use strict';
7402
7403var ReactDOMServer = _dereq_(40);
7404
7405module.exports = ReactDOMServer;
7406},{"40":40}],42:[function(_dereq_,module,exports){
7407/**
7408 * Copyright (c) 2013-present, Facebook, Inc.
7409 *
7410 * This source code is licensed under the MIT license found in the
7411 * LICENSE file in the root directory of this source tree.
7412 *
7413 */
7414
7415'use strict';
7416
7417var _prodInvariant = _dereq_(116),
7418 _assign = _dereq_(149);
7419
7420var DOMChildrenOperations = _dereq_(8);
7421var DOMLazyTree = _dereq_(9);
7422var ReactDOMComponentTree = _dereq_(32);
7423
7424var escapeTextContentForBrowser = _dereq_(100);
7425var invariant = _dereq_(141);
7426var validateDOMNesting = _dereq_(121);
7427
7428/**
7429 * Text nodes violate a couple assumptions that React makes about components:
7430 *
7431 * - When mounting text into the DOM, adjacent text nodes are merged.
7432 * - Text nodes cannot be assigned a React root ID.
7433 *
7434 * This component is used to wrap strings between comment nodes so that they
7435 * can undergo the same reconciliation that is applied to elements.
7436 *
7437 * TODO: Investigate representing React components in the DOM with text nodes.
7438 *
7439 * @class ReactDOMTextComponent
7440 * @extends ReactComponent
7441 * @internal
7442 */
7443var ReactDOMTextComponent = function (text) {
7444 // TODO: This is really a ReactText (ReactNode), not a ReactElement
7445 this._currentElement = text;
7446 this._stringText = '' + text;
7447 // ReactDOMComponentTree uses these:
7448 this._hostNode = null;
7449 this._hostParent = null;
7450
7451 // Properties
7452 this._domID = 0;
7453 this._mountIndex = 0;
7454 this._closingComment = null;
7455 this._commentNodes = null;
7456};
7457
7458_assign(ReactDOMTextComponent.prototype, {
7459 /**
7460 * Creates the markup for this text node. This node is not intended to have
7461 * any features besides containing text content.
7462 *
7463 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
7464 * @return {string} Markup for this text node.
7465 * @internal
7466 */
7467 mountComponent: function (transaction, hostParent, hostContainerInfo, context) {
7468 if ("development" !== 'production') {
7469 var parentInfo;
7470 if (hostParent != null) {
7471 parentInfo = hostParent._ancestorInfo;
7472 } else if (hostContainerInfo != null) {
7473 parentInfo = hostContainerInfo._ancestorInfo;
7474 }
7475 if (parentInfo) {
7476 // parentInfo should always be present except for the top-level
7477 // component when server rendering
7478 validateDOMNesting(null, this._stringText, this, parentInfo);
7479 }
7480 }
7481
7482 var domID = hostContainerInfo._idCounter++;
7483 var openingValue = ' react-text: ' + domID + ' ';
7484 var closingValue = ' /react-text ';
7485 this._domID = domID;
7486 this._hostParent = hostParent;
7487 if (transaction.useCreateElement) {
7488 var ownerDocument = hostContainerInfo._ownerDocument;
7489 var openingComment = ownerDocument.createComment(openingValue);
7490 var closingComment = ownerDocument.createComment(closingValue);
7491 var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment());
7492 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment));
7493 if (this._stringText) {
7494 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText)));
7495 }
7496 DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment));
7497 ReactDOMComponentTree.precacheNode(this, openingComment);
7498 this._closingComment = closingComment;
7499 return lazyTree;
7500 } else {
7501 var escapedText = escapeTextContentForBrowser(this._stringText);
7502
7503 if (transaction.renderToStaticMarkup) {
7504 // Normally we'd wrap this between comment nodes for the reasons stated
7505 // above, but since this is a situation where React won't take over
7506 // (static pages), we can simply return the text as it is.
7507 return escapedText;
7508 }
7509
7510 return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->';
7511 }
7512 },
7513
7514 /**
7515 * Updates this component by updating the text content.
7516 *
7517 * @param {ReactText} nextText The next text content
7518 * @param {ReactReconcileTransaction} transaction
7519 * @internal
7520 */
7521 receiveComponent: function (nextText, transaction) {
7522 if (nextText !== this._currentElement) {
7523 this._currentElement = nextText;
7524 var nextStringText = '' + nextText;
7525 if (nextStringText !== this._stringText) {
7526 // TODO: Save this as pending props and use performUpdateIfNecessary
7527 // and/or updateComponent to do the actual update for consistency with
7528 // other component types?
7529 this._stringText = nextStringText;
7530 var commentNodes = this.getHostNode();
7531 DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText);
7532 }
7533 }
7534 },
7535
7536 getHostNode: function () {
7537 var hostNode = this._commentNodes;
7538 if (hostNode) {
7539 return hostNode;
7540 }
7541 if (!this._closingComment) {
7542 var openingComment = ReactDOMComponentTree.getNodeFromInstance(this);
7543 var node = openingComment.nextSibling;
7544 while (true) {
7545 !(node != null) ? "development" !== 'production' ? invariant(false, 'Missing closing comment for text component %s', this._domID) : _prodInvariant('67', this._domID) : void 0;
7546 if (node.nodeType === 8 && node.nodeValue === ' /react-text ') {
7547 this._closingComment = node;
7548 break;
7549 }
7550 node = node.nextSibling;
7551 }
7552 }
7553 hostNode = [this._hostNode, this._closingComment];
7554 this._commentNodes = hostNode;
7555 return hostNode;
7556 },
7557
7558 unmountComponent: function () {
7559 this._closingComment = null;
7560 this._commentNodes = null;
7561 ReactDOMComponentTree.uncacheNode(this);
7562 }
7563});
7564
7565module.exports = ReactDOMTextComponent;
7566},{"100":100,"116":116,"121":121,"141":141,"149":149,"32":32,"8":8,"9":9}],43:[function(_dereq_,module,exports){
7567/**
7568 * Copyright (c) 2013-present, Facebook, Inc.
7569 *
7570 * This source code is licensed under the MIT license found in the
7571 * LICENSE file in the root directory of this source tree.
7572 *
7573 */
7574
7575'use strict';
7576
7577var _prodInvariant = _dereq_(116),
7578 _assign = _dereq_(149);
7579
7580var LinkedValueUtils = _dereq_(23);
7581var ReactDOMComponentTree = _dereq_(32);
7582var ReactUpdates = _dereq_(75);
7583
7584var invariant = _dereq_(141);
7585var warning = _dereq_(148);
7586
7587var didWarnValueLink = false;
7588var didWarnValDefaultVal = false;
7589
7590function forceUpdateIfMounted() {
7591 if (this._rootNodeID) {
7592 // DOM component is still mounted; update
7593 ReactDOMTextarea.updateWrapper(this);
7594 }
7595}
7596
7597/**
7598 * Implements a <textarea> host component that allows setting `value`, and
7599 * `defaultValue`. This differs from the traditional DOM API because value is
7600 * usually set as PCDATA children.
7601 *
7602 * If `value` is not supplied (or null/undefined), user actions that affect the
7603 * value will trigger updates to the element.
7604 *
7605 * If `value` is supplied (and not null/undefined), the rendered element will
7606 * not trigger updates to the element. Instead, the `value` prop must change in
7607 * order for the rendered element to be updated.
7608 *
7609 * The rendered element will be initialized with an empty value, the prop
7610 * `defaultValue` if specified, or the children content (deprecated).
7611 */
7612var ReactDOMTextarea = {
7613 getHostProps: function (inst, props) {
7614 !(props.dangerouslySetInnerHTML == null) ? "development" !== 'production' ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : _prodInvariant('91') : void 0;
7615
7616 // Always set children to the same thing. In IE9, the selection range will
7617 // get reset if `textContent` is mutated. We could add a check in setTextContent
7618 // to only set the value if/when the value differs from the node value (which would
7619 // completely solve this IE9 bug), but Sebastian+Ben seemed to like this solution.
7620 // The value can be a boolean or object so that's why it's forced to be a string.
7621 var hostProps = _assign({}, props, {
7622 value: undefined,
7623 defaultValue: undefined,
7624 children: '' + inst._wrapperState.initialValue,
7625 onChange: inst._wrapperState.onChange
7626 });
7627
7628 return hostProps;
7629 },
7630
7631 mountWrapper: function (inst, props) {
7632 if ("development" !== 'production') {
7633 LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner);
7634 if (props.valueLink !== undefined && !didWarnValueLink) {
7635 "development" !== 'production' ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0;
7636 didWarnValueLink = true;
7637 }
7638 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
7639 "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;
7640 didWarnValDefaultVal = true;
7641 }
7642 }
7643
7644 var value = LinkedValueUtils.getValue(props);
7645 var initialValue = value;
7646
7647 // Only bother fetching default value if we're going to use it
7648 if (value == null) {
7649 var defaultValue = props.defaultValue;
7650 // TODO (yungsters): Remove support for children content in <textarea>.
7651 var children = props.children;
7652 if (children != null) {
7653 if ("development" !== 'production') {
7654 "development" !== 'production' ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0;
7655 }
7656 !(defaultValue == null) ? "development" !== 'production' ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : _prodInvariant('92') : void 0;
7657 if (Array.isArray(children)) {
7658 !(children.length <= 1) ? "development" !== 'production' ? invariant(false, '<textarea> can only have at most one child.') : _prodInvariant('93') : void 0;
7659 children = children[0];
7660 }
7661
7662 defaultValue = '' + children;
7663 }
7664 if (defaultValue == null) {
7665 defaultValue = '';
7666 }
7667 initialValue = defaultValue;
7668 }
7669
7670 inst._wrapperState = {
7671 initialValue: '' + initialValue,
7672 listeners: null,
7673 onChange: _handleChange.bind(inst)
7674 };
7675 },
7676
7677 updateWrapper: function (inst) {
7678 var props = inst._currentElement.props;
7679
7680 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
7681 var value = LinkedValueUtils.getValue(props);
7682 if (value != null) {
7683 // Cast `value` to a string to ensure the value is set correctly. While
7684 // browsers typically do this as necessary, jsdom doesn't.
7685 var newValue = '' + value;
7686
7687 // To avoid side effects (such as losing text selection), only set value if changed
7688 if (newValue !== node.value) {
7689 node.value = newValue;
7690 }
7691 if (props.defaultValue == null) {
7692 node.defaultValue = newValue;
7693 }
7694 }
7695 if (props.defaultValue != null) {
7696 node.defaultValue = props.defaultValue;
7697 }
7698 },
7699
7700 postMountWrapper: function (inst) {
7701 // This is in postMount because we need access to the DOM node, which is not
7702 // available until after the component has mounted.
7703 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
7704 var textContent = node.textContent;
7705
7706 // Only set node.value if textContent is equal to the expected
7707 // initial value. In IE10/IE11 there is a bug where the placeholder attribute
7708 // will populate textContent as well.
7709 // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
7710 if (textContent === inst._wrapperState.initialValue) {
7711 node.value = textContent;
7712 }
7713 }
7714};
7715
7716function _handleChange(event) {
7717 var props = this._currentElement.props;
7718 var returnValue = LinkedValueUtils.executeOnChange(props, event);
7719 ReactUpdates.asap(forceUpdateIfMounted, this);
7720 return returnValue;
7721}
7722
7723module.exports = ReactDOMTextarea;
7724},{"116":116,"141":141,"148":148,"149":149,"23":23,"32":32,"75":75}],44:[function(_dereq_,module,exports){
7725/**
7726 * Copyright (c) 2015-present, Facebook, Inc.
7727 *
7728 * This source code is licensed under the MIT license found in the
7729 * LICENSE file in the root directory of this source tree.
7730 *
7731 */
7732
7733'use strict';
7734
7735var _prodInvariant = _dereq_(116);
7736
7737var invariant = _dereq_(141);
7738
7739/**
7740 * Return the lowest common ancestor of A and B, or null if they are in
7741 * different trees.
7742 */
7743function getLowestCommonAncestor(instA, instB) {
7744 !('_hostNode' in instA) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
7745 !('_hostNode' in instB) ? "development" !== 'production' ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0;
7746
7747 var depthA = 0;
7748 for (var tempA = instA; tempA; tempA = tempA._hostParent) {
7749 depthA++;
7750 }
7751 var depthB = 0;
7752 for (var tempB = instB; tempB; tempB = tempB._hostParent) {
7753 depthB++;
7754 }
7755
7756 // If A is deeper, crawl up.
7757 while (depthA - depthB > 0) {
7758 instA = instA._hostParent;
7759 depthA--;
7760 }
7761
7762 // If B is deeper, crawl up.
7763 while (depthB - depthA > 0) {
7764 instB = instB._hostParent;
7765 depthB--;
7766 }
7767
7768 // Walk in lockstep until we find a match.
7769 var depth = depthA;
7770 while (depth--) {
7771 if (instA === instB) {
7772 return instA;
7773 }
7774 instA = instA._hostParent;
7775 instB = instB._hostParent;
7776 }
7777 return null;
7778}
7779
7780/**
7781 * Return if A is an ancestor of B.
7782 */
7783function isAncestor(instA, instB) {
7784 !('_hostNode' in instA) ? "development" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
7785 !('_hostNode' in instB) ? "development" !== 'production' ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0;
7786
7787 while (instB) {
7788 if (instB === instA) {
7789 return true;
7790 }
7791 instB = instB._hostParent;
7792 }
7793 return false;
7794}
7795
7796/**
7797 * Return the parent instance of the passed-in instance.
7798 */
7799function getParentInstance(inst) {
7800 !('_hostNode' in inst) ? "development" !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : _prodInvariant('36') : void 0;
7801
7802 return inst._hostParent;
7803}
7804
7805/**
7806 * Simulates the traversal of a two-phase, capture/bubble event dispatch.
7807 */
7808function traverseTwoPhase(inst, fn, arg) {
7809 var path = [];
7810 while (inst) {
7811 path.push(inst);
7812 inst = inst._hostParent;
7813 }
7814 var i;
7815 for (i = path.length; i-- > 0;) {
7816 fn(path[i], 'captured', arg);
7817 }
7818 for (i = 0; i < path.length; i++) {
7819 fn(path[i], 'bubbled', arg);
7820 }
7821}
7822
7823/**
7824 * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
7825 * should would receive a `mouseEnter` or `mouseLeave` event.
7826 *
7827 * Does not invoke the callback on the nearest common ancestor because nothing
7828 * "entered" or "left" that element.
7829 */
7830function traverseEnterLeave(from, to, fn, argFrom, argTo) {
7831 var common = from && to ? getLowestCommonAncestor(from, to) : null;
7832 var pathFrom = [];
7833 while (from && from !== common) {
7834 pathFrom.push(from);
7835 from = from._hostParent;
7836 }
7837 var pathTo = [];
7838 while (to && to !== common) {
7839 pathTo.push(to);
7840 to = to._hostParent;
7841 }
7842 var i;
7843 for (i = 0; i < pathFrom.length; i++) {
7844 fn(pathFrom[i], 'bubbled', argFrom);
7845 }
7846 for (i = pathTo.length; i-- > 0;) {
7847 fn(pathTo[i], 'captured', argTo);
7848 }
7849}
7850
7851module.exports = {
7852 isAncestor: isAncestor,
7853 getLowestCommonAncestor: getLowestCommonAncestor,
7854 getParentInstance: getParentInstance,
7855 traverseTwoPhase: traverseTwoPhase,
7856 traverseEnterLeave: traverseEnterLeave
7857};
7858},{"116":116,"141":141}],45:[function(_dereq_,module,exports){
7859/**
7860 * Copyright (c) 2016-present, Facebook, Inc.
7861 *
7862 * This source code is licensed under the MIT license found in the
7863 * LICENSE file in the root directory of this source tree.
7864 *
7865 *
7866 */
7867
7868'use strict';
7869
7870var ReactInvalidSetStateWarningHook = _dereq_(60);
7871var ReactHostOperationHistoryHook = _dereq_(55);
7872var ReactComponentTreeHook = _dereq_(122);
7873var ExecutionEnvironment = _dereq_(127);
7874
7875var performanceNow = _dereq_(146);
7876var warning = _dereq_(148);
7877
7878var hooks = [];
7879var didHookThrowForEvent = {};
7880
7881function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
7882 try {
7883 fn.call(context, arg1, arg2, arg3, arg4, arg5);
7884 } catch (e) {
7885 "development" !== 'production' ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0;
7886 didHookThrowForEvent[event] = true;
7887 }
7888}
7889
7890function emitEvent(event, arg1, arg2, arg3, arg4, arg5) {
7891 for (var i = 0; i < hooks.length; i++) {
7892 var hook = hooks[i];
7893 var fn = hook[event];
7894 if (fn) {
7895 callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5);
7896 }
7897 }
7898}
7899
7900var isProfiling = false;
7901var flushHistory = [];
7902var lifeCycleTimerStack = [];
7903var currentFlushNesting = 0;
7904var currentFlushMeasurements = [];
7905var currentFlushStartTime = 0;
7906var currentTimerDebugID = null;
7907var currentTimerStartTime = 0;
7908var currentTimerNestedFlushDuration = 0;
7909var currentTimerType = null;
7910
7911var lifeCycleTimerHasWarned = false;
7912
7913function clearHistory() {
7914 ReactComponentTreeHook.purgeUnmountedComponents();
7915 ReactHostOperationHistoryHook.clearHistory();
7916}
7917
7918function getTreeSnapshot(registeredIDs) {
7919 return registeredIDs.reduce(function (tree, id) {
7920 var ownerID = ReactComponentTreeHook.getOwnerID(id);
7921 var parentID = ReactComponentTreeHook.getParentID(id);
7922 tree[id] = {
7923 displayName: ReactComponentTreeHook.getDisplayName(id),
7924 text: ReactComponentTreeHook.getText(id),
7925 updateCount: ReactComponentTreeHook.getUpdateCount(id),
7926 childIDs: ReactComponentTreeHook.getChildIDs(id),
7927 // Text nodes don't have owners but this is close enough.
7928 ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0,
7929 parentID: parentID
7930 };
7931 return tree;
7932 }, {});
7933}
7934
7935function resetMeasurements() {
7936 var previousStartTime = currentFlushStartTime;
7937 var previousMeasurements = currentFlushMeasurements;
7938 var previousOperations = ReactHostOperationHistoryHook.getHistory();
7939
7940 if (currentFlushNesting === 0) {
7941 currentFlushStartTime = 0;
7942 currentFlushMeasurements = [];
7943 clearHistory();
7944 return;
7945 }
7946
7947 if (previousMeasurements.length || previousOperations.length) {
7948 var registeredIDs = ReactComponentTreeHook.getRegisteredIDs();
7949 flushHistory.push({
7950 duration: performanceNow() - previousStartTime,
7951 measurements: previousMeasurements || [],
7952 operations: previousOperations || [],
7953 treeSnapshot: getTreeSnapshot(registeredIDs)
7954 });
7955 }
7956
7957 clearHistory();
7958 currentFlushStartTime = performanceNow();
7959 currentFlushMeasurements = [];
7960}
7961
7962function checkDebugID(debugID) {
7963 var allowRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
7964
7965 if (allowRoot && debugID === 0) {
7966 return;
7967 }
7968 if (!debugID) {
7969 "development" !== 'production' ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0;
7970 }
7971}
7972
7973function beginLifeCycleTimer(debugID, timerType) {
7974 if (currentFlushNesting === 0) {
7975 return;
7976 }
7977 if (currentTimerType && !lifeCycleTimerHasWarned) {
7978 "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;
7979 lifeCycleTimerHasWarned = true;
7980 }
7981 currentTimerStartTime = performanceNow();
7982 currentTimerNestedFlushDuration = 0;
7983 currentTimerDebugID = debugID;
7984 currentTimerType = timerType;
7985}
7986
7987function endLifeCycleTimer(debugID, timerType) {
7988 if (currentFlushNesting === 0) {
7989 return;
7990 }
7991 if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) {
7992 "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;
7993 lifeCycleTimerHasWarned = true;
7994 }
7995 if (isProfiling) {
7996 currentFlushMeasurements.push({
7997 timerType: timerType,
7998 instanceID: debugID,
7999 duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration
8000 });
8001 }
8002 currentTimerStartTime = 0;
8003 currentTimerNestedFlushDuration = 0;
8004 currentTimerDebugID = null;
8005 currentTimerType = null;
8006}
8007
8008function pauseCurrentLifeCycleTimer() {
8009 var currentTimer = {
8010 startTime: currentTimerStartTime,
8011 nestedFlushStartTime: performanceNow(),
8012 debugID: currentTimerDebugID,
8013 timerType: currentTimerType
8014 };
8015 lifeCycleTimerStack.push(currentTimer);
8016 currentTimerStartTime = 0;
8017 currentTimerNestedFlushDuration = 0;
8018 currentTimerDebugID = null;
8019 currentTimerType = null;
8020}
8021
8022function resumeCurrentLifeCycleTimer() {
8023 var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(),
8024 startTime = _lifeCycleTimerStack$.startTime,
8025 nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime,
8026 debugID = _lifeCycleTimerStack$.debugID,
8027 timerType = _lifeCycleTimerStack$.timerType;
8028
8029 var nestedFlushDuration = performanceNow() - nestedFlushStartTime;
8030 currentTimerStartTime = startTime;
8031 currentTimerNestedFlushDuration += nestedFlushDuration;
8032 currentTimerDebugID = debugID;
8033 currentTimerType = timerType;
8034}
8035
8036var lastMarkTimeStamp = 0;
8037var canUsePerformanceMeasure = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';
8038
8039function shouldMark(debugID) {
8040 if (!isProfiling || !canUsePerformanceMeasure) {
8041 return false;
8042 }
8043 var element = ReactComponentTreeHook.getElement(debugID);
8044 if (element == null || typeof element !== 'object') {
8045 return false;
8046 }
8047 var isHostElement = typeof element.type === 'string';
8048 if (isHostElement) {
8049 return false;
8050 }
8051 return true;
8052}
8053
8054function markBegin(debugID, markType) {
8055 if (!shouldMark(debugID)) {
8056 return;
8057 }
8058
8059 var markName = debugID + '::' + markType;
8060 lastMarkTimeStamp = performanceNow();
8061 performance.mark(markName);
8062}
8063
8064function markEnd(debugID, markType) {
8065 if (!shouldMark(debugID)) {
8066 return;
8067 }
8068
8069 var markName = debugID + '::' + markType;
8070 var displayName = ReactComponentTreeHook.getDisplayName(debugID) || 'Unknown';
8071
8072 // Chrome has an issue of dropping markers recorded too fast:
8073 // https://bugs.chromium.org/p/chromium/issues/detail?id=640652
8074 // To work around this, we will not report very small measurements.
8075 // I determined the magic number by tweaking it back and forth.
8076 // 0.05ms was enough to prevent the issue, but I set it to 0.1ms to be safe.
8077 // When the bug is fixed, we can `measure()` unconditionally if we want to.
8078 var timeStamp = performanceNow();
8079 if (timeStamp - lastMarkTimeStamp > 0.1) {
8080 var measurementName = displayName + ' [' + markType + ']';
8081 performance.measure(measurementName, markName);
8082 }
8083
8084 performance.clearMarks(markName);
8085 if (measurementName) {
8086 performance.clearMeasures(measurementName);
8087 }
8088}
8089
8090var ReactDebugTool = {
8091 addHook: function (hook) {
8092 hooks.push(hook);
8093 },
8094 removeHook: function (hook) {
8095 for (var i = 0; i < hooks.length; i++) {
8096 if (hooks[i] === hook) {
8097 hooks.splice(i, 1);
8098 i--;
8099 }
8100 }
8101 },
8102 isProfiling: function () {
8103 return isProfiling;
8104 },
8105 beginProfiling: function () {
8106 if (isProfiling) {
8107 return;
8108 }
8109
8110 isProfiling = true;
8111 flushHistory.length = 0;
8112 resetMeasurements();
8113 ReactDebugTool.addHook(ReactHostOperationHistoryHook);
8114 },
8115 endProfiling: function () {
8116 if (!isProfiling) {
8117 return;
8118 }
8119
8120 isProfiling = false;
8121 resetMeasurements();
8122 ReactDebugTool.removeHook(ReactHostOperationHistoryHook);
8123 },
8124 getFlushHistory: function () {
8125 return flushHistory;
8126 },
8127 onBeginFlush: function () {
8128 currentFlushNesting++;
8129 resetMeasurements();
8130 pauseCurrentLifeCycleTimer();
8131 emitEvent('onBeginFlush');
8132 },
8133 onEndFlush: function () {
8134 resetMeasurements();
8135 currentFlushNesting--;
8136 resumeCurrentLifeCycleTimer();
8137 emitEvent('onEndFlush');
8138 },
8139 onBeginLifeCycleTimer: function (debugID, timerType) {
8140 checkDebugID(debugID);
8141 emitEvent('onBeginLifeCycleTimer', debugID, timerType);
8142 markBegin(debugID, timerType);
8143 beginLifeCycleTimer(debugID, timerType);
8144 },
8145 onEndLifeCycleTimer: function (debugID, timerType) {
8146 checkDebugID(debugID);
8147 endLifeCycleTimer(debugID, timerType);
8148 markEnd(debugID, timerType);
8149 emitEvent('onEndLifeCycleTimer', debugID, timerType);
8150 },
8151 onBeginProcessingChildContext: function () {
8152 emitEvent('onBeginProcessingChildContext');
8153 },
8154 onEndProcessingChildContext: function () {
8155 emitEvent('onEndProcessingChildContext');
8156 },
8157 onHostOperation: function (operation) {
8158 checkDebugID(operation.instanceID);
8159 emitEvent('onHostOperation', operation);
8160 },
8161 onSetState: function () {
8162 emitEvent('onSetState');
8163 },
8164 onSetChildren: function (debugID, childDebugIDs) {
8165 checkDebugID(debugID);
8166 childDebugIDs.forEach(checkDebugID);
8167 emitEvent('onSetChildren', debugID, childDebugIDs);
8168 },
8169 onBeforeMountComponent: function (debugID, element, parentDebugID) {
8170 checkDebugID(debugID);
8171 checkDebugID(parentDebugID, true);
8172 emitEvent('onBeforeMountComponent', debugID, element, parentDebugID);
8173 markBegin(debugID, 'mount');
8174 },
8175 onMountComponent: function (debugID) {
8176 checkDebugID(debugID);
8177 markEnd(debugID, 'mount');
8178 emitEvent('onMountComponent', debugID);
8179 },
8180 onBeforeUpdateComponent: function (debugID, element) {
8181 checkDebugID(debugID);
8182 emitEvent('onBeforeUpdateComponent', debugID, element);
8183 markBegin(debugID, 'update');
8184 },
8185 onUpdateComponent: function (debugID) {
8186 checkDebugID(debugID);
8187 markEnd(debugID, 'update');
8188 emitEvent('onUpdateComponent', debugID);
8189 },
8190 onBeforeUnmountComponent: function (debugID) {
8191 checkDebugID(debugID);
8192 emitEvent('onBeforeUnmountComponent', debugID);
8193 markBegin(debugID, 'unmount');
8194 },
8195 onUnmountComponent: function (debugID) {
8196 checkDebugID(debugID);
8197 markEnd(debugID, 'unmount');
8198 emitEvent('onUnmountComponent', debugID);
8199 },
8200 onTestEvent: function () {
8201 emitEvent('onTestEvent');
8202 }
8203};
8204
8205// TODO remove these when RN/www gets updated
8206ReactDebugTool.addDevtool = ReactDebugTool.addHook;
8207ReactDebugTool.removeDevtool = ReactDebugTool.removeHook;
8208
8209ReactDebugTool.addHook(ReactInvalidSetStateWarningHook);
8210ReactDebugTool.addHook(ReactComponentTreeHook);
8211var url = ExecutionEnvironment.canUseDOM && window.location.href || '';
8212if (/[?&]react_perf\b/.test(url)) {
8213 ReactDebugTool.beginProfiling();
8214}
8215
8216module.exports = ReactDebugTool;
8217},{"122":122,"127":127,"146":146,"148":148,"55":55,"60":60}],46:[function(_dereq_,module,exports){
8218/**
8219 * Copyright (c) 2013-present, Facebook, Inc.
8220 *
8221 * This source code is licensed under the MIT license found in the
8222 * LICENSE file in the root directory of this source tree.
8223 *
8224 */
8225
8226'use strict';
8227
8228var _assign = _dereq_(149);
8229
8230var ReactUpdates = _dereq_(75);
8231var Transaction = _dereq_(93);
8232
8233var emptyFunction = _dereq_(133);
8234
8235var RESET_BATCHED_UPDATES = {
8236 initialize: emptyFunction,
8237 close: function () {
8238 ReactDefaultBatchingStrategy.isBatchingUpdates = false;
8239 }
8240};
8241
8242var FLUSH_BATCHED_UPDATES = {
8243 initialize: emptyFunction,
8244 close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates)
8245};
8246
8247var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES];
8248
8249function ReactDefaultBatchingStrategyTransaction() {
8250 this.reinitializeTransaction();
8251}
8252
8253_assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction, {
8254 getTransactionWrappers: function () {
8255 return TRANSACTION_WRAPPERS;
8256 }
8257});
8258
8259var transaction = new ReactDefaultBatchingStrategyTransaction();
8260
8261var ReactDefaultBatchingStrategy = {
8262 isBatchingUpdates: false,
8263
8264 /**
8265 * Call the provided function in a context within which calls to `setState`
8266 * and friends are batched such that components aren't updated unnecessarily.
8267 */
8268 batchedUpdates: function (callback, a, b, c, d, e) {
8269 var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates;
8270
8271 ReactDefaultBatchingStrategy.isBatchingUpdates = true;
8272
8273 // The code is written this way to avoid extra allocations
8274 if (alreadyBatchingUpdates) {
8275 return callback(a, b, c, d, e);
8276 } else {
8277 return transaction.perform(callback, null, a, b, c, d, e);
8278 }
8279 }
8280};
8281
8282module.exports = ReactDefaultBatchingStrategy;
8283},{"133":133,"149":149,"75":75,"93":93}],47:[function(_dereq_,module,exports){
8284/**
8285 * Copyright (c) 2013-present, Facebook, Inc.
8286 *
8287 * This source code is licensed under the MIT license found in the
8288 * LICENSE file in the root directory of this source tree.
8289 *
8290 */
8291
8292'use strict';
8293
8294var ARIADOMPropertyConfig = _dereq_(1);
8295var BeforeInputEventPlugin = _dereq_(3);
8296var ChangeEventPlugin = _dereq_(7);
8297var DefaultEventPluginOrder = _dereq_(14);
8298var EnterLeaveEventPlugin = _dereq_(15);
8299var HTMLDOMPropertyConfig = _dereq_(21);
8300var ReactComponentBrowserEnvironment = _dereq_(27);
8301var ReactDOMComponent = _dereq_(30);
8302var ReactDOMComponentTree = _dereq_(32);
8303var ReactDOMEmptyComponent = _dereq_(34);
8304var ReactDOMTreeTraversal = _dereq_(44);
8305var ReactDOMTextComponent = _dereq_(42);
8306var ReactDefaultBatchingStrategy = _dereq_(46);
8307var ReactEventListener = _dereq_(52);
8308var ReactInjection = _dereq_(56);
8309var ReactReconcileTransaction = _dereq_(67);
8310var SVGDOMPropertyConfig = _dereq_(77);
8311var SelectEventPlugin = _dereq_(78);
8312var SimpleEventPlugin = _dereq_(79);
8313
8314var alreadyInjected = false;
8315
8316function inject() {
8317 if (alreadyInjected) {
8318 // TODO: This is currently true because these injections are shared between
8319 // the client and the server package. They should be built independently
8320 // and not share any injection state. Then this problem will be solved.
8321 return;
8322 }
8323 alreadyInjected = true;
8324
8325 ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener);
8326
8327 /**
8328 * Inject modules for resolving DOM hierarchy and plugin ordering.
8329 */
8330 ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder);
8331 ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree);
8332 ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal);
8333
8334 /**
8335 * Some important event plugins included by default (without having to require
8336 * them).
8337 */
8338 ReactInjection.EventPluginHub.injectEventPluginsByName({
8339 SimpleEventPlugin: SimpleEventPlugin,
8340 EnterLeaveEventPlugin: EnterLeaveEventPlugin,
8341 ChangeEventPlugin: ChangeEventPlugin,
8342 SelectEventPlugin: SelectEventPlugin,
8343 BeforeInputEventPlugin: BeforeInputEventPlugin
8344 });
8345
8346 ReactInjection.HostComponent.injectGenericComponentClass(ReactDOMComponent);
8347
8348 ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent);
8349
8350 ReactInjection.DOMProperty.injectDOMPropertyConfig(ARIADOMPropertyConfig);
8351 ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
8352 ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);
8353
8354 ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) {
8355 return new ReactDOMEmptyComponent(instantiate);
8356 });
8357
8358 ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction);
8359 ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy);
8360
8361 ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment);
8362}
8363
8364module.exports = {
8365 inject: inject
8366};
8367},{"1":1,"14":14,"15":15,"21":21,"27":27,"3":3,"30":30,"32":32,"34":34,"42":42,"44":44,"46":46,"52":52,"56":56,"67":67,"7":7,"77":77,"78":78,"79":79}],48:[function(_dereq_,module,exports){
8368/**
8369 * Copyright (c) 2014-present, Facebook, Inc.
8370 *
8371 * This source code is licensed under the MIT license found in the
8372 * LICENSE file in the root directory of this source tree.
8373 *
8374 *
8375 */
8376
8377'use strict';
8378
8379// The Symbol used to tag the ReactElement type. If there is no native Symbol
8380// nor polyfill, then a plain number is used for performance.
8381
8382var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
8383
8384module.exports = REACT_ELEMENT_TYPE;
8385},{}],49:[function(_dereq_,module,exports){
8386/**
8387 * Copyright (c) 2014-present, Facebook, Inc.
8388 *
8389 * This source code is licensed under the MIT license found in the
8390 * LICENSE file in the root directory of this source tree.
8391 *
8392 */
8393
8394'use strict';
8395
8396var emptyComponentFactory;
8397
8398var ReactEmptyComponentInjection = {
8399 injectEmptyComponentFactory: function (factory) {
8400 emptyComponentFactory = factory;
8401 }
8402};
8403
8404var ReactEmptyComponent = {
8405 create: function (instantiate) {
8406 return emptyComponentFactory(instantiate);
8407 }
8408};
8409
8410ReactEmptyComponent.injection = ReactEmptyComponentInjection;
8411
8412module.exports = ReactEmptyComponent;
8413},{}],50:[function(_dereq_,module,exports){
8414/**
8415 * Copyright (c) 2013-present, Facebook, Inc.
8416 *
8417 * This source code is licensed under the MIT license found in the
8418 * LICENSE file in the root directory of this source tree.
8419 *
8420 *
8421 */
8422
8423'use strict';
8424
8425var caughtError = null;
8426
8427/**
8428 * Call a function while guarding against errors that happens within it.
8429 *
8430 * @param {String} name of the guard to use for logging or debugging
8431 * @param {Function} func The function to invoke
8432 * @param {*} a First argument
8433 * @param {*} b Second argument
8434 */
8435function invokeGuardedCallback(name, func, a) {
8436 try {
8437 func(a);
8438 } catch (x) {
8439 if (caughtError === null) {
8440 caughtError = x;
8441 }
8442 }
8443}
8444
8445var ReactErrorUtils = {
8446 invokeGuardedCallback: invokeGuardedCallback,
8447
8448 /**
8449 * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event
8450 * handler are sure to be rethrown by rethrowCaughtError.
8451 */
8452 invokeGuardedCallbackWithCatch: invokeGuardedCallback,
8453
8454 /**
8455 * During execution of guarded functions we will capture the first error which
8456 * we will rethrow to be handled by the top level error handler.
8457 */
8458 rethrowCaughtError: function () {
8459 if (caughtError) {
8460 var error = caughtError;
8461 caughtError = null;
8462 throw error;
8463 }
8464 }
8465};
8466
8467if ("development" !== 'production') {
8468 /**
8469 * To help development we can get better devtools integration by simulating a
8470 * real browser event.
8471 */
8472 if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
8473 var fakeNode = document.createElement('react');
8474 ReactErrorUtils.invokeGuardedCallback = function (name, func, a) {
8475 var boundFunc = function () {
8476 func(a);
8477 };
8478 var evtType = 'react-' + name;
8479 fakeNode.addEventListener(evtType, boundFunc, false);
8480 var evt = document.createEvent('Event');
8481 evt.initEvent(evtType, false, false);
8482 fakeNode.dispatchEvent(evt);
8483 fakeNode.removeEventListener(evtType, boundFunc, false);
8484 };
8485 }
8486}
8487
8488module.exports = ReactErrorUtils;
8489},{}],51:[function(_dereq_,module,exports){
8490/**
8491 * Copyright (c) 2013-present, Facebook, Inc.
8492 *
8493 * This source code is licensed under the MIT license found in the
8494 * LICENSE file in the root directory of this source tree.
8495 *
8496 */
8497
8498'use strict';
8499
8500var EventPluginHub = _dereq_(16);
8501
8502function runEventQueueInBatch(events) {
8503 EventPluginHub.enqueueEvents(events);
8504 EventPluginHub.processEventQueue(false);
8505}
8506
8507var ReactEventEmitterMixin = {
8508 /**
8509 * Streams a fired top-level event to `EventPluginHub` where plugins have the
8510 * opportunity to create `ReactEvent`s to be dispatched.
8511 */
8512 handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
8513 var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
8514 runEventQueueInBatch(events);
8515 }
8516};
8517
8518module.exports = ReactEventEmitterMixin;
8519},{"16":16}],52:[function(_dereq_,module,exports){
8520/**
8521 * Copyright (c) 2013-present, Facebook, Inc.
8522 *
8523 * This source code is licensed under the MIT license found in the
8524 * LICENSE file in the root directory of this source tree.
8525 *
8526 */
8527
8528'use strict';
8529
8530var _assign = _dereq_(149);
8531
8532var EventListener = _dereq_(126);
8533var ExecutionEnvironment = _dereq_(127);
8534var PooledClass = _dereq_(24);
8535var ReactDOMComponentTree = _dereq_(32);
8536var ReactUpdates = _dereq_(75);
8537
8538var getEventTarget = _dereq_(106);
8539var getUnboundedScrollPosition = _dereq_(138);
8540
8541/**
8542 * Find the deepest React component completely containing the root of the
8543 * passed-in instance (for use when entire React trees are nested within each
8544 * other). If React trees are not nested, returns null.
8545 */
8546function findParent(inst) {
8547 // TODO: It may be a good idea to cache this to prevent unnecessary DOM
8548 // traversal, but caching is difficult to do correctly without using a
8549 // mutation observer to listen for all DOM changes.
8550 while (inst._hostParent) {
8551 inst = inst._hostParent;
8552 }
8553 var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst);
8554 var container = rootNode.parentNode;
8555 return ReactDOMComponentTree.getClosestInstanceFromNode(container);
8556}
8557
8558// Used to store ancestor hierarchy in top level callback
8559function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) {
8560 this.topLevelType = topLevelType;
8561 this.nativeEvent = nativeEvent;
8562 this.ancestors = [];
8563}
8564_assign(TopLevelCallbackBookKeeping.prototype, {
8565 destructor: function () {
8566 this.topLevelType = null;
8567 this.nativeEvent = null;
8568 this.ancestors.length = 0;
8569 }
8570});
8571PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler);
8572
8573function handleTopLevelImpl(bookKeeping) {
8574 var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent);
8575 var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget);
8576
8577 // Loop through the hierarchy, in case there's any nested components.
8578 // It's important that we build the array of ancestors before calling any
8579 // event handlers, because event handlers can modify the DOM, leading to
8580 // inconsistencies with ReactMount's node cache. See #1105.
8581 var ancestor = targetInst;
8582 do {
8583 bookKeeping.ancestors.push(ancestor);
8584 ancestor = ancestor && findParent(ancestor);
8585 } while (ancestor);
8586
8587 for (var i = 0; i < bookKeeping.ancestors.length; i++) {
8588 targetInst = bookKeeping.ancestors[i];
8589 ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
8590 }
8591}
8592
8593function scrollValueMonitor(cb) {
8594 var scrollPosition = getUnboundedScrollPosition(window);
8595 cb(scrollPosition);
8596}
8597
8598var ReactEventListener = {
8599 _enabled: true,
8600 _handleTopLevel: null,
8601
8602 WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null,
8603
8604 setHandleTopLevel: function (handleTopLevel) {
8605 ReactEventListener._handleTopLevel = handleTopLevel;
8606 },
8607
8608 setEnabled: function (enabled) {
8609 ReactEventListener._enabled = !!enabled;
8610 },
8611
8612 isEnabled: function () {
8613 return ReactEventListener._enabled;
8614 },
8615
8616 /**
8617 * Traps top-level events by using event bubbling.
8618 *
8619 * @param {string} topLevelType Record from `EventConstants`.
8620 * @param {string} handlerBaseName Event name (e.g. "click").
8621 * @param {object} element Element on which to attach listener.
8622 * @return {?object} An object with a remove function which will forcefully
8623 * remove the listener.
8624 * @internal
8625 */
8626 trapBubbledEvent: function (topLevelType, handlerBaseName, element) {
8627 if (!element) {
8628 return null;
8629 }
8630 return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
8631 },
8632
8633 /**
8634 * Traps a top-level event by using event capturing.
8635 *
8636 * @param {string} topLevelType Record from `EventConstants`.
8637 * @param {string} handlerBaseName Event name (e.g. "click").
8638 * @param {object} element Element on which to attach listener.
8639 * @return {?object} An object with a remove function which will forcefully
8640 * remove the listener.
8641 * @internal
8642 */
8643 trapCapturedEvent: function (topLevelType, handlerBaseName, element) {
8644 if (!element) {
8645 return null;
8646 }
8647 return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType));
8648 },
8649
8650 monitorScrollValue: function (refresh) {
8651 var callback = scrollValueMonitor.bind(null, refresh);
8652 EventListener.listen(window, 'scroll', callback);
8653 },
8654
8655 dispatchEvent: function (topLevelType, nativeEvent) {
8656 if (!ReactEventListener._enabled) {
8657 return;
8658 }
8659
8660 var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent);
8661 try {
8662 // Event queue being processed in the same cycle allows
8663 // `preventDefault`.
8664 ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping);
8665 } finally {
8666 TopLevelCallbackBookKeeping.release(bookKeeping);
8667 }
8668 }
8669};
8670
8671module.exports = ReactEventListener;
8672},{"106":106,"126":126,"127":127,"138":138,"149":149,"24":24,"32":32,"75":75}],53:[function(_dereq_,module,exports){
8673/**
8674 * Copyright (c) 2013-present, Facebook, Inc.
8675 *
8676 * This source code is licensed under the MIT license found in the
8677 * LICENSE file in the root directory of this source tree.
8678 *
8679 *
8680 */
8681
8682'use strict';
8683
8684var ReactFeatureFlags = {
8685 // When true, call console.time() before and .timeEnd() after each top-level
8686 // render (both initial renders and updates). Useful when looking at prod-mode
8687 // timeline profiles in Chrome, for example.
8688 logTopLevelRenders: false
8689};
8690
8691module.exports = ReactFeatureFlags;
8692},{}],54:[function(_dereq_,module,exports){
8693/**
8694 * Copyright (c) 2014-present, Facebook, Inc.
8695 *
8696 * This source code is licensed under the MIT license found in the
8697 * LICENSE file in the root directory of this source tree.
8698 *
8699 */
8700
8701'use strict';
8702
8703var _prodInvariant = _dereq_(116);
8704
8705var invariant = _dereq_(141);
8706
8707var genericComponentClass = null;
8708var textComponentClass = null;
8709
8710var ReactHostComponentInjection = {
8711 // This accepts a class that receives the tag string. This is a catch all
8712 // that can render any kind of tag.
8713 injectGenericComponentClass: function (componentClass) {
8714 genericComponentClass = componentClass;
8715 },
8716 // This accepts a text component class that takes the text string to be
8717 // rendered as props.
8718 injectTextComponentClass: function (componentClass) {
8719 textComponentClass = componentClass;
8720 }
8721};
8722
8723/**
8724 * Get a host internal component class for a specific tag.
8725 *
8726 * @param {ReactElement} element The element to create.
8727 * @return {function} The internal class constructor function.
8728 */
8729function createInternalComponent(element) {
8730 !genericComponentClass ? "development" !== 'production' ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0;
8731 return new genericComponentClass(element);
8732}
8733
8734/**
8735 * @param {ReactText} text
8736 * @return {ReactComponent}
8737 */
8738function createInstanceForText(text) {
8739 return new textComponentClass(text);
8740}
8741
8742/**
8743 * @param {ReactComponent} component
8744 * @return {boolean}
8745 */
8746function isTextComponent(component) {
8747 return component instanceof textComponentClass;
8748}
8749
8750var ReactHostComponent = {
8751 createInternalComponent: createInternalComponent,
8752 createInstanceForText: createInstanceForText,
8753 isTextComponent: isTextComponent,
8754 injection: ReactHostComponentInjection
8755};
8756
8757module.exports = ReactHostComponent;
8758},{"116":116,"141":141}],55:[function(_dereq_,module,exports){
8759/**
8760 * Copyright (c) 2016-present, Facebook, Inc.
8761 *
8762 * This source code is licensed under the MIT license found in the
8763 * LICENSE file in the root directory of this source tree.
8764 *
8765 *
8766 */
8767
8768'use strict';
8769
8770var history = [];
8771
8772var ReactHostOperationHistoryHook = {
8773 onHostOperation: function (operation) {
8774 history.push(operation);
8775 },
8776 clearHistory: function () {
8777 if (ReactHostOperationHistoryHook._preventClearing) {
8778 // Should only be used for tests.
8779 return;
8780 }
8781
8782 history = [];
8783 },
8784 getHistory: function () {
8785 return history;
8786 }
8787};
8788
8789module.exports = ReactHostOperationHistoryHook;
8790},{}],56:[function(_dereq_,module,exports){
8791/**
8792 * Copyright (c) 2013-present, Facebook, Inc.
8793 *
8794 * This source code is licensed under the MIT license found in the
8795 * LICENSE file in the root directory of this source tree.
8796 *
8797 */
8798
8799'use strict';
8800
8801var DOMProperty = _dereq_(11);
8802var EventPluginHub = _dereq_(16);
8803var EventPluginUtils = _dereq_(18);
8804var ReactComponentEnvironment = _dereq_(28);
8805var ReactEmptyComponent = _dereq_(49);
8806var ReactBrowserEventEmitter = _dereq_(25);
8807var ReactHostComponent = _dereq_(54);
8808var ReactUpdates = _dereq_(75);
8809
8810var ReactInjection = {
8811 Component: ReactComponentEnvironment.injection,
8812 DOMProperty: DOMProperty.injection,
8813 EmptyComponent: ReactEmptyComponent.injection,
8814 EventPluginHub: EventPluginHub.injection,
8815 EventPluginUtils: EventPluginUtils.injection,
8816 EventEmitter: ReactBrowserEventEmitter.injection,
8817 HostComponent: ReactHostComponent.injection,
8818 Updates: ReactUpdates.injection
8819};
8820
8821module.exports = ReactInjection;
8822},{"11":11,"16":16,"18":18,"25":25,"28":28,"49":49,"54":54,"75":75}],57:[function(_dereq_,module,exports){
8823/**
8824 * Copyright (c) 2013-present, Facebook, Inc.
8825 *
8826 * This source code is licensed under the MIT license found in the
8827 * LICENSE file in the root directory of this source tree.
8828 *
8829 */
8830
8831'use strict';
8832
8833var ReactDOMSelection = _dereq_(39);
8834
8835var containsNode = _dereq_(130);
8836var focusNode = _dereq_(135);
8837var getActiveElement = _dereq_(136);
8838
8839function isInDocument(node) {
8840 return containsNode(document.documentElement, node);
8841}
8842
8843/**
8844 * @ReactInputSelection: React input selection module. Based on Selection.js,
8845 * but modified to be suitable for react and has a couple of bug fixes (doesn't
8846 * assume buttons have range selections allowed).
8847 * Input selection module for React.
8848 */
8849var ReactInputSelection = {
8850 hasSelectionCapabilities: function (elem) {
8851 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
8852 return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true');
8853 },
8854
8855 getSelectionInformation: function () {
8856 var focusedElem = getActiveElement();
8857 return {
8858 focusedElem: focusedElem,
8859 selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null
8860 };
8861 },
8862
8863 /**
8864 * @restoreSelection: If any selection information was potentially lost,
8865 * restore it. This is useful when performing operations that could remove dom
8866 * nodes and place them back in, resulting in focus being lost.
8867 */
8868 restoreSelection: function (priorSelectionInformation) {
8869 var curFocusedElem = getActiveElement();
8870 var priorFocusedElem = priorSelectionInformation.focusedElem;
8871 var priorSelectionRange = priorSelectionInformation.selectionRange;
8872 if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
8873 if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) {
8874 ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange);
8875 }
8876 focusNode(priorFocusedElem);
8877 }
8878 },
8879
8880 /**
8881 * @getSelection: Gets the selection bounds of a focused textarea, input or
8882 * contentEditable node.
8883 * -@input: Look up selection bounds of this input
8884 * -@return {start: selectionStart, end: selectionEnd}
8885 */
8886 getSelection: function (input) {
8887 var selection;
8888
8889 if ('selectionStart' in input) {
8890 // Modern browser with input or textarea.
8891 selection = {
8892 start: input.selectionStart,
8893 end: input.selectionEnd
8894 };
8895 } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
8896 // IE8 input.
8897 var range = document.selection.createRange();
8898 // There can only be one selection per document in IE, so it must
8899 // be in our element.
8900 if (range.parentElement() === input) {
8901 selection = {
8902 start: -range.moveStart('character', -input.value.length),
8903 end: -range.moveEnd('character', -input.value.length)
8904 };
8905 }
8906 } else {
8907 // Content editable or old IE textarea.
8908 selection = ReactDOMSelection.getOffsets(input);
8909 }
8910
8911 return selection || { start: 0, end: 0 };
8912 },
8913
8914 /**
8915 * @setSelection: Sets the selection bounds of a textarea or input and focuses
8916 * the input.
8917 * -@input Set selection bounds of this input or textarea
8918 * -@offsets Object of same form that is returned from get*
8919 */
8920 setSelection: function (input, offsets) {
8921 var start = offsets.start;
8922 var end = offsets.end;
8923 if (end === undefined) {
8924 end = start;
8925 }
8926
8927 if ('selectionStart' in input) {
8928 input.selectionStart = start;
8929 input.selectionEnd = Math.min(end, input.value.length);
8930 } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') {
8931 var range = input.createTextRange();
8932 range.collapse(true);
8933 range.moveStart('character', start);
8934 range.moveEnd('character', end - start);
8935 range.select();
8936 } else {
8937 ReactDOMSelection.setOffsets(input, offsets);
8938 }
8939 }
8940};
8941
8942module.exports = ReactInputSelection;
8943},{"130":130,"135":135,"136":136,"39":39}],58:[function(_dereq_,module,exports){
8944/**
8945 * Copyright (c) 2013-present, Facebook, Inc.
8946 *
8947 * This source code is licensed under the MIT license found in the
8948 * LICENSE file in the root directory of this source tree.
8949 *
8950 */
8951
8952'use strict';
8953
8954/**
8955 * `ReactInstanceMap` maintains a mapping from a public facing stateful
8956 * instance (key) and the internal representation (value). This allows public
8957 * methods to accept the user facing instance as an argument and map them back
8958 * to internal methods.
8959 */
8960
8961// TODO: Replace this with ES6: var ReactInstanceMap = new Map();
8962
8963var ReactInstanceMap = {
8964 /**
8965 * This API should be called `delete` but we'd have to make sure to always
8966 * transform these to strings for IE support. When this transform is fully
8967 * supported we can rename it.
8968 */
8969 remove: function (key) {
8970 key._reactInternalInstance = undefined;
8971 },
8972
8973 get: function (key) {
8974 return key._reactInternalInstance;
8975 },
8976
8977 has: function (key) {
8978 return key._reactInternalInstance !== undefined;
8979 },
8980
8981 set: function (key, value) {
8982 key._reactInternalInstance = value;
8983 }
8984};
8985
8986module.exports = ReactInstanceMap;
8987},{}],59:[function(_dereq_,module,exports){
8988/**
8989 * Copyright (c) 2016-present, Facebook, Inc.
8990 *
8991 * This source code is licensed under the MIT license found in the
8992 * LICENSE file in the root directory of this source tree.
8993 *
8994 *
8995 */
8996
8997'use strict';
8998
8999// Trust the developer to only use ReactInstrumentation with a __DEV__ check
9000
9001var debugTool = null;
9002
9003if ("development" !== 'production') {
9004 var ReactDebugTool = _dereq_(45);
9005 debugTool = ReactDebugTool;
9006}
9007
9008module.exports = { debugTool: debugTool };
9009},{"45":45}],60:[function(_dereq_,module,exports){
9010/**
9011 * Copyright (c) 2016-present, Facebook, Inc.
9012 *
9013 * This source code is licensed under the MIT license found in the
9014 * LICENSE file in the root directory of this source tree.
9015 *
9016 *
9017 */
9018
9019'use strict';
9020
9021var warning = _dereq_(148);
9022
9023if ("development" !== 'production') {
9024 var processingChildContext = false;
9025
9026 var warnInvalidSetState = function () {
9027 "development" !== 'production' ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0;
9028 };
9029}
9030
9031var ReactInvalidSetStateWarningHook = {
9032 onBeginProcessingChildContext: function () {
9033 processingChildContext = true;
9034 },
9035 onEndProcessingChildContext: function () {
9036 processingChildContext = false;
9037 },
9038 onSetState: function () {
9039 warnInvalidSetState();
9040 }
9041};
9042
9043module.exports = ReactInvalidSetStateWarningHook;
9044},{"148":148}],61:[function(_dereq_,module,exports){
9045/**
9046 * Copyright (c) 2013-present, Facebook, Inc.
9047 *
9048 * This source code is licensed under the MIT license found in the
9049 * LICENSE file in the root directory of this source tree.
9050 *
9051 */
9052
9053'use strict';
9054
9055var adler32 = _dereq_(96);
9056
9057var TAG_END = /\/?>/;
9058var COMMENT_START = /^<\!\-\-/;
9059
9060var ReactMarkupChecksum = {
9061 CHECKSUM_ATTR_NAME: 'data-react-checksum',
9062
9063 /**
9064 * @param {string} markup Markup string
9065 * @return {string} Markup string with checksum attribute attached
9066 */
9067 addChecksumToMarkup: function (markup) {
9068 var checksum = adler32(markup);
9069
9070 // Add checksum (handle both parent tags, comments and self-closing tags)
9071 if (COMMENT_START.test(markup)) {
9072 return markup;
9073 } else {
9074 return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
9075 }
9076 },
9077
9078 /**
9079 * @param {string} markup to use
9080 * @param {DOMElement} element root React element
9081 * @returns {boolean} whether or not the markup is the same
9082 */
9083 canReuseMarkup: function (markup, element) {
9084 var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME);
9085 existingChecksum = existingChecksum && parseInt(existingChecksum, 10);
9086 var markupChecksum = adler32(markup);
9087 return markupChecksum === existingChecksum;
9088 }
9089};
9090
9091module.exports = ReactMarkupChecksum;
9092},{"96":96}],62:[function(_dereq_,module,exports){
9093/**
9094 * Copyright (c) 2013-present, Facebook, Inc.
9095 *
9096 * This source code is licensed under the MIT license found in the
9097 * LICENSE file in the root directory of this source tree.
9098 *
9099 */
9100
9101'use strict';
9102
9103var _prodInvariant = _dereq_(116);
9104
9105var ReactComponentEnvironment = _dereq_(28);
9106var ReactInstanceMap = _dereq_(58);
9107var ReactInstrumentation = _dereq_(59);
9108
9109var ReactCurrentOwner = _dereq_(123);
9110var ReactReconciler = _dereq_(68);
9111var ReactChildReconciler = _dereq_(26);
9112
9113var emptyFunction = _dereq_(133);
9114var flattenChildren = _dereq_(101);
9115var invariant = _dereq_(141);
9116
9117/**
9118 * Make an update for markup to be rendered and inserted at a supplied index.
9119 *
9120 * @param {string} markup Markup that renders into an element.
9121 * @param {number} toIndex Destination index.
9122 * @private
9123 */
9124function makeInsertMarkup(markup, afterNode, toIndex) {
9125 // NOTE: Null values reduce hidden classes.
9126 return {
9127 type: 'INSERT_MARKUP',
9128 content: markup,
9129 fromIndex: null,
9130 fromNode: null,
9131 toIndex: toIndex,
9132 afterNode: afterNode
9133 };
9134}
9135
9136/**
9137 * Make an update for moving an existing element to another index.
9138 *
9139 * @param {number} fromIndex Source index of the existing element.
9140 * @param {number} toIndex Destination index of the element.
9141 * @private
9142 */
9143function makeMove(child, afterNode, toIndex) {
9144 // NOTE: Null values reduce hidden classes.
9145 return {
9146 type: 'MOVE_EXISTING',
9147 content: null,
9148 fromIndex: child._mountIndex,
9149 fromNode: ReactReconciler.getHostNode(child),
9150 toIndex: toIndex,
9151 afterNode: afterNode
9152 };
9153}
9154
9155/**
9156 * Make an update for removing an element at an index.
9157 *
9158 * @param {number} fromIndex Index of the element to remove.
9159 * @private
9160 */
9161function makeRemove(child, node) {
9162 // NOTE: Null values reduce hidden classes.
9163 return {
9164 type: 'REMOVE_NODE',
9165 content: null,
9166 fromIndex: child._mountIndex,
9167 fromNode: node,
9168 toIndex: null,
9169 afterNode: null
9170 };
9171}
9172
9173/**
9174 * Make an update for setting the markup of a node.
9175 *
9176 * @param {string} markup Markup that renders into an element.
9177 * @private
9178 */
9179function makeSetMarkup(markup) {
9180 // NOTE: Null values reduce hidden classes.
9181 return {
9182 type: 'SET_MARKUP',
9183 content: markup,
9184 fromIndex: null,
9185 fromNode: null,
9186 toIndex: null,
9187 afterNode: null
9188 };
9189}
9190
9191/**
9192 * Make an update for setting the text content.
9193 *
9194 * @param {string} textContent Text content to set.
9195 * @private
9196 */
9197function makeTextContent(textContent) {
9198 // NOTE: Null values reduce hidden classes.
9199 return {
9200 type: 'TEXT_CONTENT',
9201 content: textContent,
9202 fromIndex: null,
9203 fromNode: null,
9204 toIndex: null,
9205 afterNode: null
9206 };
9207}
9208
9209/**
9210 * Push an update, if any, onto the queue. Creates a new queue if none is
9211 * passed and always returns the queue. Mutative.
9212 */
9213function enqueue(queue, update) {
9214 if (update) {
9215 queue = queue || [];
9216 queue.push(update);
9217 }
9218 return queue;
9219}
9220
9221/**
9222 * Processes any enqueued updates.
9223 *
9224 * @private
9225 */
9226function processQueue(inst, updateQueue) {
9227 ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue);
9228}
9229
9230var setChildrenForInstrumentation = emptyFunction;
9231if ("development" !== 'production') {
9232 var getDebugID = function (inst) {
9233 if (!inst._debugID) {
9234 // Check for ART-like instances. TODO: This is silly/gross.
9235 var internal;
9236 if (internal = ReactInstanceMap.get(inst)) {
9237 inst = internal;
9238 }
9239 }
9240 return inst._debugID;
9241 };
9242 setChildrenForInstrumentation = function (children) {
9243 var debugID = getDebugID(this);
9244 // TODO: React Native empty components are also multichild.
9245 // This means they still get into this method but don't have _debugID.
9246 if (debugID !== 0) {
9247 ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) {
9248 return children[key]._debugID;
9249 }) : []);
9250 }
9251 };
9252}
9253
9254/**
9255 * ReactMultiChild are capable of reconciling multiple children.
9256 *
9257 * @class ReactMultiChild
9258 * @internal
9259 */
9260var ReactMultiChild = {
9261 /**
9262 * Provides common functionality for components that must reconcile multiple
9263 * children. This is used by `ReactDOMComponent` to mount, update, and
9264 * unmount child components.
9265 *
9266 * @lends {ReactMultiChild.prototype}
9267 */
9268 Mixin: {
9269 _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) {
9270 if ("development" !== 'production') {
9271 var selfDebugID = getDebugID(this);
9272 if (this._currentElement) {
9273 try {
9274 ReactCurrentOwner.current = this._currentElement._owner;
9275 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID);
9276 } finally {
9277 ReactCurrentOwner.current = null;
9278 }
9279 }
9280 }
9281 return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context);
9282 },
9283
9284 _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) {
9285 var nextChildren;
9286 var selfDebugID = 0;
9287 if ("development" !== 'production') {
9288 selfDebugID = getDebugID(this);
9289 if (this._currentElement) {
9290 try {
9291 ReactCurrentOwner.current = this._currentElement._owner;
9292 nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
9293 } finally {
9294 ReactCurrentOwner.current = null;
9295 }
9296 ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
9297 return nextChildren;
9298 }
9299 }
9300 nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID);
9301 ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID);
9302 return nextChildren;
9303 },
9304
9305 /**
9306 * Generates a "mount image" for each of the supplied children. In the case
9307 * of `ReactDOMComponent`, a mount image is a string of markup.
9308 *
9309 * @param {?object} nestedChildren Nested child maps.
9310 * @return {array} An array of mounted representations.
9311 * @internal
9312 */
9313 mountChildren: function (nestedChildren, transaction, context) {
9314 var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context);
9315 this._renderedChildren = children;
9316
9317 var mountImages = [];
9318 var index = 0;
9319 for (var name in children) {
9320 if (children.hasOwnProperty(name)) {
9321 var child = children[name];
9322 var selfDebugID = 0;
9323 if ("development" !== 'production') {
9324 selfDebugID = getDebugID(this);
9325 }
9326 var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID);
9327 child._mountIndex = index++;
9328 mountImages.push(mountImage);
9329 }
9330 }
9331
9332 if ("development" !== 'production') {
9333 setChildrenForInstrumentation.call(this, children);
9334 }
9335
9336 return mountImages;
9337 },
9338
9339 /**
9340 * Replaces any rendered children with a text content string.
9341 *
9342 * @param {string} nextContent String of content.
9343 * @internal
9344 */
9345 updateTextContent: function (nextContent) {
9346 var prevChildren = this._renderedChildren;
9347 // Remove any rendered children.
9348 ReactChildReconciler.unmountChildren(prevChildren, false);
9349 for (var name in prevChildren) {
9350 if (prevChildren.hasOwnProperty(name)) {
9351 !false ? "development" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
9352 }
9353 }
9354 // Set new text content.
9355 var updates = [makeTextContent(nextContent)];
9356 processQueue(this, updates);
9357 },
9358
9359 /**
9360 * Replaces any rendered children with a markup string.
9361 *
9362 * @param {string} nextMarkup String of markup.
9363 * @internal
9364 */
9365 updateMarkup: function (nextMarkup) {
9366 var prevChildren = this._renderedChildren;
9367 // Remove any rendered children.
9368 ReactChildReconciler.unmountChildren(prevChildren, false);
9369 for (var name in prevChildren) {
9370 if (prevChildren.hasOwnProperty(name)) {
9371 !false ? "development" !== 'production' ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0;
9372 }
9373 }
9374 var updates = [makeSetMarkup(nextMarkup)];
9375 processQueue(this, updates);
9376 },
9377
9378 /**
9379 * Updates the rendered children with new children.
9380 *
9381 * @param {?object} nextNestedChildrenElements Nested child element maps.
9382 * @param {ReactReconcileTransaction} transaction
9383 * @internal
9384 */
9385 updateChildren: function (nextNestedChildrenElements, transaction, context) {
9386 // Hook used by React ART
9387 this._updateChildren(nextNestedChildrenElements, transaction, context);
9388 },
9389
9390 /**
9391 * @param {?object} nextNestedChildrenElements Nested child element maps.
9392 * @param {ReactReconcileTransaction} transaction
9393 * @final
9394 * @protected
9395 */
9396 _updateChildren: function (nextNestedChildrenElements, transaction, context) {
9397 var prevChildren = this._renderedChildren;
9398 var removedNodes = {};
9399 var mountImages = [];
9400 var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context);
9401 if (!nextChildren && !prevChildren) {
9402 return;
9403 }
9404 var updates = null;
9405 var name;
9406 // `nextIndex` will increment for each child in `nextChildren`, but
9407 // `lastIndex` will be the last index visited in `prevChildren`.
9408 var nextIndex = 0;
9409 var lastIndex = 0;
9410 // `nextMountIndex` will increment for each newly mounted child.
9411 var nextMountIndex = 0;
9412 var lastPlacedNode = null;
9413 for (name in nextChildren) {
9414 if (!nextChildren.hasOwnProperty(name)) {
9415 continue;
9416 }
9417 var prevChild = prevChildren && prevChildren[name];
9418 var nextChild = nextChildren[name];
9419 if (prevChild === nextChild) {
9420 updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex));
9421 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
9422 prevChild._mountIndex = nextIndex;
9423 } else {
9424 if (prevChild) {
9425 // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
9426 lastIndex = Math.max(prevChild._mountIndex, lastIndex);
9427 // The `removedNodes` loop below will actually remove the child.
9428 }
9429 // The child must be instantiated before it's mounted.
9430 updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context));
9431 nextMountIndex++;
9432 }
9433 nextIndex++;
9434 lastPlacedNode = ReactReconciler.getHostNode(nextChild);
9435 }
9436 // Remove children that are no longer present.
9437 for (name in removedNodes) {
9438 if (removedNodes.hasOwnProperty(name)) {
9439 updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]));
9440 }
9441 }
9442 if (updates) {
9443 processQueue(this, updates);
9444 }
9445 this._renderedChildren = nextChildren;
9446
9447 if ("development" !== 'production') {
9448 setChildrenForInstrumentation.call(this, nextChildren);
9449 }
9450 },
9451
9452 /**
9453 * Unmounts all rendered children. This should be used to clean up children
9454 * when this component is unmounted. It does not actually perform any
9455 * backend operations.
9456 *
9457 * @internal
9458 */
9459 unmountChildren: function (safely) {
9460 var renderedChildren = this._renderedChildren;
9461 ReactChildReconciler.unmountChildren(renderedChildren, safely);
9462 this._renderedChildren = null;
9463 },
9464
9465 /**
9466 * Moves a child component to the supplied index.
9467 *
9468 * @param {ReactComponent} child Component to move.
9469 * @param {number} toIndex Destination index of the element.
9470 * @param {number} lastIndex Last index visited of the siblings of `child`.
9471 * @protected
9472 */
9473 moveChild: function (child, afterNode, toIndex, lastIndex) {
9474 // If the index of `child` is less than `lastIndex`, then it needs to
9475 // be moved. Otherwise, we do not need to move it because a child will be
9476 // inserted or moved before `child`.
9477 if (child._mountIndex < lastIndex) {
9478 return makeMove(child, afterNode, toIndex);
9479 }
9480 },
9481
9482 /**
9483 * Creates a child component.
9484 *
9485 * @param {ReactComponent} child Component to create.
9486 * @param {string} mountImage Markup to insert.
9487 * @protected
9488 */
9489 createChild: function (child, afterNode, mountImage) {
9490 return makeInsertMarkup(mountImage, afterNode, child._mountIndex);
9491 },
9492
9493 /**
9494 * Removes a child component.
9495 *
9496 * @param {ReactComponent} child Child to remove.
9497 * @protected
9498 */
9499 removeChild: function (child, node) {
9500 return makeRemove(child, node);
9501 },
9502
9503 /**
9504 * Mounts a child with the supplied name.
9505 *
9506 * NOTE: This is part of `updateChildren` and is here for readability.
9507 *
9508 * @param {ReactComponent} child Component to mount.
9509 * @param {string} name Name of the child.
9510 * @param {number} index Index at which to insert the child.
9511 * @param {ReactReconcileTransaction} transaction
9512 * @private
9513 */
9514 _mountChildAtIndex: function (child, mountImage, afterNode, index, transaction, context) {
9515 child._mountIndex = index;
9516 return this.createChild(child, afterNode, mountImage);
9517 },
9518
9519 /**
9520 * Unmounts a rendered child.
9521 *
9522 * NOTE: This is part of `updateChildren` and is here for readability.
9523 *
9524 * @param {ReactComponent} child Component to unmount.
9525 * @private
9526 */
9527 _unmountChild: function (child, node) {
9528 var update = this.removeChild(child, node);
9529 child._mountIndex = null;
9530 return update;
9531 }
9532 }
9533};
9534
9535module.exports = ReactMultiChild;
9536},{"101":101,"116":116,"123":123,"133":133,"141":141,"26":26,"28":28,"58":58,"59":59,"68":68}],63:[function(_dereq_,module,exports){
9537/**
9538 * Copyright (c) 2013-present, Facebook, Inc.
9539 *
9540 * This source code is licensed under the MIT license found in the
9541 * LICENSE file in the root directory of this source tree.
9542 *
9543 *
9544 */
9545
9546'use strict';
9547
9548var _prodInvariant = _dereq_(116);
9549
9550var React = _dereq_(124);
9551
9552var invariant = _dereq_(141);
9553
9554var ReactNodeTypes = {
9555 HOST: 0,
9556 COMPOSITE: 1,
9557 EMPTY: 2,
9558
9559 getType: function (node) {
9560 if (node === null || node === false) {
9561 return ReactNodeTypes.EMPTY;
9562 } else if (React.isValidElement(node)) {
9563 if (typeof node.type === 'function') {
9564 return ReactNodeTypes.COMPOSITE;
9565 } else {
9566 return ReactNodeTypes.HOST;
9567 }
9568 }
9569 !false ? "development" !== 'production' ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0;
9570 }
9571};
9572
9573module.exports = ReactNodeTypes;
9574},{"116":116,"124":124,"141":141}],64:[function(_dereq_,module,exports){
9575/**
9576 * Copyright (c) 2013-present, Facebook, Inc.
9577 *
9578 * This source code is licensed under the MIT license found in the
9579 * LICENSE file in the root directory of this source tree.
9580 *
9581 *
9582 */
9583
9584'use strict';
9585
9586var _prodInvariant = _dereq_(116);
9587
9588var invariant = _dereq_(141);
9589
9590/**
9591 * @param {?object} object
9592 * @return {boolean} True if `object` is a valid owner.
9593 * @final
9594 */
9595function isValidOwner(object) {
9596 return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function');
9597}
9598
9599/**
9600 * ReactOwners are capable of storing references to owned components.
9601 *
9602 * All components are capable of //being// referenced by owner components, but
9603 * only ReactOwner components are capable of //referencing// owned components.
9604 * The named reference is known as a "ref".
9605 *
9606 * Refs are available when mounted and updated during reconciliation.
9607 *
9608 * var MyComponent = React.createClass({
9609 * render: function() {
9610 * return (
9611 * <div onClick={this.handleClick}>
9612 * <CustomComponent ref="custom" />
9613 * </div>
9614 * );
9615 * },
9616 * handleClick: function() {
9617 * this.refs.custom.handleClick();
9618 * },
9619 * componentDidMount: function() {
9620 * this.refs.custom.initialize();
9621 * }
9622 * });
9623 *
9624 * Refs should rarely be used. When refs are used, they should only be done to
9625 * control data that is not handled by React's data flow.
9626 *
9627 * @class ReactOwner
9628 */
9629var ReactOwner = {
9630 /**
9631 * Adds a component by ref to an owner component.
9632 *
9633 * @param {ReactComponent} component Component to reference.
9634 * @param {string} ref Name by which to refer to the component.
9635 * @param {ReactOwner} owner Component on which to record the ref.
9636 * @final
9637 * @internal
9638 */
9639 addComponentAsRefTo: function (component, ref, owner) {
9640 !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;
9641 owner.attachRef(ref, component);
9642 },
9643
9644 /**
9645 * Removes a component by ref from an owner component.
9646 *
9647 * @param {ReactComponent} component Component to dereference.
9648 * @param {string} ref Name of the ref to remove.
9649 * @param {ReactOwner} owner Component on which the ref is recorded.
9650 * @final
9651 * @internal
9652 */
9653 removeComponentAsRefFrom: function (component, ref, owner) {
9654 !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;
9655 var ownerPublicInstance = owner.getPublicInstance();
9656 // Check that `component`'s owner is still alive and that `component` is still the current ref
9657 // because we do not want to detach the ref if another component stole it.
9658 if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) {
9659 owner.detachRef(ref);
9660 }
9661 }
9662};
9663
9664module.exports = ReactOwner;
9665},{"116":116,"141":141}],65:[function(_dereq_,module,exports){
9666/**
9667 * Copyright (c) 2013-present, Facebook, Inc.
9668 *
9669 * This source code is licensed under the MIT license found in the
9670 * LICENSE file in the root directory of this source tree.
9671 *
9672 *
9673 */
9674
9675'use strict';
9676
9677var ReactPropTypeLocationNames = {};
9678
9679if ("development" !== 'production') {
9680 ReactPropTypeLocationNames = {
9681 prop: 'prop',
9682 context: 'context',
9683 childContext: 'child context'
9684 };
9685}
9686
9687module.exports = ReactPropTypeLocationNames;
9688},{}],66:[function(_dereq_,module,exports){
9689/**
9690 * Copyright (c) 2013-present, Facebook, Inc.
9691 *
9692 * This source code is licensed under the MIT license found in the
9693 * LICENSE file in the root directory of this source tree.
9694 *
9695 *
9696 */
9697
9698'use strict';
9699
9700var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
9701
9702module.exports = ReactPropTypesSecret;
9703},{}],67:[function(_dereq_,module,exports){
9704/**
9705 * Copyright (c) 2013-present, Facebook, Inc.
9706 *
9707 * This source code is licensed under the MIT license found in the
9708 * LICENSE file in the root directory of this source tree.
9709 *
9710 */
9711
9712'use strict';
9713
9714var _assign = _dereq_(149);
9715
9716var CallbackQueue = _dereq_(6);
9717var PooledClass = _dereq_(24);
9718var ReactBrowserEventEmitter = _dereq_(25);
9719var ReactInputSelection = _dereq_(57);
9720var ReactInstrumentation = _dereq_(59);
9721var Transaction = _dereq_(93);
9722var ReactUpdateQueue = _dereq_(74);
9723
9724/**
9725 * Ensures that, when possible, the selection range (currently selected text
9726 * input) is not disturbed by performing the transaction.
9727 */
9728var SELECTION_RESTORATION = {
9729 /**
9730 * @return {Selection} Selection information.
9731 */
9732 initialize: ReactInputSelection.getSelectionInformation,
9733 /**
9734 * @param {Selection} sel Selection information returned from `initialize`.
9735 */
9736 close: ReactInputSelection.restoreSelection
9737};
9738
9739/**
9740 * Suppresses events (blur/focus) that could be inadvertently dispatched due to
9741 * high level DOM manipulations (like temporarily removing a text input from the
9742 * DOM).
9743 */
9744var EVENT_SUPPRESSION = {
9745 /**
9746 * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before
9747 * the reconciliation.
9748 */
9749 initialize: function () {
9750 var currentlyEnabled = ReactBrowserEventEmitter.isEnabled();
9751 ReactBrowserEventEmitter.setEnabled(false);
9752 return currentlyEnabled;
9753 },
9754
9755 /**
9756 * @param {boolean} previouslyEnabled Enabled status of
9757 * `ReactBrowserEventEmitter` before the reconciliation occurred. `close`
9758 * restores the previous value.
9759 */
9760 close: function (previouslyEnabled) {
9761 ReactBrowserEventEmitter.setEnabled(previouslyEnabled);
9762 }
9763};
9764
9765/**
9766 * Provides a queue for collecting `componentDidMount` and
9767 * `componentDidUpdate` callbacks during the transaction.
9768 */
9769var ON_DOM_READY_QUEUEING = {
9770 /**
9771 * Initializes the internal `onDOMReady` queue.
9772 */
9773 initialize: function () {
9774 this.reactMountReady.reset();
9775 },
9776
9777 /**
9778 * After DOM is flushed, invoke all registered `onDOMReady` callbacks.
9779 */
9780 close: function () {
9781 this.reactMountReady.notifyAll();
9782 }
9783};
9784
9785/**
9786 * Executed within the scope of the `Transaction` instance. Consider these as
9787 * being member methods, but with an implied ordering while being isolated from
9788 * each other.
9789 */
9790var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING];
9791
9792if ("development" !== 'production') {
9793 TRANSACTION_WRAPPERS.push({
9794 initialize: ReactInstrumentation.debugTool.onBeginFlush,
9795 close: ReactInstrumentation.debugTool.onEndFlush
9796 });
9797}
9798
9799/**
9800 * Currently:
9801 * - The order that these are listed in the transaction is critical:
9802 * - Suppresses events.
9803 * - Restores selection range.
9804 *
9805 * Future:
9806 * - Restore document/overflow scroll positions that were unintentionally
9807 * modified via DOM insertions above the top viewport boundary.
9808 * - Implement/integrate with customized constraint based layout system and keep
9809 * track of which dimensions must be remeasured.
9810 *
9811 * @class ReactReconcileTransaction
9812 */
9813function ReactReconcileTransaction(useCreateElement) {
9814 this.reinitializeTransaction();
9815 // Only server-side rendering really needs this option (see
9816 // `ReactServerRendering`), but server-side uses
9817 // `ReactServerRenderingTransaction` instead. This option is here so that it's
9818 // accessible and defaults to false when `ReactDOMComponent` and
9819 // `ReactDOMTextComponent` checks it in `mountComponent`.`
9820 this.renderToStaticMarkup = false;
9821 this.reactMountReady = CallbackQueue.getPooled(null);
9822 this.useCreateElement = useCreateElement;
9823}
9824
9825var Mixin = {
9826 /**
9827 * @see Transaction
9828 * @abstract
9829 * @final
9830 * @return {array<object>} List of operation wrap procedures.
9831 * TODO: convert to array<TransactionWrapper>
9832 */
9833 getTransactionWrappers: function () {
9834 return TRANSACTION_WRAPPERS;
9835 },
9836
9837 /**
9838 * @return {object} The queue to collect `onDOMReady` callbacks with.
9839 */
9840 getReactMountReady: function () {
9841 return this.reactMountReady;
9842 },
9843
9844 /**
9845 * @return {object} The queue to collect React async events.
9846 */
9847 getUpdateQueue: function () {
9848 return ReactUpdateQueue;
9849 },
9850
9851 /**
9852 * Save current transaction state -- if the return value from this method is
9853 * passed to `rollback`, the transaction will be reset to that state.
9854 */
9855 checkpoint: function () {
9856 // reactMountReady is the our only stateful wrapper
9857 return this.reactMountReady.checkpoint();
9858 },
9859
9860 rollback: function (checkpoint) {
9861 this.reactMountReady.rollback(checkpoint);
9862 },
9863
9864 /**
9865 * `PooledClass` looks for this, and will invoke this before allowing this
9866 * instance to be reused.
9867 */
9868 destructor: function () {
9869 CallbackQueue.release(this.reactMountReady);
9870 this.reactMountReady = null;
9871 }
9872};
9873
9874_assign(ReactReconcileTransaction.prototype, Transaction, Mixin);
9875
9876PooledClass.addPoolingTo(ReactReconcileTransaction);
9877
9878module.exports = ReactReconcileTransaction;
9879},{"149":149,"24":24,"25":25,"57":57,"59":59,"6":6,"74":74,"93":93}],68:[function(_dereq_,module,exports){
9880/**
9881 * Copyright (c) 2013-present, Facebook, Inc.
9882 *
9883 * This source code is licensed under the MIT license found in the
9884 * LICENSE file in the root directory of this source tree.
9885 *
9886 */
9887
9888'use strict';
9889
9890var ReactRef = _dereq_(69);
9891var ReactInstrumentation = _dereq_(59);
9892
9893var warning = _dereq_(148);
9894
9895/**
9896 * Helper to call ReactRef.attachRefs with this composite component, split out
9897 * to avoid allocations in the transaction mount-ready queue.
9898 */
9899function attachRefs() {
9900 ReactRef.attachRefs(this, this._currentElement);
9901}
9902
9903var ReactReconciler = {
9904 /**
9905 * Initializes the component, renders markup, and registers event listeners.
9906 *
9907 * @param {ReactComponent} internalInstance
9908 * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
9909 * @param {?object} the containing host component instance
9910 * @param {?object} info about the host container
9911 * @return {?string} Rendered markup to be inserted into the DOM.
9912 * @final
9913 * @internal
9914 */
9915 mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID) // 0 in production and for roots
9916 {
9917 if ("development" !== 'production') {
9918 if (internalInstance._debugID !== 0) {
9919 ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID);
9920 }
9921 }
9922 var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID);
9923 if (internalInstance._currentElement && internalInstance._currentElement.ref != null) {
9924 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
9925 }
9926 if ("development" !== 'production') {
9927 if (internalInstance._debugID !== 0) {
9928 ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID);
9929 }
9930 }
9931 return markup;
9932 },
9933
9934 /**
9935 * Returns a value that can be passed to
9936 * ReactComponentEnvironment.replaceNodeWithMarkup.
9937 */
9938 getHostNode: function (internalInstance) {
9939 return internalInstance.getHostNode();
9940 },
9941
9942 /**
9943 * Releases any resources allocated by `mountComponent`.
9944 *
9945 * @final
9946 * @internal
9947 */
9948 unmountComponent: function (internalInstance, safely) {
9949 if ("development" !== 'production') {
9950 if (internalInstance._debugID !== 0) {
9951 ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID);
9952 }
9953 }
9954 ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
9955 internalInstance.unmountComponent(safely);
9956 if ("development" !== 'production') {
9957 if (internalInstance._debugID !== 0) {
9958 ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID);
9959 }
9960 }
9961 },
9962
9963 /**
9964 * Update a component using a new element.
9965 *
9966 * @param {ReactComponent} internalInstance
9967 * @param {ReactElement} nextElement
9968 * @param {ReactReconcileTransaction} transaction
9969 * @param {object} context
9970 * @internal
9971 */
9972 receiveComponent: function (internalInstance, nextElement, transaction, context) {
9973 var prevElement = internalInstance._currentElement;
9974
9975 if (nextElement === prevElement && context === internalInstance._context) {
9976 // Since elements are immutable after the owner is rendered,
9977 // we can do a cheap identity compare here to determine if this is a
9978 // superfluous reconcile. It's possible for state to be mutable but such
9979 // change should trigger an update of the owner which would recreate
9980 // the element. We explicitly check for the existence of an owner since
9981 // it's possible for an element created outside a composite to be
9982 // deeply mutated and reused.
9983
9984 // TODO: Bailing out early is just a perf optimization right?
9985 // TODO: Removing the return statement should affect correctness?
9986 return;
9987 }
9988
9989 if ("development" !== 'production') {
9990 if (internalInstance._debugID !== 0) {
9991 ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement);
9992 }
9993 }
9994
9995 var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement);
9996
9997 if (refsChanged) {
9998 ReactRef.detachRefs(internalInstance, prevElement);
9999 }
10000
10001 internalInstance.receiveComponent(nextElement, transaction, context);
10002
10003 if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) {
10004 transaction.getReactMountReady().enqueue(attachRefs, internalInstance);
10005 }
10006
10007 if ("development" !== 'production') {
10008 if (internalInstance._debugID !== 0) {
10009 ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
10010 }
10011 }
10012 },
10013
10014 /**
10015 * Flush any dirty changes in a component.
10016 *
10017 * @param {ReactComponent} internalInstance
10018 * @param {ReactReconcileTransaction} transaction
10019 * @internal
10020 */
10021 performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) {
10022 if (internalInstance._updateBatchNumber !== updateBatchNumber) {
10023 // The component's enqueued batch number should always be the current
10024 // batch or the following one.
10025 "development" !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
10026 return;
10027 }
10028 if ("development" !== 'production') {
10029 if (internalInstance._debugID !== 0) {
10030 ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
10031 }
10032 }
10033 internalInstance.performUpdateIfNecessary(transaction);
10034 if ("development" !== 'production') {
10035 if (internalInstance._debugID !== 0) {
10036 ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
10037 }
10038 }
10039 }
10040};
10041
10042module.exports = ReactReconciler;
10043},{"148":148,"59":59,"69":69}],69:[function(_dereq_,module,exports){
10044/**
10045 * Copyright (c) 2013-present, Facebook, Inc.
10046 *
10047 * This source code is licensed under the MIT license found in the
10048 * LICENSE file in the root directory of this source tree.
10049 *
10050 *
10051 */
10052
10053'use strict';
10054
10055var ReactOwner = _dereq_(64);
10056
10057var ReactRef = {};
10058
10059function attachRef(ref, component, owner) {
10060 if (typeof ref === 'function') {
10061 ref(component.getPublicInstance());
10062 } else {
10063 // Legacy ref
10064 ReactOwner.addComponentAsRefTo(component, ref, owner);
10065 }
10066}
10067
10068function detachRef(ref, component, owner) {
10069 if (typeof ref === 'function') {
10070 ref(null);
10071 } else {
10072 // Legacy ref
10073 ReactOwner.removeComponentAsRefFrom(component, ref, owner);
10074 }
10075}
10076
10077ReactRef.attachRefs = function (instance, element) {
10078 if (element === null || typeof element !== 'object') {
10079 return;
10080 }
10081 var ref = element.ref;
10082 if (ref != null) {
10083 attachRef(ref, instance, element._owner);
10084 }
10085};
10086
10087ReactRef.shouldUpdateRefs = function (prevElement, nextElement) {
10088 // If either the owner or a `ref` has changed, make sure the newest owner
10089 // has stored a reference to `this`, and the previous owner (if different)
10090 // has forgotten the reference to `this`. We use the element instead
10091 // of the public this.props because the post processing cannot determine
10092 // a ref. The ref conceptually lives on the element.
10093
10094 // TODO: Should this even be possible? The owner cannot change because
10095 // it's forbidden by shouldUpdateReactComponent. The ref can change
10096 // if you swap the keys of but not the refs. Reconsider where this check
10097 // is made. It probably belongs where the key checking and
10098 // instantiateReactComponent is done.
10099
10100 var prevRef = null;
10101 var prevOwner = null;
10102 if (prevElement !== null && typeof prevElement === 'object') {
10103 prevRef = prevElement.ref;
10104 prevOwner = prevElement._owner;
10105 }
10106
10107 var nextRef = null;
10108 var nextOwner = null;
10109 if (nextElement !== null && typeof nextElement === 'object') {
10110 nextRef = nextElement.ref;
10111 nextOwner = nextElement._owner;
10112 }
10113
10114 return prevRef !== nextRef ||
10115 // If owner changes but we have an unchanged function ref, don't update refs
10116 typeof nextRef === 'string' && nextOwner !== prevOwner;
10117};
10118
10119ReactRef.detachRefs = function (instance, element) {
10120 if (element === null || typeof element !== 'object') {
10121 return;
10122 }
10123 var ref = element.ref;
10124 if (ref != null) {
10125 detachRef(ref, instance, element._owner);
10126 }
10127};
10128
10129module.exports = ReactRef;
10130},{"64":64}],70:[function(_dereq_,module,exports){
10131/**
10132 * Copyright (c) 2014-present, Facebook, Inc.
10133 *
10134 * This source code is licensed under the MIT license found in the
10135 * LICENSE file in the root directory of this source tree.
10136 *
10137 */
10138
10139'use strict';
10140
10141var ReactServerBatchingStrategy = {
10142 isBatchingUpdates: false,
10143 batchedUpdates: function (callback) {
10144 // Don't do anything here. During the server rendering we don't want to
10145 // schedule any updates. We will simply ignore them.
10146 }
10147};
10148
10149module.exports = ReactServerBatchingStrategy;
10150},{}],71:[function(_dereq_,module,exports){
10151/**
10152 * Copyright (c) 2013-present, Facebook, Inc.
10153 *
10154 * This source code is licensed under the MIT license found in the
10155 * LICENSE file in the root directory of this source tree.
10156 *
10157 */
10158'use strict';
10159
10160var _prodInvariant = _dereq_(116);
10161
10162var React = _dereq_(124);
10163var ReactDOMContainerInfo = _dereq_(33);
10164var ReactDefaultBatchingStrategy = _dereq_(46);
10165var ReactInstrumentation = _dereq_(59);
10166var ReactMarkupChecksum = _dereq_(61);
10167var ReactReconciler = _dereq_(68);
10168var ReactServerBatchingStrategy = _dereq_(70);
10169var ReactServerRenderingTransaction = _dereq_(72);
10170var ReactUpdates = _dereq_(75);
10171
10172var emptyObject = _dereq_(134);
10173var instantiateReactComponent = _dereq_(112);
10174var invariant = _dereq_(141);
10175
10176var pendingTransactions = 0;
10177
10178/**
10179 * @param {ReactElement} element
10180 * @return {string} the HTML markup
10181 */
10182function renderToStringImpl(element, makeStaticMarkup) {
10183 var transaction;
10184 try {
10185 ReactUpdates.injection.injectBatchingStrategy(ReactServerBatchingStrategy);
10186
10187 transaction = ReactServerRenderingTransaction.getPooled(makeStaticMarkup);
10188
10189 pendingTransactions++;
10190
10191 return transaction.perform(function () {
10192 var componentInstance = instantiateReactComponent(element, true);
10193 var markup = ReactReconciler.mountComponent(componentInstance, transaction, null, ReactDOMContainerInfo(), emptyObject, 0 /* parentDebugID */
10194 );
10195 if ("development" !== 'production') {
10196 ReactInstrumentation.debugTool.onUnmountComponent(componentInstance._debugID);
10197 }
10198 if (!makeStaticMarkup) {
10199 markup = ReactMarkupChecksum.addChecksumToMarkup(markup);
10200 }
10201 return markup;
10202 }, null);
10203 } finally {
10204 pendingTransactions--;
10205 ReactServerRenderingTransaction.release(transaction);
10206 // Revert to the DOM batching strategy since these two renderers
10207 // currently share these stateful modules.
10208 if (!pendingTransactions) {
10209 ReactUpdates.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy);
10210 }
10211 }
10212}
10213
10214/**
10215 * Render a ReactElement to its initial HTML. This should only be used on the
10216 * server.
10217 * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostring
10218 */
10219function renderToString(element) {
10220 !React.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToString(): You must pass a valid ReactElement.') : _prodInvariant('46') : void 0;
10221 return renderToStringImpl(element, false);
10222}
10223
10224/**
10225 * Similar to renderToString, except this doesn't create extra DOM attributes
10226 * such as data-react-id that React uses internally.
10227 * See https://facebook.github.io/react/docs/top-level-api.html#reactdomserver.rendertostaticmarkup
10228 */
10229function renderToStaticMarkup(element) {
10230 !React.isValidElement(element) ? "development" !== 'production' ? invariant(false, 'renderToStaticMarkup(): You must pass a valid ReactElement.') : _prodInvariant('47') : void 0;
10231 return renderToStringImpl(element, true);
10232}
10233
10234module.exports = {
10235 renderToString: renderToString,
10236 renderToStaticMarkup: renderToStaticMarkup
10237};
10238},{"112":112,"116":116,"124":124,"134":134,"141":141,"33":33,"46":46,"59":59,"61":61,"68":68,"70":70,"72":72,"75":75}],72:[function(_dereq_,module,exports){
10239/**
10240 * Copyright (c) 2014-present, Facebook, Inc.
10241 *
10242 * This source code is licensed under the MIT license found in the
10243 * LICENSE file in the root directory of this source tree.
10244 *
10245 */
10246
10247'use strict';
10248
10249var _assign = _dereq_(149);
10250
10251var PooledClass = _dereq_(24);
10252var Transaction = _dereq_(93);
10253var ReactInstrumentation = _dereq_(59);
10254var ReactServerUpdateQueue = _dereq_(73);
10255
10256/**
10257 * Executed within the scope of the `Transaction` instance. Consider these as
10258 * being member methods, but with an implied ordering while being isolated from
10259 * each other.
10260 */
10261var TRANSACTION_WRAPPERS = [];
10262
10263if ("development" !== 'production') {
10264 TRANSACTION_WRAPPERS.push({
10265 initialize: ReactInstrumentation.debugTool.onBeginFlush,
10266 close: ReactInstrumentation.debugTool.onEndFlush
10267 });
10268}
10269
10270var noopCallbackQueue = {
10271 enqueue: function () {}
10272};
10273
10274/**
10275 * @class ReactServerRenderingTransaction
10276 * @param {boolean} renderToStaticMarkup
10277 */
10278function ReactServerRenderingTransaction(renderToStaticMarkup) {
10279 this.reinitializeTransaction();
10280 this.renderToStaticMarkup = renderToStaticMarkup;
10281 this.useCreateElement = false;
10282 this.updateQueue = new ReactServerUpdateQueue(this);
10283}
10284
10285var Mixin = {
10286 /**
10287 * @see Transaction
10288 * @abstract
10289 * @final
10290 * @return {array} Empty list of operation wrap procedures.
10291 */
10292 getTransactionWrappers: function () {
10293 return TRANSACTION_WRAPPERS;
10294 },
10295
10296 /**
10297 * @return {object} The queue to collect `onDOMReady` callbacks with.
10298 */
10299 getReactMountReady: function () {
10300 return noopCallbackQueue;
10301 },
10302
10303 /**
10304 * @return {object} The queue to collect React async events.
10305 */
10306 getUpdateQueue: function () {
10307 return this.updateQueue;
10308 },
10309
10310 /**
10311 * `PooledClass` looks for this, and will invoke this before allowing this
10312 * instance to be reused.
10313 */
10314 destructor: function () {},
10315
10316 checkpoint: function () {},
10317
10318 rollback: function () {}
10319};
10320
10321_assign(ReactServerRenderingTransaction.prototype, Transaction, Mixin);
10322
10323PooledClass.addPoolingTo(ReactServerRenderingTransaction);
10324
10325module.exports = ReactServerRenderingTransaction;
10326},{"149":149,"24":24,"59":59,"73":73,"93":93}],73:[function(_dereq_,module,exports){
10327/**
10328 * Copyright (c) 2015-present, Facebook, Inc.
10329 *
10330 * This source code is licensed under the MIT license found in the
10331 * LICENSE file in the root directory of this source tree.
10332 *
10333 *
10334 */
10335
10336'use strict';
10337
10338function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10339
10340var ReactUpdateQueue = _dereq_(74);
10341
10342var warning = _dereq_(148);
10343
10344function warnNoop(publicInstance, callerName) {
10345 if ("development" !== 'production') {
10346 var constructor = publicInstance.constructor;
10347 "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;
10348 }
10349}
10350
10351/**
10352 * This is the update queue used for server rendering.
10353 * It delegates to ReactUpdateQueue while server rendering is in progress and
10354 * switches to ReactNoopUpdateQueue after the transaction has completed.
10355 * @class ReactServerUpdateQueue
10356 * @param {Transaction} transaction
10357 */
10358
10359var ReactServerUpdateQueue = function () {
10360 function ReactServerUpdateQueue(transaction) {
10361 _classCallCheck(this, ReactServerUpdateQueue);
10362
10363 this.transaction = transaction;
10364 }
10365
10366 /**
10367 * Checks whether or not this composite component is mounted.
10368 * @param {ReactClass} publicInstance The instance we want to test.
10369 * @return {boolean} True if mounted, false otherwise.
10370 * @protected
10371 * @final
10372 */
10373
10374
10375 ReactServerUpdateQueue.prototype.isMounted = function isMounted(publicInstance) {
10376 return false;
10377 };
10378
10379 /**
10380 * Enqueue a callback that will be executed after all the pending updates
10381 * have processed.
10382 *
10383 * @param {ReactClass} publicInstance The instance to use as `this` context.
10384 * @param {?function} callback Called after state is updated.
10385 * @internal
10386 */
10387
10388
10389 ReactServerUpdateQueue.prototype.enqueueCallback = function enqueueCallback(publicInstance, callback, callerName) {
10390 if (this.transaction.isInTransaction()) {
10391 ReactUpdateQueue.enqueueCallback(publicInstance, callback, callerName);
10392 }
10393 };
10394
10395 /**
10396 * Forces an update. This should only be invoked when it is known with
10397 * certainty that we are **not** in a DOM transaction.
10398 *
10399 * You may want to call this when you know that some deeper aspect of the
10400 * component's state has changed but `setState` was not called.
10401 *
10402 * This will not invoke `shouldComponentUpdate`, but it will invoke
10403 * `componentWillUpdate` and `componentDidUpdate`.
10404 *
10405 * @param {ReactClass} publicInstance The instance that should rerender.
10406 * @internal
10407 */
10408
10409
10410 ReactServerUpdateQueue.prototype.enqueueForceUpdate = function enqueueForceUpdate(publicInstance) {
10411 if (this.transaction.isInTransaction()) {
10412 ReactUpdateQueue.enqueueForceUpdate(publicInstance);
10413 } else {
10414 warnNoop(publicInstance, 'forceUpdate');
10415 }
10416 };
10417
10418 /**
10419 * Replaces all of the state. Always use this or `setState` to mutate state.
10420 * You should treat `this.state` as immutable.
10421 *
10422 * There is no guarantee that `this.state` will be immediately updated, so
10423 * accessing `this.state` after calling this method may return the old value.
10424 *
10425 * @param {ReactClass} publicInstance The instance that should rerender.
10426 * @param {object|function} completeState Next state.
10427 * @internal
10428 */
10429
10430
10431 ReactServerUpdateQueue.prototype.enqueueReplaceState = function enqueueReplaceState(publicInstance, completeState) {
10432 if (this.transaction.isInTransaction()) {
10433 ReactUpdateQueue.enqueueReplaceState(publicInstance, completeState);
10434 } else {
10435 warnNoop(publicInstance, 'replaceState');
10436 }
10437 };
10438
10439 /**
10440 * Sets a subset of the state. This only exists because _pendingState is
10441 * internal. This provides a merging strategy that is not available to deep
10442 * properties which is confusing. TODO: Expose pendingState or don't use it
10443 * during the merge.
10444 *
10445 * @param {ReactClass} publicInstance The instance that should rerender.
10446 * @param {object|function} partialState Next partial state to be merged with state.
10447 * @internal
10448 */
10449
10450
10451 ReactServerUpdateQueue.prototype.enqueueSetState = function enqueueSetState(publicInstance, partialState) {
10452 if (this.transaction.isInTransaction()) {
10453 ReactUpdateQueue.enqueueSetState(publicInstance, partialState);
10454 } else {
10455 warnNoop(publicInstance, 'setState');
10456 }
10457 };
10458
10459 return ReactServerUpdateQueue;
10460}();
10461
10462module.exports = ReactServerUpdateQueue;
10463},{"148":148,"74":74}],74:[function(_dereq_,module,exports){
10464/**
10465 * Copyright (c) 2015-present, Facebook, Inc.
10466 *
10467 * This source code is licensed under the MIT license found in the
10468 * LICENSE file in the root directory of this source tree.
10469 *
10470 */
10471
10472'use strict';
10473
10474var _prodInvariant = _dereq_(116);
10475
10476var ReactCurrentOwner = _dereq_(123);
10477var ReactInstanceMap = _dereq_(58);
10478var ReactInstrumentation = _dereq_(59);
10479var ReactUpdates = _dereq_(75);
10480
10481var invariant = _dereq_(141);
10482var warning = _dereq_(148);
10483
10484function enqueueUpdate(internalInstance) {
10485 ReactUpdates.enqueueUpdate(internalInstance);
10486}
10487
10488function formatUnexpectedArgument(arg) {
10489 var type = typeof arg;
10490 if (type !== 'object') {
10491 return type;
10492 }
10493 var displayName = arg.constructor && arg.constructor.name || type;
10494 var keys = Object.keys(arg);
10495 if (keys.length > 0 && keys.length < 20) {
10496 return displayName + ' (keys: ' + keys.join(', ') + ')';
10497 }
10498 return displayName;
10499}
10500
10501function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
10502 var internalInstance = ReactInstanceMap.get(publicInstance);
10503 if (!internalInstance) {
10504 if ("development" !== 'production') {
10505 var ctor = publicInstance.constructor;
10506 // Only warn when we have a callerName. Otherwise we should be silent.
10507 // We're probably calling from enqueueCallback. We don't want to warn
10508 // there because we already warned for the corresponding lifecycle method.
10509 "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;
10510 }
10511 return null;
10512 }
10513
10514 if ("development" !== 'production') {
10515 "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;
10516 }
10517
10518 return internalInstance;
10519}
10520
10521/**
10522 * ReactUpdateQueue allows for state updates to be scheduled into a later
10523 * reconciliation step.
10524 */
10525var ReactUpdateQueue = {
10526 /**
10527 * Checks whether or not this composite component is mounted.
10528 * @param {ReactClass} publicInstance The instance we want to test.
10529 * @return {boolean} True if mounted, false otherwise.
10530 * @protected
10531 * @final
10532 */
10533 isMounted: function (publicInstance) {
10534 if ("development" !== 'production') {
10535 var owner = ReactCurrentOwner.current;
10536 if (owner !== null) {
10537 "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;
10538 owner._warnedAboutRefsInRender = true;
10539 }
10540 }
10541 var internalInstance = ReactInstanceMap.get(publicInstance);
10542 if (internalInstance) {
10543 // During componentWillMount and render this will still be null but after
10544 // that will always render to something. At least for now. So we can use
10545 // this hack.
10546 return !!internalInstance._renderedComponent;
10547 } else {
10548 return false;
10549 }
10550 },
10551
10552 /**
10553 * Enqueue a callback that will be executed after all the pending updates
10554 * have processed.
10555 *
10556 * @param {ReactClass} publicInstance The instance to use as `this` context.
10557 * @param {?function} callback Called after state is updated.
10558 * @param {string} callerName Name of the calling function in the public API.
10559 * @internal
10560 */
10561 enqueueCallback: function (publicInstance, callback, callerName) {
10562 ReactUpdateQueue.validateCallback(callback, callerName);
10563 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance);
10564
10565 // Previously we would throw an error if we didn't have an internal
10566 // instance. Since we want to make it a no-op instead, we mirror the same
10567 // behavior we have in other enqueue* methods.
10568 // We also need to ignore callbacks in componentWillMount. See
10569 // enqueueUpdates.
10570 if (!internalInstance) {
10571 return null;
10572 }
10573
10574 if (internalInstance._pendingCallbacks) {
10575 internalInstance._pendingCallbacks.push(callback);
10576 } else {
10577 internalInstance._pendingCallbacks = [callback];
10578 }
10579 // TODO: The callback here is ignored when setState is called from
10580 // componentWillMount. Either fix it or disallow doing so completely in
10581 // favor of getInitialState. Alternatively, we can disallow
10582 // componentWillMount during server-side rendering.
10583 enqueueUpdate(internalInstance);
10584 },
10585
10586 enqueueCallbackInternal: function (internalInstance, callback) {
10587 if (internalInstance._pendingCallbacks) {
10588 internalInstance._pendingCallbacks.push(callback);
10589 } else {
10590 internalInstance._pendingCallbacks = [callback];
10591 }
10592 enqueueUpdate(internalInstance);
10593 },
10594
10595 /**
10596 * Forces an update. This should only be invoked when it is known with
10597 * certainty that we are **not** in a DOM transaction.
10598 *
10599 * You may want to call this when you know that some deeper aspect of the
10600 * component's state has changed but `setState` was not called.
10601 *
10602 * This will not invoke `shouldComponentUpdate`, but it will invoke
10603 * `componentWillUpdate` and `componentDidUpdate`.
10604 *
10605 * @param {ReactClass} publicInstance The instance that should rerender.
10606 * @internal
10607 */
10608 enqueueForceUpdate: function (publicInstance) {
10609 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate');
10610
10611 if (!internalInstance) {
10612 return;
10613 }
10614
10615 internalInstance._pendingForceUpdate = true;
10616
10617 enqueueUpdate(internalInstance);
10618 },
10619
10620 /**
10621 * Replaces all of the state. Always use this or `setState` to mutate state.
10622 * You should treat `this.state` as immutable.
10623 *
10624 * There is no guarantee that `this.state` will be immediately updated, so
10625 * accessing `this.state` after calling this method may return the old value.
10626 *
10627 * @param {ReactClass} publicInstance The instance that should rerender.
10628 * @param {object} completeState Next state.
10629 * @internal
10630 */
10631 enqueueReplaceState: function (publicInstance, completeState, callback) {
10632 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState');
10633
10634 if (!internalInstance) {
10635 return;
10636 }
10637
10638 internalInstance._pendingStateQueue = [completeState];
10639 internalInstance._pendingReplaceState = true;
10640
10641 // Future-proof 15.5
10642 if (callback !== undefined && callback !== null) {
10643 ReactUpdateQueue.validateCallback(callback, 'replaceState');
10644 if (internalInstance._pendingCallbacks) {
10645 internalInstance._pendingCallbacks.push(callback);
10646 } else {
10647 internalInstance._pendingCallbacks = [callback];
10648 }
10649 }
10650
10651 enqueueUpdate(internalInstance);
10652 },
10653
10654 /**
10655 * Sets a subset of the state. This only exists because _pendingState is
10656 * internal. This provides a merging strategy that is not available to deep
10657 * properties which is confusing. TODO: Expose pendingState or don't use it
10658 * during the merge.
10659 *
10660 * @param {ReactClass} publicInstance The instance that should rerender.
10661 * @param {object} partialState Next partial state to be merged with state.
10662 * @internal
10663 */
10664 enqueueSetState: function (publicInstance, partialState) {
10665 if ("development" !== 'production') {
10666 ReactInstrumentation.debugTool.onSetState();
10667 "development" !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0;
10668 }
10669
10670 var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState');
10671
10672 if (!internalInstance) {
10673 return;
10674 }
10675
10676 var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []);
10677 queue.push(partialState);
10678
10679 enqueueUpdate(internalInstance);
10680 },
10681
10682 enqueueElementInternal: function (internalInstance, nextElement, nextContext) {
10683 internalInstance._pendingElement = nextElement;
10684 // TODO: introduce _pendingContext instead of setting it directly.
10685 internalInstance._context = nextContext;
10686 enqueueUpdate(internalInstance);
10687 },
10688
10689 validateCallback: function (callback, callerName) {
10690 !(!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;
10691 }
10692};
10693
10694module.exports = ReactUpdateQueue;
10695},{"116":116,"123":123,"141":141,"148":148,"58":58,"59":59,"75":75}],75:[function(_dereq_,module,exports){
10696/**
10697 * Copyright (c) 2013-present, Facebook, Inc.
10698 *
10699 * This source code is licensed under the MIT license found in the
10700 * LICENSE file in the root directory of this source tree.
10701 *
10702 */
10703
10704'use strict';
10705
10706var _prodInvariant = _dereq_(116),
10707 _assign = _dereq_(149);
10708
10709var CallbackQueue = _dereq_(6);
10710var PooledClass = _dereq_(24);
10711var ReactFeatureFlags = _dereq_(53);
10712var ReactReconciler = _dereq_(68);
10713var Transaction = _dereq_(93);
10714
10715var invariant = _dereq_(141);
10716
10717var dirtyComponents = [];
10718var updateBatchNumber = 0;
10719var asapCallbackQueue = CallbackQueue.getPooled();
10720var asapEnqueued = false;
10721
10722var batchingStrategy = null;
10723
10724function ensureInjected() {
10725 !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0;
10726}
10727
10728var NESTED_UPDATES = {
10729 initialize: function () {
10730 this.dirtyComponentsLength = dirtyComponents.length;
10731 },
10732 close: function () {
10733 if (this.dirtyComponentsLength !== dirtyComponents.length) {
10734 // Additional updates were enqueued by componentDidUpdate handlers or
10735 // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run
10736 // these new updates so that if A's componentDidUpdate calls setState on
10737 // B, B will update before the callback A's updater provided when calling
10738 // setState.
10739 dirtyComponents.splice(0, this.dirtyComponentsLength);
10740 flushBatchedUpdates();
10741 } else {
10742 dirtyComponents.length = 0;
10743 }
10744 }
10745};
10746
10747var UPDATE_QUEUEING = {
10748 initialize: function () {
10749 this.callbackQueue.reset();
10750 },
10751 close: function () {
10752 this.callbackQueue.notifyAll();
10753 }
10754};
10755
10756var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING];
10757
10758function ReactUpdatesFlushTransaction() {
10759 this.reinitializeTransaction();
10760 this.dirtyComponentsLength = null;
10761 this.callbackQueue = CallbackQueue.getPooled();
10762 this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(
10763 /* useCreateElement */true);
10764}
10765
10766_assign(ReactUpdatesFlushTransaction.prototype, Transaction, {
10767 getTransactionWrappers: function () {
10768 return TRANSACTION_WRAPPERS;
10769 },
10770
10771 destructor: function () {
10772 this.dirtyComponentsLength = null;
10773 CallbackQueue.release(this.callbackQueue);
10774 this.callbackQueue = null;
10775 ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction);
10776 this.reconcileTransaction = null;
10777 },
10778
10779 perform: function (method, scope, a) {
10780 // Essentially calls `this.reconcileTransaction.perform(method, scope, a)`
10781 // with this transaction's wrappers around it.
10782 return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a);
10783 }
10784});
10785
10786PooledClass.addPoolingTo(ReactUpdatesFlushTransaction);
10787
10788function batchedUpdates(callback, a, b, c, d, e) {
10789 ensureInjected();
10790 return batchingStrategy.batchedUpdates(callback, a, b, c, d, e);
10791}
10792
10793/**
10794 * Array comparator for ReactComponents by mount ordering.
10795 *
10796 * @param {ReactComponent} c1 first component you're comparing
10797 * @param {ReactComponent} c2 second component you're comparing
10798 * @return {number} Return value usable by Array.prototype.sort().
10799 */
10800function mountOrderComparator(c1, c2) {
10801 return c1._mountOrder - c2._mountOrder;
10802}
10803
10804function runBatchedUpdates(transaction) {
10805 var len = transaction.dirtyComponentsLength;
10806 !(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;
10807
10808 // Since reconciling a component higher in the owner hierarchy usually (not
10809 // always -- see shouldComponentUpdate()) will reconcile children, reconcile
10810 // them before their children by sorting the array.
10811 dirtyComponents.sort(mountOrderComparator);
10812
10813 // Any updates enqueued while reconciling must be performed after this entire
10814 // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and
10815 // C, B could update twice in a single batch if C's render enqueues an update
10816 // to B (since B would have already updated, we should skip it, and the only
10817 // way we can know to do so is by checking the batch counter).
10818 updateBatchNumber++;
10819
10820 for (var i = 0; i < len; i++) {
10821 // If a component is unmounted before pending changes apply, it will still
10822 // be here, but we assume that it has cleared its _pendingCallbacks and
10823 // that performUpdateIfNecessary is a noop.
10824 var component = dirtyComponents[i];
10825
10826 // If performUpdateIfNecessary happens to enqueue any new updates, we
10827 // shouldn't execute the callbacks until the next render happens, so
10828 // stash the callbacks first
10829 var callbacks = component._pendingCallbacks;
10830 component._pendingCallbacks = null;
10831
10832 var markerName;
10833 if (ReactFeatureFlags.logTopLevelRenders) {
10834 var namedComponent = component;
10835 // Duck type TopLevelWrapper. This is probably always true.
10836 if (component._currentElement.type.isReactTopLevelWrapper) {
10837 namedComponent = component._renderedComponent;
10838 }
10839 markerName = 'React update: ' + namedComponent.getName();
10840 console.time(markerName);
10841 }
10842
10843 ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber);
10844
10845 if (markerName) {
10846 console.timeEnd(markerName);
10847 }
10848
10849 if (callbacks) {
10850 for (var j = 0; j < callbacks.length; j++) {
10851 transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance());
10852 }
10853 }
10854 }
10855}
10856
10857var flushBatchedUpdates = function () {
10858 // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents
10859 // array and perform any updates enqueued by mount-ready handlers (i.e.,
10860 // componentDidUpdate) but we need to check here too in order to catch
10861 // updates enqueued by setState callbacks and asap calls.
10862 while (dirtyComponents.length || asapEnqueued) {
10863 if (dirtyComponents.length) {
10864 var transaction = ReactUpdatesFlushTransaction.getPooled();
10865 transaction.perform(runBatchedUpdates, null, transaction);
10866 ReactUpdatesFlushTransaction.release(transaction);
10867 }
10868
10869 if (asapEnqueued) {
10870 asapEnqueued = false;
10871 var queue = asapCallbackQueue;
10872 asapCallbackQueue = CallbackQueue.getPooled();
10873 queue.notifyAll();
10874 CallbackQueue.release(queue);
10875 }
10876 }
10877};
10878
10879/**
10880 * Mark a component as needing a rerender, adding an optional callback to a
10881 * list of functions which will be executed once the rerender occurs.
10882 */
10883function enqueueUpdate(component) {
10884 ensureInjected();
10885
10886 // Various parts of our code (such as ReactCompositeComponent's
10887 // _renderValidatedComponent) assume that calls to render aren't nested;
10888 // verify that that's the case. (This is called by each top-level update
10889 // function, like setState, forceUpdate, etc.; creation and
10890 // destruction of top-level components is guarded in ReactMount.)
10891
10892 if (!batchingStrategy.isBatchingUpdates) {
10893 batchingStrategy.batchedUpdates(enqueueUpdate, component);
10894 return;
10895 }
10896
10897 dirtyComponents.push(component);
10898 if (component._updateBatchNumber == null) {
10899 component._updateBatchNumber = updateBatchNumber + 1;
10900 }
10901}
10902
10903/**
10904 * Enqueue a callback to be run at the end of the current batching cycle. Throws
10905 * if no updates are currently being performed.
10906 */
10907function asap(callback, context) {
10908 invariant(batchingStrategy.isBatchingUpdates, "ReactUpdates.asap: Can't enqueue an asap callback in a context where" + 'updates are not being batched.');
10909 asapCallbackQueue.enqueue(callback, context);
10910 asapEnqueued = true;
10911}
10912
10913var ReactUpdatesInjection = {
10914 injectReconcileTransaction: function (ReconcileTransaction) {
10915 !ReconcileTransaction ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0;
10916 ReactUpdates.ReactReconcileTransaction = ReconcileTransaction;
10917 },
10918
10919 injectBatchingStrategy: function (_batchingStrategy) {
10920 !_batchingStrategy ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0;
10921 !(typeof _batchingStrategy.batchedUpdates === 'function') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0;
10922 !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? "development" !== 'production' ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0;
10923 batchingStrategy = _batchingStrategy;
10924 }
10925};
10926
10927var ReactUpdates = {
10928 /**
10929 * React references `ReactReconcileTransaction` using this property in order
10930 * to allow dependency injection.
10931 *
10932 * @internal
10933 */
10934 ReactReconcileTransaction: null,
10935
10936 batchedUpdates: batchedUpdates,
10937 enqueueUpdate: enqueueUpdate,
10938 flushBatchedUpdates: flushBatchedUpdates,
10939 injection: ReactUpdatesInjection,
10940 asap: asap
10941};
10942
10943module.exports = ReactUpdates;
10944},{"116":116,"141":141,"149":149,"24":24,"53":53,"6":6,"68":68,"93":93}],76:[function(_dereq_,module,exports){
10945/**
10946 * Copyright (c) 2013-present, Facebook, Inc.
10947 *
10948 * This source code is licensed under the MIT license found in the
10949 * LICENSE file in the root directory of this source tree.
10950 *
10951 */
10952
10953'use strict';
10954
10955module.exports = '15.7.0';
10956},{}],77:[function(_dereq_,module,exports){
10957/**
10958 * Copyright (c) 2013-present, Facebook, Inc.
10959 *
10960 * This source code is licensed under the MIT license found in the
10961 * LICENSE file in the root directory of this source tree.
10962 *
10963 */
10964
10965'use strict';
10966
10967var NS = {
10968 xlink: 'http://www.w3.org/1999/xlink',
10969 xml: 'http://www.w3.org/XML/1998/namespace'
10970};
10971
10972// We use attributes for everything SVG so let's avoid some duplication and run
10973// code instead.
10974// The following are all specified in the HTML config already so we exclude here.
10975// - class (as className)
10976// - color
10977// - height
10978// - id
10979// - lang
10980// - max
10981// - media
10982// - method
10983// - min
10984// - name
10985// - style
10986// - target
10987// - type
10988// - width
10989var ATTRS = {
10990 accentHeight: 'accent-height',
10991 accumulate: 0,
10992 additive: 0,
10993 alignmentBaseline: 'alignment-baseline',
10994 allowReorder: 'allowReorder',
10995 alphabetic: 0,
10996 amplitude: 0,
10997 arabicForm: 'arabic-form',
10998 ascent: 0,
10999 attributeName: 'attributeName',
11000 attributeType: 'attributeType',
11001 autoReverse: 'autoReverse',
11002 azimuth: 0,
11003 baseFrequency: 'baseFrequency',
11004 baseProfile: 'baseProfile',
11005 baselineShift: 'baseline-shift',
11006 bbox: 0,
11007 begin: 0,
11008 bias: 0,
11009 by: 0,
11010 calcMode: 'calcMode',
11011 capHeight: 'cap-height',
11012 clip: 0,
11013 clipPath: 'clip-path',
11014 clipRule: 'clip-rule',
11015 clipPathUnits: 'clipPathUnits',
11016 colorInterpolation: 'color-interpolation',
11017 colorInterpolationFilters: 'color-interpolation-filters',
11018 colorProfile: 'color-profile',
11019 colorRendering: 'color-rendering',
11020 contentScriptType: 'contentScriptType',
11021 contentStyleType: 'contentStyleType',
11022 cursor: 0,
11023 cx: 0,
11024 cy: 0,
11025 d: 0,
11026 decelerate: 0,
11027 descent: 0,
11028 diffuseConstant: 'diffuseConstant',
11029 direction: 0,
11030 display: 0,
11031 divisor: 0,
11032 dominantBaseline: 'dominant-baseline',
11033 dur: 0,
11034 dx: 0,
11035 dy: 0,
11036 edgeMode: 'edgeMode',
11037 elevation: 0,
11038 enableBackground: 'enable-background',
11039 end: 0,
11040 exponent: 0,
11041 externalResourcesRequired: 'externalResourcesRequired',
11042 fill: 0,
11043 fillOpacity: 'fill-opacity',
11044 fillRule: 'fill-rule',
11045 filter: 0,
11046 filterRes: 'filterRes',
11047 filterUnits: 'filterUnits',
11048 floodColor: 'flood-color',
11049 floodOpacity: 'flood-opacity',
11050 focusable: 0,
11051 fontFamily: 'font-family',
11052 fontSize: 'font-size',
11053 fontSizeAdjust: 'font-size-adjust',
11054 fontStretch: 'font-stretch',
11055 fontStyle: 'font-style',
11056 fontVariant: 'font-variant',
11057 fontWeight: 'font-weight',
11058 format: 0,
11059 from: 0,
11060 fx: 0,
11061 fy: 0,
11062 g1: 0,
11063 g2: 0,
11064 glyphName: 'glyph-name',
11065 glyphOrientationHorizontal: 'glyph-orientation-horizontal',
11066 glyphOrientationVertical: 'glyph-orientation-vertical',
11067 glyphRef: 'glyphRef',
11068 gradientTransform: 'gradientTransform',
11069 gradientUnits: 'gradientUnits',
11070 hanging: 0,
11071 horizAdvX: 'horiz-adv-x',
11072 horizOriginX: 'horiz-origin-x',
11073 ideographic: 0,
11074 imageRendering: 'image-rendering',
11075 'in': 0,
11076 in2: 0,
11077 intercept: 0,
11078 k: 0,
11079 k1: 0,
11080 k2: 0,
11081 k3: 0,
11082 k4: 0,
11083 kernelMatrix: 'kernelMatrix',
11084 kernelUnitLength: 'kernelUnitLength',
11085 kerning: 0,
11086 keyPoints: 'keyPoints',
11087 keySplines: 'keySplines',
11088 keyTimes: 'keyTimes',
11089 lengthAdjust: 'lengthAdjust',
11090 letterSpacing: 'letter-spacing',
11091 lightingColor: 'lighting-color',
11092 limitingConeAngle: 'limitingConeAngle',
11093 local: 0,
11094 markerEnd: 'marker-end',
11095 markerMid: 'marker-mid',
11096 markerStart: 'marker-start',
11097 markerHeight: 'markerHeight',
11098 markerUnits: 'markerUnits',
11099 markerWidth: 'markerWidth',
11100 mask: 0,
11101 maskContentUnits: 'maskContentUnits',
11102 maskUnits: 'maskUnits',
11103 mathematical: 0,
11104 mode: 0,
11105 numOctaves: 'numOctaves',
11106 offset: 0,
11107 opacity: 0,
11108 operator: 0,
11109 order: 0,
11110 orient: 0,
11111 orientation: 0,
11112 origin: 0,
11113 overflow: 0,
11114 overlinePosition: 'overline-position',
11115 overlineThickness: 'overline-thickness',
11116 paintOrder: 'paint-order',
11117 panose1: 'panose-1',
11118 pathLength: 'pathLength',
11119 patternContentUnits: 'patternContentUnits',
11120 patternTransform: 'patternTransform',
11121 patternUnits: 'patternUnits',
11122 pointerEvents: 'pointer-events',
11123 points: 0,
11124 pointsAtX: 'pointsAtX',
11125 pointsAtY: 'pointsAtY',
11126 pointsAtZ: 'pointsAtZ',
11127 preserveAlpha: 'preserveAlpha',
11128 preserveAspectRatio: 'preserveAspectRatio',
11129 primitiveUnits: 'primitiveUnits',
11130 r: 0,
11131 radius: 0,
11132 refX: 'refX',
11133 refY: 'refY',
11134 renderingIntent: 'rendering-intent',
11135 repeatCount: 'repeatCount',
11136 repeatDur: 'repeatDur',
11137 requiredExtensions: 'requiredExtensions',
11138 requiredFeatures: 'requiredFeatures',
11139 restart: 0,
11140 result: 0,
11141 rotate: 0,
11142 rx: 0,
11143 ry: 0,
11144 scale: 0,
11145 seed: 0,
11146 shapeRendering: 'shape-rendering',
11147 slope: 0,
11148 spacing: 0,
11149 specularConstant: 'specularConstant',
11150 specularExponent: 'specularExponent',
11151 speed: 0,
11152 spreadMethod: 'spreadMethod',
11153 startOffset: 'startOffset',
11154 stdDeviation: 'stdDeviation',
11155 stemh: 0,
11156 stemv: 0,
11157 stitchTiles: 'stitchTiles',
11158 stopColor: 'stop-color',
11159 stopOpacity: 'stop-opacity',
11160 strikethroughPosition: 'strikethrough-position',
11161 strikethroughThickness: 'strikethrough-thickness',
11162 string: 0,
11163 stroke: 0,
11164 strokeDasharray: 'stroke-dasharray',
11165 strokeDashoffset: 'stroke-dashoffset',
11166 strokeLinecap: 'stroke-linecap',
11167 strokeLinejoin: 'stroke-linejoin',
11168 strokeMiterlimit: 'stroke-miterlimit',
11169 strokeOpacity: 'stroke-opacity',
11170 strokeWidth: 'stroke-width',
11171 surfaceScale: 'surfaceScale',
11172 systemLanguage: 'systemLanguage',
11173 tableValues: 'tableValues',
11174 targetX: 'targetX',
11175 targetY: 'targetY',
11176 textAnchor: 'text-anchor',
11177 textDecoration: 'text-decoration',
11178 textRendering: 'text-rendering',
11179 textLength: 'textLength',
11180 to: 0,
11181 transform: 0,
11182 u1: 0,
11183 u2: 0,
11184 underlinePosition: 'underline-position',
11185 underlineThickness: 'underline-thickness',
11186 unicode: 0,
11187 unicodeBidi: 'unicode-bidi',
11188 unicodeRange: 'unicode-range',
11189 unitsPerEm: 'units-per-em',
11190 vAlphabetic: 'v-alphabetic',
11191 vHanging: 'v-hanging',
11192 vIdeographic: 'v-ideographic',
11193 vMathematical: 'v-mathematical',
11194 values: 0,
11195 vectorEffect: 'vector-effect',
11196 version: 0,
11197 vertAdvY: 'vert-adv-y',
11198 vertOriginX: 'vert-origin-x',
11199 vertOriginY: 'vert-origin-y',
11200 viewBox: 'viewBox',
11201 viewTarget: 'viewTarget',
11202 visibility: 0,
11203 widths: 0,
11204 wordSpacing: 'word-spacing',
11205 writingMode: 'writing-mode',
11206 x: 0,
11207 xHeight: 'x-height',
11208 x1: 0,
11209 x2: 0,
11210 xChannelSelector: 'xChannelSelector',
11211 xlinkActuate: 'xlink:actuate',
11212 xlinkArcrole: 'xlink:arcrole',
11213 xlinkHref: 'xlink:href',
11214 xlinkRole: 'xlink:role',
11215 xlinkShow: 'xlink:show',
11216 xlinkTitle: 'xlink:title',
11217 xlinkType: 'xlink:type',
11218 xmlBase: 'xml:base',
11219 xmlns: 0,
11220 xmlnsXlink: 'xmlns:xlink',
11221 xmlLang: 'xml:lang',
11222 xmlSpace: 'xml:space',
11223 y: 0,
11224 y1: 0,
11225 y2: 0,
11226 yChannelSelector: 'yChannelSelector',
11227 z: 0,
11228 zoomAndPan: 'zoomAndPan'
11229};
11230
11231var SVGDOMPropertyConfig = {
11232 Properties: {},
11233 DOMAttributeNamespaces: {
11234 xlinkActuate: NS.xlink,
11235 xlinkArcrole: NS.xlink,
11236 xlinkHref: NS.xlink,
11237 xlinkRole: NS.xlink,
11238 xlinkShow: NS.xlink,
11239 xlinkTitle: NS.xlink,
11240 xlinkType: NS.xlink,
11241 xmlBase: NS.xml,
11242 xmlLang: NS.xml,
11243 xmlSpace: NS.xml
11244 },
11245 DOMAttributeNames: {}
11246};
11247
11248Object.keys(ATTRS).forEach(function (key) {
11249 SVGDOMPropertyConfig.Properties[key] = 0;
11250 if (ATTRS[key]) {
11251 SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];
11252 }
11253});
11254
11255module.exports = SVGDOMPropertyConfig;
11256},{}],78:[function(_dereq_,module,exports){
11257/**
11258 * Copyright (c) 2013-present, Facebook, Inc.
11259 *
11260 * This source code is licensed under the MIT license found in the
11261 * LICENSE file in the root directory of this source tree.
11262 *
11263 */
11264
11265'use strict';
11266
11267var EventPropagators = _dereq_(19);
11268var ExecutionEnvironment = _dereq_(127);
11269var ReactDOMComponentTree = _dereq_(32);
11270var ReactInputSelection = _dereq_(57);
11271var SyntheticEvent = _dereq_(84);
11272
11273var getActiveElement = _dereq_(136);
11274var isTextInputElement = _dereq_(114);
11275var shallowEqual = _dereq_(147);
11276
11277var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11;
11278
11279var eventTypes = {
11280 select: {
11281 phasedRegistrationNames: {
11282 bubbled: 'onSelect',
11283 captured: 'onSelectCapture'
11284 },
11285 dependencies: ['topBlur', 'topContextMenu', 'topFocus', 'topKeyDown', 'topKeyUp', 'topMouseDown', 'topMouseUp', 'topSelectionChange']
11286 }
11287};
11288
11289var activeElement = null;
11290var activeElementInst = null;
11291var lastSelection = null;
11292var mouseDown = false;
11293
11294// Track whether a listener exists for this plugin. If none exist, we do
11295// not extract events. See #3639.
11296var hasListener = false;
11297
11298/**
11299 * Get an object which is a unique representation of the current selection.
11300 *
11301 * The return value will not be consistent across nodes or browsers, but
11302 * two identical selections on the same node will return identical objects.
11303 *
11304 * @param {DOMElement} node
11305 * @return {object}
11306 */
11307function getSelection(node) {
11308 if ('selectionStart' in node && ReactInputSelection.hasSelectionCapabilities(node)) {
11309 return {
11310 start: node.selectionStart,
11311 end: node.selectionEnd
11312 };
11313 } else if (window.getSelection) {
11314 var selection = window.getSelection();
11315 return {
11316 anchorNode: selection.anchorNode,
11317 anchorOffset: selection.anchorOffset,
11318 focusNode: selection.focusNode,
11319 focusOffset: selection.focusOffset
11320 };
11321 } else if (document.selection) {
11322 var range = document.selection.createRange();
11323 return {
11324 parentElement: range.parentElement(),
11325 text: range.text,
11326 top: range.boundingTop,
11327 left: range.boundingLeft
11328 };
11329 }
11330}
11331
11332/**
11333 * Poll selection to see whether it's changed.
11334 *
11335 * @param {object} nativeEvent
11336 * @return {?SyntheticEvent}
11337 */
11338function constructSelectEvent(nativeEvent, nativeEventTarget) {
11339 // Ensure we have the right element, and that the user is not dragging a
11340 // selection (this matches native `select` event behavior). In HTML5, select
11341 // fires only on input and textarea thus if there's no focused element we
11342 // won't dispatch.
11343 if (mouseDown || activeElement == null || activeElement !== getActiveElement()) {
11344 return null;
11345 }
11346
11347 // Only fire when selection has actually changed.
11348 var currentSelection = getSelection(activeElement);
11349 if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
11350 lastSelection = currentSelection;
11351
11352 var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget);
11353
11354 syntheticEvent.type = 'select';
11355 syntheticEvent.target = activeElement;
11356
11357 EventPropagators.accumulateTwoPhaseDispatches(syntheticEvent);
11358
11359 return syntheticEvent;
11360 }
11361
11362 return null;
11363}
11364
11365/**
11366 * This plugin creates an `onSelect` event that normalizes select events
11367 * across form elements.
11368 *
11369 * Supported elements are:
11370 * - input (see `isTextInputElement`)
11371 * - textarea
11372 * - contentEditable
11373 *
11374 * This differs from native browser implementations in the following ways:
11375 * - Fires on contentEditable fields as well as inputs.
11376 * - Fires for collapsed selection.
11377 * - Fires after user input.
11378 */
11379var SelectEventPlugin = {
11380 eventTypes: eventTypes,
11381
11382 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
11383 if (!hasListener) {
11384 return null;
11385 }
11386
11387 var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window;
11388
11389 switch (topLevelType) {
11390 // Track the input node that has focus.
11391 case 'topFocus':
11392 if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
11393 activeElement = targetNode;
11394 activeElementInst = targetInst;
11395 lastSelection = null;
11396 }
11397 break;
11398 case 'topBlur':
11399 activeElement = null;
11400 activeElementInst = null;
11401 lastSelection = null;
11402 break;
11403 // Don't fire the event while the user is dragging. This matches the
11404 // semantics of the native select event.
11405 case 'topMouseDown':
11406 mouseDown = true;
11407 break;
11408 case 'topContextMenu':
11409 case 'topMouseUp':
11410 mouseDown = false;
11411 return constructSelectEvent(nativeEvent, nativeEventTarget);
11412 // Chrome and IE fire non-standard event when selection is changed (and
11413 // sometimes when it hasn't). IE's event fires out of order with respect
11414 // to key and input events on deletion, so we discard it.
11415 //
11416 // Firefox doesn't support selectionchange, so check selection status
11417 // after each key entry. The selection changes after keydown and before
11418 // keyup, but we check on keydown as well in the case of holding down a
11419 // key, when multiple keydown events are fired but only one keyup is.
11420 // This is also our approach for IE handling, for the reason above.
11421 case 'topSelectionChange':
11422 if (skipSelectionChangeEvent) {
11423 break;
11424 }
11425 // falls through
11426 case 'topKeyDown':
11427 case 'topKeyUp':
11428 return constructSelectEvent(nativeEvent, nativeEventTarget);
11429 }
11430
11431 return null;
11432 },
11433
11434 didPutListener: function (inst, registrationName, listener) {
11435 if (registrationName === 'onSelect') {
11436 hasListener = true;
11437 }
11438 }
11439};
11440
11441module.exports = SelectEventPlugin;
11442},{"114":114,"127":127,"136":136,"147":147,"19":19,"32":32,"57":57,"84":84}],79:[function(_dereq_,module,exports){
11443/**
11444 * Copyright (c) 2013-present, Facebook, Inc.
11445 *
11446 * This source code is licensed under the MIT license found in the
11447 * LICENSE file in the root directory of this source tree.
11448 *
11449 *
11450 */
11451
11452'use strict';
11453
11454var _prodInvariant = _dereq_(116);
11455
11456var EventListener = _dereq_(126);
11457var EventPropagators = _dereq_(19);
11458var ReactDOMComponentTree = _dereq_(32);
11459var SyntheticAnimationEvent = _dereq_(80);
11460var SyntheticClipboardEvent = _dereq_(81);
11461var SyntheticEvent = _dereq_(84);
11462var SyntheticFocusEvent = _dereq_(85);
11463var SyntheticKeyboardEvent = _dereq_(87);
11464var SyntheticMouseEvent = _dereq_(88);
11465var SyntheticDragEvent = _dereq_(83);
11466var SyntheticTouchEvent = _dereq_(89);
11467var SyntheticTransitionEvent = _dereq_(90);
11468var SyntheticUIEvent = _dereq_(91);
11469var SyntheticWheelEvent = _dereq_(92);
11470
11471var emptyFunction = _dereq_(133);
11472var getEventCharCode = _dereq_(103);
11473var invariant = _dereq_(141);
11474
11475/**
11476 * Turns
11477 * ['abort', ...]
11478 * into
11479 * eventTypes = {
11480 * 'abort': {
11481 * phasedRegistrationNames: {
11482 * bubbled: 'onAbort',
11483 * captured: 'onAbortCapture',
11484 * },
11485 * dependencies: ['topAbort'],
11486 * },
11487 * ...
11488 * };
11489 * topLevelEventsToDispatchConfig = {
11490 * 'topAbort': { sameConfig }
11491 * };
11492 */
11493var eventTypes = {};
11494var topLevelEventsToDispatchConfig = {};
11495['abort', 'animationEnd', 'animationIteration', 'animationStart', 'blur', 'canPlay', 'canPlayThrough', 'click', 'contextMenu', 'copy', 'cut', 'doubleClick', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'focus', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'progress', 'rateChange', 'reset', 'scroll', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'touchCancel', 'touchEnd', 'touchMove', 'touchStart', 'transitionEnd', 'volumeChange', 'waiting', 'wheel'].forEach(function (event) {
11496 var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
11497 var onEvent = 'on' + capitalizedEvent;
11498 var topEvent = 'top' + capitalizedEvent;
11499
11500 var type = {
11501 phasedRegistrationNames: {
11502 bubbled: onEvent,
11503 captured: onEvent + 'Capture'
11504 },
11505 dependencies: [topEvent]
11506 };
11507 eventTypes[event] = type;
11508 topLevelEventsToDispatchConfig[topEvent] = type;
11509});
11510
11511var onClickListeners = {};
11512
11513function getDictionaryKey(inst) {
11514 // Prevents V8 performance issue:
11515 // https://github.com/facebook/react/pull/7232
11516 return '.' + inst._rootNodeID;
11517}
11518
11519function isInteractive(tag) {
11520 return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
11521}
11522
11523var SimpleEventPlugin = {
11524 eventTypes: eventTypes,
11525
11526 extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
11527 var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
11528 if (!dispatchConfig) {
11529 return null;
11530 }
11531 var EventConstructor;
11532 switch (topLevelType) {
11533 case 'topAbort':
11534 case 'topCanPlay':
11535 case 'topCanPlayThrough':
11536 case 'topDurationChange':
11537 case 'topEmptied':
11538 case 'topEncrypted':
11539 case 'topEnded':
11540 case 'topError':
11541 case 'topInput':
11542 case 'topInvalid':
11543 case 'topLoad':
11544 case 'topLoadedData':
11545 case 'topLoadedMetadata':
11546 case 'topLoadStart':
11547 case 'topPause':
11548 case 'topPlay':
11549 case 'topPlaying':
11550 case 'topProgress':
11551 case 'topRateChange':
11552 case 'topReset':
11553 case 'topSeeked':
11554 case 'topSeeking':
11555 case 'topStalled':
11556 case 'topSubmit':
11557 case 'topSuspend':
11558 case 'topTimeUpdate':
11559 case 'topVolumeChange':
11560 case 'topWaiting':
11561 // HTML Events
11562 // @see http://www.w3.org/TR/html5/index.html#events-0
11563 EventConstructor = SyntheticEvent;
11564 break;
11565 case 'topKeyPress':
11566 // Firefox creates a keypress event for function keys too. This removes
11567 // the unwanted keypress events. Enter is however both printable and
11568 // non-printable. One would expect Tab to be as well (but it isn't).
11569 if (getEventCharCode(nativeEvent) === 0) {
11570 return null;
11571 }
11572 /* falls through */
11573 case 'topKeyDown':
11574 case 'topKeyUp':
11575 EventConstructor = SyntheticKeyboardEvent;
11576 break;
11577 case 'topBlur':
11578 case 'topFocus':
11579 EventConstructor = SyntheticFocusEvent;
11580 break;
11581 case 'topClick':
11582 // Firefox creates a click event on right mouse clicks. This removes the
11583 // unwanted click events.
11584 if (nativeEvent.button === 2) {
11585 return null;
11586 }
11587 /* falls through */
11588 case 'topDoubleClick':
11589 case 'topMouseDown':
11590 case 'topMouseMove':
11591 case 'topMouseUp':
11592 // TODO: Disabled elements should not respond to mouse events
11593 /* falls through */
11594 case 'topMouseOut':
11595 case 'topMouseOver':
11596 case 'topContextMenu':
11597 EventConstructor = SyntheticMouseEvent;
11598 break;
11599 case 'topDrag':
11600 case 'topDragEnd':
11601 case 'topDragEnter':
11602 case 'topDragExit':
11603 case 'topDragLeave':
11604 case 'topDragOver':
11605 case 'topDragStart':
11606 case 'topDrop':
11607 EventConstructor = SyntheticDragEvent;
11608 break;
11609 case 'topTouchCancel':
11610 case 'topTouchEnd':
11611 case 'topTouchMove':
11612 case 'topTouchStart':
11613 EventConstructor = SyntheticTouchEvent;
11614 break;
11615 case 'topAnimationEnd':
11616 case 'topAnimationIteration':
11617 case 'topAnimationStart':
11618 EventConstructor = SyntheticAnimationEvent;
11619 break;
11620 case 'topTransitionEnd':
11621 EventConstructor = SyntheticTransitionEvent;
11622 break;
11623 case 'topScroll':
11624 EventConstructor = SyntheticUIEvent;
11625 break;
11626 case 'topWheel':
11627 EventConstructor = SyntheticWheelEvent;
11628 break;
11629 case 'topCopy':
11630 case 'topCut':
11631 case 'topPaste':
11632 EventConstructor = SyntheticClipboardEvent;
11633 break;
11634 }
11635 !EventConstructor ? "development" !== 'production' ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : _prodInvariant('86', topLevelType) : void 0;
11636 var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
11637 EventPropagators.accumulateTwoPhaseDispatches(event);
11638 return event;
11639 },
11640
11641 didPutListener: function (inst, registrationName, listener) {
11642 // Mobile Safari does not fire properly bubble click events on
11643 // non-interactive elements, which means delegated click listeners do not
11644 // fire. The workaround for this bug involves attaching an empty click
11645 // listener on the target node.
11646 // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
11647 if (registrationName === 'onClick' && !isInteractive(inst._tag)) {
11648 var key = getDictionaryKey(inst);
11649 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
11650 if (!onClickListeners[key]) {
11651 onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction);
11652 }
11653 }
11654 },
11655
11656 willDeleteListener: function (inst, registrationName) {
11657 if (registrationName === 'onClick' && !isInteractive(inst._tag)) {
11658 var key = getDictionaryKey(inst);
11659 onClickListeners[key].remove();
11660 delete onClickListeners[key];
11661 }
11662 }
11663};
11664
11665module.exports = SimpleEventPlugin;
11666},{"103":103,"116":116,"126":126,"133":133,"141":141,"19":19,"32":32,"80":80,"81":81,"83":83,"84":84,"85":85,"87":87,"88":88,"89":89,"90":90,"91":91,"92":92}],80:[function(_dereq_,module,exports){
11667/**
11668 * Copyright (c) 2013-present, Facebook, Inc.
11669 *
11670 * This source code is licensed under the MIT license found in the
11671 * LICENSE file in the root directory of this source tree.
11672 *
11673 */
11674
11675'use strict';
11676
11677var SyntheticEvent = _dereq_(84);
11678
11679/**
11680 * @interface Event
11681 * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
11682 * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
11683 */
11684var AnimationEventInterface = {
11685 animationName: null,
11686 elapsedTime: null,
11687 pseudoElement: null
11688};
11689
11690/**
11691 * @param {object} dispatchConfig Configuration used to dispatch this event.
11692 * @param {string} dispatchMarker Marker identifying the event target.
11693 * @param {object} nativeEvent Native browser event.
11694 * @extends {SyntheticEvent}
11695 */
11696function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
11697 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
11698}
11699
11700SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface);
11701
11702module.exports = SyntheticAnimationEvent;
11703},{"84":84}],81:[function(_dereq_,module,exports){
11704/**
11705 * Copyright (c) 2013-present, Facebook, Inc.
11706 *
11707 * This source code is licensed under the MIT license found in the
11708 * LICENSE file in the root directory of this source tree.
11709 *
11710 */
11711
11712'use strict';
11713
11714var SyntheticEvent = _dereq_(84);
11715
11716/**
11717 * @interface Event
11718 * @see http://www.w3.org/TR/clipboard-apis/
11719 */
11720var ClipboardEventInterface = {
11721 clipboardData: function (event) {
11722 return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
11723 }
11724};
11725
11726/**
11727 * @param {object} dispatchConfig Configuration used to dispatch this event.
11728 * @param {string} dispatchMarker Marker identifying the event target.
11729 * @param {object} nativeEvent Native browser event.
11730 * @extends {SyntheticUIEvent}
11731 */
11732function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
11733 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
11734}
11735
11736SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface);
11737
11738module.exports = SyntheticClipboardEvent;
11739},{"84":84}],82:[function(_dereq_,module,exports){
11740/**
11741 * Copyright (c) 2013-present, Facebook, Inc.
11742 *
11743 * This source code is licensed under the MIT license found in the
11744 * LICENSE file in the root directory of this source tree.
11745 *
11746 */
11747
11748'use strict';
11749
11750var SyntheticEvent = _dereq_(84);
11751
11752/**
11753 * @interface Event
11754 * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
11755 */
11756var CompositionEventInterface = {
11757 data: null
11758};
11759
11760/**
11761 * @param {object} dispatchConfig Configuration used to dispatch this event.
11762 * @param {string} dispatchMarker Marker identifying the event target.
11763 * @param {object} nativeEvent Native browser event.
11764 * @extends {SyntheticUIEvent}
11765 */
11766function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
11767 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
11768}
11769
11770SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);
11771
11772module.exports = SyntheticCompositionEvent;
11773},{"84":84}],83:[function(_dereq_,module,exports){
11774/**
11775 * Copyright (c) 2013-present, Facebook, Inc.
11776 *
11777 * This source code is licensed under the MIT license found in the
11778 * LICENSE file in the root directory of this source tree.
11779 *
11780 */
11781
11782'use strict';
11783
11784var SyntheticMouseEvent = _dereq_(88);
11785
11786/**
11787 * @interface DragEvent
11788 * @see http://www.w3.org/TR/DOM-Level-3-Events/
11789 */
11790var DragEventInterface = {
11791 dataTransfer: null
11792};
11793
11794/**
11795 * @param {object} dispatchConfig Configuration used to dispatch this event.
11796 * @param {string} dispatchMarker Marker identifying the event target.
11797 * @param {object} nativeEvent Native browser event.
11798 * @extends {SyntheticUIEvent}
11799 */
11800function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
11801 return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
11802}
11803
11804SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface);
11805
11806module.exports = SyntheticDragEvent;
11807},{"88":88}],84:[function(_dereq_,module,exports){
11808/**
11809 * Copyright (c) 2013-present, Facebook, Inc.
11810 *
11811 * This source code is licensed under the MIT license found in the
11812 * LICENSE file in the root directory of this source tree.
11813 *
11814 */
11815
11816'use strict';
11817
11818var _assign = _dereq_(149);
11819
11820var PooledClass = _dereq_(24);
11821
11822var emptyFunction = _dereq_(133);
11823var warning = _dereq_(148);
11824
11825var didWarnForAddedNewProperty = false;
11826var isProxySupported = typeof Proxy === 'function';
11827
11828var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
11829
11830/**
11831 * @interface Event
11832 * @see http://www.w3.org/TR/DOM-Level-3-Events/
11833 */
11834var EventInterface = {
11835 type: null,
11836 target: null,
11837 // currentTarget is set when dispatching; no use in copying it here
11838 currentTarget: emptyFunction.thatReturnsNull,
11839 eventPhase: null,
11840 bubbles: null,
11841 cancelable: null,
11842 timeStamp: function (event) {
11843 return event.timeStamp || Date.now();
11844 },
11845 defaultPrevented: null,
11846 isTrusted: null
11847};
11848
11849/**
11850 * Synthetic events are dispatched by event plugins, typically in response to a
11851 * top-level event delegation handler.
11852 *
11853 * These systems should generally use pooling to reduce the frequency of garbage
11854 * collection. The system should check `isPersistent` to determine whether the
11855 * event should be released into the pool after being dispatched. Users that
11856 * need a persisted event should invoke `persist`.
11857 *
11858 * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
11859 * normalizing browser quirks. Subclasses do not necessarily have to implement a
11860 * DOM interface; custom application-specific events can also subclass this.
11861 *
11862 * @param {object} dispatchConfig Configuration used to dispatch this event.
11863 * @param {*} targetInst Marker identifying the event target.
11864 * @param {object} nativeEvent Native browser event.
11865 * @param {DOMEventTarget} nativeEventTarget Target node.
11866 */
11867function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
11868 if ("development" !== 'production') {
11869 // these have a getter/setter for warnings
11870 delete this.nativeEvent;
11871 delete this.preventDefault;
11872 delete this.stopPropagation;
11873 }
11874
11875 this.dispatchConfig = dispatchConfig;
11876 this._targetInst = targetInst;
11877 this.nativeEvent = nativeEvent;
11878
11879 var Interface = this.constructor.Interface;
11880 for (var propName in Interface) {
11881 if (!Interface.hasOwnProperty(propName)) {
11882 continue;
11883 }
11884 if ("development" !== 'production') {
11885 delete this[propName]; // this has a getter/setter for warnings
11886 }
11887 var normalize = Interface[propName];
11888 if (normalize) {
11889 this[propName] = normalize(nativeEvent);
11890 } else {
11891 if (propName === 'target') {
11892 this.target = nativeEventTarget;
11893 } else {
11894 this[propName] = nativeEvent[propName];
11895 }
11896 }
11897 }
11898
11899 var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
11900 if (defaultPrevented) {
11901 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
11902 } else {
11903 this.isDefaultPrevented = emptyFunction.thatReturnsFalse;
11904 }
11905 this.isPropagationStopped = emptyFunction.thatReturnsFalse;
11906 return this;
11907}
11908
11909_assign(SyntheticEvent.prototype, {
11910 preventDefault: function () {
11911 this.defaultPrevented = true;
11912 var event = this.nativeEvent;
11913 if (!event) {
11914 return;
11915 }
11916
11917 if (event.preventDefault) {
11918 event.preventDefault();
11919 // eslint-disable-next-line valid-typeof
11920 } else if (typeof event.returnValue !== 'unknown') {
11921 event.returnValue = false;
11922 }
11923 this.isDefaultPrevented = emptyFunction.thatReturnsTrue;
11924 },
11925
11926 stopPropagation: function () {
11927 var event = this.nativeEvent;
11928 if (!event) {
11929 return;
11930 }
11931
11932 if (event.stopPropagation) {
11933 event.stopPropagation();
11934 // eslint-disable-next-line valid-typeof
11935 } else if (typeof event.cancelBubble !== 'unknown') {
11936 // The ChangeEventPlugin registers a "propertychange" event for
11937 // IE. This event does not support bubbling or cancelling, and
11938 // any references to cancelBubble throw "Member not found". A
11939 // typeof check of "unknown" circumvents this issue (and is also
11940 // IE specific).
11941 event.cancelBubble = true;
11942 }
11943
11944 this.isPropagationStopped = emptyFunction.thatReturnsTrue;
11945 },
11946
11947 /**
11948 * We release all dispatched `SyntheticEvent`s after each event loop, adding
11949 * them back into the pool. This allows a way to hold onto a reference that
11950 * won't be added back into the pool.
11951 */
11952 persist: function () {
11953 this.isPersistent = emptyFunction.thatReturnsTrue;
11954 },
11955
11956 /**
11957 * Checks if this event should be released back into the pool.
11958 *
11959 * @return {boolean} True if this should not be released, false otherwise.
11960 */
11961 isPersistent: emptyFunction.thatReturnsFalse,
11962
11963 /**
11964 * `PooledClass` looks for `destructor` on each instance it releases.
11965 */
11966 destructor: function () {
11967 var Interface = this.constructor.Interface;
11968 for (var propName in Interface) {
11969 if ("development" !== 'production') {
11970 Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
11971 } else {
11972 this[propName] = null;
11973 }
11974 }
11975 for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
11976 this[shouldBeReleasedProperties[i]] = null;
11977 }
11978 if ("development" !== 'production') {
11979 Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
11980 Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
11981 Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
11982 }
11983 }
11984});
11985
11986SyntheticEvent.Interface = EventInterface;
11987
11988/**
11989 * Helper to reduce boilerplate when creating subclasses.
11990 *
11991 * @param {function} Class
11992 * @param {?object} Interface
11993 */
11994SyntheticEvent.augmentClass = function (Class, Interface) {
11995 var Super = this;
11996
11997 var E = function () {};
11998 E.prototype = Super.prototype;
11999 var prototype = new E();
12000
12001 _assign(prototype, Class.prototype);
12002 Class.prototype = prototype;
12003 Class.prototype.constructor = Class;
12004
12005 Class.Interface = _assign({}, Super.Interface, Interface);
12006 Class.augmentClass = Super.augmentClass;
12007
12008 PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler);
12009};
12010
12011/** Proxying after everything set on SyntheticEvent
12012 * to resolve Proxy issue on some WebKit browsers
12013 * in which some Event properties are set to undefined (GH#10010)
12014 */
12015if ("development" !== 'production') {
12016 if (isProxySupported) {
12017 /*eslint-disable no-func-assign */
12018 SyntheticEvent = new Proxy(SyntheticEvent, {
12019 construct: function (target, args) {
12020 return this.apply(target, Object.create(target.prototype), args);
12021 },
12022 apply: function (constructor, that, args) {
12023 return new Proxy(constructor.apply(that, args), {
12024 set: function (target, prop, value) {
12025 if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
12026 "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;
12027 didWarnForAddedNewProperty = true;
12028 }
12029 target[prop] = value;
12030 return true;
12031 }
12032 });
12033 }
12034 });
12035 /*eslint-enable no-func-assign */
12036 }
12037}
12038
12039PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler);
12040
12041module.exports = SyntheticEvent;
12042
12043/**
12044 * Helper to nullify syntheticEvent instance properties when destructing
12045 *
12046 * @param {object} SyntheticEvent
12047 * @param {String} propName
12048 * @return {object} defineProperty object
12049 */
12050function getPooledWarningPropertyDefinition(propName, getVal) {
12051 var isFunction = typeof getVal === 'function';
12052 return {
12053 configurable: true,
12054 set: set,
12055 get: get
12056 };
12057
12058 function set(val) {
12059 var action = isFunction ? 'setting the method' : 'setting the property';
12060 warn(action, 'This is effectively a no-op');
12061 return val;
12062 }
12063
12064 function get() {
12065 var action = isFunction ? 'accessing the method' : 'accessing the property';
12066 var result = isFunction ? 'This is a no-op function' : 'This is set to null';
12067 warn(action, result);
12068 return getVal;
12069 }
12070
12071 function warn(action, result) {
12072 var warningCondition = false;
12073 "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;
12074 }
12075}
12076},{"133":133,"148":148,"149":149,"24":24}],85:[function(_dereq_,module,exports){
12077/**
12078 * Copyright (c) 2013-present, Facebook, Inc.
12079 *
12080 * This source code is licensed under the MIT license found in the
12081 * LICENSE file in the root directory of this source tree.
12082 *
12083 */
12084
12085'use strict';
12086
12087var SyntheticUIEvent = _dereq_(91);
12088
12089/**
12090 * @interface FocusEvent
12091 * @see http://www.w3.org/TR/DOM-Level-3-Events/
12092 */
12093var FocusEventInterface = {
12094 relatedTarget: null
12095};
12096
12097/**
12098 * @param {object} dispatchConfig Configuration used to dispatch this event.
12099 * @param {string} dispatchMarker Marker identifying the event target.
12100 * @param {object} nativeEvent Native browser event.
12101 * @extends {SyntheticUIEvent}
12102 */
12103function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
12104 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
12105}
12106
12107SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface);
12108
12109module.exports = SyntheticFocusEvent;
12110},{"91":91}],86:[function(_dereq_,module,exports){
12111/**
12112 * Copyright (c) 2013-present, Facebook, Inc.
12113 *
12114 * This source code is licensed under the MIT license found in the
12115 * LICENSE file in the root directory of this source tree.
12116 *
12117 */
12118
12119'use strict';
12120
12121var SyntheticEvent = _dereq_(84);
12122
12123/**
12124 * @interface Event
12125 * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
12126 * /#events-inputevents
12127 */
12128var InputEventInterface = {
12129 data: null
12130};
12131
12132/**
12133 * @param {object} dispatchConfig Configuration used to dispatch this event.
12134 * @param {string} dispatchMarker Marker identifying the event target.
12135 * @param {object} nativeEvent Native browser event.
12136 * @extends {SyntheticUIEvent}
12137 */
12138function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
12139 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
12140}
12141
12142SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface);
12143
12144module.exports = SyntheticInputEvent;
12145},{"84":84}],87:[function(_dereq_,module,exports){
12146/**
12147 * Copyright (c) 2013-present, Facebook, Inc.
12148 *
12149 * This source code is licensed under the MIT license found in the
12150 * LICENSE file in the root directory of this source tree.
12151 *
12152 */
12153
12154'use strict';
12155
12156var SyntheticUIEvent = _dereq_(91);
12157
12158var getEventCharCode = _dereq_(103);
12159var getEventKey = _dereq_(104);
12160var getEventModifierState = _dereq_(105);
12161
12162/**
12163 * @interface KeyboardEvent
12164 * @see http://www.w3.org/TR/DOM-Level-3-Events/
12165 */
12166var KeyboardEventInterface = {
12167 key: getEventKey,
12168 location: null,
12169 ctrlKey: null,
12170 shiftKey: null,
12171 altKey: null,
12172 metaKey: null,
12173 repeat: null,
12174 locale: null,
12175 getModifierState: getEventModifierState,
12176 // Legacy Interface
12177 charCode: function (event) {
12178 // `charCode` is the result of a KeyPress event and represents the value of
12179 // the actual printable character.
12180
12181 // KeyPress is deprecated, but its replacement is not yet final and not
12182 // implemented in any major browser. Only KeyPress has charCode.
12183 if (event.type === 'keypress') {
12184 return getEventCharCode(event);
12185 }
12186 return 0;
12187 },
12188 keyCode: function (event) {
12189 // `keyCode` is the result of a KeyDown/Up event and represents the value of
12190 // physical keyboard key.
12191
12192 // The actual meaning of the value depends on the users' keyboard layout
12193 // which cannot be detected. Assuming that it is a US keyboard layout
12194 // provides a surprisingly accurate mapping for US and European users.
12195 // Due to this, it is left to the user to implement at this time.
12196 if (event.type === 'keydown' || event.type === 'keyup') {
12197 return event.keyCode;
12198 }
12199 return 0;
12200 },
12201 which: function (event) {
12202 // `which` is an alias for either `keyCode` or `charCode` depending on the
12203 // type of the event.
12204 if (event.type === 'keypress') {
12205 return getEventCharCode(event);
12206 }
12207 if (event.type === 'keydown' || event.type === 'keyup') {
12208 return event.keyCode;
12209 }
12210 return 0;
12211 }
12212};
12213
12214/**
12215 * @param {object} dispatchConfig Configuration used to dispatch this event.
12216 * @param {string} dispatchMarker Marker identifying the event target.
12217 * @param {object} nativeEvent Native browser event.
12218 * @extends {SyntheticUIEvent}
12219 */
12220function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
12221 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
12222}
12223
12224SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface);
12225
12226module.exports = SyntheticKeyboardEvent;
12227},{"103":103,"104":104,"105":105,"91":91}],88:[function(_dereq_,module,exports){
12228/**
12229 * Copyright (c) 2013-present, Facebook, Inc.
12230 *
12231 * This source code is licensed under the MIT license found in the
12232 * LICENSE file in the root directory of this source tree.
12233 *
12234 */
12235
12236'use strict';
12237
12238var SyntheticUIEvent = _dereq_(91);
12239var ViewportMetrics = _dereq_(94);
12240
12241var getEventModifierState = _dereq_(105);
12242
12243/**
12244 * @interface MouseEvent
12245 * @see http://www.w3.org/TR/DOM-Level-3-Events/
12246 */
12247var MouseEventInterface = {
12248 screenX: null,
12249 screenY: null,
12250 clientX: null,
12251 clientY: null,
12252 ctrlKey: null,
12253 shiftKey: null,
12254 altKey: null,
12255 metaKey: null,
12256 getModifierState: getEventModifierState,
12257 button: function (event) {
12258 // Webkit, Firefox, IE9+
12259 // which: 1 2 3
12260 // button: 0 1 2 (standard)
12261 var button = event.button;
12262 if ('which' in event) {
12263 return button;
12264 }
12265 // IE<9
12266 // which: undefined
12267 // button: 0 0 0
12268 // button: 1 4 2 (onmouseup)
12269 return button === 2 ? 2 : button === 4 ? 1 : 0;
12270 },
12271 buttons: null,
12272 relatedTarget: function (event) {
12273 return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
12274 },
12275 // "Proprietary" Interface.
12276 pageX: function (event) {
12277 return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft;
12278 },
12279 pageY: function (event) {
12280 return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop;
12281 }
12282};
12283
12284/**
12285 * @param {object} dispatchConfig Configuration used to dispatch this event.
12286 * @param {string} dispatchMarker Marker identifying the event target.
12287 * @param {object} nativeEvent Native browser event.
12288 * @extends {SyntheticUIEvent}
12289 */
12290function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
12291 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
12292}
12293
12294SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface);
12295
12296module.exports = SyntheticMouseEvent;
12297},{"105":105,"91":91,"94":94}],89:[function(_dereq_,module,exports){
12298/**
12299 * Copyright (c) 2013-present, Facebook, Inc.
12300 *
12301 * This source code is licensed under the MIT license found in the
12302 * LICENSE file in the root directory of this source tree.
12303 *
12304 */
12305
12306'use strict';
12307
12308var SyntheticUIEvent = _dereq_(91);
12309
12310var getEventModifierState = _dereq_(105);
12311
12312/**
12313 * @interface TouchEvent
12314 * @see http://www.w3.org/TR/touch-events/
12315 */
12316var TouchEventInterface = {
12317 touches: null,
12318 targetTouches: null,
12319 changedTouches: null,
12320 altKey: null,
12321 metaKey: null,
12322 ctrlKey: null,
12323 shiftKey: null,
12324 getModifierState: getEventModifierState
12325};
12326
12327/**
12328 * @param {object} dispatchConfig Configuration used to dispatch this event.
12329 * @param {string} dispatchMarker Marker identifying the event target.
12330 * @param {object} nativeEvent Native browser event.
12331 * @extends {SyntheticUIEvent}
12332 */
12333function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
12334 return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
12335}
12336
12337SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface);
12338
12339module.exports = SyntheticTouchEvent;
12340},{"105":105,"91":91}],90:[function(_dereq_,module,exports){
12341/**
12342 * Copyright (c) 2013-present, Facebook, Inc.
12343 *
12344 * This source code is licensed under the MIT license found in the
12345 * LICENSE file in the root directory of this source tree.
12346 *
12347 */
12348
12349'use strict';
12350
12351var SyntheticEvent = _dereq_(84);
12352
12353/**
12354 * @interface Event
12355 * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
12356 * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
12357 */
12358var TransitionEventInterface = {
12359 propertyName: null,
12360 elapsedTime: null,
12361 pseudoElement: null
12362};
12363
12364/**
12365 * @param {object} dispatchConfig Configuration used to dispatch this event.
12366 * @param {string} dispatchMarker Marker identifying the event target.
12367 * @param {object} nativeEvent Native browser event.
12368 * @extends {SyntheticEvent}
12369 */
12370function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
12371 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
12372}
12373
12374SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface);
12375
12376module.exports = SyntheticTransitionEvent;
12377},{"84":84}],91:[function(_dereq_,module,exports){
12378/**
12379 * Copyright (c) 2013-present, Facebook, Inc.
12380 *
12381 * This source code is licensed under the MIT license found in the
12382 * LICENSE file in the root directory of this source tree.
12383 *
12384 */
12385
12386'use strict';
12387
12388var SyntheticEvent = _dereq_(84);
12389
12390var getEventTarget = _dereq_(106);
12391
12392/**
12393 * @interface UIEvent
12394 * @see http://www.w3.org/TR/DOM-Level-3-Events/
12395 */
12396var UIEventInterface = {
12397 view: function (event) {
12398 if (event.view) {
12399 return event.view;
12400 }
12401
12402 var target = getEventTarget(event);
12403 if (target.window === target) {
12404 // target is a window object
12405 return target;
12406 }
12407
12408 var doc = target.ownerDocument;
12409 // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
12410 if (doc) {
12411 return doc.defaultView || doc.parentWindow;
12412 } else {
12413 return window;
12414 }
12415 },
12416 detail: function (event) {
12417 return event.detail || 0;
12418 }
12419};
12420
12421/**
12422 * @param {object} dispatchConfig Configuration used to dispatch this event.
12423 * @param {string} dispatchMarker Marker identifying the event target.
12424 * @param {object} nativeEvent Native browser event.
12425 * @extends {SyntheticEvent}
12426 */
12427function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
12428 return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
12429}
12430
12431SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface);
12432
12433module.exports = SyntheticUIEvent;
12434},{"106":106,"84":84}],92:[function(_dereq_,module,exports){
12435/**
12436 * Copyright (c) 2013-present, Facebook, Inc.
12437 *
12438 * This source code is licensed under the MIT license found in the
12439 * LICENSE file in the root directory of this source tree.
12440 *
12441 */
12442
12443'use strict';
12444
12445var SyntheticMouseEvent = _dereq_(88);
12446
12447/**
12448 * @interface WheelEvent
12449 * @see http://www.w3.org/TR/DOM-Level-3-Events/
12450 */
12451var WheelEventInterface = {
12452 deltaX: function (event) {
12453 return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
12454 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
12455 },
12456 deltaY: function (event) {
12457 return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
12458 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
12459 'wheelDelta' in event ? -event.wheelDelta : 0;
12460 },
12461 deltaZ: null,
12462
12463 // Browsers without "deltaMode" is reporting in raw wheel delta where one
12464 // notch on the scroll is always +/- 120, roughly equivalent to pixels.
12465 // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
12466 // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
12467 deltaMode: null
12468};
12469
12470/**
12471 * @param {object} dispatchConfig Configuration used to dispatch this event.
12472 * @param {string} dispatchMarker Marker identifying the event target.
12473 * @param {object} nativeEvent Native browser event.
12474 * @extends {SyntheticMouseEvent}
12475 */
12476function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
12477 return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
12478}
12479
12480SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface);
12481
12482module.exports = SyntheticWheelEvent;
12483},{"88":88}],93:[function(_dereq_,module,exports){
12484/**
12485 * Copyright (c) 2013-present, Facebook, Inc.
12486 *
12487 * This source code is licensed under the MIT license found in the
12488 * LICENSE file in the root directory of this source tree.
12489 *
12490 *
12491 */
12492
12493'use strict';
12494
12495var _prodInvariant = _dereq_(116);
12496
12497var invariant = _dereq_(141);
12498
12499var OBSERVED_ERROR = {};
12500
12501/**
12502 * `Transaction` creates a black box that is able to wrap any method such that
12503 * certain invariants are maintained before and after the method is invoked
12504 * (Even if an exception is thrown while invoking the wrapped method). Whoever
12505 * instantiates a transaction can provide enforcers of the invariants at
12506 * creation time. The `Transaction` class itself will supply one additional
12507 * automatic invariant for you - the invariant that any transaction instance
12508 * should not be run while it is already being run. You would typically create a
12509 * single instance of a `Transaction` for reuse multiple times, that potentially
12510 * is used to wrap several different methods. Wrappers are extremely simple -
12511 * they only require implementing two methods.
12512 *
12513 * <pre>
12514 * wrappers (injected at creation time)
12515 * + +
12516 * | |
12517 * +-----------------|--------|--------------+
12518 * | v | |
12519 * | +---------------+ | |
12520 * | +--| wrapper1 |---|----+ |
12521 * | | +---------------+ v | |
12522 * | | +-------------+ | |
12523 * | | +----| wrapper2 |--------+ |
12524 * | | | +-------------+ | | |
12525 * | | | | | |
12526 * | v v v v | wrapper
12527 * | +---+ +---+ +---------+ +---+ +---+ | invariants
12528 * perform(anyMethod) | | | | | | | | | | | | maintained
12529 * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
12530 * | | | | | | | | | | | |
12531 * | | | | | | | | | | | |
12532 * | | | | | | | | | | | |
12533 * | +---+ +---+ +---------+ +---+ +---+ |
12534 * | initialize close |
12535 * +-----------------------------------------+
12536 * </pre>
12537 *
12538 * Use cases:
12539 * - Preserving the input selection ranges before/after reconciliation.
12540 * Restoring selection even in the event of an unexpected error.
12541 * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
12542 * while guaranteeing that afterwards, the event system is reactivated.
12543 * - Flushing a queue of collected DOM mutations to the main UI thread after a
12544 * reconciliation takes place in a worker thread.
12545 * - Invoking any collected `componentDidUpdate` callbacks after rendering new
12546 * content.
12547 * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
12548 * to preserve the `scrollTop` (an automatic scroll aware DOM).
12549 * - (Future use case): Layout calculations before and after DOM updates.
12550 *
12551 * Transactional plugin API:
12552 * - A module that has an `initialize` method that returns any precomputation.
12553 * - and a `close` method that accepts the precomputation. `close` is invoked
12554 * when the wrapped process is completed, or has failed.
12555 *
12556 * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
12557 * that implement `initialize` and `close`.
12558 * @return {Transaction} Single transaction for reuse in thread.
12559 *
12560 * @class Transaction
12561 */
12562var TransactionImpl = {
12563 /**
12564 * Sets up this instance so that it is prepared for collecting metrics. Does
12565 * so such that this setup method may be used on an instance that is already
12566 * initialized, in a way that does not consume additional memory upon reuse.
12567 * That can be useful if you decide to make your subclass of this mixin a
12568 * "PooledClass".
12569 */
12570 reinitializeTransaction: function () {
12571 this.transactionWrappers = this.getTransactionWrappers();
12572 if (this.wrapperInitData) {
12573 this.wrapperInitData.length = 0;
12574 } else {
12575 this.wrapperInitData = [];
12576 }
12577 this._isInTransaction = false;
12578 },
12579
12580 _isInTransaction: false,
12581
12582 /**
12583 * @abstract
12584 * @return {Array<TransactionWrapper>} Array of transaction wrappers.
12585 */
12586 getTransactionWrappers: null,
12587
12588 isInTransaction: function () {
12589 return !!this._isInTransaction;
12590 },
12591
12592 /* eslint-disable space-before-function-paren */
12593
12594 /**
12595 * Executes the function within a safety window. Use this for the top level
12596 * methods that result in large amounts of computation/mutations that would
12597 * need to be safety checked. The optional arguments helps prevent the need
12598 * to bind in many cases.
12599 *
12600 * @param {function} method Member of scope to call.
12601 * @param {Object} scope Scope to invoke from.
12602 * @param {Object?=} a Argument to pass to the method.
12603 * @param {Object?=} b Argument to pass to the method.
12604 * @param {Object?=} c Argument to pass to the method.
12605 * @param {Object?=} d Argument to pass to the method.
12606 * @param {Object?=} e Argument to pass to the method.
12607 * @param {Object?=} f Argument to pass to the method.
12608 *
12609 * @return {*} Return value from `method`.
12610 */
12611 perform: function (method, scope, a, b, c, d, e, f) {
12612 /* eslint-enable space-before-function-paren */
12613 !!this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0;
12614 var errorThrown;
12615 var ret;
12616 try {
12617 this._isInTransaction = true;
12618 // Catching errors makes debugging more difficult, so we start with
12619 // errorThrown set to true before setting it to false after calling
12620 // close -- if it's still set to true in the finally block, it means
12621 // one of these calls threw.
12622 errorThrown = true;
12623 this.initializeAll(0);
12624 ret = method.call(scope, a, b, c, d, e, f);
12625 errorThrown = false;
12626 } finally {
12627 try {
12628 if (errorThrown) {
12629 // If `method` throws, prefer to show that stack trace over any thrown
12630 // by invoking `closeAll`.
12631 try {
12632 this.closeAll(0);
12633 } catch (err) {}
12634 } else {
12635 // Since `method` didn't throw, we don't want to silence the exception
12636 // here.
12637 this.closeAll(0);
12638 }
12639 } finally {
12640 this._isInTransaction = false;
12641 }
12642 }
12643 return ret;
12644 },
12645
12646 initializeAll: function (startIndex) {
12647 var transactionWrappers = this.transactionWrappers;
12648 for (var i = startIndex; i < transactionWrappers.length; i++) {
12649 var wrapper = transactionWrappers[i];
12650 try {
12651 // Catching errors makes debugging more difficult, so we start with the
12652 // OBSERVED_ERROR state before overwriting it with the real return value
12653 // of initialize -- if it's still set to OBSERVED_ERROR in the finally
12654 // block, it means wrapper.initialize threw.
12655 this.wrapperInitData[i] = OBSERVED_ERROR;
12656 this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
12657 } finally {
12658 if (this.wrapperInitData[i] === OBSERVED_ERROR) {
12659 // The initializer for wrapper i threw an error; initialize the
12660 // remaining wrappers but silence any exceptions from them to ensure
12661 // that the first error is the one to bubble up.
12662 try {
12663 this.initializeAll(i + 1);
12664 } catch (err) {}
12665 }
12666 }
12667 }
12668 },
12669
12670 /**
12671 * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
12672 * them the respective return values of `this.transactionWrappers.init[i]`
12673 * (`close`rs that correspond to initializers that failed will not be
12674 * invoked).
12675 */
12676 closeAll: function (startIndex) {
12677 !this.isInTransaction() ? "development" !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0;
12678 var transactionWrappers = this.transactionWrappers;
12679 for (var i = startIndex; i < transactionWrappers.length; i++) {
12680 var wrapper = transactionWrappers[i];
12681 var initData = this.wrapperInitData[i];
12682 var errorThrown;
12683 try {
12684 // Catching errors makes debugging more difficult, so we start with
12685 // errorThrown set to true before setting it to false after calling
12686 // close -- if it's still set to true in the finally block, it means
12687 // wrapper.close threw.
12688 errorThrown = true;
12689 if (initData !== OBSERVED_ERROR && wrapper.close) {
12690 wrapper.close.call(this, initData);
12691 }
12692 errorThrown = false;
12693 } finally {
12694 if (errorThrown) {
12695 // The closer for wrapper i threw an error; close the remaining
12696 // wrappers but silence any exceptions from them to ensure that the
12697 // first error is the one to bubble up.
12698 try {
12699 this.closeAll(i + 1);
12700 } catch (e) {}
12701 }
12702 }
12703 }
12704 this.wrapperInitData.length = 0;
12705 }
12706};
12707
12708module.exports = TransactionImpl;
12709},{"116":116,"141":141}],94:[function(_dereq_,module,exports){
12710/**
12711 * Copyright (c) 2013-present, Facebook, Inc.
12712 *
12713 * This source code is licensed under the MIT license found in the
12714 * LICENSE file in the root directory of this source tree.
12715 *
12716 */
12717
12718'use strict';
12719
12720var ViewportMetrics = {
12721 currentScrollLeft: 0,
12722
12723 currentScrollTop: 0,
12724
12725 refreshScrollValues: function (scrollPosition) {
12726 ViewportMetrics.currentScrollLeft = scrollPosition.x;
12727 ViewportMetrics.currentScrollTop = scrollPosition.y;
12728 }
12729};
12730
12731module.exports = ViewportMetrics;
12732},{}],95:[function(_dereq_,module,exports){
12733/**
12734 * Copyright (c) 2014-present, Facebook, Inc.
12735 *
12736 * This source code is licensed under the MIT license found in the
12737 * LICENSE file in the root directory of this source tree.
12738 *
12739 *
12740 */
12741
12742'use strict';
12743
12744var _prodInvariant = _dereq_(116);
12745
12746var invariant = _dereq_(141);
12747
12748/**
12749 * Accumulates items that must not be null or undefined into the first one. This
12750 * is used to conserve memory by avoiding array allocations, and thus sacrifices
12751 * API cleanness. Since `current` can be null before being passed in and not
12752 * null after this function, make sure to assign it back to `current`:
12753 *
12754 * `a = accumulateInto(a, b);`
12755 *
12756 * This API should be sparingly used. Try `accumulate` for something cleaner.
12757 *
12758 * @return {*|array<*>} An accumulation of items.
12759 */
12760
12761function accumulateInto(current, next) {
12762 !(next != null) ? "development" !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0;
12763
12764 if (current == null) {
12765 return next;
12766 }
12767
12768 // Both are not empty. Warning: Never call x.concat(y) when you are not
12769 // certain that x is an Array (x could be a string with concat method).
12770 if (Array.isArray(current)) {
12771 if (Array.isArray(next)) {
12772 current.push.apply(current, next);
12773 return current;
12774 }
12775 current.push(next);
12776 return current;
12777 }
12778
12779 if (Array.isArray(next)) {
12780 // A bit too dangerous to mutate `next`.
12781 return [current].concat(next);
12782 }
12783
12784 return [current, next];
12785}
12786
12787module.exports = accumulateInto;
12788},{"116":116,"141":141}],96:[function(_dereq_,module,exports){
12789/**
12790 * Copyright (c) 2013-present, Facebook, Inc.
12791 *
12792 * This source code is licensed under the MIT license found in the
12793 * LICENSE file in the root directory of this source tree.
12794 *
12795 *
12796 */
12797
12798'use strict';
12799
12800var MOD = 65521;
12801
12802// adler32 is not cryptographically strong, and is only used to sanity check that
12803// markup generated on the server matches the markup generated on the client.
12804// This implementation (a modified version of the SheetJS version) has been optimized
12805// for our use case, at the expense of conforming to the adler32 specification
12806// for non-ascii inputs.
12807function adler32(data) {
12808 var a = 1;
12809 var b = 0;
12810 var i = 0;
12811 var l = data.length;
12812 var m = l & ~0x3;
12813 while (i < m) {
12814 var n = Math.min(i + 4096, m);
12815 for (; i < n; i += 4) {
12816 b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));
12817 }
12818 a %= MOD;
12819 b %= MOD;
12820 }
12821 for (; i < l; i++) {
12822 b += a += data.charCodeAt(i);
12823 }
12824 a %= MOD;
12825 b %= MOD;
12826 return a | b << 16;
12827}
12828
12829module.exports = adler32;
12830},{}],97:[function(_dereq_,module,exports){
12831(function (process){
12832/**
12833 * Copyright (c) 2013-present, Facebook, Inc.
12834 *
12835 * This source code is licensed under the MIT license found in the
12836 * LICENSE file in the root directory of this source tree.
12837 *
12838 */
12839
12840'use strict';
12841
12842var _prodInvariant = _dereq_(116);
12843
12844var ReactPropTypeLocationNames = _dereq_(65);
12845var ReactPropTypesSecret = _dereq_(66);
12846
12847var invariant = _dereq_(141);
12848var warning = _dereq_(148);
12849
12850var ReactComponentTreeHook;
12851
12852if (typeof process !== 'undefined' && process.env && "development" === 'test') {
12853 // Temporary hack.
12854 // Inline requires don't work well with Jest:
12855 // https://github.com/facebook/react/issues/7240
12856 // Remove the inline requires when we don't need them anymore:
12857 // https://github.com/facebook/react/pull/7178
12858 ReactComponentTreeHook = _dereq_(122);
12859}
12860
12861var loggedTypeFailures = {};
12862
12863/**
12864 * Assert that the values match with the type specs.
12865 * Error messages are memorized and will only be shown once.
12866 *
12867 * @param {object} typeSpecs Map of name to a ReactPropType
12868 * @param {object} values Runtime values that need to be type-checked
12869 * @param {string} location e.g. "prop", "context", "child context"
12870 * @param {string} componentName Name of the component for error messages.
12871 * @param {?object} element The React element that is being type-checked
12872 * @param {?number} debugID The React component instance that is being type-checked
12873 * @private
12874 */
12875function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) {
12876 for (var typeSpecName in typeSpecs) {
12877 if (typeSpecs.hasOwnProperty(typeSpecName)) {
12878 var error;
12879 // Prop type validation may throw. In case they do, we don't want to
12880 // fail the render phase where it didn't fail before. So we log it.
12881 // After these have been cleaned up, we'll let them throw.
12882 try {
12883 // This is intentionally an invariant that gets caught. It's the same
12884 // behavior as without this statement except with a better message.
12885 !(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;
12886 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
12887 } catch (ex) {
12888 error = ex;
12889 }
12890 "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;
12891 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
12892 // Only monitor this failure once because there tends to be a lot of the
12893 // same error.
12894 loggedTypeFailures[error.message] = true;
12895
12896 var componentStackInfo = '';
12897
12898 if ("development" !== 'production') {
12899 if (!ReactComponentTreeHook) {
12900 ReactComponentTreeHook = _dereq_(122);
12901 }
12902 if (debugID !== null) {
12903 componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID);
12904 } else if (element !== null) {
12905 componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element);
12906 }
12907 }
12908
12909 "development" !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0;
12910 }
12911 }
12912 }
12913}
12914
12915module.exports = checkReactTypeSpec;
12916}).call(this,undefined)
12917},{"116":116,"122":122,"141":141,"148":148,"65":65,"66":66}],98:[function(_dereq_,module,exports){
12918/**
12919 * Copyright (c) 2013-present, Facebook, Inc.
12920 *
12921 * This source code is licensed under the MIT license found in the
12922 * LICENSE file in the root directory of this source tree.
12923 *
12924 */
12925
12926/* globals MSApp */
12927
12928'use strict';
12929
12930/**
12931 * Create a function which has 'unsafe' privileges (required by windows8 apps)
12932 */
12933
12934var createMicrosoftUnsafeLocalFunction = function (func) {
12935 if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
12936 return function (arg0, arg1, arg2, arg3) {
12937 MSApp.execUnsafeLocalFunction(function () {
12938 return func(arg0, arg1, arg2, arg3);
12939 });
12940 };
12941 } else {
12942 return func;
12943 }
12944};
12945
12946module.exports = createMicrosoftUnsafeLocalFunction;
12947},{}],99:[function(_dereq_,module,exports){
12948/**
12949 * Copyright (c) 2013-present, Facebook, Inc.
12950 *
12951 * This source code is licensed under the MIT license found in the
12952 * LICENSE file in the root directory of this source tree.
12953 *
12954 */
12955
12956'use strict';
12957
12958var CSSProperty = _dereq_(4);
12959var warning = _dereq_(148);
12960
12961var isUnitlessNumber = CSSProperty.isUnitlessNumber;
12962var styleWarnings = {};
12963
12964/**
12965 * Convert a value into the proper css writable value. The style name `name`
12966 * should be logical (no hyphens), as specified
12967 * in `CSSProperty.isUnitlessNumber`.
12968 *
12969 * @param {string} name CSS property name such as `topMargin`.
12970 * @param {*} value CSS property value such as `10px`.
12971 * @param {ReactDOMComponent} component
12972 * @return {string} Normalized style value with dimensions applied.
12973 */
12974function dangerousStyleValue(name, value, component, isCustomProperty) {
12975 // Note that we've removed escapeTextForBrowser() calls here since the
12976 // whole string will be escaped when the attribute is injected into
12977 // the markup. If you provide unsafe user data here they can inject
12978 // arbitrary CSS which may be problematic (I couldn't repro this):
12979 // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
12980 // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
12981 // This is not an XSS hole but instead a potential CSS injection issue
12982 // which has lead to a greater discussion about how we're going to
12983 // trust URLs moving forward. See #2115901
12984
12985 var isEmpty = value == null || typeof value === 'boolean' || value === '';
12986 if (isEmpty) {
12987 return '';
12988 }
12989
12990 var isNonNumeric = isNaN(value);
12991 if (isCustomProperty || isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) {
12992 return '' + value; // cast to string
12993 }
12994
12995 if (typeof value === 'string') {
12996 if ("development" !== 'production') {
12997 // Allow '0' to pass through without warning. 0 is already special and
12998 // doesn't require units, so we don't need to warn about it.
12999 if (component && value !== '0') {
13000 var owner = component._currentElement._owner;
13001 var ownerName = owner ? owner.getName() : null;
13002 if (ownerName && !styleWarnings[ownerName]) {
13003 styleWarnings[ownerName] = {};
13004 }
13005 var warned = false;
13006 if (ownerName) {
13007 var warnings = styleWarnings[ownerName];
13008 warned = warnings[name];
13009 if (!warned) {
13010 warnings[name] = true;
13011 }
13012 }
13013 if (!warned) {
13014 "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;
13015 }
13016 }
13017 }
13018 value = value.trim();
13019 }
13020 return value + 'px';
13021}
13022
13023module.exports = dangerousStyleValue;
13024},{"148":148,"4":4}],100:[function(_dereq_,module,exports){
13025/**
13026 * Copyright (c) 2016-present, Facebook, Inc.
13027 *
13028 * This source code is licensed under the MIT license found in the
13029 * LICENSE file in the root directory of this source tree.
13030 *
13031 * Based on the escape-html library, which is used under the MIT License below:
13032 *
13033 * Copyright (c) 2012-2013 TJ Holowaychuk
13034 * Copyright (c) 2015 Andreas Lubbe
13035 * Copyright (c) 2015 Tiancheng "Timothy" Gu
13036 *
13037 * Permission is hereby granted, free of charge, to any person obtaining
13038 * a copy of this software and associated documentation files (the
13039 * 'Software'), to deal in the Software without restriction, including
13040 * without limitation the rights to use, copy, modify, merge, publish,
13041 * distribute, sublicense, and/or sell copies of the Software, and to
13042 * permit persons to whom the Software is furnished to do so, subject to
13043 * the following conditions:
13044 *
13045 * The above copyright notice and this permission notice shall be
13046 * included in all copies or substantial portions of the Software.
13047 *
13048 * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
13049 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
13050 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
13051 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
13052 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
13053 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
13054 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13055 *
13056 */
13057
13058'use strict';
13059
13060// code copied and modified from escape-html
13061/**
13062 * Module variables.
13063 * @private
13064 */
13065
13066var matchHtmlRegExp = /["'&<>]/;
13067
13068/**
13069 * Escape special characters in the given string of html.
13070 *
13071 * @param {string} string The string to escape for inserting into HTML
13072 * @return {string}
13073 * @public
13074 */
13075
13076function escapeHtml(string) {
13077 var str = '' + string;
13078 var match = matchHtmlRegExp.exec(str);
13079
13080 if (!match) {
13081 return str;
13082 }
13083
13084 var escape;
13085 var html = '';
13086 var index = 0;
13087 var lastIndex = 0;
13088
13089 for (index = match.index; index < str.length; index++) {
13090 switch (str.charCodeAt(index)) {
13091 case 34:
13092 // "
13093 escape = '&quot;';
13094 break;
13095 case 38:
13096 // &
13097 escape = '&amp;';
13098 break;
13099 case 39:
13100 // '
13101 escape = '&#x27;'; // modified from escape-html; used to be '&#39'
13102 break;
13103 case 60:
13104 // <
13105 escape = '&lt;';
13106 break;
13107 case 62:
13108 // >
13109 escape = '&gt;';
13110 break;
13111 default:
13112 continue;
13113 }
13114
13115 if (lastIndex !== index) {
13116 html += str.substring(lastIndex, index);
13117 }
13118
13119 lastIndex = index + 1;
13120 html += escape;
13121 }
13122
13123 return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
13124}
13125// end code copied and modified from escape-html
13126
13127/**
13128 * Escapes text to prevent scripting attacks.
13129 *
13130 * @param {*} text Text value to escape.
13131 * @return {string} An escaped string.
13132 */
13133function escapeTextContentForBrowser(text) {
13134 if (typeof text === 'boolean' || typeof text === 'number') {
13135 // this shortcircuit helps perf for types that we know will never have
13136 // special characters, especially given that this function is used often
13137 // for numeric dom ids.
13138 return '' + text;
13139 }
13140 return escapeHtml(text);
13141}
13142
13143module.exports = escapeTextContentForBrowser;
13144},{}],101:[function(_dereq_,module,exports){
13145(function (process){
13146/**
13147 * Copyright (c) 2013-present, Facebook, Inc.
13148 *
13149 * This source code is licensed under the MIT license found in the
13150 * LICENSE file in the root directory of this source tree.
13151 *
13152 *
13153 */
13154
13155'use strict';
13156
13157var KeyEscapeUtils = _dereq_(22);
13158var traverseAllChildren = _dereq_(120);
13159var warning = _dereq_(148);
13160
13161var ReactComponentTreeHook;
13162
13163if (typeof process !== 'undefined' && process.env && "development" === 'test') {
13164 // Temporary hack.
13165 // Inline requires don't work well with Jest:
13166 // https://github.com/facebook/react/issues/7240
13167 // Remove the inline requires when we don't need them anymore:
13168 // https://github.com/facebook/react/pull/7178
13169 ReactComponentTreeHook = _dereq_(122);
13170}
13171
13172/**
13173 * @param {function} traverseContext Context passed through traversal.
13174 * @param {?ReactComponent} child React child component.
13175 * @param {!string} name String name of key path to child.
13176 * @param {number=} selfDebugID Optional debugID of the current internal instance.
13177 */
13178function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) {
13179 // We found a component instance.
13180 if (traverseContext && typeof traverseContext === 'object') {
13181 var result = traverseContext;
13182 var keyUnique = result[name] === undefined;
13183 if ("development" !== 'production') {
13184 if (!ReactComponentTreeHook) {
13185 ReactComponentTreeHook = _dereq_(122);
13186 }
13187 if (!keyUnique) {
13188 "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;
13189 }
13190 }
13191 if (keyUnique && child != null) {
13192 result[name] = child;
13193 }
13194 }
13195}
13196
13197/**
13198 * Flattens children that are typically specified as `props.children`. Any null
13199 * children will not be included in the resulting object.
13200 * @return {!object} flattened children keyed by name.
13201 */
13202function flattenChildren(children, selfDebugID) {
13203 if (children == null) {
13204 return children;
13205 }
13206 var result = {};
13207
13208 if ("development" !== 'production') {
13209 traverseAllChildren(children, function (traverseContext, child, name) {
13210 return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID);
13211 }, result);
13212 } else {
13213 traverseAllChildren(children, flattenSingleChildIntoContext, result);
13214 }
13215 return result;
13216}
13217
13218module.exports = flattenChildren;
13219}).call(this,undefined)
13220},{"120":120,"122":122,"148":148,"22":22}],102:[function(_dereq_,module,exports){
13221/**
13222 * Copyright (c) 2013-present, Facebook, Inc.
13223 *
13224 * This source code is licensed under the MIT license found in the
13225 * LICENSE file in the root directory of this source tree.
13226 *
13227 *
13228 */
13229
13230'use strict';
13231
13232/**
13233 * @param {array} arr an "accumulation" of items which is either an Array or
13234 * a single item. Useful when paired with the `accumulate` module. This is a
13235 * simple utility that allows us to reason about a collection of items, but
13236 * handling the case when there is exactly one item (and we do not need to
13237 * allocate an array).
13238 */
13239
13240function forEachAccumulated(arr, cb, scope) {
13241 if (Array.isArray(arr)) {
13242 arr.forEach(cb, scope);
13243 } else if (arr) {
13244 cb.call(scope, arr);
13245 }
13246}
13247
13248module.exports = forEachAccumulated;
13249},{}],103:[function(_dereq_,module,exports){
13250/**
13251 * Copyright (c) 2013-present, Facebook, Inc.
13252 *
13253 * This source code is licensed under the MIT license found in the
13254 * LICENSE file in the root directory of this source tree.
13255 *
13256 */
13257
13258'use strict';
13259
13260/**
13261 * `charCode` represents the actual "character code" and is safe to use with
13262 * `String.fromCharCode`. As such, only keys that correspond to printable
13263 * characters produce a valid `charCode`, the only exception to this is Enter.
13264 * The Tab-key is considered non-printable and does not have a `charCode`,
13265 * presumably because it does not produce a tab-character in browsers.
13266 *
13267 * @param {object} nativeEvent Native browser event.
13268 * @return {number} Normalized `charCode` property.
13269 */
13270
13271function getEventCharCode(nativeEvent) {
13272 var charCode;
13273 var keyCode = nativeEvent.keyCode;
13274
13275 if ('charCode' in nativeEvent) {
13276 charCode = nativeEvent.charCode;
13277
13278 // FF does not set `charCode` for the Enter-key, check against `keyCode`.
13279 if (charCode === 0 && keyCode === 13) {
13280 charCode = 13;
13281 }
13282 } else {
13283 // IE8 does not implement `charCode`, but `keyCode` has the correct value.
13284 charCode = keyCode;
13285 }
13286
13287 // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
13288 // Must not discard the (non-)printable Enter-key.
13289 if (charCode >= 32 || charCode === 13) {
13290 return charCode;
13291 }
13292
13293 return 0;
13294}
13295
13296module.exports = getEventCharCode;
13297},{}],104:[function(_dereq_,module,exports){
13298/**
13299 * Copyright (c) 2013-present, Facebook, Inc.
13300 *
13301 * This source code is licensed under the MIT license found in the
13302 * LICENSE file in the root directory of this source tree.
13303 *
13304 */
13305
13306'use strict';
13307
13308var getEventCharCode = _dereq_(103);
13309
13310/**
13311 * Normalization of deprecated HTML5 `key` values
13312 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
13313 */
13314var normalizeKey = {
13315 Esc: 'Escape',
13316 Spacebar: ' ',
13317 Left: 'ArrowLeft',
13318 Up: 'ArrowUp',
13319 Right: 'ArrowRight',
13320 Down: 'ArrowDown',
13321 Del: 'Delete',
13322 Win: 'OS',
13323 Menu: 'ContextMenu',
13324 Apps: 'ContextMenu',
13325 Scroll: 'ScrollLock',
13326 MozPrintableKey: 'Unidentified'
13327};
13328
13329/**
13330 * Translation from legacy `keyCode` to HTML5 `key`
13331 * Only special keys supported, all others depend on keyboard layout or browser
13332 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
13333 */
13334var translateToKey = {
13335 8: 'Backspace',
13336 9: 'Tab',
13337 12: 'Clear',
13338 13: 'Enter',
13339 16: 'Shift',
13340 17: 'Control',
13341 18: 'Alt',
13342 19: 'Pause',
13343 20: 'CapsLock',
13344 27: 'Escape',
13345 32: ' ',
13346 33: 'PageUp',
13347 34: 'PageDown',
13348 35: 'End',
13349 36: 'Home',
13350 37: 'ArrowLeft',
13351 38: 'ArrowUp',
13352 39: 'ArrowRight',
13353 40: 'ArrowDown',
13354 45: 'Insert',
13355 46: 'Delete',
13356 112: 'F1',
13357 113: 'F2',
13358 114: 'F3',
13359 115: 'F4',
13360 116: 'F5',
13361 117: 'F6',
13362 118: 'F7',
13363 119: 'F8',
13364 120: 'F9',
13365 121: 'F10',
13366 122: 'F11',
13367 123: 'F12',
13368 144: 'NumLock',
13369 145: 'ScrollLock',
13370 224: 'Meta'
13371};
13372
13373/**
13374 * @param {object} nativeEvent Native browser event.
13375 * @return {string} Normalized `key` property.
13376 */
13377function getEventKey(nativeEvent) {
13378 if (nativeEvent.key) {
13379 // Normalize inconsistent values reported by browsers due to
13380 // implementations of a working draft specification.
13381
13382 // FireFox implements `key` but returns `MozPrintableKey` for all
13383 // printable characters (normalized to `Unidentified`), ignore it.
13384 var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
13385 if (key !== 'Unidentified') {
13386 return key;
13387 }
13388 }
13389
13390 // Browser does not implement `key`, polyfill as much of it as we can.
13391 if (nativeEvent.type === 'keypress') {
13392 var charCode = getEventCharCode(nativeEvent);
13393
13394 // The enter-key is technically both printable and non-printable and can
13395 // thus be captured by `keypress`, no other non-printable key should.
13396 return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
13397 }
13398 if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
13399 // While user keyboard layout determines the actual meaning of each
13400 // `keyCode` value, almost all function keys have a universal value.
13401 return translateToKey[nativeEvent.keyCode] || 'Unidentified';
13402 }
13403 return '';
13404}
13405
13406module.exports = getEventKey;
13407},{"103":103}],105:[function(_dereq_,module,exports){
13408/**
13409 * Copyright (c) 2013-present, Facebook, Inc.
13410 *
13411 * This source code is licensed under the MIT license found in the
13412 * LICENSE file in the root directory of this source tree.
13413 *
13414 */
13415
13416'use strict';
13417
13418/**
13419 * Translation from modifier key to the associated property in the event.
13420 * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
13421 */
13422
13423var modifierKeyToProp = {
13424 Alt: 'altKey',
13425 Control: 'ctrlKey',
13426 Meta: 'metaKey',
13427 Shift: 'shiftKey'
13428};
13429
13430// IE8 does not implement getModifierState so we simply map it to the only
13431// modifier keys exposed by the event itself, does not support Lock-keys.
13432// Currently, all major browsers except Chrome seems to support Lock-keys.
13433function modifierStateGetter(keyArg) {
13434 var syntheticEvent = this;
13435 var nativeEvent = syntheticEvent.nativeEvent;
13436 if (nativeEvent.getModifierState) {
13437 return nativeEvent.getModifierState(keyArg);
13438 }
13439 var keyProp = modifierKeyToProp[keyArg];
13440 return keyProp ? !!nativeEvent[keyProp] : false;
13441}
13442
13443function getEventModifierState(nativeEvent) {
13444 return modifierStateGetter;
13445}
13446
13447module.exports = getEventModifierState;
13448},{}],106:[function(_dereq_,module,exports){
13449/**
13450 * Copyright (c) 2013-present, Facebook, Inc.
13451 *
13452 * This source code is licensed under the MIT license found in the
13453 * LICENSE file in the root directory of this source tree.
13454 *
13455 */
13456
13457'use strict';
13458
13459/**
13460 * Gets the target node from a native browser event by accounting for
13461 * inconsistencies in browser DOM APIs.
13462 *
13463 * @param {object} nativeEvent Native browser event.
13464 * @return {DOMEventTarget} Target node.
13465 */
13466
13467function getEventTarget(nativeEvent) {
13468 var target = nativeEvent.target || nativeEvent.srcElement || window;
13469
13470 // Normalize SVG <use> element events #4963
13471 if (target.correspondingUseElement) {
13472 target = target.correspondingUseElement;
13473 }
13474
13475 // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
13476 // @see http://www.quirksmode.org/js/events_properties.html
13477 return target.nodeType === 3 ? target.parentNode : target;
13478}
13479
13480module.exports = getEventTarget;
13481},{}],107:[function(_dereq_,module,exports){
13482/**
13483 * Copyright (c) 2013-present, Facebook, Inc.
13484 *
13485 * This source code is licensed under the MIT license found in the
13486 * LICENSE file in the root directory of this source tree.
13487 *
13488 *
13489 */
13490
13491'use strict';
13492
13493/* global Symbol */
13494
13495var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
13496var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
13497
13498/**
13499 * Returns the iterator method function contained on the iterable object.
13500 *
13501 * Be sure to invoke the function with the iterable as context:
13502 *
13503 * var iteratorFn = getIteratorFn(myIterable);
13504 * if (iteratorFn) {
13505 * var iterator = iteratorFn.call(myIterable);
13506 * ...
13507 * }
13508 *
13509 * @param {?object} maybeIterable
13510 * @return {?function}
13511 */
13512function getIteratorFn(maybeIterable) {
13513 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
13514 if (typeof iteratorFn === 'function') {
13515 return iteratorFn;
13516 }
13517}
13518
13519module.exports = getIteratorFn;
13520},{}],108:[function(_dereq_,module,exports){
13521/**
13522 * Copyright (c) 2013-present, Facebook, Inc.
13523 *
13524 * This source code is licensed under the MIT license found in the
13525 * LICENSE file in the root directory of this source tree.
13526 *
13527 */
13528
13529'use strict';
13530
13531/**
13532 * Given any node return the first leaf node without children.
13533 *
13534 * @param {DOMElement|DOMTextNode} node
13535 * @return {DOMElement|DOMTextNode}
13536 */
13537
13538function getLeafNode(node) {
13539 while (node && node.firstChild) {
13540 node = node.firstChild;
13541 }
13542 return node;
13543}
13544
13545/**
13546 * Get the next sibling within a container. This will walk up the
13547 * DOM if a node's siblings have been exhausted.
13548 *
13549 * @param {DOMElement|DOMTextNode} node
13550 * @return {?DOMElement|DOMTextNode}
13551 */
13552function getSiblingNode(node) {
13553 while (node) {
13554 if (node.nextSibling) {
13555 return node.nextSibling;
13556 }
13557 node = node.parentNode;
13558 }
13559}
13560
13561/**
13562 * Get object describing the nodes which contain characters at offset.
13563 *
13564 * @param {DOMElement|DOMTextNode} root
13565 * @param {number} offset
13566 * @return {?object}
13567 */
13568function getNodeForCharacterOffset(root, offset) {
13569 var node = getLeafNode(root);
13570 var nodeStart = 0;
13571 var nodeEnd = 0;
13572
13573 while (node) {
13574 if (node.nodeType === 3) {
13575 nodeEnd = nodeStart + node.textContent.length;
13576
13577 if (nodeStart <= offset && nodeEnd >= offset) {
13578 return {
13579 node: node,
13580 offset: offset - nodeStart
13581 };
13582 }
13583
13584 nodeStart = nodeEnd;
13585 }
13586
13587 node = getLeafNode(getSiblingNode(node));
13588 }
13589}
13590
13591module.exports = getNodeForCharacterOffset;
13592},{}],109:[function(_dereq_,module,exports){
13593/**
13594 * Copyright (c) 2013-present, Facebook, Inc.
13595 *
13596 * This source code is licensed under the MIT license found in the
13597 * LICENSE file in the root directory of this source tree.
13598 *
13599 */
13600
13601'use strict';
13602
13603var ExecutionEnvironment = _dereq_(127);
13604
13605var contentKey = null;
13606
13607/**
13608 * Gets the key used to access text content on a DOM node.
13609 *
13610 * @return {?string} Key used to access text content.
13611 * @internal
13612 */
13613function getTextContentAccessor() {
13614 if (!contentKey && ExecutionEnvironment.canUseDOM) {
13615 // Prefer textContent to innerText because many browsers support both but
13616 // SVG <text> elements don't support innerText even when <div> does.
13617 contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
13618 }
13619 return contentKey;
13620}
13621
13622module.exports = getTextContentAccessor;
13623},{"127":127}],110:[function(_dereq_,module,exports){
13624/**
13625 * Copyright (c) 2013-present, Facebook, Inc.
13626 *
13627 * This source code is licensed under the MIT license found in the
13628 * LICENSE file in the root directory of this source tree.
13629 *
13630 */
13631
13632'use strict';
13633
13634var ExecutionEnvironment = _dereq_(127);
13635
13636/**
13637 * Generate a mapping of standard vendor prefixes using the defined style property and event name.
13638 *
13639 * @param {string} styleProp
13640 * @param {string} eventName
13641 * @returns {object}
13642 */
13643function makePrefixMap(styleProp, eventName) {
13644 var prefixes = {};
13645
13646 prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
13647 prefixes['Webkit' + styleProp] = 'webkit' + eventName;
13648 prefixes['Moz' + styleProp] = 'moz' + eventName;
13649 prefixes['ms' + styleProp] = 'MS' + eventName;
13650 prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
13651
13652 return prefixes;
13653}
13654
13655/**
13656 * A list of event names to a configurable list of vendor prefixes.
13657 */
13658var vendorPrefixes = {
13659 animationend: makePrefixMap('Animation', 'AnimationEnd'),
13660 animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
13661 animationstart: makePrefixMap('Animation', 'AnimationStart'),
13662 transitionend: makePrefixMap('Transition', 'TransitionEnd')
13663};
13664
13665/**
13666 * Event names that have already been detected and prefixed (if applicable).
13667 */
13668var prefixedEventNames = {};
13669
13670/**
13671 * Element to check for prefixes on.
13672 */
13673var style = {};
13674
13675/**
13676 * Bootstrap if a DOM exists.
13677 */
13678if (ExecutionEnvironment.canUseDOM) {
13679 style = document.createElement('div').style;
13680
13681 // On some platforms, in particular some releases of Android 4.x,
13682 // the un-prefixed "animation" and "transition" properties are defined on the
13683 // style object but the events that fire will still be prefixed, so we need
13684 // to check if the un-prefixed events are usable, and if not remove them from the map.
13685 if (!('AnimationEvent' in window)) {
13686 delete vendorPrefixes.animationend.animation;
13687 delete vendorPrefixes.animationiteration.animation;
13688 delete vendorPrefixes.animationstart.animation;
13689 }
13690
13691 // Same as above
13692 if (!('TransitionEvent' in window)) {
13693 delete vendorPrefixes.transitionend.transition;
13694 }
13695}
13696
13697/**
13698 * Attempts to determine the correct vendor prefixed event name.
13699 *
13700 * @param {string} eventName
13701 * @returns {string}
13702 */
13703function getVendorPrefixedEventName(eventName) {
13704 if (prefixedEventNames[eventName]) {
13705 return prefixedEventNames[eventName];
13706 } else if (!vendorPrefixes[eventName]) {
13707 return eventName;
13708 }
13709
13710 var prefixMap = vendorPrefixes[eventName];
13711
13712 for (var styleProp in prefixMap) {
13713 if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
13714 return prefixedEventNames[eventName] = prefixMap[styleProp];
13715 }
13716 }
13717
13718 return '';
13719}
13720
13721module.exports = getVendorPrefixedEventName;
13722},{"127":127}],111:[function(_dereq_,module,exports){
13723/**
13724 * Copyright (c) 2013-present, Facebook, Inc.
13725 *
13726 * This source code is licensed under the MIT license found in the
13727 * LICENSE file in the root directory of this source tree.
13728 *
13729 */
13730
13731'use strict';
13732
13733var ReactDOMComponentTree = _dereq_(32);
13734
13735function isCheckable(elem) {
13736 var type = elem.type;
13737 var nodeName = elem.nodeName;
13738 return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
13739}
13740
13741function getTracker(inst) {
13742 return inst._wrapperState.valueTracker;
13743}
13744
13745function attachTracker(inst, tracker) {
13746 inst._wrapperState.valueTracker = tracker;
13747}
13748
13749function detachTracker(inst) {
13750 inst._wrapperState.valueTracker = null;
13751}
13752
13753function getValueFromNode(node) {
13754 var value;
13755 if (node) {
13756 value = isCheckable(node) ? '' + node.checked : node.value;
13757 }
13758 return value;
13759}
13760
13761var inputValueTracking = {
13762 // exposed for testing
13763 _getTrackerFromNode: function (node) {
13764 return getTracker(ReactDOMComponentTree.getInstanceFromNode(node));
13765 },
13766
13767
13768 track: function (inst) {
13769 if (getTracker(inst)) {
13770 return;
13771 }
13772
13773 var node = ReactDOMComponentTree.getNodeFromInstance(inst);
13774 var valueField = isCheckable(node) ? 'checked' : 'value';
13775 var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
13776
13777 var currentValue = '' + node[valueField];
13778
13779 // if someone has already defined a value or Safari, then bail
13780 // and don't track value will cause over reporting of changes,
13781 // but it's better then a hard failure
13782 // (needed for certain tests that spyOn input values and Safari)
13783 if (node.hasOwnProperty(valueField) || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
13784 return;
13785 }
13786
13787 Object.defineProperty(node, valueField, {
13788 enumerable: descriptor.enumerable,
13789 configurable: true,
13790 get: function () {
13791 return descriptor.get.call(this);
13792 },
13793 set: function (value) {
13794 currentValue = '' + value;
13795 descriptor.set.call(this, value);
13796 }
13797 });
13798
13799 attachTracker(inst, {
13800 getValue: function () {
13801 return currentValue;
13802 },
13803 setValue: function (value) {
13804 currentValue = '' + value;
13805 },
13806 stopTracking: function () {
13807 detachTracker(inst);
13808 delete node[valueField];
13809 }
13810 });
13811 },
13812
13813 updateValueIfChanged: function (inst) {
13814 if (!inst) {
13815 return false;
13816 }
13817 var tracker = getTracker(inst);
13818
13819 if (!tracker) {
13820 inputValueTracking.track(inst);
13821 return true;
13822 }
13823
13824 var lastValue = tracker.getValue();
13825 var nextValue = getValueFromNode(ReactDOMComponentTree.getNodeFromInstance(inst));
13826
13827 if (nextValue !== lastValue) {
13828 tracker.setValue(nextValue);
13829 return true;
13830 }
13831
13832 return false;
13833 },
13834 stopTracking: function (inst) {
13835 var tracker = getTracker(inst);
13836 if (tracker) {
13837 tracker.stopTracking();
13838 }
13839 }
13840};
13841
13842module.exports = inputValueTracking;
13843},{"32":32}],112:[function(_dereq_,module,exports){
13844/**
13845 * Copyright (c) 2013-present, Facebook, Inc.
13846 *
13847 * This source code is licensed under the MIT license found in the
13848 * LICENSE file in the root directory of this source tree.
13849 *
13850 */
13851
13852'use strict';
13853
13854var _prodInvariant = _dereq_(116),
13855 _assign = _dereq_(149);
13856
13857var ReactCompositeComponent = _dereq_(29);
13858var ReactEmptyComponent = _dereq_(49);
13859var ReactHostComponent = _dereq_(54);
13860
13861var getNextDebugID = _dereq_(125);
13862var invariant = _dereq_(141);
13863var warning = _dereq_(148);
13864
13865// To avoid a cyclic dependency, we create the final class in this module
13866var ReactCompositeComponentWrapper = function (element) {
13867 this.construct(element);
13868};
13869
13870function getDeclarationErrorAddendum(owner) {
13871 if (owner) {
13872 var name = owner.getName();
13873 if (name) {
13874 return ' Check the render method of `' + name + '`.';
13875 }
13876 }
13877 return '';
13878}
13879
13880/**
13881 * Check if the type reference is a known internal type. I.e. not a user
13882 * provided composite type.
13883 *
13884 * @param {function} type
13885 * @return {boolean} Returns true if this is a valid internal type.
13886 */
13887function isInternalComponentType(type) {
13888 return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
13889}
13890
13891/**
13892 * Given a ReactNode, create an instance that will actually be mounted.
13893 *
13894 * @param {ReactNode} node
13895 * @param {boolean} shouldHaveDebugID
13896 * @return {object} A new instance of the element's constructor.
13897 * @protected
13898 */
13899function instantiateReactComponent(node, shouldHaveDebugID) {
13900 var instance;
13901
13902 if (node === null || node === false) {
13903 instance = ReactEmptyComponent.create(instantiateReactComponent);
13904 } else if (typeof node === 'object') {
13905 var element = node;
13906 var type = element.type;
13907 if (typeof type !== 'function' && typeof type !== 'string') {
13908 var info = '';
13909 if ("development" !== 'production') {
13910 if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
13911 info += ' You likely forgot to export your component from the file ' + "it's defined in.";
13912 }
13913 }
13914 info += getDeclarationErrorAddendum(element._owner);
13915 !false ? "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', type == null ? type : typeof type, info) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0;
13916 }
13917
13918 // Special case string values
13919 if (typeof element.type === 'string') {
13920 instance = ReactHostComponent.createInternalComponent(element);
13921 } else if (isInternalComponentType(element.type)) {
13922 // This is temporarily available for custom components that are not string
13923 // representations. I.e. ART. Once those are updated to use the string
13924 // representation, we can drop this code path.
13925 instance = new element.type(element);
13926
13927 // We renamed this. Allow the old name for compat. :(
13928 if (!instance.getHostNode) {
13929 instance.getHostNode = instance.getNativeNode;
13930 }
13931 } else {
13932 instance = new ReactCompositeComponentWrapper(element);
13933 }
13934 } else if (typeof node === 'string' || typeof node === 'number') {
13935 instance = ReactHostComponent.createInstanceForText(node);
13936 } else {
13937 !false ? "development" !== 'production' ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0;
13938 }
13939
13940 if ("development" !== 'production') {
13941 "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;
13942 }
13943
13944 // These two fields are used by the DOM and ART diffing algorithms
13945 // respectively. Instead of using expandos on components, we should be
13946 // storing the state needed by the diffing algorithms elsewhere.
13947 instance._mountIndex = 0;
13948 instance._mountImage = null;
13949
13950 if ("development" !== 'production') {
13951 instance._debugID = shouldHaveDebugID ? getNextDebugID() : 0;
13952 }
13953
13954 // Internal instances should fully constructed at this point, so they should
13955 // not get any new fields added to them at this point.
13956 if ("development" !== 'production') {
13957 if (Object.preventExtensions) {
13958 Object.preventExtensions(instance);
13959 }
13960 }
13961
13962 return instance;
13963}
13964
13965_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, {
13966 _instantiateReactComponent: instantiateReactComponent
13967});
13968
13969module.exports = instantiateReactComponent;
13970},{"116":116,"125":125,"141":141,"148":148,"149":149,"29":29,"49":49,"54":54}],113:[function(_dereq_,module,exports){
13971/**
13972 * Copyright (c) 2013-present, Facebook, Inc.
13973 *
13974 * This source code is licensed under the MIT license found in the
13975 * LICENSE file in the root directory of this source tree.
13976 *
13977 */
13978
13979'use strict';
13980
13981var ExecutionEnvironment = _dereq_(127);
13982
13983var useHasFeature;
13984if (ExecutionEnvironment.canUseDOM) {
13985 useHasFeature = document.implementation && document.implementation.hasFeature &&
13986 // always returns true in newer browsers as per the standard.
13987 // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
13988 document.implementation.hasFeature('', '') !== true;
13989}
13990
13991/**
13992 * Checks if an event is supported in the current execution environment.
13993 *
13994 * NOTE: This will not work correctly for non-generic events such as `change`,
13995 * `reset`, `load`, `error`, and `select`.
13996 *
13997 * Borrows from Modernizr.
13998 *
13999 * @param {string} eventNameSuffix Event name, e.g. "click".
14000 * @param {?boolean} capture Check if the capture phase is supported.
14001 * @return {boolean} True if the event is supported.
14002 * @internal
14003 * @license Modernizr 3.0.0pre (Custom Build) | MIT
14004 */
14005function isEventSupported(eventNameSuffix, capture) {
14006 if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
14007 return false;
14008 }
14009
14010 var eventName = 'on' + eventNameSuffix;
14011 var isSupported = eventName in document;
14012
14013 if (!isSupported) {
14014 var element = document.createElement('div');
14015 element.setAttribute(eventName, 'return;');
14016 isSupported = typeof element[eventName] === 'function';
14017 }
14018
14019 if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
14020 // This is the only way to test support for the `wheel` event in IE9+.
14021 isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
14022 }
14023
14024 return isSupported;
14025}
14026
14027module.exports = isEventSupported;
14028},{"127":127}],114:[function(_dereq_,module,exports){
14029/**
14030 * Copyright (c) 2013-present, Facebook, Inc.
14031 *
14032 * This source code is licensed under the MIT license found in the
14033 * LICENSE file in the root directory of this source tree.
14034 *
14035 *
14036 */
14037
14038'use strict';
14039
14040/**
14041 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
14042 */
14043
14044var supportedInputTypes = {
14045 color: true,
14046 date: true,
14047 datetime: true,
14048 'datetime-local': true,
14049 email: true,
14050 month: true,
14051 number: true,
14052 password: true,
14053 range: true,
14054 search: true,
14055 tel: true,
14056 text: true,
14057 time: true,
14058 url: true,
14059 week: true
14060};
14061
14062function isTextInputElement(elem) {
14063 var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
14064
14065 if (nodeName === 'input') {
14066 return !!supportedInputTypes[elem.type];
14067 }
14068
14069 if (nodeName === 'textarea') {
14070 return true;
14071 }
14072
14073 return false;
14074}
14075
14076module.exports = isTextInputElement;
14077},{}],115:[function(_dereq_,module,exports){
14078/**
14079 * Copyright (c) 2013-present, Facebook, Inc.
14080 *
14081 * This source code is licensed under the MIT license found in the
14082 * LICENSE file in the root directory of this source tree.
14083 *
14084 */
14085
14086'use strict';
14087
14088var escapeTextContentForBrowser = _dereq_(100);
14089
14090/**
14091 * Escapes attribute value to prevent scripting attacks.
14092 *
14093 * @param {*} value Value to escape.
14094 * @return {string} An escaped string.
14095 */
14096function quoteAttributeValueForBrowser(value) {
14097 return '"' + escapeTextContentForBrowser(value) + '"';
14098}
14099
14100module.exports = quoteAttributeValueForBrowser;
14101},{"100":100}],116:[function(_dereq_,module,exports){
14102/**
14103 * Copyright (c) 2013-present, Facebook, Inc.
14104 *
14105 * This source code is licensed under the MIT license found in the
14106 * LICENSE file in the root directory of this source tree.
14107 *
14108 *
14109 */
14110'use strict';
14111
14112/**
14113 * WARNING: DO NOT manually require this module.
14114 * This is a replacement for `invariant(...)` used by the error code system
14115 * and will _only_ be required by the corresponding babel pass.
14116 * It always throws.
14117 */
14118
14119function reactProdInvariant(code) {
14120 var argCount = arguments.length - 1;
14121
14122 var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
14123
14124 for (var argIdx = 0; argIdx < argCount; argIdx++) {
14125 message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
14126 }
14127
14128 message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
14129
14130 var error = new Error(message);
14131 error.name = 'Invariant Violation';
14132 error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
14133
14134 throw error;
14135}
14136
14137module.exports = reactProdInvariant;
14138},{}],117:[function(_dereq_,module,exports){
14139/**
14140 * Copyright (c) 2013-present, Facebook, Inc.
14141 *
14142 * This source code is licensed under the MIT license found in the
14143 * LICENSE file in the root directory of this source tree.
14144 *
14145 */
14146
14147'use strict';
14148
14149var ExecutionEnvironment = _dereq_(127);
14150var DOMNamespaces = _dereq_(10);
14151
14152var WHITESPACE_TEST = /^[ \r\n\t\f]/;
14153var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/;
14154
14155var createMicrosoftUnsafeLocalFunction = _dereq_(98);
14156
14157// SVG temp container for IE lacking innerHTML
14158var reusableSVGContainer;
14159
14160/**
14161 * Set the innerHTML property of a node, ensuring that whitespace is preserved
14162 * even in IE8.
14163 *
14164 * @param {DOMElement} node
14165 * @param {string} html
14166 * @internal
14167 */
14168var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
14169 // IE does not have innerHTML for SVG nodes, so instead we inject the
14170 // new markup in a temp node and then move the child nodes across into
14171 // the target node
14172 if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) {
14173 reusableSVGContainer = reusableSVGContainer || document.createElement('div');
14174 reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
14175 var svgNode = reusableSVGContainer.firstChild;
14176 while (svgNode.firstChild) {
14177 node.appendChild(svgNode.firstChild);
14178 }
14179 } else {
14180 node.innerHTML = html;
14181 }
14182});
14183
14184if (ExecutionEnvironment.canUseDOM) {
14185 // IE8: When updating a just created node with innerHTML only leading
14186 // whitespace is removed. When updating an existing node with innerHTML
14187 // whitespace in root TextNodes is also collapsed.
14188 // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
14189
14190 // Feature detection; only IE8 is known to behave improperly like this.
14191 var testElement = document.createElement('div');
14192 testElement.innerHTML = ' ';
14193 if (testElement.innerHTML === '') {
14194 setInnerHTML = function (node, html) {
14195 // Magic theory: IE8 supposedly differentiates between added and updated
14196 // nodes when processing innerHTML, innerHTML on updated nodes suffers
14197 // from worse whitespace behavior. Re-adding a node like this triggers
14198 // the initial and more favorable whitespace behavior.
14199 // TODO: What to do on a detached node?
14200 if (node.parentNode) {
14201 node.parentNode.replaceChild(node, node);
14202 }
14203
14204 // We also implement a workaround for non-visible tags disappearing into
14205 // thin air on IE8, this only happens if there is no visible text
14206 // in-front of the non-visible tags. Piggyback on the whitespace fix
14207 // and simply check if any non-visible tags appear in the source.
14208 if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {
14209 // Recover leading whitespace by temporarily prepending any character.
14210 // \uFEFF has the potential advantage of being zero-width/invisible.
14211 // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode
14212 // in hopes that this is preserved even if "\uFEFF" is transformed to
14213 // the actual Unicode character (by Babel, for example).
14214 // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216
14215 node.innerHTML = String.fromCharCode(0xfeff) + html;
14216
14217 // deleteData leaves an empty `TextNode` which offsets the index of all
14218 // children. Definitely want to avoid this.
14219 var textNode = node.firstChild;
14220 if (textNode.data.length === 1) {
14221 node.removeChild(textNode);
14222 } else {
14223 textNode.deleteData(0, 1);
14224 }
14225 } else {
14226 node.innerHTML = html;
14227 }
14228 };
14229 }
14230 testElement = null;
14231}
14232
14233module.exports = setInnerHTML;
14234},{"10":10,"127":127,"98":98}],118:[function(_dereq_,module,exports){
14235/**
14236 * Copyright (c) 2013-present, Facebook, Inc.
14237 *
14238 * This source code is licensed under the MIT license found in the
14239 * LICENSE file in the root directory of this source tree.
14240 *
14241 */
14242
14243'use strict';
14244
14245var ExecutionEnvironment = _dereq_(127);
14246var escapeTextContentForBrowser = _dereq_(100);
14247var setInnerHTML = _dereq_(117);
14248
14249/**
14250 * Set the textContent property of a node, ensuring that whitespace is preserved
14251 * even in IE8. innerText is a poor substitute for textContent and, among many
14252 * issues, inserts <br> instead of the literal newline chars. innerHTML behaves
14253 * as it should.
14254 *
14255 * @param {DOMElement} node
14256 * @param {string} text
14257 * @internal
14258 */
14259var setTextContent = function (node, text) {
14260 if (text) {
14261 var firstChild = node.firstChild;
14262
14263 if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) {
14264 firstChild.nodeValue = text;
14265 return;
14266 }
14267 }
14268 node.textContent = text;
14269};
14270
14271if (ExecutionEnvironment.canUseDOM) {
14272 if (!('textContent' in document.documentElement)) {
14273 setTextContent = function (node, text) {
14274 if (node.nodeType === 3) {
14275 node.nodeValue = text;
14276 return;
14277 }
14278 setInnerHTML(node, escapeTextContentForBrowser(text));
14279 };
14280 }
14281}
14282
14283module.exports = setTextContent;
14284},{"100":100,"117":117,"127":127}],119:[function(_dereq_,module,exports){
14285/**
14286 * Copyright (c) 2013-present, Facebook, Inc.
14287 *
14288 * This source code is licensed under the MIT license found in the
14289 * LICENSE file in the root directory of this source tree.
14290 *
14291 */
14292
14293'use strict';
14294
14295/**
14296 * Given a `prevElement` and `nextElement`, determines if the existing
14297 * instance should be updated as opposed to being destroyed or replaced by a new
14298 * instance. Both arguments are elements. This ensures that this logic can
14299 * operate on stateless trees without any backing instance.
14300 *
14301 * @param {?object} prevElement
14302 * @param {?object} nextElement
14303 * @return {boolean} True if the existing instance should be updated.
14304 * @protected
14305 */
14306
14307function shouldUpdateReactComponent(prevElement, nextElement) {
14308 var prevEmpty = prevElement === null || prevElement === false;
14309 var nextEmpty = nextElement === null || nextElement === false;
14310 if (prevEmpty || nextEmpty) {
14311 return prevEmpty === nextEmpty;
14312 }
14313
14314 var prevType = typeof prevElement;
14315 var nextType = typeof nextElement;
14316 if (prevType === 'string' || prevType === 'number') {
14317 return nextType === 'string' || nextType === 'number';
14318 } else {
14319 return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key;
14320 }
14321}
14322
14323module.exports = shouldUpdateReactComponent;
14324},{}],120:[function(_dereq_,module,exports){
14325/**
14326 * Copyright (c) 2013-present, Facebook, Inc.
14327 *
14328 * This source code is licensed under the MIT license found in the
14329 * LICENSE file in the root directory of this source tree.
14330 *
14331 */
14332
14333'use strict';
14334
14335var _prodInvariant = _dereq_(116);
14336
14337var ReactCurrentOwner = _dereq_(123);
14338var REACT_ELEMENT_TYPE = _dereq_(48);
14339
14340var getIteratorFn = _dereq_(107);
14341var invariant = _dereq_(141);
14342var KeyEscapeUtils = _dereq_(22);
14343var warning = _dereq_(148);
14344
14345var SEPARATOR = '.';
14346var SUBSEPARATOR = ':';
14347
14348/**
14349 * This is inlined from ReactElement since this file is shared between
14350 * isomorphic and renderers. We could extract this to a
14351 *
14352 */
14353
14354/**
14355 * TODO: Test that a single child and an array with one item have the same key
14356 * pattern.
14357 */
14358
14359var didWarnAboutMaps = false;
14360
14361/**
14362 * Generate a key string that identifies a component within a set.
14363 *
14364 * @param {*} component A component that could contain a manual key.
14365 * @param {number} index Index that is used if a manual key is not provided.
14366 * @return {string}
14367 */
14368function getComponentKey(component, index) {
14369 // Do some typechecking here since we call this blindly. We want to ensure
14370 // that we don't block potential future ES APIs.
14371 if (component && typeof component === 'object' && component.key != null) {
14372 // Explicit key
14373 return KeyEscapeUtils.escape(component.key);
14374 }
14375 // Implicit key determined by the index in the set
14376 return index.toString(36);
14377}
14378
14379/**
14380 * @param {?*} children Children tree container.
14381 * @param {!string} nameSoFar Name of the key path so far.
14382 * @param {!function} callback Callback to invoke with each child found.
14383 * @param {?*} traverseContext Used to pass information throughout the traversal
14384 * process.
14385 * @return {!number} The number of children in this subtree.
14386 */
14387function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
14388 var type = typeof children;
14389
14390 if (type === 'undefined' || type === 'boolean') {
14391 // All of the above are perceived as null.
14392 children = null;
14393 }
14394
14395 if (children === null || type === 'string' || type === 'number' ||
14396 // The following is inlined from ReactElement. This means we can optimize
14397 // some checks. React Fiber also inlines this logic for similar purposes.
14398 type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
14399 callback(traverseContext, children,
14400 // If it's the only child, treat the name as if it was wrapped in an array
14401 // so that it's consistent if the number of children grows.
14402 nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
14403 return 1;
14404 }
14405
14406 var child;
14407 var nextName;
14408 var subtreeCount = 0; // Count of children found in the current subtree.
14409 var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
14410
14411 if (Array.isArray(children)) {
14412 for (var i = 0; i < children.length; i++) {
14413 child = children[i];
14414 nextName = nextNamePrefix + getComponentKey(child, i);
14415 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
14416 }
14417 } else {
14418 var iteratorFn = getIteratorFn(children);
14419 if (iteratorFn) {
14420 var iterator = iteratorFn.call(children);
14421 var step;
14422 if (iteratorFn !== children.entries) {
14423 var ii = 0;
14424 while (!(step = iterator.next()).done) {
14425 child = step.value;
14426 nextName = nextNamePrefix + getComponentKey(child, ii++);
14427 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
14428 }
14429 } else {
14430 if ("development" !== 'production') {
14431 var mapsAsChildrenAddendum = '';
14432 if (ReactCurrentOwner.current) {
14433 var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName();
14434 if (mapsAsChildrenOwnerName) {
14435 mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.';
14436 }
14437 }
14438 "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;
14439 didWarnAboutMaps = true;
14440 }
14441 // Iterator will provide entry [k,v] tuples rather than values.
14442 while (!(step = iterator.next()).done) {
14443 var entry = step.value;
14444 if (entry) {
14445 child = entry[1];
14446 nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0);
14447 subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
14448 }
14449 }
14450 }
14451 } else if (type === 'object') {
14452 var addendum = '';
14453 if ("development" !== 'production') {
14454 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.';
14455 if (children._isReactElement) {
14456 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.';
14457 }
14458 if (ReactCurrentOwner.current) {
14459 var name = ReactCurrentOwner.current.getName();
14460 if (name) {
14461 addendum += ' Check the render method of `' + name + '`.';
14462 }
14463 }
14464 }
14465 var childrenString = String(children);
14466 !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;
14467 }
14468 }
14469
14470 return subtreeCount;
14471}
14472
14473/**
14474 * Traverses children that are typically specified as `props.children`, but
14475 * might also be specified through attributes:
14476 *
14477 * - `traverseAllChildren(this.props.children, ...)`
14478 * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
14479 *
14480 * The `traverseContext` is an optional argument that is passed through the
14481 * entire traversal. It can be used to store accumulations or anything else that
14482 * the callback might find relevant.
14483 *
14484 * @param {?*} children Children tree object.
14485 * @param {!function} callback To invoke upon traversing each child.
14486 * @param {?*} traverseContext Context for traversal.
14487 * @return {!number} The number of children in this subtree.
14488 */
14489function traverseAllChildren(children, callback, traverseContext) {
14490 if (children == null) {
14491 return 0;
14492 }
14493
14494 return traverseAllChildrenImpl(children, '', callback, traverseContext);
14495}
14496
14497module.exports = traverseAllChildren;
14498},{"107":107,"116":116,"123":123,"141":141,"148":148,"22":22,"48":48}],121:[function(_dereq_,module,exports){
14499/**
14500 * Copyright (c) 2015-present, Facebook, Inc.
14501 *
14502 * This source code is licensed under the MIT license found in the
14503 * LICENSE file in the root directory of this source tree.
14504 *
14505 */
14506
14507'use strict';
14508
14509var _assign = _dereq_(149);
14510
14511var emptyFunction = _dereq_(133);
14512var warning = _dereq_(148);
14513
14514var validateDOMNesting = emptyFunction;
14515
14516if ("development" !== 'production') {
14517 // This validation code was written based on the HTML5 parsing spec:
14518 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
14519 //
14520 // Note: this does not catch all invalid nesting, nor does it try to (as it's
14521 // not clear what practical benefit doing so provides); instead, we warn only
14522 // for cases where the parser will give a parse tree differing from what React
14523 // intended. For example, <b><div></div></b> is invalid but we don't warn
14524 // because it still parses correctly; we do warn for other cases like nested
14525 // <p> tags where the beginning of the second element implicitly closes the
14526 // first, causing a confusing mess.
14527
14528 // https://html.spec.whatwg.org/multipage/syntax.html#special
14529 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'];
14530
14531 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
14532 var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
14533
14534 // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
14535 // TODO: Distinguish by namespace here -- for <title>, including it here
14536 // errs on the side of fewer warnings
14537 'foreignObject', 'desc', 'title'];
14538
14539 // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
14540 var buttonScopeTags = inScopeTags.concat(['button']);
14541
14542 // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
14543 var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
14544
14545 var emptyAncestorInfo = {
14546 current: null,
14547
14548 formTag: null,
14549 aTagInScope: null,
14550 buttonTagInScope: null,
14551 nobrTagInScope: null,
14552 pTagInButtonScope: null,
14553
14554 listItemTagAutoclosing: null,
14555 dlItemTagAutoclosing: null
14556 };
14557
14558 var updatedAncestorInfo = function (oldInfo, tag, instance) {
14559 var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
14560 var info = { tag: tag, instance: instance };
14561
14562 if (inScopeTags.indexOf(tag) !== -1) {
14563 ancestorInfo.aTagInScope = null;
14564 ancestorInfo.buttonTagInScope = null;
14565 ancestorInfo.nobrTagInScope = null;
14566 }
14567 if (buttonScopeTags.indexOf(tag) !== -1) {
14568 ancestorInfo.pTagInButtonScope = null;
14569 }
14570
14571 // See rules for 'li', 'dd', 'dt' start tags in
14572 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
14573 if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
14574 ancestorInfo.listItemTagAutoclosing = null;
14575 ancestorInfo.dlItemTagAutoclosing = null;
14576 }
14577
14578 ancestorInfo.current = info;
14579
14580 if (tag === 'form') {
14581 ancestorInfo.formTag = info;
14582 }
14583 if (tag === 'a') {
14584 ancestorInfo.aTagInScope = info;
14585 }
14586 if (tag === 'button') {
14587 ancestorInfo.buttonTagInScope = info;
14588 }
14589 if (tag === 'nobr') {
14590 ancestorInfo.nobrTagInScope = info;
14591 }
14592 if (tag === 'p') {
14593 ancestorInfo.pTagInButtonScope = info;
14594 }
14595 if (tag === 'li') {
14596 ancestorInfo.listItemTagAutoclosing = info;
14597 }
14598 if (tag === 'dd' || tag === 'dt') {
14599 ancestorInfo.dlItemTagAutoclosing = info;
14600 }
14601
14602 return ancestorInfo;
14603 };
14604
14605 /**
14606 * Returns whether
14607 */
14608 var isTagValidWithParent = function (tag, parentTag) {
14609 // First, let's check if we're in an unusual parsing mode...
14610 switch (parentTag) {
14611 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
14612 case 'select':
14613 return tag === 'option' || tag === 'optgroup' || tag === '#text';
14614 case 'optgroup':
14615 return tag === 'option' || tag === '#text';
14616 // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
14617 // but
14618 case 'option':
14619 return tag === '#text';
14620 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
14621 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
14622 // No special behavior since these rules fall back to "in body" mode for
14623 // all except special table nodes which cause bad parsing behavior anyway.
14624
14625 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
14626 case 'tr':
14627 return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
14628 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
14629 case 'tbody':
14630 case 'thead':
14631 case 'tfoot':
14632 return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
14633 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
14634 case 'colgroup':
14635 return tag === 'col' || tag === 'template';
14636 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
14637 case 'table':
14638 return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
14639 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
14640 case 'head':
14641 return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
14642 // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
14643 case 'html':
14644 return tag === 'head' || tag === 'body';
14645 case '#document':
14646 return tag === 'html';
14647 }
14648
14649 // Probably in the "in body" parsing mode, so we outlaw only tag combos
14650 // where the parsing rules cause implicit opens or closes to be added.
14651 // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
14652 switch (tag) {
14653 case 'h1':
14654 case 'h2':
14655 case 'h3':
14656 case 'h4':
14657 case 'h5':
14658 case 'h6':
14659 return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
14660
14661 case 'rp':
14662 case 'rt':
14663 return impliedEndTags.indexOf(parentTag) === -1;
14664
14665 case 'body':
14666 case 'caption':
14667 case 'col':
14668 case 'colgroup':
14669 case 'frame':
14670 case 'head':
14671 case 'html':
14672 case 'tbody':
14673 case 'td':
14674 case 'tfoot':
14675 case 'th':
14676 case 'thead':
14677 case 'tr':
14678 // These tags are only valid with a few parents that have special child
14679 // parsing rules -- if we're down here, then none of those matched and
14680 // so we allow it only if we don't know what the parent is, as all other
14681 // cases are invalid.
14682 return parentTag == null;
14683 }
14684
14685 return true;
14686 };
14687
14688 /**
14689 * Returns whether
14690 */
14691 var findInvalidAncestorForTag = function (tag, ancestorInfo) {
14692 switch (tag) {
14693 case 'address':
14694 case 'article':
14695 case 'aside':
14696 case 'blockquote':
14697 case 'center':
14698 case 'details':
14699 case 'dialog':
14700 case 'dir':
14701 case 'div':
14702 case 'dl':
14703 case 'fieldset':
14704 case 'figcaption':
14705 case 'figure':
14706 case 'footer':
14707 case 'header':
14708 case 'hgroup':
14709 case 'main':
14710 case 'menu':
14711 case 'nav':
14712 case 'ol':
14713 case 'p':
14714 case 'section':
14715 case 'summary':
14716 case 'ul':
14717 case 'pre':
14718 case 'listing':
14719 case 'table':
14720 case 'hr':
14721 case 'xmp':
14722 case 'h1':
14723 case 'h2':
14724 case 'h3':
14725 case 'h4':
14726 case 'h5':
14727 case 'h6':
14728 return ancestorInfo.pTagInButtonScope;
14729
14730 case 'form':
14731 return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
14732
14733 case 'li':
14734 return ancestorInfo.listItemTagAutoclosing;
14735
14736 case 'dd':
14737 case 'dt':
14738 return ancestorInfo.dlItemTagAutoclosing;
14739
14740 case 'button':
14741 return ancestorInfo.buttonTagInScope;
14742
14743 case 'a':
14744 // Spec says something about storing a list of markers, but it sounds
14745 // equivalent to this check.
14746 return ancestorInfo.aTagInScope;
14747
14748 case 'nobr':
14749 return ancestorInfo.nobrTagInScope;
14750 }
14751
14752 return null;
14753 };
14754
14755 /**
14756 * Given a ReactCompositeComponent instance, return a list of its recursive
14757 * owners, starting at the root and ending with the instance itself.
14758 */
14759 var findOwnerStack = function (instance) {
14760 if (!instance) {
14761 return [];
14762 }
14763
14764 var stack = [];
14765 do {
14766 stack.push(instance);
14767 } while (instance = instance._currentElement._owner);
14768 stack.reverse();
14769 return stack;
14770 };
14771
14772 var didWarn = {};
14773
14774 validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) {
14775 ancestorInfo = ancestorInfo || emptyAncestorInfo;
14776 var parentInfo = ancestorInfo.current;
14777 var parentTag = parentInfo && parentInfo.tag;
14778
14779 if (childText != null) {
14780 "development" !== 'production' ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
14781 childTag = '#text';
14782 }
14783
14784 var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
14785 var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
14786 var problematic = invalidParent || invalidAncestor;
14787
14788 if (problematic) {
14789 var ancestorTag = problematic.tag;
14790 var ancestorInstance = problematic.instance;
14791
14792 var childOwner = childInstance && childInstance._currentElement._owner;
14793 var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner;
14794
14795 var childOwners = findOwnerStack(childOwner);
14796 var ancestorOwners = findOwnerStack(ancestorOwner);
14797
14798 var minStackLen = Math.min(childOwners.length, ancestorOwners.length);
14799 var i;
14800
14801 var deepestCommon = -1;
14802 for (i = 0; i < minStackLen; i++) {
14803 if (childOwners[i] === ancestorOwners[i]) {
14804 deepestCommon = i;
14805 } else {
14806 break;
14807 }
14808 }
14809
14810 var UNKNOWN = '(unknown)';
14811 var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) {
14812 return inst.getName() || UNKNOWN;
14813 });
14814 var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) {
14815 return inst.getName() || UNKNOWN;
14816 });
14817 var ownerInfo = [].concat(
14818 // If the parent and child instances have a common owner ancestor, start
14819 // with that -- otherwise we just start with the parent's owners.
14820 deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag,
14821 // If we're warning about an invalid (non-parent) ancestry, add '...'
14822 invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > ');
14823
14824 var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo;
14825 if (didWarn[warnKey]) {
14826 return;
14827 }
14828 didWarn[warnKey] = true;
14829
14830 var tagDisplayName = childTag;
14831 var whitespaceInfo = '';
14832 if (childTag === '#text') {
14833 if (/\S/.test(childText)) {
14834 tagDisplayName = 'Text nodes';
14835 } else {
14836 tagDisplayName = 'Whitespace text nodes';
14837 whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
14838 }
14839 } else {
14840 tagDisplayName = '<' + childTag + '>';
14841 }
14842
14843 if (invalidParent) {
14844 var info = '';
14845 if (ancestorTag === 'table' && childTag === 'tr') {
14846 info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
14847 }
14848 "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0;
14849 } else {
14850 "development" !== 'production' ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0;
14851 }
14852 }
14853 };
14854
14855 validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo;
14856
14857 // For testing
14858 validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) {
14859 ancestorInfo = ancestorInfo || emptyAncestorInfo;
14860 var parentInfo = ancestorInfo.current;
14861 var parentTag = parentInfo && parentInfo.tag;
14862 return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo);
14863 };
14864}
14865
14866module.exports = validateDOMNesting;
14867},{"133":133,"148":148,"149":149}],122:[function(_dereq_,module,exports){
14868/**
14869 * Copyright (c) 2013-present, Facebook, Inc.
14870 *
14871 * This source code is licensed under the MIT license found in the
14872 * LICENSE file in the root directory of this source tree.
14873 *
14874 */
14875
14876/* globals React */
14877
14878'use strict';
14879
14880var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
14881
14882module.exports = ReactInternals.ReactComponentTreeHook;
14883},{}],123:[function(_dereq_,module,exports){
14884/**
14885 * Copyright (c) 2013-present, Facebook, Inc.
14886 *
14887 * This source code is licensed under the MIT license found in the
14888 * LICENSE file in the root directory of this source tree.
14889 *
14890 */
14891
14892/* globals React */
14893
14894'use strict';
14895
14896var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
14897
14898module.exports = ReactInternals.ReactCurrentOwner;
14899},{}],124:[function(_dereq_,module,exports){
14900/**
14901 * Copyright (c) 2013-present, Facebook, Inc.
14902 *
14903 * This source code is licensed under the MIT license found in the
14904 * LICENSE file in the root directory of this source tree.
14905 *
14906 */
14907
14908/* globals React */
14909
14910'use strict';
14911
14912module.exports = React;
14913},{}],125:[function(_dereq_,module,exports){
14914/**
14915 * Copyright (c) 2013-present, Facebook, Inc.
14916 *
14917 * This source code is licensed under the MIT license found in the
14918 * LICENSE file in the root directory of this source tree.
14919 *
14920 */
14921
14922/* globals React */
14923
14924'use strict';
14925
14926var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
14927
14928module.exports = ReactInternals.getNextDebugID;
14929},{}],126:[function(_dereq_,module,exports){
14930'use strict';
14931
14932/**
14933 * Copyright (c) 2013-present, Facebook, Inc.
14934 *
14935 * Licensed under the Apache License, Version 2.0 (the "License");
14936 * you may not use this file except in compliance with the License.
14937 * You may obtain a copy of the License at
14938 *
14939 * http://www.apache.org/licenses/LICENSE-2.0
14940 *
14941 * Unless required by applicable law or agreed to in writing, software
14942 * distributed under the License is distributed on an "AS IS" BASIS,
14943 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14944 * See the License for the specific language governing permissions and
14945 * limitations under the License.
14946 *
14947 * @typechecks
14948 */
14949
14950var emptyFunction = _dereq_(133);
14951
14952/**
14953 * Upstream version of event listener. Does not take into account specific
14954 * nature of platform.
14955 */
14956var EventListener = {
14957 /**
14958 * Listen to DOM events during the bubble phase.
14959 *
14960 * @param {DOMEventTarget} target DOM element to register listener on.
14961 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
14962 * @param {function} callback Callback function.
14963 * @return {object} Object with a `remove` method.
14964 */
14965 listen: function listen(target, eventType, callback) {
14966 if (target.addEventListener) {
14967 target.addEventListener(eventType, callback, false);
14968 return {
14969 remove: function remove() {
14970 target.removeEventListener(eventType, callback, false);
14971 }
14972 };
14973 } else if (target.attachEvent) {
14974 target.attachEvent('on' + eventType, callback);
14975 return {
14976 remove: function remove() {
14977 target.detachEvent('on' + eventType, callback);
14978 }
14979 };
14980 }
14981 },
14982
14983 /**
14984 * Listen to DOM events during the capture phase.
14985 *
14986 * @param {DOMEventTarget} target DOM element to register listener on.
14987 * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
14988 * @param {function} callback Callback function.
14989 * @return {object} Object with a `remove` method.
14990 */
14991 capture: function capture(target, eventType, callback) {
14992 if (target.addEventListener) {
14993 target.addEventListener(eventType, callback, true);
14994 return {
14995 remove: function remove() {
14996 target.removeEventListener(eventType, callback, true);
14997 }
14998 };
14999 } else {
15000 if ("development" !== 'production') {
15001 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.');
15002 }
15003 return {
15004 remove: emptyFunction
15005 };
15006 }
15007 },
15008
15009 registerDefault: function registerDefault() {}
15010};
15011
15012module.exports = EventListener;
15013},{"133":133}],127:[function(_dereq_,module,exports){
15014/**
15015 * Copyright (c) 2013-present, Facebook, Inc.
15016 * All rights reserved.
15017 *
15018 * This source code is licensed under the BSD-style license found in the
15019 * LICENSE file in the root directory of this source tree. An additional grant
15020 * of patent rights can be found in the PATENTS file in the same directory.
15021 *
15022 */
15023
15024'use strict';
15025
15026var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
15027
15028/**
15029 * Simple, lightweight module assisting with the detection and context of
15030 * Worker. Helps avoid circular dependencies and allows code to reason about
15031 * whether or not they are in a Worker, even if they never include the main
15032 * `ReactWorker` dependency.
15033 */
15034var ExecutionEnvironment = {
15035
15036 canUseDOM: canUseDOM,
15037
15038 canUseWorkers: typeof Worker !== 'undefined',
15039
15040 canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
15041
15042 canUseViewport: canUseDOM && !!window.screen,
15043
15044 isInWorker: !canUseDOM // For now, this is true - might change in the future.
15045
15046};
15047
15048module.exports = ExecutionEnvironment;
15049},{}],128:[function(_dereq_,module,exports){
15050"use strict";
15051
15052/**
15053 * Copyright (c) 2013-present, Facebook, Inc.
15054 * All rights reserved.
15055 *
15056 * This source code is licensed under the BSD-style license found in the
15057 * LICENSE file in the root directory of this source tree. An additional grant
15058 * of patent rights can be found in the PATENTS file in the same directory.
15059 *
15060 * @typechecks
15061 */
15062
15063var _hyphenPattern = /-(.)/g;
15064
15065/**
15066 * Camelcases a hyphenated string, for example:
15067 *
15068 * > camelize('background-color')
15069 * < "backgroundColor"
15070 *
15071 * @param {string} string
15072 * @return {string}
15073 */
15074function camelize(string) {
15075 return string.replace(_hyphenPattern, function (_, character) {
15076 return character.toUpperCase();
15077 });
15078}
15079
15080module.exports = camelize;
15081},{}],129:[function(_dereq_,module,exports){
15082/**
15083 * Copyright (c) 2013-present, Facebook, Inc.
15084 * All rights reserved.
15085 *
15086 * This source code is licensed under the BSD-style license found in the
15087 * LICENSE file in the root directory of this source tree. An additional grant
15088 * of patent rights can be found in the PATENTS file in the same directory.
15089 *
15090 * @typechecks
15091 */
15092
15093'use strict';
15094
15095var camelize = _dereq_(128);
15096
15097var msPattern = /^-ms-/;
15098
15099/**
15100 * Camelcases a hyphenated CSS property name, for example:
15101 *
15102 * > camelizeStyleName('background-color')
15103 * < "backgroundColor"
15104 * > camelizeStyleName('-moz-transition')
15105 * < "MozTransition"
15106 * > camelizeStyleName('-ms-transition')
15107 * < "msTransition"
15108 *
15109 * As Andi Smith suggests
15110 * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
15111 * is converted to lowercase `ms`.
15112 *
15113 * @param {string} string
15114 * @return {string}
15115 */
15116function camelizeStyleName(string) {
15117 return camelize(string.replace(msPattern, 'ms-'));
15118}
15119
15120module.exports = camelizeStyleName;
15121},{"128":128}],130:[function(_dereq_,module,exports){
15122'use strict';
15123
15124/**
15125 * Copyright (c) 2013-present, Facebook, Inc.
15126 * All rights reserved.
15127 *
15128 * This source code is licensed under the BSD-style license found in the
15129 * LICENSE file in the root directory of this source tree. An additional grant
15130 * of patent rights can be found in the PATENTS file in the same directory.
15131 *
15132 *
15133 */
15134
15135var isTextNode = _dereq_(143);
15136
15137/*eslint-disable no-bitwise */
15138
15139/**
15140 * Checks if a given DOM node contains or is another DOM node.
15141 */
15142function containsNode(outerNode, innerNode) {
15143 if (!outerNode || !innerNode) {
15144 return false;
15145 } else if (outerNode === innerNode) {
15146 return true;
15147 } else if (isTextNode(outerNode)) {
15148 return false;
15149 } else if (isTextNode(innerNode)) {
15150 return containsNode(outerNode, innerNode.parentNode);
15151 } else if ('contains' in outerNode) {
15152 return outerNode.contains(innerNode);
15153 } else if (outerNode.compareDocumentPosition) {
15154 return !!(outerNode.compareDocumentPosition(innerNode) & 16);
15155 } else {
15156 return false;
15157 }
15158}
15159
15160module.exports = containsNode;
15161},{"143":143}],131:[function(_dereq_,module,exports){
15162'use strict';
15163
15164/**
15165 * Copyright (c) 2013-present, Facebook, Inc.
15166 * All rights reserved.
15167 *
15168 * This source code is licensed under the BSD-style license found in the
15169 * LICENSE file in the root directory of this source tree. An additional grant
15170 * of patent rights can be found in the PATENTS file in the same directory.
15171 *
15172 * @typechecks
15173 */
15174
15175var invariant = _dereq_(141);
15176
15177/**
15178 * Convert array-like objects to arrays.
15179 *
15180 * This API assumes the caller knows the contents of the data type. For less
15181 * well defined inputs use createArrayFromMixed.
15182 *
15183 * @param {object|function|filelist} obj
15184 * @return {array}
15185 */
15186function toArray(obj) {
15187 var length = obj.length;
15188
15189 // Some browsers builtin objects can report typeof 'function' (e.g. NodeList
15190 // in old versions of Safari).
15191 !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? "development" !== 'production' ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0;
15192
15193 !(typeof length === 'number') ? "development" !== 'production' ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0;
15194
15195 !(length === 0 || length - 1 in obj) ? "development" !== 'production' ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0;
15196
15197 !(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;
15198
15199 // Old IE doesn't give collections access to hasOwnProperty. Assume inputs
15200 // without method will throw during the slice call and skip straight to the
15201 // fallback.
15202 if (obj.hasOwnProperty) {
15203 try {
15204 return Array.prototype.slice.call(obj);
15205 } catch (e) {
15206 // IE < 9 does not support Array#slice on collections objects
15207 }
15208 }
15209
15210 // Fall back to copying key by key. This assumes all keys have a value,
15211 // so will not preserve sparsely populated inputs.
15212 var ret = Array(length);
15213 for (var ii = 0; ii < length; ii++) {
15214 ret[ii] = obj[ii];
15215 }
15216 return ret;
15217}
15218
15219/**
15220 * Perform a heuristic test to determine if an object is "array-like".
15221 *
15222 * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?"
15223 * Joshu replied: "Mu."
15224 *
15225 * This function determines if its argument has "array nature": it returns
15226 * true if the argument is an actual array, an `arguments' object, or an
15227 * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()).
15228 *
15229 * It will return false for other array-like objects like Filelist.
15230 *
15231 * @param {*} obj
15232 * @return {boolean}
15233 */
15234function hasArrayNature(obj) {
15235 return (
15236 // not null/false
15237 !!obj && (
15238 // arrays are objects, NodeLists are functions in Safari
15239 typeof obj == 'object' || typeof obj == 'function') &&
15240 // quacks like an array
15241 'length' in obj &&
15242 // not window
15243 !('setInterval' in obj) &&
15244 // no DOM node should be considered an array-like
15245 // a 'select' element has 'length' and 'item' properties on IE8
15246 typeof obj.nodeType != 'number' && (
15247 // a real array
15248 Array.isArray(obj) ||
15249 // arguments
15250 'callee' in obj ||
15251 // HTMLCollection/NodeList
15252 'item' in obj)
15253 );
15254}
15255
15256/**
15257 * Ensure that the argument is an array by wrapping it in an array if it is not.
15258 * Creates a copy of the argument if it is already an array.
15259 *
15260 * This is mostly useful idiomatically:
15261 *
15262 * var createArrayFromMixed = require('createArrayFromMixed');
15263 *
15264 * function takesOneOrMoreThings(things) {
15265 * things = createArrayFromMixed(things);
15266 * ...
15267 * }
15268 *
15269 * This allows you to treat `things' as an array, but accept scalars in the API.
15270 *
15271 * If you need to convert an array-like object, like `arguments`, into an array
15272 * use toArray instead.
15273 *
15274 * @param {*} obj
15275 * @return {array}
15276 */
15277function createArrayFromMixed(obj) {
15278 if (!hasArrayNature(obj)) {
15279 return [obj];
15280 } else if (Array.isArray(obj)) {
15281 return obj.slice();
15282 } else {
15283 return toArray(obj);
15284 }
15285}
15286
15287module.exports = createArrayFromMixed;
15288},{"141":141}],132:[function(_dereq_,module,exports){
15289'use strict';
15290
15291/**
15292 * Copyright (c) 2013-present, Facebook, Inc.
15293 * All rights reserved.
15294 *
15295 * This source code is licensed under the BSD-style license found in the
15296 * LICENSE file in the root directory of this source tree. An additional grant
15297 * of patent rights can be found in the PATENTS file in the same directory.
15298 *
15299 * @typechecks
15300 */
15301
15302/*eslint-disable fb-www/unsafe-html*/
15303
15304var ExecutionEnvironment = _dereq_(127);
15305
15306var createArrayFromMixed = _dereq_(131);
15307var getMarkupWrap = _dereq_(137);
15308var invariant = _dereq_(141);
15309
15310/**
15311 * Dummy container used to render all markup.
15312 */
15313var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
15314
15315/**
15316 * Pattern used by `getNodeName`.
15317 */
15318var nodeNamePattern = /^\s*<(\w+)/;
15319
15320/**
15321 * Extracts the `nodeName` of the first element in a string of markup.
15322 *
15323 * @param {string} markup String of markup.
15324 * @return {?string} Node name of the supplied markup.
15325 */
15326function getNodeName(markup) {
15327 var nodeNameMatch = markup.match(nodeNamePattern);
15328 return nodeNameMatch && nodeNameMatch[1].toLowerCase();
15329}
15330
15331/**
15332 * Creates an array containing the nodes rendered from the supplied markup. The
15333 * optionally supplied `handleScript` function will be invoked once for each
15334 * <script> element that is rendered. If no `handleScript` function is supplied,
15335 * an exception is thrown if any <script> elements are rendered.
15336 *
15337 * @param {string} markup A string of valid HTML markup.
15338 * @param {?function} handleScript Invoked once for each rendered <script>.
15339 * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes.
15340 */
15341function createNodesFromMarkup(markup, handleScript) {
15342 var node = dummyNode;
15343 !!!dummyNode ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0;
15344 var nodeName = getNodeName(markup);
15345
15346 var wrap = nodeName && getMarkupWrap(nodeName);
15347 if (wrap) {
15348 node.innerHTML = wrap[1] + markup + wrap[2];
15349
15350 var wrapDepth = wrap[0];
15351 while (wrapDepth--) {
15352 node = node.lastChild;
15353 }
15354 } else {
15355 node.innerHTML = markup;
15356 }
15357
15358 var scripts = node.getElementsByTagName('script');
15359 if (scripts.length) {
15360 !handleScript ? "development" !== 'production' ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0;
15361 createArrayFromMixed(scripts).forEach(handleScript);
15362 }
15363
15364 var nodes = Array.from(node.childNodes);
15365 while (node.lastChild) {
15366 node.removeChild(node.lastChild);
15367 }
15368 return nodes;
15369}
15370
15371module.exports = createNodesFromMarkup;
15372},{"127":127,"131":131,"137":137,"141":141}],133:[function(_dereq_,module,exports){
15373"use strict";
15374
15375/**
15376 * Copyright (c) 2013-present, Facebook, Inc.
15377 * All rights reserved.
15378 *
15379 * This source code is licensed under the BSD-style license found in the
15380 * LICENSE file in the root directory of this source tree. An additional grant
15381 * of patent rights can be found in the PATENTS file in the same directory.
15382 *
15383 *
15384 */
15385
15386function makeEmptyFunction(arg) {
15387 return function () {
15388 return arg;
15389 };
15390}
15391
15392/**
15393 * This function accepts and discards inputs; it has no side effects. This is
15394 * primarily useful idiomatically for overridable function endpoints which
15395 * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
15396 */
15397var emptyFunction = function emptyFunction() {};
15398
15399emptyFunction.thatReturns = makeEmptyFunction;
15400emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
15401emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
15402emptyFunction.thatReturnsNull = makeEmptyFunction(null);
15403emptyFunction.thatReturnsThis = function () {
15404 return this;
15405};
15406emptyFunction.thatReturnsArgument = function (arg) {
15407 return arg;
15408};
15409
15410module.exports = emptyFunction;
15411},{}],134:[function(_dereq_,module,exports){
15412/**
15413 * Copyright (c) 2013-present, Facebook, Inc.
15414 * All rights reserved.
15415 *
15416 * This source code is licensed under the BSD-style license found in the
15417 * LICENSE file in the root directory of this source tree. An additional grant
15418 * of patent rights can be found in the PATENTS file in the same directory.
15419 *
15420 */
15421
15422'use strict';
15423
15424var emptyObject = {};
15425
15426if ("development" !== 'production') {
15427 Object.freeze(emptyObject);
15428}
15429
15430module.exports = emptyObject;
15431},{}],135:[function(_dereq_,module,exports){
15432/**
15433 * Copyright (c) 2013-present, Facebook, Inc.
15434 * All rights reserved.
15435 *
15436 * This source code is licensed under the BSD-style license found in the
15437 * LICENSE file in the root directory of this source tree. An additional grant
15438 * of patent rights can be found in the PATENTS file in the same directory.
15439 *
15440 */
15441
15442'use strict';
15443
15444/**
15445 * @param {DOMElement} node input/textarea to focus
15446 */
15447
15448function focusNode(node) {
15449 // IE8 can throw "Can't move focus to the control because it is invisible,
15450 // not enabled, or of a type that does not accept the focus." for all kinds of
15451 // reasons that are too expensive and fragile to test.
15452 try {
15453 node.focus();
15454 } catch (e) {}
15455}
15456
15457module.exports = focusNode;
15458},{}],136:[function(_dereq_,module,exports){
15459'use strict';
15460
15461/**
15462 * Copyright (c) 2013-present, Facebook, Inc.
15463 * All rights reserved.
15464 *
15465 * This source code is licensed under the BSD-style license found in the
15466 * LICENSE file in the root directory of this source tree. An additional grant
15467 * of patent rights can be found in the PATENTS file in the same directory.
15468 *
15469 * @typechecks
15470 */
15471
15472/* eslint-disable fb-www/typeof-undefined */
15473
15474/**
15475 * Same as document.activeElement but wraps in a try-catch block. In IE it is
15476 * not safe to call document.activeElement if there is nothing focused.
15477 *
15478 * The activeElement will be null only if the document or document body is not
15479 * yet defined.
15480 *
15481 * @param {?DOMDocument} doc Defaults to current document.
15482 * @return {?DOMElement}
15483 */
15484function getActiveElement(doc) /*?DOMElement*/{
15485 doc = doc || (typeof document !== 'undefined' ? document : undefined);
15486 if (typeof doc === 'undefined') {
15487 return null;
15488 }
15489 try {
15490 return doc.activeElement || doc.body;
15491 } catch (e) {
15492 return doc.body;
15493 }
15494}
15495
15496module.exports = getActiveElement;
15497},{}],137:[function(_dereq_,module,exports){
15498'use strict';
15499
15500/**
15501 * Copyright (c) 2013-present, Facebook, Inc.
15502 * All rights reserved.
15503 *
15504 * This source code is licensed under the BSD-style license found in the
15505 * LICENSE file in the root directory of this source tree. An additional grant
15506 * of patent rights can be found in the PATENTS file in the same directory.
15507 *
15508 */
15509
15510/*eslint-disable fb-www/unsafe-html */
15511
15512var ExecutionEnvironment = _dereq_(127);
15513
15514var invariant = _dereq_(141);
15515
15516/**
15517 * Dummy container used to detect which wraps are necessary.
15518 */
15519var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
15520
15521/**
15522 * Some browsers cannot use `innerHTML` to render certain elements standalone,
15523 * so we wrap them, render the wrapped nodes, then extract the desired node.
15524 *
15525 * In IE8, certain elements cannot render alone, so wrap all elements ('*').
15526 */
15527
15528var shouldWrap = {};
15529
15530var selectWrap = [1, '<select multiple="true">', '</select>'];
15531var tableWrap = [1, '<table>', '</table>'];
15532var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
15533
15534var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];
15535
15536var markupWrap = {
15537 '*': [1, '?<div>', '</div>'],
15538
15539 'area': [1, '<map>', '</map>'],
15540 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
15541 'legend': [1, '<fieldset>', '</fieldset>'],
15542 'param': [1, '<object>', '</object>'],
15543 'tr': [2, '<table><tbody>', '</tbody></table>'],
15544
15545 'optgroup': selectWrap,
15546 'option': selectWrap,
15547
15548 'caption': tableWrap,
15549 'colgroup': tableWrap,
15550 'tbody': tableWrap,
15551 'tfoot': tableWrap,
15552 'thead': tableWrap,
15553
15554 'td': trWrap,
15555 'th': trWrap
15556};
15557
15558// Initialize the SVG elements since we know they'll always need to be wrapped
15559// consistently. If they are created inside a <div> they will be initialized in
15560// the wrong namespace (and will not display).
15561var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan'];
15562svgElements.forEach(function (nodeName) {
15563 markupWrap[nodeName] = svgWrap;
15564 shouldWrap[nodeName] = true;
15565});
15566
15567/**
15568 * Gets the markup wrap configuration for the supplied `nodeName`.
15569 *
15570 * NOTE: This lazily detects which wraps are necessary for the current browser.
15571 *
15572 * @param {string} nodeName Lowercase `nodeName`.
15573 * @return {?array} Markup wrap configuration, if applicable.
15574 */
15575function getMarkupWrap(nodeName) {
15576 !!!dummyNode ? "development" !== 'production' ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0;
15577 if (!markupWrap.hasOwnProperty(nodeName)) {
15578 nodeName = '*';
15579 }
15580 if (!shouldWrap.hasOwnProperty(nodeName)) {
15581 if (nodeName === '*') {
15582 dummyNode.innerHTML = '<link />';
15583 } else {
15584 dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
15585 }
15586 shouldWrap[nodeName] = !dummyNode.firstChild;
15587 }
15588 return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
15589}
15590
15591module.exports = getMarkupWrap;
15592},{"127":127,"141":141}],138:[function(_dereq_,module,exports){
15593/**
15594 * Copyright (c) 2013-present, Facebook, Inc.
15595 * All rights reserved.
15596 *
15597 * This source code is licensed under the BSD-style license found in the
15598 * LICENSE file in the root directory of this source tree. An additional grant
15599 * of patent rights can be found in the PATENTS file in the same directory.
15600 *
15601 * @typechecks
15602 */
15603
15604'use strict';
15605
15606/**
15607 * Gets the scroll position of the supplied element or window.
15608 *
15609 * The return values are unbounded, unlike `getScrollPosition`. This means they
15610 * may be negative or exceed the element boundaries (which is possible using
15611 * inertial scrolling).
15612 *
15613 * @param {DOMWindow|DOMElement} scrollable
15614 * @return {object} Map with `x` and `y` keys.
15615 */
15616
15617function getUnboundedScrollPosition(scrollable) {
15618 if (scrollable.Window && scrollable instanceof scrollable.Window) {
15619 return {
15620 x: scrollable.pageXOffset || scrollable.document.documentElement.scrollLeft,
15621 y: scrollable.pageYOffset || scrollable.document.documentElement.scrollTop
15622 };
15623 }
15624 return {
15625 x: scrollable.scrollLeft,
15626 y: scrollable.scrollTop
15627 };
15628}
15629
15630module.exports = getUnboundedScrollPosition;
15631},{}],139:[function(_dereq_,module,exports){
15632'use strict';
15633
15634/**
15635 * Copyright (c) 2013-present, Facebook, Inc.
15636 * All rights reserved.
15637 *
15638 * This source code is licensed under the BSD-style license found in the
15639 * LICENSE file in the root directory of this source tree. An additional grant
15640 * of patent rights can be found in the PATENTS file in the same directory.
15641 *
15642 * @typechecks
15643 */
15644
15645var _uppercasePattern = /([A-Z])/g;
15646
15647/**
15648 * Hyphenates a camelcased string, for example:
15649 *
15650 * > hyphenate('backgroundColor')
15651 * < "background-color"
15652 *
15653 * For CSS style names, use `hyphenateStyleName` instead which works properly
15654 * with all vendor prefixes, including `ms`.
15655 *
15656 * @param {string} string
15657 * @return {string}
15658 */
15659function hyphenate(string) {
15660 return string.replace(_uppercasePattern, '-$1').toLowerCase();
15661}
15662
15663module.exports = hyphenate;
15664},{}],140:[function(_dereq_,module,exports){
15665/**
15666 * Copyright (c) 2013-present, Facebook, Inc.
15667 * All rights reserved.
15668 *
15669 * This source code is licensed under the BSD-style license found in the
15670 * LICENSE file in the root directory of this source tree. An additional grant
15671 * of patent rights can be found in the PATENTS file in the same directory.
15672 *
15673 * @typechecks
15674 */
15675
15676'use strict';
15677
15678var hyphenate = _dereq_(139);
15679
15680var msPattern = /^ms-/;
15681
15682/**
15683 * Hyphenates a camelcased CSS property name, for example:
15684 *
15685 * > hyphenateStyleName('backgroundColor')
15686 * < "background-color"
15687 * > hyphenateStyleName('MozTransition')
15688 * < "-moz-transition"
15689 * > hyphenateStyleName('msTransition')
15690 * < "-ms-transition"
15691 *
15692 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
15693 * is converted to `-ms-`.
15694 *
15695 * @param {string} string
15696 * @return {string}
15697 */
15698function hyphenateStyleName(string) {
15699 return hyphenate(string).replace(msPattern, '-ms-');
15700}
15701
15702module.exports = hyphenateStyleName;
15703},{"139":139}],141:[function(_dereq_,module,exports){
15704/**
15705 * Copyright (c) 2013-present, Facebook, Inc.
15706 * All rights reserved.
15707 *
15708 * This source code is licensed under the BSD-style license found in the
15709 * LICENSE file in the root directory of this source tree. An additional grant
15710 * of patent rights can be found in the PATENTS file in the same directory.
15711 *
15712 */
15713
15714'use strict';
15715
15716/**
15717 * Use invariant() to assert state which your program assumes to be true.
15718 *
15719 * Provide sprintf-style format (only %s is supported) and arguments
15720 * to provide information about what broke and what you were
15721 * expecting.
15722 *
15723 * The invariant message will be stripped in production, but the invariant
15724 * will remain to ensure logic does not differ in production.
15725 */
15726
15727var validateFormat = function validateFormat(format) {};
15728
15729if ("development" !== 'production') {
15730 validateFormat = function validateFormat(format) {
15731 if (format === undefined) {
15732 throw new Error('invariant requires an error message argument');
15733 }
15734 };
15735}
15736
15737function invariant(condition, format, a, b, c, d, e, f) {
15738 validateFormat(format);
15739
15740 if (!condition) {
15741 var error;
15742 if (format === undefined) {
15743 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
15744 } else {
15745 var args = [a, b, c, d, e, f];
15746 var argIndex = 0;
15747 error = new Error(format.replace(/%s/g, function () {
15748 return args[argIndex++];
15749 }));
15750 error.name = 'Invariant Violation';
15751 }
15752
15753 error.framesToPop = 1; // we don't care about invariant's own frame
15754 throw error;
15755 }
15756}
15757
15758module.exports = invariant;
15759},{}],142:[function(_dereq_,module,exports){
15760'use strict';
15761
15762/**
15763 * Copyright (c) 2013-present, Facebook, Inc.
15764 * All rights reserved.
15765 *
15766 * This source code is licensed under the BSD-style license found in the
15767 * LICENSE file in the root directory of this source tree. An additional grant
15768 * of patent rights can be found in the PATENTS file in the same directory.
15769 *
15770 * @typechecks
15771 */
15772
15773/**
15774 * @param {*} object The object to check.
15775 * @return {boolean} Whether or not the object is a DOM node.
15776 */
15777function isNode(object) {
15778 var doc = object ? object.ownerDocument || object : document;
15779 var defaultView = doc.defaultView || window;
15780 return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
15781}
15782
15783module.exports = isNode;
15784},{}],143:[function(_dereq_,module,exports){
15785'use strict';
15786
15787/**
15788 * Copyright (c) 2013-present, Facebook, Inc.
15789 * All rights reserved.
15790 *
15791 * This source code is licensed under the BSD-style license found in the
15792 * LICENSE file in the root directory of this source tree. An additional grant
15793 * of patent rights can be found in the PATENTS file in the same directory.
15794 *
15795 * @typechecks
15796 */
15797
15798var isNode = _dereq_(142);
15799
15800/**
15801 * @param {*} object The object to check.
15802 * @return {boolean} Whether or not the object is a DOM text node.
15803 */
15804function isTextNode(object) {
15805 return isNode(object) && object.nodeType == 3;
15806}
15807
15808module.exports = isTextNode;
15809},{"142":142}],144:[function(_dereq_,module,exports){
15810/**
15811 * Copyright (c) 2013-present, Facebook, Inc.
15812 * All rights reserved.
15813 *
15814 * This source code is licensed under the BSD-style license found in the
15815 * LICENSE file in the root directory of this source tree. An additional grant
15816 * of patent rights can be found in the PATENTS file in the same directory.
15817 *
15818 *
15819 * @typechecks static-only
15820 */
15821
15822'use strict';
15823
15824/**
15825 * Memoizes the return value of a function that accepts one string argument.
15826 */
15827
15828function memoizeStringOnly(callback) {
15829 var cache = {};
15830 return function (string) {
15831 if (!cache.hasOwnProperty(string)) {
15832 cache[string] = callback.call(this, string);
15833 }
15834 return cache[string];
15835 };
15836}
15837
15838module.exports = memoizeStringOnly;
15839},{}],145:[function(_dereq_,module,exports){
15840/**
15841 * Copyright (c) 2013-present, Facebook, Inc.
15842 * All rights reserved.
15843 *
15844 * This source code is licensed under the BSD-style license found in the
15845 * LICENSE file in the root directory of this source tree. An additional grant
15846 * of patent rights can be found in the PATENTS file in the same directory.
15847 *
15848 * @typechecks
15849 */
15850
15851'use strict';
15852
15853var ExecutionEnvironment = _dereq_(127);
15854
15855var performance;
15856
15857if (ExecutionEnvironment.canUseDOM) {
15858 performance = window.performance || window.msPerformance || window.webkitPerformance;
15859}
15860
15861module.exports = performance || {};
15862},{"127":127}],146:[function(_dereq_,module,exports){
15863'use strict';
15864
15865/**
15866 * Copyright (c) 2013-present, Facebook, Inc.
15867 * All rights reserved.
15868 *
15869 * This source code is licensed under the BSD-style license found in the
15870 * LICENSE file in the root directory of this source tree. An additional grant
15871 * of patent rights can be found in the PATENTS file in the same directory.
15872 *
15873 * @typechecks
15874 */
15875
15876var performance = _dereq_(145);
15877
15878var performanceNow;
15879
15880/**
15881 * Detect if we can use `window.performance.now()` and gracefully fallback to
15882 * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now
15883 * because of Facebook's testing infrastructure.
15884 */
15885if (performance.now) {
15886 performanceNow = function performanceNow() {
15887 return performance.now();
15888 };
15889} else {
15890 performanceNow = function performanceNow() {
15891 return Date.now();
15892 };
15893}
15894
15895module.exports = performanceNow;
15896},{"145":145}],147:[function(_dereq_,module,exports){
15897/**
15898 * Copyright (c) 2013-present, Facebook, Inc.
15899 * All rights reserved.
15900 *
15901 * This source code is licensed under the BSD-style license found in the
15902 * LICENSE file in the root directory of this source tree. An additional grant
15903 * of patent rights can be found in the PATENTS file in the same directory.
15904 *
15905 * @typechecks
15906 *
15907 */
15908
15909/*eslint-disable no-self-compare */
15910
15911'use strict';
15912
15913var hasOwnProperty = Object.prototype.hasOwnProperty;
15914
15915/**
15916 * inlined Object.is polyfill to avoid requiring consumers ship their own
15917 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
15918 */
15919function is(x, y) {
15920 // SameValue algorithm
15921 if (x === y) {
15922 // Steps 1-5, 7-10
15923 // Steps 6.b-6.e: +0 != -0
15924 // Added the nonzero y check to make Flow happy, but it is redundant
15925 return x !== 0 || y !== 0 || 1 / x === 1 / y;
15926 } else {
15927 // Step 6.a: NaN == NaN
15928 return x !== x && y !== y;
15929 }
15930}
15931
15932/**
15933 * Performs equality by iterating through keys on an object and returning false
15934 * when any key has values which are not strictly equal between the arguments.
15935 * Returns true when the values of all keys are strictly equal.
15936 */
15937function shallowEqual(objA, objB) {
15938 if (is(objA, objB)) {
15939 return true;
15940 }
15941
15942 if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
15943 return false;
15944 }
15945
15946 var keysA = Object.keys(objA);
15947 var keysB = Object.keys(objB);
15948
15949 if (keysA.length !== keysB.length) {
15950 return false;
15951 }
15952
15953 // Test for A's keys different from B.
15954 for (var i = 0; i < keysA.length; i++) {
15955 if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
15956 return false;
15957 }
15958 }
15959
15960 return true;
15961}
15962
15963module.exports = shallowEqual;
15964},{}],148:[function(_dereq_,module,exports){
15965/**
15966 * Copyright 2014-2015, Facebook, Inc.
15967 * All rights reserved.
15968 *
15969 * This source code is licensed under the BSD-style license found in the
15970 * LICENSE file in the root directory of this source tree. An additional grant
15971 * of patent rights can be found in the PATENTS file in the same directory.
15972 *
15973 */
15974
15975'use strict';
15976
15977var emptyFunction = _dereq_(133);
15978
15979/**
15980 * Similar to invariant but only logs a warning if the condition is not met.
15981 * This can be used to log issues in development environments in critical
15982 * paths. Removing the logging code for production environments will keep the
15983 * same logic and follow the same code paths.
15984 */
15985
15986var warning = emptyFunction;
15987
15988if ("development" !== 'production') {
15989 (function () {
15990 var printWarning = function printWarning(format) {
15991 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
15992 args[_key - 1] = arguments[_key];
15993 }
15994
15995 var argIndex = 0;
15996 var message = 'Warning: ' + format.replace(/%s/g, function () {
15997 return args[argIndex++];
15998 });
15999 if (typeof console !== 'undefined') {
16000 console.error(message);
16001 }
16002 try {
16003 // --- Welcome to debugging React ---
16004 // This error was thrown as a convenience so that you can use this stack
16005 // to find the callsite that caused this warning to fire.
16006 throw new Error(message);
16007 } catch (x) {}
16008 };
16009
16010 warning = function warning(condition, format) {
16011 if (format === undefined) {
16012 throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
16013 }
16014
16015 if (format.indexOf('Failed Composite propType: ') === 0) {
16016 return; // Ignore CompositeComponent proptype check.
16017 }
16018
16019 if (!condition) {
16020 for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
16021 args[_key2 - 2] = arguments[_key2];
16022 }
16023
16024 printWarning.apply(undefined, [format].concat(args));
16025 }
16026 };
16027 })();
16028}
16029
16030module.exports = warning;
16031},{"133":133}],149:[function(_dereq_,module,exports){
16032/*
16033object-assign
16034(c) Sindre Sorhus
16035@license MIT
16036*/
16037
16038'use strict';
16039/* eslint-disable no-unused-vars */
16040var getOwnPropertySymbols = Object.getOwnPropertySymbols;
16041var hasOwnProperty = Object.prototype.hasOwnProperty;
16042var propIsEnumerable = Object.prototype.propertyIsEnumerable;
16043
16044function toObject(val) {
16045 if (val === null || val === undefined) {
16046 throw new TypeError('Object.assign cannot be called with null or undefined');
16047 }
16048
16049 return Object(val);
16050}
16051
16052function shouldUseNative() {
16053 try {
16054 if (!Object.assign) {
16055 return false;
16056 }
16057
16058 // Detect buggy property enumeration order in older V8 versions.
16059
16060 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
16061 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
16062 test1[5] = 'de';
16063 if (Object.getOwnPropertyNames(test1)[0] === '5') {
16064 return false;
16065 }
16066
16067 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
16068 var test2 = {};
16069 for (var i = 0; i < 10; i++) {
16070 test2['_' + String.fromCharCode(i)] = i;
16071 }
16072 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
16073 return test2[n];
16074 });
16075 if (order2.join('') !== '0123456789') {
16076 return false;
16077 }
16078
16079 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
16080 var test3 = {};
16081 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
16082 test3[letter] = letter;
16083 });
16084 if (Object.keys(Object.assign({}, test3)).join('') !==
16085 'abcdefghijklmnopqrst') {
16086 return false;
16087 }
16088
16089 return true;
16090 } catch (err) {
16091 // We don't expect any of the above to throw, but better to be safe.
16092 return false;
16093 }
16094}
16095
16096module.exports = shouldUseNative() ? Object.assign : function (target, source) {
16097 var from;
16098 var to = toObject(target);
16099 var symbols;
16100
16101 for (var s = 1; s < arguments.length; s++) {
16102 from = Object(arguments[s]);
16103
16104 for (var key in from) {
16105 if (hasOwnProperty.call(from, key)) {
16106 to[key] = from[key];
16107 }
16108 }
16109
16110 if (getOwnPropertySymbols) {
16111 symbols = getOwnPropertySymbols(from);
16112 for (var i = 0; i < symbols.length; i++) {
16113 if (propIsEnumerable.call(from, symbols[i])) {
16114 to[symbols[i]] = from[symbols[i]];
16115 }
16116 }
16117 }
16118 }
16119
16120 return to;
16121};
16122
16123},{}],150:[function(_dereq_,module,exports){
16124/**
16125 * Copyright 2013-present, Facebook, Inc.
16126 * All rights reserved.
16127 *
16128 * This source code is licensed under the BSD-style license found in the
16129 * LICENSE file in the root directory of this source tree. An additional grant
16130 * of patent rights can be found in the PATENTS file in the same directory.
16131 */
16132
16133'use strict';
16134
16135if ("development" !== 'production') {
16136 var invariant = _dereq_(141);
16137 var warning = _dereq_(148);
16138 var ReactPropTypesSecret = _dereq_(153);
16139 var loggedTypeFailures = {};
16140}
16141
16142/**
16143 * Assert that the values match with the type specs.
16144 * Error messages are memorized and will only be shown once.
16145 *
16146 * @param {object} typeSpecs Map of name to a ReactPropType
16147 * @param {object} values Runtime values that need to be type-checked
16148 * @param {string} location e.g. "prop", "context", "child context"
16149 * @param {string} componentName Name of the component for error messages.
16150 * @param {?Function} getStack Returns the component stack.
16151 * @private
16152 */
16153function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
16154 if ("development" !== 'production') {
16155 for (var typeSpecName in typeSpecs) {
16156 if (typeSpecs.hasOwnProperty(typeSpecName)) {
16157 var error;
16158 // Prop type validation may throw. In case they do, we don't want to
16159 // fail the render phase where it didn't fail before. So we log it.
16160 // After these have been cleaned up, we'll let them throw.
16161 try {
16162 // This is intentionally an invariant that gets caught. It's the same
16163 // behavior as without this statement except with a better message.
16164 invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
16165 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
16166 } catch (ex) {
16167 error = ex;
16168 }
16169 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', location, typeSpecName, typeof error);
16170 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
16171 // Only monitor this failure once because there tends to be a lot of the
16172 // same error.
16173 loggedTypeFailures[error.message] = true;
16174
16175 var stack = getStack ? getStack() : '';
16176
16177 warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
16178 }
16179 }
16180 }
16181 }
16182}
16183
16184module.exports = checkPropTypes;
16185
16186},{"141":141,"148":148,"153":153}],151:[function(_dereq_,module,exports){
16187/**
16188 * Copyright 2013-present, Facebook, Inc.
16189 * All rights reserved.
16190 *
16191 * This source code is licensed under the BSD-style license found in the
16192 * LICENSE file in the root directory of this source tree. An additional grant
16193 * of patent rights can be found in the PATENTS file in the same directory.
16194 */
16195
16196'use strict';
16197
16198// React 15.5 references this module, and assumes PropTypes are still callable in production.
16199// Therefore we re-export development-only version with all the PropTypes checks here.
16200// However if one is migrating to the `prop-types` npm library, they will go through the
16201// `index.js` entry point, and it will branch depending on the environment.
16202var factory = _dereq_(152);
16203module.exports = function(isValidElement) {
16204 // It is still allowed in 15.5.
16205 var throwOnDirectAccess = false;
16206 return factory(isValidElement, throwOnDirectAccess);
16207};
16208
16209},{"152":152}],152:[function(_dereq_,module,exports){
16210/**
16211 * Copyright 2013-present, Facebook, Inc.
16212 * All rights reserved.
16213 *
16214 * This source code is licensed under the BSD-style license found in the
16215 * LICENSE file in the root directory of this source tree. An additional grant
16216 * of patent rights can be found in the PATENTS file in the same directory.
16217 */
16218
16219'use strict';
16220
16221var emptyFunction = _dereq_(133);
16222var invariant = _dereq_(141);
16223var warning = _dereq_(148);
16224
16225var ReactPropTypesSecret = _dereq_(153);
16226var checkPropTypes = _dereq_(150);
16227
16228module.exports = function(isValidElement, throwOnDirectAccess) {
16229 /* global Symbol */
16230 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
16231 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
16232
16233 /**
16234 * Returns the iterator method function contained on the iterable object.
16235 *
16236 * Be sure to invoke the function with the iterable as context:
16237 *
16238 * var iteratorFn = getIteratorFn(myIterable);
16239 * if (iteratorFn) {
16240 * var iterator = iteratorFn.call(myIterable);
16241 * ...
16242 * }
16243 *
16244 * @param {?object} maybeIterable
16245 * @return {?function}
16246 */
16247 function getIteratorFn(maybeIterable) {
16248 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
16249 if (typeof iteratorFn === 'function') {
16250 return iteratorFn;
16251 }
16252 }
16253
16254 /**
16255 * Collection of methods that allow declaration and validation of props that are
16256 * supplied to React components. Example usage:
16257 *
16258 * var Props = require('ReactPropTypes');
16259 * var MyArticle = React.createClass({
16260 * propTypes: {
16261 * // An optional string prop named "description".
16262 * description: Props.string,
16263 *
16264 * // A required enum prop named "category".
16265 * category: Props.oneOf(['News','Photos']).isRequired,
16266 *
16267 * // A prop named "dialog" that requires an instance of Dialog.
16268 * dialog: Props.instanceOf(Dialog).isRequired
16269 * },
16270 * render: function() { ... }
16271 * });
16272 *
16273 * A more formal specification of how these methods are used:
16274 *
16275 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
16276 * decl := ReactPropTypes.{type}(.isRequired)?
16277 *
16278 * Each and every declaration produces a function with the same signature. This
16279 * allows the creation of custom validation functions. For example:
16280 *
16281 * var MyLink = React.createClass({
16282 * propTypes: {
16283 * // An optional string or URI prop named "href".
16284 * href: function(props, propName, componentName) {
16285 * var propValue = props[propName];
16286 * if (propValue != null && typeof propValue !== 'string' &&
16287 * !(propValue instanceof URI)) {
16288 * return new Error(
16289 * 'Expected a string or an URI for ' + propName + ' in ' +
16290 * componentName
16291 * );
16292 * }
16293 * }
16294 * },
16295 * render: function() {...}
16296 * });
16297 *
16298 * @internal
16299 */
16300
16301 var ANONYMOUS = '<<anonymous>>';
16302
16303 // Important!
16304 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
16305 var ReactPropTypes = {
16306 array: createPrimitiveTypeChecker('array'),
16307 bool: createPrimitiveTypeChecker('boolean'),
16308 func: createPrimitiveTypeChecker('function'),
16309 number: createPrimitiveTypeChecker('number'),
16310 object: createPrimitiveTypeChecker('object'),
16311 string: createPrimitiveTypeChecker('string'),
16312 symbol: createPrimitiveTypeChecker('symbol'),
16313
16314 any: createAnyTypeChecker(),
16315 arrayOf: createArrayOfTypeChecker,
16316 element: createElementTypeChecker(),
16317 instanceOf: createInstanceTypeChecker,
16318 node: createNodeChecker(),
16319 objectOf: createObjectOfTypeChecker,
16320 oneOf: createEnumTypeChecker,
16321 oneOfType: createUnionTypeChecker,
16322 shape: createShapeTypeChecker
16323 };
16324
16325 /**
16326 * inlined Object.is polyfill to avoid requiring consumers ship their own
16327 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
16328 */
16329 /*eslint-disable no-self-compare*/
16330 function is(x, y) {
16331 // SameValue algorithm
16332 if (x === y) {
16333 // Steps 1-5, 7-10
16334 // Steps 6.b-6.e: +0 != -0
16335 return x !== 0 || 1 / x === 1 / y;
16336 } else {
16337 // Step 6.a: NaN == NaN
16338 return x !== x && y !== y;
16339 }
16340 }
16341 /*eslint-enable no-self-compare*/
16342
16343 /**
16344 * We use an Error-like object for backward compatibility as people may call
16345 * PropTypes directly and inspect their output. However, we don't use real
16346 * Errors anymore. We don't inspect their stack anyway, and creating them
16347 * is prohibitively expensive if they are created too often, such as what
16348 * happens in oneOfType() for any type before the one that matched.
16349 */
16350 function PropTypeError(message) {
16351 this.message = message;
16352 this.stack = '';
16353 }
16354 // Make `instanceof Error` still work for returned errors.
16355 PropTypeError.prototype = Error.prototype;
16356
16357 function createChainableTypeChecker(validate) {
16358 if ("development" !== 'production') {
16359 var manualPropTypeCallCache = {};
16360 var manualPropTypeWarningCount = 0;
16361 }
16362 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
16363 componentName = componentName || ANONYMOUS;
16364 propFullName = propFullName || propName;
16365
16366 if (secret !== ReactPropTypesSecret) {
16367 if (throwOnDirectAccess) {
16368 // New behavior only for users of `prop-types` package
16369 invariant(
16370 false,
16371 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
16372 'Use `PropTypes.checkPropTypes()` to call them. ' +
16373 'Read more at http://fb.me/use-check-prop-types'
16374 );
16375 } else if ("development" !== 'production' && typeof console !== 'undefined') {
16376 // Old behavior for people using React.PropTypes
16377 var cacheKey = componentName + ':' + propName;
16378 if (
16379 !manualPropTypeCallCache[cacheKey] &&
16380 // Avoid spamming the console because they are often not actionable except for lib authors
16381 manualPropTypeWarningCount < 3
16382 ) {
16383 warning(
16384 false,
16385 'You are manually calling a React.PropTypes validation ' +
16386 'function for the `%s` prop on `%s`. This is deprecated ' +
16387 'and will throw in the standalone `prop-types` package. ' +
16388 'You may be seeing this warning due to a third-party PropTypes ' +
16389 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
16390 propFullName,
16391 componentName
16392 );
16393 manualPropTypeCallCache[cacheKey] = true;
16394 manualPropTypeWarningCount++;
16395 }
16396 }
16397 }
16398 if (props[propName] == null) {
16399 if (isRequired) {
16400 if (props[propName] === null) {
16401 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
16402 }
16403 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
16404 }
16405 return null;
16406 } else {
16407 return validate(props, propName, componentName, location, propFullName);
16408 }
16409 }
16410
16411 var chainedCheckType = checkType.bind(null, false);
16412 chainedCheckType.isRequired = checkType.bind(null, true);
16413
16414 return chainedCheckType;
16415 }
16416
16417 function createPrimitiveTypeChecker(expectedType) {
16418 function validate(props, propName, componentName, location, propFullName, secret) {
16419 var propValue = props[propName];
16420 var propType = getPropType(propValue);
16421 if (propType !== expectedType) {
16422 // `propValue` being instance of, say, date/regexp, pass the 'object'
16423 // check, but we can offer a more precise error message here rather than
16424 // 'of type `object`'.
16425 var preciseType = getPreciseType(propValue);
16426
16427 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
16428 }
16429 return null;
16430 }
16431 return createChainableTypeChecker(validate);
16432 }
16433
16434 function createAnyTypeChecker() {
16435 return createChainableTypeChecker(emptyFunction.thatReturnsNull);
16436 }
16437
16438 function createArrayOfTypeChecker(typeChecker) {
16439 function validate(props, propName, componentName, location, propFullName) {
16440 if (typeof typeChecker !== 'function') {
16441 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
16442 }
16443 var propValue = props[propName];
16444 if (!Array.isArray(propValue)) {
16445 var propType = getPropType(propValue);
16446 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
16447 }
16448 for (var i = 0; i < propValue.length; i++) {
16449 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
16450 if (error instanceof Error) {
16451 return error;
16452 }
16453 }
16454 return null;
16455 }
16456 return createChainableTypeChecker(validate);
16457 }
16458
16459 function createElementTypeChecker() {
16460 function validate(props, propName, componentName, location, propFullName) {
16461 var propValue = props[propName];
16462 if (!isValidElement(propValue)) {
16463 var propType = getPropType(propValue);
16464 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
16465 }
16466 return null;
16467 }
16468 return createChainableTypeChecker(validate);
16469 }
16470
16471 function createInstanceTypeChecker(expectedClass) {
16472 function validate(props, propName, componentName, location, propFullName) {
16473 if (!(props[propName] instanceof expectedClass)) {
16474 var expectedClassName = expectedClass.name || ANONYMOUS;
16475 var actualClassName = getClassName(props[propName]);
16476 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
16477 }
16478 return null;
16479 }
16480 return createChainableTypeChecker(validate);
16481 }
16482
16483 function createEnumTypeChecker(expectedValues) {
16484 if (!Array.isArray(expectedValues)) {
16485 "development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
16486 return emptyFunction.thatReturnsNull;
16487 }
16488
16489 function validate(props, propName, componentName, location, propFullName) {
16490 var propValue = props[propName];
16491 for (var i = 0; i < expectedValues.length; i++) {
16492 if (is(propValue, expectedValues[i])) {
16493 return null;
16494 }
16495 }
16496
16497 var valuesString = JSON.stringify(expectedValues);
16498 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
16499 }
16500 return createChainableTypeChecker(validate);
16501 }
16502
16503 function createObjectOfTypeChecker(typeChecker) {
16504 function validate(props, propName, componentName, location, propFullName) {
16505 if (typeof typeChecker !== 'function') {
16506 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
16507 }
16508 var propValue = props[propName];
16509 var propType = getPropType(propValue);
16510 if (propType !== 'object') {
16511 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
16512 }
16513 for (var key in propValue) {
16514 if (propValue.hasOwnProperty(key)) {
16515 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
16516 if (error instanceof Error) {
16517 return error;
16518 }
16519 }
16520 }
16521 return null;
16522 }
16523 return createChainableTypeChecker(validate);
16524 }
16525
16526 function createUnionTypeChecker(arrayOfTypeCheckers) {
16527 if (!Array.isArray(arrayOfTypeCheckers)) {
16528 "development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
16529 return emptyFunction.thatReturnsNull;
16530 }
16531
16532 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
16533 var checker = arrayOfTypeCheckers[i];
16534 if (typeof checker !== 'function') {
16535 warning(
16536 false,
16537 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
16538 'received %s at index %s.',
16539 getPostfixForTypeWarning(checker),
16540 i
16541 );
16542 return emptyFunction.thatReturnsNull;
16543 }
16544 }
16545
16546 function validate(props, propName, componentName, location, propFullName) {
16547 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
16548 var checker = arrayOfTypeCheckers[i];
16549 if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
16550 return null;
16551 }
16552 }
16553
16554 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
16555 }
16556 return createChainableTypeChecker(validate);
16557 }
16558
16559 function createNodeChecker() {
16560 function validate(props, propName, componentName, location, propFullName) {
16561 if (!isNode(props[propName])) {
16562 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
16563 }
16564 return null;
16565 }
16566 return createChainableTypeChecker(validate);
16567 }
16568
16569 function createShapeTypeChecker(shapeTypes) {
16570 function validate(props, propName, componentName, location, propFullName) {
16571 var propValue = props[propName];
16572 var propType = getPropType(propValue);
16573 if (propType !== 'object') {
16574 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
16575 }
16576 for (var key in shapeTypes) {
16577 var checker = shapeTypes[key];
16578 if (!checker) {
16579 continue;
16580 }
16581 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
16582 if (error) {
16583 return error;
16584 }
16585 }
16586 return null;
16587 }
16588 return createChainableTypeChecker(validate);
16589 }
16590
16591 function isNode(propValue) {
16592 switch (typeof propValue) {
16593 case 'number':
16594 case 'string':
16595 case 'undefined':
16596 return true;
16597 case 'boolean':
16598 return !propValue;
16599 case 'object':
16600 if (Array.isArray(propValue)) {
16601 return propValue.every(isNode);
16602 }
16603 if (propValue === null || isValidElement(propValue)) {
16604 return true;
16605 }
16606
16607 var iteratorFn = getIteratorFn(propValue);
16608 if (iteratorFn) {
16609 var iterator = iteratorFn.call(propValue);
16610 var step;
16611 if (iteratorFn !== propValue.entries) {
16612 while (!(step = iterator.next()).done) {
16613 if (!isNode(step.value)) {
16614 return false;
16615 }
16616 }
16617 } else {
16618 // Iterator will provide entry [k,v] tuples rather than values.
16619 while (!(step = iterator.next()).done) {
16620 var entry = step.value;
16621 if (entry) {
16622 if (!isNode(entry[1])) {
16623 return false;
16624 }
16625 }
16626 }
16627 }
16628 } else {
16629 return false;
16630 }
16631
16632 return true;
16633 default:
16634 return false;
16635 }
16636 }
16637
16638 function isSymbol(propType, propValue) {
16639 // Native Symbol.
16640 if (propType === 'symbol') {
16641 return true;
16642 }
16643
16644 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
16645 if (propValue['@@toStringTag'] === 'Symbol') {
16646 return true;
16647 }
16648
16649 // Fallback for non-spec compliant Symbols which are polyfilled.
16650 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
16651 return true;
16652 }
16653
16654 return false;
16655 }
16656
16657 // Equivalent of `typeof` but with special handling for array and regexp.
16658 function getPropType(propValue) {
16659 var propType = typeof propValue;
16660 if (Array.isArray(propValue)) {
16661 return 'array';
16662 }
16663 if (propValue instanceof RegExp) {
16664 // Old webkits (at least until Android 4.0) return 'function' rather than
16665 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
16666 // passes PropTypes.object.
16667 return 'object';
16668 }
16669 if (isSymbol(propType, propValue)) {
16670 return 'symbol';
16671 }
16672 return propType;
16673 }
16674
16675 // This handles more types than `getPropType`. Only used for error messages.
16676 // See `createPrimitiveTypeChecker`.
16677 function getPreciseType(propValue) {
16678 if (typeof propValue === 'undefined' || propValue === null) {
16679 return '' + propValue;
16680 }
16681 var propType = getPropType(propValue);
16682 if (propType === 'object') {
16683 if (propValue instanceof Date) {
16684 return 'date';
16685 } else if (propValue instanceof RegExp) {
16686 return 'regexp';
16687 }
16688 }
16689 return propType;
16690 }
16691
16692 // Returns a string that is postfixed to a warning about an invalid type.
16693 // For example, "undefined" or "of type array"
16694 function getPostfixForTypeWarning(value) {
16695 var type = getPreciseType(value);
16696 switch (type) {
16697 case 'array':
16698 case 'object':
16699 return 'an ' + type;
16700 case 'boolean':
16701 case 'date':
16702 case 'regexp':
16703 return 'a ' + type;
16704 default:
16705 return type;
16706 }
16707 }
16708
16709 // Returns class name of the object, if any.
16710 function getClassName(propValue) {
16711 if (!propValue.constructor || !propValue.constructor.name) {
16712 return ANONYMOUS;
16713 }
16714 return propValue.constructor.name;
16715 }
16716
16717 ReactPropTypes.checkPropTypes = checkPropTypes;
16718 ReactPropTypes.PropTypes = ReactPropTypes;
16719
16720 return ReactPropTypes;
16721};
16722
16723},{"133":133,"141":141,"148":148,"150":150,"153":153}],153:[function(_dereq_,module,exports){
16724/**
16725 * Copyright 2013-present, Facebook, Inc.
16726 * All rights reserved.
16727 *
16728 * This source code is licensed under the BSD-style license found in the
16729 * LICENSE file in the root directory of this source tree. An additional grant
16730 * of patent rights can be found in the PATENTS file in the same directory.
16731 */
16732
16733'use strict';
16734
16735var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
16736
16737module.exports = ReactPropTypesSecret;
16738
16739},{}]},{},[41])(41)
16740});
16741});