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