Simon Egersand
2018-02-11 12add8e864157a0593398fd0db943f040aea0d52
commit | author | age
d76f7b 1 /*
12add8 2 react-datetime v2.14.0
be9654 3 https://github.com/YouCanBookMe/react-datetime
SE 4 MIT: https://github.com/YouCanBookMe/react-datetime/raw/master/LICENSE
d76f7b 5 */
M 6 (function webpackUniversalModuleDefinition(root, factory) {
7     if(typeof exports === 'object' && typeof module === 'object')
be31e2 8         module.exports = factory(require("React"), require("moment"), require("ReactDOM"));
d76f7b 9     else if(typeof define === 'function' && define.amd)
be31e2 10         define(["React", "moment", "ReactDOM"], factory);
d76f7b 11     else if(typeof exports === 'object')
be31e2 12         exports["Datetime"] = factory(require("React"), require("moment"), require("ReactDOM"));
d76f7b 13     else
be31e2 14         root["Datetime"] = factory(root["React"], root["moment"], root["ReactDOM"]);
94dde5 15 })(this, function(__WEBPACK_EXTERNAL_MODULE_13__, __WEBPACK_EXTERNAL_MODULE_17__, __WEBPACK_EXTERNAL_MODULE_21__) {
d76f7b 16 return /******/ (function(modules) { // webpackBootstrap
M 17 /******/     // The module cache
18 /******/     var installedModules = {};
19
20 /******/     // The require function
21 /******/     function __webpack_require__(moduleId) {
22
23 /******/         // Check if module is in cache
24 /******/         if(installedModules[moduleId])
25 /******/             return installedModules[moduleId].exports;
26
27 /******/         // Create a new module (and put it into the cache)
28 /******/         var module = installedModules[moduleId] = {
29 /******/             exports: {},
30 /******/             id: moduleId,
31 /******/             loaded: false
32 /******/         };
33
34 /******/         // Execute the module function
35 /******/         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
36
37 /******/         // Flag the module as loaded
38 /******/         module.loaded = true;
39
40 /******/         // Return the exports of the module
41 /******/         return module.exports;
42 /******/     }
43
44
45 /******/     // expose the modules object (__webpack_modules__)
46 /******/     __webpack_require__.m = modules;
47
48 /******/     // expose the module cache
49 /******/     __webpack_require__.c = installedModules;
50
51 /******/     // __webpack_public_path__
52 /******/     __webpack_require__.p = "";
53
54 /******/     // Load entry module and return exports
55 /******/     return __webpack_require__(0);
56 /******/ })
57 /************************************************************************/
58 /******/ ([
59 /* 0 */
7392ed 60 /***/ (function(module, exports, __webpack_require__) {
d76f7b 61
be9654 62     'use strict';
SE 63
64     var assign = __webpack_require__(1),
833531 65         PropTypes = __webpack_require__(2),
94dde5 66         createClass = __webpack_require__(12),
SE 67         moment = __webpack_require__(17),
68         React = __webpack_require__(13),
69         CalendarContainer = __webpack_require__(18)
8f6f33 70         ;
be9654 71
12add8 72     var viewModes = Object.freeze({
SE 73         YEARS: 'years',
74         MONTHS: 'months',
75         DAYS: 'days',
76         TIME: 'time',
77     });
78
be31e2 79     var TYPES = PropTypes;
JB 80     var Datetime = createClass({
be9654 81         propTypes: {
SE 82             // value: TYPES.object | TYPES.string,
83             // defaultValue: TYPES.object | TYPES.string,
94dde5 84             // viewDate: TYPES.object | TYPES.string,
be9654 85             onFocus: TYPES.func,
SE 86             onBlur: TYPES.func,
87             onChange: TYPES.func,
833531 88             onViewModeChange: TYPES.func,
be9654 89             locale: TYPES.string,
SE 90             utc: TYPES.bool,
91             input: TYPES.bool,
92             // dateFormat: TYPES.string | TYPES.bool,
93             // timeFormat: TYPES.string | TYPES.bool,
94             inputProps: TYPES.object,
95             timeConstraints: TYPES.object,
12add8 96             viewMode: TYPES.oneOf([viewModes.YEARS, viewModes.MONTHS, viewModes.DAYS, viewModes.TIME]),
be9654 97             isValidDate: TYPES.func,
SE 98             open: TYPES.bool,
99             strictParsing: TYPES.bool,
100             closeOnSelect: TYPES.bool,
101             closeOnTab: TYPES.bool
102         },
103
104         getInitialState: function() {
105             var state = this.getStateFromProps( this.props );
106
107             if ( state.open === undefined )
108                 state.open = !this.props.input;
109
12add8 110             state.currentView = this.props.dateFormat ?
SE 111                 (this.props.viewMode || state.updateOn || viewModes.DAYS) : viewModes.TIME;
be9654 112
SE 113             return state;
114         },
115
94dde5 116         parseDate: function (date, formats) {
SE 117             var parsedDate;
118
119             if (date && typeof date === 'string')
120                 parsedDate = this.localMoment(date, formats.datetime);
121             else if (date)
122                 parsedDate = this.localMoment(date);
123
124             if (parsedDate && !parsedDate.isValid())
125                 parsedDate = null;
126
127             return parsedDate;
128         },
129
be9654 130         getStateFromProps: function( props ) {
SE 131             var formats = this.getFormats( props ),
132                 date = props.value || props.defaultValue,
133                 selectedDate, viewDate, updateOn, inputValue
8f6f33 134                 ;
be9654 135
94dde5 136             selectedDate = this.parseDate(date, formats);
be9654 137
94dde5 138             viewDate = this.parseDate(props.viewDate, formats);
be9654 139
SE 140             viewDate = selectedDate ?
141                 selectedDate.clone().startOf('month') :
94dde5 142                 viewDate ? viewDate.clone().startOf('month') : this.localMoment().startOf('month');
be9654 143
SE 144             updateOn = this.getUpdateOn(formats);
145
146             if ( selectedDate )
147                 inputValue = selectedDate.format(formats.datetime);
148             else if ( date.isValid && !date.isValid() )
149                 inputValue = '';
150             else
151                 inputValue = date || '';
152
153             return {
154                 updateOn: updateOn,
155                 inputFormat: formats.datetime,
156                 viewDate: viewDate,
157                 selectedDate: selectedDate,
158                 inputValue: inputValue,
159                 open: props.open
160             };
161         },
162
163         getUpdateOn: function( formats ) {
8f6f33 164             if ( formats.date.match(/[lLD]/) ) {
12add8 165                 return viewModes.DAYS;
833531 166             } else if ( formats.date.indexOf('M') !== -1 ) {
12add8 167                 return viewModes.MONTHS;
833531 168             } else if ( formats.date.indexOf('Y') !== -1 ) {
12add8 169                 return viewModes.YEARS;
be9654 170             }
SE 171
12add8 172             return viewModes.DAYS;
be9654 173         },
SE 174
175         getFormats: function( props ) {
176             var formats = {
177                     date: props.dateFormat || '',
178                     time: props.timeFormat || ''
179                 },
180                 locale = this.localMoment( props.date, null, props ).localeData()
8f6f33 181                 ;
be9654 182
SE 183             if ( formats.date === true ) {
184                 formats.date = locale.longDateFormat('L');
185             }
12add8 186             else if ( this.getUpdateOn(formats) !== viewModes.DAYS ) {
be9654 187                 formats.time = '';
SE 188             }
189
190             if ( formats.time === true ) {
191                 formats.time = locale.longDateFormat('LT');
192             }
193
194             formats.datetime = formats.date && formats.time ?
195                 formats.date + ' ' + formats.time :
196                 formats.date || formats.time
197             ;
198
199             return formats;
200         },
201
202         componentWillReceiveProps: function( nextProps ) {
203             var formats = this.getFormats( nextProps ),
204                 updatedState = {}
205             ;
206
207             if ( nextProps.value !== this.props.value ||
208                 formats.datetime !== this.getFormats( this.props ).datetime ) {
209                 updatedState = this.getStateFromProps( nextProps );
210             }
211
212             if ( updatedState.open === undefined ) {
94dde5 213                 if ( typeof nextProps.open !== 'undefined' ) {
SE 214                     updatedState.open = nextProps.open;
12add8 215                 } else if ( this.props.closeOnSelect && this.state.currentView !== viewModes.TIME ) {
a6752b 216                     updatedState.open = false;
7750ac 217                 } else {
a6752b 218                     updatedState.open = this.state.open;
SE 219                 }
be9654 220             }
SE 221
222             if ( nextProps.viewMode !== this.props.viewMode ) {
223                 updatedState.currentView = nextProps.viewMode;
224             }
225
226             if ( nextProps.locale !== this.props.locale ) {
227                 if ( this.state.viewDate ) {
228                     var updatedViewDate = this.state.viewDate.clone().locale( nextProps.locale );
229                     updatedState.viewDate = updatedViewDate;
230                 }
231                 if ( this.state.selectedDate ) {
232                     var updatedSelectedDate = this.state.selectedDate.clone().locale( nextProps.locale );
233                     updatedState.selectedDate = updatedSelectedDate;
234                     updatedState.inputValue = updatedSelectedDate.format( formats.datetime );
235                 }
236             }
237
238             if ( nextProps.utc !== this.props.utc ) {
239                 if ( nextProps.utc ) {
240                     if ( this.state.viewDate )
241                         updatedState.viewDate = this.state.viewDate.clone().utc();
242                     if ( this.state.selectedDate ) {
243                         updatedState.selectedDate = this.state.selectedDate.clone().utc();
244                         updatedState.inputValue = updatedState.selectedDate.format( formats.datetime );
245                     }
246                 } else {
247                     if ( this.state.viewDate )
248                         updatedState.viewDate = this.state.viewDate.clone().local();
249                     if ( this.state.selectedDate ) {
250                         updatedState.selectedDate = this.state.selectedDate.clone().local();
251                         updatedState.inputValue = updatedState.selectedDate.format(formats.datetime);
252                     }
253                 }
12add8 254             }
SE 255
256             if ( nextProps.viewDate !== this.props.viewDate ) {
257                 updatedState.viewDate = moment(nextProps.viewDate);
be9654 258             }
39b827 259             //we should only show a valid date if we are provided a isValidDate function. Removed in 2.10.3
LA 260             /*if (this.props.isValidDate) {
8f6f33 261                 updatedState.viewDate = updatedState.viewDate || this.state.viewDate;
LA 262                 while (!this.props.isValidDate(updatedState.viewDate)) {
263                     updatedState.viewDate = updatedState.viewDate.add(1, 'day');
264                 }
39b827 265             }*/
be9654 266             this.setState( updatedState );
SE 267         },
268
269         onInputChange: function( e ) {
270             var value = e.target === null ? e : e.target.value,
271                 localMoment = this.localMoment( value, this.state.inputFormat ),
272                 update = { inputValue: value }
8f6f33 273                 ;
be9654 274
SE 275             if ( localMoment.isValid() && !this.props.value ) {
276                 update.selectedDate = localMoment;
277                 update.viewDate = localMoment.clone().startOf('month');
833531 278             } else {
be9654 279                 update.selectedDate = null;
SE 280             }
281
282             return this.setState( update, function() {
283                 return this.props.onChange( localMoment.isValid() ? localMoment : this.state.inputValue );
284             });
285         },
286
287         onInputKey: function( e ) {
288             if ( e.which === 9 && this.props.closeOnTab ) {
289                 this.closeCalendar();
290             }
291         },
292
293         showView: function( view ) {
294             var me = this;
295             return function() {
833531 296                 me.state.currentView !== view && me.props.onViewModeChange( view );
be9654 297                 me.setState({ currentView: view });
SE 298             };
299         },
300
301         setDate: function( type ) {
302             var me = this,
303                 nextViews = {
12add8 304                     month: viewModes.DAYS,
SE 305                     year: viewModes.MONTHS,
be9654 306                 }
SE 307             ;
308             return function( e ) {
309                 me.setState({
310                     viewDate: me.state.viewDate.clone()[ type ]( parseInt(e.target.getAttribute('data-value'), 10) ).startOf( type ),
311                     currentView: nextViews[ type ]
312                 });
833531 313                 me.props.onViewModeChange( nextViews[ type ] );
be9654 314             };
SE 315         },
316
317         addTime: function( amount, type, toSelected ) {
318             return this.updateTime( 'add', amount, type, toSelected );
319         },
320
321         subtractTime: function( amount, type, toSelected ) {
322             return this.updateTime( 'subtract', amount, type, toSelected );
323         },
324
325         updateTime: function( op, amount, type, toSelected ) {
326             var me = this;
327
328             return function() {
329                 var update = {},
330                     date = toSelected ? 'selectedDate' : 'viewDate'
331                 ;
332
333                 update[ date ] = me.state[ date ].clone()[ op ]( amount, type );
334
335                 me.setState( update );
336             };
337         },
338
339         allowedSetTime: ['hours', 'minutes', 'seconds', 'milliseconds'],
340         setTime: function( type, value ) {
341             var index = this.allowedSetTime.indexOf( type ) + 1,
342                 state = this.state,
343                 date = (state.selectedDate || state.viewDate).clone(),
344                 nextType
8f6f33 345                 ;
be9654 346
SE 347             // It is needed to set all the time properties
348             // to not to reset the time
349             date[ type ]( value );
350             for (; index < this.allowedSetTime.length; index++) {
351                 nextType = this.allowedSetTime[index];
352                 date[ nextType ]( date[nextType]() );
353             }
354
355             if ( !this.props.value ) {
356                 this.setState({
357                     selectedDate: date,
358                     inputValue: date.format( state.inputFormat )
359                 });
360             }
361             this.props.onChange( date );
362         },
363
364         updateSelectedDate: function( e, close ) {
365             var target = e.target,
366                 modifier = 0,
367                 viewDate = this.state.viewDate,
368                 currentDate = this.state.selectedDate || viewDate,
369                 date
8f6f33 370                 ;
be9654 371
SE 372             if (target.className.indexOf('rdtDay') !== -1) {
373                 if (target.className.indexOf('rdtNew') !== -1)
374                     modifier = 1;
375                 else if (target.className.indexOf('rdtOld') !== -1)
376                     modifier = -1;
377
378                 date = viewDate.clone()
379                     .month( viewDate.month() + modifier )
380                     .date( parseInt( target.getAttribute('data-value'), 10 ) );
381             } else if (target.className.indexOf('rdtMonth') !== -1) {
382                 date = viewDate.clone()
383                     .month( parseInt( target.getAttribute('data-value'), 10 ) )
384                     .date( currentDate.date() );
385             } else if (target.className.indexOf('rdtYear') !== -1) {
386                 date = viewDate.clone()
387                     .month( currentDate.month() )
388                     .date( currentDate.date() )
389                     .year( parseInt( target.getAttribute('data-value'), 10 ) );
390             }
391
392             date.hours( currentDate.hours() )
393                 .minutes( currentDate.minutes() )
394                 .seconds( currentDate.seconds() )
395                 .milliseconds( currentDate.milliseconds() );
396
397             if ( !this.props.value ) {
7750ac 398                 var open = !( this.props.closeOnSelect && close );
JM 399                 if ( !open ) {
400                     this.props.onBlur( date );
401                 }
402
be9654 403                 this.setState({
SE 404                     selectedDate: date,
405                     viewDate: date.clone().startOf('month'),
406                     inputValue: date.format( this.state.inputFormat ),
7750ac 407                     open: open
be9654 408                 });
SE 409             } else {
7750ac 410                 if ( this.props.closeOnSelect && close ) {
be9654 411                     this.closeCalendar();
SE 412                 }
413             }
414
415             this.props.onChange( date );
416         },
417
c1a952 418         openCalendar: function( e ) {
SE 419             if ( !this.state.open ) {
be9654 420                 this.setState({ open: true }, function() {
c1a952 421                     this.props.onFocus( e );
be9654 422                 });
SE 423             }
424         },
425
426         closeCalendar: function() {
427             this.setState({ open: false }, function () {
428                 this.props.onBlur( this.state.selectedDate || this.state.inputValue );
429             });
430         },
431
432         handleClickOutside: function() {
94dde5 433             if ( this.props.input && this.state.open && !this.props.open && !this.props.disableOnClickOutside ) {
be9654 434                 this.setState({ open: false }, function() {
SE 435                     this.props.onBlur( this.state.selectedDate || this.state.inputValue );
436                 });
437             }
438         },
439
440         localMoment: function( date, format, props ) {
441             props = props || this.props;
442             var momentFn = props.utc ? moment.utc : moment;
443             var m = momentFn( date, format, props.strictParsing );
444             if ( props.locale )
445                 m.locale( props.locale );
446             return m;
447         },
448
449         componentProps: {
450             fromProps: ['value', 'isValidDate', 'renderDay', 'renderMonth', 'renderYear', 'timeConstraints'],
451             fromState: ['viewDate', 'selectedDate', 'updateOn'],
11612b 452             fromThis: ['setDate', 'setTime', 'showView', 'addTime', 'subtractTime', 'updateSelectedDate', 'localMoment', 'handleClickOutside']
be9654 453         },
SE 454
455         getComponentProps: function() {
456             var me = this,
457                 formats = this.getFormats( this.props ),
458                 props = {dateFormat: formats.date, timeFormat: formats.time}
8f6f33 459                 ;
be9654 460
SE 461             this.componentProps.fromProps.forEach( function( name ) {
462                 props[ name ] = me.props[ name ];
463             });
464             this.componentProps.fromState.forEach( function( name ) {
465                 props[ name ] = me.state[ name ];
466             });
467             this.componentProps.fromThis.forEach( function( name ) {
468                 props[ name ] = me[ name ];
469             });
470
471             return props;
472         },
473
474         render: function() {
8f6f33 475             // TODO: Make a function or clean up this code,
LA 476             // logic right now is really hard to follow
a50b2e 477             var className = 'rdt' + (this.props.className ?
be9654 478                       ( Array.isArray( this.props.className ) ?
SE 479                       ' ' + this.props.className.join( ' ' ) : ' ' + this.props.className) : ''),
8f6f33 480                 children = [];
be9654 481
SE 482             if ( this.props.input ) {
c1a952 483                 var finalInputProps = assign({
be9654 484                     type: 'text',
SE 485                     className: 'form-control',
c1a952 486                     onClick: this.openCalendar,
be9654 487                     onFocus: this.openCalendar,
SE 488                     onChange: this.onInputChange,
489                     onKeyDown: this.onInputKey,
c1a952 490                     value: this.state.inputValue,
SE 491                 }, this.props.inputProps);
492                 if ( this.props.renderInput ) {
94dde5 493                     children = [ React.createElement('div', { key: 'i' }, this.props.renderInput( finalInputProps, this.openCalendar, this.closeCalendar )) ];
c1a952 494                 } else {
SE 495                     children = [ React.createElement('input', assign({ key: 'i' }, finalInputProps ))];
496                 }
be9654 497             } else {
SE 498                 className += ' rdtStatic';
499             }
500
501             if ( this.state.open )
502                 className += ' rdtOpen';
503
c1a952 504             return React.createElement( 'div', { className: className }, children.concat(
SE 505                 React.createElement( 'div',
be9654 506                     { key: 'dt', className: 'rdtPicker' },
c1a952 507                     React.createElement( CalendarContainer, { view: this.state.currentView, viewProps: this.getComponentProps(), onClickOutside: this.handleClickOutside })
be9654 508                 )
SE 509             ));
510         }
511     });
94dde5 512
SE 513     Datetime.defaultProps = {
514         className: '',
515         defaultValue: '',
516         inputProps: {},
517         input: true,
518         onFocus: function() {},
519         onBlur: function() {},
520         onChange: function() {},
521         onViewModeChange: function() {},
522         timeFormat: true,
523         timeConstraints: {},
524         dateFormat: true,
525         strictParsing: true,
526         closeOnSelect: false,
527         closeOnTab: true,
528         utc: false
529     };
be9654 530
SE 531     // Make moment accessible through the Datetime class
532     Datetime.moment = moment;
533
534     module.exports = Datetime;
535
d76f7b 536
7392ed 537 /***/ }),
d76f7b 538 /* 1 */
7392ed 539 /***/ (function(module, exports) {
d76f7b 540
be9654 541     'use strict';
SE 542     var propIsEnumerable = Object.prototype.propertyIsEnumerable;
543
544     function ToObject(val) {
545         if (val == null) {
546             throw new TypeError('Object.assign cannot be called with null or undefined');
547         }
548
549         return Object(val);
550     }
551
552     function ownEnumerableKeys(obj) {
553         var keys = Object.getOwnPropertyNames(obj);
554
555         if (Object.getOwnPropertySymbols) {
556             keys = keys.concat(Object.getOwnPropertySymbols(obj));
557         }
558
559         return keys.filter(function (key) {
560             return propIsEnumerable.call(obj, key);
561         });
562     }
563
564     module.exports = Object.assign || function (target, source) {
565         var from;
566         var keys;
567         var to = ToObject(target);
568
569         for (var s = 1; s < arguments.length; s++) {
570             from = arguments[s];
571             keys = ownEnumerableKeys(Object(from));
572
573             for (var i = 0; i < keys.length; i++) {
574                 to[keys[i]] = from[keys[i]];
575             }
576         }
577
578         return to;
579     };
580
d76f7b 581
7392ed 582 /***/ }),
d76f7b 583 /* 2 */
7392ed 584 /***/ (function(module, exports, __webpack_require__) {
d76f7b 585
be31e2 586     /* WEBPACK VAR INJECTION */(function(process) {/**
94dde5 587      * Copyright (c) 2013-present, Facebook, Inc.
be31e2 588      *
94dde5 589      * This source code is licensed under the MIT license found in the
SE 590      * LICENSE file in the root directory of this source tree.
be31e2 591      */
JB 592
593     if (process.env.NODE_ENV !== 'production') {
594       var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
595         Symbol.for &&
596         Symbol.for('react.element')) ||
597         0xeac7;
598
599       var isValidElement = function(object) {
600         return typeof object === 'object' &&
601           object !== null &&
602           object.$$typeof === REACT_ELEMENT_TYPE;
603       };
604
605       // By explicitly using `prop-types` you are opting into new development behavior.
606       // http://fb.me/prop-types-in-prod
607       var throwOnDirectAccess = true;
608       module.exports = __webpack_require__(4)(isValidElement, throwOnDirectAccess);
609     } else {
610       // By explicitly using `prop-types` you are opting into new production behavior.
611       // http://fb.me/prop-types-in-prod
94dde5 612       module.exports = __webpack_require__(11)();
be31e2 613     }
JB 614
615     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
d76f7b 616
7392ed 617 /***/ }),
d76f7b 618 /* 3 */
7392ed 619 /***/ (function(module, exports) {
d76f7b 620
be31e2 621     // shim for using process in browser
JB 622     var process = module.exports = {};
623
624     // cached from whatever global is present so that test runners that stub it
625     // don't break things.  But we need to wrap it in a try catch in case it is
626     // wrapped in strict mode code which doesn't define any globals.  It's inside a
627     // function because try/catches deoptimize in certain engines.
628
629     var cachedSetTimeout;
630     var cachedClearTimeout;
631
632     function defaultSetTimout() {
633         throw new Error('setTimeout has not been defined');
634     }
635     function defaultClearTimeout () {
636         throw new Error('clearTimeout has not been defined');
637     }
638     (function () {
639         try {
640             if (typeof setTimeout === 'function') {
641                 cachedSetTimeout = setTimeout;
642             } else {
643                 cachedSetTimeout = defaultSetTimout;
644             }
645         } catch (e) {
646             cachedSetTimeout = defaultSetTimout;
647         }
648         try {
649             if (typeof clearTimeout === 'function') {
650                 cachedClearTimeout = clearTimeout;
651             } else {
652                 cachedClearTimeout = defaultClearTimeout;
653             }
654         } catch (e) {
655             cachedClearTimeout = defaultClearTimeout;
656         }
657     } ())
658     function runTimeout(fun) {
659         if (cachedSetTimeout === setTimeout) {
660             //normal enviroments in sane situations
661             return setTimeout(fun, 0);
662         }
663         // if setTimeout wasn't available but was latter defined
664         if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
665             cachedSetTimeout = setTimeout;
666             return setTimeout(fun, 0);
667         }
668         try {
669             // when when somebody has screwed with setTimeout but no I.E. maddness
670             return cachedSetTimeout(fun, 0);
671         } catch(e){
672             try {
673                 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
674                 return cachedSetTimeout.call(null, fun, 0);
675             } catch(e){
676                 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
677                 return cachedSetTimeout.call(this, fun, 0);
678             }
679         }
680
681
682     }
683     function runClearTimeout(marker) {
684         if (cachedClearTimeout === clearTimeout) {
685             //normal enviroments in sane situations
686             return clearTimeout(marker);
687         }
688         // if clearTimeout wasn't available but was latter defined
689         if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
690             cachedClearTimeout = clearTimeout;
691             return clearTimeout(marker);
692         }
693         try {
694             // when when somebody has screwed with setTimeout but no I.E. maddness
695             return cachedClearTimeout(marker);
696         } catch (e){
697             try {
698                 // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
699                 return cachedClearTimeout.call(null, marker);
700             } catch (e){
701                 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
702                 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
703                 return cachedClearTimeout.call(this, marker);
704             }
705         }
706
707
708
709     }
710     var queue = [];
711     var draining = false;
712     var currentQueue;
713     var queueIndex = -1;
714
715     function cleanUpNextTick() {
716         if (!draining || !currentQueue) {
717             return;
718         }
719         draining = false;
720         if (currentQueue.length) {
721             queue = currentQueue.concat(queue);
722         } else {
723             queueIndex = -1;
724         }
725         if (queue.length) {
726             drainQueue();
727         }
728     }
729
730     function drainQueue() {
731         if (draining) {
732             return;
733         }
734         var timeout = runTimeout(cleanUpNextTick);
735         draining = true;
736
737         var len = queue.length;
738         while(len) {
739             currentQueue = queue;
740             queue = [];
741             while (++queueIndex < len) {
742                 if (currentQueue) {
743                     currentQueue[queueIndex].run();
744                 }
745             }
746             queueIndex = -1;
747             len = queue.length;
748         }
749         currentQueue = null;
750         draining = false;
751         runClearTimeout(timeout);
752     }
753
754     process.nextTick = function (fun) {
755         var args = new Array(arguments.length - 1);
756         if (arguments.length > 1) {
757             for (var i = 1; i < arguments.length; i++) {
758                 args[i - 1] = arguments[i];
759             }
760         }
761         queue.push(new Item(fun, args));
762         if (queue.length === 1 && !draining) {
763             runTimeout(drainQueue);
764         }
765     };
766
767     // v8 likes predictible objects
768     function Item(fun, array) {
769         this.fun = fun;
770         this.array = array;
771     }
772     Item.prototype.run = function () {
773         this.fun.apply(null, this.array);
774     };
775     process.title = 'browser';
776     process.browser = true;
777     process.env = {};
778     process.argv = [];
779     process.version = ''; // empty string to avoid regexp issues
780     process.versions = {};
781
782     function noop() {}
783
784     process.on = noop;
785     process.addListener = noop;
786     process.once = noop;
787     process.off = noop;
788     process.removeListener = noop;
789     process.removeAllListeners = noop;
790     process.emit = noop;
a50b2e 791     process.prependListener = noop;
GL 792     process.prependOnceListener = noop;
793
794     process.listeners = function (name) { return [] }
be31e2 795
JB 796     process.binding = function (name) {
797         throw new Error('process.binding is not supported');
798     };
799
800     process.cwd = function () { return '/' };
801     process.chdir = function (dir) {
802         throw new Error('process.chdir is not supported');
803     };
804     process.umask = function() { return 0; };
805
d76f7b 806
7392ed 807 /***/ }),
d76f7b 808 /* 4 */
7392ed 809 /***/ (function(module, exports, __webpack_require__) {
7750ac 810
be31e2 811     /* WEBPACK VAR INJECTION */(function(process) {/**
94dde5 812      * Copyright (c) 2013-present, Facebook, Inc.
be31e2 813      *
94dde5 814      * This source code is licensed under the MIT license found in the
SE 815      * LICENSE file in the root directory of this source tree.
be31e2 816      */
JB 817
818     'use strict';
819
820     var emptyFunction = __webpack_require__(5);
821     var invariant = __webpack_require__(6);
822     var warning = __webpack_require__(7);
94dde5 823     var assign = __webpack_require__(8);
be31e2 824
94dde5 825     var ReactPropTypesSecret = __webpack_require__(9);
SE 826     var checkPropTypes = __webpack_require__(10);
be31e2 827
JB 828     module.exports = function(isValidElement, throwOnDirectAccess) {
829       /* global Symbol */
830       var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
831       var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
832
833       /**
834        * Returns the iterator method function contained on the iterable object.
835        *
836        * Be sure to invoke the function with the iterable as context:
837        *
838        *     var iteratorFn = getIteratorFn(myIterable);
839        *     if (iteratorFn) {
840        *       var iterator = iteratorFn.call(myIterable);
841        *       ...
842        *     }
843        *
844        * @param {?object} maybeIterable
845        * @return {?function}
846        */
847       function getIteratorFn(maybeIterable) {
848         var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
849         if (typeof iteratorFn === 'function') {
850           return iteratorFn;
851         }
852       }
853
854       /**
855        * Collection of methods that allow declaration and validation of props that are
856        * supplied to React components. Example usage:
857        *
858        *   var Props = require('ReactPropTypes');
859        *   var MyArticle = React.createClass({
860        *     propTypes: {
861        *       // An optional string prop named "description".
862        *       description: Props.string,
863        *
864        *       // A required enum prop named "category".
865        *       category: Props.oneOf(['News','Photos']).isRequired,
866        *
867        *       // A prop named "dialog" that requires an instance of Dialog.
868        *       dialog: Props.instanceOf(Dialog).isRequired
869        *     },
870        *     render: function() { ... }
871        *   });
872        *
873        * A more formal specification of how these methods are used:
874        *
875        *   type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
876        *   decl := ReactPropTypes.{type}(.isRequired)?
877        *
878        * Each and every declaration produces a function with the same signature. This
879        * allows the creation of custom validation functions. For example:
880        *
881        *  var MyLink = React.createClass({
882        *    propTypes: {
883        *      // An optional string or URI prop named "href".
884        *      href: function(props, propName, componentName) {
885        *        var propValue = props[propName];
886        *        if (propValue != null && typeof propValue !== 'string' &&
887        *            !(propValue instanceof URI)) {
888        *          return new Error(
889        *            'Expected a string or an URI for ' + propName + ' in ' +
890        *            componentName
891        *          );
892        *        }
893        *      }
894        *    },
895        *    render: function() {...}
896        *  });
897        *
898        * @internal
899        */
900
901       var ANONYMOUS = '<<anonymous>>';
902
903       // Important!
904       // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
905       var ReactPropTypes = {
906         array: createPrimitiveTypeChecker('array'),
907         bool: createPrimitiveTypeChecker('boolean'),
908         func: createPrimitiveTypeChecker('function'),
909         number: createPrimitiveTypeChecker('number'),
910         object: createPrimitiveTypeChecker('object'),
911         string: createPrimitiveTypeChecker('string'),
912         symbol: createPrimitiveTypeChecker('symbol'),
913
914         any: createAnyTypeChecker(),
915         arrayOf: createArrayOfTypeChecker,
916         element: createElementTypeChecker(),
917         instanceOf: createInstanceTypeChecker,
918         node: createNodeChecker(),
919         objectOf: createObjectOfTypeChecker,
920         oneOf: createEnumTypeChecker,
921         oneOfType: createUnionTypeChecker,
94dde5 922         shape: createShapeTypeChecker,
SE 923         exact: createStrictShapeTypeChecker,
be31e2 924       };
JB 925
926       /**
927        * inlined Object.is polyfill to avoid requiring consumers ship their own
928        * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
929        */
930       /*eslint-disable no-self-compare*/
931       function is(x, y) {
932         // SameValue algorithm
933         if (x === y) {
934           // Steps 1-5, 7-10
935           // Steps 6.b-6.e: +0 != -0
936           return x !== 0 || 1 / x === 1 / y;
937         } else {
938           // Step 6.a: NaN == NaN
939           return x !== x && y !== y;
940         }
941       }
942       /*eslint-enable no-self-compare*/
943
944       /**
945        * We use an Error-like object for backward compatibility as people may call
946        * PropTypes directly and inspect their output. However, we don't use real
947        * Errors anymore. We don't inspect their stack anyway, and creating them
948        * is prohibitively expensive if they are created too often, such as what
949        * happens in oneOfType() for any type before the one that matched.
950        */
951       function PropTypeError(message) {
952         this.message = message;
953         this.stack = '';
954       }
955       // Make `instanceof Error` still work for returned errors.
956       PropTypeError.prototype = Error.prototype;
957
958       function createChainableTypeChecker(validate) {
959         if (process.env.NODE_ENV !== 'production') {
960           var manualPropTypeCallCache = {};
7392ed 961           var manualPropTypeWarningCount = 0;
be31e2 962         }
JB 963         function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
964           componentName = componentName || ANONYMOUS;
965           propFullName = propFullName || propName;
966
967           if (secret !== ReactPropTypesSecret) {
968             if (throwOnDirectAccess) {
969               // New behavior only for users of `prop-types` package
970               invariant(
971                 false,
972                 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
973                 'Use `PropTypes.checkPropTypes()` to call them. ' +
974                 'Read more at http://fb.me/use-check-prop-types'
975               );
976             } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
977               // Old behavior for people using React.PropTypes
978               var cacheKey = componentName + ':' + propName;
7392ed 979               if (
SE 980                 !manualPropTypeCallCache[cacheKey] &&
981                 // Avoid spamming the console because they are often not actionable except for lib authors
982                 manualPropTypeWarningCount < 3
983               ) {
be31e2 984                 warning(
JB 985                   false,
986                   'You are manually calling a React.PropTypes validation ' +
987                   'function for the `%s` prop on `%s`. This is deprecated ' +
988                   'and will throw in the standalone `prop-types` package. ' +
989                   'You may be seeing this warning due to a third-party PropTypes ' +
990                   'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
991                   propFullName,
992                   componentName
993                 );
994                 manualPropTypeCallCache[cacheKey] = true;
7392ed 995                 manualPropTypeWarningCount++;
be31e2 996               }
JB 997             }
998           }
999           if (props[propName] == null) {
1000             if (isRequired) {
1001               if (props[propName] === null) {
1002                 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
1003               }
1004               return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
1005             }
1006             return null;
1007           } else {
1008             return validate(props, propName, componentName, location, propFullName);
1009           }
1010         }
1011
1012         var chainedCheckType = checkType.bind(null, false);
1013         chainedCheckType.isRequired = checkType.bind(null, true);
1014
1015         return chainedCheckType;
1016       }
1017
1018       function createPrimitiveTypeChecker(expectedType) {
1019         function validate(props, propName, componentName, location, propFullName, secret) {
1020           var propValue = props[propName];
1021           var propType = getPropType(propValue);
1022           if (propType !== expectedType) {
1023             // `propValue` being instance of, say, date/regexp, pass the 'object'
1024             // check, but we can offer a more precise error message here rather than
1025             // 'of type `object`'.
1026             var preciseType = getPreciseType(propValue);
1027
1028             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
1029           }
1030           return null;
1031         }
1032         return createChainableTypeChecker(validate);
1033       }
1034
1035       function createAnyTypeChecker() {
1036         return createChainableTypeChecker(emptyFunction.thatReturnsNull);
1037       }
1038
1039       function createArrayOfTypeChecker(typeChecker) {
1040         function validate(props, propName, componentName, location, propFullName) {
1041           if (typeof typeChecker !== 'function') {
1042             return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
1043           }
1044           var propValue = props[propName];
1045           if (!Array.isArray(propValue)) {
1046             var propType = getPropType(propValue);
1047             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
1048           }
1049           for (var i = 0; i < propValue.length; i++) {
1050             var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
1051             if (error instanceof Error) {
1052               return error;
1053             }
1054           }
1055           return null;
1056         }
1057         return createChainableTypeChecker(validate);
1058       }
1059
1060       function createElementTypeChecker() {
1061         function validate(props, propName, componentName, location, propFullName) {
1062           var propValue = props[propName];
1063           if (!isValidElement(propValue)) {
1064             var propType = getPropType(propValue);
1065             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
1066           }
1067           return null;
1068         }
1069         return createChainableTypeChecker(validate);
1070       }
1071
1072       function createInstanceTypeChecker(expectedClass) {
1073         function validate(props, propName, componentName, location, propFullName) {
1074           if (!(props[propName] instanceof expectedClass)) {
1075             var expectedClassName = expectedClass.name || ANONYMOUS;
1076             var actualClassName = getClassName(props[propName]);
1077             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
1078           }
1079           return null;
1080         }
1081         return createChainableTypeChecker(validate);
1082       }
1083
1084       function createEnumTypeChecker(expectedValues) {
1085         if (!Array.isArray(expectedValues)) {
1086           process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
1087           return emptyFunction.thatReturnsNull;
1088         }
1089
1090         function validate(props, propName, componentName, location, propFullName) {
1091           var propValue = props[propName];
1092           for (var i = 0; i < expectedValues.length; i++) {
1093             if (is(propValue, expectedValues[i])) {
1094               return null;
1095             }
1096           }
1097
1098           var valuesString = JSON.stringify(expectedValues);
1099           return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
1100         }
1101         return createChainableTypeChecker(validate);
1102       }
1103
1104       function createObjectOfTypeChecker(typeChecker) {
1105         function validate(props, propName, componentName, location, propFullName) {
1106           if (typeof typeChecker !== 'function') {
1107             return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
1108           }
1109           var propValue = props[propName];
1110           var propType = getPropType(propValue);
1111           if (propType !== 'object') {
1112             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
1113           }
1114           for (var key in propValue) {
1115             if (propValue.hasOwnProperty(key)) {
1116               var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1117               if (error instanceof Error) {
1118                 return error;
1119               }
1120             }
1121           }
1122           return null;
1123         }
1124         return createChainableTypeChecker(validate);
1125       }
1126
1127       function createUnionTypeChecker(arrayOfTypeCheckers) {
1128         if (!Array.isArray(arrayOfTypeCheckers)) {
1129           process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
1130           return emptyFunction.thatReturnsNull;
1131         }
1132
a50b2e 1133         for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
GL 1134           var checker = arrayOfTypeCheckers[i];
1135           if (typeof checker !== 'function') {
1136             warning(
1137               false,
94dde5 1138               'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
a50b2e 1139               'received %s at index %s.',
GL 1140               getPostfixForTypeWarning(checker),
1141               i
1142             );
1143             return emptyFunction.thatReturnsNull;
1144           }
1145         }
1146
be31e2 1147         function validate(props, propName, componentName, location, propFullName) {
JB 1148           for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1149             var checker = arrayOfTypeCheckers[i];
1150             if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
1151               return null;
1152             }
1153           }
1154
1155           return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
1156         }
1157         return createChainableTypeChecker(validate);
1158       }
1159
1160       function createNodeChecker() {
1161         function validate(props, propName, componentName, location, propFullName) {
1162           if (!isNode(props[propName])) {
1163             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1164           }
1165           return null;
1166         }
1167         return createChainableTypeChecker(validate);
1168       }
1169
1170       function createShapeTypeChecker(shapeTypes) {
1171         function validate(props, propName, componentName, location, propFullName) {
1172           var propValue = props[propName];
1173           var propType = getPropType(propValue);
1174           if (propType !== 'object') {
1175             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1176           }
1177           for (var key in shapeTypes) {
1178             var checker = shapeTypes[key];
1179             if (!checker) {
1180               continue;
1181             }
1182             var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1183             if (error) {
1184               return error;
1185             }
1186           }
1187           return null;
1188         }
94dde5 1189         return createChainableTypeChecker(validate);
SE 1190       }
1191
1192       function createStrictShapeTypeChecker(shapeTypes) {
1193         function validate(props, propName, componentName, location, propFullName) {
1194           var propValue = props[propName];
1195           var propType = getPropType(propValue);
1196           if (propType !== 'object') {
1197             return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1198           }
1199           // We need to check all keys in case some are required but missing from
1200           // props.
1201           var allKeys = assign({}, props[propName], shapeTypes);
1202           for (var key in allKeys) {
1203             var checker = shapeTypes[key];
1204             if (!checker) {
1205               return new PropTypeError(
1206                 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
1207                 '\nBad object: ' + JSON.stringify(props[propName], null, '  ') +
1208                 '\nValid keys: ' +  JSON.stringify(Object.keys(shapeTypes), null, '  ')
1209               );
1210             }
1211             var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1212             if (error) {
1213               return error;
1214             }
1215           }
1216           return null;
1217         }
1218
be31e2 1219         return createChainableTypeChecker(validate);
JB 1220       }
1221
1222       function isNode(propValue) {
1223         switch (typeof propValue) {
1224           case 'number':
1225           case 'string':
1226           case 'undefined':
1227             return true;
1228           case 'boolean':
1229             return !propValue;
1230           case 'object':
1231             if (Array.isArray(propValue)) {
1232               return propValue.every(isNode);
1233             }
1234             if (propValue === null || isValidElement(propValue)) {
1235               return true;
1236             }
1237
1238             var iteratorFn = getIteratorFn(propValue);
1239             if (iteratorFn) {
1240               var iterator = iteratorFn.call(propValue);
1241               var step;
1242               if (iteratorFn !== propValue.entries) {
1243                 while (!(step = iterator.next()).done) {
1244                   if (!isNode(step.value)) {
1245                     return false;
1246                   }
1247                 }
1248               } else {
1249                 // Iterator will provide entry [k,v] tuples rather than values.
1250                 while (!(step = iterator.next()).done) {
1251                   var entry = step.value;
1252                   if (entry) {
1253                     if (!isNode(entry[1])) {
1254                       return false;
1255                     }
1256                   }
1257                 }
1258               }
1259             } else {
1260               return false;
1261             }
1262
1263             return true;
1264           default:
1265             return false;
1266         }
1267       }
1268
1269       function isSymbol(propType, propValue) {
1270         // Native Symbol.
1271         if (propType === 'symbol') {
1272           return true;
1273         }
1274
1275         // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1276         if (propValue['@@toStringTag'] === 'Symbol') {
1277           return true;
1278         }
1279
1280         // Fallback for non-spec compliant Symbols which are polyfilled.
1281         if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1282           return true;
1283         }
1284
1285         return false;
1286       }
1287
1288       // Equivalent of `typeof` but with special handling for array and regexp.
1289       function getPropType(propValue) {
1290         var propType = typeof propValue;
1291         if (Array.isArray(propValue)) {
1292           return 'array';
1293         }
1294         if (propValue instanceof RegExp) {
1295           // Old webkits (at least until Android 4.0) return 'function' rather than
1296           // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1297           // passes PropTypes.object.
1298           return 'object';
1299         }
1300         if (isSymbol(propType, propValue)) {
1301           return 'symbol';
1302         }
1303         return propType;
1304       }
1305
1306       // This handles more types than `getPropType`. Only used for error messages.
1307       // See `createPrimitiveTypeChecker`.
1308       function getPreciseType(propValue) {
a50b2e 1309         if (typeof propValue === 'undefined' || propValue === null) {
GL 1310           return '' + propValue;
1311         }
be31e2 1312         var propType = getPropType(propValue);
JB 1313         if (propType === 'object') {
1314           if (propValue instanceof Date) {
1315             return 'date';
1316           } else if (propValue instanceof RegExp) {
1317             return 'regexp';
1318           }
1319         }
1320         return propType;
a50b2e 1321       }
GL 1322
1323       // Returns a string that is postfixed to a warning about an invalid type.
1324       // For example, "undefined" or "of type array"
1325       function getPostfixForTypeWarning(value) {
1326         var type = getPreciseType(value);
1327         switch (type) {
1328           case 'array':
1329           case 'object':
1330             return 'an ' + type;
1331           case 'boolean':
1332           case 'date':
1333           case 'regexp':
1334             return 'a ' + type;
1335           default:
1336             return type;
1337         }
be31e2 1338       }
JB 1339
1340       // Returns class name of the object, if any.
1341       function getClassName(propValue) {
1342         if (!propValue.constructor || !propValue.constructor.name) {
1343           return ANONYMOUS;
1344         }
1345         return propValue.constructor.name;
1346       }
1347
1348       ReactPropTypes.checkPropTypes = checkPropTypes;
1349       ReactPropTypes.PropTypes = ReactPropTypes;
1350
1351       return ReactPropTypes;
1352     };
1353
1354     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
1355
7392ed 1356 /***/ }),
be31e2 1357 /* 5 */
7392ed 1358 /***/ (function(module, exports) {
be31e2 1359
JB 1360     "use strict";
1361
1362     /**
1363      * Copyright (c) 2013-present, Facebook, Inc.
1364      *
94dde5 1365      * This source code is licensed under the MIT license found in the
SE 1366      * LICENSE file in the root directory of this source tree.
be31e2 1367      *
JB 1368      * 
1369      */
1370
1371     function makeEmptyFunction(arg) {
1372       return function () {
1373         return arg;
1374       };
1375     }
1376
1377     /**
1378      * This function accepts and discards inputs; it has no side effects. This is
1379      * primarily useful idiomatically for overridable function endpoints which
1380      * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
1381      */
1382     var emptyFunction = function emptyFunction() {};
1383
1384     emptyFunction.thatReturns = makeEmptyFunction;
1385     emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
1386     emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
1387     emptyFunction.thatReturnsNull = makeEmptyFunction(null);
1388     emptyFunction.thatReturnsThis = function () {
1389       return this;
1390     };
1391     emptyFunction.thatReturnsArgument = function (arg) {
1392       return arg;
1393     };
1394
1395     module.exports = emptyFunction;
1396
7392ed 1397 /***/ }),
be31e2 1398 /* 6 */
7392ed 1399 /***/ (function(module, exports, __webpack_require__) {
be31e2 1400
JB 1401     /* WEBPACK VAR INJECTION */(function(process) {/**
1402      * Copyright (c) 2013-present, Facebook, Inc.
1403      *
94dde5 1404      * This source code is licensed under the MIT license found in the
SE 1405      * LICENSE file in the root directory of this source tree.
be31e2 1406      *
JB 1407      */
1408
1409     'use strict';
1410
1411     /**
1412      * Use invariant() to assert state which your program assumes to be true.
1413      *
1414      * Provide sprintf-style format (only %s is supported) and arguments
1415      * to provide information about what broke and what you were
1416      * expecting.
1417      *
1418      * The invariant message will be stripped in production, but the invariant
1419      * will remain to ensure logic does not differ in production.
1420      */
1421
1422     var validateFormat = function validateFormat(format) {};
1423
1424     if (process.env.NODE_ENV !== 'production') {
1425       validateFormat = function validateFormat(format) {
1426         if (format === undefined) {
1427           throw new Error('invariant requires an error message argument');
1428         }
1429       };
1430     }
1431
1432     function invariant(condition, format, a, b, c, d, e, f) {
1433       validateFormat(format);
1434
1435       if (!condition) {
1436         var error;
1437         if (format === undefined) {
1438           error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
1439         } else {
1440           var args = [a, b, c, d, e, f];
1441           var argIndex = 0;
1442           error = new Error(format.replace(/%s/g, function () {
1443             return args[argIndex++];
1444           }));
1445           error.name = 'Invariant Violation';
1446         }
1447
1448         error.framesToPop = 1; // we don't care about invariant's own frame
1449         throw error;
1450       }
1451     }
1452
1453     module.exports = invariant;
1454     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
1455
7392ed 1456 /***/ }),
be31e2 1457 /* 7 */
7392ed 1458 /***/ (function(module, exports, __webpack_require__) {
be31e2 1459
JB 1460     /* WEBPACK VAR INJECTION */(function(process) {/**
94dde5 1461      * Copyright (c) 2014-present, Facebook, Inc.
be31e2 1462      *
94dde5 1463      * This source code is licensed under the MIT license found in the
SE 1464      * LICENSE file in the root directory of this source tree.
be31e2 1465      *
JB 1466      */
1467
1468     'use strict';
1469
1470     var emptyFunction = __webpack_require__(5);
1471
1472     /**
1473      * Similar to invariant but only logs a warning if the condition is not met.
1474      * This can be used to log issues in development environments in critical
1475      * paths. Removing the logging code for production environments will keep the
1476      * same logic and follow the same code paths.
1477      */
1478
1479     var warning = emptyFunction;
1480
1481     if (process.env.NODE_ENV !== 'production') {
94dde5 1482       var printWarning = function printWarning(format) {
SE 1483         for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1484           args[_key - 1] = arguments[_key];
1485         }
1486
1487         var argIndex = 0;
1488         var message = 'Warning: ' + format.replace(/%s/g, function () {
1489           return args[argIndex++];
1490         });
1491         if (typeof console !== 'undefined') {
1492           console.error(message);
1493         }
1494         try {
1495           // --- Welcome to debugging React ---
1496           // This error was thrown as a convenience so that you can use this stack
1497           // to find the callsite that caused this warning to fire.
1498           throw new Error(message);
1499         } catch (x) {}
1500       };
1501
1502       warning = function warning(condition, format) {
1503         if (format === undefined) {
1504           throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
1505         }
1506
1507         if (format.indexOf('Failed Composite propType: ') === 0) {
1508           return; // Ignore CompositeComponent proptype check.
1509         }
1510
1511         if (!condition) {
1512           for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
1513             args[_key2 - 2] = arguments[_key2];
be31e2 1514           }
JB 1515
94dde5 1516           printWarning.apply(undefined, [format].concat(args));
SE 1517         }
1518       };
be31e2 1519     }
JB 1520
1521     module.exports = warning;
1522     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
1523
7392ed 1524 /***/ }),
be31e2 1525 /* 8 */
7392ed 1526 /***/ (function(module, exports) {
be31e2 1527
94dde5 1528     /*
SE 1529     object-assign
1530     (c) Sindre Sorhus
1531     @license MIT
1532     */
1533
1534     'use strict';
1535     /* eslint-disable no-unused-vars */
1536     var getOwnPropertySymbols = Object.getOwnPropertySymbols;
1537     var hasOwnProperty = Object.prototype.hasOwnProperty;
1538     var propIsEnumerable = Object.prototype.propertyIsEnumerable;
1539
1540     function toObject(val) {
1541         if (val === null || val === undefined) {
1542             throw new TypeError('Object.assign cannot be called with null or undefined');
1543         }
1544
1545         return Object(val);
1546     }
1547
1548     function shouldUseNative() {
1549         try {
1550             if (!Object.assign) {
1551                 return false;
1552             }
1553
1554             // Detect buggy property enumeration order in older V8 versions.
1555
1556             // https://bugs.chromium.org/p/v8/issues/detail?id=4118
1557             var test1 = new String('abc');  // eslint-disable-line no-new-wrappers
1558             test1[5] = 'de';
1559             if (Object.getOwnPropertyNames(test1)[0] === '5') {
1560                 return false;
1561             }
1562
1563             // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1564             var test2 = {};
1565             for (var i = 0; i < 10; i++) {
1566                 test2['_' + String.fromCharCode(i)] = i;
1567             }
1568             var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
1569                 return test2[n];
1570             });
1571             if (order2.join('') !== '0123456789') {
1572                 return false;
1573             }
1574
1575             // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1576             var test3 = {};
1577             'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
1578                 test3[letter] = letter;
1579             });
1580             if (Object.keys(Object.assign({}, test3)).join('') !==
1581                     'abcdefghijklmnopqrst') {
1582                 return false;
1583             }
1584
1585             return true;
1586         } catch (err) {
1587             // We don't expect any of the above to throw, but better to be safe.
1588             return false;
1589         }
1590     }
1591
1592     module.exports = shouldUseNative() ? Object.assign : function (target, source) {
1593         var from;
1594         var to = toObject(target);
1595         var symbols;
1596
1597         for (var s = 1; s < arguments.length; s++) {
1598             from = Object(arguments[s]);
1599
1600             for (var key in from) {
1601                 if (hasOwnProperty.call(from, key)) {
1602                     to[key] = from[key];
1603                 }
1604             }
1605
1606             if (getOwnPropertySymbols) {
1607                 symbols = getOwnPropertySymbols(from);
1608                 for (var i = 0; i < symbols.length; i++) {
1609                     if (propIsEnumerable.call(from, symbols[i])) {
1610                         to[symbols[i]] = from[symbols[i]];
1611                     }
1612                 }
1613             }
1614         }
1615
1616         return to;
1617     };
1618
1619
1620 /***/ }),
1621 /* 9 */
1622 /***/ (function(module, exports) {
1623
be31e2 1624     /**
94dde5 1625      * Copyright (c) 2013-present, Facebook, Inc.
be31e2 1626      *
94dde5 1627      * This source code is licensed under the MIT license found in the
SE 1628      * LICENSE file in the root directory of this source tree.
be31e2 1629      */
JB 1630
1631     'use strict';
1632
1633     var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1634
1635     module.exports = ReactPropTypesSecret;
1636
1637
7392ed 1638 /***/ }),
94dde5 1639 /* 10 */
7392ed 1640 /***/ (function(module, exports, __webpack_require__) {
be31e2 1641
JB 1642     /* WEBPACK VAR INJECTION */(function(process) {/**
94dde5 1643      * Copyright (c) 2013-present, Facebook, Inc.
be31e2 1644      *
94dde5 1645      * This source code is licensed under the MIT license found in the
SE 1646      * LICENSE file in the root directory of this source tree.
be31e2 1647      */
JB 1648
1649     'use strict';
1650
1651     if (process.env.NODE_ENV !== 'production') {
1652       var invariant = __webpack_require__(6);
1653       var warning = __webpack_require__(7);
94dde5 1654       var ReactPropTypesSecret = __webpack_require__(9);
be31e2 1655       var loggedTypeFailures = {};
JB 1656     }
1657
1658     /**
1659      * Assert that the values match with the type specs.
1660      * Error messages are memorized and will only be shown once.
1661      *
1662      * @param {object} typeSpecs Map of name to a ReactPropType
1663      * @param {object} values Runtime values that need to be type-checked
1664      * @param {string} location e.g. "prop", "context", "child context"
1665      * @param {string} componentName Name of the component for error messages.
1666      * @param {?Function} getStack Returns the component stack.
1667      * @private
1668      */
1669     function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
1670       if (process.env.NODE_ENV !== 'production') {
1671         for (var typeSpecName in typeSpecs) {
1672           if (typeSpecs.hasOwnProperty(typeSpecName)) {
1673             var error;
1674             // Prop type validation may throw. In case they do, we don't want to
1675             // fail the render phase where it didn't fail before. So we log it.
1676             // After these have been cleaned up, we'll let them throw.
1677             try {
1678               // This is intentionally an invariant that gets caught. It's the same
1679               // behavior as without this statement except with a better message.
94dde5 1680               invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);
be31e2 1681               error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
JB 1682             } catch (ex) {
1683               error = ex;
1684             }
1685             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);
1686             if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1687               // Only monitor this failure once because there tends to be a lot of the
1688               // same error.
1689               loggedTypeFailures[error.message] = true;
1690
1691               var stack = getStack ? getStack() : '';
1692
1693               warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
1694             }
1695           }
1696         }
1697       }
1698     }
1699
1700     module.exports = checkPropTypes;
1701
1702     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
1703
7392ed 1704 /***/ }),
94dde5 1705 /* 11 */
7392ed 1706 /***/ (function(module, exports, __webpack_require__) {
be31e2 1707
JB 1708     /**
94dde5 1709      * Copyright (c) 2013-present, Facebook, Inc.
be31e2 1710      *
94dde5 1711      * This source code is licensed under the MIT license found in the
SE 1712      * LICENSE file in the root directory of this source tree.
be31e2 1713      */
JB 1714
1715     'use strict';
1716
1717     var emptyFunction = __webpack_require__(5);
1718     var invariant = __webpack_require__(6);
94dde5 1719     var ReactPropTypesSecret = __webpack_require__(9);
be31e2 1720
JB 1721     module.exports = function() {
a50b2e 1722       function shim(props, propName, componentName, location, propFullName, secret) {
GL 1723         if (secret === ReactPropTypesSecret) {
1724           // It is still safe when called from React.
1725           return;
1726         }
be31e2 1727         invariant(
JB 1728           false,
1729           'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1730           'Use PropTypes.checkPropTypes() to call them. ' +
1731           'Read more at http://fb.me/use-check-prop-types'
1732         );
1733       };
1734       shim.isRequired = shim;
1735       function getShim() {
1736         return shim;
1737       };
a50b2e 1738       // Important!
GL 1739       // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
be31e2 1740       var ReactPropTypes = {
JB 1741         array: shim,
1742         bool: shim,
1743         func: shim,
1744         number: shim,
1745         object: shim,
1746         string: shim,
1747         symbol: shim,
1748
1749         any: shim,
1750         arrayOf: getShim,
1751         element: shim,
1752         instanceOf: getShim,
1753         node: shim,
1754         objectOf: getShim,
1755         oneOf: getShim,
1756         oneOfType: getShim,
94dde5 1757         shape: getShim,
SE 1758         exact: getShim
be31e2 1759       };
JB 1760
1761       ReactPropTypes.checkPropTypes = emptyFunction;
1762       ReactPropTypes.PropTypes = ReactPropTypes;
1763
1764       return ReactPropTypes;
1765     };
1766
1767
7392ed 1768 /***/ }),
94dde5 1769 /* 12 */
7392ed 1770 /***/ (function(module, exports, __webpack_require__) {
be31e2 1771
JB 1772     /**
94dde5 1773      * Copyright (c) 2013-present, Facebook, Inc.
be31e2 1774      *
94dde5 1775      * This source code is licensed under the MIT license found in the
SE 1776      * LICENSE file in the root directory of this source tree.
be31e2 1777      *
JB 1778      */
1779
1780     'use strict';
1781
94dde5 1782     var React = __webpack_require__(13);
SE 1783     var factory = __webpack_require__(14);
a50b2e 1784
GL 1785     if (typeof React === 'undefined') {
1786       throw Error(
1787         'create-react-class could not find the React object. If you are using script tags, ' +
1788           'make sure that React is being loaded before create-react-class.'
1789       );
1790     }
be31e2 1791
JB 1792     // Hack to grab NoopUpdateQueue from isomorphic React
1793     var ReactNoopUpdateQueue = new React.Component().updater;
1794
1795     module.exports = factory(
1796       React.Component,
1797       React.isValidElement,
1798       ReactNoopUpdateQueue
1799     );
1800
1801
7392ed 1802 /***/ }),
94dde5 1803 /* 13 */
7392ed 1804 /***/ (function(module, exports) {
be31e2 1805
94dde5 1806     module.exports = __WEBPACK_EXTERNAL_MODULE_13__;
be31e2 1807
7392ed 1808 /***/ }),
94dde5 1809 /* 14 */
7392ed 1810 /***/ (function(module, exports, __webpack_require__) {
be31e2 1811
JB 1812     /* WEBPACK VAR INJECTION */(function(process) {/**
94dde5 1813      * Copyright (c) 2013-present, Facebook, Inc.
be31e2 1814      *
94dde5 1815      * This source code is licensed under the MIT license found in the
SE 1816      * LICENSE file in the root directory of this source tree.
be31e2 1817      *
JB 1818      */
1819
1820     'use strict';
1821
94dde5 1822     var _assign = __webpack_require__(15);
be31e2 1823
94dde5 1824     var emptyObject = __webpack_require__(16);
be31e2 1825     var _invariant = __webpack_require__(6);
JB 1826
1827     if (process.env.NODE_ENV !== 'production') {
1828       var warning = __webpack_require__(7);
1829     }
1830
1831     var MIXINS_KEY = 'mixins';
1832
1833     // Helper function to allow the creation of anonymous functions which do not
1834     // have .name set to the name of the variable being assigned to.
1835     function identity(fn) {
1836       return fn;
1837     }
1838
1839     var ReactPropTypeLocationNames;
1840     if (process.env.NODE_ENV !== 'production') {
1841       ReactPropTypeLocationNames = {
1842         prop: 'prop',
1843         context: 'context',
a50b2e 1844         childContext: 'child context'
be31e2 1845       };
JB 1846     } else {
1847       ReactPropTypeLocationNames = {};
1848     }
1849
1850     function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
1851       /**
1852        * Policies that describe methods in `ReactClassInterface`.
1853        */
1854
1855       var injectedMixins = [];
1856
1857       /**
1858        * Composite components are higher-level components that compose other composite
1859        * or host components.
1860        *
1861        * To create a new type of `ReactClass`, pass a specification of
1862        * your new class to `React.createClass`. The only requirement of your class
1863        * specification is that you implement a `render` method.
1864        *
1865        *   var MyComponent = React.createClass({
1866        *     render: function() {
1867        *       return <div>Hello World</div>;
1868        *     }
1869        *   });
1870        *
1871        * The class specification supports a specific protocol of methods that have
1872        * special meaning (e.g. `render`). See `ReactClassInterface` for
1873        * more the comprehensive protocol. Any other properties and methods in the
1874        * class specification will be available on the prototype.
1875        *
1876        * @interface ReactClassInterface
1877        * @internal
1878        */
1879       var ReactClassInterface = {
1880         /**
1881          * An array of Mixin objects to include when defining your component.
1882          *
1883          * @type {array}
1884          * @optional
1885          */
1886         mixins: 'DEFINE_MANY',
1887
1888         /**
1889          * An object containing properties and methods that should be defined on
1890          * the component's constructor instead of its prototype (static methods).
1891          *
1892          * @type {object}
1893          * @optional
1894          */
1895         statics: 'DEFINE_MANY',
1896
1897         /**
1898          * Definition of prop types for this component.
1899          *
1900          * @type {object}
1901          * @optional
1902          */
1903         propTypes: 'DEFINE_MANY',
1904
1905         /**
1906          * Definition of context types for this component.
1907          *
1908          * @type {object}
1909          * @optional
1910          */
1911         contextTypes: 'DEFINE_MANY',
1912
1913         /**
1914          * Definition of context types this component sets for its children.
1915          *
1916          * @type {object}
1917          * @optional
1918          */
1919         childContextTypes: 'DEFINE_MANY',
1920
1921         // ==== Definition methods ====
1922
1923         /**
1924          * Invoked when the component is mounted. Values in the mapping will be set on
1925          * `this.props` if that prop is not specified (i.e. using an `in` check).
1926          *
1927          * This method is invoked before `getInitialState` and therefore cannot rely
1928          * on `this.state` or use `this.setState`.
1929          *
1930          * @return {object}
1931          * @optional
1932          */
1933         getDefaultProps: 'DEFINE_MANY_MERGED',
1934
1935         /**
1936          * Invoked once before the component is mounted. The return value will be used
1937          * as the initial value of `this.state`.
1938          *
1939          *   getInitialState: function() {
1940          *     return {
1941          *       isOn: false,
1942          *       fooBaz: new BazFoo()
1943          *     }
1944          *   }
1945          *
1946          * @return {object}
1947          * @optional
1948          */
1949         getInitialState: 'DEFINE_MANY_MERGED',
1950
1951         /**
1952          * @return {object}
1953          * @optional
1954          */
1955         getChildContext: 'DEFINE_MANY_MERGED',
1956
1957         /**
1958          * Uses props from `this.props` and state from `this.state` to render the
1959          * structure of the component.
1960          *
1961          * No guarantees are made about when or how often this method is invoked, so
1962          * it must not have side effects.
1963          *
1964          *   render: function() {
1965          *     var name = this.props.name;
1966          *     return <div>Hello, {name}!</div>;
1967          *   }
1968          *
1969          * @return {ReactComponent}
1970          * @required
1971          */
1972         render: 'DEFINE_ONCE',
1973
1974         // ==== Delegate methods ====
1975
1976         /**
1977          * Invoked when the component is initially created and about to be mounted.
1978          * This may have side effects, but any external subscriptions or data created
1979          * by this method must be cleaned up in `componentWillUnmount`.
1980          *
1981          * @optional
1982          */
1983         componentWillMount: 'DEFINE_MANY',
1984
1985         /**
1986          * Invoked when the component has been mounted and has a DOM representation.
1987          * However, there is no guarantee that the DOM node is in the document.
1988          *
1989          * Use this as an opportunity to operate on the DOM when the component has
1990          * been mounted (initialized and rendered) for the first time.
1991          *
1992          * @param {DOMElement} rootNode DOM element representing the component.
1993          * @optional
1994          */
1995         componentDidMount: 'DEFINE_MANY',
1996
1997         /**
1998          * Invoked before the component receives new props.
1999          *
2000          * Use this as an opportunity to react to a prop transition by updating the
2001          * state using `this.setState`. Current props are accessed via `this.props`.
2002          *
2003          *   componentWillReceiveProps: function(nextProps, nextContext) {
2004          *     this.setState({
2005          *       likesIncreasing: nextProps.likeCount > this.props.likeCount
2006          *     });
2007          *   }
2008          *
2009          * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
2010          * transition may cause a state change, but the opposite is not true. If you
2011          * need it, you are probably looking for `componentWillUpdate`.
2012          *
2013          * @param {object} nextProps
2014          * @optional
2015          */
2016         componentWillReceiveProps: 'DEFINE_MANY',
2017
2018         /**
2019          * Invoked while deciding if the component should be updated as a result of
2020          * receiving new props, state and/or context.
2021          *
2022          * Use this as an opportunity to `return false` when you're certain that the
2023          * transition to the new props/state/context will not require a component
2024          * update.
2025          *
2026          *   shouldComponentUpdate: function(nextProps, nextState, nextContext) {
2027          *     return !equal(nextProps, this.props) ||
2028          *       !equal(nextState, this.state) ||
2029          *       !equal(nextContext, this.context);
2030          *   }
2031          *
2032          * @param {object} nextProps
2033          * @param {?object} nextState
2034          * @param {?object} nextContext
2035          * @return {boolean} True if the component should update.
2036          * @optional
2037          */
2038         shouldComponentUpdate: 'DEFINE_ONCE',
2039
2040         /**
2041          * Invoked when the component is about to update due to a transition from
2042          * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
2043          * and `nextContext`.
2044          *
2045          * Use this as an opportunity to perform preparation before an update occurs.
2046          *
2047          * NOTE: You **cannot** use `this.setState()` in this method.
2048          *
2049          * @param {object} nextProps
2050          * @param {?object} nextState
2051          * @param {?object} nextContext
2052          * @param {ReactReconcileTransaction} transaction
2053          * @optional
2054          */
2055         componentWillUpdate: 'DEFINE_MANY',
2056
2057         /**
2058          * Invoked when the component's DOM representation has been updated.
2059          *
2060          * Use this as an opportunity to operate on the DOM when the component has
2061          * been updated.
2062          *
2063          * @param {object} prevProps
2064          * @param {?object} prevState
2065          * @param {?object} prevContext
2066          * @param {DOMElement} rootNode DOM element representing the component.
2067          * @optional
2068          */
2069         componentDidUpdate: 'DEFINE_MANY',
2070
2071         /**
2072          * Invoked when the component is about to be removed from its parent and have
2073          * its DOM representation destroyed.
2074          *
2075          * Use this as an opportunity to deallocate any external resources.
2076          *
2077          * NOTE: There is no `componentDidUnmount` since your component will have been
2078          * destroyed by that point.
2079          *
2080          * @optional
2081          */
2082         componentWillUnmount: 'DEFINE_MANY',
2083
94dde5 2084         /**
SE 2085          * Replacement for (deprecated) `componentWillMount`.
2086          *
2087          * @optional
2088          */
2089         UNSAFE_componentWillMount: 'DEFINE_MANY',
2090
2091         /**
2092          * Replacement for (deprecated) `componentWillReceiveProps`.
2093          *
2094          * @optional
2095          */
2096         UNSAFE_componentWillReceiveProps: 'DEFINE_MANY',
2097
2098         /**
2099          * Replacement for (deprecated) `componentWillUpdate`.
2100          *
2101          * @optional
2102          */
2103         UNSAFE_componentWillUpdate: 'DEFINE_MANY',
2104
be31e2 2105         // ==== Advanced methods ====
JB 2106
2107         /**
2108          * Updates the component's currently mounted DOM representation.
2109          *
2110          * By default, this implements React's rendering and reconciliation algorithm.
2111          * Sophisticated clients may wish to override this.
2112          *
2113          * @param {ReactReconcileTransaction} transaction
2114          * @internal
2115          * @overridable
2116          */
2117         updateComponent: 'OVERRIDE_BASE'
94dde5 2118       };
SE 2119
2120       /**
2121        * Similar to ReactClassInterface but for static methods.
2122        */
2123       var ReactClassStaticInterface = {
2124         /**
2125          * This method is invoked after a component is instantiated and when it
2126          * receives new props. Return an object to update state in response to
2127          * prop changes. Return null to indicate no change to state.
2128          *
2129          * If an object is returned, its keys will be merged into the existing state.
2130          *
2131          * @return {object || null}
2132          * @optional
2133          */
2134         getDerivedStateFromProps: 'DEFINE_MANY_MERGED'
be31e2 2135       };
JB 2136
2137       /**
2138        * Mapping from class specification keys to special processing functions.
2139        *
2140        * Although these are declared like instance properties in the specification
2141        * when defining classes using `React.createClass`, they are actually static
2142        * and are accessible on the constructor instead of the prototype. Despite
2143        * being static, they must be defined outside of the "statics" key under
2144        * which all other static methods are defined.
2145        */
2146       var RESERVED_SPEC_KEYS = {
a50b2e 2147         displayName: function(Constructor, displayName) {
be31e2 2148           Constructor.displayName = displayName;
JB 2149         },
a50b2e 2150         mixins: function(Constructor, mixins) {
be31e2 2151           if (mixins) {
JB 2152             for (var i = 0; i < mixins.length; i++) {
2153               mixSpecIntoComponent(Constructor, mixins[i]);
2154             }
2155           }
2156         },
a50b2e 2157         childContextTypes: function(Constructor, childContextTypes) {
be31e2 2158           if (process.env.NODE_ENV !== 'production') {
JB 2159             validateTypeDef(Constructor, childContextTypes, 'childContext');
2160           }
a50b2e 2161           Constructor.childContextTypes = _assign(
GL 2162             {},
2163             Constructor.childContextTypes,
2164             childContextTypes
2165           );
be31e2 2166         },
a50b2e 2167         contextTypes: function(Constructor, contextTypes) {
be31e2 2168           if (process.env.NODE_ENV !== 'production') {
JB 2169             validateTypeDef(Constructor, contextTypes, 'context');
2170           }
a50b2e 2171           Constructor.contextTypes = _assign(
GL 2172             {},
2173             Constructor.contextTypes,
2174             contextTypes
2175           );
be31e2 2176         },
JB 2177         /**
2178          * Special case getDefaultProps which should move into statics but requires
2179          * automatic merging.
2180          */
a50b2e 2181         getDefaultProps: function(Constructor, getDefaultProps) {
be31e2 2182           if (Constructor.getDefaultProps) {
a50b2e 2183             Constructor.getDefaultProps = createMergedResultFunction(
GL 2184               Constructor.getDefaultProps,
2185               getDefaultProps
2186             );
be31e2 2187           } else {
JB 2188             Constructor.getDefaultProps = getDefaultProps;
2189           }
2190         },
a50b2e 2191         propTypes: function(Constructor, propTypes) {
be31e2 2192           if (process.env.NODE_ENV !== 'production') {
JB 2193             validateTypeDef(Constructor, propTypes, 'prop');
2194           }
2195           Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
2196         },
a50b2e 2197         statics: function(Constructor, statics) {
be31e2 2198           mixStaticSpecIntoComponent(Constructor, statics);
JB 2199         },
a50b2e 2200         autobind: function() {}
GL 2201       };
be31e2 2202
JB 2203       function validateTypeDef(Constructor, typeDef, location) {
2204         for (var propName in typeDef) {
2205           if (typeDef.hasOwnProperty(propName)) {
2206             // use a warning instead of an _invariant so components
2207             // don't show up in prod but only in __DEV__
a50b2e 2208             if (process.env.NODE_ENV !== 'production') {
GL 2209               warning(
2210                 typeof typeDef[propName] === 'function',
2211                 '%s: %s type `%s` is invalid; it must be a function, usually from ' +
2212                   'React.PropTypes.',
2213                 Constructor.displayName || 'ReactClass',
2214                 ReactPropTypeLocationNames[location],
2215                 propName
2216               );
2217             }
be31e2 2218           }
JB 2219         }
2220       }
2221
2222       function validateMethodOverride(isAlreadyDefined, name) {
a50b2e 2223         var specPolicy = ReactClassInterface.hasOwnProperty(name)
GL 2224           ? ReactClassInterface[name]
2225           : null;
be31e2 2226
JB 2227         // Disallow overriding of base class methods unless explicitly allowed.
2228         if (ReactClassMixin.hasOwnProperty(name)) {
a50b2e 2229           _invariant(
GL 2230             specPolicy === 'OVERRIDE_BASE',
2231             'ReactClassInterface: You are attempting to override ' +
2232               '`%s` from your class specification. Ensure that your method names ' +
2233               'do not overlap with React methods.',
2234             name
2235           );
be31e2 2236         }
JB 2237
2238         // Disallow defining methods more than once unless explicitly allowed.
2239         if (isAlreadyDefined) {
a50b2e 2240           _invariant(
GL 2241             specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',
2242             'ReactClassInterface: You are attempting to define ' +
2243               '`%s` on your component more than once. This conflict may be due ' +
2244               'to a mixin.',
2245             name
2246           );
be31e2 2247         }
JB 2248       }
2249
2250       /**
2251        * Mixin helper which handles policy validation and reserved
2252        * specification keys when building React classes.
2253        */
2254       function mixSpecIntoComponent(Constructor, spec) {
2255         if (!spec) {
2256           if (process.env.NODE_ENV !== 'production') {
2257             var typeofSpec = typeof spec;
2258             var isMixinValid = typeofSpec === 'object' && spec !== null;
2259
a50b2e 2260             if (process.env.NODE_ENV !== 'production') {
GL 2261               warning(
2262                 isMixinValid,
2263                 "%s: You're attempting to include a mixin that is either null " +
2264                   'or not an object. Check the mixins included by the component, ' +
2265                   'as well as any mixins they include themselves. ' +
2266                   'Expected object but got %s.',
2267                 Constructor.displayName || 'ReactClass',
2268                 spec === null ? null : typeofSpec
2269               );
2270             }
be31e2 2271           }
JB 2272
2273           return;
2274         }
2275
a50b2e 2276         _invariant(
GL 2277           typeof spec !== 'function',
2278           "ReactClass: You're attempting to " +
2279             'use a component class or function as a mixin. Instead, just use a ' +
2280             'regular object.'
2281         );
2282         _invariant(
2283           !isValidElement(spec),
2284           "ReactClass: You're attempting to " +
2285             'use a component as a mixin. Instead, just use a regular object.'
2286         );
be31e2 2287
JB 2288         var proto = Constructor.prototype;
2289         var autoBindPairs = proto.__reactAutoBindPairs;
2290
2291         // By handling mixins before any other properties, we ensure the same
2292         // chaining order is applied to methods with DEFINE_MANY policy, whether
2293         // mixins are listed before or after these methods in the spec.
2294         if (spec.hasOwnProperty(MIXINS_KEY)) {
2295           RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
2296         }
2297
2298         for (var name in spec) {
2299           if (!spec.hasOwnProperty(name)) {
2300             continue;
2301           }
2302
2303           if (name === MIXINS_KEY) {
2304             // We have already handled mixins in a special case above.
2305             continue;
2306           }
2307
2308           var property = spec[name];
2309           var isAlreadyDefined = proto.hasOwnProperty(name);
2310           validateMethodOverride(isAlreadyDefined, name);
2311
2312           if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
2313             RESERVED_SPEC_KEYS[name](Constructor, property);
2314           } else {
2315             // Setup methods on prototype:
2316             // The following member methods should not be automatically bound:
2317             // 1. Expected ReactClass methods (in the "interface").
2318             // 2. Overridden methods (that were mixed in).
2319             var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
2320             var isFunction = typeof property === 'function';
a50b2e 2321             var shouldAutoBind =
GL 2322               isFunction &&
2323               !isReactClassMethod &&
2324               !isAlreadyDefined &&
2325               spec.autobind !== false;
be31e2 2326
JB 2327             if (shouldAutoBind) {
2328               autoBindPairs.push(name, property);
2329               proto[name] = property;
2330             } else {
2331               if (isAlreadyDefined) {
2332                 var specPolicy = ReactClassInterface[name];
2333
2334                 // These cases should already be caught by validateMethodOverride.
a50b2e 2335                 _invariant(
GL 2336                   isReactClassMethod &&
2337                     (specPolicy === 'DEFINE_MANY_MERGED' ||
2338                       specPolicy === 'DEFINE_MANY'),
2339                   'ReactClass: Unexpected spec policy %s for key %s ' +
2340                     'when mixing in component specs.',
2341                   specPolicy,
2342                   name
2343                 );
be31e2 2344
JB 2345                 // For methods which are defined more than once, call the existing
2346                 // methods before calling the new property, merging if appropriate.
2347                 if (specPolicy === 'DEFINE_MANY_MERGED') {
2348                   proto[name] = createMergedResultFunction(proto[name], property);
2349                 } else if (specPolicy === 'DEFINE_MANY') {
2350                   proto[name] = createChainedFunction(proto[name], property);
2351                 }
2352               } else {
2353                 proto[name] = property;
2354                 if (process.env.NODE_ENV !== 'production') {
2355                   // Add verbose displayName to the function, which helps when looking
2356                   // at profiling tools.
2357                   if (typeof property === 'function' && spec.displayName) {
2358                     proto[name].displayName = spec.displayName + '_' + name;
2359                   }
2360                 }
2361               }
2362             }
2363           }
2364         }
2365       }
2366
2367       function mixStaticSpecIntoComponent(Constructor, statics) {
2368         if (!statics) {
2369           return;
2370         }
94dde5 2371
be31e2 2372         for (var name in statics) {
JB 2373           var property = statics[name];
2374           if (!statics.hasOwnProperty(name)) {
2375             continue;
2376           }
2377
2378           var isReserved = name in RESERVED_SPEC_KEYS;
a50b2e 2379           _invariant(
GL 2380             !isReserved,
2381             'ReactClass: You are attempting to define a reserved ' +
2382               'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' +
2383               'as an instance property instead; it will still be accessible on the ' +
2384               'constructor.',
2385             name
2386           );
be31e2 2387
94dde5 2388           var isAlreadyDefined = name in Constructor;
SE 2389           if (isAlreadyDefined) {
2390             var specPolicy = ReactClassStaticInterface.hasOwnProperty(name)
2391               ? ReactClassStaticInterface[name]
2392               : null;
2393
2394             _invariant(
2395               specPolicy === 'DEFINE_MANY_MERGED',
2396               'ReactClass: You are attempting to define ' +
2397                 '`%s` on your component more than once. This conflict may be ' +
2398                 'due to a mixin.',
2399               name
2400             );
2401
2402             Constructor[name] = createMergedResultFunction(Constructor[name], property);
2403
2404             return;
2405           }
2406
be31e2 2407           Constructor[name] = property;
JB 2408         }
2409       }
2410
2411       /**
2412        * Merge two objects, but throw if both contain the same key.
2413        *
2414        * @param {object} one The first object, which is mutated.
2415        * @param {object} two The second object
2416        * @return {object} one after it has been mutated to contain everything in two.
2417        */
2418       function mergeIntoWithNoDuplicateKeys(one, two) {
a50b2e 2419         _invariant(
GL 2420           one && two && typeof one === 'object' && typeof two === 'object',
2421           'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'
2422         );
be31e2 2423
JB 2424         for (var key in two) {
2425           if (two.hasOwnProperty(key)) {
a50b2e 2426             _invariant(
GL 2427               one[key] === undefined,
2428               'mergeIntoWithNoDuplicateKeys(): ' +
2429                 'Tried to merge two objects with the same key: `%s`. This conflict ' +
2430                 'may be due to a mixin; in particular, this may be caused by two ' +
2431                 'getInitialState() or getDefaultProps() methods returning objects ' +
2432                 'with clashing keys.',
2433               key
2434             );
be31e2 2435             one[key] = two[key];
JB 2436           }
2437         }
2438         return one;
2439       }
2440
2441       /**
2442        * Creates a function that invokes two functions and merges their return values.
2443        *
2444        * @param {function} one Function to invoke first.
2445        * @param {function} two Function to invoke second.
2446        * @return {function} Function that invokes the two argument functions.
2447        * @private
2448        */
2449       function createMergedResultFunction(one, two) {
2450         return function mergedResult() {
2451           var a = one.apply(this, arguments);
2452           var b = two.apply(this, arguments);
2453           if (a == null) {
2454             return b;
2455           } else if (b == null) {
2456             return a;
2457           }
2458           var c = {};
2459           mergeIntoWithNoDuplicateKeys(c, a);
2460           mergeIntoWithNoDuplicateKeys(c, b);
2461           return c;
2462         };
2463       }
2464
2465       /**
2466        * Creates a function that invokes two functions and ignores their return vales.
2467        *
2468        * @param {function} one Function to invoke first.
2469        * @param {function} two Function to invoke second.
2470        * @return {function} Function that invokes the two argument functions.
2471        * @private
2472        */
2473       function createChainedFunction(one, two) {
2474         return function chainedFunction() {
2475           one.apply(this, arguments);
2476           two.apply(this, arguments);
2477         };
2478       }
2479
2480       /**
2481        * Binds a method to the component.
2482        *
2483        * @param {object} component Component whose method is going to be bound.
2484        * @param {function} method Method to be bound.
2485        * @return {function} The bound method.
2486        */
2487       function bindAutoBindMethod(component, method) {
2488         var boundMethod = method.bind(component);
2489         if (process.env.NODE_ENV !== 'production') {
2490           boundMethod.__reactBoundContext = component;
2491           boundMethod.__reactBoundMethod = method;
2492           boundMethod.__reactBoundArguments = null;
2493           var componentName = component.constructor.displayName;
2494           var _bind = boundMethod.bind;
a50b2e 2495           boundMethod.bind = function(newThis) {
GL 2496             for (
2497               var _len = arguments.length,
2498                 args = Array(_len > 1 ? _len - 1 : 0),
2499                 _key = 1;
2500               _key < _len;
2501               _key++
2502             ) {
be31e2 2503               args[_key - 1] = arguments[_key];
JB 2504             }
2505
2506             // User is trying to bind() an autobound method; we effectively will
2507             // ignore the value of "this" that the user is trying to use, so
2508             // let's warn.
2509             if (newThis !== component && newThis !== null) {
a50b2e 2510               if (process.env.NODE_ENV !== 'production') {
GL 2511                 warning(
2512                   false,
2513                   'bind(): React component methods may only be bound to the ' +
2514                     'component instance. See %s',
2515                   componentName
2516                 );
2517               }
be31e2 2518             } else if (!args.length) {
a50b2e 2519               if (process.env.NODE_ENV !== 'production') {
GL 2520                 warning(
2521                   false,
2522                   'bind(): You are binding a component method to the component. ' +
2523                     'React does this for you automatically in a high-performance ' +
2524                     'way, so you can safely remove this call. See %s',
2525                   componentName
2526                 );
2527               }
be31e2 2528               return boundMethod;
JB 2529             }
2530             var reboundMethod = _bind.apply(boundMethod, arguments);
2531             reboundMethod.__reactBoundContext = component;
2532             reboundMethod.__reactBoundMethod = method;
2533             reboundMethod.__reactBoundArguments = args;
2534             return reboundMethod;
2535           };
2536         }
2537         return boundMethod;
2538       }
2539
2540       /**
2541        * Binds all auto-bound methods in a component.
2542        *
2543        * @param {object} component Component whose method is going to be bound.
2544        */
2545       function bindAutoBindMethods(component) {
2546         var pairs = component.__reactAutoBindPairs;
2547         for (var i = 0; i < pairs.length; i += 2) {
2548           var autoBindKey = pairs[i];
2549           var method = pairs[i + 1];
2550           component[autoBindKey] = bindAutoBindMethod(component, method);
2551         }
2552       }
2553
a50b2e 2554       var IsMountedPreMixin = {
GL 2555         componentDidMount: function() {
be31e2 2556           this.__isMounted = true;
a50b2e 2557         }
GL 2558       };
2559
2560       var IsMountedPostMixin = {
2561         componentWillUnmount: function() {
be31e2 2562           this.__isMounted = false;
JB 2563         }
2564       };
2565
2566       /**
2567        * Add more to the ReactClass base class. These are all legacy features and
2568        * therefore not already part of the modern ReactComponent.
2569        */
2570       var ReactClassMixin = {
2571         /**
2572          * TODO: This will be deprecated because state should always keep a consistent
2573          * type signature and the only use case for this, is to avoid that.
2574          */
a50b2e 2575         replaceState: function(newState, callback) {
be31e2 2576           this.updater.enqueueReplaceState(this, newState, callback);
JB 2577         },
2578
2579         /**
2580          * Checks whether or not this composite component is mounted.
2581          * @return {boolean} True if mounted, false otherwise.
2582          * @protected
2583          * @final
2584          */
a50b2e 2585         isMounted: function() {
be31e2 2586           if (process.env.NODE_ENV !== 'production') {
a50b2e 2587             warning(
GL 2588               this.__didWarnIsMounted,
2589               '%s: isMounted is deprecated. Instead, make sure to clean up ' +
2590                 'subscriptions and pending requests in componentWillUnmount to ' +
2591                 'prevent memory leaks.',
2592               (this.constructor && this.constructor.displayName) ||
2593                 this.name ||
2594                 'Component'
2595             );
be31e2 2596             this.__didWarnIsMounted = true;
JB 2597           }
2598           return !!this.__isMounted;
2599         }
2600       };
2601
a50b2e 2602       var ReactClassComponent = function() {};
GL 2603       _assign(
2604         ReactClassComponent.prototype,
2605         ReactComponent.prototype,
2606         ReactClassMixin
2607       );
be31e2 2608
JB 2609       /**
2610        * Creates a composite component class given a class specification.
2611        * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
2612        *
2613        * @param {object} spec Class specification (which must define `render`).
2614        * @return {function} Component constructor function.
2615        * @public
2616        */
2617       function createClass(spec) {
2618         // To keep our warnings more understandable, we'll use a little hack here to
2619         // ensure that Constructor.name !== 'Constructor'. This makes sure we don't
2620         // unnecessarily identify a class without displayName as 'Constructor'.
a50b2e 2621         var Constructor = identity(function(props, context, updater) {
be31e2 2622           // This constructor gets overridden by mocks. The argument is used
JB 2623           // by mocks to assert on what gets mounted.
2624
2625           if (process.env.NODE_ENV !== 'production') {
a50b2e 2626             warning(
GL 2627               this instanceof Constructor,
2628               'Something is calling a React component directly. Use a factory or ' +
2629                 'JSX instead. See: https://fb.me/react-legacyfactory'
2630             );
be31e2 2631           }
JB 2632
2633           // Wire up auto-binding
2634           if (this.__reactAutoBindPairs.length) {
2635             bindAutoBindMethods(this);
2636           }
2637
2638           this.props = props;
2639           this.context = context;
2640           this.refs = emptyObject;
2641           this.updater = updater || ReactNoopUpdateQueue;
2642
2643           this.state = null;
2644
2645           // ReactClasses doesn't have constructors. Instead, they use the
2646           // getInitialState and componentWillMount methods for initialization.
2647
2648           var initialState = this.getInitialState ? this.getInitialState() : null;
2649           if (process.env.NODE_ENV !== 'production') {
2650             // We allow auto-mocks to proceed as if they're returning null.
a50b2e 2651             if (
GL 2652               initialState === undefined &&
2653               this.getInitialState._isMockFunction
2654             ) {
be31e2 2655               // This is probably bad practice. Consider warning here and
JB 2656               // deprecating this convenience.
2657               initialState = null;
2658             }
2659           }
a50b2e 2660           _invariant(
GL 2661             typeof initialState === 'object' && !Array.isArray(initialState),
2662             '%s.getInitialState(): must return an object or null',
2663             Constructor.displayName || 'ReactCompositeComponent'
2664           );
be31e2 2665
JB 2666           this.state = initialState;
2667         });
2668         Constructor.prototype = new ReactClassComponent();
2669         Constructor.prototype.constructor = Constructor;
2670         Constructor.prototype.__reactAutoBindPairs = [];
2671
2672         injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
2673
a50b2e 2674         mixSpecIntoComponent(Constructor, IsMountedPreMixin);
be31e2 2675         mixSpecIntoComponent(Constructor, spec);
a50b2e 2676         mixSpecIntoComponent(Constructor, IsMountedPostMixin);
be31e2 2677
JB 2678         // Initialize the defaultProps property after all mixins have been merged.
2679         if (Constructor.getDefaultProps) {
2680           Constructor.defaultProps = Constructor.getDefaultProps();
2681         }
2682
2683         if (process.env.NODE_ENV !== 'production') {
2684           // This is a tag to indicate that the use of these method names is ok,
2685           // since it's used with createClass. If it's not, then it's likely a
2686           // mistake so we'll warn you to use the static property, property
2687           // initializer or constructor respectively.
2688           if (Constructor.getDefaultProps) {
2689             Constructor.getDefaultProps.isReactClassApproved = {};
2690           }
2691           if (Constructor.prototype.getInitialState) {
2692             Constructor.prototype.getInitialState.isReactClassApproved = {};
2693           }
2694         }
2695
a50b2e 2696         _invariant(
GL 2697           Constructor.prototype.render,
2698           'createClass(...): Class specification must implement a `render` method.'
2699         );
be31e2 2700
JB 2701         if (process.env.NODE_ENV !== 'production') {
a50b2e 2702           warning(
GL 2703             !Constructor.prototype.componentShouldUpdate,
2704             '%s has a method called ' +
2705               'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
2706               'The name is phrased as a question because the function is ' +
2707               'expected to return a value.',
2708             spec.displayName || 'A component'
2709           );
2710           warning(
2711             !Constructor.prototype.componentWillRecieveProps,
2712             '%s has a method called ' +
2713               'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',
2714             spec.displayName || 'A component'
2715           );
94dde5 2716           warning(
SE 2717             !Constructor.prototype.UNSAFE_componentWillRecieveProps,
2718             '%s has a method called UNSAFE_componentWillRecieveProps(). ' +
2719               'Did you mean UNSAFE_componentWillReceiveProps()?',
2720             spec.displayName || 'A component'
2721           );
be31e2 2722         }
JB 2723
2724         // Reduce time spent doing lookups by setting these on the prototype.
2725         for (var methodName in ReactClassInterface) {
2726           if (!Constructor.prototype[methodName]) {
2727             Constructor.prototype[methodName] = null;
2728           }
2729         }
2730
2731         return Constructor;
2732       }
2733
2734       return createClass;
2735     }
2736
2737     module.exports = factory;
2738
2739     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
2740
7392ed 2741 /***/ }),
94dde5 2742 /* 15 */
7392ed 2743 /***/ (function(module, exports) {
be31e2 2744
JB 2745     /*
2746     object-assign
2747     (c) Sindre Sorhus
2748     @license MIT
2749     */
2750
2751     'use strict';
2752     /* eslint-disable no-unused-vars */
2753     var getOwnPropertySymbols = Object.getOwnPropertySymbols;
2754     var hasOwnProperty = Object.prototype.hasOwnProperty;
2755     var propIsEnumerable = Object.prototype.propertyIsEnumerable;
2756
2757     function toObject(val) {
2758         if (val === null || val === undefined) {
2759             throw new TypeError('Object.assign cannot be called with null or undefined');
2760         }
2761
2762         return Object(val);
2763     }
2764
2765     function shouldUseNative() {
2766         try {
2767             if (!Object.assign) {
2768                 return false;
2769             }
2770
2771             // Detect buggy property enumeration order in older V8 versions.
2772
2773             // https://bugs.chromium.org/p/v8/issues/detail?id=4118
2774             var test1 = new String('abc');  // eslint-disable-line no-new-wrappers
2775             test1[5] = 'de';
2776             if (Object.getOwnPropertyNames(test1)[0] === '5') {
2777                 return false;
2778             }
2779
2780             // https://bugs.chromium.org/p/v8/issues/detail?id=3056
2781             var test2 = {};
2782             for (var i = 0; i < 10; i++) {
2783                 test2['_' + String.fromCharCode(i)] = i;
2784             }
2785             var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
2786                 return test2[n];
2787             });
2788             if (order2.join('') !== '0123456789') {
2789                 return false;
2790             }
2791
2792             // https://bugs.chromium.org/p/v8/issues/detail?id=3056
2793             var test3 = {};
2794             'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
2795                 test3[letter] = letter;
2796             });
2797             if (Object.keys(Object.assign({}, test3)).join('') !==
2798                     'abcdefghijklmnopqrst') {
2799                 return false;
2800             }
2801
2802             return true;
2803         } catch (err) {
2804             // We don't expect any of the above to throw, but better to be safe.
2805             return false;
2806         }
2807     }
2808
2809     module.exports = shouldUseNative() ? Object.assign : function (target, source) {
2810         var from;
2811         var to = toObject(target);
2812         var symbols;
2813
2814         for (var s = 1; s < arguments.length; s++) {
2815             from = Object(arguments[s]);
2816
2817             for (var key in from) {
2818                 if (hasOwnProperty.call(from, key)) {
2819                     to[key] = from[key];
2820                 }
2821             }
2822
2823             if (getOwnPropertySymbols) {
2824                 symbols = getOwnPropertySymbols(from);
2825                 for (var i = 0; i < symbols.length; i++) {
2826                     if (propIsEnumerable.call(from, symbols[i])) {
2827                         to[symbols[i]] = from[symbols[i]];
2828                     }
2829                 }
2830             }
2831         }
2832
2833         return to;
2834     };
2835
2836
7392ed 2837 /***/ }),
94dde5 2838 /* 16 */
7392ed 2839 /***/ (function(module, exports, __webpack_require__) {
be31e2 2840
JB 2841     /* WEBPACK VAR INJECTION */(function(process) {/**
2842      * Copyright (c) 2013-present, Facebook, Inc.
2843      *
94dde5 2844      * This source code is licensed under the MIT license found in the
SE 2845      * LICENSE file in the root directory of this source tree.
be31e2 2846      *
JB 2847      */
2848
2849     'use strict';
2850
2851     var emptyObject = {};
2852
2853     if (process.env.NODE_ENV !== 'production') {
2854       Object.freeze(emptyObject);
2855     }
2856
2857     module.exports = emptyObject;
2858     /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
2859
7392ed 2860 /***/ }),
94dde5 2861 /* 17 */
7392ed 2862 /***/ (function(module, exports) {
be31e2 2863
94dde5 2864     module.exports = __WEBPACK_EXTERNAL_MODULE_17__;
be31e2 2865
7392ed 2866 /***/ }),
94dde5 2867 /* 18 */
7392ed 2868 /***/ (function(module, exports, __webpack_require__) {
be31e2 2869
833531 2870     'use strict';
SE 2871
94dde5 2872     var React = __webpack_require__(13),
SE 2873         createClass = __webpack_require__(12),
2874         DaysView = __webpack_require__(19),
39b827 2875         MonthsView = __webpack_require__(22),
LA 2876         YearsView = __webpack_require__(23),
2877         TimeView = __webpack_require__(24)
8f6f33 2878         ;
7750ac 2879
be31e2 2880     var CalendarContainer = createClass({
7750ac 2881         viewComponents: {
JM 2882             days: DaysView,
2883             months: MonthsView,
2884             years: YearsView,
2885             time: TimeView
2886         },
2887
8f6f33 2888         render: function() {
LA 2889             return React.createElement( this.viewComponents[ this.props.view ], this.props.viewProps );
2890         }
11612b 2891     });
7750ac 2892
JM 2893     module.exports = CalendarContainer;
2894
2895
7392ed 2896 /***/ }),
94dde5 2897 /* 19 */
7392ed 2898 /***/ (function(module, exports, __webpack_require__) {
d76f7b 2899
be9654 2900     'use strict';
SE 2901
94dde5 2902     var React = __webpack_require__(13),
SE 2903         createClass = __webpack_require__(12),
2904         moment = __webpack_require__(17),
2905         onClickOutside = __webpack_require__(20).default
8f6f33 2906         ;
be9654 2907
be31e2 2908     var DateTimePickerDays = onClickOutside( createClass({
be9654 2909         render: function() {
SE 2910             var footer = this.renderFooter(),
2911                 date = this.props.viewDate,
2912                 locale = date.localeData(),
2913                 tableChildren
8f6f33 2914                 ;
be9654 2915
SE 2916             tableChildren = [
a50b2e 2917                 React.createElement('thead', { key: 'th' }, [
GL 2918                     React.createElement('tr', { key: 'h' }, [
2919                         React.createElement('th', { key: 'p', className: 'rdtPrev', onClick: this.props.subtractTime( 1, 'months' )}, React.createElement('span', {}, '‹' )),
2920                         React.createElement('th', { key: 's', className: 'rdtSwitch', onClick: this.props.showView( 'months' ), colSpan: 5, 'data-value': this.props.viewDate.month() }, locale.months( date ) + ' ' + date.year() ),
2921                         React.createElement('th', { key: 'n', className: 'rdtNext', onClick: this.props.addTime( 1, 'months' )}, React.createElement('span', {}, '›' ))
be9654 2922                     ]),
a50b2e 2923                     React.createElement('tr', { key: 'd'}, this.getDaysOfWeek( locale ).map( function( day, index ) { return React.createElement('th', { key: day + index, className: 'dow'}, day ); }) )
be9654 2924                 ]),
a50b2e 2925                 React.createElement('tbody', { key: 'tb' }, this.renderDays())
be9654 2926             ];
SE 2927
2928             if ( footer )
2929                 tableChildren.push( footer );
2930
a50b2e 2931             return React.createElement('div', { className: 'rdtDays' },
GL 2932                 React.createElement('table', {}, tableChildren )
be9654 2933             );
SE 2934         },
2935
2936         /**
2937          * Get a list of the days of the week
2938          * depending on the current locale
2939          * @return {array} A list with the shortname of the days
2940          */
2941         getDaysOfWeek: function( locale ) {
2942             var days = locale._weekdaysMin,
2943                 first = locale.firstDayOfWeek(),
2944                 dow = [],
2945                 i = 0
8f6f33 2946                 ;
be9654 2947
SE 2948             days.forEach( function( day ) {
2949                 dow[ (7 + ( i++ ) - first) % 7 ] = day;
2950             });
2951
2952             return dow;
2953         },
2954
2955         renderDays: function() {
2956             var date = this.props.viewDate,
2957                 selected = this.props.selectedDate && this.props.selectedDate.clone(),
2958                 prevMonth = date.clone().subtract( 1, 'months' ),
2959                 currentYear = date.year(),
2960                 currentMonth = date.month(),
2961                 weeks = [],
2962                 days = [],
2963                 renderer = this.props.renderDay || this.renderDay,
2964                 isValid = this.props.isValidDate || this.alwaysValidDate,
2965                 classes, isDisabled, dayProps, currentDate
8f6f33 2966                 ;
be9654 2967
SE 2968             // Go to the last week of the previous month
2969             prevMonth.date( prevMonth.daysInMonth() ).startOf( 'week' );
2970             var lastDay = prevMonth.clone().add( 42, 'd' );
2971
2972             while ( prevMonth.isBefore( lastDay ) ) {
2973                 classes = 'rdtDay';
2974                 currentDate = prevMonth.clone();
2975
2976                 if ( ( prevMonth.year() === currentYear && prevMonth.month() < currentMonth ) || ( prevMonth.year() < currentYear ) )
2977                     classes += ' rdtOld';
2978                 else if ( ( prevMonth.year() === currentYear && prevMonth.month() > currentMonth ) || ( prevMonth.year() > currentYear ) )
2979                     classes += ' rdtNew';
2980
2981                 if ( selected && prevMonth.isSame( selected, 'day' ) )
2982                     classes += ' rdtActive';
2983
7750ac 2984                 if ( prevMonth.isSame( moment(), 'day' ) )
be9654 2985                     classes += ' rdtToday';
SE 2986
2987                 isDisabled = !isValid( currentDate, selected );
2988                 if ( isDisabled )
2989                     classes += ' rdtDisabled';
2990
2991                 dayProps = {
2992                     key: prevMonth.format( 'M_D' ),
2993                     'data-value': prevMonth.date(),
2994                     className: classes
2995                 };
2996
2997                 if ( !isDisabled )
2998                     dayProps.onClick = this.updateSelectedDate;
2999
3000                 days.push( renderer( dayProps, currentDate, selected ) );
3001
3002                 if ( days.length === 7 ) {
a50b2e 3003                     weeks.push( React.createElement('tr', { key: prevMonth.format( 'M_D' )}, days ) );
be9654 3004                     days = [];
SE 3005                 }
3006
3007                 prevMonth.add( 1, 'd' );
3008             }
3009
3010             return weeks;
3011         },
3012
3013         updateSelectedDate: function( event ) {
3014             this.props.updateSelectedDate( event, true );
3015         },
3016
3017         renderDay: function( props, currentDate ) {
a50b2e 3018             return React.createElement('td',  props, currentDate.date() );
be9654 3019         },
SE 3020
3021         renderFooter: function() {
3022             if ( !this.props.timeFormat )
3023                 return '';
3024
3025             var date = this.props.selectedDate || this.props.viewDate;
3026
a50b2e 3027             return React.createElement('tfoot', { key: 'tf'},
GL 3028                 React.createElement('tr', {},
3029                     React.createElement('td', { onClick: this.props.showView( 'time' ), colSpan: 7, className: 'rdtTimeToggle' }, date.format( this.props.timeFormat ))
be9654 3030                 )
SE 3031             );
3032         },
3033
3034         alwaysValidDate: function() {
3035             return 1;
11612b 3036         },
JM 3037
8f6f33 3038         handleClickOutside: function() {
LA 3039             this.props.handleClickOutside();
3040         }
11612b 3041     }));
be9654 3042
SE 3043     module.exports = DateTimePickerDays;
3044
d76f7b 3045
7392ed 3046 /***/ }),
94dde5 3047 /* 20 */
7392ed 3048 /***/ (function(module, exports, __webpack_require__) {
d76f7b 3049
39b827 3050     'use strict';
LA 3051
94dde5 3052     Object.defineProperty(exports, '__esModule', { value: true });
39b827 3053
94dde5 3054     var react = __webpack_require__(13);
SE 3055     var reactDom = __webpack_require__(21);
39b827 3056
94dde5 3057     function _inheritsLoose(subClass, superClass) {
SE 3058       subClass.prototype = Object.create(superClass.prototype);
3059       subClass.prototype.constructor = subClass;
3060       subClass.__proto__ = superClass;
3061     }
39b827 3062
94dde5 3063     function _objectWithoutProperties(source, excluded) {
SE 3064       if (source == null) return {};
3065       var target = {};
3066       var sourceKeys = Object.keys(source);
3067       var key, i;
39b827 3068
94dde5 3069       for (i = 0; i < sourceKeys.length; i++) {
SE 3070         key = sourceKeys[i];
3071         if (excluded.indexOf(key) >= 0) continue;
3072         target[key] = source[key];
3073       }
39b827 3074
94dde5 3075       if (Object.getOwnPropertySymbols) {
SE 3076         var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
39b827 3077
94dde5 3078         for (i = 0; i < sourceSymbolKeys.length; i++) {
SE 3079           key = sourceSymbolKeys[i];
3080           if (excluded.indexOf(key) >= 0) continue;
3081           if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
3082           target[key] = source[key];
3083         }
3084       }
39b827 3085
94dde5 3086       return target;
SE 3087     }
39b827 3088
LA 3089     /**
94dde5 3090      * Check whether some DOM node is our Component's node.
7750ac 3091      */
94dde5 3092     function isNodeFound(current, componentNode, ignoreClass) {
SE 3093       if (current === componentNode) {
3094         return true;
3095       } // SVG <use/> elements do not technically reside in the rendered DOM, so
3096       // they do not have classList directly, but they offer a link to their
3097       // corresponding element, which can have classList. This extra check is for
3098       // that case.
3099       // See: http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGUseElement
3100       // Discussion: https://github.com/Pomax/react-onclickoutside/pull/17
be9654 3101
94dde5 3102
SE 3103       if (current.correspondingElement) {
3104         return current.correspondingElement.classList.contains(ignoreClass);
3105       }
3106
3107       return current.classList.contains(ignoreClass);
3108     }
3109     /**
3110      * Try to find our node in a hierarchy of nodes, returning the document
3111      * node as highest node if our node is not found in the path up.
3112      */
3113
3114     function findHighest(current, componentNode, ignoreClass) {
3115       if (current === componentNode) {
3116         return true;
3117       } // If source=local then this event came from 'somewhere'
3118       // inside and should be ignored. We could handle this with
3119       // a layered approach, too, but that requires going back to
3120       // thinking in terms of Dom node nesting, running counter
3121       // to React's 'you shouldn't care about the DOM' philosophy.
3122
3123
3124       while (current.parentNode) {
3125         if (isNodeFound(current, componentNode, ignoreClass)) {
3126           return true;
3127         }
3128
3129         current = current.parentNode;
3130       }
3131
3132       return current;
3133     }
3134     /**
3135      * Check if the browser scrollbar was clicked
3136      */
3137
3138     function clickedScrollbar(evt) {
3139       return document.documentElement.clientWidth <= evt.clientX || document.documentElement.clientHeight <= evt.clientY;
3140     }
3141
3142     // ideally will get replaced with external dep
3143     // when rafrex/detect-passive-events#4 and rafrex/detect-passive-events#5 get merged in
3144     var testPassiveEventSupport = function testPassiveEventSupport() {
3145       if (typeof window === 'undefined' || typeof window.addEventListener !== 'function') {
3146         return;
3147       }
3148
3149       var passive = false;
3150       var options = Object.defineProperty({}, 'passive', {
3151         get: function get() {
3152           passive = true;
3153         }
3154       });
3155
3156       var noop = function noop() {};
3157
3158       window.addEventListener('testPassiveEventSupport', noop, options);
3159       window.removeEventListener('testPassiveEventSupport', noop, options);
3160       return passive;
3161     };
3162
3163     function autoInc(seed) {
3164       if (seed === void 0) {
3165         seed = 0;
3166       }
3167
3168       return function () {
3169         return ++seed;
3170       };
3171     }
3172
3173     var uid = autoInc();
3174
3175     var passiveEventSupport;
3176     var handlersMap = {};
3177     var enabledInstances = {};
39b827 3178     var touchEvents = ['touchstart', 'touchmove'];
94dde5 3179     var IGNORE_CLASS_NAME = 'ignore-react-onclickoutside';
SE 3180     /**
3181      * Options for addEventHandler and removeEventHandler
3182      */
be9654 3183
94dde5 3184     function getEventHandlerOptions(instance, eventName) {
SE 3185       var handlerOptions = null;
3186       var isTouchEvent = touchEvents.indexOf(eventName) !== -1;
3187
3188       if (isTouchEvent && passiveEventSupport) {
3189         handlerOptions = {
3190           passive: !instance.props.preventDefault
3191         };
3192       }
3193
3194       return handlerOptions;
3195     }
39b827 3196     /**
LA 3197      * This function generates the HOC function that you'll use
3198      * in order to impart onOutsideClick listening to an
3199      * arbitrary component. It gets called at the end of the
3200      * bootstrapping code to yield an instance of the
3201      * onClickOutsideHOC function defined inside setupHOC().
3202      */
94dde5 3203
SE 3204
39b827 3205     function onClickOutsideHOC(WrappedComponent, config) {
94dde5 3206       var _class, _temp;
be9654 3207
94dde5 3208       return _temp = _class =
SE 3209       /*#__PURE__*/
3210       function (_Component) {
3211         _inheritsLoose(onClickOutside, _Component);
be9654 3212
94dde5 3213         function onClickOutside(props) {
SE 3214           var _this;
39b827 3215
94dde5 3216           _this = _Component.call(this, props) || this;
39b827 3217
94dde5 3218           _this.__outsideClickHandler = function (event) {
SE 3219             if (typeof _this.__clickOutsideHandlerProp === 'function') {
3220               _this.__clickOutsideHandlerProp(event);
39b827 3221
94dde5 3222               return;
SE 3223             }
3224
3225             var instance = _this.getInstance();
3226
3227             if (typeof instance.props.handleClickOutside === 'function') {
3228               instance.props.handleClickOutside(event);
3229               return;
3230             }
3231
3232             if (typeof instance.handleClickOutside === 'function') {
3233               instance.handleClickOutside(event);
3234               return;
3235             }
3236
3237             throw new Error('WrappedComponent lacks a handleClickOutside(event) function for processing outside click events.');
3238           };
3239
3240           _this.enableOnClickOutside = function () {
3241             if (typeof document === 'undefined' || enabledInstances[_this._uid]) {
3242               return;
3243             }
3244
3245             if (typeof passiveEventSupport === 'undefined') {
3246               passiveEventSupport = testPassiveEventSupport();
3247             }
3248
3249             enabledInstances[_this._uid] = true;
3250             var events = _this.props.eventTypes;
3251
3252             if (!events.forEach) {
3253               events = [events];
3254             }
3255
3256             handlersMap[_this._uid] = function (event) {
3257               if (_this.props.disableOnClickOutside) return;
3258               if (_this.componentNode === null) return;
3259
3260               if (_this.props.preventDefault) {
3261                 event.preventDefault();
3262               }
3263
3264               if (_this.props.stopPropagation) {
3265                 event.stopPropagation();
3266               }
3267
3268               if (_this.props.excludeScrollbar && clickedScrollbar(event)) return;
3269               var current = event.target;
3270
3271               if (findHighest(current, _this.componentNode, _this.props.outsideClickIgnoreClass) !== document) {
3272                 return;
3273               }
3274
3275               _this.__outsideClickHandler(event);
3276             };
3277
3278             events.forEach(function (eventName) {
3279               document.addEventListener(eventName, handlersMap[_this._uid], getEventHandlerOptions(_this, eventName));
3280             });
3281           };
3282
3283           _this.disableOnClickOutside = function () {
3284             delete enabledInstances[_this._uid];
3285             var fn = handlersMap[_this._uid];
3286
39b827 3287             if (fn && typeof document !== 'undefined') {
LA 3288               var events = _this.props.eventTypes;
94dde5 3289
39b827 3290               if (!events.forEach) {
LA 3291                 events = [events];
3292               }
3293
3294               events.forEach(function (eventName) {
94dde5 3295                 return document.removeEventListener(eventName, fn, getEventHandlerOptions(_this, eventName));
39b827 3296               });
94dde5 3297               delete handlersMap[_this._uid];
39b827 3298             }
94dde5 3299           };
SE 3300
3301           _this.getRef = function (ref) {
39b827 3302             return _this.instanceRef = ref;
94dde5 3303           };
be9654 3304
94dde5 3305           _this._uid = uid();
SE 3306           return _this;
3307         }
39b827 3308         /**
LA 3309          * Access the WrappedComponent's instance.
3310          */
94dde5 3311
SE 3312
3313         var _proto = onClickOutside.prototype;
3314
3315         _proto.getInstance = function getInstance() {
39b827 3316           if (!WrappedComponent.prototype.isReactComponent) {
LA 3317             return this;
3318           }
94dde5 3319
39b827 3320           var ref = this.instanceRef;
LA 3321           return ref.getInstance ? ref.getInstance() : ref;
3322         };
3323
3324         /**
3325          * Add click listeners to the current document,
3326          * linked to this component's state.
3327          */
94dde5 3328         _proto.componentDidMount = function componentDidMount() {
39b827 3329           // If we are in an environment without a DOM such
LA 3330           // as shallow rendering or snapshots then we exit
3331           // early to prevent any unhandled errors being thrown.
3332           if (typeof document === 'undefined' || !document.createElement) {
7750ac 3333             return;
JM 3334           }
be9654 3335
39b827 3336           var instance = this.getInstance();
be9654 3337
39b827 3338           if (config && typeof config.handleClickOutside === 'function') {
LA 3339             this.__clickOutsideHandlerProp = config.handleClickOutside(instance);
94dde5 3340
39b827 3341             if (typeof this.__clickOutsideHandlerProp !== 'function') {
LA 3342               throw new Error('WrappedComponent lacks a function for processing outside click events specified by the handleClickOutside config option.');
7750ac 3343             }
39b827 3344           }
7750ac 3345
94dde5 3346           this.componentNode = reactDom.findDOMNode(this.getInstance());
SE 3347           this.enableOnClickOutside();
7750ac 3348         };
JM 3349
94dde5 3350         _proto.componentDidUpdate = function componentDidUpdate() {
SE 3351           this.componentNode = reactDom.findDOMNode(this.getInstance());
39b827 3352         };
LA 3353         /**
3354          * Remove all document's event listeners for this component
3355          */
3356
3357
94dde5 3358         _proto.componentWillUnmount = function componentWillUnmount() {
SE 3359           this.disableOnClickOutside();
39b827 3360         };
LA 3361         /**
3362          * Can be called to explicitly enable event listening
3363          * for clicks and touches outside of this element.
3364          */
3365
3366
3367         /**
3368          * Pass-through render
3369          */
94dde5 3370         _proto.render = function render() {
SE 3371           // eslint-disable-next-line no-unused-vars
3372           var _props = this.props,
3373               excludeScrollbar = _props.excludeScrollbar,
3374               props = _objectWithoutProperties(_props, ["excludeScrollbar"]);
39b827 3375
LA 3376           if (WrappedComponent.prototype.isReactComponent) {
3377             props.ref = this.getRef;
3378           } else {
3379             props.wrappedRef = this.getRef;
3380           }
3381
3382           props.disableOnClickOutside = this.disableOnClickOutside;
3383           props.enableOnClickOutside = this.enableOnClickOutside;
94dde5 3384           return react.createElement(WrappedComponent, props);
39b827 3385         };
LA 3386
3387         return onClickOutside;
94dde5 3388       }(react.Component), _class.displayName = "OnClickOutside(" + (WrappedComponent.displayName || WrappedComponent.name || 'Component') + ")", _class.defaultProps = {
39b827 3389         eventTypes: ['mousedown', 'touchstart'],
LA 3390         excludeScrollbar: config && config.excludeScrollbar || false,
3391         outsideClickIgnoreClass: IGNORE_CLASS_NAME,
3392         preventDefault: false,
3393         stopPropagation: false
3394       }, _class.getClass = function () {
3395         return WrappedComponent.getClass ? WrappedComponent.getClass() : WrappedComponent;
94dde5 3396       }, _temp;
39b827 3397     }
d359eb 3398
94dde5 3399     exports.IGNORE_CLASS_NAME = IGNORE_CLASS_NAME;
SE 3400     exports['default'] = onClickOutsideHOC;
d359eb 3401
11612b 3402
7392ed 3403 /***/ }),
be31e2 3404 /* 21 */
39b827 3405 /***/ (function(module, exports) {
LA 3406
94dde5 3407     module.exports = __WEBPACK_EXTERNAL_MODULE_21__;
39b827 3408
LA 3409 /***/ }),
3410 /* 22 */
7392ed 3411 /***/ (function(module, exports, __webpack_require__) {
11612b 3412
JM 3413     'use strict';
3414
94dde5 3415     var React = __webpack_require__(13),
SE 3416         createClass = __webpack_require__(12),
3417         onClickOutside = __webpack_require__(20).default
8f6f33 3418         ;
11612b 3419
be31e2 3420     var DateTimePickerMonths = onClickOutside( createClass({
11612b 3421         render: function() {
a50b2e 3422             return React.createElement('div', { className: 'rdtMonths' }, [
GL 3423                 React.createElement('table', { key: 'a' }, React.createElement('thead', {}, React.createElement('tr', {}, [
3424                     React.createElement('th', { key: 'prev', className: 'rdtPrev', onClick: this.props.subtractTime( 1, 'years' )}, React.createElement('span', {}, '‹' )),
3425                     React.createElement('th', { key: 'year', className: 'rdtSwitch', onClick: this.props.showView( 'years' ), colSpan: 2, 'data-value': this.props.viewDate.year() }, this.props.viewDate.year() ),
3426                     React.createElement('th', { key: 'next', className: 'rdtNext', onClick: this.props.addTime( 1, 'years' )}, React.createElement('span', {}, '›' ))
11612b 3427                 ]))),
a50b2e 3428                 React.createElement('table', { key: 'months' }, React.createElement('tbody', { key: 'b' }, this.renderMonths()))
11612b 3429             ]);
JM 3430         },
3431
3432         renderMonths: function() {
3433             var date = this.props.selectedDate,
3434                 month = this.props.viewDate.month(),
3435                 year = this.props.viewDate.year(),
3436                 rows = [],
3437                 i = 0,
3438                 months = [],
3439                 renderer = this.props.renderMonth || this.renderMonth,
3440                 isValid = this.props.isValidDate || this.alwaysValidDate,
3441                 classes, props, currentMonth, isDisabled, noOfDaysInMonth, daysInMonth, validDay,
3442                 // Date is irrelevant because we're only interested in month
3443                 irrelevantDate = 1
8f6f33 3444                 ;
11612b 3445
JM 3446             while (i < 12) {
3447                 classes = 'rdtMonth';
3448                 currentMonth =
3449                     this.props.viewDate.clone().set({ year: year, month: i, date: irrelevantDate });
3450
3451                 noOfDaysInMonth = currentMonth.endOf( 'month' ).format( 'D' );
3452                 daysInMonth = Array.from({ length: noOfDaysInMonth }, function( e, i ) {
3453                     return i + 1;
3454                 });
3455
3456                 validDay = daysInMonth.find(function( d ) {
3457                     var day = currentMonth.clone().set( 'date', d );
3458                     return isValid( day );
3459                 });
3460
3461                 isDisabled = ( validDay === undefined );
3462
3463                 if ( isDisabled )
3464                     classes += ' rdtDisabled';
3465
7d7b99 3466                 if ( date && i === date.month() && year === date.year() )
11612b 3467                     classes += ' rdtActive';
JM 3468
3469                 props = {
3470                     key: i,
3471                     'data-value': i,
3472                     className: classes
3473                 };
3474
3475                 if ( !isDisabled )
3476                     props.onClick = ( this.props.updateOn === 'months' ?
3477                         this.updateSelectedMonth : this.props.setDate( 'month' ) );
3478
3479                 months.push( renderer( props, i, year, date && date.clone() ) );
3480
3481                 if ( months.length === 4 ) {
a50b2e 3482                     rows.push( React.createElement('tr', { key: month + '_' + rows.length }, months ) );
11612b 3483                     months = [];
JM 3484                 }
3485
3486                 i++;
3487             }
3488
3489             return rows;
3490         },
3491
3492         updateSelectedMonth: function( event ) {
3493             this.props.updateSelectedDate( event );
3494         },
3495
3496         renderMonth: function( props, month ) {
3497             var localMoment = this.props.viewDate;
3498             var monthStr = localMoment.localeData().monthsShort( localMoment.month( month ) );
3499             var strLength = 3;
3500             // Because some months are up to 5 characters long, we want to
3501             // use a fixed string length for consistency
3502             var monthStrFixedLength = monthStr.substring( 0, strLength );
a50b2e 3503             return React.createElement('td', props, capitalize( monthStrFixedLength ) );
11612b 3504         },
JM 3505
3506         alwaysValidDate: function() {
3507             return 1;
3508         },
3509
8f6f33 3510         handleClickOutside: function() {
LA 3511             this.props.handleClickOutside();
3512         }
11612b 3513     }));
JM 3514
3515     function capitalize( str ) {
3516         return str.charAt( 0 ).toUpperCase() + str.slice( 1 );
3517     }
3518
3519     module.exports = DateTimePickerMonths;
3520
3521
7392ed 3522 /***/ }),
39b827 3523 /* 23 */
7392ed 3524 /***/ (function(module, exports, __webpack_require__) {
11612b 3525
JM 3526     'use strict';
3527
94dde5 3528     var React = __webpack_require__(13),
SE 3529         createClass = __webpack_require__(12),
3530         onClickOutside = __webpack_require__(20).default
8f6f33 3531         ;
a50b2e 3532
be31e2 3533     var DateTimePickerYears = onClickOutside( createClass({
11612b 3534         render: function() {
JM 3535             var year = parseInt( this.props.viewDate.year() / 10, 10 ) * 10;
3536
a50b2e 3537             return React.createElement('div', { className: 'rdtYears' }, [
GL 3538                 React.createElement('table', { key: 'a' }, React.createElement('thead', {}, React.createElement('tr', {}, [
3539                     React.createElement('th', { key: 'prev', className: 'rdtPrev', onClick: this.props.subtractTime( 10, 'years' )}, React.createElement('span', {}, '‹' )),
3540                     React.createElement('th', { key: 'year', className: 'rdtSwitch', onClick: this.props.showView( 'years' ), colSpan: 2 }, year + '-' + ( year + 9 ) ),
3541                     React.createElement('th', { key: 'next', className: 'rdtNext', onClick: this.props.addTime( 10, 'years' )}, React.createElement('span', {}, '›' ))
8f6f33 3542                 ]))),
a50b2e 3543                 React.createElement('table', { key: 'years' }, React.createElement('tbody',  {}, this.renderYears( year )))
11612b 3544             ]);
JM 3545         },
3546
3547         renderYears: function( year ) {
3548             var years = [],
3549                 i = -1,
3550                 rows = [],
3551                 renderer = this.props.renderYear || this.renderYear,
3552                 selectedDate = this.props.selectedDate,
3553                 isValid = this.props.isValidDate || this.alwaysValidDate,
3554                 classes, props, currentYear, isDisabled, noOfDaysInYear, daysInYear, validDay,
3555                 // Month and date are irrelevant here because
3556                 // we're only interested in the year
3557                 irrelevantMonth = 0,
3558                 irrelevantDate = 1
8f6f33 3559                 ;
11612b 3560
JM 3561             year--;
3562             while (i < 11) {
3563                 classes = 'rdtYear';
3564                 currentYear = this.props.viewDate.clone().set(
3565                     { year: year, month: irrelevantMonth, date: irrelevantDate } );
3566
3567                 // Not sure what 'rdtOld' is for, commenting out for now as it's not working properly
3568                 // if ( i === -1 | i === 10 )
3569                     // classes += ' rdtOld';
3570
3571                 noOfDaysInYear = currentYear.endOf( 'year' ).format( 'DDD' );
3572                 daysInYear = Array.from({ length: noOfDaysInYear }, function( e, i ) {
3573                     return i + 1;
3574                 });
3575
3576                 validDay = daysInYear.find(function( d ) {
3577                     var day = currentYear.clone().dayOfYear( d );
3578                     return isValid( day );
3579                 });
3580
3581                 isDisabled = ( validDay === undefined );
3582
3583                 if ( isDisabled )
3584                     classes += ' rdtDisabled';
3585
3586                 if ( selectedDate && selectedDate.year() === year )
3587                     classes += ' rdtActive';
3588
3589                 props = {
3590                     key: year,
3591                     'data-value': year,
3592                     className: classes
3593                 };
3594
3595                 if ( !isDisabled )
3596                     props.onClick = ( this.props.updateOn === 'years' ?
3597                         this.updateSelectedYear : this.props.setDate('year') );
3598
3599                 years.push( renderer( props, year, selectedDate && selectedDate.clone() ));
3600
3601                 if ( years.length === 4 ) {
a50b2e 3602                     rows.push( React.createElement('tr', { key: i }, years ) );
11612b 3603                     years = [];
JM 3604                 }
3605
3606                 year++;
3607                 i++;
3608             }
3609
3610             return rows;
3611         },
3612
3613         updateSelectedYear: function( event ) {
3614             this.props.updateSelectedDate( event );
3615         },
3616
3617         renderYear: function( props, year ) {
a50b2e 3618             return React.createElement('td',  props, year );
11612b 3619         },
JM 3620
3621         alwaysValidDate: function() {
3622             return 1;
3623         },
3624
8f6f33 3625         handleClickOutside: function() {
LA 3626             this.props.handleClickOutside();
3627         }
11612b 3628     }));
JM 3629
3630     module.exports = DateTimePickerYears;
3631
3632
7392ed 3633 /***/ }),
39b827 3634 /* 24 */
7392ed 3635 /***/ (function(module, exports, __webpack_require__) {
11612b 3636
JM 3637     'use strict';
3638
94dde5 3639     var React = __webpack_require__(13),
SE 3640         createClass = __webpack_require__(12),
11612b 3641         assign = __webpack_require__(1),
94dde5 3642         onClickOutside = __webpack_require__(20).default
8f6f33 3643         ;
11612b 3644
be31e2 3645     var DateTimePickerTime = onClickOutside( createClass({
11612b 3646         getInitialState: function() {
JM 3647             return this.calculateState( this.props );
3648         },
3649
3650         calculateState: function( props ) {
3651             var date = props.selectedDate || props.viewDate,
3652                 format = props.timeFormat,
3653                 counters = []
8f6f33 3654                 ;
11612b 3655
JM 3656             if ( format.toLowerCase().indexOf('h') !== -1 ) {
3657                 counters.push('hours');
3658                 if ( format.indexOf('m') !== -1 ) {
3659                     counters.push('minutes');
3660                     if ( format.indexOf('s') !== -1 ) {
3661                         counters.push('seconds');
3662                     }
3663                 }
3664             }
3665
c1a952 3666             var hours = date.format( 'H' );
SE 3667             
11612b 3668             var daypart = false;
JM 3669             if ( this.state !== null && this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1 ) {
3670                 if ( this.props.timeFormat.indexOf( ' A' ) !== -1 ) {
c1a952 3671                     daypart = ( hours >= 12 ) ? 'PM' : 'AM';
11612b 3672                 } else {
c1a952 3673                     daypart = ( hours >= 12 ) ? 'pm' : 'am';
11612b 3674                 }
JM 3675             }
3676
3677             return {
c1a952 3678                 hours: hours,
11612b 3679                 minutes: date.format( 'mm' ),
JM 3680                 seconds: date.format( 'ss' ),
3681                 milliseconds: date.format( 'SSS' ),
3682                 daypart: daypart,
3683                 counters: counters
3684             };
3685         },
3686
3687         renderCounter: function( type ) {
3688             if ( type !== 'daypart' ) {
3689                 var value = this.state[ type ];
3690                 if ( type === 'hours' && this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1 ) {
3691                     value = ( value - 1 ) % 12 + 1;
3692
3693                     if ( value === 0 ) {
3694                         value = 12;
3695                     }
3696                 }
a50b2e 3697                 return React.createElement('div', { key: type, className: 'rdtCounter' }, [
94dde5 3698                     React.createElement('span', { key: 'up', className: 'rdtBtn', onTouchStart: this.onStartClicking('increase', type), onMouseDown: this.onStartClicking( 'increase', type ), onContextMenu: this.disableContextMenu }, '▲' ),
a50b2e 3699                     React.createElement('div', { key: 'c', className: 'rdtCount' }, value ),
94dde5 3700                     React.createElement('span', { key: 'do', className: 'rdtBtn', onTouchStart: this.onStartClicking('decrease', type), onMouseDown: this.onStartClicking( 'decrease', type ), onContextMenu: this.disableContextMenu }, '▼' )
11612b 3701                 ]);
JM 3702             }
3703             return '';
3704         },
3705
3706         renderDayPart: function() {
a50b2e 3707             return React.createElement('div', { key: 'dayPart', className: 'rdtCounter' }, [
94dde5 3708                 React.createElement('span', { key: 'up', className: 'rdtBtn', onTouchStart: this.onStartClicking('toggleDayPart', 'hours'), onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▲' ),
a50b2e 3709                 React.createElement('div', { key: this.state.daypart, className: 'rdtCount' }, this.state.daypart ),
94dde5 3710                 React.createElement('span', { key: 'do', className: 'rdtBtn', onTouchStart: this.onStartClicking('toggleDayPart', 'hours'), onMouseDown: this.onStartClicking( 'toggleDayPart', 'hours'), onContextMenu: this.disableContextMenu }, '▼' )
11612b 3711             ]);
JM 3712         },
3713
3714         render: function() {
3715             var me = this,
3716                 counters = []
3717             ;
3718
3719             this.state.counters.forEach( function( c ) {
3720                 if ( counters.length )
a50b2e 3721                     counters.push( React.createElement('div', { key: 'sep' + counters.length, className: 'rdtCounterSeparator' }, ':' ) );
11612b 3722                 counters.push( me.renderCounter( c ) );
JM 3723             });
3724
3725             if ( this.state.daypart !== false ) {
3726                 counters.push( me.renderDayPart() );
3727             }
3728
3729             if ( this.state.counters.length === 3 && this.props.timeFormat.indexOf( 'S' ) !== -1 ) {
a50b2e 3730                 counters.push( React.createElement('div', { className: 'rdtCounterSeparator', key: 'sep5' }, ':' ) );
11612b 3731                 counters.push(
a50b2e 3732                     React.createElement('div', { className: 'rdtCounter rdtMilli', key: 'm' },
GL 3733                         React.createElement('input', { value: this.state.milliseconds, type: 'text', onChange: this.updateMilli } )
11612b 3734                         )
JM 3735                     );
3736             }
3737
a50b2e 3738             return React.createElement('div', { className: 'rdtTime' },
GL 3739                 React.createElement('table', {}, [
11612b 3740                     this.renderHeader(),
a50b2e 3741                     React.createElement('tbody', { key: 'b'}, React.createElement('tr', {}, React.createElement('td', {},
GL 3742                         React.createElement('div', { className: 'rdtCounters' }, counters )
11612b 3743                     )))
JM 3744                 ])
3745             );
3746         },
3747
3748         componentWillMount: function() {
3749             var me = this;
3750             me.timeConstraints = {
3751                 hours: {
3752                     min: 0,
3753                     max: 23,
3754                     step: 1
3755                 },
3756                 minutes: {
3757                     min: 0,
3758                     max: 59,
3759                     step: 1
3760                 },
3761                 seconds: {
3762                     min: 0,
3763                     max: 59,
3764                     step: 1
3765                 },
3766                 milliseconds: {
3767                     min: 0,
3768                     max: 999,
3769                     step: 1
3770                 }
3771             };
3772             ['hours', 'minutes', 'seconds', 'milliseconds'].forEach( function( type ) {
3773                 assign(me.timeConstraints[ type ], me.props.timeConstraints[ type ]);
3774             });
3775             this.setState( this.calculateState( this.props ) );
3776         },
3777
3778         componentWillReceiveProps: function( nextProps ) {
3779             this.setState( this.calculateState( nextProps ) );
3780         },
3781
3782         updateMilli: function( e ) {
3783             var milli = parseInt( e.target.value, 10 );
3784             if ( milli === e.target.value && milli >= 0 && milli < 1000 ) {
3785                 this.props.setTime( 'milliseconds', milli );
3786                 this.setState( { milliseconds: milli } );
3787             }
3788         },
3789
3790         renderHeader: function() {
3791             if ( !this.props.dateFormat )
3792                 return null;
3793
3794             var date = this.props.selectedDate || this.props.viewDate;
a50b2e 3795             return React.createElement('thead', { key: 'h' }, React.createElement('tr', {},
GL 3796                 React.createElement('th', { className: 'rdtSwitch', colSpan: 4, onClick: this.props.showView( 'days' ) }, date.format( this.props.dateFormat ) )
11612b 3797             ));
JM 3798         },
3799
3800         onStartClicking: function( action, type ) {
3801             var me = this;
3802
3803             return function() {
3804                 var update = {};
3805                 update[ type ] = me[ action ]( type );
3806                 me.setState( update );
3807
3808                 me.timer = setTimeout( function() {
3809                     me.increaseTimer = setInterval( function() {
3810                         update[ type ] = me[ action ]( type );
3811                         me.setState( update );
3812                     }, 70);
3813                 }, 500);
3814
3815                 me.mouseUpListener = function() {
3816                     clearTimeout( me.timer );
3817                     clearInterval( me.increaseTimer );
3818                     me.props.setTime( type, me.state[ type ] );
3819                     document.body.removeEventListener( 'mouseup', me.mouseUpListener );
94dde5 3820                     document.body.removeEventListener( 'touchend', me.mouseUpListener );
11612b 3821                 };
JM 3822
3823                 document.body.addEventListener( 'mouseup', me.mouseUpListener );
94dde5 3824                 document.body.addEventListener( 'touchend', me.mouseUpListener );
11612b 3825             };
JM 3826         },
3827
c1a952 3828         disableContextMenu: function( event ) {
SE 3829             event.preventDefault();
3830             return false;
3831         },
3832
11612b 3833         padValues: {
JM 3834             hours: 1,
3835             minutes: 2,
3836             seconds: 2,
3837             milliseconds: 3
3838         },
3839
3840         toggleDayPart: function( type ) { // type is always 'hours'
3841             var value = parseInt( this.state[ type ], 10) + 12;
3842             if ( value > this.timeConstraints[ type ].max )
3843                 value = this.timeConstraints[ type ].min + ( value - ( this.timeConstraints[ type ].max + 1 ) );
3844             return this.pad( type, value );
3845         },
3846
3847         increase: function( type ) {
3848             var value = parseInt( this.state[ type ], 10) + this.timeConstraints[ type ].step;
3849             if ( value > this.timeConstraints[ type ].max )
3850                 value = this.timeConstraints[ type ].min + ( value - ( this.timeConstraints[ type ].max + 1 ) );
3851             return this.pad( type, value );
3852         },
3853
3854         decrease: function( type ) {
3855             var value = parseInt( this.state[ type ], 10) - this.timeConstraints[ type ].step;
3856             if ( value < this.timeConstraints[ type ].min )
3857                 value = this.timeConstraints[ type ].max + 1 - ( this.timeConstraints[ type ].min - value );
3858             return this.pad( type, value );
3859         },
3860
3861         pad: function( type, value ) {
3862             var str = value + '';
3863             while ( str.length < this.padValues[ type ] )
3864                 str = '0' + str;
3865             return str;
3866         },
3867
8f6f33 3868         handleClickOutside: function() {
LA 3869             this.props.handleClickOutside();
3870         }
11612b 3871     }));
JM 3872
3873     module.exports = DateTimePickerTime;
3874
d76f7b 3875
7392ed 3876 /***/ })
d76f7b 3877 /******/ ])
M 3878 });
be9654 3879 ;