1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict';
|
11 |
|
12 |
|
13 |
|
14 | if (process.env.NODE_ENV !== "production") {
|
15 | (function() {
|
16 | 'use strict';
|
17 |
|
18 | var _assign = require('object-assign');
|
19 | var React = require('react');
|
20 | var checkPropTypes = require('prop-types/checkPropTypes');
|
21 | var stream = require('stream');
|
22 |
|
23 |
|
24 |
|
25 | var ReactVersion = '16.8.1';
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | var validateFormat = function () {};
|
39 |
|
40 | {
|
41 | validateFormat = function (format) {
|
42 | if (format === undefined) {
|
43 | throw new Error('invariant requires an error message argument');
|
44 | }
|
45 | };
|
46 | }
|
47 |
|
48 | function invariant(condition, format, a, b, c, d, e, f) {
|
49 | validateFormat(format);
|
50 |
|
51 | if (!condition) {
|
52 | var error = void 0;
|
53 | if (format === undefined) {
|
54 | error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
55 | } else {
|
56 | var args = [a, b, c, d, e, f];
|
57 | var argIndex = 0;
|
58 | error = new Error(format.replace(/%s/g, function () {
|
59 | return args[argIndex++];
|
60 | }));
|
61 | error.name = 'Invariant Violation';
|
62 | }
|
63 |
|
64 | error.framesToPop = 1;
|
65 | throw error;
|
66 | }
|
67 | }
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 | var warningWithoutStack = function () {};
|
80 |
|
81 | {
|
82 | warningWithoutStack = function (condition, format) {
|
83 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
84 | args[_key - 2] = arguments[_key];
|
85 | }
|
86 |
|
87 | if (format === undefined) {
|
88 | throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
89 | }
|
90 | if (args.length > 8) {
|
91 |
|
92 | throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
|
93 | }
|
94 | if (condition) {
|
95 | return;
|
96 | }
|
97 | if (typeof console !== 'undefined') {
|
98 | var argsWithFormat = args.map(function (item) {
|
99 | return '' + item;
|
100 | });
|
101 | argsWithFormat.unshift('Warning: ' + format);
|
102 |
|
103 |
|
104 |
|
105 | Function.prototype.apply.call(console.error, console, argsWithFormat);
|
106 | }
|
107 | try {
|
108 |
|
109 |
|
110 |
|
111 | var argIndex = 0;
|
112 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
113 | return args[argIndex++];
|
114 | });
|
115 | throw new Error(message);
|
116 | } catch (x) {}
|
117 | };
|
118 | }
|
119 |
|
120 | var warningWithoutStack$1 = warningWithoutStack;
|
121 |
|
122 |
|
123 |
|
124 | var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
125 |
|
126 |
|
127 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
128 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
129 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
130 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
131 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
132 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
133 |
|
134 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
135 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
136 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
137 | var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
138 | var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
139 |
|
140 | var Resolved = 1;
|
141 |
|
142 |
|
143 | function refineResolvedLazyComponent(lazyComponent) {
|
144 | return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
145 | }
|
146 |
|
147 | function getWrappedName(outerType, innerType, wrapperName) {
|
148 | var functionName = innerType.displayName || innerType.name || '';
|
149 | return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
|
150 | }
|
151 |
|
152 | function getComponentName(type) {
|
153 | if (type == null) {
|
154 |
|
155 | return null;
|
156 | }
|
157 | {
|
158 | if (typeof type.tag === 'number') {
|
159 | warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
160 | }
|
161 | }
|
162 | if (typeof type === 'function') {
|
163 | return type.displayName || type.name || null;
|
164 | }
|
165 | if (typeof type === 'string') {
|
166 | return type;
|
167 | }
|
168 | switch (type) {
|
169 | case REACT_CONCURRENT_MODE_TYPE:
|
170 | return 'ConcurrentMode';
|
171 | case REACT_FRAGMENT_TYPE:
|
172 | return 'Fragment';
|
173 | case REACT_PORTAL_TYPE:
|
174 | return 'Portal';
|
175 | case REACT_PROFILER_TYPE:
|
176 | return 'Profiler';
|
177 | case REACT_STRICT_MODE_TYPE:
|
178 | return 'StrictMode';
|
179 | case REACT_SUSPENSE_TYPE:
|
180 | return 'Suspense';
|
181 | }
|
182 | if (typeof type === 'object') {
|
183 | switch (type.$$typeof) {
|
184 | case REACT_CONTEXT_TYPE:
|
185 | return 'Context.Consumer';
|
186 | case REACT_PROVIDER_TYPE:
|
187 | return 'Context.Provider';
|
188 | case REACT_FORWARD_REF_TYPE:
|
189 | return getWrappedName(type, type.render, 'ForwardRef');
|
190 | case REACT_MEMO_TYPE:
|
191 | return getComponentName(type.type);
|
192 | case REACT_LAZY_TYPE:
|
193 | {
|
194 | var thenable = type;
|
195 | var resolvedThenable = refineResolvedLazyComponent(thenable);
|
196 | if (resolvedThenable) {
|
197 | return getComponentName(resolvedThenable);
|
198 | }
|
199 | }
|
200 | }
|
201 | }
|
202 | return null;
|
203 | }
|
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 |
|
215 |
|
216 |
|
217 |
|
218 |
|
219 | var lowPriorityWarning = function () {};
|
220 |
|
221 | {
|
222 | var printWarning = function (format) {
|
223 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
224 | args[_key - 1] = arguments[_key];
|
225 | }
|
226 |
|
227 | var argIndex = 0;
|
228 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
229 | return args[argIndex++];
|
230 | });
|
231 | if (typeof console !== 'undefined') {
|
232 | console.warn(message);
|
233 | }
|
234 | try {
|
235 |
|
236 |
|
237 |
|
238 | throw new Error(message);
|
239 | } catch (x) {}
|
240 | };
|
241 |
|
242 | lowPriorityWarning = function (condition, format) {
|
243 | if (format === undefined) {
|
244 | throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
245 | }
|
246 | if (!condition) {
|
247 | for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
248 | args[_key2 - 2] = arguments[_key2];
|
249 | }
|
250 |
|
251 | printWarning.apply(undefined, [format].concat(args));
|
252 | }
|
253 | };
|
254 | }
|
255 |
|
256 | var lowPriorityWarning$1 = lowPriorityWarning;
|
257 |
|
258 | var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
259 |
|
260 |
|
261 |
|
262 |
|
263 | if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
|
264 | ReactSharedInternals.ReactCurrentDispatcher = {
|
265 | current: null
|
266 | };
|
267 | }
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 | var warning = warningWithoutStack$1;
|
277 |
|
278 | {
|
279 | warning = function (condition, format) {
|
280 | if (condition) {
|
281 | return;
|
282 | }
|
283 | var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
284 | var stack = ReactDebugCurrentFrame.getStackAddendum();
|
285 |
|
286 |
|
287 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
288 | args[_key - 2] = arguments[_key];
|
289 | }
|
290 |
|
291 | warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
|
292 | };
|
293 | }
|
294 |
|
295 | var warning$1 = warning;
|
296 |
|
297 | var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
298 |
|
299 | var describeComponentFrame = function (name, source, ownerName) {
|
300 | var sourceInfo = '';
|
301 | if (source) {
|
302 | var path = source.fileName;
|
303 | var fileName = path.replace(BEFORE_SLASH_RE, '');
|
304 | {
|
305 |
|
306 |
|
307 | if (/^index\./.test(fileName)) {
|
308 | var match = path.match(BEFORE_SLASH_RE);
|
309 | if (match) {
|
310 | var pathBeforeSlash = match[1];
|
311 | if (pathBeforeSlash) {
|
312 | var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
313 | fileName = folderName + '/' + fileName;
|
314 | }
|
315 | }
|
316 | }
|
317 | }
|
318 | sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
319 | } else if (ownerName) {
|
320 | sourceInfo = ' (created by ' + ownerName + ')';
|
321 | }
|
322 | return '\n in ' + (name || 'Unknown') + sourceInfo;
|
323 | };
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 | var warnAboutDeprecatedLifecycles = false;
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 | var enableSuspenseServerRenderer = false;
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 | var ReactDebugCurrentFrame$1 = void 0;
|
364 | {
|
365 | ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
366 | }
|
367 |
|
368 | var didWarnAboutInvalidateContextType = {};
|
369 |
|
370 | var emptyObject = {};
|
371 | {
|
372 | Object.freeze(emptyObject);
|
373 | }
|
374 |
|
375 | function maskContext(type, context) {
|
376 | var contextTypes = type.contextTypes;
|
377 | if (!contextTypes) {
|
378 | return emptyObject;
|
379 | }
|
380 | var maskedContext = {};
|
381 | for (var contextName in contextTypes) {
|
382 | maskedContext[contextName] = context[contextName];
|
383 | }
|
384 | return maskedContext;
|
385 | }
|
386 |
|
387 | function checkContextTypes(typeSpecs, values, location) {
|
388 | {
|
389 | checkPropTypes(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame$1.getCurrentStack);
|
390 | }
|
391 | }
|
392 |
|
393 | function validateContextBounds(context, threadID) {
|
394 |
|
395 |
|
396 |
|
397 |
|
398 | for (var i = context._threadCount | 0; i <= threadID; i++) {
|
399 |
|
400 |
|
401 |
|
402 | context[i] = context._currentValue2;
|
403 | context._threadCount = i + 1;
|
404 | }
|
405 | }
|
406 |
|
407 | function processContext(type, context, threadID) {
|
408 | var contextType = type.contextType;
|
409 | if (typeof contextType === 'object' && contextType !== null) {
|
410 | {
|
411 | if (contextType.$$typeof !== REACT_CONTEXT_TYPE) {
|
412 | var name = getComponentName(type) || 'Component';
|
413 | if (!didWarnAboutInvalidateContextType[name]) {
|
414 | didWarnAboutInvalidateContextType[name] = true;
|
415 | warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext(). ' + 'Did you accidentally pass the Context.Provider instead?', name);
|
416 | }
|
417 | }
|
418 | }
|
419 | validateContextBounds(contextType, threadID);
|
420 | return contextType[threadID];
|
421 | } else {
|
422 | var maskedContext = maskContext(type, context);
|
423 | {
|
424 | if (type.contextTypes) {
|
425 | checkContextTypes(type.contextTypes, maskedContext, 'context');
|
426 | }
|
427 | }
|
428 | return maskedContext;
|
429 | }
|
430 | }
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 | var nextAvailableThreadIDs = new Uint16Array(16);
|
437 | for (var i = 0; i < 15; i++) {
|
438 | nextAvailableThreadIDs[i] = i + 1;
|
439 | }
|
440 | nextAvailableThreadIDs[15] = 0;
|
441 |
|
442 | function growThreadCountAndReturnNextAvailable() {
|
443 | var oldArray = nextAvailableThreadIDs;
|
444 | var oldSize = oldArray.length;
|
445 | var newSize = oldSize * 2;
|
446 | !(newSize <= 0x10000) ? invariant(false, 'Maximum number of concurrent React renderers exceeded. This can happen if you are not properly destroying the Readable provided by React. Ensure that you call .destroy() on it if you no longer want to read from it, and did not read to the end. If you use .pipe() this should be automatic.') : void 0;
|
447 | var newArray = new Uint16Array(newSize);
|
448 | newArray.set(oldArray);
|
449 | nextAvailableThreadIDs = newArray;
|
450 | nextAvailableThreadIDs[0] = oldSize + 1;
|
451 | for (var _i = oldSize; _i < newSize - 1; _i++) {
|
452 | nextAvailableThreadIDs[_i] = _i + 1;
|
453 | }
|
454 | nextAvailableThreadIDs[newSize - 1] = 0;
|
455 | return oldSize;
|
456 | }
|
457 |
|
458 | function allocThreadID() {
|
459 | var nextID = nextAvailableThreadIDs[0];
|
460 | if (nextID === 0) {
|
461 | return growThreadCountAndReturnNextAvailable();
|
462 | }
|
463 | nextAvailableThreadIDs[0] = nextAvailableThreadIDs[nextID];
|
464 | return nextID;
|
465 | }
|
466 |
|
467 | function freeThreadID(id) {
|
468 | nextAvailableThreadIDs[id] = nextAvailableThreadIDs[0];
|
469 | nextAvailableThreadIDs[0] = id;
|
470 | }
|
471 |
|
472 |
|
473 |
|
474 | var RESERVED = 0;
|
475 |
|
476 |
|
477 |
|
478 | var STRING = 1;
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 | var BOOLEANISH_STRING = 2;
|
485 |
|
486 |
|
487 |
|
488 |
|
489 | var BOOLEAN = 3;
|
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 | var OVERLOADED_BOOLEAN = 4;
|
496 |
|
497 |
|
498 |
|
499 | var NUMERIC = 5;
|
500 |
|
501 |
|
502 |
|
503 | var POSITIVE_NUMERIC = 6;
|
504 |
|
505 |
|
506 | var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
|
507 |
|
508 | var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
|
509 |
|
510 |
|
511 | var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
|
512 | var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
513 |
|
514 | var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
515 | var illegalAttributeNameCache = {};
|
516 | var validatedAttributeNameCache = {};
|
517 |
|
518 | function isAttributeNameSafe(attributeName) {
|
519 | if (hasOwnProperty$1.call(validatedAttributeNameCache, attributeName)) {
|
520 | return true;
|
521 | }
|
522 | if (hasOwnProperty$1.call(illegalAttributeNameCache, attributeName)) {
|
523 | return false;
|
524 | }
|
525 | if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
|
526 | validatedAttributeNameCache[attributeName] = true;
|
527 | return true;
|
528 | }
|
529 | illegalAttributeNameCache[attributeName] = true;
|
530 | {
|
531 | warning$1(false, 'Invalid attribute name: `%s`', attributeName);
|
532 | }
|
533 | return false;
|
534 | }
|
535 |
|
536 | function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
|
537 | if (propertyInfo !== null) {
|
538 | return propertyInfo.type === RESERVED;
|
539 | }
|
540 | if (isCustomComponentTag) {
|
541 | return false;
|
542 | }
|
543 | if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
|
544 | return true;
|
545 | }
|
546 | return false;
|
547 | }
|
548 |
|
549 | function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
|
550 | if (propertyInfo !== null && propertyInfo.type === RESERVED) {
|
551 | return false;
|
552 | }
|
553 | switch (typeof value) {
|
554 | case 'function':
|
555 |
|
556 | case 'symbol':
|
557 |
|
558 | return true;
|
559 | case 'boolean':
|
560 | {
|
561 | if (isCustomComponentTag) {
|
562 | return false;
|
563 | }
|
564 | if (propertyInfo !== null) {
|
565 | return !propertyInfo.acceptsBooleans;
|
566 | } else {
|
567 | var prefix = name.toLowerCase().slice(0, 5);
|
568 | return prefix !== 'data-' && prefix !== 'aria-';
|
569 | }
|
570 | }
|
571 | default:
|
572 | return false;
|
573 | }
|
574 | }
|
575 |
|
576 | function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
|
577 | if (value === null || typeof value === 'undefined') {
|
578 | return true;
|
579 | }
|
580 | if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
|
581 | return true;
|
582 | }
|
583 | if (isCustomComponentTag) {
|
584 | return false;
|
585 | }
|
586 | if (propertyInfo !== null) {
|
587 | switch (propertyInfo.type) {
|
588 | case BOOLEAN:
|
589 | return !value;
|
590 | case OVERLOADED_BOOLEAN:
|
591 | return value === false;
|
592 | case NUMERIC:
|
593 | return isNaN(value);
|
594 | case POSITIVE_NUMERIC:
|
595 | return isNaN(value) || value < 1;
|
596 | }
|
597 | }
|
598 | return false;
|
599 | }
|
600 |
|
601 | function getPropertyInfo(name) {
|
602 | return properties.hasOwnProperty(name) ? properties[name] : null;
|
603 | }
|
604 |
|
605 | function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace) {
|
606 | this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
|
607 | this.attributeName = attributeName;
|
608 | this.attributeNamespace = attributeNamespace;
|
609 | this.mustUseProperty = mustUseProperty;
|
610 | this.propertyName = name;
|
611 | this.type = type;
|
612 | }
|
613 |
|
614 |
|
615 |
|
616 |
|
617 | var properties = {};
|
618 |
|
619 |
|
620 | ['children', 'dangerouslySetInnerHTML',
|
621 |
|
622 |
|
623 |
|
624 | 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
|
625 | properties[name] = new PropertyInfoRecord(name, RESERVED, false,
|
626 | name,
|
627 | null);
|
628 | }
|
629 | );
|
630 |
|
631 |
|
632 |
|
633 | [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
|
634 | var name = _ref[0],
|
635 | attributeName = _ref[1];
|
636 |
|
637 | properties[name] = new PropertyInfoRecord(name, STRING, false,
|
638 | attributeName,
|
639 | null);
|
640 | }
|
641 | );
|
642 |
|
643 |
|
644 |
|
645 |
|
646 | ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
|
647 | properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false,
|
648 | name.toLowerCase(),
|
649 | null);
|
650 | }
|
651 | );
|
652 |
|
653 |
|
654 |
|
655 |
|
656 |
|
657 | ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
|
658 | properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false,
|
659 | name,
|
660 | null);
|
661 | }
|
662 | );
|
663 |
|
664 |
|
665 | ['allowFullScreen', 'async',
|
666 |
|
667 |
|
668 | 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless',
|
669 |
|
670 | 'itemScope'].forEach(function (name) {
|
671 | properties[name] = new PropertyInfoRecord(name, BOOLEAN, false,
|
672 | name.toLowerCase(),
|
673 | null);
|
674 | }
|
675 | );
|
676 |
|
677 |
|
678 |
|
679 | ['checked',
|
680 |
|
681 |
|
682 | 'multiple', 'muted', 'selected'].forEach(function (name) {
|
683 | properties[name] = new PropertyInfoRecord(name, BOOLEAN, true,
|
684 | name,
|
685 | null);
|
686 | }
|
687 | );
|
688 |
|
689 |
|
690 |
|
691 | ['capture', 'download'].forEach(function (name) {
|
692 | properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false,
|
693 | name,
|
694 | null);
|
695 | }
|
696 | );
|
697 |
|
698 |
|
699 | ['cols', 'rows', 'size', 'span'].forEach(function (name) {
|
700 | properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false,
|
701 | name,
|
702 | null);
|
703 | }
|
704 | );
|
705 |
|
706 |
|
707 | ['rowSpan', 'start'].forEach(function (name) {
|
708 | properties[name] = new PropertyInfoRecord(name, NUMERIC, false,
|
709 | name.toLowerCase(),
|
710 | null);
|
711 | }
|
712 | );
|
713 |
|
714 | var CAMELIZE = /[\-\:]([a-z])/g;
|
715 | var capitalize = function (token) {
|
716 | return token[1].toUpperCase();
|
717 | };
|
718 |
|
719 |
|
720 |
|
721 |
|
722 |
|
723 |
|
724 | ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {
|
725 | var name = attributeName.replace(CAMELIZE, capitalize);
|
726 | properties[name] = new PropertyInfoRecord(name, STRING, false,
|
727 | attributeName, null);
|
728 | }
|
729 | );
|
730 |
|
731 |
|
732 | ['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
|
733 | var name = attributeName.replace(CAMELIZE, capitalize);
|
734 | properties[name] = new PropertyInfoRecord(name, STRING, false,
|
735 | attributeName, 'http://www.w3.org/1999/xlink');
|
736 | });
|
737 |
|
738 |
|
739 | ['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
|
740 | var name = attributeName.replace(CAMELIZE, capitalize);
|
741 | properties[name] = new PropertyInfoRecord(name, STRING, false,
|
742 | attributeName, 'http://www.w3.org/XML/1998/namespace');
|
743 | });
|
744 |
|
745 |
|
746 |
|
747 |
|
748 | properties.tabIndex = new PropertyInfoRecord('tabIndex', STRING, false,
|
749 | 'tabindex',
|
750 | null);
|
751 |
|
752 |
|
753 |
|
754 |
|
755 |
|
756 |
|
757 |
|
758 | var matchHtmlRegExp = /["'&<>]/;
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 | function escapeHtml(string) {
|
769 | var str = '' + string;
|
770 | var match = matchHtmlRegExp.exec(str);
|
771 |
|
772 | if (!match) {
|
773 | return str;
|
774 | }
|
775 |
|
776 | var escape = void 0;
|
777 | var html = '';
|
778 | var index = void 0;
|
779 | var lastIndex = 0;
|
780 |
|
781 | for (index = match.index; index < str.length; index++) {
|
782 | switch (str.charCodeAt(index)) {
|
783 | case 34:
|
784 |
|
785 | escape = '"';
|
786 | break;
|
787 | case 38:
|
788 |
|
789 | escape = '&';
|
790 | break;
|
791 | case 39:
|
792 |
|
793 | escape = ''';
|
794 | break;
|
795 | case 60:
|
796 |
|
797 | escape = '<';
|
798 | break;
|
799 | case 62:
|
800 |
|
801 | escape = '>';
|
802 | break;
|
803 | default:
|
804 | continue;
|
805 | }
|
806 |
|
807 | if (lastIndex !== index) {
|
808 | html += str.substring(lastIndex, index);
|
809 | }
|
810 |
|
811 | lastIndex = index + 1;
|
812 | html += escape;
|
813 | }
|
814 |
|
815 | return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
|
816 | }
|
817 |
|
818 |
|
819 |
|
820 |
|
821 |
|
822 |
|
823 |
|
824 |
|
825 | function escapeTextForBrowser(text) {
|
826 | if (typeof text === 'boolean' || typeof text === 'number') {
|
827 |
|
828 |
|
829 |
|
830 | return '' + text;
|
831 | }
|
832 | return escapeHtml(text);
|
833 | }
|
834 |
|
835 |
|
836 |
|
837 |
|
838 |
|
839 |
|
840 |
|
841 | function quoteAttributeValueForBrowser(value) {
|
842 | return '"' + escapeTextForBrowser(value) + '"';
|
843 | }
|
844 |
|
845 |
|
846 |
|
847 |
|
848 |
|
849 |
|
850 |
|
851 |
|
852 |
|
853 |
|
854 |
|
855 |
|
856 |
|
857 | function createMarkupForRoot() {
|
858 | return ROOT_ATTRIBUTE_NAME + '=""';
|
859 | }
|
860 |
|
861 |
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 | function createMarkupForProperty(name, value) {
|
869 | var propertyInfo = getPropertyInfo(name);
|
870 | if (name !== 'style' && shouldIgnoreAttribute(name, propertyInfo, false)) {
|
871 | return '';
|
872 | }
|
873 | if (shouldRemoveAttribute(name, value, propertyInfo, false)) {
|
874 | return '';
|
875 | }
|
876 | if (propertyInfo !== null) {
|
877 | var attributeName = propertyInfo.attributeName;
|
878 | var type = propertyInfo.type;
|
879 |
|
880 | if (type === BOOLEAN || type === OVERLOADED_BOOLEAN && value === true) {
|
881 | return attributeName + '=""';
|
882 | } else {
|
883 | return attributeName + '=' + quoteAttributeValueForBrowser(value);
|
884 | }
|
885 | } else if (isAttributeNameSafe(name)) {
|
886 | return name + '=' + quoteAttributeValueForBrowser(value);
|
887 | }
|
888 | return '';
|
889 | }
|
890 |
|
891 |
|
892 |
|
893 |
|
894 |
|
895 |
|
896 |
|
897 |
|
898 | function createMarkupForCustomAttribute(name, value) {
|
899 | if (!isAttributeNameSafe(name) || value == null) {
|
900 | return '';
|
901 | }
|
902 | return name + '=' + quoteAttributeValueForBrowser(value);
|
903 | }
|
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 | function is(x, y) {
|
910 | return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y
|
911 | ;
|
912 | }
|
913 |
|
914 | var currentlyRenderingComponent = null;
|
915 | var firstWorkInProgressHook = null;
|
916 | var workInProgressHook = null;
|
917 |
|
918 | var isReRender = false;
|
919 |
|
920 | var didScheduleRenderPhaseUpdate = false;
|
921 |
|
922 | var renderPhaseUpdates = null;
|
923 |
|
924 | var numberOfReRenders = 0;
|
925 | var RE_RENDER_LIMIT = 25;
|
926 |
|
927 | var isInHookUserCodeInDev = false;
|
928 |
|
929 |
|
930 | var currentHookNameInDev = void 0;
|
931 |
|
932 | function resolveCurrentlyRenderingComponent() {
|
933 | !(currentlyRenderingComponent !== null) ? invariant(false, 'Hooks can only be called inside the body of a function component. (https://fb.me/react-invalid-hook-call)') : void 0;
|
934 | {
|
935 | !!isInHookUserCodeInDev ? warning$1(false, 'Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks') : void 0;
|
936 | }
|
937 | return currentlyRenderingComponent;
|
938 | }
|
939 |
|
940 | function areHookInputsEqual(nextDeps, prevDeps) {
|
941 | if (prevDeps === null) {
|
942 | {
|
943 | warning$1(false, '%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
|
944 | }
|
945 | return false;
|
946 | }
|
947 |
|
948 | {
|
949 |
|
950 |
|
951 | if (nextDeps.length !== prevDeps.length) {
|
952 | warning$1(false, 'The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, '[' + nextDeps.join(', ') + ']', '[' + prevDeps.join(', ') + ']');
|
953 | }
|
954 | }
|
955 | for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
|
956 | if (is(nextDeps[i], prevDeps[i])) {
|
957 | continue;
|
958 | }
|
959 | return false;
|
960 | }
|
961 | return true;
|
962 | }
|
963 |
|
964 | function createHook() {
|
965 | if (numberOfReRenders > 0) {
|
966 | invariant(false, 'Rendered more hooks than during the previous render');
|
967 | }
|
968 | return {
|
969 | memoizedState: null,
|
970 | queue: null,
|
971 | next: null
|
972 | };
|
973 | }
|
974 |
|
975 | function createWorkInProgressHook() {
|
976 | if (workInProgressHook === null) {
|
977 |
|
978 | if (firstWorkInProgressHook === null) {
|
979 | isReRender = false;
|
980 | firstWorkInProgressHook = workInProgressHook = createHook();
|
981 | } else {
|
982 |
|
983 | isReRender = true;
|
984 | workInProgressHook = firstWorkInProgressHook;
|
985 | }
|
986 | } else {
|
987 | if (workInProgressHook.next === null) {
|
988 | isReRender = false;
|
989 |
|
990 | workInProgressHook = workInProgressHook.next = createHook();
|
991 | } else {
|
992 |
|
993 | isReRender = true;
|
994 | workInProgressHook = workInProgressHook.next;
|
995 | }
|
996 | }
|
997 | return workInProgressHook;
|
998 | }
|
999 |
|
1000 | function prepareToUseHooks(componentIdentity) {
|
1001 | currentlyRenderingComponent = componentIdentity;
|
1002 | {
|
1003 | isInHookUserCodeInDev = false;
|
1004 | }
|
1005 |
|
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 | }
|
1013 |
|
1014 | function finishHooks(Component, props, children, refOrContext) {
|
1015 |
|
1016 |
|
1017 |
|
1018 | while (didScheduleRenderPhaseUpdate) {
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 | didScheduleRenderPhaseUpdate = false;
|
1024 | numberOfReRenders += 1;
|
1025 |
|
1026 |
|
1027 | workInProgressHook = null;
|
1028 |
|
1029 | children = Component(props, refOrContext);
|
1030 | }
|
1031 | currentlyRenderingComponent = null;
|
1032 | firstWorkInProgressHook = null;
|
1033 | numberOfReRenders = 0;
|
1034 | renderPhaseUpdates = null;
|
1035 | workInProgressHook = null;
|
1036 | {
|
1037 | isInHookUserCodeInDev = false;
|
1038 | }
|
1039 |
|
1040 |
|
1041 |
|
1042 |
|
1043 |
|
1044 |
|
1045 |
|
1046 |
|
1047 |
|
1048 | return children;
|
1049 | }
|
1050 |
|
1051 | function readContext(context, observedBits) {
|
1052 | var threadID = currentThreadID;
|
1053 | validateContextBounds(context, threadID);
|
1054 | {
|
1055 | !!isInHookUserCodeInDev ? warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().') : void 0;
|
1056 | }
|
1057 | return context[threadID];
|
1058 | }
|
1059 |
|
1060 | function useContext(context, observedBits) {
|
1061 | {
|
1062 | currentHookNameInDev = 'useContext';
|
1063 | }
|
1064 | resolveCurrentlyRenderingComponent();
|
1065 | var threadID = currentThreadID;
|
1066 | validateContextBounds(context, threadID);
|
1067 | return context[threadID];
|
1068 | }
|
1069 |
|
1070 | function basicStateReducer(state, action) {
|
1071 | return typeof action === 'function' ? action(state) : action;
|
1072 | }
|
1073 |
|
1074 | function useState(initialState) {
|
1075 | {
|
1076 | currentHookNameInDev = 'useState';
|
1077 | }
|
1078 | return useReducer(basicStateReducer,
|
1079 |
|
1080 | initialState);
|
1081 | }
|
1082 |
|
1083 | function useReducer(reducer, initialArg, init) {
|
1084 | {
|
1085 | if (reducer !== basicStateReducer) {
|
1086 | currentHookNameInDev = 'useReducer';
|
1087 | }
|
1088 | }
|
1089 | currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
|
1090 | workInProgressHook = createWorkInProgressHook();
|
1091 | if (isReRender) {
|
1092 |
|
1093 | var _queue = workInProgressHook.queue;
|
1094 | var _dispatch = _queue.dispatch;
|
1095 | if (renderPhaseUpdates !== null) {
|
1096 |
|
1097 | var firstRenderPhaseUpdate = renderPhaseUpdates.get(_queue);
|
1098 | if (firstRenderPhaseUpdate !== undefined) {
|
1099 | renderPhaseUpdates.delete(_queue);
|
1100 | var newState = workInProgressHook.memoizedState;
|
1101 | var update = firstRenderPhaseUpdate;
|
1102 | do {
|
1103 |
|
1104 |
|
1105 |
|
1106 | var _action = update.action;
|
1107 | {
|
1108 | isInHookUserCodeInDev = true;
|
1109 | }
|
1110 | newState = reducer(newState, _action);
|
1111 | {
|
1112 | isInHookUserCodeInDev = false;
|
1113 | }
|
1114 | update = update.next;
|
1115 | } while (update !== null);
|
1116 |
|
1117 | workInProgressHook.memoizedState = newState;
|
1118 |
|
1119 | return [newState, _dispatch];
|
1120 | }
|
1121 | }
|
1122 | return [workInProgressHook.memoizedState, _dispatch];
|
1123 | } else {
|
1124 | {
|
1125 | isInHookUserCodeInDev = true;
|
1126 | }
|
1127 | var initialState = void 0;
|
1128 | if (reducer === basicStateReducer) {
|
1129 |
|
1130 | initialState = typeof initialArg === 'function' ? initialArg() : initialArg;
|
1131 | } else {
|
1132 | initialState = init !== undefined ? init(initialArg) : initialArg;
|
1133 | }
|
1134 | {
|
1135 | isInHookUserCodeInDev = false;
|
1136 | }
|
1137 | workInProgressHook.memoizedState = initialState;
|
1138 | var _queue2 = workInProgressHook.queue = {
|
1139 | last: null,
|
1140 | dispatch: null
|
1141 | };
|
1142 | var _dispatch2 = _queue2.dispatch = dispatchAction.bind(null, currentlyRenderingComponent, _queue2);
|
1143 | return [workInProgressHook.memoizedState, _dispatch2];
|
1144 | }
|
1145 | }
|
1146 |
|
1147 | function useMemo(nextCreate, deps) {
|
1148 | currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
|
1149 | workInProgressHook = createWorkInProgressHook();
|
1150 |
|
1151 | var nextDeps = deps === undefined ? null : deps;
|
1152 |
|
1153 | if (workInProgressHook !== null) {
|
1154 | var prevState = workInProgressHook.memoizedState;
|
1155 | if (prevState !== null) {
|
1156 | if (nextDeps !== null) {
|
1157 | var prevDeps = prevState[1];
|
1158 | if (areHookInputsEqual(nextDeps, prevDeps)) {
|
1159 | return prevState[0];
|
1160 | }
|
1161 | }
|
1162 | }
|
1163 | }
|
1164 |
|
1165 | {
|
1166 | isInHookUserCodeInDev = true;
|
1167 | }
|
1168 | var nextValue = nextCreate();
|
1169 | {
|
1170 | isInHookUserCodeInDev = false;
|
1171 | }
|
1172 | workInProgressHook.memoizedState = [nextValue, nextDeps];
|
1173 | return nextValue;
|
1174 | }
|
1175 |
|
1176 | function useRef(initialValue) {
|
1177 | currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
|
1178 | workInProgressHook = createWorkInProgressHook();
|
1179 | var previousRef = workInProgressHook.memoizedState;
|
1180 | if (previousRef === null) {
|
1181 | var ref = { current: initialValue };
|
1182 | {
|
1183 | Object.seal(ref);
|
1184 | }
|
1185 | workInProgressHook.memoizedState = ref;
|
1186 | return ref;
|
1187 | } else {
|
1188 | return previousRef;
|
1189 | }
|
1190 | }
|
1191 |
|
1192 | function useLayoutEffect(create, inputs) {
|
1193 | {
|
1194 | currentHookNameInDev = 'useLayoutEffect';
|
1195 | }
|
1196 | warning$1(false, 'useLayoutEffect does nothing on the server, because its effect cannot ' + "be encoded into the server renderer's output format. This will lead " + 'to a mismatch between the initial, non-hydrated UI and the intended ' + 'UI. To avoid this, useLayoutEffect should only be used in ' + 'components that render exclusively on the client.');
|
1197 | }
|
1198 |
|
1199 | function dispatchAction(componentIdentity, queue, action) {
|
1200 | !(numberOfReRenders < RE_RENDER_LIMIT) ? invariant(false, 'Too many re-renders. React limits the number of renders to prevent an infinite loop.') : void 0;
|
1201 |
|
1202 | if (componentIdentity === currentlyRenderingComponent) {
|
1203 |
|
1204 |
|
1205 |
|
1206 | didScheduleRenderPhaseUpdate = true;
|
1207 | var update = {
|
1208 | action: action,
|
1209 | next: null
|
1210 | };
|
1211 | if (renderPhaseUpdates === null) {
|
1212 | renderPhaseUpdates = new Map();
|
1213 | }
|
1214 | var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
|
1215 | if (firstRenderPhaseUpdate === undefined) {
|
1216 | renderPhaseUpdates.set(queue, update);
|
1217 | } else {
|
1218 |
|
1219 | var lastRenderPhaseUpdate = firstRenderPhaseUpdate;
|
1220 | while (lastRenderPhaseUpdate.next !== null) {
|
1221 | lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
|
1222 | }
|
1223 | lastRenderPhaseUpdate.next = update;
|
1224 | }
|
1225 | } else {
|
1226 |
|
1227 |
|
1228 |
|
1229 | }
|
1230 | }
|
1231 |
|
1232 | function useCallback(callback, deps) {
|
1233 |
|
1234 | return callback;
|
1235 | }
|
1236 |
|
1237 | function noop() {}
|
1238 |
|
1239 | var currentThreadID = 0;
|
1240 |
|
1241 | function setCurrentThreadID(threadID) {
|
1242 | currentThreadID = threadID;
|
1243 | }
|
1244 |
|
1245 | var Dispatcher = {
|
1246 | readContext: readContext,
|
1247 | useContext: useContext,
|
1248 | useMemo: useMemo,
|
1249 | useReducer: useReducer,
|
1250 | useRef: useRef,
|
1251 | useState: useState,
|
1252 | useLayoutEffect: useLayoutEffect,
|
1253 | useCallback: useCallback,
|
1254 |
|
1255 | useImperativeHandle: noop,
|
1256 |
|
1257 | useEffect: noop,
|
1258 |
|
1259 | useDebugValue: noop
|
1260 | };
|
1261 |
|
1262 | var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
1263 | var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
1264 | var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
1265 |
|
1266 | var Namespaces = {
|
1267 | html: HTML_NAMESPACE,
|
1268 | mathml: MATH_NAMESPACE,
|
1269 | svg: SVG_NAMESPACE
|
1270 | };
|
1271 |
|
1272 |
|
1273 | function getIntrinsicNamespace(type) {
|
1274 | switch (type) {
|
1275 | case 'svg':
|
1276 | return SVG_NAMESPACE;
|
1277 | case 'math':
|
1278 | return MATH_NAMESPACE;
|
1279 | default:
|
1280 | return HTML_NAMESPACE;
|
1281 | }
|
1282 | }
|
1283 |
|
1284 | function getChildNamespace(parentNamespace, type) {
|
1285 | if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
|
1286 |
|
1287 | return getIntrinsicNamespace(type);
|
1288 | }
|
1289 | if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
|
1290 |
|
1291 | return HTML_NAMESPACE;
|
1292 | }
|
1293 |
|
1294 | return parentNamespace;
|
1295 | }
|
1296 |
|
1297 | var ReactDebugCurrentFrame$2 = null;
|
1298 |
|
1299 | var ReactControlledValuePropTypes = {
|
1300 | checkPropTypes: null
|
1301 | };
|
1302 |
|
1303 | {
|
1304 | ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
1305 |
|
1306 | var hasReadOnlyValue = {
|
1307 | button: true,
|
1308 | checkbox: true,
|
1309 | image: true,
|
1310 | hidden: true,
|
1311 | radio: true,
|
1312 | reset: true,
|
1313 | submit: true
|
1314 | };
|
1315 |
|
1316 | var propTypes = {
|
1317 | value: function (props, propName, componentName) {
|
1318 | if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null) {
|
1319 | return null;
|
1320 | }
|
1321 | return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
|
1322 | },
|
1323 | checked: function (props, propName, componentName) {
|
1324 | if (props.onChange || props.readOnly || props.disabled || props[propName] == null) {
|
1325 | return null;
|
1326 | }
|
1327 | return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
|
1328 | }
|
1329 | };
|
1330 |
|
1331 | |
1332 |
|
1333 |
|
1334 |
|
1335 | ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
|
1336 | checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);
|
1337 | };
|
1338 | }
|
1339 |
|
1340 |
|
1341 |
|
1342 |
|
1343 | var omittedCloseTags = {
|
1344 | area: true,
|
1345 | base: true,
|
1346 | br: true,
|
1347 | col: true,
|
1348 | embed: true,
|
1349 | hr: true,
|
1350 | img: true,
|
1351 | input: true,
|
1352 | keygen: true,
|
1353 | link: true,
|
1354 | meta: true,
|
1355 | param: true,
|
1356 | source: true,
|
1357 | track: true,
|
1358 | wbr: true
|
1359 |
|
1360 | };
|
1361 |
|
1362 |
|
1363 |
|
1364 |
|
1365 | var voidElementTags = _assign({
|
1366 | menuitem: true
|
1367 | }, omittedCloseTags);
|
1368 |
|
1369 |
|
1370 |
|
1371 | var HTML = '__html';
|
1372 |
|
1373 | var ReactDebugCurrentFrame$3 = null;
|
1374 | {
|
1375 | ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
|
1376 | }
|
1377 |
|
1378 | function assertValidProps(tag, props) {
|
1379 | if (!props) {
|
1380 | return;
|
1381 | }
|
1382 |
|
1383 | if (voidElementTags[tag]) {
|
1384 | !(props.children == null && props.dangerouslySetInnerHTML == null) ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', tag, ReactDebugCurrentFrame$3.getStackAddendum()) : void 0;
|
1385 | }
|
1386 | if (props.dangerouslySetInnerHTML != null) {
|
1387 | !(props.children == null) ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : void 0;
|
1388 | !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : void 0;
|
1389 | }
|
1390 | {
|
1391 | !(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning$1(false, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
|
1392 | }
|
1393 | !(props.style == null || typeof props.style === 'object') ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', ReactDebugCurrentFrame$3.getStackAddendum()) : void 0;
|
1394 | }
|
1395 |
|
1396 |
|
1397 |
|
1398 |
|
1399 | var isUnitlessNumber = {
|
1400 | animationIterationCount: true,
|
1401 | borderImageOutset: true,
|
1402 | borderImageSlice: true,
|
1403 | borderImageWidth: true,
|
1404 | boxFlex: true,
|
1405 | boxFlexGroup: true,
|
1406 | boxOrdinalGroup: true,
|
1407 | columnCount: true,
|
1408 | columns: true,
|
1409 | flex: true,
|
1410 | flexGrow: true,
|
1411 | flexPositive: true,
|
1412 | flexShrink: true,
|
1413 | flexNegative: true,
|
1414 | flexOrder: true,
|
1415 | gridArea: true,
|
1416 | gridRow: true,
|
1417 | gridRowEnd: true,
|
1418 | gridRowSpan: true,
|
1419 | gridRowStart: true,
|
1420 | gridColumn: true,
|
1421 | gridColumnEnd: true,
|
1422 | gridColumnSpan: true,
|
1423 | gridColumnStart: true,
|
1424 | fontWeight: true,
|
1425 | lineClamp: true,
|
1426 | lineHeight: true,
|
1427 | opacity: true,
|
1428 | order: true,
|
1429 | orphans: true,
|
1430 | tabSize: true,
|
1431 | widows: true,
|
1432 | zIndex: true,
|
1433 | zoom: true,
|
1434 |
|
1435 |
|
1436 | fillOpacity: true,
|
1437 | floodOpacity: true,
|
1438 | stopOpacity: true,
|
1439 | strokeDasharray: true,
|
1440 | strokeDashoffset: true,
|
1441 | strokeMiterlimit: true,
|
1442 | strokeOpacity: true,
|
1443 | strokeWidth: true
|
1444 | };
|
1445 |
|
1446 |
|
1447 |
|
1448 |
|
1449 |
|
1450 |
|
1451 |
|
1452 | function prefixKey(prefix, key) {
|
1453 | return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
1454 | }
|
1455 |
|
1456 |
|
1457 |
|
1458 |
|
1459 |
|
1460 | var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
|
1461 |
|
1462 |
|
1463 |
|
1464 | Object.keys(isUnitlessNumber).forEach(function (prop) {
|
1465 | prefixes.forEach(function (prefix) {
|
1466 | isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
|
1467 | });
|
1468 | });
|
1469 |
|
1470 |
|
1471 |
|
1472 |
|
1473 |
|
1474 |
|
1475 |
|
1476 |
|
1477 |
|
1478 |
|
1479 | function dangerousStyleValue(name, value, isCustomProperty) {
|
1480 |
|
1481 |
|
1482 |
|
1483 |
|
1484 |
|
1485 |
|
1486 |
|
1487 |
|
1488 |
|
1489 |
|
1490 | var isEmpty = value == null || typeof value === 'boolean' || value === '';
|
1491 | if (isEmpty) {
|
1492 | return '';
|
1493 | }
|
1494 |
|
1495 | if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
|
1496 | return value + 'px';
|
1497 | }
|
1498 |
|
1499 | return ('' + value).trim();
|
1500 | }
|
1501 |
|
1502 | var uppercasePattern = /([A-Z])/g;
|
1503 | var msPattern = /^ms-/;
|
1504 |
|
1505 |
|
1506 |
|
1507 |
|
1508 |
|
1509 |
|
1510 |
|
1511 |
|
1512 |
|
1513 |
|
1514 |
|
1515 |
|
1516 |
|
1517 |
|
1518 | function hyphenateStyleName(name) {
|
1519 | return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
|
1520 | }
|
1521 |
|
1522 | function isCustomComponent(tagName, props) {
|
1523 | if (tagName.indexOf('-') === -1) {
|
1524 | return typeof props.is === 'string';
|
1525 | }
|
1526 | switch (tagName) {
|
1527 |
|
1528 |
|
1529 |
|
1530 |
|
1531 | case 'annotation-xml':
|
1532 | case 'color-profile':
|
1533 | case 'font-face':
|
1534 | case 'font-face-src':
|
1535 | case 'font-face-uri':
|
1536 | case 'font-face-format':
|
1537 | case 'font-face-name':
|
1538 | case 'missing-glyph':
|
1539 | return false;
|
1540 | default:
|
1541 | return true;
|
1542 | }
|
1543 | }
|
1544 |
|
1545 | var warnValidStyle = function () {};
|
1546 |
|
1547 | {
|
1548 |
|
1549 | var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
|
1550 | var msPattern$1 = /^-ms-/;
|
1551 | var hyphenPattern = /-(.)/g;
|
1552 |
|
1553 |
|
1554 | var badStyleValueWithSemicolonPattern = /;\s*$/;
|
1555 |
|
1556 | var warnedStyleNames = {};
|
1557 | var warnedStyleValues = {};
|
1558 | var warnedForNaNValue = false;
|
1559 | var warnedForInfinityValue = false;
|
1560 |
|
1561 | var camelize = function (string) {
|
1562 | return string.replace(hyphenPattern, function (_, character) {
|
1563 | return character.toUpperCase();
|
1564 | });
|
1565 | };
|
1566 |
|
1567 | var warnHyphenatedStyleName = function (name) {
|
1568 | if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
1569 | return;
|
1570 | }
|
1571 |
|
1572 | warnedStyleNames[name] = true;
|
1573 | warning$1(false, 'Unsupported style property %s. Did you mean %s?', name,
|
1574 |
|
1575 |
|
1576 |
|
1577 | camelize(name.replace(msPattern$1, 'ms-')));
|
1578 | };
|
1579 |
|
1580 | var warnBadVendoredStyleName = function (name) {
|
1581 | if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
1582 | return;
|
1583 | }
|
1584 |
|
1585 | warnedStyleNames[name] = true;
|
1586 | warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
|
1587 | };
|
1588 |
|
1589 | var warnStyleValueWithSemicolon = function (name, value) {
|
1590 | if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
|
1591 | return;
|
1592 | }
|
1593 |
|
1594 | warnedStyleValues[value] = true;
|
1595 | warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
|
1596 | };
|
1597 |
|
1598 | var warnStyleValueIsNaN = function (name, value) {
|
1599 | if (warnedForNaNValue) {
|
1600 | return;
|
1601 | }
|
1602 |
|
1603 | warnedForNaNValue = true;
|
1604 | warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name);
|
1605 | };
|
1606 |
|
1607 | var warnStyleValueIsInfinity = function (name, value) {
|
1608 | if (warnedForInfinityValue) {
|
1609 | return;
|
1610 | }
|
1611 |
|
1612 | warnedForInfinityValue = true;
|
1613 | warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name);
|
1614 | };
|
1615 |
|
1616 | warnValidStyle = function (name, value) {
|
1617 | if (name.indexOf('-') > -1) {
|
1618 | warnHyphenatedStyleName(name);
|
1619 | } else if (badVendoredStyleNamePattern.test(name)) {
|
1620 | warnBadVendoredStyleName(name);
|
1621 | } else if (badStyleValueWithSemicolonPattern.test(value)) {
|
1622 | warnStyleValueWithSemicolon(name, value);
|
1623 | }
|
1624 |
|
1625 | if (typeof value === 'number') {
|
1626 | if (isNaN(value)) {
|
1627 | warnStyleValueIsNaN(name, value);
|
1628 | } else if (!isFinite(value)) {
|
1629 | warnStyleValueIsInfinity(name, value);
|
1630 | }
|
1631 | }
|
1632 | };
|
1633 | }
|
1634 |
|
1635 | var warnValidStyle$1 = warnValidStyle;
|
1636 |
|
1637 | var ariaProperties = {
|
1638 | 'aria-current': 0,
|
1639 | 'aria-details': 0,
|
1640 | 'aria-disabled': 0,
|
1641 | 'aria-hidden': 0,
|
1642 | 'aria-invalid': 0,
|
1643 | 'aria-keyshortcuts': 0,
|
1644 | 'aria-label': 0,
|
1645 | 'aria-roledescription': 0,
|
1646 |
|
1647 | 'aria-autocomplete': 0,
|
1648 | 'aria-checked': 0,
|
1649 | 'aria-expanded': 0,
|
1650 | 'aria-haspopup': 0,
|
1651 | 'aria-level': 0,
|
1652 | 'aria-modal': 0,
|
1653 | 'aria-multiline': 0,
|
1654 | 'aria-multiselectable': 0,
|
1655 | 'aria-orientation': 0,
|
1656 | 'aria-placeholder': 0,
|
1657 | 'aria-pressed': 0,
|
1658 | 'aria-readonly': 0,
|
1659 | 'aria-required': 0,
|
1660 | 'aria-selected': 0,
|
1661 | 'aria-sort': 0,
|
1662 | 'aria-valuemax': 0,
|
1663 | 'aria-valuemin': 0,
|
1664 | 'aria-valuenow': 0,
|
1665 | 'aria-valuetext': 0,
|
1666 |
|
1667 | 'aria-atomic': 0,
|
1668 | 'aria-busy': 0,
|
1669 | 'aria-live': 0,
|
1670 | 'aria-relevant': 0,
|
1671 |
|
1672 | 'aria-dropeffect': 0,
|
1673 | 'aria-grabbed': 0,
|
1674 |
|
1675 | 'aria-activedescendant': 0,
|
1676 | 'aria-colcount': 0,
|
1677 | 'aria-colindex': 0,
|
1678 | 'aria-colspan': 0,
|
1679 | 'aria-controls': 0,
|
1680 | 'aria-describedby': 0,
|
1681 | 'aria-errormessage': 0,
|
1682 | 'aria-flowto': 0,
|
1683 | 'aria-labelledby': 0,
|
1684 | 'aria-owns': 0,
|
1685 | 'aria-posinset': 0,
|
1686 | 'aria-rowcount': 0,
|
1687 | 'aria-rowindex': 0,
|
1688 | 'aria-rowspan': 0,
|
1689 | 'aria-setsize': 0
|
1690 | };
|
1691 |
|
1692 | var warnedProperties = {};
|
1693 | var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
|
1694 | var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
1695 |
|
1696 | var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
1697 |
|
1698 | function validateProperty(tagName, name) {
|
1699 | if (hasOwnProperty$2.call(warnedProperties, name) && warnedProperties[name]) {
|
1700 | return true;
|
1701 | }
|
1702 |
|
1703 | if (rARIACamel.test(name)) {
|
1704 | var ariaName = 'aria-' + name.slice(4).toLowerCase();
|
1705 | var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;
|
1706 |
|
1707 |
|
1708 |
|
1709 | if (correctName == null) {
|
1710 | warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
|
1711 | warnedProperties[name] = true;
|
1712 | return true;
|
1713 | }
|
1714 |
|
1715 | if (name !== correctName) {
|
1716 | warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
|
1717 | warnedProperties[name] = true;
|
1718 | return true;
|
1719 | }
|
1720 | }
|
1721 |
|
1722 | if (rARIA.test(name)) {
|
1723 | var lowerCasedName = name.toLowerCase();
|
1724 | var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
|
1725 |
|
1726 |
|
1727 |
|
1728 | if (standardName == null) {
|
1729 | warnedProperties[name] = true;
|
1730 | return false;
|
1731 | }
|
1732 |
|
1733 | if (name !== standardName) {
|
1734 | warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
|
1735 | warnedProperties[name] = true;
|
1736 | return true;
|
1737 | }
|
1738 | }
|
1739 |
|
1740 | return true;
|
1741 | }
|
1742 |
|
1743 | function warnInvalidARIAProps(type, props) {
|
1744 | var invalidProps = [];
|
1745 |
|
1746 | for (var key in props) {
|
1747 | var isValid = validateProperty(type, key);
|
1748 | if (!isValid) {
|
1749 | invalidProps.push(key);
|
1750 | }
|
1751 | }
|
1752 |
|
1753 | var unknownPropString = invalidProps.map(function (prop) {
|
1754 | return '`' + prop + '`';
|
1755 | }).join(', ');
|
1756 |
|
1757 | if (invalidProps.length === 1) {
|
1758 | warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
|
1759 | } else if (invalidProps.length > 1) {
|
1760 | warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
|
1761 | }
|
1762 | }
|
1763 |
|
1764 | function validateProperties(type, props) {
|
1765 | if (isCustomComponent(type, props)) {
|
1766 | return;
|
1767 | }
|
1768 | warnInvalidARIAProps(type, props);
|
1769 | }
|
1770 |
|
1771 | var didWarnValueNull = false;
|
1772 |
|
1773 | function validateProperties$1(type, props) {
|
1774 | if (type !== 'input' && type !== 'textarea' && type !== 'select') {
|
1775 | return;
|
1776 | }
|
1777 |
|
1778 | if (props != null && props.value === null && !didWarnValueNull) {
|
1779 | didWarnValueNull = true;
|
1780 | if (type === 'select' && props.multiple) {
|
1781 | warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
|
1782 | } else {
|
1783 | warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
|
1784 | }
|
1785 | }
|
1786 | }
|
1787 |
|
1788 |
|
1789 |
|
1790 |
|
1791 |
|
1792 |
|
1793 |
|
1794 |
|
1795 |
|
1796 |
|
1797 |
|
1798 |
|
1799 |
|
1800 |
|
1801 |
|
1802 |
|
1803 |
|
1804 |
|
1805 |
|
1806 |
|
1807 | var registrationNameModules = {};
|
1808 |
|
1809 |
|
1810 |
|
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 |
|
1816 |
|
1817 |
|
1818 |
|
1819 |
|
1820 | var possibleRegistrationNames = {};
|
1821 |
|
1822 |
|
1823 |
|
1824 |
|
1825 |
|
1826 |
|
1827 |
|
1828 |
|
1829 |
|
1830 |
|
1831 |
|
1832 |
|
1833 |
|
1834 |
|
1835 |
|
1836 |
|
1837 |
|
1838 |
|
1839 |
|
1840 |
|
1841 |
|
1842 |
|
1843 |
|
1844 |
|
1845 |
|
1846 |
|
1847 |
|
1848 | var possibleStandardNames = {
|
1849 |
|
1850 | accept: 'accept',
|
1851 | acceptcharset: 'acceptCharset',
|
1852 | 'accept-charset': 'acceptCharset',
|
1853 | accesskey: 'accessKey',
|
1854 | action: 'action',
|
1855 | allowfullscreen: 'allowFullScreen',
|
1856 | alt: 'alt',
|
1857 | as: 'as',
|
1858 | async: 'async',
|
1859 | autocapitalize: 'autoCapitalize',
|
1860 | autocomplete: 'autoComplete',
|
1861 | autocorrect: 'autoCorrect',
|
1862 | autofocus: 'autoFocus',
|
1863 | autoplay: 'autoPlay',
|
1864 | autosave: 'autoSave',
|
1865 | capture: 'capture',
|
1866 | cellpadding: 'cellPadding',
|
1867 | cellspacing: 'cellSpacing',
|
1868 | challenge: 'challenge',
|
1869 | charset: 'charSet',
|
1870 | checked: 'checked',
|
1871 | children: 'children',
|
1872 | cite: 'cite',
|
1873 | class: 'className',
|
1874 | classid: 'classID',
|
1875 | classname: 'className',
|
1876 | cols: 'cols',
|
1877 | colspan: 'colSpan',
|
1878 | content: 'content',
|
1879 | contenteditable: 'contentEditable',
|
1880 | contextmenu: 'contextMenu',
|
1881 | controls: 'controls',
|
1882 | controlslist: 'controlsList',
|
1883 | coords: 'coords',
|
1884 | crossorigin: 'crossOrigin',
|
1885 | dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
|
1886 | data: 'data',
|
1887 | datetime: 'dateTime',
|
1888 | default: 'default',
|
1889 | defaultchecked: 'defaultChecked',
|
1890 | defaultvalue: 'defaultValue',
|
1891 | defer: 'defer',
|
1892 | dir: 'dir',
|
1893 | disabled: 'disabled',
|
1894 | download: 'download',
|
1895 | draggable: 'draggable',
|
1896 | enctype: 'encType',
|
1897 | for: 'htmlFor',
|
1898 | form: 'form',
|
1899 | formmethod: 'formMethod',
|
1900 | formaction: 'formAction',
|
1901 | formenctype: 'formEncType',
|
1902 | formnovalidate: 'formNoValidate',
|
1903 | formtarget: 'formTarget',
|
1904 | frameborder: 'frameBorder',
|
1905 | headers: 'headers',
|
1906 | height: 'height',
|
1907 | hidden: 'hidden',
|
1908 | high: 'high',
|
1909 | href: 'href',
|
1910 | hreflang: 'hrefLang',
|
1911 | htmlfor: 'htmlFor',
|
1912 | httpequiv: 'httpEquiv',
|
1913 | 'http-equiv': 'httpEquiv',
|
1914 | icon: 'icon',
|
1915 | id: 'id',
|
1916 | innerhtml: 'innerHTML',
|
1917 | inputmode: 'inputMode',
|
1918 | integrity: 'integrity',
|
1919 | is: 'is',
|
1920 | itemid: 'itemID',
|
1921 | itemprop: 'itemProp',
|
1922 | itemref: 'itemRef',
|
1923 | itemscope: 'itemScope',
|
1924 | itemtype: 'itemType',
|
1925 | keyparams: 'keyParams',
|
1926 | keytype: 'keyType',
|
1927 | kind: 'kind',
|
1928 | label: 'label',
|
1929 | lang: 'lang',
|
1930 | list: 'list',
|
1931 | loop: 'loop',
|
1932 | low: 'low',
|
1933 | manifest: 'manifest',
|
1934 | marginwidth: 'marginWidth',
|
1935 | marginheight: 'marginHeight',
|
1936 | max: 'max',
|
1937 | maxlength: 'maxLength',
|
1938 | media: 'media',
|
1939 | mediagroup: 'mediaGroup',
|
1940 | method: 'method',
|
1941 | min: 'min',
|
1942 | minlength: 'minLength',
|
1943 | multiple: 'multiple',
|
1944 | muted: 'muted',
|
1945 | name: 'name',
|
1946 | nomodule: 'noModule',
|
1947 | nonce: 'nonce',
|
1948 | novalidate: 'noValidate',
|
1949 | open: 'open',
|
1950 | optimum: 'optimum',
|
1951 | pattern: 'pattern',
|
1952 | placeholder: 'placeholder',
|
1953 | playsinline: 'playsInline',
|
1954 | poster: 'poster',
|
1955 | preload: 'preload',
|
1956 | profile: 'profile',
|
1957 | radiogroup: 'radioGroup',
|
1958 | readonly: 'readOnly',
|
1959 | referrerpolicy: 'referrerPolicy',
|
1960 | rel: 'rel',
|
1961 | required: 'required',
|
1962 | reversed: 'reversed',
|
1963 | role: 'role',
|
1964 | rows: 'rows',
|
1965 | rowspan: 'rowSpan',
|
1966 | sandbox: 'sandbox',
|
1967 | scope: 'scope',
|
1968 | scoped: 'scoped',
|
1969 | scrolling: 'scrolling',
|
1970 | seamless: 'seamless',
|
1971 | selected: 'selected',
|
1972 | shape: 'shape',
|
1973 | size: 'size',
|
1974 | sizes: 'sizes',
|
1975 | span: 'span',
|
1976 | spellcheck: 'spellCheck',
|
1977 | src: 'src',
|
1978 | srcdoc: 'srcDoc',
|
1979 | srclang: 'srcLang',
|
1980 | srcset: 'srcSet',
|
1981 | start: 'start',
|
1982 | step: 'step',
|
1983 | style: 'style',
|
1984 | summary: 'summary',
|
1985 | tabindex: 'tabIndex',
|
1986 | target: 'target',
|
1987 | title: 'title',
|
1988 | type: 'type',
|
1989 | usemap: 'useMap',
|
1990 | value: 'value',
|
1991 | width: 'width',
|
1992 | wmode: 'wmode',
|
1993 | wrap: 'wrap',
|
1994 |
|
1995 |
|
1996 | about: 'about',
|
1997 | accentheight: 'accentHeight',
|
1998 | 'accent-height': 'accentHeight',
|
1999 | accumulate: 'accumulate',
|
2000 | additive: 'additive',
|
2001 | alignmentbaseline: 'alignmentBaseline',
|
2002 | 'alignment-baseline': 'alignmentBaseline',
|
2003 | allowreorder: 'allowReorder',
|
2004 | alphabetic: 'alphabetic',
|
2005 | amplitude: 'amplitude',
|
2006 | arabicform: 'arabicForm',
|
2007 | 'arabic-form': 'arabicForm',
|
2008 | ascent: 'ascent',
|
2009 | attributename: 'attributeName',
|
2010 | attributetype: 'attributeType',
|
2011 | autoreverse: 'autoReverse',
|
2012 | azimuth: 'azimuth',
|
2013 | basefrequency: 'baseFrequency',
|
2014 | baselineshift: 'baselineShift',
|
2015 | 'baseline-shift': 'baselineShift',
|
2016 | baseprofile: 'baseProfile',
|
2017 | bbox: 'bbox',
|
2018 | begin: 'begin',
|
2019 | bias: 'bias',
|
2020 | by: 'by',
|
2021 | calcmode: 'calcMode',
|
2022 | capheight: 'capHeight',
|
2023 | 'cap-height': 'capHeight',
|
2024 | clip: 'clip',
|
2025 | clippath: 'clipPath',
|
2026 | 'clip-path': 'clipPath',
|
2027 | clippathunits: 'clipPathUnits',
|
2028 | cliprule: 'clipRule',
|
2029 | 'clip-rule': 'clipRule',
|
2030 | color: 'color',
|
2031 | colorinterpolation: 'colorInterpolation',
|
2032 | 'color-interpolation': 'colorInterpolation',
|
2033 | colorinterpolationfilters: 'colorInterpolationFilters',
|
2034 | 'color-interpolation-filters': 'colorInterpolationFilters',
|
2035 | colorprofile: 'colorProfile',
|
2036 | 'color-profile': 'colorProfile',
|
2037 | colorrendering: 'colorRendering',
|
2038 | 'color-rendering': 'colorRendering',
|
2039 | contentscripttype: 'contentScriptType',
|
2040 | contentstyletype: 'contentStyleType',
|
2041 | cursor: 'cursor',
|
2042 | cx: 'cx',
|
2043 | cy: 'cy',
|
2044 | d: 'd',
|
2045 | datatype: 'datatype',
|
2046 | decelerate: 'decelerate',
|
2047 | descent: 'descent',
|
2048 | diffuseconstant: 'diffuseConstant',
|
2049 | direction: 'direction',
|
2050 | display: 'display',
|
2051 | divisor: 'divisor',
|
2052 | dominantbaseline: 'dominantBaseline',
|
2053 | 'dominant-baseline': 'dominantBaseline',
|
2054 | dur: 'dur',
|
2055 | dx: 'dx',
|
2056 | dy: 'dy',
|
2057 | edgemode: 'edgeMode',
|
2058 | elevation: 'elevation',
|
2059 | enablebackground: 'enableBackground',
|
2060 | 'enable-background': 'enableBackground',
|
2061 | end: 'end',
|
2062 | exponent: 'exponent',
|
2063 | externalresourcesrequired: 'externalResourcesRequired',
|
2064 | fill: 'fill',
|
2065 | fillopacity: 'fillOpacity',
|
2066 | 'fill-opacity': 'fillOpacity',
|
2067 | fillrule: 'fillRule',
|
2068 | 'fill-rule': 'fillRule',
|
2069 | filter: 'filter',
|
2070 | filterres: 'filterRes',
|
2071 | filterunits: 'filterUnits',
|
2072 | floodopacity: 'floodOpacity',
|
2073 | 'flood-opacity': 'floodOpacity',
|
2074 | floodcolor: 'floodColor',
|
2075 | 'flood-color': 'floodColor',
|
2076 | focusable: 'focusable',
|
2077 | fontfamily: 'fontFamily',
|
2078 | 'font-family': 'fontFamily',
|
2079 | fontsize: 'fontSize',
|
2080 | 'font-size': 'fontSize',
|
2081 | fontsizeadjust: 'fontSizeAdjust',
|
2082 | 'font-size-adjust': 'fontSizeAdjust',
|
2083 | fontstretch: 'fontStretch',
|
2084 | 'font-stretch': 'fontStretch',
|
2085 | fontstyle: 'fontStyle',
|
2086 | 'font-style': 'fontStyle',
|
2087 | fontvariant: 'fontVariant',
|
2088 | 'font-variant': 'fontVariant',
|
2089 | fontweight: 'fontWeight',
|
2090 | 'font-weight': 'fontWeight',
|
2091 | format: 'format',
|
2092 | from: 'from',
|
2093 | fx: 'fx',
|
2094 | fy: 'fy',
|
2095 | g1: 'g1',
|
2096 | g2: 'g2',
|
2097 | glyphname: 'glyphName',
|
2098 | 'glyph-name': 'glyphName',
|
2099 | glyphorientationhorizontal: 'glyphOrientationHorizontal',
|
2100 | 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
|
2101 | glyphorientationvertical: 'glyphOrientationVertical',
|
2102 | 'glyph-orientation-vertical': 'glyphOrientationVertical',
|
2103 | glyphref: 'glyphRef',
|
2104 | gradienttransform: 'gradientTransform',
|
2105 | gradientunits: 'gradientUnits',
|
2106 | hanging: 'hanging',
|
2107 | horizadvx: 'horizAdvX',
|
2108 | 'horiz-adv-x': 'horizAdvX',
|
2109 | horizoriginx: 'horizOriginX',
|
2110 | 'horiz-origin-x': 'horizOriginX',
|
2111 | ideographic: 'ideographic',
|
2112 | imagerendering: 'imageRendering',
|
2113 | 'image-rendering': 'imageRendering',
|
2114 | in2: 'in2',
|
2115 | in: 'in',
|
2116 | inlist: 'inlist',
|
2117 | intercept: 'intercept',
|
2118 | k1: 'k1',
|
2119 | k2: 'k2',
|
2120 | k3: 'k3',
|
2121 | k4: 'k4',
|
2122 | k: 'k',
|
2123 | kernelmatrix: 'kernelMatrix',
|
2124 | kernelunitlength: 'kernelUnitLength',
|
2125 | kerning: 'kerning',
|
2126 | keypoints: 'keyPoints',
|
2127 | keysplines: 'keySplines',
|
2128 | keytimes: 'keyTimes',
|
2129 | lengthadjust: 'lengthAdjust',
|
2130 | letterspacing: 'letterSpacing',
|
2131 | 'letter-spacing': 'letterSpacing',
|
2132 | lightingcolor: 'lightingColor',
|
2133 | 'lighting-color': 'lightingColor',
|
2134 | limitingconeangle: 'limitingConeAngle',
|
2135 | local: 'local',
|
2136 | markerend: 'markerEnd',
|
2137 | 'marker-end': 'markerEnd',
|
2138 | markerheight: 'markerHeight',
|
2139 | markermid: 'markerMid',
|
2140 | 'marker-mid': 'markerMid',
|
2141 | markerstart: 'markerStart',
|
2142 | 'marker-start': 'markerStart',
|
2143 | markerunits: 'markerUnits',
|
2144 | markerwidth: 'markerWidth',
|
2145 | mask: 'mask',
|
2146 | maskcontentunits: 'maskContentUnits',
|
2147 | maskunits: 'maskUnits',
|
2148 | mathematical: 'mathematical',
|
2149 | mode: 'mode',
|
2150 | numoctaves: 'numOctaves',
|
2151 | offset: 'offset',
|
2152 | opacity: 'opacity',
|
2153 | operator: 'operator',
|
2154 | order: 'order',
|
2155 | orient: 'orient',
|
2156 | orientation: 'orientation',
|
2157 | origin: 'origin',
|
2158 | overflow: 'overflow',
|
2159 | overlineposition: 'overlinePosition',
|
2160 | 'overline-position': 'overlinePosition',
|
2161 | overlinethickness: 'overlineThickness',
|
2162 | 'overline-thickness': 'overlineThickness',
|
2163 | paintorder: 'paintOrder',
|
2164 | 'paint-order': 'paintOrder',
|
2165 | panose1: 'panose1',
|
2166 | 'panose-1': 'panose1',
|
2167 | pathlength: 'pathLength',
|
2168 | patterncontentunits: 'patternContentUnits',
|
2169 | patterntransform: 'patternTransform',
|
2170 | patternunits: 'patternUnits',
|
2171 | pointerevents: 'pointerEvents',
|
2172 | 'pointer-events': 'pointerEvents',
|
2173 | points: 'points',
|
2174 | pointsatx: 'pointsAtX',
|
2175 | pointsaty: 'pointsAtY',
|
2176 | pointsatz: 'pointsAtZ',
|
2177 | prefix: 'prefix',
|
2178 | preservealpha: 'preserveAlpha',
|
2179 | preserveaspectratio: 'preserveAspectRatio',
|
2180 | primitiveunits: 'primitiveUnits',
|
2181 | property: 'property',
|
2182 | r: 'r',
|
2183 | radius: 'radius',
|
2184 | refx: 'refX',
|
2185 | refy: 'refY',
|
2186 | renderingintent: 'renderingIntent',
|
2187 | 'rendering-intent': 'renderingIntent',
|
2188 | repeatcount: 'repeatCount',
|
2189 | repeatdur: 'repeatDur',
|
2190 | requiredextensions: 'requiredExtensions',
|
2191 | requiredfeatures: 'requiredFeatures',
|
2192 | resource: 'resource',
|
2193 | restart: 'restart',
|
2194 | result: 'result',
|
2195 | results: 'results',
|
2196 | rotate: 'rotate',
|
2197 | rx: 'rx',
|
2198 | ry: 'ry',
|
2199 | scale: 'scale',
|
2200 | security: 'security',
|
2201 | seed: 'seed',
|
2202 | shaperendering: 'shapeRendering',
|
2203 | 'shape-rendering': 'shapeRendering',
|
2204 | slope: 'slope',
|
2205 | spacing: 'spacing',
|
2206 | specularconstant: 'specularConstant',
|
2207 | specularexponent: 'specularExponent',
|
2208 | speed: 'speed',
|
2209 | spreadmethod: 'spreadMethod',
|
2210 | startoffset: 'startOffset',
|
2211 | stddeviation: 'stdDeviation',
|
2212 | stemh: 'stemh',
|
2213 | stemv: 'stemv',
|
2214 | stitchtiles: 'stitchTiles',
|
2215 | stopcolor: 'stopColor',
|
2216 | 'stop-color': 'stopColor',
|
2217 | stopopacity: 'stopOpacity',
|
2218 | 'stop-opacity': 'stopOpacity',
|
2219 | strikethroughposition: 'strikethroughPosition',
|
2220 | 'strikethrough-position': 'strikethroughPosition',
|
2221 | strikethroughthickness: 'strikethroughThickness',
|
2222 | 'strikethrough-thickness': 'strikethroughThickness',
|
2223 | string: 'string',
|
2224 | stroke: 'stroke',
|
2225 | strokedasharray: 'strokeDasharray',
|
2226 | 'stroke-dasharray': 'strokeDasharray',
|
2227 | strokedashoffset: 'strokeDashoffset',
|
2228 | 'stroke-dashoffset': 'strokeDashoffset',
|
2229 | strokelinecap: 'strokeLinecap',
|
2230 | 'stroke-linecap': 'strokeLinecap',
|
2231 | strokelinejoin: 'strokeLinejoin',
|
2232 | 'stroke-linejoin': 'strokeLinejoin',
|
2233 | strokemiterlimit: 'strokeMiterlimit',
|
2234 | 'stroke-miterlimit': 'strokeMiterlimit',
|
2235 | strokewidth: 'strokeWidth',
|
2236 | 'stroke-width': 'strokeWidth',
|
2237 | strokeopacity: 'strokeOpacity',
|
2238 | 'stroke-opacity': 'strokeOpacity',
|
2239 | suppresscontenteditablewarning: 'suppressContentEditableWarning',
|
2240 | suppresshydrationwarning: 'suppressHydrationWarning',
|
2241 | surfacescale: 'surfaceScale',
|
2242 | systemlanguage: 'systemLanguage',
|
2243 | tablevalues: 'tableValues',
|
2244 | targetx: 'targetX',
|
2245 | targety: 'targetY',
|
2246 | textanchor: 'textAnchor',
|
2247 | 'text-anchor': 'textAnchor',
|
2248 | textdecoration: 'textDecoration',
|
2249 | 'text-decoration': 'textDecoration',
|
2250 | textlength: 'textLength',
|
2251 | textrendering: 'textRendering',
|
2252 | 'text-rendering': 'textRendering',
|
2253 | to: 'to',
|
2254 | transform: 'transform',
|
2255 | typeof: 'typeof',
|
2256 | u1: 'u1',
|
2257 | u2: 'u2',
|
2258 | underlineposition: 'underlinePosition',
|
2259 | 'underline-position': 'underlinePosition',
|
2260 | underlinethickness: 'underlineThickness',
|
2261 | 'underline-thickness': 'underlineThickness',
|
2262 | unicode: 'unicode',
|
2263 | unicodebidi: 'unicodeBidi',
|
2264 | 'unicode-bidi': 'unicodeBidi',
|
2265 | unicoderange: 'unicodeRange',
|
2266 | 'unicode-range': 'unicodeRange',
|
2267 | unitsperem: 'unitsPerEm',
|
2268 | 'units-per-em': 'unitsPerEm',
|
2269 | unselectable: 'unselectable',
|
2270 | valphabetic: 'vAlphabetic',
|
2271 | 'v-alphabetic': 'vAlphabetic',
|
2272 | values: 'values',
|
2273 | vectoreffect: 'vectorEffect',
|
2274 | 'vector-effect': 'vectorEffect',
|
2275 | version: 'version',
|
2276 | vertadvy: 'vertAdvY',
|
2277 | 'vert-adv-y': 'vertAdvY',
|
2278 | vertoriginx: 'vertOriginX',
|
2279 | 'vert-origin-x': 'vertOriginX',
|
2280 | vertoriginy: 'vertOriginY',
|
2281 | 'vert-origin-y': 'vertOriginY',
|
2282 | vhanging: 'vHanging',
|
2283 | 'v-hanging': 'vHanging',
|
2284 | videographic: 'vIdeographic',
|
2285 | 'v-ideographic': 'vIdeographic',
|
2286 | viewbox: 'viewBox',
|
2287 | viewtarget: 'viewTarget',
|
2288 | visibility: 'visibility',
|
2289 | vmathematical: 'vMathematical',
|
2290 | 'v-mathematical': 'vMathematical',
|
2291 | vocab: 'vocab',
|
2292 | widths: 'widths',
|
2293 | wordspacing: 'wordSpacing',
|
2294 | 'word-spacing': 'wordSpacing',
|
2295 | writingmode: 'writingMode',
|
2296 | 'writing-mode': 'writingMode',
|
2297 | x1: 'x1',
|
2298 | x2: 'x2',
|
2299 | x: 'x',
|
2300 | xchannelselector: 'xChannelSelector',
|
2301 | xheight: 'xHeight',
|
2302 | 'x-height': 'xHeight',
|
2303 | xlinkactuate: 'xlinkActuate',
|
2304 | 'xlink:actuate': 'xlinkActuate',
|
2305 | xlinkarcrole: 'xlinkArcrole',
|
2306 | 'xlink:arcrole': 'xlinkArcrole',
|
2307 | xlinkhref: 'xlinkHref',
|
2308 | 'xlink:href': 'xlinkHref',
|
2309 | xlinkrole: 'xlinkRole',
|
2310 | 'xlink:role': 'xlinkRole',
|
2311 | xlinkshow: 'xlinkShow',
|
2312 | 'xlink:show': 'xlinkShow',
|
2313 | xlinktitle: 'xlinkTitle',
|
2314 | 'xlink:title': 'xlinkTitle',
|
2315 | xlinktype: 'xlinkType',
|
2316 | 'xlink:type': 'xlinkType',
|
2317 | xmlbase: 'xmlBase',
|
2318 | 'xml:base': 'xmlBase',
|
2319 | xmllang: 'xmlLang',
|
2320 | 'xml:lang': 'xmlLang',
|
2321 | xmlns: 'xmlns',
|
2322 | 'xml:space': 'xmlSpace',
|
2323 | xmlnsxlink: 'xmlnsXlink',
|
2324 | 'xmlns:xlink': 'xmlnsXlink',
|
2325 | xmlspace: 'xmlSpace',
|
2326 | y1: 'y1',
|
2327 | y2: 'y2',
|
2328 | y: 'y',
|
2329 | ychannelselector: 'yChannelSelector',
|
2330 | z: 'z',
|
2331 | zoomandpan: 'zoomAndPan'
|
2332 | };
|
2333 |
|
2334 | var validateProperty$1 = function () {};
|
2335 |
|
2336 | {
|
2337 | var warnedProperties$1 = {};
|
2338 | var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
2339 | var EVENT_NAME_REGEX = /^on./;
|
2340 | var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
|
2341 | var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
|
2342 | var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
2343 |
|
2344 | validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
|
2345 | if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
|
2346 | return true;
|
2347 | }
|
2348 |
|
2349 | var lowerCasedName = name.toLowerCase();
|
2350 | if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
|
2351 | warning$1(false, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
|
2352 | warnedProperties$1[name] = true;
|
2353 | return true;
|
2354 | }
|
2355 |
|
2356 |
|
2357 | if (canUseEventSystem) {
|
2358 | if (registrationNameModules.hasOwnProperty(name)) {
|
2359 | return true;
|
2360 | }
|
2361 | var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
|
2362 | if (registrationName != null) {
|
2363 | warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
|
2364 | warnedProperties$1[name] = true;
|
2365 | return true;
|
2366 | }
|
2367 | if (EVENT_NAME_REGEX.test(name)) {
|
2368 | warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name);
|
2369 | warnedProperties$1[name] = true;
|
2370 | return true;
|
2371 | }
|
2372 | } else if (EVENT_NAME_REGEX.test(name)) {
|
2373 |
|
2374 |
|
2375 |
|
2376 | if (INVALID_EVENT_NAME_REGEX.test(name)) {
|
2377 | warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
|
2378 | }
|
2379 | warnedProperties$1[name] = true;
|
2380 | return true;
|
2381 | }
|
2382 |
|
2383 |
|
2384 | if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
|
2385 | return true;
|
2386 | }
|
2387 |
|
2388 | if (lowerCasedName === 'innerhtml') {
|
2389 | warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
|
2390 | warnedProperties$1[name] = true;
|
2391 | return true;
|
2392 | }
|
2393 |
|
2394 | if (lowerCasedName === 'aria') {
|
2395 | warning$1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
|
2396 | warnedProperties$1[name] = true;
|
2397 | return true;
|
2398 | }
|
2399 |
|
2400 | if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
|
2401 | warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
|
2402 | warnedProperties$1[name] = true;
|
2403 | return true;
|
2404 | }
|
2405 |
|
2406 | if (typeof value === 'number' && isNaN(value)) {
|
2407 | warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
|
2408 | warnedProperties$1[name] = true;
|
2409 | return true;
|
2410 | }
|
2411 |
|
2412 | var propertyInfo = getPropertyInfo(name);
|
2413 | var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
|
2414 |
|
2415 |
|
2416 | if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
|
2417 | var standardName = possibleStandardNames[lowerCasedName];
|
2418 | if (standardName !== name) {
|
2419 | warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
|
2420 | warnedProperties$1[name] = true;
|
2421 | return true;
|
2422 | }
|
2423 | } else if (!isReserved && name !== lowerCasedName) {
|
2424 |
|
2425 |
|
2426 | warning$1(false, 'React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);
|
2427 | warnedProperties$1[name] = true;
|
2428 | return true;
|
2429 | }
|
2430 |
|
2431 | if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
2432 | if (value) {
|
2433 | warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
|
2434 | } else {
|
2435 | warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
|
2436 | }
|
2437 | warnedProperties$1[name] = true;
|
2438 | return true;
|
2439 | }
|
2440 |
|
2441 |
|
2442 |
|
2443 | if (isReserved) {
|
2444 | return true;
|
2445 | }
|
2446 |
|
2447 |
|
2448 | if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
2449 | warnedProperties$1[name] = true;
|
2450 | return false;
|
2451 | }
|
2452 |
|
2453 |
|
2454 | if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
|
2455 | warning$1(false, 'Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
|
2456 | warnedProperties$1[name] = true;
|
2457 | return true;
|
2458 | }
|
2459 |
|
2460 | return true;
|
2461 | };
|
2462 | }
|
2463 |
|
2464 | var warnUnknownProperties = function (type, props, canUseEventSystem) {
|
2465 | var unknownProps = [];
|
2466 | for (var key in props) {
|
2467 | var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
|
2468 | if (!isValid) {
|
2469 | unknownProps.push(key);
|
2470 | }
|
2471 | }
|
2472 |
|
2473 | var unknownPropString = unknownProps.map(function (prop) {
|
2474 | return '`' + prop + '`';
|
2475 | }).join(', ');
|
2476 | if (unknownProps.length === 1) {
|
2477 | warning$1(false, 'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
|
2478 | } else if (unknownProps.length > 1) {
|
2479 | warning$1(false, 'Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
|
2480 | }
|
2481 | };
|
2482 |
|
2483 | function validateProperties$2(type, props, canUseEventSystem) {
|
2484 | if (isCustomComponent(type, props)) {
|
2485 | return;
|
2486 | }
|
2487 | warnUnknownProperties(type, props, canUseEventSystem);
|
2488 | }
|
2489 |
|
2490 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
2491 |
|
2492 |
|
2493 |
|
2494 | var toArray = React.Children.toArray;
|
2495 |
|
2496 |
|
2497 |
|
2498 |
|
2499 |
|
2500 | var currentDebugStacks = [];
|
2501 |
|
2502 | var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
2503 | var ReactDebugCurrentFrame = void 0;
|
2504 | var prevGetCurrentStackImpl = null;
|
2505 | var getCurrentServerStackImpl = function () {
|
2506 | return '';
|
2507 | };
|
2508 | var describeStackFrame = function (element) {
|
2509 | return '';
|
2510 | };
|
2511 |
|
2512 | var validatePropertiesInDevelopment = function (type, props) {};
|
2513 | var pushCurrentDebugStack = function (stack) {};
|
2514 | var pushElementToDebugStack = function (element) {};
|
2515 | var popCurrentDebugStack = function () {};
|
2516 | var hasWarnedAboutUsingContextAsConsumer = false;
|
2517 |
|
2518 | {
|
2519 | ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
2520 |
|
2521 | validatePropertiesInDevelopment = function (type, props) {
|
2522 | validateProperties(type, props);
|
2523 | validateProperties$1(type, props);
|
2524 | validateProperties$2(type, props, false);
|
2525 | };
|
2526 |
|
2527 | describeStackFrame = function (element) {
|
2528 | var source = element._source;
|
2529 | var type = element.type;
|
2530 | var name = getComponentName(type);
|
2531 | var ownerName = null;
|
2532 | return describeComponentFrame(name, source, ownerName);
|
2533 | };
|
2534 |
|
2535 | pushCurrentDebugStack = function (stack) {
|
2536 | currentDebugStacks.push(stack);
|
2537 |
|
2538 | if (currentDebugStacks.length === 1) {
|
2539 |
|
2540 |
|
2541 | prevGetCurrentStackImpl = ReactDebugCurrentFrame.getCurrentStack;
|
2542 | ReactDebugCurrentFrame.getCurrentStack = getCurrentServerStackImpl;
|
2543 | }
|
2544 | };
|
2545 |
|
2546 | pushElementToDebugStack = function (element) {
|
2547 |
|
2548 | var stack = currentDebugStacks[currentDebugStacks.length - 1];
|
2549 |
|
2550 | var frame = stack[stack.length - 1];
|
2551 |
|
2552 | frame.debugElementStack.push(element);
|
2553 |
|
2554 |
|
2555 |
|
2556 | };
|
2557 |
|
2558 | popCurrentDebugStack = function () {
|
2559 | currentDebugStacks.pop();
|
2560 |
|
2561 | if (currentDebugStacks.length === 0) {
|
2562 |
|
2563 |
|
2564 | ReactDebugCurrentFrame.getCurrentStack = prevGetCurrentStackImpl;
|
2565 | prevGetCurrentStackImpl = null;
|
2566 | }
|
2567 | };
|
2568 |
|
2569 | getCurrentServerStackImpl = function () {
|
2570 | if (currentDebugStacks.length === 0) {
|
2571 |
|
2572 | return '';
|
2573 | }
|
2574 |
|
2575 |
|
2576 | var frames = currentDebugStacks[currentDebugStacks.length - 1];
|
2577 | var stack = '';
|
2578 |
|
2579 | for (var i = frames.length - 1; i >= 0; i--) {
|
2580 | var frame = frames[i];
|
2581 |
|
2582 |
|
2583 |
|
2584 | var _debugElementStack = frame.debugElementStack;
|
2585 | for (var ii = _debugElementStack.length - 1; ii >= 0; ii--) {
|
2586 | stack += describeStackFrame(_debugElementStack[ii]);
|
2587 | }
|
2588 | }
|
2589 | return stack;
|
2590 | };
|
2591 | }
|
2592 |
|
2593 | var didWarnDefaultInputValue = false;
|
2594 | var didWarnDefaultChecked = false;
|
2595 | var didWarnDefaultSelectValue = false;
|
2596 | var didWarnDefaultTextareaValue = false;
|
2597 | var didWarnInvalidOptionChildren = false;
|
2598 | var didWarnAboutNoopUpdateForComponent = {};
|
2599 | var didWarnAboutBadClass = {};
|
2600 | var didWarnAboutDeprecatedWillMount = {};
|
2601 | var didWarnAboutUndefinedDerivedState = {};
|
2602 | var didWarnAboutUninitializedState = {};
|
2603 | var valuePropNames = ['value', 'defaultValue'];
|
2604 | var newlineEatingTags = {
|
2605 | listing: true,
|
2606 | pre: true,
|
2607 | textarea: true
|
2608 | };
|
2609 |
|
2610 |
|
2611 |
|
2612 |
|
2613 | var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/;
|
2614 | var validatedTagCache = {};
|
2615 | function validateDangerousTag(tag) {
|
2616 | if (!validatedTagCache.hasOwnProperty(tag)) {
|
2617 | !VALID_TAG_REGEX.test(tag) ? invariant(false, 'Invalid tag: %s', tag) : void 0;
|
2618 | validatedTagCache[tag] = true;
|
2619 | }
|
2620 | }
|
2621 |
|
2622 | var styleNameCache = {};
|
2623 | var processStyleName = function (styleName) {
|
2624 | if (styleNameCache.hasOwnProperty(styleName)) {
|
2625 | return styleNameCache[styleName];
|
2626 | }
|
2627 | var result = hyphenateStyleName(styleName);
|
2628 | styleNameCache[styleName] = result;
|
2629 | return result;
|
2630 | };
|
2631 |
|
2632 | function createMarkupForStyles(styles) {
|
2633 | var serialized = '';
|
2634 | var delimiter = '';
|
2635 | for (var styleName in styles) {
|
2636 | if (!styles.hasOwnProperty(styleName)) {
|
2637 | continue;
|
2638 | }
|
2639 | var isCustomProperty = styleName.indexOf('--') === 0;
|
2640 | var styleValue = styles[styleName];
|
2641 | {
|
2642 | if (!isCustomProperty) {
|
2643 | warnValidStyle$1(styleName, styleValue);
|
2644 | }
|
2645 | }
|
2646 | if (styleValue != null) {
|
2647 | serialized += delimiter + processStyleName(styleName) + ':';
|
2648 | serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
|
2649 |
|
2650 | delimiter = ';';
|
2651 | }
|
2652 | }
|
2653 | return serialized || null;
|
2654 | }
|
2655 |
|
2656 | function warnNoop(publicInstance, callerName) {
|
2657 | {
|
2658 | var _constructor = publicInstance.constructor;
|
2659 | var componentName = _constructor && getComponentName(_constructor) || 'ReactClass';
|
2660 | var warningKey = componentName + '.' + callerName;
|
2661 | if (didWarnAboutNoopUpdateForComponent[warningKey]) {
|
2662 | return;
|
2663 | }
|
2664 |
|
2665 | warningWithoutStack$1(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, componentName);
|
2666 | didWarnAboutNoopUpdateForComponent[warningKey] = true;
|
2667 | }
|
2668 | }
|
2669 |
|
2670 | function shouldConstruct(Component) {
|
2671 | return Component.prototype && Component.prototype.isReactComponent;
|
2672 | }
|
2673 |
|
2674 | function getNonChildrenInnerMarkup(props) {
|
2675 | var innerHTML = props.dangerouslySetInnerHTML;
|
2676 | if (innerHTML != null) {
|
2677 | if (innerHTML.__html != null) {
|
2678 | return innerHTML.__html;
|
2679 | }
|
2680 | } else {
|
2681 | var content = props.children;
|
2682 | if (typeof content === 'string' || typeof content === 'number') {
|
2683 | return escapeTextForBrowser(content);
|
2684 | }
|
2685 | }
|
2686 | return null;
|
2687 | }
|
2688 |
|
2689 | function flattenTopLevelChildren(children) {
|
2690 | if (!React.isValidElement(children)) {
|
2691 | return toArray(children);
|
2692 | }
|
2693 | var element = children;
|
2694 | if (element.type !== REACT_FRAGMENT_TYPE) {
|
2695 | return [element];
|
2696 | }
|
2697 | var fragmentChildren = element.props.children;
|
2698 | if (!React.isValidElement(fragmentChildren)) {
|
2699 | return toArray(fragmentChildren);
|
2700 | }
|
2701 | var fragmentChildElement = fragmentChildren;
|
2702 | return [fragmentChildElement];
|
2703 | }
|
2704 |
|
2705 | function flattenOptionChildren(children) {
|
2706 | if (children === undefined || children === null) {
|
2707 | return children;
|
2708 | }
|
2709 | var content = '';
|
2710 |
|
2711 |
|
2712 | React.Children.forEach(children, function (child) {
|
2713 | if (child == null) {
|
2714 | return;
|
2715 | }
|
2716 | content += child;
|
2717 | {
|
2718 | if (!didWarnInvalidOptionChildren && typeof child !== 'string' && typeof child !== 'number') {
|
2719 | didWarnInvalidOptionChildren = true;
|
2720 | warning$1(false, 'Only strings and numbers are supported as <option> children.');
|
2721 | }
|
2722 | }
|
2723 | });
|
2724 | return content;
|
2725 | }
|
2726 |
|
2727 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
2728 | var STYLE = 'style';
|
2729 | var RESERVED_PROPS = {
|
2730 | children: null,
|
2731 | dangerouslySetInnerHTML: null,
|
2732 | suppressContentEditableWarning: null,
|
2733 | suppressHydrationWarning: null
|
2734 | };
|
2735 |
|
2736 | function createOpenTagMarkup(tagVerbatim, tagLowercase, props, namespace, makeStaticMarkup, isRootElement) {
|
2737 | var ret = '<' + tagVerbatim;
|
2738 |
|
2739 | for (var propKey in props) {
|
2740 | if (!hasOwnProperty.call(props, propKey)) {
|
2741 | continue;
|
2742 | }
|
2743 | var propValue = props[propKey];
|
2744 | if (propValue == null) {
|
2745 | continue;
|
2746 | }
|
2747 | if (propKey === STYLE) {
|
2748 | propValue = createMarkupForStyles(propValue);
|
2749 | }
|
2750 | var markup = null;
|
2751 | if (isCustomComponent(tagLowercase, props)) {
|
2752 | if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
|
2753 | markup = createMarkupForCustomAttribute(propKey, propValue);
|
2754 | }
|
2755 | } else {
|
2756 | markup = createMarkupForProperty(propKey, propValue);
|
2757 | }
|
2758 | if (markup) {
|
2759 | ret += ' ' + markup;
|
2760 | }
|
2761 | }
|
2762 |
|
2763 |
|
2764 |
|
2765 | if (makeStaticMarkup) {
|
2766 | return ret;
|
2767 | }
|
2768 |
|
2769 | if (isRootElement) {
|
2770 | ret += ' ' + createMarkupForRoot();
|
2771 | }
|
2772 | return ret;
|
2773 | }
|
2774 |
|
2775 | function validateRenderResult(child, type) {
|
2776 | if (child === undefined) {
|
2777 | invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', getComponentName(type) || 'Component');
|
2778 | }
|
2779 | }
|
2780 |
|
2781 | function resolve(child, context, threadID) {
|
2782 | while (React.isValidElement(child)) {
|
2783 |
|
2784 | var element = child;
|
2785 | var Component = element.type;
|
2786 | {
|
2787 | pushElementToDebugStack(element);
|
2788 | }
|
2789 | if (typeof Component !== 'function') {
|
2790 | break;
|
2791 | }
|
2792 | processChild(element, Component);
|
2793 | }
|
2794 |
|
2795 |
|
2796 | function processChild(element, Component) {
|
2797 | var publicContext = processContext(Component, context, threadID);
|
2798 |
|
2799 | var queue = [];
|
2800 | var replace = false;
|
2801 | var updater = {
|
2802 | isMounted: function (publicInstance) {
|
2803 | return false;
|
2804 | },
|
2805 | enqueueForceUpdate: function (publicInstance) {
|
2806 | if (queue === null) {
|
2807 | warnNoop(publicInstance, 'forceUpdate');
|
2808 | return null;
|
2809 | }
|
2810 | },
|
2811 | enqueueReplaceState: function (publicInstance, completeState) {
|
2812 | replace = true;
|
2813 | queue = [completeState];
|
2814 | },
|
2815 | enqueueSetState: function (publicInstance, currentPartialState) {
|
2816 | if (queue === null) {
|
2817 | warnNoop(publicInstance, 'setState');
|
2818 | return null;
|
2819 | }
|
2820 | queue.push(currentPartialState);
|
2821 | }
|
2822 | };
|
2823 |
|
2824 | var inst = void 0;
|
2825 | if (shouldConstruct(Component)) {
|
2826 | inst = new Component(element.props, publicContext, updater);
|
2827 |
|
2828 | if (typeof Component.getDerivedStateFromProps === 'function') {
|
2829 | {
|
2830 | if (inst.state === null || inst.state === undefined) {
|
2831 | var componentName = getComponentName(Component) || 'Unknown';
|
2832 | if (!didWarnAboutUninitializedState[componentName]) {
|
2833 | warningWithoutStack$1(false, '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, inst.state === null ? 'null' : 'undefined', componentName);
|
2834 | didWarnAboutUninitializedState[componentName] = true;
|
2835 | }
|
2836 | }
|
2837 | }
|
2838 |
|
2839 | var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);
|
2840 |
|
2841 | {
|
2842 | if (partialState === undefined) {
|
2843 | var _componentName = getComponentName(Component) || 'Unknown';
|
2844 | if (!didWarnAboutUndefinedDerivedState[_componentName]) {
|
2845 | warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);
|
2846 | didWarnAboutUndefinedDerivedState[_componentName] = true;
|
2847 | }
|
2848 | }
|
2849 | }
|
2850 |
|
2851 | if (partialState != null) {
|
2852 | inst.state = _assign({}, inst.state, partialState);
|
2853 | }
|
2854 | }
|
2855 | } else {
|
2856 | {
|
2857 | if (Component.prototype && typeof Component.prototype.render === 'function') {
|
2858 | var _componentName2 = getComponentName(Component) || 'Unknown';
|
2859 |
|
2860 | if (!didWarnAboutBadClass[_componentName2]) {
|
2861 | warningWithoutStack$1(false, "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);
|
2862 | didWarnAboutBadClass[_componentName2] = true;
|
2863 | }
|
2864 | }
|
2865 | }
|
2866 | var componentIdentity = {};
|
2867 | prepareToUseHooks(componentIdentity);
|
2868 | inst = Component(element.props, publicContext, updater);
|
2869 | inst = finishHooks(Component, element.props, inst, publicContext);
|
2870 |
|
2871 | if (inst == null || inst.render == null) {
|
2872 | child = inst;
|
2873 | validateRenderResult(child, Component);
|
2874 | return;
|
2875 | }
|
2876 | }
|
2877 |
|
2878 | inst.props = element.props;
|
2879 | inst.context = publicContext;
|
2880 | inst.updater = updater;
|
2881 |
|
2882 | var initialState = inst.state;
|
2883 | if (initialState === undefined) {
|
2884 | inst.state = initialState = null;
|
2885 | }
|
2886 | if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {
|
2887 | if (typeof inst.componentWillMount === 'function') {
|
2888 | {
|
2889 | if (warnAboutDeprecatedLifecycles && inst.componentWillMount.__suppressDeprecationWarning !== true) {
|
2890 | var _componentName3 = getComponentName(Component) || 'Unknown';
|
2891 |
|
2892 | if (!didWarnAboutDeprecatedWillMount[_componentName3]) {
|
2893 | lowPriorityWarning$1(false, '%s: componentWillMount() is deprecated and will be ' + 'removed in the next major version. Read about the motivations ' + 'behind this change: ' + 'https://fb.me/react-async-component-lifecycle-hooks' + '\n\n' + 'As a temporary workaround, you can rename to ' + 'UNSAFE_componentWillMount instead.', _componentName3);
|
2894 | didWarnAboutDeprecatedWillMount[_componentName3] = true;
|
2895 | }
|
2896 | }
|
2897 | }
|
2898 |
|
2899 |
|
2900 |
|
2901 | if (typeof Component.getDerivedStateFromProps !== 'function') {
|
2902 | inst.componentWillMount();
|
2903 | }
|
2904 | }
|
2905 | if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {
|
2906 |
|
2907 |
|
2908 | inst.UNSAFE_componentWillMount();
|
2909 | }
|
2910 | if (queue.length) {
|
2911 | var oldQueue = queue;
|
2912 | var oldReplace = replace;
|
2913 | queue = null;
|
2914 | replace = false;
|
2915 |
|
2916 | if (oldReplace && oldQueue.length === 1) {
|
2917 | inst.state = oldQueue[0];
|
2918 | } else {
|
2919 | var nextState = oldReplace ? oldQueue[0] : inst.state;
|
2920 | var dontMutate = true;
|
2921 | for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {
|
2922 | var partial = oldQueue[i];
|
2923 | var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;
|
2924 | if (_partialState != null) {
|
2925 | if (dontMutate) {
|
2926 | dontMutate = false;
|
2927 | nextState = _assign({}, nextState, _partialState);
|
2928 | } else {
|
2929 | _assign(nextState, _partialState);
|
2930 | }
|
2931 | }
|
2932 | }
|
2933 | inst.state = nextState;
|
2934 | }
|
2935 | } else {
|
2936 | queue = null;
|
2937 | }
|
2938 | }
|
2939 | child = inst.render();
|
2940 |
|
2941 | {
|
2942 | if (child === undefined && inst.render._isMockFunction) {
|
2943 |
|
2944 |
|
2945 | child = null;
|
2946 | }
|
2947 | }
|
2948 | validateRenderResult(child, Component);
|
2949 |
|
2950 | var childContext = void 0;
|
2951 | if (typeof inst.getChildContext === 'function') {
|
2952 | var childContextTypes = Component.childContextTypes;
|
2953 | if (typeof childContextTypes === 'object') {
|
2954 | childContext = inst.getChildContext();
|
2955 | for (var contextKey in childContext) {
|
2956 | !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;
|
2957 | }
|
2958 | } else {
|
2959 | warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
|
2960 | }
|
2961 | }
|
2962 | if (childContext) {
|
2963 | context = _assign({}, context, childContext);
|
2964 | }
|
2965 | }
|
2966 | return { child: child, context: context };
|
2967 | }
|
2968 |
|
2969 | var ReactDOMServerRenderer = function () {
|
2970 |
|
2971 |
|
2972 |
|
2973 | function ReactDOMServerRenderer(children, makeStaticMarkup) {
|
2974 | _classCallCheck(this, ReactDOMServerRenderer);
|
2975 |
|
2976 | var flatChildren = flattenTopLevelChildren(children);
|
2977 |
|
2978 | var topFrame = {
|
2979 | type: null,
|
2980 |
|
2981 |
|
2982 | domNamespace: Namespaces.html,
|
2983 | children: flatChildren,
|
2984 | childIndex: 0,
|
2985 | context: emptyObject,
|
2986 | footer: ''
|
2987 | };
|
2988 | {
|
2989 | topFrame.debugElementStack = [];
|
2990 | }
|
2991 | this.threadID = allocThreadID();
|
2992 | this.stack = [topFrame];
|
2993 | this.exhausted = false;
|
2994 | this.currentSelectValue = null;
|
2995 | this.previousWasTextNode = false;
|
2996 | this.makeStaticMarkup = makeStaticMarkup;
|
2997 | this.suspenseDepth = 0;
|
2998 |
|
2999 |
|
3000 | this.contextIndex = -1;
|
3001 | this.contextStack = [];
|
3002 | this.contextValueStack = [];
|
3003 | {
|
3004 | this.contextProviderStack = [];
|
3005 | }
|
3006 | }
|
3007 |
|
3008 | ReactDOMServerRenderer.prototype.destroy = function destroy() {
|
3009 | if (!this.exhausted) {
|
3010 | this.exhausted = true;
|
3011 | freeThreadID(this.threadID);
|
3012 | }
|
3013 | };
|
3014 |
|
3015 | |
3016 |
|
3017 |
|
3018 |
|
3019 |
|
3020 |
|
3021 |
|
3022 |
|
3023 |
|
3024 |
|
3025 | ReactDOMServerRenderer.prototype.pushProvider = function pushProvider(provider) {
|
3026 | var index = ++this.contextIndex;
|
3027 | var context = provider.type._context;
|
3028 | var threadID = this.threadID;
|
3029 | validateContextBounds(context, threadID);
|
3030 | var previousValue = context[threadID];
|
3031 |
|
3032 |
|
3033 | this.contextStack[index] = context;
|
3034 | this.contextValueStack[index] = previousValue;
|
3035 | {
|
3036 |
|
3037 | this.contextProviderStack[index] = provider;
|
3038 | }
|
3039 |
|
3040 |
|
3041 | context[threadID] = provider.props.value;
|
3042 | };
|
3043 |
|
3044 | ReactDOMServerRenderer.prototype.popProvider = function popProvider(provider) {
|
3045 | var index = this.contextIndex;
|
3046 | {
|
3047 | !(index > -1 && provider === this.contextProviderStack[index]) ? warningWithoutStack$1(false, 'Unexpected pop.') : void 0;
|
3048 | }
|
3049 |
|
3050 | var context = this.contextStack[index];
|
3051 | var previousValue = this.contextValueStack[index];
|
3052 |
|
3053 |
|
3054 |
|
3055 |
|
3056 | this.contextStack[index] = null;
|
3057 | this.contextValueStack[index] = null;
|
3058 | {
|
3059 | this.contextProviderStack[index] = null;
|
3060 | }
|
3061 | this.contextIndex--;
|
3062 |
|
3063 |
|
3064 |
|
3065 |
|
3066 | context[this.threadID] = previousValue;
|
3067 | };
|
3068 |
|
3069 | ReactDOMServerRenderer.prototype.read = function read(bytes) {
|
3070 | if (this.exhausted) {
|
3071 | return null;
|
3072 | }
|
3073 |
|
3074 | var prevThreadID = currentThreadID;
|
3075 | setCurrentThreadID(this.threadID);
|
3076 | var prevDispatcher = ReactCurrentDispatcher.current;
|
3077 | ReactCurrentDispatcher.current = Dispatcher;
|
3078 | try {
|
3079 |
|
3080 |
|
3081 | var out = [''];
|
3082 | var suspended = false;
|
3083 | while (out[0].length < bytes) {
|
3084 | if (this.stack.length === 0) {
|
3085 | this.exhausted = true;
|
3086 | freeThreadID(this.threadID);
|
3087 | break;
|
3088 | }
|
3089 | var frame = this.stack[this.stack.length - 1];
|
3090 | if (suspended || frame.childIndex >= frame.children.length) {
|
3091 | var _footer = frame.footer;
|
3092 | if (_footer !== '') {
|
3093 | this.previousWasTextNode = false;
|
3094 | }
|
3095 | this.stack.pop();
|
3096 | if (frame.type === 'select') {
|
3097 | this.currentSelectValue = null;
|
3098 | } else if (frame.type != null && frame.type.type != null && frame.type.type.$$typeof === REACT_PROVIDER_TYPE) {
|
3099 | var provider = frame.type;
|
3100 | this.popProvider(provider);
|
3101 | } else if (frame.type === REACT_SUSPENSE_TYPE) {
|
3102 | this.suspenseDepth--;
|
3103 | var buffered = out.pop();
|
3104 |
|
3105 | if (suspended) {
|
3106 | suspended = false;
|
3107 |
|
3108 | var _fallbackFrame = frame.fallbackFrame;
|
3109 | !_fallbackFrame ? invariant(false, 'suspense fallback not found, something is broken') : void 0;
|
3110 | this.stack.push(_fallbackFrame);
|
3111 |
|
3112 | continue;
|
3113 | } else {
|
3114 | out[this.suspenseDepth] += buffered;
|
3115 | }
|
3116 | }
|
3117 |
|
3118 |
|
3119 | out[this.suspenseDepth] += _footer;
|
3120 | continue;
|
3121 | }
|
3122 | var child = frame.children[frame.childIndex++];
|
3123 |
|
3124 | var outBuffer = '';
|
3125 | {
|
3126 | pushCurrentDebugStack(this.stack);
|
3127 |
|
3128 | frame.debugElementStack.length = 0;
|
3129 | }
|
3130 | try {
|
3131 | outBuffer += this.render(child, frame.context, frame.domNamespace);
|
3132 | } catch (err) {
|
3133 | if (enableSuspenseServerRenderer && typeof err.then === 'function') {
|
3134 | suspended = true;
|
3135 | } else {
|
3136 | throw err;
|
3137 | }
|
3138 | } finally {
|
3139 | {
|
3140 | popCurrentDebugStack();
|
3141 | }
|
3142 | }
|
3143 | if (out.length <= this.suspenseDepth) {
|
3144 | out.push('');
|
3145 | }
|
3146 | out[this.suspenseDepth] += outBuffer;
|
3147 | }
|
3148 | return out[0];
|
3149 | } finally {
|
3150 | ReactCurrentDispatcher.current = prevDispatcher;
|
3151 | setCurrentThreadID(prevThreadID);
|
3152 | }
|
3153 | };
|
3154 |
|
3155 | ReactDOMServerRenderer.prototype.render = function render(child, context, parentNamespace) {
|
3156 | if (typeof child === 'string' || typeof child === 'number') {
|
3157 | var text = '' + child;
|
3158 | if (text === '') {
|
3159 | return '';
|
3160 | }
|
3161 | if (this.makeStaticMarkup) {
|
3162 | return escapeTextForBrowser(text);
|
3163 | }
|
3164 | if (this.previousWasTextNode) {
|
3165 | return '<!-- -->' + escapeTextForBrowser(text);
|
3166 | }
|
3167 | this.previousWasTextNode = true;
|
3168 | return escapeTextForBrowser(text);
|
3169 | } else {
|
3170 | var nextChild = void 0;
|
3171 |
|
3172 | var _resolve = resolve(child, context, this.threadID);
|
3173 |
|
3174 | nextChild = _resolve.child;
|
3175 | context = _resolve.context;
|
3176 |
|
3177 | if (nextChild === null || nextChild === false) {
|
3178 | return '';
|
3179 | } else if (!React.isValidElement(nextChild)) {
|
3180 | if (nextChild != null && nextChild.$$typeof != null) {
|
3181 |
|
3182 | var $$typeof = nextChild.$$typeof;
|
3183 | !($$typeof !== REACT_PORTAL_TYPE) ? invariant(false, 'Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.') : void 0;
|
3184 |
|
3185 | invariant(false, 'Unknown element-like object type: %s. This is likely a bug in React. Please file an issue.', $$typeof.toString());
|
3186 | }
|
3187 | var nextChildren = toArray(nextChild);
|
3188 | var frame = {
|
3189 | type: null,
|
3190 | domNamespace: parentNamespace,
|
3191 | children: nextChildren,
|
3192 | childIndex: 0,
|
3193 | context: context,
|
3194 | footer: ''
|
3195 | };
|
3196 | {
|
3197 | frame.debugElementStack = [];
|
3198 | }
|
3199 | this.stack.push(frame);
|
3200 | return '';
|
3201 | }
|
3202 |
|
3203 | var nextElement = nextChild;
|
3204 | var elementType = nextElement.type;
|
3205 |
|
3206 | if (typeof elementType === 'string') {
|
3207 | return this.renderDOM(nextElement, context, parentNamespace);
|
3208 | }
|
3209 |
|
3210 | switch (elementType) {
|
3211 | case REACT_STRICT_MODE_TYPE:
|
3212 | case REACT_CONCURRENT_MODE_TYPE:
|
3213 | case REACT_PROFILER_TYPE:
|
3214 | case REACT_FRAGMENT_TYPE:
|
3215 | {
|
3216 | var _nextChildren = toArray(nextChild.props.children);
|
3217 | var _frame = {
|
3218 | type: null,
|
3219 | domNamespace: parentNamespace,
|
3220 | children: _nextChildren,
|
3221 | childIndex: 0,
|
3222 | context: context,
|
3223 | footer: ''
|
3224 | };
|
3225 | {
|
3226 | _frame.debugElementStack = [];
|
3227 | }
|
3228 | this.stack.push(_frame);
|
3229 | return '';
|
3230 | }
|
3231 | case REACT_SUSPENSE_TYPE:
|
3232 | {
|
3233 | if (enableSuspenseServerRenderer) {
|
3234 | var fallbackChildren = toArray(nextChild.props.fallback);
|
3235 | var _nextChildren2 = toArray(nextChild.props.children);
|
3236 | var _fallbackFrame2 = {
|
3237 | type: null,
|
3238 | domNamespace: parentNamespace,
|
3239 | children: fallbackChildren,
|
3240 | childIndex: 0,
|
3241 | context: context,
|
3242 | footer: '',
|
3243 | out: ''
|
3244 | };
|
3245 | var _frame2 = {
|
3246 | fallbackFrame: _fallbackFrame2,
|
3247 | type: REACT_SUSPENSE_TYPE,
|
3248 | domNamespace: parentNamespace,
|
3249 | children: _nextChildren2,
|
3250 | childIndex: 0,
|
3251 | context: context,
|
3252 | footer: ''
|
3253 | };
|
3254 | {
|
3255 | _frame2.debugElementStack = [];
|
3256 | _fallbackFrame2.debugElementStack = [];
|
3257 | }
|
3258 | this.stack.push(_frame2);
|
3259 | this.suspenseDepth++;
|
3260 | return '';
|
3261 | } else {
|
3262 | invariant(false, 'ReactDOMServer does not yet support Suspense.');
|
3263 | }
|
3264 | }
|
3265 |
|
3266 | default:
|
3267 | break;
|
3268 | }
|
3269 | if (typeof elementType === 'object' && elementType !== null) {
|
3270 | switch (elementType.$$typeof) {
|
3271 | case REACT_FORWARD_REF_TYPE:
|
3272 | {
|
3273 | var element = nextChild;
|
3274 | var _nextChildren3 = void 0;
|
3275 | var componentIdentity = {};
|
3276 | prepareToUseHooks(componentIdentity);
|
3277 | _nextChildren3 = elementType.render(element.props, element.ref);
|
3278 | _nextChildren3 = finishHooks(elementType.render, element.props, _nextChildren3, element.ref);
|
3279 | _nextChildren3 = toArray(_nextChildren3);
|
3280 | var _frame3 = {
|
3281 | type: null,
|
3282 | domNamespace: parentNamespace,
|
3283 | children: _nextChildren3,
|
3284 | childIndex: 0,
|
3285 | context: context,
|
3286 | footer: ''
|
3287 | };
|
3288 | {
|
3289 | _frame3.debugElementStack = [];
|
3290 | }
|
3291 | this.stack.push(_frame3);
|
3292 | return '';
|
3293 | }
|
3294 | case REACT_MEMO_TYPE:
|
3295 | {
|
3296 | var _element = nextChild;
|
3297 | var _nextChildren4 = [React.createElement(elementType.type, _assign({ ref: _element.ref }, _element.props))];
|
3298 | var _frame4 = {
|
3299 | type: null,
|
3300 | domNamespace: parentNamespace,
|
3301 | children: _nextChildren4,
|
3302 | childIndex: 0,
|
3303 | context: context,
|
3304 | footer: ''
|
3305 | };
|
3306 | {
|
3307 | _frame4.debugElementStack = [];
|
3308 | }
|
3309 | this.stack.push(_frame4);
|
3310 | return '';
|
3311 | }
|
3312 | case REACT_PROVIDER_TYPE:
|
3313 | {
|
3314 | var provider = nextChild;
|
3315 | var nextProps = provider.props;
|
3316 | var _nextChildren5 = toArray(nextProps.children);
|
3317 | var _frame5 = {
|
3318 | type: provider,
|
3319 | domNamespace: parentNamespace,
|
3320 | children: _nextChildren5,
|
3321 | childIndex: 0,
|
3322 | context: context,
|
3323 | footer: ''
|
3324 | };
|
3325 | {
|
3326 | _frame5.debugElementStack = [];
|
3327 | }
|
3328 |
|
3329 | this.pushProvider(provider);
|
3330 |
|
3331 | this.stack.push(_frame5);
|
3332 | return '';
|
3333 | }
|
3334 | case REACT_CONTEXT_TYPE:
|
3335 | {
|
3336 | var reactContext = nextChild.type;
|
3337 |
|
3338 |
|
3339 |
|
3340 |
|
3341 |
|
3342 |
|
3343 |
|
3344 | {
|
3345 | if (reactContext._context === undefined) {
|
3346 |
|
3347 |
|
3348 |
|
3349 | if (reactContext !== reactContext.Consumer) {
|
3350 | if (!hasWarnedAboutUsingContextAsConsumer) {
|
3351 | hasWarnedAboutUsingContextAsConsumer = true;
|
3352 | warning$1(false, 'Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
3353 | }
|
3354 | }
|
3355 | } else {
|
3356 | reactContext = reactContext._context;
|
3357 | }
|
3358 | }
|
3359 | var _nextProps = nextChild.props;
|
3360 | var threadID = this.threadID;
|
3361 | validateContextBounds(reactContext, threadID);
|
3362 | var nextValue = reactContext[threadID];
|
3363 |
|
3364 | var _nextChildren6 = toArray(_nextProps.children(nextValue));
|
3365 | var _frame6 = {
|
3366 | type: nextChild,
|
3367 | domNamespace: parentNamespace,
|
3368 | children: _nextChildren6,
|
3369 | childIndex: 0,
|
3370 | context: context,
|
3371 | footer: ''
|
3372 | };
|
3373 | {
|
3374 | _frame6.debugElementStack = [];
|
3375 | }
|
3376 | this.stack.push(_frame6);
|
3377 | return '';
|
3378 | }
|
3379 | case REACT_LAZY_TYPE:
|
3380 | invariant(false, 'ReactDOMServer does not yet support lazy-loaded components.');
|
3381 | }
|
3382 | }
|
3383 |
|
3384 | var info = '';
|
3385 | {
|
3386 | var owner = nextElement._owner;
|
3387 | if (elementType === undefined || typeof elementType === 'object' && elementType !== null && Object.keys(elementType).length === 0) {
|
3388 | info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.';
|
3389 | }
|
3390 | var ownerName = owner ? getComponentName(owner) : null;
|
3391 | if (ownerName) {
|
3392 | info += '\n\nCheck the render method of `' + ownerName + '`.';
|
3393 | }
|
3394 | }
|
3395 | invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', elementType == null ? elementType : typeof elementType, info);
|
3396 | }
|
3397 | };
|
3398 |
|
3399 | ReactDOMServerRenderer.prototype.renderDOM = function renderDOM(element, context, parentNamespace) {
|
3400 | var tag = element.type.toLowerCase();
|
3401 |
|
3402 | var namespace = parentNamespace;
|
3403 | if (parentNamespace === Namespaces.html) {
|
3404 | namespace = getIntrinsicNamespace(tag);
|
3405 | }
|
3406 |
|
3407 | {
|
3408 | if (namespace === Namespaces.html) {
|
3409 |
|
3410 |
|
3411 | !(tag === element.type) ? warning$1(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', element.type) : void 0;
|
3412 | }
|
3413 | }
|
3414 |
|
3415 | validateDangerousTag(tag);
|
3416 |
|
3417 | var props = element.props;
|
3418 | if (tag === 'input') {
|
3419 | {
|
3420 | ReactControlledValuePropTypes.checkPropTypes('input', props);
|
3421 |
|
3422 | if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnDefaultChecked) {
|
3423 | warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', 'A component', props.type);
|
3424 | didWarnDefaultChecked = true;
|
3425 | }
|
3426 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultInputValue) {
|
3427 | warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', 'A component', props.type);
|
3428 | didWarnDefaultInputValue = true;
|
3429 | }
|
3430 | }
|
3431 |
|
3432 | props = _assign({
|
3433 | type: undefined
|
3434 | }, props, {
|
3435 | defaultChecked: undefined,
|
3436 | defaultValue: undefined,
|
3437 | value: props.value != null ? props.value : props.defaultValue,
|
3438 | checked: props.checked != null ? props.checked : props.defaultChecked
|
3439 | });
|
3440 | } else if (tag === 'textarea') {
|
3441 | {
|
3442 | ReactControlledValuePropTypes.checkPropTypes('textarea', props);
|
3443 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultTextareaValue) {
|
3444 | warning$1(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
|
3445 | didWarnDefaultTextareaValue = true;
|
3446 | }
|
3447 | }
|
3448 |
|
3449 | var initialValue = props.value;
|
3450 | if (initialValue == null) {
|
3451 | var defaultValue = props.defaultValue;
|
3452 |
|
3453 | var textareaChildren = props.children;
|
3454 | if (textareaChildren != null) {
|
3455 | {
|
3456 | warning$1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
|
3457 | }
|
3458 | !(defaultValue == null) ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : void 0;
|
3459 | if (Array.isArray(textareaChildren)) {
|
3460 | !(textareaChildren.length <= 1) ? invariant(false, '<textarea> can only have at most one child.') : void 0;
|
3461 | textareaChildren = textareaChildren[0];
|
3462 | }
|
3463 |
|
3464 | defaultValue = '' + textareaChildren;
|
3465 | }
|
3466 | if (defaultValue == null) {
|
3467 | defaultValue = '';
|
3468 | }
|
3469 | initialValue = defaultValue;
|
3470 | }
|
3471 |
|
3472 | props = _assign({}, props, {
|
3473 | value: undefined,
|
3474 | children: '' + initialValue
|
3475 | });
|
3476 | } else if (tag === 'select') {
|
3477 | {
|
3478 | ReactControlledValuePropTypes.checkPropTypes('select', props);
|
3479 |
|
3480 | for (var i = 0; i < valuePropNames.length; i++) {
|
3481 | var propName = valuePropNames[i];
|
3482 | if (props[propName] == null) {
|
3483 | continue;
|
3484 | }
|
3485 | var isArray = Array.isArray(props[propName]);
|
3486 | if (props.multiple && !isArray) {
|
3487 | warning$1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.', propName);
|
3488 | } else if (!props.multiple && isArray) {
|
3489 | warning$1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.', propName);
|
3490 | }
|
3491 | }
|
3492 |
|
3493 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultSelectValue) {
|
3494 | warning$1(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
|
3495 | didWarnDefaultSelectValue = true;
|
3496 | }
|
3497 | }
|
3498 | this.currentSelectValue = props.value != null ? props.value : props.defaultValue;
|
3499 | props = _assign({}, props, {
|
3500 | value: undefined
|
3501 | });
|
3502 | } else if (tag === 'option') {
|
3503 | var selected = null;
|
3504 | var selectValue = this.currentSelectValue;
|
3505 | var optionChildren = flattenOptionChildren(props.children);
|
3506 | if (selectValue != null) {
|
3507 | var value = void 0;
|
3508 | if (props.value != null) {
|
3509 | value = props.value + '';
|
3510 | } else {
|
3511 | value = optionChildren;
|
3512 | }
|
3513 | selected = false;
|
3514 | if (Array.isArray(selectValue)) {
|
3515 |
|
3516 | for (var j = 0; j < selectValue.length; j++) {
|
3517 | if ('' + selectValue[j] === value) {
|
3518 | selected = true;
|
3519 | break;
|
3520 | }
|
3521 | }
|
3522 | } else {
|
3523 | selected = '' + selectValue === value;
|
3524 | }
|
3525 |
|
3526 | props = _assign({
|
3527 | selected: undefined,
|
3528 | children: undefined
|
3529 | }, props, {
|
3530 | selected: selected,
|
3531 | children: optionChildren
|
3532 | });
|
3533 | }
|
3534 | }
|
3535 |
|
3536 | {
|
3537 | validatePropertiesInDevelopment(tag, props);
|
3538 | }
|
3539 |
|
3540 | assertValidProps(tag, props);
|
3541 |
|
3542 | var out = createOpenTagMarkup(element.type, tag, props, namespace, this.makeStaticMarkup, this.stack.length === 1);
|
3543 | var footer = '';
|
3544 | if (omittedCloseTags.hasOwnProperty(tag)) {
|
3545 | out += '/>';
|
3546 | } else {
|
3547 | out += '>';
|
3548 | footer = '</' + element.type + '>';
|
3549 | }
|
3550 | var children = void 0;
|
3551 | var innerMarkup = getNonChildrenInnerMarkup(props);
|
3552 | if (innerMarkup != null) {
|
3553 | children = [];
|
3554 | if (newlineEatingTags[tag] && innerMarkup.charAt(0) === '\n') {
|
3555 |
|
3556 |
|
3557 |
|
3558 |
|
3559 |
|
3560 |
|
3561 |
|
3562 |
|
3563 |
|
3564 |
|
3565 | out += '\n';
|
3566 | }
|
3567 | out += innerMarkup;
|
3568 | } else {
|
3569 | children = toArray(props.children);
|
3570 | }
|
3571 | var frame = {
|
3572 | domNamespace: getChildNamespace(parentNamespace, element.type),
|
3573 | type: tag,
|
3574 | children: children,
|
3575 | childIndex: 0,
|
3576 | context: context,
|
3577 | footer: footer
|
3578 | };
|
3579 | {
|
3580 | frame.debugElementStack = [];
|
3581 | }
|
3582 | this.stack.push(frame);
|
3583 | this.previousWasTextNode = false;
|
3584 | return out;
|
3585 | };
|
3586 |
|
3587 | return ReactDOMServerRenderer;
|
3588 | }();
|
3589 |
|
3590 |
|
3591 |
|
3592 |
|
3593 |
|
3594 |
|
3595 | function renderToString(element) {
|
3596 | var renderer = new ReactDOMServerRenderer(element, false);
|
3597 | try {
|
3598 | var markup = renderer.read(Infinity);
|
3599 | return markup;
|
3600 | } finally {
|
3601 | renderer.destroy();
|
3602 | }
|
3603 | }
|
3604 |
|
3605 |
|
3606 |
|
3607 |
|
3608 |
|
3609 |
|
3610 | function renderToStaticMarkup(element) {
|
3611 | var renderer = new ReactDOMServerRenderer(element, true);
|
3612 | try {
|
3613 | var markup = renderer.read(Infinity);
|
3614 | return markup;
|
3615 | } finally {
|
3616 | renderer.destroy();
|
3617 | }
|
3618 | }
|
3619 |
|
3620 | function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3621 |
|
3622 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
3623 |
|
3624 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
3625 |
|
3626 |
|
3627 |
|
3628 | var ReactMarkupReadableStream = function (_Readable) {
|
3629 | _inherits(ReactMarkupReadableStream, _Readable);
|
3630 |
|
3631 | function ReactMarkupReadableStream(element, makeStaticMarkup) {
|
3632 | _classCallCheck$1(this, ReactMarkupReadableStream);
|
3633 |
|
3634 | var _this = _possibleConstructorReturn(this, _Readable.call(this, {}));
|
3635 |
|
3636 |
|
3637 |
|
3638 |
|
3639 | _this.partialRenderer = new ReactDOMServerRenderer(element, makeStaticMarkup);
|
3640 | return _this;
|
3641 | }
|
3642 |
|
3643 | ReactMarkupReadableStream.prototype._destroy = function _destroy(err, callback) {
|
3644 | this.partialRenderer.destroy();
|
3645 | callback(err);
|
3646 | };
|
3647 |
|
3648 | ReactMarkupReadableStream.prototype._read = function _read(size) {
|
3649 | try {
|
3650 | this.push(this.partialRenderer.read(size));
|
3651 | } catch (err) {
|
3652 | this.destroy(err);
|
3653 | }
|
3654 | };
|
3655 |
|
3656 | return ReactMarkupReadableStream;
|
3657 | }(stream.Readable);
|
3658 |
|
3659 |
|
3660 |
|
3661 |
|
3662 |
|
3663 |
|
3664 |
|
3665 | function renderToNodeStream(element) {
|
3666 | return new ReactMarkupReadableStream(element, false);
|
3667 | }
|
3668 |
|
3669 |
|
3670 |
|
3671 |
|
3672 |
|
3673 |
|
3674 | function renderToStaticNodeStream(element) {
|
3675 | return new ReactMarkupReadableStream(element, true);
|
3676 | }
|
3677 |
|
3678 |
|
3679 | var ReactDOMServerNode = {
|
3680 | renderToString: renderToString,
|
3681 | renderToStaticMarkup: renderToStaticMarkup,
|
3682 | renderToNodeStream: renderToNodeStream,
|
3683 | renderToStaticNodeStream: renderToStaticNodeStream,
|
3684 | version: ReactVersion
|
3685 | };
|
3686 |
|
3687 | var ReactDOMServerNode$1 = Object.freeze({
|
3688 | default: ReactDOMServerNode
|
3689 | });
|
3690 |
|
3691 | var ReactDOMServer = ( ReactDOMServerNode$1 && ReactDOMServerNode ) || ReactDOMServerNode$1;
|
3692 |
|
3693 |
|
3694 |
|
3695 | var server_node = ReactDOMServer.default || ReactDOMServer;
|
3696 |
|
3697 | module.exports = server_node;
|
3698 | })();
|
3699 | }
|