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