UNPKG

56.1 kBJavaScriptView Raw
1module.exports =
2/******/ (function(modules) { // webpackBootstrap
3/******/ // The module cache
4/******/ var installedModules = {};
5/******/
6/******/ // The require function
7/******/ function __webpack_require__(moduleId) {
8/******/
9/******/ // Check if module is in cache
10/******/ if(installedModules[moduleId])
11/******/ return installedModules[moduleId].exports;
12/******/
13/******/ // Create a new module (and put it into the cache)
14/******/ var module = installedModules[moduleId] = {
15/******/ exports: {},
16/******/ id: moduleId,
17/******/ loaded: false
18/******/ };
19/******/
20/******/ // Execute the module function
21/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22/******/
23/******/ // Flag the module as loaded
24/******/ module.loaded = true;
25/******/
26/******/ // Return the exports of the module
27/******/ return module.exports;
28/******/ }
29/******/
30/******/
31/******/ // expose the modules object (__webpack_modules__)
32/******/ __webpack_require__.m = modules;
33/******/
34/******/ // expose the module cache
35/******/ __webpack_require__.c = installedModules;
36/******/
37/******/ // __webpack_public_path__
38/******/ __webpack_require__.p = "";
39/******/
40/******/ // Load entry module and return exports
41/******/ return __webpack_require__(0);
42/******/ })
43/************************************************************************/
44/******/ ([
45/* 0 */
46/***/ (function(module, exports, __webpack_require__) {
47
48 module.exports = __webpack_require__(1);
49
50
51/***/ }),
52/* 1 */
53/***/ (function(module, exports, __webpack_require__) {
54
55 'use strict';
56
57 Object.defineProperty(exports, '__esModule', {
58 value: true
59 });
60
61 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
62
63 var _Highlighter = __webpack_require__(2);
64
65 var _Highlighter2 = _interopRequireDefault(_Highlighter);
66
67 exports['default'] = _Highlighter2['default'];
68 module.exports = exports['default'];
69
70/***/ }),
71/* 2 */
72/***/ (function(module, exports, __webpack_require__) {
73
74 'use strict';
75
76 Object.defineProperty(exports, '__esModule', {
77 value: true
78 });
79 exports['default'] = Highlighter;
80
81 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
82
83 var _highlightWordsCore = __webpack_require__(3);
84
85 var _propTypes = __webpack_require__(4);
86
87 var _propTypes2 = _interopRequireDefault(_propTypes);
88
89 var _react = __webpack_require__(14);
90
91 var _react2 = _interopRequireDefault(_react);
92
93 var _memoizeOne = __webpack_require__(15);
94
95 var _memoizeOne2 = _interopRequireDefault(_memoizeOne);
96
97 Highlighter.propTypes = {
98 activeClassName: _propTypes2['default'].string,
99 activeIndex: _propTypes2['default'].number,
100 activeStyle: _propTypes2['default'].object,
101 autoEscape: _propTypes2['default'].bool,
102 className: _propTypes2['default'].string,
103 findChunks: _propTypes2['default'].func,
104 highlightClassName: _propTypes2['default'].oneOfType([_propTypes2['default'].object, _propTypes2['default'].string]),
105 highlightStyle: _propTypes2['default'].object,
106 highlightTag: _propTypes2['default'].oneOfType([_propTypes2['default'].node, _propTypes2['default'].func, _propTypes2['default'].string]),
107 sanitize: _propTypes2['default'].func,
108 searchWords: _propTypes2['default'].arrayOf(_propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].instanceOf(RegExp)])).isRequired,
109 textToHighlight: _propTypes2['default'].string.isRequired,
110 unhighlightClassName: _propTypes2['default'].string,
111 unhighlightStyle: _propTypes2['default'].object
112 };
113
114 /**
115 * Highlights all occurrences of search terms (searchText) within a string (textToHighlight).
116 * This function returns an array of strings and <span>s (wrapping highlighted words).
117 */
118
119 function Highlighter(_ref) {
120 var _ref$activeClassName = _ref.activeClassName;
121 var activeClassName = _ref$activeClassName === undefined ? '' : _ref$activeClassName;
122 var _ref$activeIndex = _ref.activeIndex;
123 var activeIndex = _ref$activeIndex === undefined ? -1 : _ref$activeIndex;
124 var activeStyle = _ref.activeStyle;
125 var autoEscape = _ref.autoEscape;
126 var _ref$caseSensitive = _ref.caseSensitive;
127 var caseSensitive = _ref$caseSensitive === undefined ? false : _ref$caseSensitive;
128 var className = _ref.className;
129 var findChunks = _ref.findChunks;
130 var _ref$highlightClassName = _ref.highlightClassName;
131 var highlightClassName = _ref$highlightClassName === undefined ? '' : _ref$highlightClassName;
132 var _ref$highlightStyle = _ref.highlightStyle;
133 var highlightStyle = _ref$highlightStyle === undefined ? {} : _ref$highlightStyle;
134 var _ref$highlightTag = _ref.highlightTag;
135 var highlightTag = _ref$highlightTag === undefined ? 'mark' : _ref$highlightTag;
136 var sanitize = _ref.sanitize;
137 var searchWords = _ref.searchWords;
138 var textToHighlight = _ref.textToHighlight;
139 var _ref$unhighlightClassName = _ref.unhighlightClassName;
140 var unhighlightClassName = _ref$unhighlightClassName === undefined ? '' : _ref$unhighlightClassName;
141 var unhighlightStyle = _ref.unhighlightStyle;
142
143 var chunks = (0, _highlightWordsCore.findAll)({
144 autoEscape: autoEscape,
145 caseSensitive: caseSensitive,
146 findChunks: findChunks,
147 sanitize: sanitize,
148 searchWords: searchWords,
149 textToHighlight: textToHighlight
150 });
151 var HighlightTag = highlightTag;
152 var highlightCount = -1;
153 var highlightClassNames = '';
154 var highlightStyles = undefined;
155
156 var lowercaseProps = function lowercaseProps(object) {
157 var mapped = {};
158 for (var key in object) {
159 mapped[key.toLowerCase()] = object[key];
160 }
161 return mapped;
162 };
163 var memoizedLowercaseProps = (0, _memoizeOne2['default'])(lowercaseProps);
164
165 return _react2['default'].createElement(
166 'span',
167 { className: className },
168 chunks.map(function (chunk, index) {
169 var text = textToHighlight.substr(chunk.start, chunk.end - chunk.start);
170
171 if (chunk.highlight) {
172 highlightCount++;
173
174 var highlightClass = undefined;
175 if (typeof highlightClassName === 'object') {
176 if (!caseSensitive) {
177 highlightClassName = memoizedLowercaseProps(highlightClassName);
178 highlightClass = highlightClassName[text.toLowerCase()];
179 } else {
180 highlightClass = highlightClassName[text];
181 }
182 } else {
183 highlightClass = highlightClassName;
184 }
185
186 var isActive = highlightCount === +activeIndex;
187
188 highlightClassNames = highlightClass + ' ' + (isActive ? activeClassName : '');
189 highlightStyles = isActive === true && activeStyle != null ? Object.assign({}, highlightStyle, activeStyle) : highlightStyle;
190
191 return _react2['default'].createElement(
192 HighlightTag,
193 {
194 className: highlightClassNames,
195 highlightIndex: highlightCount,
196 key: index,
197 style: highlightStyles
198 },
199 text
200 );
201 } else {
202 return _react2['default'].createElement(
203 'span',
204 {
205 className: unhighlightClassName,
206 key: index,
207 style: unhighlightStyle
208 },
209 text
210 );
211 }
212 })
213 );
214 }
215
216 module.exports = exports['default'];
217
218/***/ }),
219/* 3 */
220/***/ (function(module, exports) {
221
222 module.exports =
223 /******/ (function(modules) { // webpackBootstrap
224 /******/ // The module cache
225 /******/ var installedModules = {};
226 /******/
227 /******/ // The require function
228 /******/ function __webpack_require__(moduleId) {
229 /******/
230 /******/ // Check if module is in cache
231 /******/ if(installedModules[moduleId])
232 /******/ return installedModules[moduleId].exports;
233 /******/
234 /******/ // Create a new module (and put it into the cache)
235 /******/ var module = installedModules[moduleId] = {
236 /******/ exports: {},
237 /******/ id: moduleId,
238 /******/ loaded: false
239 /******/ };
240 /******/
241 /******/ // Execute the module function
242 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
243 /******/
244 /******/ // Flag the module as loaded
245 /******/ module.loaded = true;
246 /******/
247 /******/ // Return the exports of the module
248 /******/ return module.exports;
249 /******/ }
250 /******/
251 /******/
252 /******/ // expose the modules object (__webpack_modules__)
253 /******/ __webpack_require__.m = modules;
254 /******/
255 /******/ // expose the module cache
256 /******/ __webpack_require__.c = installedModules;
257 /******/
258 /******/ // __webpack_public_path__
259 /******/ __webpack_require__.p = "";
260 /******/
261 /******/ // Load entry module and return exports
262 /******/ return __webpack_require__(0);
263 /******/ })
264 /************************************************************************/
265 /******/ ([
266 /* 0 */
267 /***/ (function(module, exports, __webpack_require__) {
268
269 module.exports = __webpack_require__(1);
270
271
272 /***/ }),
273 /* 1 */
274 /***/ (function(module, exports, __webpack_require__) {
275
276 'use strict';
277
278 Object.defineProperty(exports, "__esModule", {
279 value: true
280 });
281
282 var _utils = __webpack_require__(2);
283
284 Object.defineProperty(exports, 'combineChunks', {
285 enumerable: true,
286 get: function get() {
287 return _utils.combineChunks;
288 }
289 });
290 Object.defineProperty(exports, 'fillInChunks', {
291 enumerable: true,
292 get: function get() {
293 return _utils.fillInChunks;
294 }
295 });
296 Object.defineProperty(exports, 'findAll', {
297 enumerable: true,
298 get: function get() {
299 return _utils.findAll;
300 }
301 });
302 Object.defineProperty(exports, 'findChunks', {
303 enumerable: true,
304 get: function get() {
305 return _utils.findChunks;
306 }
307 });
308
309 /***/ }),
310 /* 2 */
311 /***/ (function(module, exports) {
312
313 'use strict';
314
315 Object.defineProperty(exports, "__esModule", {
316 value: true
317 });
318 /**
319 * Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word.
320 * @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean })
321 */
322 var findAll = exports.findAll = function findAll(_ref) {
323 var autoEscape = _ref.autoEscape,
324 _ref$caseSensitive = _ref.caseSensitive,
325 caseSensitive = _ref$caseSensitive === undefined ? false : _ref$caseSensitive,
326 _ref$findChunks = _ref.findChunks,
327 findChunks = _ref$findChunks === undefined ? defaultFindChunks : _ref$findChunks,
328 sanitize = _ref.sanitize,
329 searchWords = _ref.searchWords,
330 textToHighlight = _ref.textToHighlight;
331 return fillInChunks({
332 chunksToHighlight: combineChunks({
333 chunks: findChunks({
334 autoEscape: autoEscape,
335 caseSensitive: caseSensitive,
336 sanitize: sanitize,
337 searchWords: searchWords,
338 textToHighlight: textToHighlight
339 })
340 }),
341 totalLength: textToHighlight ? textToHighlight.length : 0
342 });
343 };
344
345 /**
346 * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks.
347 * @return {start:number, end:number}[]
348 */
349 var combineChunks = exports.combineChunks = function combineChunks(_ref2) {
350 var chunks = _ref2.chunks;
351
352 chunks = chunks.sort(function (first, second) {
353 return first.start - second.start;
354 }).reduce(function (processedChunks, nextChunk) {
355 // First chunk just goes straight in the array...
356 if (processedChunks.length === 0) {
357 return [nextChunk];
358 } else {
359 // ... subsequent chunks get checked to see if they overlap...
360 var prevChunk = processedChunks.pop();
361 if (nextChunk.start <= prevChunk.end) {
362 // It may be the case that prevChunk completely surrounds nextChunk, so take the
363 // largest of the end indeces.
364 var endIndex = Math.max(prevChunk.end, nextChunk.end);
365 processedChunks.push({ start: prevChunk.start, end: endIndex });
366 } else {
367 processedChunks.push(prevChunk, nextChunk);
368 }
369 return processedChunks;
370 }
371 }, []);
372
373 return chunks;
374 };
375
376 /**
377 * Examine text for any matches.
378 * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}).
379 * @return {start:number, end:number}[]
380 */
381 var defaultFindChunks = function defaultFindChunks(_ref3) {
382 var autoEscape = _ref3.autoEscape,
383 caseSensitive = _ref3.caseSensitive,
384 _ref3$sanitize = _ref3.sanitize,
385 sanitize = _ref3$sanitize === undefined ? identity : _ref3$sanitize,
386 searchWords = _ref3.searchWords,
387 textToHighlight = _ref3.textToHighlight;
388
389 textToHighlight = sanitize(textToHighlight);
390
391 return searchWords.filter(function (searchWord) {
392 return searchWord;
393 }) // Remove empty words
394 .reduce(function (chunks, searchWord) {
395 searchWord = sanitize(searchWord);
396
397 if (autoEscape) {
398 searchWord = escapeRegExpFn(searchWord);
399 }
400
401 var regex = new RegExp(searchWord, caseSensitive ? 'g' : 'gi');
402
403 var match = void 0;
404 while (match = regex.exec(textToHighlight)) {
405 var start = match.index;
406 var end = regex.lastIndex;
407 // We do not return zero-length matches
408 if (end > start) {
409 chunks.push({ start: start, end: end });
410 }
411
412 // Prevent browsers like Firefox from getting stuck in an infinite loop
413 // See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/
414 if (match.index == regex.lastIndex) {
415 regex.lastIndex++;
416 }
417 }
418
419 return chunks;
420 }, []);
421 };
422 // Allow the findChunks to be overridden in findAll,
423 // but for backwards compatibility we export as the old name
424 exports.findChunks = defaultFindChunks;
425
426 /**
427 * Given a set of chunks to highlight, create an additional set of chunks
428 * to represent the bits of text between the highlighted text.
429 * @param chunksToHighlight {start:number, end:number}[]
430 * @param totalLength number
431 * @return {start:number, end:number, highlight:boolean}[]
432 */
433
434 var fillInChunks = exports.fillInChunks = function fillInChunks(_ref4) {
435 var chunksToHighlight = _ref4.chunksToHighlight,
436 totalLength = _ref4.totalLength;
437
438 var allChunks = [];
439 var append = function append(start, end, highlight) {
440 if (end - start > 0) {
441 allChunks.push({
442 start: start,
443 end: end,
444 highlight: highlight
445 });
446 }
447 };
448
449 if (chunksToHighlight.length === 0) {
450 append(0, totalLength, false);
451 } else {
452 var lastIndex = 0;
453 chunksToHighlight.forEach(function (chunk) {
454 append(lastIndex, chunk.start, false);
455 append(chunk.start, chunk.end, true);
456 lastIndex = chunk.end;
457 });
458 append(lastIndex, totalLength, false);
459 }
460 return allChunks;
461 };
462
463 function identity(value) {
464 return value;
465 }
466
467 function escapeRegExpFn(str) {
468 return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
469 }
470
471 /***/ })
472 /******/ ]);
473 //# sourceMappingURL=index.js.map
474
475/***/ }),
476/* 4 */
477/***/ (function(module, exports, __webpack_require__) {
478
479 /* WEBPACK VAR INJECTION */(function(process) {/**
480 * Copyright (c) 2013-present, Facebook, Inc.
481 *
482 * This source code is licensed under the MIT license found in the
483 * LICENSE file in the root directory of this source tree.
484 */
485
486 if (process.env.NODE_ENV !== 'production') {
487 var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
488 Symbol.for &&
489 Symbol.for('react.element')) ||
490 0xeac7;
491
492 var isValidElement = function(object) {
493 return typeof object === 'object' &&
494 object !== null &&
495 object.$$typeof === REACT_ELEMENT_TYPE;
496 };
497
498 // By explicitly using `prop-types` you are opting into new development behavior.
499 // http://fb.me/prop-types-in-prod
500 var throwOnDirectAccess = true;
501 module.exports = __webpack_require__(6)(isValidElement, throwOnDirectAccess);
502 } else {
503 // By explicitly using `prop-types` you are opting into new production behavior.
504 // http://fb.me/prop-types-in-prod
505 module.exports = __webpack_require__(13)();
506 }
507
508 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
509
510/***/ }),
511/* 5 */
512/***/ (function(module, exports) {
513
514 // shim for using process in browser
515 var process = module.exports = {};
516
517 // cached from whatever global is present so that test runners that stub it
518 // don't break things. But we need to wrap it in a try catch in case it is
519 // wrapped in strict mode code which doesn't define any globals. It's inside a
520 // function because try/catches deoptimize in certain engines.
521
522 var cachedSetTimeout;
523 var cachedClearTimeout;
524
525 function defaultSetTimout() {
526 throw new Error('setTimeout has not been defined');
527 }
528 function defaultClearTimeout () {
529 throw new Error('clearTimeout has not been defined');
530 }
531 (function () {
532 try {
533 if (typeof setTimeout === 'function') {
534 cachedSetTimeout = setTimeout;
535 } else {
536 cachedSetTimeout = defaultSetTimout;
537 }
538 } catch (e) {
539 cachedSetTimeout = defaultSetTimout;
540 }
541 try {
542 if (typeof clearTimeout === 'function') {
543 cachedClearTimeout = clearTimeout;
544 } else {
545 cachedClearTimeout = defaultClearTimeout;
546 }
547 } catch (e) {
548 cachedClearTimeout = defaultClearTimeout;
549 }
550 } ())
551 function runTimeout(fun) {
552 if (cachedSetTimeout === setTimeout) {
553 //normal enviroments in sane situations
554 return setTimeout(fun, 0);
555 }
556 // if setTimeout wasn't available but was latter defined
557 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
558 cachedSetTimeout = setTimeout;
559 return setTimeout(fun, 0);
560 }
561 try {
562 // when when somebody has screwed with setTimeout but no I.E. maddness
563 return cachedSetTimeout(fun, 0);
564 } catch(e){
565 try {
566 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
567 return cachedSetTimeout.call(null, fun, 0);
568 } catch(e){
569 // 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
570 return cachedSetTimeout.call(this, fun, 0);
571 }
572 }
573
574
575 }
576 function runClearTimeout(marker) {
577 if (cachedClearTimeout === clearTimeout) {
578 //normal enviroments in sane situations
579 return clearTimeout(marker);
580 }
581 // if clearTimeout wasn't available but was latter defined
582 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
583 cachedClearTimeout = clearTimeout;
584 return clearTimeout(marker);
585 }
586 try {
587 // when when somebody has screwed with setTimeout but no I.E. maddness
588 return cachedClearTimeout(marker);
589 } catch (e){
590 try {
591 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
592 return cachedClearTimeout.call(null, marker);
593 } catch (e){
594 // 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.
595 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
596 return cachedClearTimeout.call(this, marker);
597 }
598 }
599
600
601
602 }
603 var queue = [];
604 var draining = false;
605 var currentQueue;
606 var queueIndex = -1;
607
608 function cleanUpNextTick() {
609 if (!draining || !currentQueue) {
610 return;
611 }
612 draining = false;
613 if (currentQueue.length) {
614 queue = currentQueue.concat(queue);
615 } else {
616 queueIndex = -1;
617 }
618 if (queue.length) {
619 drainQueue();
620 }
621 }
622
623 function drainQueue() {
624 if (draining) {
625 return;
626 }
627 var timeout = runTimeout(cleanUpNextTick);
628 draining = true;
629
630 var len = queue.length;
631 while(len) {
632 currentQueue = queue;
633 queue = [];
634 while (++queueIndex < len) {
635 if (currentQueue) {
636 currentQueue[queueIndex].run();
637 }
638 }
639 queueIndex = -1;
640 len = queue.length;
641 }
642 currentQueue = null;
643 draining = false;
644 runClearTimeout(timeout);
645 }
646
647 process.nextTick = function (fun) {
648 var args = new Array(arguments.length - 1);
649 if (arguments.length > 1) {
650 for (var i = 1; i < arguments.length; i++) {
651 args[i - 1] = arguments[i];
652 }
653 }
654 queue.push(new Item(fun, args));
655 if (queue.length === 1 && !draining) {
656 runTimeout(drainQueue);
657 }
658 };
659
660 // v8 likes predictible objects
661 function Item(fun, array) {
662 this.fun = fun;
663 this.array = array;
664 }
665 Item.prototype.run = function () {
666 this.fun.apply(null, this.array);
667 };
668 process.title = 'browser';
669 process.browser = true;
670 process.env = {};
671 process.argv = [];
672 process.version = ''; // empty string to avoid regexp issues
673 process.versions = {};
674
675 function noop() {}
676
677 process.on = noop;
678 process.addListener = noop;
679 process.once = noop;
680 process.off = noop;
681 process.removeListener = noop;
682 process.removeAllListeners = noop;
683 process.emit = noop;
684 process.prependListener = noop;
685 process.prependOnceListener = noop;
686
687 process.listeners = function (name) { return [] }
688
689 process.binding = function (name) {
690 throw new Error('process.binding is not supported');
691 };
692
693 process.cwd = function () { return '/' };
694 process.chdir = function (dir) {
695 throw new Error('process.chdir is not supported');
696 };
697 process.umask = function() { return 0; };
698
699
700/***/ }),
701/* 6 */
702/***/ (function(module, exports, __webpack_require__) {
703
704 /* WEBPACK VAR INJECTION */(function(process) {/**
705 * Copyright (c) 2013-present, Facebook, Inc.
706 *
707 * This source code is licensed under the MIT license found in the
708 * LICENSE file in the root directory of this source tree.
709 */
710
711 'use strict';
712
713 var emptyFunction = __webpack_require__(7);
714 var invariant = __webpack_require__(8);
715 var warning = __webpack_require__(9);
716 var assign = __webpack_require__(10);
717
718 var ReactPropTypesSecret = __webpack_require__(11);
719 var checkPropTypes = __webpack_require__(12);
720
721 module.exports = function(isValidElement, throwOnDirectAccess) {
722 /* global Symbol */
723 var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
724 var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
725
726 /**
727 * Returns the iterator method function contained on the iterable object.
728 *
729 * Be sure to invoke the function with the iterable as context:
730 *
731 * var iteratorFn = getIteratorFn(myIterable);
732 * if (iteratorFn) {
733 * var iterator = iteratorFn.call(myIterable);
734 * ...
735 * }
736 *
737 * @param {?object} maybeIterable
738 * @return {?function}
739 */
740 function getIteratorFn(maybeIterable) {
741 var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
742 if (typeof iteratorFn === 'function') {
743 return iteratorFn;
744 }
745 }
746
747 /**
748 * Collection of methods that allow declaration and validation of props that are
749 * supplied to React components. Example usage:
750 *
751 * var Props = require('ReactPropTypes');
752 * var MyArticle = React.createClass({
753 * propTypes: {
754 * // An optional string prop named "description".
755 * description: Props.string,
756 *
757 * // A required enum prop named "category".
758 * category: Props.oneOf(['News','Photos']).isRequired,
759 *
760 * // A prop named "dialog" that requires an instance of Dialog.
761 * dialog: Props.instanceOf(Dialog).isRequired
762 * },
763 * render: function() { ... }
764 * });
765 *
766 * A more formal specification of how these methods are used:
767 *
768 * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
769 * decl := ReactPropTypes.{type}(.isRequired)?
770 *
771 * Each and every declaration produces a function with the same signature. This
772 * allows the creation of custom validation functions. For example:
773 *
774 * var MyLink = React.createClass({
775 * propTypes: {
776 * // An optional string or URI prop named "href".
777 * href: function(props, propName, componentName) {
778 * var propValue = props[propName];
779 * if (propValue != null && typeof propValue !== 'string' &&
780 * !(propValue instanceof URI)) {
781 * return new Error(
782 * 'Expected a string or an URI for ' + propName + ' in ' +
783 * componentName
784 * );
785 * }
786 * }
787 * },
788 * render: function() {...}
789 * });
790 *
791 * @internal
792 */
793
794 var ANONYMOUS = '<<anonymous>>';
795
796 // Important!
797 // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
798 var ReactPropTypes = {
799 array: createPrimitiveTypeChecker('array'),
800 bool: createPrimitiveTypeChecker('boolean'),
801 func: createPrimitiveTypeChecker('function'),
802 number: createPrimitiveTypeChecker('number'),
803 object: createPrimitiveTypeChecker('object'),
804 string: createPrimitiveTypeChecker('string'),
805 symbol: createPrimitiveTypeChecker('symbol'),
806
807 any: createAnyTypeChecker(),
808 arrayOf: createArrayOfTypeChecker,
809 element: createElementTypeChecker(),
810 instanceOf: createInstanceTypeChecker,
811 node: createNodeChecker(),
812 objectOf: createObjectOfTypeChecker,
813 oneOf: createEnumTypeChecker,
814 oneOfType: createUnionTypeChecker,
815 shape: createShapeTypeChecker,
816 exact: createStrictShapeTypeChecker,
817 };
818
819 /**
820 * inlined Object.is polyfill to avoid requiring consumers ship their own
821 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
822 */
823 /*eslint-disable no-self-compare*/
824 function is(x, y) {
825 // SameValue algorithm
826 if (x === y) {
827 // Steps 1-5, 7-10
828 // Steps 6.b-6.e: +0 != -0
829 return x !== 0 || 1 / x === 1 / y;
830 } else {
831 // Step 6.a: NaN == NaN
832 return x !== x && y !== y;
833 }
834 }
835 /*eslint-enable no-self-compare*/
836
837 /**
838 * We use an Error-like object for backward compatibility as people may call
839 * PropTypes directly and inspect their output. However, we don't use real
840 * Errors anymore. We don't inspect their stack anyway, and creating them
841 * is prohibitively expensive if they are created too often, such as what
842 * happens in oneOfType() for any type before the one that matched.
843 */
844 function PropTypeError(message) {
845 this.message = message;
846 this.stack = '';
847 }
848 // Make `instanceof Error` still work for returned errors.
849 PropTypeError.prototype = Error.prototype;
850
851 function createChainableTypeChecker(validate) {
852 if (process.env.NODE_ENV !== 'production') {
853 var manualPropTypeCallCache = {};
854 var manualPropTypeWarningCount = 0;
855 }
856 function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
857 componentName = componentName || ANONYMOUS;
858 propFullName = propFullName || propName;
859
860 if (secret !== ReactPropTypesSecret) {
861 if (throwOnDirectAccess) {
862 // New behavior only for users of `prop-types` package
863 invariant(
864 false,
865 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
866 'Use `PropTypes.checkPropTypes()` to call them. ' +
867 'Read more at http://fb.me/use-check-prop-types'
868 );
869 } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
870 // Old behavior for people using React.PropTypes
871 var cacheKey = componentName + ':' + propName;
872 if (
873 !manualPropTypeCallCache[cacheKey] &&
874 // Avoid spamming the console because they are often not actionable except for lib authors
875 manualPropTypeWarningCount < 3
876 ) {
877 warning(
878 false,
879 'You are manually calling a React.PropTypes validation ' +
880 'function for the `%s` prop on `%s`. This is deprecated ' +
881 'and will throw in the standalone `prop-types` package. ' +
882 'You may be seeing this warning due to a third-party PropTypes ' +
883 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
884 propFullName,
885 componentName
886 );
887 manualPropTypeCallCache[cacheKey] = true;
888 manualPropTypeWarningCount++;
889 }
890 }
891 }
892 if (props[propName] == null) {
893 if (isRequired) {
894 if (props[propName] === null) {
895 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
896 }
897 return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
898 }
899 return null;
900 } else {
901 return validate(props, propName, componentName, location, propFullName);
902 }
903 }
904
905 var chainedCheckType = checkType.bind(null, false);
906 chainedCheckType.isRequired = checkType.bind(null, true);
907
908 return chainedCheckType;
909 }
910
911 function createPrimitiveTypeChecker(expectedType) {
912 function validate(props, propName, componentName, location, propFullName, secret) {
913 var propValue = props[propName];
914 var propType = getPropType(propValue);
915 if (propType !== expectedType) {
916 // `propValue` being instance of, say, date/regexp, pass the 'object'
917 // check, but we can offer a more precise error message here rather than
918 // 'of type `object`'.
919 var preciseType = getPreciseType(propValue);
920
921 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
922 }
923 return null;
924 }
925 return createChainableTypeChecker(validate);
926 }
927
928 function createAnyTypeChecker() {
929 return createChainableTypeChecker(emptyFunction.thatReturnsNull);
930 }
931
932 function createArrayOfTypeChecker(typeChecker) {
933 function validate(props, propName, componentName, location, propFullName) {
934 if (typeof typeChecker !== 'function') {
935 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
936 }
937 var propValue = props[propName];
938 if (!Array.isArray(propValue)) {
939 var propType = getPropType(propValue);
940 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
941 }
942 for (var i = 0; i < propValue.length; i++) {
943 var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
944 if (error instanceof Error) {
945 return error;
946 }
947 }
948 return null;
949 }
950 return createChainableTypeChecker(validate);
951 }
952
953 function createElementTypeChecker() {
954 function validate(props, propName, componentName, location, propFullName) {
955 var propValue = props[propName];
956 if (!isValidElement(propValue)) {
957 var propType = getPropType(propValue);
958 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
959 }
960 return null;
961 }
962 return createChainableTypeChecker(validate);
963 }
964
965 function createInstanceTypeChecker(expectedClass) {
966 function validate(props, propName, componentName, location, propFullName) {
967 if (!(props[propName] instanceof expectedClass)) {
968 var expectedClassName = expectedClass.name || ANONYMOUS;
969 var actualClassName = getClassName(props[propName]);
970 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
971 }
972 return null;
973 }
974 return createChainableTypeChecker(validate);
975 }
976
977 function createEnumTypeChecker(expectedValues) {
978 if (!Array.isArray(expectedValues)) {
979 process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
980 return emptyFunction.thatReturnsNull;
981 }
982
983 function validate(props, propName, componentName, location, propFullName) {
984 var propValue = props[propName];
985 for (var i = 0; i < expectedValues.length; i++) {
986 if (is(propValue, expectedValues[i])) {
987 return null;
988 }
989 }
990
991 var valuesString = JSON.stringify(expectedValues);
992 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
993 }
994 return createChainableTypeChecker(validate);
995 }
996
997 function createObjectOfTypeChecker(typeChecker) {
998 function validate(props, propName, componentName, location, propFullName) {
999 if (typeof typeChecker !== 'function') {
1000 return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
1001 }
1002 var propValue = props[propName];
1003 var propType = getPropType(propValue);
1004 if (propType !== 'object') {
1005 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
1006 }
1007 for (var key in propValue) {
1008 if (propValue.hasOwnProperty(key)) {
1009 var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1010 if (error instanceof Error) {
1011 return error;
1012 }
1013 }
1014 }
1015 return null;
1016 }
1017 return createChainableTypeChecker(validate);
1018 }
1019
1020 function createUnionTypeChecker(arrayOfTypeCheckers) {
1021 if (!Array.isArray(arrayOfTypeCheckers)) {
1022 process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
1023 return emptyFunction.thatReturnsNull;
1024 }
1025
1026 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1027 var checker = arrayOfTypeCheckers[i];
1028 if (typeof checker !== 'function') {
1029 warning(
1030 false,
1031 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
1032 'received %s at index %s.',
1033 getPostfixForTypeWarning(checker),
1034 i
1035 );
1036 return emptyFunction.thatReturnsNull;
1037 }
1038 }
1039
1040 function validate(props, propName, componentName, location, propFullName) {
1041 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1042 var checker = arrayOfTypeCheckers[i];
1043 if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
1044 return null;
1045 }
1046 }
1047
1048 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
1049 }
1050 return createChainableTypeChecker(validate);
1051 }
1052
1053 function createNodeChecker() {
1054 function validate(props, propName, componentName, location, propFullName) {
1055 if (!isNode(props[propName])) {
1056 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1057 }
1058 return null;
1059 }
1060 return createChainableTypeChecker(validate);
1061 }
1062
1063 function createShapeTypeChecker(shapeTypes) {
1064 function validate(props, propName, componentName, location, propFullName) {
1065 var propValue = props[propName];
1066 var propType = getPropType(propValue);
1067 if (propType !== 'object') {
1068 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1069 }
1070 for (var key in shapeTypes) {
1071 var checker = shapeTypes[key];
1072 if (!checker) {
1073 continue;
1074 }
1075 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1076 if (error) {
1077 return error;
1078 }
1079 }
1080 return null;
1081 }
1082 return createChainableTypeChecker(validate);
1083 }
1084
1085 function createStrictShapeTypeChecker(shapeTypes) {
1086 function validate(props, propName, componentName, location, propFullName) {
1087 var propValue = props[propName];
1088 var propType = getPropType(propValue);
1089 if (propType !== 'object') {
1090 return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1091 }
1092 // We need to check all keys in case some are required but missing from
1093 // props.
1094 var allKeys = assign({}, props[propName], shapeTypes);
1095 for (var key in allKeys) {
1096 var checker = shapeTypes[key];
1097 if (!checker) {
1098 return new PropTypeError(
1099 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
1100 '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
1101 '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
1102 );
1103 }
1104 var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1105 if (error) {
1106 return error;
1107 }
1108 }
1109 return null;
1110 }
1111
1112 return createChainableTypeChecker(validate);
1113 }
1114
1115 function isNode(propValue) {
1116 switch (typeof propValue) {
1117 case 'number':
1118 case 'string':
1119 case 'undefined':
1120 return true;
1121 case 'boolean':
1122 return !propValue;
1123 case 'object':
1124 if (Array.isArray(propValue)) {
1125 return propValue.every(isNode);
1126 }
1127 if (propValue === null || isValidElement(propValue)) {
1128 return true;
1129 }
1130
1131 var iteratorFn = getIteratorFn(propValue);
1132 if (iteratorFn) {
1133 var iterator = iteratorFn.call(propValue);
1134 var step;
1135 if (iteratorFn !== propValue.entries) {
1136 while (!(step = iterator.next()).done) {
1137 if (!isNode(step.value)) {
1138 return false;
1139 }
1140 }
1141 } else {
1142 // Iterator will provide entry [k,v] tuples rather than values.
1143 while (!(step = iterator.next()).done) {
1144 var entry = step.value;
1145 if (entry) {
1146 if (!isNode(entry[1])) {
1147 return false;
1148 }
1149 }
1150 }
1151 }
1152 } else {
1153 return false;
1154 }
1155
1156 return true;
1157 default:
1158 return false;
1159 }
1160 }
1161
1162 function isSymbol(propType, propValue) {
1163 // Native Symbol.
1164 if (propType === 'symbol') {
1165 return true;
1166 }
1167
1168 // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1169 if (propValue['@@toStringTag'] === 'Symbol') {
1170 return true;
1171 }
1172
1173 // Fallback for non-spec compliant Symbols which are polyfilled.
1174 if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1175 return true;
1176 }
1177
1178 return false;
1179 }
1180
1181 // Equivalent of `typeof` but with special handling for array and regexp.
1182 function getPropType(propValue) {
1183 var propType = typeof propValue;
1184 if (Array.isArray(propValue)) {
1185 return 'array';
1186 }
1187 if (propValue instanceof RegExp) {
1188 // Old webkits (at least until Android 4.0) return 'function' rather than
1189 // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1190 // passes PropTypes.object.
1191 return 'object';
1192 }
1193 if (isSymbol(propType, propValue)) {
1194 return 'symbol';
1195 }
1196 return propType;
1197 }
1198
1199 // This handles more types than `getPropType`. Only used for error messages.
1200 // See `createPrimitiveTypeChecker`.
1201 function getPreciseType(propValue) {
1202 if (typeof propValue === 'undefined' || propValue === null) {
1203 return '' + propValue;
1204 }
1205 var propType = getPropType(propValue);
1206 if (propType === 'object') {
1207 if (propValue instanceof Date) {
1208 return 'date';
1209 } else if (propValue instanceof RegExp) {
1210 return 'regexp';
1211 }
1212 }
1213 return propType;
1214 }
1215
1216 // Returns a string that is postfixed to a warning about an invalid type.
1217 // For example, "undefined" or "of type array"
1218 function getPostfixForTypeWarning(value) {
1219 var type = getPreciseType(value);
1220 switch (type) {
1221 case 'array':
1222 case 'object':
1223 return 'an ' + type;
1224 case 'boolean':
1225 case 'date':
1226 case 'regexp':
1227 return 'a ' + type;
1228 default:
1229 return type;
1230 }
1231 }
1232
1233 // Returns class name of the object, if any.
1234 function getClassName(propValue) {
1235 if (!propValue.constructor || !propValue.constructor.name) {
1236 return ANONYMOUS;
1237 }
1238 return propValue.constructor.name;
1239 }
1240
1241 ReactPropTypes.checkPropTypes = checkPropTypes;
1242 ReactPropTypes.PropTypes = ReactPropTypes;
1243
1244 return ReactPropTypes;
1245 };
1246
1247 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
1248
1249/***/ }),
1250/* 7 */
1251/***/ (function(module, exports) {
1252
1253 "use strict";
1254
1255 /**
1256 * Copyright (c) 2013-present, Facebook, Inc.
1257 *
1258 * This source code is licensed under the MIT license found in the
1259 * LICENSE file in the root directory of this source tree.
1260 *
1261 *
1262 */
1263
1264 function makeEmptyFunction(arg) {
1265 return function () {
1266 return arg;
1267 };
1268 }
1269
1270 /**
1271 * This function accepts and discards inputs; it has no side effects. This is
1272 * primarily useful idiomatically for overridable function endpoints which
1273 * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
1274 */
1275 var emptyFunction = function emptyFunction() {};
1276
1277 emptyFunction.thatReturns = makeEmptyFunction;
1278 emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
1279 emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
1280 emptyFunction.thatReturnsNull = makeEmptyFunction(null);
1281 emptyFunction.thatReturnsThis = function () {
1282 return this;
1283 };
1284 emptyFunction.thatReturnsArgument = function (arg) {
1285 return arg;
1286 };
1287
1288 module.exports = emptyFunction;
1289
1290/***/ }),
1291/* 8 */
1292/***/ (function(module, exports, __webpack_require__) {
1293
1294 /* WEBPACK VAR INJECTION */(function(process) {/**
1295 * Copyright (c) 2013-present, Facebook, Inc.
1296 *
1297 * This source code is licensed under the MIT license found in the
1298 * LICENSE file in the root directory of this source tree.
1299 *
1300 */
1301
1302 'use strict';
1303
1304 /**
1305 * Use invariant() to assert state which your program assumes to be true.
1306 *
1307 * Provide sprintf-style format (only %s is supported) and arguments
1308 * to provide information about what broke and what you were
1309 * expecting.
1310 *
1311 * The invariant message will be stripped in production, but the invariant
1312 * will remain to ensure logic does not differ in production.
1313 */
1314
1315 var validateFormat = function validateFormat(format) {};
1316
1317 if (process.env.NODE_ENV !== 'production') {
1318 validateFormat = function validateFormat(format) {
1319 if (format === undefined) {
1320 throw new Error('invariant requires an error message argument');
1321 }
1322 };
1323 }
1324
1325 function invariant(condition, format, a, b, c, d, e, f) {
1326 validateFormat(format);
1327
1328 if (!condition) {
1329 var error;
1330 if (format === undefined) {
1331 error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
1332 } else {
1333 var args = [a, b, c, d, e, f];
1334 var argIndex = 0;
1335 error = new Error(format.replace(/%s/g, function () {
1336 return args[argIndex++];
1337 }));
1338 error.name = 'Invariant Violation';
1339 }
1340
1341 error.framesToPop = 1; // we don't care about invariant's own frame
1342 throw error;
1343 }
1344 }
1345
1346 module.exports = invariant;
1347 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
1348
1349/***/ }),
1350/* 9 */
1351/***/ (function(module, exports, __webpack_require__) {
1352
1353 /* WEBPACK VAR INJECTION */(function(process) {/**
1354 * Copyright (c) 2014-present, Facebook, Inc.
1355 *
1356 * This source code is licensed under the MIT license found in the
1357 * LICENSE file in the root directory of this source tree.
1358 *
1359 */
1360
1361 'use strict';
1362
1363 var emptyFunction = __webpack_require__(7);
1364
1365 /**
1366 * Similar to invariant but only logs a warning if the condition is not met.
1367 * This can be used to log issues in development environments in critical
1368 * paths. Removing the logging code for production environments will keep the
1369 * same logic and follow the same code paths.
1370 */
1371
1372 var warning = emptyFunction;
1373
1374 if (process.env.NODE_ENV !== 'production') {
1375 var printWarning = function printWarning(format) {
1376 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1377 args[_key - 1] = arguments[_key];
1378 }
1379
1380 var argIndex = 0;
1381 var message = 'Warning: ' + format.replace(/%s/g, function () {
1382 return args[argIndex++];
1383 });
1384 if (typeof console !== 'undefined') {
1385 console.error(message);
1386 }
1387 try {
1388 // --- Welcome to debugging React ---
1389 // This error was thrown as a convenience so that you can use this stack
1390 // to find the callsite that caused this warning to fire.
1391 throw new Error(message);
1392 } catch (x) {}
1393 };
1394
1395 warning = function warning(condition, format) {
1396 if (format === undefined) {
1397 throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
1398 }
1399
1400 if (format.indexOf('Failed Composite propType: ') === 0) {
1401 return; // Ignore CompositeComponent proptype check.
1402 }
1403
1404 if (!condition) {
1405 for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
1406 args[_key2 - 2] = arguments[_key2];
1407 }
1408
1409 printWarning.apply(undefined, [format].concat(args));
1410 }
1411 };
1412 }
1413
1414 module.exports = warning;
1415 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
1416
1417/***/ }),
1418/* 10 */
1419/***/ (function(module, exports) {
1420
1421 /*
1422 object-assign
1423 (c) Sindre Sorhus
1424 @license MIT
1425 */
1426
1427 'use strict';
1428 /* eslint-disable no-unused-vars */
1429 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
1430 var hasOwnProperty = Object.prototype.hasOwnProperty;
1431 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
1432
1433 function toObject(val) {
1434 if (val === null || val === undefined) {
1435 throw new TypeError('Object.assign cannot be called with null or undefined');
1436 }
1437
1438 return Object(val);
1439 }
1440
1441 function shouldUseNative() {
1442 try {
1443 if (!Object.assign) {
1444 return false;
1445 }
1446
1447 // Detect buggy property enumeration order in older V8 versions.
1448
1449 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
1450 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
1451 test1[5] = 'de';
1452 if (Object.getOwnPropertyNames(test1)[0] === '5') {
1453 return false;
1454 }
1455
1456 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1457 var test2 = {};
1458 for (var i = 0; i < 10; i++) {
1459 test2['_' + String.fromCharCode(i)] = i;
1460 }
1461 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
1462 return test2[n];
1463 });
1464 if (order2.join('') !== '0123456789') {
1465 return false;
1466 }
1467
1468 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1469 var test3 = {};
1470 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
1471 test3[letter] = letter;
1472 });
1473 if (Object.keys(Object.assign({}, test3)).join('') !==
1474 'abcdefghijklmnopqrst') {
1475 return false;
1476 }
1477
1478 return true;
1479 } catch (err) {
1480 // We don't expect any of the above to throw, but better to be safe.
1481 return false;
1482 }
1483 }
1484
1485 module.exports = shouldUseNative() ? Object.assign : function (target, source) {
1486 var from;
1487 var to = toObject(target);
1488 var symbols;
1489
1490 for (var s = 1; s < arguments.length; s++) {
1491 from = Object(arguments[s]);
1492
1493 for (var key in from) {
1494 if (hasOwnProperty.call(from, key)) {
1495 to[key] = from[key];
1496 }
1497 }
1498
1499 if (getOwnPropertySymbols) {
1500 symbols = getOwnPropertySymbols(from);
1501 for (var i = 0; i < symbols.length; i++) {
1502 if (propIsEnumerable.call(from, symbols[i])) {
1503 to[symbols[i]] = from[symbols[i]];
1504 }
1505 }
1506 }
1507 }
1508
1509 return to;
1510 };
1511
1512
1513/***/ }),
1514/* 11 */
1515/***/ (function(module, exports) {
1516
1517 /**
1518 * Copyright (c) 2013-present, Facebook, Inc.
1519 *
1520 * This source code is licensed under the MIT license found in the
1521 * LICENSE file in the root directory of this source tree.
1522 */
1523
1524 'use strict';
1525
1526 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1527
1528 module.exports = ReactPropTypesSecret;
1529
1530
1531/***/ }),
1532/* 12 */
1533/***/ (function(module, exports, __webpack_require__) {
1534
1535 /* WEBPACK VAR INJECTION */(function(process) {/**
1536 * Copyright (c) 2013-present, Facebook, Inc.
1537 *
1538 * This source code is licensed under the MIT license found in the
1539 * LICENSE file in the root directory of this source tree.
1540 */
1541
1542 'use strict';
1543
1544 if (process.env.NODE_ENV !== 'production') {
1545 var invariant = __webpack_require__(8);
1546 var warning = __webpack_require__(9);
1547 var ReactPropTypesSecret = __webpack_require__(11);
1548 var loggedTypeFailures = {};
1549 }
1550
1551 /**
1552 * Assert that the values match with the type specs.
1553 * Error messages are memorized and will only be shown once.
1554 *
1555 * @param {object} typeSpecs Map of name to a ReactPropType
1556 * @param {object} values Runtime values that need to be type-checked
1557 * @param {string} location e.g. "prop", "context", "child context"
1558 * @param {string} componentName Name of the component for error messages.
1559 * @param {?Function} getStack Returns the component stack.
1560 * @private
1561 */
1562 function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
1563 if (process.env.NODE_ENV !== 'production') {
1564 for (var typeSpecName in typeSpecs) {
1565 if (typeSpecs.hasOwnProperty(typeSpecName)) {
1566 var error;
1567 // Prop type validation may throw. In case they do, we don't want to
1568 // fail the render phase where it didn't fail before. So we log it.
1569 // After these have been cleaned up, we'll let them throw.
1570 try {
1571 // This is intentionally an invariant that gets caught. It's the same
1572 // behavior as without this statement except with a better message.
1573 invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);
1574 error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
1575 } catch (ex) {
1576 error = ex;
1577 }
1578 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);
1579 if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1580 // Only monitor this failure once because there tends to be a lot of the
1581 // same error.
1582 loggedTypeFailures[error.message] = true;
1583
1584 var stack = getStack ? getStack() : '';
1585
1586 warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
1587 }
1588 }
1589 }
1590 }
1591 }
1592
1593 module.exports = checkPropTypes;
1594
1595 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
1596
1597/***/ }),
1598/* 13 */
1599/***/ (function(module, exports, __webpack_require__) {
1600
1601 /**
1602 * Copyright (c) 2013-present, Facebook, Inc.
1603 *
1604 * This source code is licensed under the MIT license found in the
1605 * LICENSE file in the root directory of this source tree.
1606 */
1607
1608 'use strict';
1609
1610 var emptyFunction = __webpack_require__(7);
1611 var invariant = __webpack_require__(8);
1612 var ReactPropTypesSecret = __webpack_require__(11);
1613
1614 module.exports = function() {
1615 function shim(props, propName, componentName, location, propFullName, secret) {
1616 if (secret === ReactPropTypesSecret) {
1617 // It is still safe when called from React.
1618 return;
1619 }
1620 invariant(
1621 false,
1622 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1623 'Use PropTypes.checkPropTypes() to call them. ' +
1624 'Read more at http://fb.me/use-check-prop-types'
1625 );
1626 };
1627 shim.isRequired = shim;
1628 function getShim() {
1629 return shim;
1630 };
1631 // Important!
1632 // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1633 var ReactPropTypes = {
1634 array: shim,
1635 bool: shim,
1636 func: shim,
1637 number: shim,
1638 object: shim,
1639 string: shim,
1640 symbol: shim,
1641
1642 any: shim,
1643 arrayOf: getShim,
1644 element: shim,
1645 instanceOf: getShim,
1646 node: shim,
1647 objectOf: getShim,
1648 oneOf: getShim,
1649 oneOfType: getShim,
1650 shape: getShim,
1651 exact: getShim
1652 };
1653
1654 ReactPropTypes.checkPropTypes = emptyFunction;
1655 ReactPropTypes.PropTypes = ReactPropTypes;
1656
1657 return ReactPropTypes;
1658 };
1659
1660
1661/***/ }),
1662/* 14 */
1663/***/ (function(module, exports) {
1664
1665 module.exports = require("react");
1666
1667/***/ }),
1668/* 15 */
1669/***/ (function(module, exports) {
1670
1671 'use strict';
1672
1673 var simpleIsEqual = function simpleIsEqual(a, b) {
1674 return a === b;
1675 };
1676
1677 function index (resultFn) {
1678 var isEqual = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : simpleIsEqual;
1679
1680 var lastThis = void 0;
1681 var lastArgs = [];
1682 var lastResult = void 0;
1683 var calledOnce = false;
1684
1685 var isNewArgEqualToLast = function isNewArgEqualToLast(newArg, index) {
1686 return isEqual(newArg, lastArgs[index]);
1687 };
1688
1689 var result = function result() {
1690 for (var _len = arguments.length, newArgs = Array(_len), _key = 0; _key < _len; _key++) {
1691 newArgs[_key] = arguments[_key];
1692 }
1693
1694 if (calledOnce && lastThis === this && newArgs.length === lastArgs.length && newArgs.every(isNewArgEqualToLast)) {
1695 return lastResult;
1696 }
1697
1698 calledOnce = true;
1699 lastThis = this;
1700 lastArgs = newArgs;
1701 lastResult = resultFn.apply(this, newArgs);
1702 return lastResult;
1703 };
1704
1705 return result;
1706 }
1707
1708 module.exports = index;
1709
1710
1711/***/ })
1712/******/ ]);
1713//# sourceMappingURL=main.js.map
\No newline at end of file