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