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