1 | require=(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
2 | function _assertThisInitialized(self) {
|
3 | if (self === void 0) {
|
4 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
5 | }
|
6 |
|
7 | return self;
|
8 | }
|
9 |
|
10 | module.exports = _assertThisInitialized;
|
11 | },{}],2:[function(require,module,exports){
|
12 | function _extends() {
|
13 | module.exports = _extends = Object.assign || function (target) {
|
14 | for (var i = 1; i < arguments.length; i++) {
|
15 | var source = arguments[i];
|
16 |
|
17 | for (var key in source) {
|
18 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
19 | target[key] = source[key];
|
20 | }
|
21 | }
|
22 | }
|
23 |
|
24 | return target;
|
25 | };
|
26 |
|
27 | return _extends.apply(this, arguments);
|
28 | }
|
29 |
|
30 | module.exports = _extends;
|
31 | },{}],3:[function(require,module,exports){
|
32 | function _inheritsLoose(subClass, superClass) {
|
33 | subClass.prototype = Object.create(superClass.prototype);
|
34 | subClass.prototype.constructor = subClass;
|
35 | subClass.__proto__ = superClass;
|
36 | }
|
37 |
|
38 | module.exports = _inheritsLoose;
|
39 | },{}],4:[function(require,module,exports){
|
40 | function _interopRequireDefault(obj) {
|
41 | return obj && obj.__esModule ? obj : {
|
42 | default: obj
|
43 | };
|
44 | }
|
45 |
|
46 | module.exports = _interopRequireDefault;
|
47 | },{}],5:[function(require,module,exports){
|
48 | function _interopRequireWildcard(obj) {
|
49 | if (obj && obj.__esModule) {
|
50 | return obj;
|
51 | } else {
|
52 | var newObj = {};
|
53 |
|
54 | if (obj != null) {
|
55 | for (var key in obj) {
|
56 | if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
57 | var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
|
58 |
|
59 | if (desc.get || desc.set) {
|
60 | Object.defineProperty(newObj, key, desc);
|
61 | } else {
|
62 | newObj[key] = obj[key];
|
63 | }
|
64 | }
|
65 | }
|
66 | }
|
67 |
|
68 | newObj.default = obj;
|
69 | return newObj;
|
70 | }
|
71 | }
|
72 |
|
73 | module.exports = _interopRequireWildcard;
|
74 | },{}],6:[function(require,module,exports){
|
75 | function _objectWithoutPropertiesLoose(source, excluded) {
|
76 | if (source == null) return {};
|
77 | var target = {};
|
78 | var sourceKeys = Object.keys(source);
|
79 | var key, i;
|
80 |
|
81 | for (i = 0; i < sourceKeys.length; i++) {
|
82 | key = sourceKeys[i];
|
83 | if (excluded.indexOf(key) >= 0) continue;
|
84 | target[key] = source[key];
|
85 | }
|
86 |
|
87 | return target;
|
88 | }
|
89 |
|
90 | module.exports = _objectWithoutPropertiesLoose;
|
91 | },{}],7:[function(require,module,exports){
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 | function debounce(func, wait, immediate){
|
107 | var timeout, args, context, timestamp, result;
|
108 | if (null == wait) wait = 100;
|
109 |
|
110 | function later() {
|
111 | var last = Date.now() - timestamp;
|
112 |
|
113 | if (last < wait && last >= 0) {
|
114 | timeout = setTimeout(later, wait - last);
|
115 | } else {
|
116 | timeout = null;
|
117 | if (!immediate) {
|
118 | result = func.apply(context, args);
|
119 | context = args = null;
|
120 | }
|
121 | }
|
122 | };
|
123 |
|
124 | var debounced = function(){
|
125 | context = this;
|
126 | args = arguments;
|
127 | timestamp = Date.now();
|
128 | var callNow = immediate && !timeout;
|
129 | if (!timeout) timeout = setTimeout(later, wait);
|
130 | if (callNow) {
|
131 | result = func.apply(context, args);
|
132 | context = args = null;
|
133 | }
|
134 |
|
135 | return result;
|
136 | };
|
137 |
|
138 | debounced.clear = function() {
|
139 | if (timeout) {
|
140 | clearTimeout(timeout);
|
141 | timeout = null;
|
142 | }
|
143 | };
|
144 |
|
145 | debounced.flush = function() {
|
146 | if (timeout) {
|
147 | result = func.apply(context, args);
|
148 | context = args = null;
|
149 |
|
150 | clearTimeout(timeout);
|
151 | timeout = null;
|
152 | }
|
153 | };
|
154 |
|
155 | return debounced;
|
156 | };
|
157 |
|
158 |
|
159 | debounce.debounce = debounce;
|
160 |
|
161 | module.exports = debounce;
|
162 |
|
163 | },{}],8:[function(require,module,exports){
|
164 | (function (global){
|
165 |
|
166 |
|
167 |
|
168 |
|
169 | ;(function(root, factory) {
|
170 | 'use strict';
|
171 | if (typeof define === 'function' && define.amd) {
|
172 |
|
173 | define([], function() {
|
174 | return factory();
|
175 | });
|
176 | } else if (typeof exports === 'object') {
|
177 |
|
178 |
|
179 |
|
180 | module.exports = factory();
|
181 | } else {
|
182 |
|
183 | root.DeepDiff = factory();
|
184 | }
|
185 | }(this, function(undefined) {
|
186 | 'use strict';
|
187 |
|
188 | var $scope, conflict, conflictResolution = [];
|
189 | if (typeof global === 'object' && global) {
|
190 | $scope = global;
|
191 | } else if (typeof window !== 'undefined') {
|
192 | $scope = window;
|
193 | } else {
|
194 | $scope = {};
|
195 | }
|
196 | conflict = $scope.DeepDiff;
|
197 | if (conflict) {
|
198 | conflictResolution.push(
|
199 | function() {
|
200 | if ('undefined' !== typeof conflict && $scope.DeepDiff === accumulateDiff) {
|
201 | $scope.DeepDiff = conflict;
|
202 | conflict = undefined;
|
203 | }
|
204 | });
|
205 | }
|
206 |
|
207 |
|
208 | function inherits(ctor, superCtor) {
|
209 | ctor.super_ = superCtor;
|
210 | ctor.prototype = Object.create(superCtor.prototype, {
|
211 | constructor: {
|
212 | value: ctor,
|
213 | enumerable: false,
|
214 | writable: true,
|
215 | configurable: true
|
216 | }
|
217 | });
|
218 | }
|
219 |
|
220 | function Diff(kind, path) {
|
221 | Object.defineProperty(this, 'kind', {
|
222 | value: kind,
|
223 | enumerable: true
|
224 | });
|
225 | if (path && path.length) {
|
226 | Object.defineProperty(this, 'path', {
|
227 | value: path,
|
228 | enumerable: true
|
229 | });
|
230 | }
|
231 | }
|
232 |
|
233 | function DiffEdit(path, origin, value) {
|
234 | DiffEdit.super_.call(this, 'E', path);
|
235 | Object.defineProperty(this, 'lhs', {
|
236 | value: origin,
|
237 | enumerable: true
|
238 | });
|
239 | Object.defineProperty(this, 'rhs', {
|
240 | value: value,
|
241 | enumerable: true
|
242 | });
|
243 | }
|
244 | inherits(DiffEdit, Diff);
|
245 |
|
246 | function DiffNew(path, value) {
|
247 | DiffNew.super_.call(this, 'N', path);
|
248 | Object.defineProperty(this, 'rhs', {
|
249 | value: value,
|
250 | enumerable: true
|
251 | });
|
252 | }
|
253 | inherits(DiffNew, Diff);
|
254 |
|
255 | function DiffDeleted(path, value) {
|
256 | DiffDeleted.super_.call(this, 'D', path);
|
257 | Object.defineProperty(this, 'lhs', {
|
258 | value: value,
|
259 | enumerable: true
|
260 | });
|
261 | }
|
262 | inherits(DiffDeleted, Diff);
|
263 |
|
264 | function DiffArray(path, index, item) {
|
265 | DiffArray.super_.call(this, 'A', path);
|
266 | Object.defineProperty(this, 'index', {
|
267 | value: index,
|
268 | enumerable: true
|
269 | });
|
270 | Object.defineProperty(this, 'item', {
|
271 | value: item,
|
272 | enumerable: true
|
273 | });
|
274 | }
|
275 | inherits(DiffArray, Diff);
|
276 |
|
277 | function arrayRemove(arr, from, to) {
|
278 | var rest = arr.slice((to || from) + 1 || arr.length);
|
279 | arr.length = from < 0 ? arr.length + from : from;
|
280 | arr.push.apply(arr, rest);
|
281 | return arr;
|
282 | }
|
283 |
|
284 | function realTypeOf(subject) {
|
285 | var type = typeof subject;
|
286 | if (type !== 'object') {
|
287 | return type;
|
288 | }
|
289 |
|
290 | if (subject === Math) {
|
291 | return 'math';
|
292 | } else if (subject === null) {
|
293 | return 'null';
|
294 | } else if (Array.isArray(subject)) {
|
295 | return 'array';
|
296 | } else if (Object.prototype.toString.call(subject) === '[object Date]') {
|
297 | return 'date';
|
298 | } else if (typeof subject.toString !== 'undefined' && /^\/.*\//.test(subject.toString())) {
|
299 | return 'regexp';
|
300 | }
|
301 | return 'object';
|
302 | }
|
303 |
|
304 | function deepDiff(lhs, rhs, changes, prefilter, path, key, stack) {
|
305 | path = path || [];
|
306 | var currentPath = path.slice(0);
|
307 | if (typeof key !== 'undefined') {
|
308 | if (prefilter) {
|
309 | if (typeof(prefilter) === 'function' && prefilter(currentPath, key)) { return; }
|
310 | else if (typeof(prefilter) === 'object') {
|
311 | if (prefilter.prefilter && prefilter.prefilter(currentPath, key)) { return; }
|
312 | if (prefilter.normalize) {
|
313 | var alt = prefilter.normalize(currentPath, key, lhs, rhs);
|
314 | if (alt) {
|
315 | lhs = alt[0];
|
316 | rhs = alt[1];
|
317 | }
|
318 | }
|
319 | }
|
320 | }
|
321 | currentPath.push(key);
|
322 | }
|
323 |
|
324 |
|
325 | if (realTypeOf(lhs) === 'regexp' && realTypeOf(rhs) === 'regexp') {
|
326 | lhs = lhs.toString();
|
327 | rhs = rhs.toString();
|
328 | }
|
329 |
|
330 | var ltype = typeof lhs;
|
331 | var rtype = typeof rhs;
|
332 | if (ltype === 'undefined') {
|
333 | if (rtype !== 'undefined') {
|
334 | changes(new DiffNew(currentPath, rhs));
|
335 | }
|
336 | } else if (rtype === 'undefined') {
|
337 | changes(new DiffDeleted(currentPath, lhs));
|
338 | } else if (realTypeOf(lhs) !== realTypeOf(rhs)) {
|
339 | changes(new DiffEdit(currentPath, lhs, rhs));
|
340 | } else if (Object.prototype.toString.call(lhs) === '[object Date]' && Object.prototype.toString.call(rhs) === '[object Date]' && ((lhs - rhs) !== 0)) {
|
341 | changes(new DiffEdit(currentPath, lhs, rhs));
|
342 | } else if (ltype === 'object' && lhs !== null && rhs !== null) {
|
343 | stack = stack || [];
|
344 | if (stack.indexOf(lhs) < 0) {
|
345 | stack.push(lhs);
|
346 | if (Array.isArray(lhs)) {
|
347 | var i, len = lhs.length;
|
348 | for (i = 0; i < lhs.length; i++) {
|
349 | if (i >= rhs.length) {
|
350 | changes(new DiffArray(currentPath, i, new DiffDeleted(undefined, lhs[i])));
|
351 | } else {
|
352 | deepDiff(lhs[i], rhs[i], changes, prefilter, currentPath, i, stack);
|
353 | }
|
354 | }
|
355 | while (i < rhs.length) {
|
356 | changes(new DiffArray(currentPath, i, new DiffNew(undefined, rhs[i++])));
|
357 | }
|
358 | } else {
|
359 | var akeys = Object.keys(lhs);
|
360 | var pkeys = Object.keys(rhs);
|
361 | akeys.forEach(function(k, i) {
|
362 | var other = pkeys.indexOf(k);
|
363 | if (other >= 0) {
|
364 | deepDiff(lhs[k], rhs[k], changes, prefilter, currentPath, k, stack);
|
365 | pkeys = arrayRemove(pkeys, other);
|
366 | } else {
|
367 | deepDiff(lhs[k], undefined, changes, prefilter, currentPath, k, stack);
|
368 | }
|
369 | });
|
370 | pkeys.forEach(function(k) {
|
371 | deepDiff(undefined, rhs[k], changes, prefilter, currentPath, k, stack);
|
372 | });
|
373 | }
|
374 | stack.length = stack.length - 1;
|
375 | }
|
376 | } else if (lhs !== rhs) {
|
377 | if (!(ltype === 'number' && isNaN(lhs) && isNaN(rhs))) {
|
378 | changes(new DiffEdit(currentPath, lhs, rhs));
|
379 | }
|
380 | }
|
381 | }
|
382 |
|
383 | function accumulateDiff(lhs, rhs, prefilter, accum) {
|
384 | accum = accum || [];
|
385 | deepDiff(lhs, rhs,
|
386 | function(diff) {
|
387 | if (diff) {
|
388 | accum.push(diff);
|
389 | }
|
390 | },
|
391 | prefilter);
|
392 | return (accum.length) ? accum : undefined;
|
393 | }
|
394 |
|
395 | function applyArrayChange(arr, index, change) {
|
396 | if (change.path && change.path.length) {
|
397 | var it = arr[index],
|
398 | i, u = change.path.length - 1;
|
399 | for (i = 0; i < u; i++) {
|
400 | it = it[change.path[i]];
|
401 | }
|
402 | switch (change.kind) {
|
403 | case 'A':
|
404 | applyArrayChange(it[change.path[i]], change.index, change.item);
|
405 | break;
|
406 | case 'D':
|
407 | delete it[change.path[i]];
|
408 | break;
|
409 | case 'E':
|
410 | case 'N':
|
411 | it[change.path[i]] = change.rhs;
|
412 | break;
|
413 | }
|
414 | } else {
|
415 | switch (change.kind) {
|
416 | case 'A':
|
417 | applyArrayChange(arr[index], change.index, change.item);
|
418 | break;
|
419 | case 'D':
|
420 | arr = arrayRemove(arr, index);
|
421 | break;
|
422 | case 'E':
|
423 | case 'N':
|
424 | arr[index] = change.rhs;
|
425 | break;
|
426 | }
|
427 | }
|
428 | return arr;
|
429 | }
|
430 |
|
431 | function applyChange(target, source, change) {
|
432 | if (target && source && change && change.kind) {
|
433 | var it = target,
|
434 | i = -1,
|
435 | last = change.path ? change.path.length - 1 : 0;
|
436 | while (++i < last) {
|
437 | if (typeof it[change.path[i]] === 'undefined') {
|
438 | it[change.path[i]] = (typeof change.path[i] === 'number') ? [] : {};
|
439 | }
|
440 | it = it[change.path[i]];
|
441 | }
|
442 | switch (change.kind) {
|
443 | case 'A':
|
444 | applyArrayChange(change.path ? it[change.path[i]] : it, change.index, change.item);
|
445 | break;
|
446 | case 'D':
|
447 | delete it[change.path[i]];
|
448 | break;
|
449 | case 'E':
|
450 | case 'N':
|
451 | it[change.path[i]] = change.rhs;
|
452 | break;
|
453 | }
|
454 | }
|
455 | }
|
456 |
|
457 | function revertArrayChange(arr, index, change) {
|
458 | if (change.path && change.path.length) {
|
459 |
|
460 | var it = arr[index],
|
461 | i, u = change.path.length - 1;
|
462 | for (i = 0; i < u; i++) {
|
463 | it = it[change.path[i]];
|
464 | }
|
465 | switch (change.kind) {
|
466 | case 'A':
|
467 | revertArrayChange(it[change.path[i]], change.index, change.item);
|
468 | break;
|
469 | case 'D':
|
470 | it[change.path[i]] = change.lhs;
|
471 | break;
|
472 | case 'E':
|
473 | it[change.path[i]] = change.lhs;
|
474 | break;
|
475 | case 'N':
|
476 | delete it[change.path[i]];
|
477 | break;
|
478 | }
|
479 | } else {
|
480 |
|
481 | switch (change.kind) {
|
482 | case 'A':
|
483 | revertArrayChange(arr[index], change.index, change.item);
|
484 | break;
|
485 | case 'D':
|
486 | arr[index] = change.lhs;
|
487 | break;
|
488 | case 'E':
|
489 | arr[index] = change.lhs;
|
490 | break;
|
491 | case 'N':
|
492 | arr = arrayRemove(arr, index);
|
493 | break;
|
494 | }
|
495 | }
|
496 | return arr;
|
497 | }
|
498 |
|
499 | function revertChange(target, source, change) {
|
500 | if (target && source && change && change.kind) {
|
501 | var it = target,
|
502 | i, u;
|
503 | u = change.path.length - 1;
|
504 | for (i = 0; i < u; i++) {
|
505 | if (typeof it[change.path[i]] === 'undefined') {
|
506 | it[change.path[i]] = {};
|
507 | }
|
508 | it = it[change.path[i]];
|
509 | }
|
510 | switch (change.kind) {
|
511 | case 'A':
|
512 |
|
513 |
|
514 | revertArrayChange(it[change.path[i]], change.index, change.item);
|
515 | break;
|
516 | case 'D':
|
517 |
|
518 | it[change.path[i]] = change.lhs;
|
519 | break;
|
520 | case 'E':
|
521 |
|
522 | it[change.path[i]] = change.lhs;
|
523 | break;
|
524 | case 'N':
|
525 |
|
526 | delete it[change.path[i]];
|
527 | break;
|
528 | }
|
529 | }
|
530 | }
|
531 |
|
532 | function applyDiff(target, source, filter) {
|
533 | if (target && source) {
|
534 | var onChange = function(change) {
|
535 | if (!filter || filter(target, source, change)) {
|
536 | applyChange(target, source, change);
|
537 | }
|
538 | };
|
539 | deepDiff(target, source, onChange);
|
540 | }
|
541 | }
|
542 |
|
543 | Object.defineProperties(accumulateDiff, {
|
544 |
|
545 | diff: {
|
546 | value: accumulateDiff,
|
547 | enumerable: true
|
548 | },
|
549 | observableDiff: {
|
550 | value: deepDiff,
|
551 | enumerable: true
|
552 | },
|
553 | applyDiff: {
|
554 | value: applyDiff,
|
555 | enumerable: true
|
556 | },
|
557 | applyChange: {
|
558 | value: applyChange,
|
559 | enumerable: true
|
560 | },
|
561 | revertChange: {
|
562 | value: revertChange,
|
563 | enumerable: true
|
564 | },
|
565 | isConflict: {
|
566 | value: function() {
|
567 | return 'undefined' !== typeof conflict;
|
568 | },
|
569 | enumerable: true
|
570 | },
|
571 | noConflict: {
|
572 | value: function() {
|
573 | if (conflictResolution) {
|
574 | conflictResolution.forEach(function(it) {
|
575 | it();
|
576 | });
|
577 | conflictResolution = null;
|
578 | }
|
579 | return accumulateDiff;
|
580 | },
|
581 | enumerable: true
|
582 | }
|
583 | });
|
584 |
|
585 | return accumulateDiff;
|
586 | }));
|
587 |
|
588 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
589 |
|
590 | },{}],9:[function(require,module,exports){
|
591 | 'use strict';
|
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 | var ReactIs = require('react-is');
|
598 | var REACT_STATICS = {
|
599 | childContextTypes: true,
|
600 | contextType: true,
|
601 | contextTypes: true,
|
602 | defaultProps: true,
|
603 | displayName: true,
|
604 | getDefaultProps: true,
|
605 | getDerivedStateFromError: true,
|
606 | getDerivedStateFromProps: true,
|
607 | mixins: true,
|
608 | propTypes: true,
|
609 | type: true
|
610 | };
|
611 |
|
612 | var KNOWN_STATICS = {
|
613 | name: true,
|
614 | length: true,
|
615 | prototype: true,
|
616 | caller: true,
|
617 | callee: true,
|
618 | arguments: true,
|
619 | arity: true
|
620 | };
|
621 |
|
622 | var FORWARD_REF_STATICS = {
|
623 | '$$typeof': true,
|
624 | render: true,
|
625 | defaultProps: true,
|
626 | displayName: true,
|
627 | propTypes: true
|
628 | };
|
629 |
|
630 | var MEMO_STATICS = {
|
631 | '$$typeof': true,
|
632 | compare: true,
|
633 | defaultProps: true,
|
634 | displayName: true,
|
635 | propTypes: true,
|
636 | type: true
|
637 | };
|
638 |
|
639 | var TYPE_STATICS = {};
|
640 | TYPE_STATICS[ReactIs.ForwardRef] = FORWARD_REF_STATICS;
|
641 |
|
642 | function getStatics(component) {
|
643 | if (ReactIs.isMemo(component)) {
|
644 | return MEMO_STATICS;
|
645 | }
|
646 | return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
|
647 | }
|
648 |
|
649 | var defineProperty = Object.defineProperty;
|
650 | var getOwnPropertyNames = Object.getOwnPropertyNames;
|
651 | var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
652 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
653 | var getPrototypeOf = Object.getPrototypeOf;
|
654 | var objectPrototype = Object.prototype;
|
655 |
|
656 | function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
657 | if (typeof sourceComponent !== 'string') {
|
658 |
|
659 |
|
660 | if (objectPrototype) {
|
661 | var inheritedComponent = getPrototypeOf(sourceComponent);
|
662 | if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
663 | hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
664 | }
|
665 | }
|
666 |
|
667 | var keys = getOwnPropertyNames(sourceComponent);
|
668 |
|
669 | if (getOwnPropertySymbols) {
|
670 | keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
671 | }
|
672 |
|
673 | var targetStatics = getStatics(targetComponent);
|
674 | var sourceStatics = getStatics(sourceComponent);
|
675 |
|
676 | for (var i = 0; i < keys.length; ++i) {
|
677 | var key = keys[i];
|
678 | if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
|
679 | var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
680 | try {
|
681 |
|
682 | defineProperty(targetComponent, key, descriptor);
|
683 | } catch (e) {}
|
684 | }
|
685 | }
|
686 |
|
687 | return targetComponent;
|
688 | }
|
689 |
|
690 | return targetComponent;
|
691 | }
|
692 |
|
693 | module.exports = hoistNonReactStatics;
|
694 |
|
695 | },{"react-is":33}],10:[function(require,module,exports){
|
696 | function merge(a, b) {
|
697 | var r = {};
|
698 | for (var i=0;i<a.length;++i) {
|
699 | r[a[i]] = b[i];
|
700 | }
|
701 | return r;
|
702 | }
|
703 |
|
704 | function Houkou(pattern, cfg) {
|
705 | if (!(this instanceof Houkou)) {
|
706 | return new Houkou(pattern, cfg);
|
707 | }
|
708 |
|
709 | var self = this;
|
710 |
|
711 | this.cfg = cfg || {};
|
712 | this.cfg.requirements || (this.cfg.requirements = {});
|
713 | this.cfg.defaults || (this.cfg.defaults = {});
|
714 | this.cfg.paramChar || (this.cfg.paramChar = ':');
|
715 |
|
716 | var paramRegx = new RegExp(this.cfg.paramChar + '([a-z_]+)', 'gi');
|
717 |
|
718 | this.parameters = (pattern.match(paramRegx) || []).map(function(p) { return p.substr(1); });
|
719 | this.pattern = new RegExp(("^" + pattern.replace(/\//g, "\\/").replace(/\./g, "\\.").replace(paramRegx, function(m,t) { return "(" + (self.cfg.requirements[t] || ".+?") + ")"; }) + "$"));
|
720 | this.build = new Function("v", 'return !this.validate(v) ? false : "' + pattern.replace(paramRegx, '" + ((typeof v["$1"] !== "undefined" && v["$1"] !== null) ? v["$1"] : this.cfg.defaults["$1"]) + "') + '";');
|
721 | }
|
722 |
|
723 | Houkou.prototype.validate = function(params) {
|
724 | for (var param in params) {
|
725 | if (!params.hasOwnProperty(param) || !this.cfg.requirements[param]) {
|
726 | continue;
|
727 | }
|
728 | if (!RegExp(this.cfg.requirements[param]).test(params[param])) {
|
729 | return false;
|
730 | }
|
731 | }
|
732 | return true;
|
733 | };
|
734 |
|
735 | Houkou.prototype.match = function(url) {
|
736 | var matches;
|
737 |
|
738 | if (matches = this.pattern.exec(url)) {
|
739 | matches.shift();
|
740 | return merge(this.parameters, matches);
|
741 | }
|
742 |
|
743 | return false;
|
744 | };
|
745 |
|
746 | (typeof module === "object") && (module.exports = Houkou);
|
747 |
|
748 | },{}],11:[function(require,module,exports){
|
749 |
|
750 |
|
751 |
|
752 |
|
753 |
|
754 |
|
755 |
|
756 | 'use strict';
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 |
|
769 | var invariant = function(condition, format, a, b, c, d, e, f) {
|
770 | if ("development" !== 'production') {
|
771 | if (format === undefined) {
|
772 | throw new Error('invariant requires an error message argument');
|
773 | }
|
774 | }
|
775 |
|
776 | if (!condition) {
|
777 | var error;
|
778 | if (format === undefined) {
|
779 | error = new Error(
|
780 | 'Minified exception occurred; use the non-minified dev environment ' +
|
781 | 'for the full error message and additional helpful warnings.'
|
782 | );
|
783 | } else {
|
784 | var args = [a, b, c, d, e, f];
|
785 | var argIndex = 0;
|
786 | error = new Error(
|
787 | format.replace(/%s/g, function() { return args[argIndex++]; })
|
788 | );
|
789 | error.name = 'Invariant Violation';
|
790 | }
|
791 |
|
792 | error.framesToPop = 1;
|
793 | throw error;
|
794 | }
|
795 | };
|
796 |
|
797 | module.exports = invariant;
|
798 |
|
799 | },{}],12:[function(require,module,exports){
|
800 | var root = require('./_root');
|
801 |
|
802 |
|
803 | var Symbol = root.Symbol;
|
804 |
|
805 | module.exports = Symbol;
|
806 |
|
807 | },{"./_root":19}],13:[function(require,module,exports){
|
808 | var Symbol = require('./_Symbol'),
|
809 | getRawTag = require('./_getRawTag'),
|
810 | objectToString = require('./_objectToString');
|
811 |
|
812 |
|
813 | var nullTag = '[object Null]',
|
814 | undefinedTag = '[object Undefined]';
|
815 |
|
816 |
|
817 | var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
818 |
|
819 |
|
820 |
|
821 |
|
822 |
|
823 |
|
824 |
|
825 |
|
826 | function baseGetTag(value) {
|
827 | if (value == null) {
|
828 | return value === undefined ? undefinedTag : nullTag;
|
829 | }
|
830 | return (symToStringTag && symToStringTag in Object(value))
|
831 | ? getRawTag(value)
|
832 | : objectToString(value);
|
833 | }
|
834 |
|
835 | module.exports = baseGetTag;
|
836 |
|
837 | },{"./_Symbol":12,"./_getRawTag":16,"./_objectToString":17}],14:[function(require,module,exports){
|
838 | (function (global){
|
839 |
|
840 | var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
841 |
|
842 | module.exports = freeGlobal;
|
843 |
|
844 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
845 |
|
846 | },{}],15:[function(require,module,exports){
|
847 | var overArg = require('./_overArg');
|
848 |
|
849 |
|
850 | var getPrototype = overArg(Object.getPrototypeOf, Object);
|
851 |
|
852 | module.exports = getPrototype;
|
853 |
|
854 | },{"./_overArg":18}],16:[function(require,module,exports){
|
855 | var Symbol = require('./_Symbol');
|
856 |
|
857 |
|
858 | var objectProto = Object.prototype;
|
859 |
|
860 |
|
861 | var hasOwnProperty = objectProto.hasOwnProperty;
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 | var nativeObjectToString = objectProto.toString;
|
869 |
|
870 |
|
871 | var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
872 |
|
873 |
|
874 |
|
875 |
|
876 |
|
877 |
|
878 |
|
879 |
|
880 | function getRawTag(value) {
|
881 | var isOwn = hasOwnProperty.call(value, symToStringTag),
|
882 | tag = value[symToStringTag];
|
883 |
|
884 | try {
|
885 | value[symToStringTag] = undefined;
|
886 | var unmasked = true;
|
887 | } catch (e) {}
|
888 |
|
889 | var result = nativeObjectToString.call(value);
|
890 | if (unmasked) {
|
891 | if (isOwn) {
|
892 | value[symToStringTag] = tag;
|
893 | } else {
|
894 | delete value[symToStringTag];
|
895 | }
|
896 | }
|
897 | return result;
|
898 | }
|
899 |
|
900 | module.exports = getRawTag;
|
901 |
|
902 | },{"./_Symbol":12}],17:[function(require,module,exports){
|
903 |
|
904 | var objectProto = Object.prototype;
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
|
910 |
|
911 | var nativeObjectToString = objectProto.toString;
|
912 |
|
913 |
|
914 |
|
915 |
|
916 |
|
917 |
|
918 |
|
919 |
|
920 | function objectToString(value) {
|
921 | return nativeObjectToString.call(value);
|
922 | }
|
923 |
|
924 | module.exports = objectToString;
|
925 |
|
926 | },{}],18:[function(require,module,exports){
|
927 |
|
928 |
|
929 |
|
930 |
|
931 |
|
932 |
|
933 |
|
934 |
|
935 | function overArg(func, transform) {
|
936 | return function(arg) {
|
937 | return func(transform(arg));
|
938 | };
|
939 | }
|
940 |
|
941 | module.exports = overArg;
|
942 |
|
943 | },{}],19:[function(require,module,exports){
|
944 | var freeGlobal = require('./_freeGlobal');
|
945 |
|
946 |
|
947 | var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
948 |
|
949 |
|
950 | var root = freeGlobal || freeSelf || Function('return this')();
|
951 |
|
952 | module.exports = root;
|
953 |
|
954 | },{"./_freeGlobal":14}],20:[function(require,module,exports){
|
955 |
|
956 |
|
957 |
|
958 |
|
959 |
|
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
965 |
|
966 |
|
967 |
|
968 |
|
969 |
|
970 |
|
971 |
|
972 |
|
973 |
|
974 |
|
975 |
|
976 |
|
977 |
|
978 |
|
979 | function isObjectLike(value) {
|
980 | return value != null && typeof value == 'object';
|
981 | }
|
982 |
|
983 | module.exports = isObjectLike;
|
984 |
|
985 | },{}],21:[function(require,module,exports){
|
986 | var baseGetTag = require('./_baseGetTag'),
|
987 | getPrototype = require('./_getPrototype'),
|
988 | isObjectLike = require('./isObjectLike');
|
989 |
|
990 |
|
991 | var objectTag = '[object Object]';
|
992 |
|
993 |
|
994 | var funcProto = Function.prototype,
|
995 | objectProto = Object.prototype;
|
996 |
|
997 |
|
998 | var funcToString = funcProto.toString;
|
999 |
|
1000 |
|
1001 | var hasOwnProperty = objectProto.hasOwnProperty;
|
1002 |
|
1003 |
|
1004 | var objectCtorString = funcToString.call(Object);
|
1005 |
|
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 |
|
1025 |
|
1026 |
|
1027 |
|
1028 |
|
1029 |
|
1030 |
|
1031 |
|
1032 |
|
1033 |
|
1034 | function isPlainObject(value) {
|
1035 | if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
1036 | return false;
|
1037 | }
|
1038 | var proto = getPrototype(value);
|
1039 | if (proto === null) {
|
1040 | return true;
|
1041 | }
|
1042 | var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
1043 | return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
1044 | funcToString.call(Ctor) == objectCtorString;
|
1045 | }
|
1046 |
|
1047 | module.exports = isPlainObject;
|
1048 |
|
1049 | },{"./_baseGetTag":13,"./_getPrototype":15,"./isObjectLike":20}],22:[function(require,module,exports){
|
1050 | 'use strict';
|
1051 |
|
1052 | var id = 1;
|
1053 |
|
1054 | function index () {
|
1055 | return "" + id++;
|
1056 | }
|
1057 |
|
1058 | module.exports = index;
|
1059 | },{}],23:[function(require,module,exports){
|
1060 |
|
1061 |
|
1062 |
|
1063 |
|
1064 |
|
1065 |
|
1066 | 'use strict';
|
1067 |
|
1068 | var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
1069 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
1070 | var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
1071 |
|
1072 | function toObject(val) {
|
1073 | if (val === null || val === undefined) {
|
1074 | throw new TypeError('Object.assign cannot be called with null or undefined');
|
1075 | }
|
1076 |
|
1077 | return Object(val);
|
1078 | }
|
1079 |
|
1080 | function shouldUseNative() {
|
1081 | try {
|
1082 | if (!Object.assign) {
|
1083 | return false;
|
1084 | }
|
1085 |
|
1086 |
|
1087 |
|
1088 |
|
1089 | var test1 = new String('abc');
|
1090 | test1[5] = 'de';
|
1091 | if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
1092 | return false;
|
1093 | }
|
1094 |
|
1095 |
|
1096 | var test2 = {};
|
1097 | for (var i = 0; i < 10; i++) {
|
1098 | test2['_' + String.fromCharCode(i)] = i;
|
1099 | }
|
1100 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
1101 | return test2[n];
|
1102 | });
|
1103 | if (order2.join('') !== '0123456789') {
|
1104 | return false;
|
1105 | }
|
1106 |
|
1107 |
|
1108 | var test3 = {};
|
1109 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
1110 | test3[letter] = letter;
|
1111 | });
|
1112 | if (Object.keys(Object.assign({}, test3)).join('') !==
|
1113 | 'abcdefghijklmnopqrst') {
|
1114 | return false;
|
1115 | }
|
1116 |
|
1117 | return true;
|
1118 | } catch (err) {
|
1119 |
|
1120 | return false;
|
1121 | }
|
1122 | }
|
1123 |
|
1124 | module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
1125 | var from;
|
1126 | var to = toObject(target);
|
1127 | var symbols;
|
1128 |
|
1129 | for (var s = 1; s < arguments.length; s++) {
|
1130 | from = Object(arguments[s]);
|
1131 |
|
1132 | for (var key in from) {
|
1133 | if (hasOwnProperty.call(from, key)) {
|
1134 | to[key] = from[key];
|
1135 | }
|
1136 | }
|
1137 |
|
1138 | if (getOwnPropertySymbols) {
|
1139 | symbols = getOwnPropertySymbols(from);
|
1140 | for (var i = 0; i < symbols.length; i++) {
|
1141 | if (propIsEnumerable.call(from, symbols[i])) {
|
1142 | to[symbols[i]] = from[symbols[i]];
|
1143 | }
|
1144 | }
|
1145 | }
|
1146 | }
|
1147 |
|
1148 | return to;
|
1149 | };
|
1150 |
|
1151 | },{}],24:[function(require,module,exports){
|
1152 |
|
1153 | var process = module.exports = {};
|
1154 |
|
1155 |
|
1156 |
|
1157 |
|
1158 |
|
1159 |
|
1160 | var cachedSetTimeout;
|
1161 | var cachedClearTimeout;
|
1162 |
|
1163 | function defaultSetTimout() {
|
1164 | throw new Error('setTimeout has not been defined');
|
1165 | }
|
1166 | function defaultClearTimeout () {
|
1167 | throw new Error('clearTimeout has not been defined');
|
1168 | }
|
1169 | (function () {
|
1170 | try {
|
1171 | if (typeof setTimeout === 'function') {
|
1172 | cachedSetTimeout = setTimeout;
|
1173 | } else {
|
1174 | cachedSetTimeout = defaultSetTimout;
|
1175 | }
|
1176 | } catch (e) {
|
1177 | cachedSetTimeout = defaultSetTimout;
|
1178 | }
|
1179 | try {
|
1180 | if (typeof clearTimeout === 'function') {
|
1181 | cachedClearTimeout = clearTimeout;
|
1182 | } else {
|
1183 | cachedClearTimeout = defaultClearTimeout;
|
1184 | }
|
1185 | } catch (e) {
|
1186 | cachedClearTimeout = defaultClearTimeout;
|
1187 | }
|
1188 | } ())
|
1189 | function runTimeout(fun) {
|
1190 | if (cachedSetTimeout === setTimeout) {
|
1191 |
|
1192 | return setTimeout(fun, 0);
|
1193 | }
|
1194 |
|
1195 | if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
1196 | cachedSetTimeout = setTimeout;
|
1197 | return setTimeout(fun, 0);
|
1198 | }
|
1199 | try {
|
1200 |
|
1201 | return cachedSetTimeout(fun, 0);
|
1202 | } catch(e){
|
1203 | try {
|
1204 |
|
1205 | return cachedSetTimeout.call(null, fun, 0);
|
1206 | } catch(e){
|
1207 |
|
1208 | return cachedSetTimeout.call(this, fun, 0);
|
1209 | }
|
1210 | }
|
1211 |
|
1212 |
|
1213 | }
|
1214 | function runClearTimeout(marker) {
|
1215 | if (cachedClearTimeout === clearTimeout) {
|
1216 |
|
1217 | return clearTimeout(marker);
|
1218 | }
|
1219 |
|
1220 | if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
1221 | cachedClearTimeout = clearTimeout;
|
1222 | return clearTimeout(marker);
|
1223 | }
|
1224 | try {
|
1225 |
|
1226 | return cachedClearTimeout(marker);
|
1227 | } catch (e){
|
1228 | try {
|
1229 |
|
1230 | return cachedClearTimeout.call(null, marker);
|
1231 | } catch (e){
|
1232 |
|
1233 |
|
1234 | return cachedClearTimeout.call(this, marker);
|
1235 | }
|
1236 | }
|
1237 |
|
1238 |
|
1239 |
|
1240 | }
|
1241 | var queue = [];
|
1242 | var draining = false;
|
1243 | var currentQueue;
|
1244 | var queueIndex = -1;
|
1245 |
|
1246 | function cleanUpNextTick() {
|
1247 | if (!draining || !currentQueue) {
|
1248 | return;
|
1249 | }
|
1250 | draining = false;
|
1251 | if (currentQueue.length) {
|
1252 | queue = currentQueue.concat(queue);
|
1253 | } else {
|
1254 | queueIndex = -1;
|
1255 | }
|
1256 | if (queue.length) {
|
1257 | drainQueue();
|
1258 | }
|
1259 | }
|
1260 |
|
1261 | function drainQueue() {
|
1262 | if (draining) {
|
1263 | return;
|
1264 | }
|
1265 | var timeout = runTimeout(cleanUpNextTick);
|
1266 | draining = true;
|
1267 |
|
1268 | var len = queue.length;
|
1269 | while(len) {
|
1270 | currentQueue = queue;
|
1271 | queue = [];
|
1272 | while (++queueIndex < len) {
|
1273 | if (currentQueue) {
|
1274 | currentQueue[queueIndex].run();
|
1275 | }
|
1276 | }
|
1277 | queueIndex = -1;
|
1278 | len = queue.length;
|
1279 | }
|
1280 | currentQueue = null;
|
1281 | draining = false;
|
1282 | runClearTimeout(timeout);
|
1283 | }
|
1284 |
|
1285 | process.nextTick = function (fun) {
|
1286 | var args = new Array(arguments.length - 1);
|
1287 | if (arguments.length > 1) {
|
1288 | for (var i = 1; i < arguments.length; i++) {
|
1289 | args[i - 1] = arguments[i];
|
1290 | }
|
1291 | }
|
1292 | queue.push(new Item(fun, args));
|
1293 | if (queue.length === 1 && !draining) {
|
1294 | runTimeout(drainQueue);
|
1295 | }
|
1296 | };
|
1297 |
|
1298 |
|
1299 | function Item(fun, array) {
|
1300 | this.fun = fun;
|
1301 | this.array = array;
|
1302 | }
|
1303 | Item.prototype.run = function () {
|
1304 | this.fun.apply(null, this.array);
|
1305 | };
|
1306 | process.title = 'browser';
|
1307 | process.browser = true;
|
1308 | process.env = {};
|
1309 | process.argv = [];
|
1310 | process.version = '';
|
1311 | process.versions = {};
|
1312 |
|
1313 | function noop() {}
|
1314 |
|
1315 | process.on = noop;
|
1316 | process.addListener = noop;
|
1317 | process.once = noop;
|
1318 | process.off = noop;
|
1319 | process.removeListener = noop;
|
1320 | process.removeAllListeners = noop;
|
1321 | process.emit = noop;
|
1322 | process.prependListener = noop;
|
1323 | process.prependOnceListener = noop;
|
1324 |
|
1325 | process.listeners = function (name) { return [] }
|
1326 |
|
1327 | process.binding = function (name) {
|
1328 | throw new Error('process.binding is not supported');
|
1329 | };
|
1330 |
|
1331 | process.cwd = function () { return '/' };
|
1332 | process.chdir = function (dir) {
|
1333 | throw new Error('process.chdir is not supported');
|
1334 | };
|
1335 | process.umask = function() { return 0; };
|
1336 |
|
1337 | },{}],25:[function(require,module,exports){
|
1338 |
|
1339 |
|
1340 |
|
1341 |
|
1342 |
|
1343 |
|
1344 |
|
1345 | 'use strict';
|
1346 |
|
1347 | var printWarning = function() {};
|
1348 |
|
1349 | if ("development" !== 'production') {
|
1350 | var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
|
1351 | var loggedTypeFailures = {};
|
1352 |
|
1353 | printWarning = function(text) {
|
1354 | var message = 'Warning: ' + text;
|
1355 | if (typeof console !== 'undefined') {
|
1356 | console.error(message);
|
1357 | }
|
1358 | try {
|
1359 |
|
1360 |
|
1361 |
|
1362 | throw new Error(message);
|
1363 | } catch (x) {}
|
1364 | };
|
1365 | }
|
1366 |
|
1367 |
|
1368 |
|
1369 |
|
1370 |
|
1371 |
|
1372 |
|
1373 |
|
1374 |
|
1375 |
|
1376 |
|
1377 |
|
1378 | function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
1379 | if ("development" !== 'production') {
|
1380 | for (var typeSpecName in typeSpecs) {
|
1381 | if (typeSpecs.hasOwnProperty(typeSpecName)) {
|
1382 | var error;
|
1383 |
|
1384 |
|
1385 |
|
1386 | try {
|
1387 |
|
1388 |
|
1389 | if (typeof typeSpecs[typeSpecName] !== 'function') {
|
1390 | var err = Error(
|
1391 | (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
1392 | 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
1393 | );
|
1394 | err.name = 'Invariant Violation';
|
1395 | throw err;
|
1396 | }
|
1397 | error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
1398 | } catch (ex) {
|
1399 | error = ex;
|
1400 | }
|
1401 | if (error && !(error instanceof Error)) {
|
1402 | printWarning(
|
1403 | (componentName || 'React class') + ': type specification of ' +
|
1404 | location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
1405 | 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
1406 | 'You may have forgotten to pass an argument to the type checker ' +
|
1407 | 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
1408 | 'shape all require an argument).'
|
1409 | )
|
1410 |
|
1411 | }
|
1412 | if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
1413 |
|
1414 |
|
1415 | loggedTypeFailures[error.message] = true;
|
1416 |
|
1417 | var stack = getStack ? getStack() : '';
|
1418 |
|
1419 | printWarning(
|
1420 | 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
1421 | );
|
1422 | }
|
1423 | }
|
1424 | }
|
1425 | }
|
1426 | }
|
1427 |
|
1428 | module.exports = checkPropTypes;
|
1429 |
|
1430 | },{"./lib/ReactPropTypesSecret":28}],26:[function(require,module,exports){
|
1431 |
|
1432 |
|
1433 |
|
1434 |
|
1435 |
|
1436 |
|
1437 |
|
1438 | 'use strict';
|
1439 |
|
1440 | var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
|
1441 |
|
1442 | function emptyFunction() {}
|
1443 |
|
1444 | module.exports = function() {
|
1445 | function shim(props, propName, componentName, location, propFullName, secret) {
|
1446 | if (secret === ReactPropTypesSecret) {
|
1447 |
|
1448 | return;
|
1449 | }
|
1450 | var err = new Error(
|
1451 | 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
1452 | 'Use PropTypes.checkPropTypes() to call them. ' +
|
1453 | 'Read more at http://fb.me/use-check-prop-types'
|
1454 | );
|
1455 | err.name = 'Invariant Violation';
|
1456 | throw err;
|
1457 | };
|
1458 | shim.isRequired = shim;
|
1459 | function getShim() {
|
1460 | return shim;
|
1461 | };
|
1462 |
|
1463 |
|
1464 | var ReactPropTypes = {
|
1465 | array: shim,
|
1466 | bool: shim,
|
1467 | func: shim,
|
1468 | number: shim,
|
1469 | object: shim,
|
1470 | string: shim,
|
1471 | symbol: shim,
|
1472 |
|
1473 | any: shim,
|
1474 | arrayOf: getShim,
|
1475 | element: shim,
|
1476 | instanceOf: getShim,
|
1477 | node: shim,
|
1478 | objectOf: getShim,
|
1479 | oneOf: getShim,
|
1480 | oneOfType: getShim,
|
1481 | shape: getShim,
|
1482 | exact: getShim
|
1483 | };
|
1484 |
|
1485 | ReactPropTypes.checkPropTypes = emptyFunction;
|
1486 | ReactPropTypes.PropTypes = ReactPropTypes;
|
1487 |
|
1488 | return ReactPropTypes;
|
1489 | };
|
1490 |
|
1491 | },{"./lib/ReactPropTypesSecret":28}],27:[function(require,module,exports){
|
1492 |
|
1493 |
|
1494 |
|
1495 |
|
1496 |
|
1497 |
|
1498 |
|
1499 | 'use strict';
|
1500 |
|
1501 | var assign = require('object-assign');
|
1502 |
|
1503 | var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');
|
1504 | var checkPropTypes = require('./checkPropTypes');
|
1505 |
|
1506 | var printWarning = function() {};
|
1507 |
|
1508 | if ("development" !== 'production') {
|
1509 | printWarning = function(text) {
|
1510 | var message = 'Warning: ' + text;
|
1511 | if (typeof console !== 'undefined') {
|
1512 | console.error(message);
|
1513 | }
|
1514 | try {
|
1515 |
|
1516 |
|
1517 |
|
1518 | throw new Error(message);
|
1519 | } catch (x) {}
|
1520 | };
|
1521 | }
|
1522 |
|
1523 | function emptyFunctionThatReturnsNull() {
|
1524 | return null;
|
1525 | }
|
1526 |
|
1527 | module.exports = function(isValidElement, throwOnDirectAccess) {
|
1528 |
|
1529 | var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
1530 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
1531 |
|
1532 | |
1533 |
|
1534 |
|
1535 |
|
1536 |
|
1537 |
|
1538 |
|
1539 |
|
1540 |
|
1541 |
|
1542 |
|
1543 |
|
1544 |
|
1545 |
|
1546 | function getIteratorFn(maybeIterable) {
|
1547 | var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
1548 | if (typeof iteratorFn === 'function') {
|
1549 | return iteratorFn;
|
1550 | }
|
1551 | }
|
1552 |
|
1553 | |
1554 |
|
1555 |
|
1556 |
|
1557 |
|
1558 |
|
1559 |
|
1560 |
|
1561 |
|
1562 |
|
1563 |
|
1564 |
|
1565 |
|
1566 |
|
1567 |
|
1568 |
|
1569 |
|
1570 |
|
1571 |
|
1572 |
|
1573 |
|
1574 |
|
1575 |
|
1576 |
|
1577 |
|
1578 |
|
1579 |
|
1580 |
|
1581 |
|
1582 |
|
1583 |
|
1584 |
|
1585 |
|
1586 |
|
1587 |
|
1588 |
|
1589 |
|
1590 |
|
1591 |
|
1592 |
|
1593 |
|
1594 |
|
1595 |
|
1596 |
|
1597 |
|
1598 |
|
1599 |
|
1600 | var ANONYMOUS = '<<anonymous>>';
|
1601 |
|
1602 |
|
1603 |
|
1604 | var ReactPropTypes = {
|
1605 | array: createPrimitiveTypeChecker('array'),
|
1606 | bool: createPrimitiveTypeChecker('boolean'),
|
1607 | func: createPrimitiveTypeChecker('function'),
|
1608 | number: createPrimitiveTypeChecker('number'),
|
1609 | object: createPrimitiveTypeChecker('object'),
|
1610 | string: createPrimitiveTypeChecker('string'),
|
1611 | symbol: createPrimitiveTypeChecker('symbol'),
|
1612 |
|
1613 | any: createAnyTypeChecker(),
|
1614 | arrayOf: createArrayOfTypeChecker,
|
1615 | element: createElementTypeChecker(),
|
1616 | instanceOf: createInstanceTypeChecker,
|
1617 | node: createNodeChecker(),
|
1618 | objectOf: createObjectOfTypeChecker,
|
1619 | oneOf: createEnumTypeChecker,
|
1620 | oneOfType: createUnionTypeChecker,
|
1621 | shape: createShapeTypeChecker,
|
1622 | exact: createStrictShapeTypeChecker,
|
1623 | };
|
1624 |
|
1625 | |
1626 |
|
1627 |
|
1628 |
|
1629 |
|
1630 | function is(x, y) {
|
1631 |
|
1632 | if (x === y) {
|
1633 |
|
1634 |
|
1635 | return x !== 0 || 1 / x === 1 / y;
|
1636 | } else {
|
1637 |
|
1638 | return x !== x && y !== y;
|
1639 | }
|
1640 | }
|
1641 |
|
1642 |
|
1643 | |
1644 |
|
1645 |
|
1646 |
|
1647 |
|
1648 |
|
1649 |
|
1650 | function PropTypeError(message) {
|
1651 | this.message = message;
|
1652 | this.stack = '';
|
1653 | }
|
1654 |
|
1655 | PropTypeError.prototype = Error.prototype;
|
1656 |
|
1657 | function createChainableTypeChecker(validate) {
|
1658 | if ("development" !== 'production') {
|
1659 | var manualPropTypeCallCache = {};
|
1660 | var manualPropTypeWarningCount = 0;
|
1661 | }
|
1662 | function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
1663 | componentName = componentName || ANONYMOUS;
|
1664 | propFullName = propFullName || propName;
|
1665 |
|
1666 | if (secret !== ReactPropTypesSecret) {
|
1667 | if (throwOnDirectAccess) {
|
1668 |
|
1669 | var err = new Error(
|
1670 | 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
1671 | 'Use `PropTypes.checkPropTypes()` to call them. ' +
|
1672 | 'Read more at http://fb.me/use-check-prop-types'
|
1673 | );
|
1674 | err.name = 'Invariant Violation';
|
1675 | throw err;
|
1676 | } else if ("development" !== 'production' && typeof console !== 'undefined') {
|
1677 |
|
1678 | var cacheKey = componentName + ':' + propName;
|
1679 | if (
|
1680 | !manualPropTypeCallCache[cacheKey] &&
|
1681 |
|
1682 | manualPropTypeWarningCount < 3
|
1683 | ) {
|
1684 | printWarning(
|
1685 | 'You are manually calling a React.PropTypes validation ' +
|
1686 | 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
1687 | 'and will throw in the standalone `prop-types` package. ' +
|
1688 | 'You may be seeing this warning due to a third-party PropTypes ' +
|
1689 | 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
1690 | );
|
1691 | manualPropTypeCallCache[cacheKey] = true;
|
1692 | manualPropTypeWarningCount++;
|
1693 | }
|
1694 | }
|
1695 | }
|
1696 | if (props[propName] == null) {
|
1697 | if (isRequired) {
|
1698 | if (props[propName] === null) {
|
1699 | return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
1700 | }
|
1701 | return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
1702 | }
|
1703 | return null;
|
1704 | } else {
|
1705 | return validate(props, propName, componentName, location, propFullName);
|
1706 | }
|
1707 | }
|
1708 |
|
1709 | var chainedCheckType = checkType.bind(null, false);
|
1710 | chainedCheckType.isRequired = checkType.bind(null, true);
|
1711 |
|
1712 | return chainedCheckType;
|
1713 | }
|
1714 |
|
1715 | function createPrimitiveTypeChecker(expectedType) {
|
1716 | function validate(props, propName, componentName, location, propFullName, secret) {
|
1717 | var propValue = props[propName];
|
1718 | var propType = getPropType(propValue);
|
1719 | if (propType !== expectedType) {
|
1720 |
|
1721 |
|
1722 |
|
1723 | var preciseType = getPreciseType(propValue);
|
1724 |
|
1725 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
1726 | }
|
1727 | return null;
|
1728 | }
|
1729 | return createChainableTypeChecker(validate);
|
1730 | }
|
1731 |
|
1732 | function createAnyTypeChecker() {
|
1733 | return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
1734 | }
|
1735 |
|
1736 | function createArrayOfTypeChecker(typeChecker) {
|
1737 | function validate(props, propName, componentName, location, propFullName) {
|
1738 | if (typeof typeChecker !== 'function') {
|
1739 | return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
1740 | }
|
1741 | var propValue = props[propName];
|
1742 | if (!Array.isArray(propValue)) {
|
1743 | var propType = getPropType(propValue);
|
1744 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
1745 | }
|
1746 | for (var i = 0; i < propValue.length; i++) {
|
1747 | var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
1748 | if (error instanceof Error) {
|
1749 | return error;
|
1750 | }
|
1751 | }
|
1752 | return null;
|
1753 | }
|
1754 | return createChainableTypeChecker(validate);
|
1755 | }
|
1756 |
|
1757 | function createElementTypeChecker() {
|
1758 | function validate(props, propName, componentName, location, propFullName) {
|
1759 | var propValue = props[propName];
|
1760 | if (!isValidElement(propValue)) {
|
1761 | var propType = getPropType(propValue);
|
1762 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
1763 | }
|
1764 | return null;
|
1765 | }
|
1766 | return createChainableTypeChecker(validate);
|
1767 | }
|
1768 |
|
1769 | function createInstanceTypeChecker(expectedClass) {
|
1770 | function validate(props, propName, componentName, location, propFullName) {
|
1771 | if (!(props[propName] instanceof expectedClass)) {
|
1772 | var expectedClassName = expectedClass.name || ANONYMOUS;
|
1773 | var actualClassName = getClassName(props[propName]);
|
1774 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
1775 | }
|
1776 | return null;
|
1777 | }
|
1778 | return createChainableTypeChecker(validate);
|
1779 | }
|
1780 |
|
1781 | function createEnumTypeChecker(expectedValues) {
|
1782 | if (!Array.isArray(expectedValues)) {
|
1783 | "development" !== 'production' ? printWarning('Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
|
1784 | return emptyFunctionThatReturnsNull;
|
1785 | }
|
1786 |
|
1787 | function validate(props, propName, componentName, location, propFullName) {
|
1788 | var propValue = props[propName];
|
1789 | for (var i = 0; i < expectedValues.length; i++) {
|
1790 | if (is(propValue, expectedValues[i])) {
|
1791 | return null;
|
1792 | }
|
1793 | }
|
1794 |
|
1795 | var valuesString = JSON.stringify(expectedValues);
|
1796 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
1797 | }
|
1798 | return createChainableTypeChecker(validate);
|
1799 | }
|
1800 |
|
1801 | function createObjectOfTypeChecker(typeChecker) {
|
1802 | function validate(props, propName, componentName, location, propFullName) {
|
1803 | if (typeof typeChecker !== 'function') {
|
1804 | return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
1805 | }
|
1806 | var propValue = props[propName];
|
1807 | var propType = getPropType(propValue);
|
1808 | if (propType !== 'object') {
|
1809 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
1810 | }
|
1811 | for (var key in propValue) {
|
1812 | if (propValue.hasOwnProperty(key)) {
|
1813 | var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
1814 | if (error instanceof Error) {
|
1815 | return error;
|
1816 | }
|
1817 | }
|
1818 | }
|
1819 | return null;
|
1820 | }
|
1821 | return createChainableTypeChecker(validate);
|
1822 | }
|
1823 |
|
1824 | function createUnionTypeChecker(arrayOfTypeCheckers) {
|
1825 | if (!Array.isArray(arrayOfTypeCheckers)) {
|
1826 | "development" !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
1827 | return emptyFunctionThatReturnsNull;
|
1828 | }
|
1829 |
|
1830 | for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
1831 | var checker = arrayOfTypeCheckers[i];
|
1832 | if (typeof checker !== 'function') {
|
1833 | printWarning(
|
1834 | 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
1835 | 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
1836 | );
|
1837 | return emptyFunctionThatReturnsNull;
|
1838 | }
|
1839 | }
|
1840 |
|
1841 | function validate(props, propName, componentName, location, propFullName) {
|
1842 | for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
1843 | var checker = arrayOfTypeCheckers[i];
|
1844 | if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
|
1845 | return null;
|
1846 | }
|
1847 | }
|
1848 |
|
1849 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
1850 | }
|
1851 | return createChainableTypeChecker(validate);
|
1852 | }
|
1853 |
|
1854 | function createNodeChecker() {
|
1855 | function validate(props, propName, componentName, location, propFullName) {
|
1856 | if (!isNode(props[propName])) {
|
1857 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
1858 | }
|
1859 | return null;
|
1860 | }
|
1861 | return createChainableTypeChecker(validate);
|
1862 | }
|
1863 |
|
1864 | function createShapeTypeChecker(shapeTypes) {
|
1865 | function validate(props, propName, componentName, location, propFullName) {
|
1866 | var propValue = props[propName];
|
1867 | var propType = getPropType(propValue);
|
1868 | if (propType !== 'object') {
|
1869 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
1870 | }
|
1871 | for (var key in shapeTypes) {
|
1872 | var checker = shapeTypes[key];
|
1873 | if (!checker) {
|
1874 | continue;
|
1875 | }
|
1876 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
1877 | if (error) {
|
1878 | return error;
|
1879 | }
|
1880 | }
|
1881 | return null;
|
1882 | }
|
1883 | return createChainableTypeChecker(validate);
|
1884 | }
|
1885 |
|
1886 | function createStrictShapeTypeChecker(shapeTypes) {
|
1887 | function validate(props, propName, componentName, location, propFullName) {
|
1888 | var propValue = props[propName];
|
1889 | var propType = getPropType(propValue);
|
1890 | if (propType !== 'object') {
|
1891 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
1892 | }
|
1893 |
|
1894 |
|
1895 | var allKeys = assign({}, props[propName], shapeTypes);
|
1896 | for (var key in allKeys) {
|
1897 | var checker = shapeTypes[key];
|
1898 | if (!checker) {
|
1899 | return new PropTypeError(
|
1900 | 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
1901 | '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
1902 | '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
1903 | );
|
1904 | }
|
1905 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
1906 | if (error) {
|
1907 | return error;
|
1908 | }
|
1909 | }
|
1910 | return null;
|
1911 | }
|
1912 |
|
1913 | return createChainableTypeChecker(validate);
|
1914 | }
|
1915 |
|
1916 | function isNode(propValue) {
|
1917 | switch (typeof propValue) {
|
1918 | case 'number':
|
1919 | case 'string':
|
1920 | case 'undefined':
|
1921 | return true;
|
1922 | case 'boolean':
|
1923 | return !propValue;
|
1924 | case 'object':
|
1925 | if (Array.isArray(propValue)) {
|
1926 | return propValue.every(isNode);
|
1927 | }
|
1928 | if (propValue === null || isValidElement(propValue)) {
|
1929 | return true;
|
1930 | }
|
1931 |
|
1932 | var iteratorFn = getIteratorFn(propValue);
|
1933 | if (iteratorFn) {
|
1934 | var iterator = iteratorFn.call(propValue);
|
1935 | var step;
|
1936 | if (iteratorFn !== propValue.entries) {
|
1937 | while (!(step = iterator.next()).done) {
|
1938 | if (!isNode(step.value)) {
|
1939 | return false;
|
1940 | }
|
1941 | }
|
1942 | } else {
|
1943 |
|
1944 | while (!(step = iterator.next()).done) {
|
1945 | var entry = step.value;
|
1946 | if (entry) {
|
1947 | if (!isNode(entry[1])) {
|
1948 | return false;
|
1949 | }
|
1950 | }
|
1951 | }
|
1952 | }
|
1953 | } else {
|
1954 | return false;
|
1955 | }
|
1956 |
|
1957 | return true;
|
1958 | default:
|
1959 | return false;
|
1960 | }
|
1961 | }
|
1962 |
|
1963 | function isSymbol(propType, propValue) {
|
1964 |
|
1965 | if (propType === 'symbol') {
|
1966 | return true;
|
1967 | }
|
1968 |
|
1969 |
|
1970 | if (propValue['@@toStringTag'] === 'Symbol') {
|
1971 | return true;
|
1972 | }
|
1973 |
|
1974 |
|
1975 | if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
1976 | return true;
|
1977 | }
|
1978 |
|
1979 | return false;
|
1980 | }
|
1981 |
|
1982 |
|
1983 | function getPropType(propValue) {
|
1984 | var propType = typeof propValue;
|
1985 | if (Array.isArray(propValue)) {
|
1986 | return 'array';
|
1987 | }
|
1988 | if (propValue instanceof RegExp) {
|
1989 |
|
1990 |
|
1991 |
|
1992 | return 'object';
|
1993 | }
|
1994 | if (isSymbol(propType, propValue)) {
|
1995 | return 'symbol';
|
1996 | }
|
1997 | return propType;
|
1998 | }
|
1999 |
|
2000 |
|
2001 |
|
2002 | function getPreciseType(propValue) {
|
2003 | if (typeof propValue === 'undefined' || propValue === null) {
|
2004 | return '' + propValue;
|
2005 | }
|
2006 | var propType = getPropType(propValue);
|
2007 | if (propType === 'object') {
|
2008 | if (propValue instanceof Date) {
|
2009 | return 'date';
|
2010 | } else if (propValue instanceof RegExp) {
|
2011 | return 'regexp';
|
2012 | }
|
2013 | }
|
2014 | return propType;
|
2015 | }
|
2016 |
|
2017 |
|
2018 |
|
2019 | function getPostfixForTypeWarning(value) {
|
2020 | var type = getPreciseType(value);
|
2021 | switch (type) {
|
2022 | case 'array':
|
2023 | case 'object':
|
2024 | return 'an ' + type;
|
2025 | case 'boolean':
|
2026 | case 'date':
|
2027 | case 'regexp':
|
2028 | return 'a ' + type;
|
2029 | default:
|
2030 | return type;
|
2031 | }
|
2032 | }
|
2033 |
|
2034 |
|
2035 | function getClassName(propValue) {
|
2036 | if (!propValue.constructor || !propValue.constructor.name) {
|
2037 | return ANONYMOUS;
|
2038 | }
|
2039 | return propValue.constructor.name;
|
2040 | }
|
2041 |
|
2042 | ReactPropTypes.checkPropTypes = checkPropTypes;
|
2043 | ReactPropTypes.PropTypes = ReactPropTypes;
|
2044 |
|
2045 | return ReactPropTypes;
|
2046 | };
|
2047 |
|
2048 | },{"./checkPropTypes":25,"./lib/ReactPropTypesSecret":28,"object-assign":23}],28:[function(require,module,exports){
|
2049 |
|
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 | 'use strict';
|
2057 |
|
2058 | var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
2059 |
|
2060 | module.exports = ReactPropTypesSecret;
|
2061 |
|
2062 | },{}],29:[function(require,module,exports){
|
2063 |
|
2064 |
|
2065 |
|
2066 |
|
2067 |
|
2068 |
|
2069 |
|
2070 |
|
2071 |
|
2072 | 'use strict';
|
2073 |
|
2074 |
|
2075 |
|
2076 | if ("development" !== "production") {
|
2077 | (function() {
|
2078 | 'use strict';
|
2079 |
|
2080 | var React = require('react');
|
2081 | var _assign = require('object-assign');
|
2082 | var checkPropTypes = require('prop-types/checkPropTypes');
|
2083 | var scheduler = require('scheduler');
|
2084 | var tracing = require('scheduler/tracing');
|
2085 |
|
2086 |
|
2087 |
|
2088 |
|
2089 |
|
2090 |
|
2091 |
|
2092 |
|
2093 |
|
2094 |
|
2095 |
|
2096 |
|
2097 | var validateFormat = function () {};
|
2098 |
|
2099 | {
|
2100 | validateFormat = function (format) {
|
2101 | if (format === undefined) {
|
2102 | throw new Error('invariant requires an error message argument');
|
2103 | }
|
2104 | };
|
2105 | }
|
2106 |
|
2107 | function invariant(condition, format, a, b, c, d, e, f) {
|
2108 | validateFormat(format);
|
2109 |
|
2110 | if (!condition) {
|
2111 | var error = void 0;
|
2112 | if (format === undefined) {
|
2113 | error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
2114 | } else {
|
2115 | var args = [a, b, c, d, e, f];
|
2116 | var argIndex = 0;
|
2117 | error = new Error(format.replace(/%s/g, function () {
|
2118 | return args[argIndex++];
|
2119 | }));
|
2120 | error.name = 'Invariant Violation';
|
2121 | }
|
2122 |
|
2123 | error.framesToPop = 1;
|
2124 | throw error;
|
2125 | }
|
2126 | }
|
2127 |
|
2128 |
|
2129 |
|
2130 |
|
2131 | !React ? invariant(false, 'ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.') : void 0;
|
2132 |
|
2133 | var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {
|
2134 | var funcArgs = Array.prototype.slice.call(arguments, 3);
|
2135 | try {
|
2136 | func.apply(context, funcArgs);
|
2137 | } catch (error) {
|
2138 | this.onError(error);
|
2139 | }
|
2140 | };
|
2141 |
|
2142 | {
|
2143 |
|
2144 |
|
2145 |
|
2146 |
|
2147 |
|
2148 |
|
2149 |
|
2150 |
|
2151 |
|
2152 |
|
2153 |
|
2154 |
|
2155 |
|
2156 |
|
2157 |
|
2158 |
|
2159 |
|
2160 |
|
2161 |
|
2162 |
|
2163 |
|
2164 | if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
|
2165 | var fakeNode = document.createElement('react');
|
2166 |
|
2167 | var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
|
2168 |
|
2169 |
|
2170 |
|
2171 |
|
2172 | !(typeof document !== 'undefined') ? invariant(false, 'The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.') : void 0;
|
2173 | var evt = document.createEvent('Event');
|
2174 |
|
2175 |
|
2176 |
|
2177 |
|
2178 |
|
2179 |
|
2180 |
|
2181 | var didError = true;
|
2182 |
|
2183 |
|
2184 |
|
2185 |
|
2186 | var windowEvent = window.event;
|
2187 |
|
2188 |
|
2189 |
|
2190 | var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event');
|
2191 |
|
2192 |
|
2193 |
|
2194 |
|
2195 | var funcArgs = Array.prototype.slice.call(arguments, 3);
|
2196 | function callCallback() {
|
2197 |
|
2198 |
|
2199 |
|
2200 |
|
2201 | fakeNode.removeEventListener(evtType, callCallback, false);
|
2202 |
|
2203 |
|
2204 |
|
2205 |
|
2206 |
|
2207 | if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {
|
2208 | window.event = windowEvent;
|
2209 | }
|
2210 |
|
2211 | func.apply(context, funcArgs);
|
2212 | didError = false;
|
2213 | }
|
2214 |
|
2215 |
|
2216 |
|
2217 |
|
2218 |
|
2219 |
|
2220 |
|
2221 |
|
2222 |
|
2223 |
|
2224 |
|
2225 |
|
2226 | var error = void 0;
|
2227 |
|
2228 | var didSetError = false;
|
2229 | var isCrossOriginError = false;
|
2230 |
|
2231 | function handleWindowError(event) {
|
2232 | error = event.error;
|
2233 | didSetError = true;
|
2234 | if (error === null && event.colno === 0 && event.lineno === 0) {
|
2235 | isCrossOriginError = true;
|
2236 | }
|
2237 | if (event.defaultPrevented) {
|
2238 |
|
2239 |
|
2240 |
|
2241 | if (error != null && typeof error === 'object') {
|
2242 | try {
|
2243 | error._suppressLogging = true;
|
2244 | } catch (inner) {
|
2245 |
|
2246 | }
|
2247 | }
|
2248 | }
|
2249 | }
|
2250 |
|
2251 |
|
2252 | var evtType = 'react-' + (name ? name : 'invokeguardedcallback');
|
2253 |
|
2254 |
|
2255 | window.addEventListener('error', handleWindowError);
|
2256 | fakeNode.addEventListener(evtType, callCallback, false);
|
2257 |
|
2258 |
|
2259 |
|
2260 | evt.initEvent(evtType, false, false);
|
2261 | fakeNode.dispatchEvent(evt);
|
2262 |
|
2263 | if (windowEventDescriptor) {
|
2264 | Object.defineProperty(window, 'event', windowEventDescriptor);
|
2265 | }
|
2266 |
|
2267 | if (didError) {
|
2268 | if (!didSetError) {
|
2269 |
|
2270 | error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
|
2271 | } else if (isCrossOriginError) {
|
2272 | error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');
|
2273 | }
|
2274 | this.onError(error);
|
2275 | }
|
2276 |
|
2277 |
|
2278 | window.removeEventListener('error', handleWindowError);
|
2279 | };
|
2280 |
|
2281 | invokeGuardedCallbackImpl = invokeGuardedCallbackDev;
|
2282 | }
|
2283 | }
|
2284 |
|
2285 | var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
|
2286 |
|
2287 |
|
2288 | var hasError = false;
|
2289 | var caughtError = null;
|
2290 |
|
2291 |
|
2292 | var hasRethrowError = false;
|
2293 | var rethrowError = null;
|
2294 |
|
2295 | var reporter = {
|
2296 | onError: function (error) {
|
2297 | hasError = true;
|
2298 | caughtError = error;
|
2299 | }
|
2300 | };
|
2301 |
|
2302 |
|
2303 |
|
2304 |
|
2305 |
|
2306 |
|
2307 |
|
2308 |
|
2309 |
|
2310 |
|
2311 |
|
2312 |
|
2313 |
|
2314 |
|
2315 | function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
|
2316 | hasError = false;
|
2317 | caughtError = null;
|
2318 | invokeGuardedCallbackImpl$1.apply(reporter, arguments);
|
2319 | }
|
2320 |
|
2321 |
|
2322 |
|
2323 |
|
2324 |
|
2325 |
|
2326 |
|
2327 |
|
2328 |
|
2329 |
|
2330 |
|
2331 | function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
|
2332 | invokeGuardedCallback.apply(this, arguments);
|
2333 | if (hasError) {
|
2334 | var error = clearCaughtError();
|
2335 | if (!hasRethrowError) {
|
2336 | hasRethrowError = true;
|
2337 | rethrowError = error;
|
2338 | }
|
2339 | }
|
2340 | }
|
2341 |
|
2342 |
|
2343 |
|
2344 |
|
2345 |
|
2346 | function rethrowCaughtError() {
|
2347 | if (hasRethrowError) {
|
2348 | var error = rethrowError;
|
2349 | hasRethrowError = false;
|
2350 | rethrowError = null;
|
2351 | throw error;
|
2352 | }
|
2353 | }
|
2354 |
|
2355 | function hasCaughtError() {
|
2356 | return hasError;
|
2357 | }
|
2358 |
|
2359 | function clearCaughtError() {
|
2360 | if (hasError) {
|
2361 | var error = caughtError;
|
2362 | hasError = false;
|
2363 | caughtError = null;
|
2364 | return error;
|
2365 | } else {
|
2366 | invariant(false, 'clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.');
|
2367 | }
|
2368 | }
|
2369 |
|
2370 |
|
2371 |
|
2372 |
|
2373 | var eventPluginOrder = null;
|
2374 |
|
2375 |
|
2376 |
|
2377 |
|
2378 | var namesToPlugins = {};
|
2379 |
|
2380 |
|
2381 |
|
2382 |
|
2383 |
|
2384 |
|
2385 | function recomputePluginOrdering() {
|
2386 | if (!eventPluginOrder) {
|
2387 |
|
2388 | return;
|
2389 | }
|
2390 | for (var pluginName in namesToPlugins) {
|
2391 | var pluginModule = namesToPlugins[pluginName];
|
2392 | var pluginIndex = eventPluginOrder.indexOf(pluginName);
|
2393 | !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;
|
2394 | if (plugins[pluginIndex]) {
|
2395 | continue;
|
2396 | }
|
2397 | !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;
|
2398 | plugins[pluginIndex] = pluginModule;
|
2399 | var publishedEvents = pluginModule.eventTypes;
|
2400 | for (var eventName in publishedEvents) {
|
2401 | !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;
|
2402 | }
|
2403 | }
|
2404 | }
|
2405 |
|
2406 |
|
2407 |
|
2408 |
|
2409 |
|
2410 |
|
2411 |
|
2412 |
|
2413 |
|
2414 | function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
|
2415 | !!eventNameDispatchConfigs.hasOwnProperty(eventName) ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : void 0;
|
2416 | eventNameDispatchConfigs[eventName] = dispatchConfig;
|
2417 |
|
2418 | var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
|
2419 | if (phasedRegistrationNames) {
|
2420 | for (var phaseName in phasedRegistrationNames) {
|
2421 | if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
|
2422 | var phasedRegistrationName = phasedRegistrationNames[phaseName];
|
2423 | publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
|
2424 | }
|
2425 | }
|
2426 | return true;
|
2427 | } else if (dispatchConfig.registrationName) {
|
2428 | publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
|
2429 | return true;
|
2430 | }
|
2431 | return false;
|
2432 | }
|
2433 |
|
2434 |
|
2435 |
|
2436 |
|
2437 |
|
2438 |
|
2439 |
|
2440 |
|
2441 | function publishRegistrationName(registrationName, pluginModule, eventName) {
|
2442 | !!registrationNameModules[registrationName] ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : void 0;
|
2443 | registrationNameModules[registrationName] = pluginModule;
|
2444 | registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
|
2445 |
|
2446 | {
|
2447 | var lowerCasedName = registrationName.toLowerCase();
|
2448 | possibleRegistrationNames[lowerCasedName] = registrationName;
|
2449 |
|
2450 | if (registrationName === 'onDoubleClick') {
|
2451 | possibleRegistrationNames.ondblclick = registrationName;
|
2452 | }
|
2453 | }
|
2454 | }
|
2455 |
|
2456 |
|
2457 |
|
2458 |
|
2459 |
|
2460 |
|
2461 |
|
2462 |
|
2463 |
|
2464 |
|
2465 | var plugins = [];
|
2466 |
|
2467 |
|
2468 |
|
2469 |
|
2470 | var eventNameDispatchConfigs = {};
|
2471 |
|
2472 |
|
2473 |
|
2474 |
|
2475 | var registrationNameModules = {};
|
2476 |
|
2477 |
|
2478 |
|
2479 |
|
2480 | var registrationNameDependencies = {};
|
2481 |
|
2482 |
|
2483 |
|
2484 |
|
2485 |
|
2486 |
|
2487 |
|
2488 | var possibleRegistrationNames = {};
|
2489 |
|
2490 |
|
2491 |
|
2492 |
|
2493 |
|
2494 |
|
2495 |
|
2496 |
|
2497 |
|
2498 |
|
2499 |
|
2500 | function injectEventPluginOrder(injectedEventPluginOrder) {
|
2501 | !!eventPluginOrder ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : void 0;
|
2502 |
|
2503 | eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
|
2504 | recomputePluginOrdering();
|
2505 | }
|
2506 |
|
2507 |
|
2508 |
|
2509 |
|
2510 |
|
2511 |
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 |
|
2517 | function injectEventPluginsByName(injectedNamesToPlugins) {
|
2518 | var isOrderingDirty = false;
|
2519 | for (var pluginName in injectedNamesToPlugins) {
|
2520 | if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
|
2521 | continue;
|
2522 | }
|
2523 | var pluginModule = injectedNamesToPlugins[pluginName];
|
2524 | if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
|
2525 | !!namesToPlugins[pluginName] ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : void 0;
|
2526 | namesToPlugins[pluginName] = pluginModule;
|
2527 | isOrderingDirty = true;
|
2528 | }
|
2529 | }
|
2530 | if (isOrderingDirty) {
|
2531 | recomputePluginOrdering();
|
2532 | }
|
2533 | }
|
2534 |
|
2535 |
|
2536 |
|
2537 |
|
2538 |
|
2539 |
|
2540 |
|
2541 |
|
2542 | var warningWithoutStack = function () {};
|
2543 |
|
2544 | {
|
2545 | warningWithoutStack = function (condition, format) {
|
2546 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
2547 | args[_key - 2] = arguments[_key];
|
2548 | }
|
2549 |
|
2550 | if (format === undefined) {
|
2551 | throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
2552 | }
|
2553 | if (args.length > 8) {
|
2554 |
|
2555 | throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
|
2556 | }
|
2557 | if (condition) {
|
2558 | return;
|
2559 | }
|
2560 | if (typeof console !== 'undefined') {
|
2561 | var argsWithFormat = args.map(function (item) {
|
2562 | return '' + item;
|
2563 | });
|
2564 | argsWithFormat.unshift('Warning: ' + format);
|
2565 |
|
2566 |
|
2567 |
|
2568 | Function.prototype.apply.call(console.error, console, argsWithFormat);
|
2569 | }
|
2570 | try {
|
2571 |
|
2572 |
|
2573 |
|
2574 | var argIndex = 0;
|
2575 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
2576 | return args[argIndex++];
|
2577 | });
|
2578 | throw new Error(message);
|
2579 | } catch (x) {}
|
2580 | };
|
2581 | }
|
2582 |
|
2583 | var warningWithoutStack$1 = warningWithoutStack;
|
2584 |
|
2585 | var getFiberCurrentPropsFromNode = null;
|
2586 | var getInstanceFromNode = null;
|
2587 | var getNodeFromInstance = null;
|
2588 |
|
2589 | function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {
|
2590 | getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
|
2591 | getInstanceFromNode = getInstanceFromNodeImpl;
|
2592 | getNodeFromInstance = getNodeFromInstanceImpl;
|
2593 | {
|
2594 | !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
|
2595 | }
|
2596 | }
|
2597 |
|
2598 | var validateEventDispatches = void 0;
|
2599 | {
|
2600 | validateEventDispatches = function (event) {
|
2601 | var dispatchListeners = event._dispatchListeners;
|
2602 | var dispatchInstances = event._dispatchInstances;
|
2603 |
|
2604 | var listenersIsArr = Array.isArray(dispatchListeners);
|
2605 | var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
|
2606 |
|
2607 | var instancesIsArr = Array.isArray(dispatchInstances);
|
2608 | var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
|
2609 |
|
2610 | !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0;
|
2611 | };
|
2612 | }
|
2613 |
|
2614 |
|
2615 |
|
2616 |
|
2617 |
|
2618 |
|
2619 |
|
2620 | function executeDispatch(event, listener, inst) {
|
2621 | var type = event.type || 'unknown-event';
|
2622 | event.currentTarget = getNodeFromInstance(inst);
|
2623 | invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
|
2624 | event.currentTarget = null;
|
2625 | }
|
2626 |
|
2627 |
|
2628 |
|
2629 |
|
2630 | function executeDispatchesInOrder(event) {
|
2631 | var dispatchListeners = event._dispatchListeners;
|
2632 | var dispatchInstances = event._dispatchInstances;
|
2633 | {
|
2634 | validateEventDispatches(event);
|
2635 | }
|
2636 | if (Array.isArray(dispatchListeners)) {
|
2637 | for (var i = 0; i < dispatchListeners.length; i++) {
|
2638 | if (event.isPropagationStopped()) {
|
2639 | break;
|
2640 | }
|
2641 |
|
2642 | executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);
|
2643 | }
|
2644 | } else if (dispatchListeners) {
|
2645 | executeDispatch(event, dispatchListeners, dispatchInstances);
|
2646 | }
|
2647 | event._dispatchListeners = null;
|
2648 | event._dispatchInstances = null;
|
2649 | }
|
2650 |
|
2651 |
|
2652 |
|
2653 |
|
2654 |
|
2655 |
|
2656 |
|
2657 |
|
2658 |
|
2659 |
|
2660 |
|
2661 |
|
2662 |
|
2663 |
|
2664 |
|
2665 |
|
2666 |
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 |
|
2672 |
|
2673 |
|
2674 |
|
2675 |
|
2676 |
|
2677 |
|
2678 |
|
2679 |
|
2680 |
|
2681 |
|
2682 |
|
2683 |
|
2684 |
|
2685 | function accumulateInto(current, next) {
|
2686 | !(next != null) ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : void 0;
|
2687 |
|
2688 | if (current == null) {
|
2689 | return next;
|
2690 | }
|
2691 |
|
2692 |
|
2693 |
|
2694 | if (Array.isArray(current)) {
|
2695 | if (Array.isArray(next)) {
|
2696 | current.push.apply(current, next);
|
2697 | return current;
|
2698 | }
|
2699 | current.push(next);
|
2700 | return current;
|
2701 | }
|
2702 |
|
2703 | if (Array.isArray(next)) {
|
2704 |
|
2705 | return [current].concat(next);
|
2706 | }
|
2707 |
|
2708 | return [current, next];
|
2709 | }
|
2710 |
|
2711 |
|
2712 |
|
2713 |
|
2714 |
|
2715 |
|
2716 |
|
2717 |
|
2718 |
|
2719 |
|
2720 | function forEachAccumulated(arr, cb, scope) {
|
2721 | if (Array.isArray(arr)) {
|
2722 | arr.forEach(cb, scope);
|
2723 | } else if (arr) {
|
2724 | cb.call(scope, arr);
|
2725 | }
|
2726 | }
|
2727 |
|
2728 |
|
2729 |
|
2730 |
|
2731 |
|
2732 | var eventQueue = null;
|
2733 |
|
2734 |
|
2735 |
|
2736 |
|
2737 |
|
2738 |
|
2739 |
|
2740 | var executeDispatchesAndRelease = function (event) {
|
2741 | if (event) {
|
2742 | executeDispatchesInOrder(event);
|
2743 |
|
2744 | if (!event.isPersistent()) {
|
2745 | event.constructor.release(event);
|
2746 | }
|
2747 | }
|
2748 | };
|
2749 | var executeDispatchesAndReleaseTopLevel = function (e) {
|
2750 | return executeDispatchesAndRelease(e);
|
2751 | };
|
2752 |
|
2753 | function isInteractive(tag) {
|
2754 | return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
|
2755 | }
|
2756 |
|
2757 | function shouldPreventMouseEvent(name, type, props) {
|
2758 | switch (name) {
|
2759 | case 'onClick':
|
2760 | case 'onClickCapture':
|
2761 | case 'onDoubleClick':
|
2762 | case 'onDoubleClickCapture':
|
2763 | case 'onMouseDown':
|
2764 | case 'onMouseDownCapture':
|
2765 | case 'onMouseMove':
|
2766 | case 'onMouseMoveCapture':
|
2767 | case 'onMouseUp':
|
2768 | case 'onMouseUpCapture':
|
2769 | return !!(props.disabled && isInteractive(type));
|
2770 | default:
|
2771 | return false;
|
2772 | }
|
2773 | }
|
2774 |
|
2775 |
|
2776 |
|
2777 |
|
2778 |
|
2779 |
|
2780 |
|
2781 |
|
2782 |
|
2783 |
|
2784 |
|
2785 |
|
2786 |
|
2787 |
|
2788 |
|
2789 |
|
2790 |
|
2791 |
|
2792 |
|
2793 |
|
2794 |
|
2795 |
|
2796 |
|
2797 |
|
2798 |
|
2799 |
|
2800 |
|
2801 | var injection = {
|
2802 | |
2803 |
|
2804 |
|
2805 |
|
2806 | injectEventPluginOrder: injectEventPluginOrder,
|
2807 |
|
2808 | |
2809 |
|
2810 |
|
2811 | injectEventPluginsByName: injectEventPluginsByName
|
2812 | };
|
2813 |
|
2814 |
|
2815 |
|
2816 |
|
2817 |
|
2818 |
|
2819 | function getListener(inst, registrationName) {
|
2820 | var listener = void 0;
|
2821 |
|
2822 |
|
2823 |
|
2824 | var stateNode = inst.stateNode;
|
2825 | if (!stateNode) {
|
2826 |
|
2827 | return null;
|
2828 | }
|
2829 | var props = getFiberCurrentPropsFromNode(stateNode);
|
2830 | if (!props) {
|
2831 |
|
2832 | return null;
|
2833 | }
|
2834 | listener = props[registrationName];
|
2835 | if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
|
2836 | return null;
|
2837 | }
|
2838 | !(!listener || typeof listener === 'function') ? invariant(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener) : void 0;
|
2839 | return listener;
|
2840 | }
|
2841 |
|
2842 |
|
2843 |
|
2844 |
|
2845 |
|
2846 |
|
2847 |
|
2848 |
|
2849 | function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
2850 | var events = null;
|
2851 | for (var i = 0; i < plugins.length; i++) {
|
2852 |
|
2853 | var possiblePlugin = plugins[i];
|
2854 | if (possiblePlugin) {
|
2855 | var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
|
2856 | if (extractedEvents) {
|
2857 | events = accumulateInto(events, extractedEvents);
|
2858 | }
|
2859 | }
|
2860 | }
|
2861 | return events;
|
2862 | }
|
2863 |
|
2864 | function runEventsInBatch(events) {
|
2865 | if (events !== null) {
|
2866 | eventQueue = accumulateInto(eventQueue, events);
|
2867 | }
|
2868 |
|
2869 |
|
2870 |
|
2871 | var processingEventQueue = eventQueue;
|
2872 | eventQueue = null;
|
2873 |
|
2874 | if (!processingEventQueue) {
|
2875 | return;
|
2876 | }
|
2877 |
|
2878 | forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
|
2879 | !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
|
2880 |
|
2881 | rethrowCaughtError();
|
2882 | }
|
2883 |
|
2884 | function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
2885 | var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
|
2886 | runEventsInBatch(events);
|
2887 | }
|
2888 |
|
2889 | var FunctionComponent = 0;
|
2890 | var ClassComponent = 1;
|
2891 | var IndeterminateComponent = 2;
|
2892 | var HostRoot = 3;
|
2893 | var HostPortal = 4;
|
2894 | var HostComponent = 5;
|
2895 | var HostText = 6;
|
2896 | var Fragment = 7;
|
2897 | var Mode = 8;
|
2898 | var ContextConsumer = 9;
|
2899 | var ContextProvider = 10;
|
2900 | var ForwardRef = 11;
|
2901 | var Profiler = 12;
|
2902 | var SuspenseComponent = 13;
|
2903 | var MemoComponent = 14;
|
2904 | var SimpleMemoComponent = 15;
|
2905 | var LazyComponent = 16;
|
2906 | var IncompleteClassComponent = 17;
|
2907 |
|
2908 | var randomKey = Math.random().toString(36).slice(2);
|
2909 | var internalInstanceKey = '__reactInternalInstance$' + randomKey;
|
2910 | var internalEventHandlersKey = '__reactEventHandlers$' + randomKey;
|
2911 |
|
2912 | function precacheFiberNode(hostInst, node) {
|
2913 | node[internalInstanceKey] = hostInst;
|
2914 | }
|
2915 |
|
2916 |
|
2917 |
|
2918 |
|
2919 |
|
2920 | function getClosestInstanceFromNode(node) {
|
2921 | if (node[internalInstanceKey]) {
|
2922 | return node[internalInstanceKey];
|
2923 | }
|
2924 |
|
2925 | while (!node[internalInstanceKey]) {
|
2926 | if (node.parentNode) {
|
2927 | node = node.parentNode;
|
2928 | } else {
|
2929 |
|
2930 |
|
2931 | return null;
|
2932 | }
|
2933 | }
|
2934 |
|
2935 | var inst = node[internalInstanceKey];
|
2936 | if (inst.tag === HostComponent || inst.tag === HostText) {
|
2937 |
|
2938 | return inst;
|
2939 | }
|
2940 |
|
2941 | return null;
|
2942 | }
|
2943 |
|
2944 |
|
2945 |
|
2946 |
|
2947 |
|
2948 | function getInstanceFromNode$1(node) {
|
2949 | var inst = node[internalInstanceKey];
|
2950 | if (inst) {
|
2951 | if (inst.tag === HostComponent || inst.tag === HostText) {
|
2952 | return inst;
|
2953 | } else {
|
2954 | return null;
|
2955 | }
|
2956 | }
|
2957 | return null;
|
2958 | }
|
2959 |
|
2960 |
|
2961 |
|
2962 |
|
2963 |
|
2964 | function getNodeFromInstance$1(inst) {
|
2965 | if (inst.tag === HostComponent || inst.tag === HostText) {
|
2966 |
|
2967 |
|
2968 | return inst.stateNode;
|
2969 | }
|
2970 |
|
2971 |
|
2972 |
|
2973 | invariant(false, 'getNodeFromInstance: Invalid argument.');
|
2974 | }
|
2975 |
|
2976 | function getFiberCurrentPropsFromNode$1(node) {
|
2977 | return node[internalEventHandlersKey] || null;
|
2978 | }
|
2979 |
|
2980 | function updateFiberProps(node, props) {
|
2981 | node[internalEventHandlersKey] = props;
|
2982 | }
|
2983 |
|
2984 | function getParent(inst) {
|
2985 | do {
|
2986 | inst = inst.return;
|
2987 |
|
2988 |
|
2989 |
|
2990 |
|
2991 |
|
2992 | } while (inst && inst.tag !== HostComponent);
|
2993 | if (inst) {
|
2994 | return inst;
|
2995 | }
|
2996 | return null;
|
2997 | }
|
2998 |
|
2999 |
|
3000 |
|
3001 |
|
3002 |
|
3003 | function getLowestCommonAncestor(instA, instB) {
|
3004 | var depthA = 0;
|
3005 | for (var tempA = instA; tempA; tempA = getParent(tempA)) {
|
3006 | depthA++;
|
3007 | }
|
3008 | var depthB = 0;
|
3009 | for (var tempB = instB; tempB; tempB = getParent(tempB)) {
|
3010 | depthB++;
|
3011 | }
|
3012 |
|
3013 |
|
3014 | while (depthA - depthB > 0) {
|
3015 | instA = getParent(instA);
|
3016 | depthA--;
|
3017 | }
|
3018 |
|
3019 |
|
3020 | while (depthB - depthA > 0) {
|
3021 | instB = getParent(instB);
|
3022 | depthB--;
|
3023 | }
|
3024 |
|
3025 |
|
3026 | var depth = depthA;
|
3027 | while (depth--) {
|
3028 | if (instA === instB || instA === instB.alternate) {
|
3029 | return instA;
|
3030 | }
|
3031 | instA = getParent(instA);
|
3032 | instB = getParent(instB);
|
3033 | }
|
3034 | return null;
|
3035 | }
|
3036 |
|
3037 |
|
3038 |
|
3039 |
|
3040 |
|
3041 |
|
3042 |
|
3043 |
|
3044 |
|
3045 |
|
3046 |
|
3047 |
|
3048 |
|
3049 |
|
3050 | function traverseTwoPhase(inst, fn, arg) {
|
3051 | var path = [];
|
3052 | while (inst) {
|
3053 | path.push(inst);
|
3054 | inst = getParent(inst);
|
3055 | }
|
3056 | var i = void 0;
|
3057 | for (i = path.length; i-- > 0;) {
|
3058 | fn(path[i], 'captured', arg);
|
3059 | }
|
3060 | for (i = 0; i < path.length; i++) {
|
3061 | fn(path[i], 'bubbled', arg);
|
3062 | }
|
3063 | }
|
3064 |
|
3065 |
|
3066 |
|
3067 |
|
3068 |
|
3069 |
|
3070 |
|
3071 |
|
3072 | function traverseEnterLeave(from, to, fn, argFrom, argTo) {
|
3073 | var common = from && to ? getLowestCommonAncestor(from, to) : null;
|
3074 | var pathFrom = [];
|
3075 | while (true) {
|
3076 | if (!from) {
|
3077 | break;
|
3078 | }
|
3079 | if (from === common) {
|
3080 | break;
|
3081 | }
|
3082 | var alternate = from.alternate;
|
3083 | if (alternate !== null && alternate === common) {
|
3084 | break;
|
3085 | }
|
3086 | pathFrom.push(from);
|
3087 | from = getParent(from);
|
3088 | }
|
3089 | var pathTo = [];
|
3090 | while (true) {
|
3091 | if (!to) {
|
3092 | break;
|
3093 | }
|
3094 | if (to === common) {
|
3095 | break;
|
3096 | }
|
3097 | var _alternate = to.alternate;
|
3098 | if (_alternate !== null && _alternate === common) {
|
3099 | break;
|
3100 | }
|
3101 | pathTo.push(to);
|
3102 | to = getParent(to);
|
3103 | }
|
3104 | for (var i = 0; i < pathFrom.length; i++) {
|
3105 | fn(pathFrom[i], 'bubbled', argFrom);
|
3106 | }
|
3107 | for (var _i = pathTo.length; _i-- > 0;) {
|
3108 | fn(pathTo[_i], 'captured', argTo);
|
3109 | }
|
3110 | }
|
3111 |
|
3112 |
|
3113 |
|
3114 |
|
3115 |
|
3116 | function listenerAtPhase(inst, event, propagationPhase) {
|
3117 | var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
|
3118 | return getListener(inst, registrationName);
|
3119 | }
|
3120 |
|
3121 |
|
3122 |
|
3123 |
|
3124 |
|
3125 |
|
3126 |
|
3127 |
|
3128 |
|
3129 |
|
3130 |
|
3131 |
|
3132 |
|
3133 |
|
3134 |
|
3135 |
|
3136 |
|
3137 | function accumulateDirectionalDispatches(inst, phase, event) {
|
3138 | {
|
3139 | !inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0;
|
3140 | }
|
3141 | var listener = listenerAtPhase(inst, event, phase);
|
3142 | if (listener) {
|
3143 | event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
|
3144 | event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
|
3145 | }
|
3146 | }
|
3147 |
|
3148 |
|
3149 |
|
3150 |
|
3151 |
|
3152 |
|
3153 |
|
3154 |
|
3155 | function accumulateTwoPhaseDispatchesSingle(event) {
|
3156 | if (event && event.dispatchConfig.phasedRegistrationNames) {
|
3157 | traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
|
3158 | }
|
3159 | }
|
3160 |
|
3161 |
|
3162 |
|
3163 |
|
3164 |
|
3165 |
|
3166 | function accumulateDispatches(inst, ignoredDirection, event) {
|
3167 | if (inst && event && event.dispatchConfig.registrationName) {
|
3168 | var registrationName = event.dispatchConfig.registrationName;
|
3169 | var listener = getListener(inst, registrationName);
|
3170 | if (listener) {
|
3171 | event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
|
3172 | event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
|
3173 | }
|
3174 | }
|
3175 | }
|
3176 |
|
3177 |
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 | function accumulateDirectDispatchesSingle(event) {
|
3183 | if (event && event.dispatchConfig.registrationName) {
|
3184 | accumulateDispatches(event._targetInst, null, event);
|
3185 | }
|
3186 | }
|
3187 |
|
3188 | function accumulateTwoPhaseDispatches(events) {
|
3189 | forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
|
3190 | }
|
3191 |
|
3192 |
|
3193 |
|
3194 | function accumulateEnterLeaveDispatches(leave, enter, from, to) {
|
3195 | traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
|
3196 | }
|
3197 |
|
3198 | function accumulateDirectDispatches(events) {
|
3199 | forEachAccumulated(events, accumulateDirectDispatchesSingle);
|
3200 | }
|
3201 |
|
3202 | var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
3203 |
|
3204 |
|
3205 |
|
3206 |
|
3207 |
|
3208 | function unsafeCastStringToDOMTopLevelType(topLevelType) {
|
3209 | return topLevelType;
|
3210 | }
|
3211 |
|
3212 | function unsafeCastDOMTopLevelTypeToString(topLevelType) {
|
3213 | return topLevelType;
|
3214 | }
|
3215 |
|
3216 |
|
3217 |
|
3218 |
|
3219 |
|
3220 |
|
3221 |
|
3222 |
|
3223 | function makePrefixMap(styleProp, eventName) {
|
3224 | var prefixes = {};
|
3225 |
|
3226 | prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
|
3227 | prefixes['Webkit' + styleProp] = 'webkit' + eventName;
|
3228 | prefixes['Moz' + styleProp] = 'moz' + eventName;
|
3229 |
|
3230 | return prefixes;
|
3231 | }
|
3232 |
|
3233 |
|
3234 |
|
3235 |
|
3236 | var vendorPrefixes = {
|
3237 | animationend: makePrefixMap('Animation', 'AnimationEnd'),
|
3238 | animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
|
3239 | animationstart: makePrefixMap('Animation', 'AnimationStart'),
|
3240 | transitionend: makePrefixMap('Transition', 'TransitionEnd')
|
3241 | };
|
3242 |
|
3243 |
|
3244 |
|
3245 |
|
3246 | var prefixedEventNames = {};
|
3247 |
|
3248 |
|
3249 |
|
3250 |
|
3251 | var style = {};
|
3252 |
|
3253 |
|
3254 |
|
3255 |
|
3256 | if (canUseDOM) {
|
3257 | style = document.createElement('div').style;
|
3258 |
|
3259 |
|
3260 |
|
3261 |
|
3262 |
|
3263 | if (!('AnimationEvent' in window)) {
|
3264 | delete vendorPrefixes.animationend.animation;
|
3265 | delete vendorPrefixes.animationiteration.animation;
|
3266 | delete vendorPrefixes.animationstart.animation;
|
3267 | }
|
3268 |
|
3269 |
|
3270 | if (!('TransitionEvent' in window)) {
|
3271 | delete vendorPrefixes.transitionend.transition;
|
3272 | }
|
3273 | }
|
3274 |
|
3275 |
|
3276 |
|
3277 |
|
3278 |
|
3279 |
|
3280 |
|
3281 | function getVendorPrefixedEventName(eventName) {
|
3282 | if (prefixedEventNames[eventName]) {
|
3283 | return prefixedEventNames[eventName];
|
3284 | } else if (!vendorPrefixes[eventName]) {
|
3285 | return eventName;
|
3286 | }
|
3287 |
|
3288 | var prefixMap = vendorPrefixes[eventName];
|
3289 |
|
3290 | for (var styleProp in prefixMap) {
|
3291 | if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
|
3292 | return prefixedEventNames[eventName] = prefixMap[styleProp];
|
3293 | }
|
3294 | }
|
3295 |
|
3296 | return eventName;
|
3297 | }
|
3298 |
|
3299 |
|
3300 |
|
3301 |
|
3302 |
|
3303 |
|
3304 |
|
3305 |
|
3306 | var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');
|
3307 | var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));
|
3308 | var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));
|
3309 | var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));
|
3310 | var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');
|
3311 | var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');
|
3312 | var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');
|
3313 | var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');
|
3314 | var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');
|
3315 | var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');
|
3316 | var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');
|
3317 | var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');
|
3318 | var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');
|
3319 | var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');
|
3320 | var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
|
3321 | var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
|
3322 | var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
|
3323 | var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
|
3324 | var TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');
|
3325 | var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
|
3326 | var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
|
3327 | var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
|
3328 | var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');
|
3329 | var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');
|
3330 | var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');
|
3331 | var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');
|
3332 | var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');
|
3333 | var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');
|
3334 | var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');
|
3335 | var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');
|
3336 | var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');
|
3337 | var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');
|
3338 | var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');
|
3339 | var TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');
|
3340 | var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');
|
3341 | var TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');
|
3342 | var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');
|
3343 | var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');
|
3344 | var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');
|
3345 | var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');
|
3346 | var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');
|
3347 | var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');
|
3348 | var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');
|
3349 | var TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');
|
3350 | var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');
|
3351 | var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');
|
3352 | var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');
|
3353 | var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');
|
3354 | var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');
|
3355 | var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');
|
3356 | var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');
|
3357 | var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');
|
3358 | var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');
|
3359 | var TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');
|
3360 | var TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');
|
3361 |
|
3362 |
|
3363 | var TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');
|
3364 | var TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');
|
3365 | var TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');
|
3366 | var TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');
|
3367 | var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');
|
3368 | var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');
|
3369 | var TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');
|
3370 | var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');
|
3371 | var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');
|
3372 | var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');
|
3373 | var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');
|
3374 | var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');
|
3375 | var TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');
|
3376 | var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');
|
3377 | var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');
|
3378 | var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');
|
3379 | var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');
|
3380 | var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');
|
3381 | var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');
|
3382 | var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');
|
3383 | var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');
|
3384 | var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));
|
3385 | var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');
|
3386 | var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');
|
3387 | var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel');
|
3388 |
|
3389 |
|
3390 |
|
3391 |
|
3392 | var mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];
|
3393 |
|
3394 | function getRawEventName(topLevelType) {
|
3395 | return unsafeCastDOMTopLevelTypeToString(topLevelType);
|
3396 | }
|
3397 |
|
3398 |
|
3399 |
|
3400 |
|
3401 |
|
3402 |
|
3403 |
|
3404 |
|
3405 |
|
3406 |
|
3407 |
|
3408 |
|
3409 |
|
3410 | var root = null;
|
3411 | var startText = null;
|
3412 | var fallbackText = null;
|
3413 |
|
3414 | function initialize(nativeEventTarget) {
|
3415 | root = nativeEventTarget;
|
3416 | startText = getText();
|
3417 | return true;
|
3418 | }
|
3419 |
|
3420 | function reset() {
|
3421 | root = null;
|
3422 | startText = null;
|
3423 | fallbackText = null;
|
3424 | }
|
3425 |
|
3426 | function getData() {
|
3427 | if (fallbackText) {
|
3428 | return fallbackText;
|
3429 | }
|
3430 |
|
3431 | var start = void 0;
|
3432 | var startValue = startText;
|
3433 | var startLength = startValue.length;
|
3434 | var end = void 0;
|
3435 | var endValue = getText();
|
3436 | var endLength = endValue.length;
|
3437 |
|
3438 | for (start = 0; start < startLength; start++) {
|
3439 | if (startValue[start] !== endValue[start]) {
|
3440 | break;
|
3441 | }
|
3442 | }
|
3443 |
|
3444 | var minEnd = startLength - start;
|
3445 | for (end = 1; end <= minEnd; end++) {
|
3446 | if (startValue[startLength - end] !== endValue[endLength - end]) {
|
3447 | break;
|
3448 | }
|
3449 | }
|
3450 |
|
3451 | var sliceTail = end > 1 ? 1 - end : undefined;
|
3452 | fallbackText = endValue.slice(start, sliceTail);
|
3453 | return fallbackText;
|
3454 | }
|
3455 |
|
3456 | function getText() {
|
3457 | if ('value' in root) {
|
3458 | return root.value;
|
3459 | }
|
3460 | return root.textContent;
|
3461 | }
|
3462 |
|
3463 |
|
3464 |
|
3465 | var EVENT_POOL_SIZE = 10;
|
3466 |
|
3467 |
|
3468 |
|
3469 |
|
3470 |
|
3471 | var EventInterface = {
|
3472 | type: null,
|
3473 | target: null,
|
3474 |
|
3475 | currentTarget: function () {
|
3476 | return null;
|
3477 | },
|
3478 | eventPhase: null,
|
3479 | bubbles: null,
|
3480 | cancelable: null,
|
3481 | timeStamp: function (event) {
|
3482 | return event.timeStamp || Date.now();
|
3483 | },
|
3484 | defaultPrevented: null,
|
3485 | isTrusted: null
|
3486 | };
|
3487 |
|
3488 | function functionThatReturnsTrue() {
|
3489 | return true;
|
3490 | }
|
3491 |
|
3492 | function functionThatReturnsFalse() {
|
3493 | return false;
|
3494 | }
|
3495 |
|
3496 |
|
3497 |
|
3498 |
|
3499 |
|
3500 |
|
3501 |
|
3502 |
|
3503 |
|
3504 |
|
3505 |
|
3506 |
|
3507 |
|
3508 |
|
3509 |
|
3510 |
|
3511 |
|
3512 |
|
3513 |
|
3514 | function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
|
3515 | {
|
3516 |
|
3517 | delete this.nativeEvent;
|
3518 | delete this.preventDefault;
|
3519 | delete this.stopPropagation;
|
3520 | delete this.isDefaultPrevented;
|
3521 | delete this.isPropagationStopped;
|
3522 | }
|
3523 |
|
3524 | this.dispatchConfig = dispatchConfig;
|
3525 | this._targetInst = targetInst;
|
3526 | this.nativeEvent = nativeEvent;
|
3527 |
|
3528 | var Interface = this.constructor.Interface;
|
3529 | for (var propName in Interface) {
|
3530 | if (!Interface.hasOwnProperty(propName)) {
|
3531 | continue;
|
3532 | }
|
3533 | {
|
3534 | delete this[propName];
|
3535 | }
|
3536 | var normalize = Interface[propName];
|
3537 | if (normalize) {
|
3538 | this[propName] = normalize(nativeEvent);
|
3539 | } else {
|
3540 | if (propName === 'target') {
|
3541 | this.target = nativeEventTarget;
|
3542 | } else {
|
3543 | this[propName] = nativeEvent[propName];
|
3544 | }
|
3545 | }
|
3546 | }
|
3547 |
|
3548 | var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
|
3549 | if (defaultPrevented) {
|
3550 | this.isDefaultPrevented = functionThatReturnsTrue;
|
3551 | } else {
|
3552 | this.isDefaultPrevented = functionThatReturnsFalse;
|
3553 | }
|
3554 | this.isPropagationStopped = functionThatReturnsFalse;
|
3555 | return this;
|
3556 | }
|
3557 |
|
3558 | _assign(SyntheticEvent.prototype, {
|
3559 | preventDefault: function () {
|
3560 | this.defaultPrevented = true;
|
3561 | var event = this.nativeEvent;
|
3562 | if (!event) {
|
3563 | return;
|
3564 | }
|
3565 |
|
3566 | if (event.preventDefault) {
|
3567 | event.preventDefault();
|
3568 | } else if (typeof event.returnValue !== 'unknown') {
|
3569 | event.returnValue = false;
|
3570 | }
|
3571 | this.isDefaultPrevented = functionThatReturnsTrue;
|
3572 | },
|
3573 |
|
3574 | stopPropagation: function () {
|
3575 | var event = this.nativeEvent;
|
3576 | if (!event) {
|
3577 | return;
|
3578 | }
|
3579 |
|
3580 | if (event.stopPropagation) {
|
3581 | event.stopPropagation();
|
3582 | } else if (typeof event.cancelBubble !== 'unknown') {
|
3583 |
|
3584 |
|
3585 |
|
3586 |
|
3587 |
|
3588 | event.cancelBubble = true;
|
3589 | }
|
3590 |
|
3591 | this.isPropagationStopped = functionThatReturnsTrue;
|
3592 | },
|
3593 |
|
3594 | |
3595 |
|
3596 |
|
3597 |
|
3598 |
|
3599 | persist: function () {
|
3600 | this.isPersistent = functionThatReturnsTrue;
|
3601 | },
|
3602 |
|
3603 | |
3604 |
|
3605 |
|
3606 |
|
3607 |
|
3608 | isPersistent: functionThatReturnsFalse,
|
3609 |
|
3610 | |
3611 |
|
3612 |
|
3613 | destructor: function () {
|
3614 | var Interface = this.constructor.Interface;
|
3615 | for (var propName in Interface) {
|
3616 | {
|
3617 | Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
|
3618 | }
|
3619 | }
|
3620 | this.dispatchConfig = null;
|
3621 | this._targetInst = null;
|
3622 | this.nativeEvent = null;
|
3623 | this.isDefaultPrevented = functionThatReturnsFalse;
|
3624 | this.isPropagationStopped = functionThatReturnsFalse;
|
3625 | this._dispatchListeners = null;
|
3626 | this._dispatchInstances = null;
|
3627 | {
|
3628 | Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
|
3629 | Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));
|
3630 | Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));
|
3631 | Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));
|
3632 | Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));
|
3633 | }
|
3634 | }
|
3635 | });
|
3636 |
|
3637 | SyntheticEvent.Interface = EventInterface;
|
3638 |
|
3639 |
|
3640 |
|
3641 |
|
3642 | SyntheticEvent.extend = function (Interface) {
|
3643 | var Super = this;
|
3644 |
|
3645 | var E = function () {};
|
3646 | E.prototype = Super.prototype;
|
3647 | var prototype = new E();
|
3648 |
|
3649 | function Class() {
|
3650 | return Super.apply(this, arguments);
|
3651 | }
|
3652 | _assign(prototype, Class.prototype);
|
3653 | Class.prototype = prototype;
|
3654 | Class.prototype.constructor = Class;
|
3655 |
|
3656 | Class.Interface = _assign({}, Super.Interface, Interface);
|
3657 | Class.extend = Super.extend;
|
3658 | addEventPoolingTo(Class);
|
3659 |
|
3660 | return Class;
|
3661 | };
|
3662 |
|
3663 | addEventPoolingTo(SyntheticEvent);
|
3664 |
|
3665 |
|
3666 |
|
3667 |
|
3668 |
|
3669 |
|
3670 |
|
3671 |
|
3672 | function getPooledWarningPropertyDefinition(propName, getVal) {
|
3673 | var isFunction = typeof getVal === 'function';
|
3674 | return {
|
3675 | configurable: true,
|
3676 | set: set,
|
3677 | get: get
|
3678 | };
|
3679 |
|
3680 | function set(val) {
|
3681 | var action = isFunction ? 'setting the method' : 'setting the property';
|
3682 | warn(action, 'This is effectively a no-op');
|
3683 | return val;
|
3684 | }
|
3685 |
|
3686 | function get() {
|
3687 | var action = isFunction ? 'accessing the method' : 'accessing the property';
|
3688 | var result = isFunction ? 'This is a no-op function' : 'This is set to null';
|
3689 | warn(action, result);
|
3690 | return getVal;
|
3691 | }
|
3692 |
|
3693 | function warn(action, result) {
|
3694 | var warningCondition = false;
|
3695 | !warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
|
3696 | }
|
3697 | }
|
3698 |
|
3699 | function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
|
3700 | var EventConstructor = this;
|
3701 | if (EventConstructor.eventPool.length) {
|
3702 | var instance = EventConstructor.eventPool.pop();
|
3703 | EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
|
3704 | return instance;
|
3705 | }
|
3706 | return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
|
3707 | }
|
3708 |
|
3709 | function releasePooledEvent(event) {
|
3710 | var EventConstructor = this;
|
3711 | !(event instanceof EventConstructor) ? invariant(false, 'Trying to release an event instance into a pool of a different type.') : void 0;
|
3712 | event.destructor();
|
3713 | if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
|
3714 | EventConstructor.eventPool.push(event);
|
3715 | }
|
3716 | }
|
3717 |
|
3718 | function addEventPoolingTo(EventConstructor) {
|
3719 | EventConstructor.eventPool = [];
|
3720 | EventConstructor.getPooled = getPooledEvent;
|
3721 | EventConstructor.release = releasePooledEvent;
|
3722 | }
|
3723 |
|
3724 |
|
3725 |
|
3726 |
|
3727 |
|
3728 | var SyntheticCompositionEvent = SyntheticEvent.extend({
|
3729 | data: null
|
3730 | });
|
3731 |
|
3732 |
|
3733 |
|
3734 |
|
3735 |
|
3736 |
|
3737 | var SyntheticInputEvent = SyntheticEvent.extend({
|
3738 | data: null
|
3739 | });
|
3740 |
|
3741 | var END_KEYCODES = [9, 13, 27, 32];
|
3742 | var START_KEYCODE = 229;
|
3743 |
|
3744 | var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;
|
3745 |
|
3746 | var documentMode = null;
|
3747 | if (canUseDOM && 'documentMode' in document) {
|
3748 | documentMode = document.documentMode;
|
3749 | }
|
3750 |
|
3751 |
|
3752 |
|
3753 |
|
3754 | var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode;
|
3755 |
|
3756 |
|
3757 |
|
3758 |
|
3759 | var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
|
3760 |
|
3761 | var SPACEBAR_CODE = 32;
|
3762 | var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
|
3763 |
|
3764 |
|
3765 | var eventTypes = {
|
3766 | beforeInput: {
|
3767 | phasedRegistrationNames: {
|
3768 | bubbled: 'onBeforeInput',
|
3769 | captured: 'onBeforeInputCapture'
|
3770 | },
|
3771 | dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]
|
3772 | },
|
3773 | compositionEnd: {
|
3774 | phasedRegistrationNames: {
|
3775 | bubbled: 'onCompositionEnd',
|
3776 | captured: 'onCompositionEndCapture'
|
3777 | },
|
3778 | dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
|
3779 | },
|
3780 | compositionStart: {
|
3781 | phasedRegistrationNames: {
|
3782 | bubbled: 'onCompositionStart',
|
3783 | captured: 'onCompositionStartCapture'
|
3784 | },
|
3785 | dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
|
3786 | },
|
3787 | compositionUpdate: {
|
3788 | phasedRegistrationNames: {
|
3789 | bubbled: 'onCompositionUpdate',
|
3790 | captured: 'onCompositionUpdateCapture'
|
3791 | },
|
3792 | dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
|
3793 | }
|
3794 | };
|
3795 |
|
3796 |
|
3797 | var hasSpaceKeypress = false;
|
3798 |
|
3799 |
|
3800 |
|
3801 |
|
3802 |
|
3803 |
|
3804 | function isKeypressCommand(nativeEvent) {
|
3805 | return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
|
3806 |
|
3807 | !(nativeEvent.ctrlKey && nativeEvent.altKey);
|
3808 | }
|
3809 |
|
3810 |
|
3811 |
|
3812 |
|
3813 |
|
3814 |
|
3815 |
|
3816 | function getCompositionEventType(topLevelType) {
|
3817 | switch (topLevelType) {
|
3818 | case TOP_COMPOSITION_START:
|
3819 | return eventTypes.compositionStart;
|
3820 | case TOP_COMPOSITION_END:
|
3821 | return eventTypes.compositionEnd;
|
3822 | case TOP_COMPOSITION_UPDATE:
|
3823 | return eventTypes.compositionUpdate;
|
3824 | }
|
3825 | }
|
3826 |
|
3827 |
|
3828 |
|
3829 |
|
3830 |
|
3831 |
|
3832 |
|
3833 |
|
3834 |
|
3835 | function isFallbackCompositionStart(topLevelType, nativeEvent) {
|
3836 | return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;
|
3837 | }
|
3838 |
|
3839 |
|
3840 |
|
3841 |
|
3842 |
|
3843 |
|
3844 |
|
3845 |
|
3846 | function isFallbackCompositionEnd(topLevelType, nativeEvent) {
|
3847 | switch (topLevelType) {
|
3848 | case TOP_KEY_UP:
|
3849 |
|
3850 | return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
|
3851 | case TOP_KEY_DOWN:
|
3852 |
|
3853 |
|
3854 | return nativeEvent.keyCode !== START_KEYCODE;
|
3855 | case TOP_KEY_PRESS:
|
3856 | case TOP_MOUSE_DOWN:
|
3857 | case TOP_BLUR:
|
3858 |
|
3859 | return true;
|
3860 | default:
|
3861 | return false;
|
3862 | }
|
3863 | }
|
3864 |
|
3865 |
|
3866 |
|
3867 |
|
3868 |
|
3869 |
|
3870 |
|
3871 |
|
3872 |
|
3873 |
|
3874 | function getDataFromCustomEvent(nativeEvent) {
|
3875 | var detail = nativeEvent.detail;
|
3876 | if (typeof detail === 'object' && 'data' in detail) {
|
3877 | return detail.data;
|
3878 | }
|
3879 | return null;
|
3880 | }
|
3881 |
|
3882 |
|
3883 |
|
3884 |
|
3885 |
|
3886 |
|
3887 |
|
3888 |
|
3889 |
|
3890 |
|
3891 |
|
3892 | function isUsingKoreanIME(nativeEvent) {
|
3893 | return nativeEvent.locale === 'ko';
|
3894 | }
|
3895 |
|
3896 |
|
3897 | var isComposing = false;
|
3898 |
|
3899 |
|
3900 |
|
3901 |
|
3902 | function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
3903 | var eventType = void 0;
|
3904 | var fallbackData = void 0;
|
3905 |
|
3906 | if (canUseCompositionEvent) {
|
3907 | eventType = getCompositionEventType(topLevelType);
|
3908 | } else if (!isComposing) {
|
3909 | if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
|
3910 | eventType = eventTypes.compositionStart;
|
3911 | }
|
3912 | } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
|
3913 | eventType = eventTypes.compositionEnd;
|
3914 | }
|
3915 |
|
3916 | if (!eventType) {
|
3917 | return null;
|
3918 | }
|
3919 |
|
3920 | if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
|
3921 |
|
3922 |
|
3923 | if (!isComposing && eventType === eventTypes.compositionStart) {
|
3924 | isComposing = initialize(nativeEventTarget);
|
3925 | } else if (eventType === eventTypes.compositionEnd) {
|
3926 | if (isComposing) {
|
3927 | fallbackData = getData();
|
3928 | }
|
3929 | }
|
3930 | }
|
3931 |
|
3932 | var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
|
3933 |
|
3934 | if (fallbackData) {
|
3935 |
|
3936 |
|
3937 | event.data = fallbackData;
|
3938 | } else {
|
3939 | var customData = getDataFromCustomEvent(nativeEvent);
|
3940 | if (customData !== null) {
|
3941 | event.data = customData;
|
3942 | }
|
3943 | }
|
3944 |
|
3945 | accumulateTwoPhaseDispatches(event);
|
3946 | return event;
|
3947 | }
|
3948 |
|
3949 |
|
3950 |
|
3951 |
|
3952 |
|
3953 |
|
3954 | function getNativeBeforeInputChars(topLevelType, nativeEvent) {
|
3955 | switch (topLevelType) {
|
3956 | case TOP_COMPOSITION_END:
|
3957 | return getDataFromCustomEvent(nativeEvent);
|
3958 | case TOP_KEY_PRESS:
|
3959 | |
3960 |
|
3961 |
|
3962 |
|
3963 |
|
3964 |
|
3965 |
|
3966 |
|
3967 |
|
3968 |
|
3969 |
|
3970 |
|
3971 |
|
3972 |
|
3973 | var which = nativeEvent.which;
|
3974 | if (which !== SPACEBAR_CODE) {
|
3975 | return null;
|
3976 | }
|
3977 |
|
3978 | hasSpaceKeypress = true;
|
3979 | return SPACEBAR_CHAR;
|
3980 |
|
3981 | case TOP_TEXT_INPUT:
|
3982 |
|
3983 | var chars = nativeEvent.data;
|
3984 |
|
3985 |
|
3986 |
|
3987 |
|
3988 | if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
|
3989 | return null;
|
3990 | }
|
3991 |
|
3992 | return chars;
|
3993 |
|
3994 | default:
|
3995 |
|
3996 | return null;
|
3997 | }
|
3998 | }
|
3999 |
|
4000 |
|
4001 |
|
4002 |
|
4003 |
|
4004 |
|
4005 |
|
4006 |
|
4007 |
|
4008 | function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
|
4009 |
|
4010 |
|
4011 |
|
4012 |
|
4013 | if (isComposing) {
|
4014 | if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
|
4015 | var chars = getData();
|
4016 | reset();
|
4017 | isComposing = false;
|
4018 | return chars;
|
4019 | }
|
4020 | return null;
|
4021 | }
|
4022 |
|
4023 | switch (topLevelType) {
|
4024 | case TOP_PASTE:
|
4025 |
|
4026 |
|
4027 | return null;
|
4028 | case TOP_KEY_PRESS:
|
4029 | |
4030 |
|
4031 |
|
4032 |
|
4033 |
|
4034 |
|
4035 |
|
4036 |
|
4037 |
|
4038 |
|
4039 |
|
4040 |
|
4041 |
|
4042 |
|
4043 |
|
4044 |
|
4045 | if (!isKeypressCommand(nativeEvent)) {
|
4046 |
|
4047 |
|
4048 |
|
4049 |
|
4050 |
|
4051 |
|
4052 | if (nativeEvent.char && nativeEvent.char.length > 1) {
|
4053 | return nativeEvent.char;
|
4054 | } else if (nativeEvent.which) {
|
4055 | return String.fromCharCode(nativeEvent.which);
|
4056 | }
|
4057 | }
|
4058 | return null;
|
4059 | case TOP_COMPOSITION_END:
|
4060 | return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
|
4061 | default:
|
4062 | return null;
|
4063 | }
|
4064 | }
|
4065 |
|
4066 |
|
4067 |
|
4068 |
|
4069 |
|
4070 |
|
4071 |
|
4072 | function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
4073 | var chars = void 0;
|
4074 |
|
4075 | if (canUseTextInputEvent) {
|
4076 | chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
|
4077 | } else {
|
4078 | chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
|
4079 | }
|
4080 |
|
4081 |
|
4082 |
|
4083 | if (!chars) {
|
4084 | return null;
|
4085 | }
|
4086 |
|
4087 | var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
|
4088 |
|
4089 | event.data = chars;
|
4090 | accumulateTwoPhaseDispatches(event);
|
4091 | return event;
|
4092 | }
|
4093 |
|
4094 |
|
4095 |
|
4096 |
|
4097 |
|
4098 |
|
4099 |
|
4100 |
|
4101 |
|
4102 |
|
4103 |
|
4104 |
|
4105 |
|
4106 |
|
4107 |
|
4108 |
|
4109 |
|
4110 |
|
4111 |
|
4112 | var BeforeInputEventPlugin = {
|
4113 | eventTypes: eventTypes,
|
4114 |
|
4115 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
4116 | var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
|
4117 |
|
4118 | var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
|
4119 |
|
4120 | if (composition === null) {
|
4121 | return beforeInput;
|
4122 | }
|
4123 |
|
4124 | if (beforeInput === null) {
|
4125 | return composition;
|
4126 | }
|
4127 |
|
4128 | return [composition, beforeInput];
|
4129 | }
|
4130 | };
|
4131 |
|
4132 |
|
4133 |
|
4134 | var restoreImpl = null;
|
4135 | var restoreTarget = null;
|
4136 | var restoreQueue = null;
|
4137 |
|
4138 | function restoreStateOfTarget(target) {
|
4139 |
|
4140 |
|
4141 | var internalInstance = getInstanceFromNode(target);
|
4142 | if (!internalInstance) {
|
4143 |
|
4144 | return;
|
4145 | }
|
4146 | !(typeof restoreImpl === 'function') ? invariant(false, 'setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
4147 | var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);
|
4148 | restoreImpl(internalInstance.stateNode, internalInstance.type, props);
|
4149 | }
|
4150 |
|
4151 | function setRestoreImplementation(impl) {
|
4152 | restoreImpl = impl;
|
4153 | }
|
4154 |
|
4155 | function enqueueStateRestore(target) {
|
4156 | if (restoreTarget) {
|
4157 | if (restoreQueue) {
|
4158 | restoreQueue.push(target);
|
4159 | } else {
|
4160 | restoreQueue = [target];
|
4161 | }
|
4162 | } else {
|
4163 | restoreTarget = target;
|
4164 | }
|
4165 | }
|
4166 |
|
4167 | function needsStateRestore() {
|
4168 | return restoreTarget !== null || restoreQueue !== null;
|
4169 | }
|
4170 |
|
4171 | function restoreStateIfNeeded() {
|
4172 | if (!restoreTarget) {
|
4173 | return;
|
4174 | }
|
4175 | var target = restoreTarget;
|
4176 | var queuedTargets = restoreQueue;
|
4177 | restoreTarget = null;
|
4178 | restoreQueue = null;
|
4179 |
|
4180 | restoreStateOfTarget(target);
|
4181 | if (queuedTargets) {
|
4182 | for (var i = 0; i < queuedTargets.length; i++) {
|
4183 | restoreStateOfTarget(queuedTargets[i]);
|
4184 | }
|
4185 | }
|
4186 | }
|
4187 |
|
4188 |
|
4189 |
|
4190 |
|
4191 |
|
4192 |
|
4193 |
|
4194 |
|
4195 | var _batchedUpdatesImpl = function (fn, bookkeeping) {
|
4196 | return fn(bookkeeping);
|
4197 | };
|
4198 | var _interactiveUpdatesImpl = function (fn, a, b) {
|
4199 | return fn(a, b);
|
4200 | };
|
4201 | var _flushInteractiveUpdatesImpl = function () {};
|
4202 |
|
4203 | var isBatching = false;
|
4204 | function batchedUpdates(fn, bookkeeping) {
|
4205 | if (isBatching) {
|
4206 |
|
4207 |
|
4208 | return fn(bookkeeping);
|
4209 | }
|
4210 | isBatching = true;
|
4211 | try {
|
4212 | return _batchedUpdatesImpl(fn, bookkeeping);
|
4213 | } finally {
|
4214 |
|
4215 |
|
4216 |
|
4217 |
|
4218 | isBatching = false;
|
4219 | var controlledComponentsHavePendingUpdates = needsStateRestore();
|
4220 | if (controlledComponentsHavePendingUpdates) {
|
4221 |
|
4222 |
|
4223 |
|
4224 | _flushInteractiveUpdatesImpl();
|
4225 | restoreStateIfNeeded();
|
4226 | }
|
4227 | }
|
4228 | }
|
4229 |
|
4230 | function interactiveUpdates(fn, a, b) {
|
4231 | return _interactiveUpdatesImpl(fn, a, b);
|
4232 | }
|
4233 |
|
4234 |
|
4235 |
|
4236 | function setBatchingImplementation(batchedUpdatesImpl, interactiveUpdatesImpl, flushInteractiveUpdatesImpl) {
|
4237 | _batchedUpdatesImpl = batchedUpdatesImpl;
|
4238 | _interactiveUpdatesImpl = interactiveUpdatesImpl;
|
4239 | _flushInteractiveUpdatesImpl = flushInteractiveUpdatesImpl;
|
4240 | }
|
4241 |
|
4242 |
|
4243 |
|
4244 |
|
4245 | var supportedInputTypes = {
|
4246 | color: true,
|
4247 | date: true,
|
4248 | datetime: true,
|
4249 | 'datetime-local': true,
|
4250 | email: true,
|
4251 | month: true,
|
4252 | number: true,
|
4253 | password: true,
|
4254 | range: true,
|
4255 | search: true,
|
4256 | tel: true,
|
4257 | text: true,
|
4258 | time: true,
|
4259 | url: true,
|
4260 | week: true
|
4261 | };
|
4262 |
|
4263 | function isTextInputElement(elem) {
|
4264 | var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
4265 |
|
4266 | if (nodeName === 'input') {
|
4267 | return !!supportedInputTypes[elem.type];
|
4268 | }
|
4269 |
|
4270 | if (nodeName === 'textarea') {
|
4271 | return true;
|
4272 | }
|
4273 |
|
4274 | return false;
|
4275 | }
|
4276 |
|
4277 |
|
4278 |
|
4279 |
|
4280 |
|
4281 | var ELEMENT_NODE = 1;
|
4282 | var TEXT_NODE = 3;
|
4283 | var COMMENT_NODE = 8;
|
4284 | var DOCUMENT_NODE = 9;
|
4285 | var DOCUMENT_FRAGMENT_NODE = 11;
|
4286 |
|
4287 |
|
4288 |
|
4289 |
|
4290 |
|
4291 |
|
4292 |
|
4293 |
|
4294 | function getEventTarget(nativeEvent) {
|
4295 |
|
4296 |
|
4297 | var target = nativeEvent.target || nativeEvent.srcElement || window;
|
4298 |
|
4299 |
|
4300 | if (target.correspondingUseElement) {
|
4301 | target = target.correspondingUseElement;
|
4302 | }
|
4303 |
|
4304 |
|
4305 |
|
4306 | return target.nodeType === TEXT_NODE ? target.parentNode : target;
|
4307 | }
|
4308 |
|
4309 |
|
4310 |
|
4311 |
|
4312 |
|
4313 |
|
4314 |
|
4315 |
|
4316 |
|
4317 |
|
4318 |
|
4319 |
|
4320 |
|
4321 |
|
4322 | function isEventSupported(eventNameSuffix) {
|
4323 | if (!canUseDOM) {
|
4324 | return false;
|
4325 | }
|
4326 |
|
4327 | var eventName = 'on' + eventNameSuffix;
|
4328 | var isSupported = eventName in document;
|
4329 |
|
4330 | if (!isSupported) {
|
4331 | var element = document.createElement('div');
|
4332 | element.setAttribute(eventName, 'return;');
|
4333 | isSupported = typeof element[eventName] === 'function';
|
4334 | }
|
4335 |
|
4336 | return isSupported;
|
4337 | }
|
4338 |
|
4339 | function isCheckable(elem) {
|
4340 | var type = elem.type;
|
4341 | var nodeName = elem.nodeName;
|
4342 | return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
|
4343 | }
|
4344 |
|
4345 | function getTracker(node) {
|
4346 | return node._valueTracker;
|
4347 | }
|
4348 |
|
4349 | function detachTracker(node) {
|
4350 | node._valueTracker = null;
|
4351 | }
|
4352 |
|
4353 | function getValueFromNode(node) {
|
4354 | var value = '';
|
4355 | if (!node) {
|
4356 | return value;
|
4357 | }
|
4358 |
|
4359 | if (isCheckable(node)) {
|
4360 | value = node.checked ? 'true' : 'false';
|
4361 | } else {
|
4362 | value = node.value;
|
4363 | }
|
4364 |
|
4365 | return value;
|
4366 | }
|
4367 |
|
4368 | function trackValueOnNode(node) {
|
4369 | var valueField = isCheckable(node) ? 'checked' : 'value';
|
4370 | var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
|
4371 |
|
4372 | var currentValue = '' + node[valueField];
|
4373 |
|
4374 |
|
4375 |
|
4376 |
|
4377 |
|
4378 | if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
|
4379 | return;
|
4380 | }
|
4381 | var get = descriptor.get,
|
4382 | set = descriptor.set;
|
4383 |
|
4384 | Object.defineProperty(node, valueField, {
|
4385 | configurable: true,
|
4386 | get: function () {
|
4387 | return get.call(this);
|
4388 | },
|
4389 | set: function (value) {
|
4390 | currentValue = '' + value;
|
4391 | set.call(this, value);
|
4392 | }
|
4393 | });
|
4394 | // We could've passed this the first time
|
4395 | // but it triggers a bug in IE11 and Edge 14/15.
|
4396 | // Calling defineProperty() again should be equivalent.
|
4397 | // https://github.com/facebook/react/issues/11768
|
4398 | Object.defineProperty(node, valueField, {
|
4399 | enumerable: descriptor.enumerable
|
4400 | });
|
4401 |
|
4402 | var tracker = {
|
4403 | getValue: function () {
|
4404 | return currentValue;
|
4405 | },
|
4406 | setValue: function (value) {
|
4407 | currentValue = '' + value;
|
4408 | },
|
4409 | stopTracking: function () {
|
4410 | detachTracker(node);
|
4411 | delete node[valueField];
|
4412 | }
|
4413 | };
|
4414 | return tracker;
|
4415 | }
|
4416 |
|
4417 | function track(node) {
|
4418 | if (getTracker(node)) {
|
4419 | return;
|
4420 | }
|
4421 |
|
4422 |
|
4423 | node._valueTracker = trackValueOnNode(node);
|
4424 | }
|
4425 |
|
4426 | function updateValueIfChanged(node) {
|
4427 | if (!node) {
|
4428 | return false;
|
4429 | }
|
4430 |
|
4431 | var tracker = getTracker(node);
|
4432 |
|
4433 |
|
4434 | if (!tracker) {
|
4435 | return true;
|
4436 | }
|
4437 |
|
4438 | var lastValue = tracker.getValue();
|
4439 | var nextValue = getValueFromNode(node);
|
4440 | if (nextValue !== lastValue) {
|
4441 | tracker.setValue(nextValue);
|
4442 | return true;
|
4443 | }
|
4444 | return false;
|
4445 | }
|
4446 |
|
4447 | var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
4448 |
|
4449 | var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
4450 |
|
4451 | var describeComponentFrame = function (name, source, ownerName) {
|
4452 | var sourceInfo = '';
|
4453 | if (source) {
|
4454 | var path = source.fileName;
|
4455 | var fileName = path.replace(BEFORE_SLASH_RE, '');
|
4456 | {
|
4457 |
|
4458 |
|
4459 | if (/^index\./.test(fileName)) {
|
4460 | var match = path.match(BEFORE_SLASH_RE);
|
4461 | if (match) {
|
4462 | var pathBeforeSlash = match[1];
|
4463 | if (pathBeforeSlash) {
|
4464 | var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
4465 | fileName = folderName + '/' + fileName;
|
4466 | }
|
4467 | }
|
4468 | }
|
4469 | }
|
4470 | sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
4471 | } else if (ownerName) {
|
4472 | sourceInfo = ' (created by ' + ownerName + ')';
|
4473 | }
|
4474 | return '\n in ' + (name || 'Unknown') + sourceInfo;
|
4475 | };
|
4476 |
|
4477 |
|
4478 |
|
4479 | var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
4480 |
|
4481 | var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
4482 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
4483 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
4484 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
4485 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
4486 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
4487 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
4488 |
|
4489 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
4490 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
4491 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
4492 | var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
4493 | var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
4494 |
|
4495 | var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
4496 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
4497 |
|
4498 | function getIteratorFn(maybeIterable) {
|
4499 | if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
4500 | return null;
|
4501 | }
|
4502 | var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
4503 | if (typeof maybeIterator === 'function') {
|
4504 | return maybeIterator;
|
4505 | }
|
4506 | return null;
|
4507 | }
|
4508 |
|
4509 | var Pending = 0;
|
4510 | var Resolved = 1;
|
4511 | var Rejected = 2;
|
4512 |
|
4513 | function refineResolvedLazyComponent(lazyComponent) {
|
4514 | return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
4515 | }
|
4516 |
|
4517 | function getWrappedName(outerType, innerType, wrapperName) {
|
4518 | var functionName = innerType.displayName || innerType.name || '';
|
4519 | return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
|
4520 | }
|
4521 |
|
4522 | function getComponentName(type) {
|
4523 | if (type == null) {
|
4524 |
|
4525 | return null;
|
4526 | }
|
4527 | {
|
4528 | if (typeof type.tag === 'number') {
|
4529 | warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
4530 | }
|
4531 | }
|
4532 | if (typeof type === 'function') {
|
4533 | return type.displayName || type.name || null;
|
4534 | }
|
4535 | if (typeof type === 'string') {
|
4536 | return type;
|
4537 | }
|
4538 | switch (type) {
|
4539 | case REACT_CONCURRENT_MODE_TYPE:
|
4540 | return 'ConcurrentMode';
|
4541 | case REACT_FRAGMENT_TYPE:
|
4542 | return 'Fragment';
|
4543 | case REACT_PORTAL_TYPE:
|
4544 | return 'Portal';
|
4545 | case REACT_PROFILER_TYPE:
|
4546 | return 'Profiler';
|
4547 | case REACT_STRICT_MODE_TYPE:
|
4548 | return 'StrictMode';
|
4549 | case REACT_SUSPENSE_TYPE:
|
4550 | return 'Suspense';
|
4551 | }
|
4552 | if (typeof type === 'object') {
|
4553 | switch (type.$$typeof) {
|
4554 | case REACT_CONTEXT_TYPE:
|
4555 | return 'Context.Consumer';
|
4556 | case REACT_PROVIDER_TYPE:
|
4557 | return 'Context.Provider';
|
4558 | case REACT_FORWARD_REF_TYPE:
|
4559 | return getWrappedName(type, type.render, 'ForwardRef');
|
4560 | case REACT_MEMO_TYPE:
|
4561 | return getComponentName(type.type);
|
4562 | case REACT_LAZY_TYPE:
|
4563 | {
|
4564 | var thenable = type;
|
4565 | var resolvedThenable = refineResolvedLazyComponent(thenable);
|
4566 | if (resolvedThenable) {
|
4567 | return getComponentName(resolvedThenable);
|
4568 | }
|
4569 | }
|
4570 | }
|
4571 | }
|
4572 | return null;
|
4573 | }
|
4574 |
|
4575 | var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
4576 |
|
4577 | function describeFiber(fiber) {
|
4578 | switch (fiber.tag) {
|
4579 | case HostRoot:
|
4580 | case HostPortal:
|
4581 | case HostText:
|
4582 | case Fragment:
|
4583 | case ContextProvider:
|
4584 | case ContextConsumer:
|
4585 | return '';
|
4586 | default:
|
4587 | var owner = fiber._debugOwner;
|
4588 | var source = fiber._debugSource;
|
4589 | var name = getComponentName(fiber.type);
|
4590 | var ownerName = null;
|
4591 | if (owner) {
|
4592 | ownerName = getComponentName(owner.type);
|
4593 | }
|
4594 | return describeComponentFrame(name, source, ownerName);
|
4595 | }
|
4596 | }
|
4597 |
|
4598 | function getStackByFiberInDevAndProd(workInProgress) {
|
4599 | var info = '';
|
4600 | var node = workInProgress;
|
4601 | do {
|
4602 | info += describeFiber(node);
|
4603 | node = node.return;
|
4604 | } while (node);
|
4605 | return info;
|
4606 | }
|
4607 |
|
4608 | var current = null;
|
4609 | var phase = null;
|
4610 |
|
4611 | function getCurrentFiberOwnerNameInDevOrNull() {
|
4612 | {
|
4613 | if (current === null) {
|
4614 | return null;
|
4615 | }
|
4616 | var owner = current._debugOwner;
|
4617 | if (owner !== null && typeof owner !== 'undefined') {
|
4618 | return getComponentName(owner.type);
|
4619 | }
|
4620 | }
|
4621 | return null;
|
4622 | }
|
4623 |
|
4624 | function getCurrentFiberStackInDev() {
|
4625 | {
|
4626 | if (current === null) {
|
4627 | return '';
|
4628 | }
|
4629 |
|
4630 |
|
4631 | return getStackByFiberInDevAndProd(current);
|
4632 | }
|
4633 | return '';
|
4634 | }
|
4635 |
|
4636 | function resetCurrentFiber() {
|
4637 | {
|
4638 | ReactDebugCurrentFrame.getCurrentStack = null;
|
4639 | current = null;
|
4640 | phase = null;
|
4641 | }
|
4642 | }
|
4643 |
|
4644 | function setCurrentFiber(fiber) {
|
4645 | {
|
4646 | ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
|
4647 | current = fiber;
|
4648 | phase = null;
|
4649 | }
|
4650 | }
|
4651 |
|
4652 | function setCurrentPhase(lifeCyclePhase) {
|
4653 | {
|
4654 | phase = lifeCyclePhase;
|
4655 | }
|
4656 | }
|
4657 |
|
4658 |
|
4659 |
|
4660 |
|
4661 |
|
4662 |
|
4663 |
|
4664 |
|
4665 | var warning = warningWithoutStack$1;
|
4666 |
|
4667 | {
|
4668 | warning = function (condition, format) {
|
4669 | if (condition) {
|
4670 | return;
|
4671 | }
|
4672 | var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
4673 | var stack = ReactDebugCurrentFrame.getStackAddendum();
|
4674 |
|
4675 |
|
4676 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
4677 | args[_key - 2] = arguments[_key];
|
4678 | }
|
4679 |
|
4680 | warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
|
4681 | };
|
4682 | }
|
4683 |
|
4684 | var warning$1 = warning;
|
4685 |
|
4686 |
|
4687 |
|
4688 | var RESERVED = 0;
|
4689 |
|
4690 |
|
4691 |
|
4692 | var STRING = 1;
|
4693 |
|
4694 |
|
4695 |
|
4696 |
|
4697 |
|
4698 | var BOOLEANISH_STRING = 2;
|
4699 |
|
4700 |
|
4701 |
|
4702 |
|
4703 | var BOOLEAN = 3;
|
4704 |
|
4705 |
|
4706 |
|
4707 |
|
4708 |
|
4709 | var OVERLOADED_BOOLEAN = 4;
|
4710 |
|
4711 |
|
4712 |
|
4713 | var NUMERIC = 5;
|
4714 |
|
4715 |
|
4716 |
|
4717 | var POSITIVE_NUMERIC = 6;
|
4718 |
|
4719 |
|
4720 | 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';
|
4721 |
|
4722 | var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
|
4723 |
|
4724 |
|
4725 | var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
|
4726 | var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
4727 |
|
4728 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
4729 | var illegalAttributeNameCache = {};
|
4730 | var validatedAttributeNameCache = {};
|
4731 |
|
4732 | function isAttributeNameSafe(attributeName) {
|
4733 | if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
|
4734 | return true;
|
4735 | }
|
4736 | if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
|
4737 | return false;
|
4738 | }
|
4739 | if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
|
4740 | validatedAttributeNameCache[attributeName] = true;
|
4741 | return true;
|
4742 | }
|
4743 | illegalAttributeNameCache[attributeName] = true;
|
4744 | {
|
4745 | warning$1(false, 'Invalid attribute name: `%s`', attributeName);
|
4746 | }
|
4747 | return false;
|
4748 | }
|
4749 |
|
4750 | function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
|
4751 | if (propertyInfo !== null) {
|
4752 | return propertyInfo.type === RESERVED;
|
4753 | }
|
4754 | if (isCustomComponentTag) {
|
4755 | return false;
|
4756 | }
|
4757 | if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
|
4758 | return true;
|
4759 | }
|
4760 | return false;
|
4761 | }
|
4762 |
|
4763 | function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
|
4764 | if (propertyInfo !== null && propertyInfo.type === RESERVED) {
|
4765 | return false;
|
4766 | }
|
4767 | switch (typeof value) {
|
4768 | case 'function':
|
4769 |
|
4770 | case 'symbol':
|
4771 |
|
4772 | return true;
|
4773 | case 'boolean':
|
4774 | {
|
4775 | if (isCustomComponentTag) {
|
4776 | return false;
|
4777 | }
|
4778 | if (propertyInfo !== null) {
|
4779 | return !propertyInfo.acceptsBooleans;
|
4780 | } else {
|
4781 | var prefix = name.toLowerCase().slice(0, 5);
|
4782 | return prefix !== 'data-' && prefix !== 'aria-';
|
4783 | }
|
4784 | }
|
4785 | default:
|
4786 | return false;
|
4787 | }
|
4788 | }
|
4789 |
|
4790 | function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
|
4791 | if (value === null || typeof value === 'undefined') {
|
4792 | return true;
|
4793 | }
|
4794 | if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
|
4795 | return true;
|
4796 | }
|
4797 | if (isCustomComponentTag) {
|
4798 | return false;
|
4799 | }
|
4800 | if (propertyInfo !== null) {
|
4801 | switch (propertyInfo.type) {
|
4802 | case BOOLEAN:
|
4803 | return !value;
|
4804 | case OVERLOADED_BOOLEAN:
|
4805 | return value === false;
|
4806 | case NUMERIC:
|
4807 | return isNaN(value);
|
4808 | case POSITIVE_NUMERIC:
|
4809 | return isNaN(value) || value < 1;
|
4810 | }
|
4811 | }
|
4812 | return false;
|
4813 | }
|
4814 |
|
4815 | function getPropertyInfo(name) {
|
4816 | return properties.hasOwnProperty(name) ? properties[name] : null;
|
4817 | }
|
4818 |
|
4819 | function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace) {
|
4820 | this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
|
4821 | this.attributeName = attributeName;
|
4822 | this.attributeNamespace = attributeNamespace;
|
4823 | this.mustUseProperty = mustUseProperty;
|
4824 | this.propertyName = name;
|
4825 | this.type = type;
|
4826 | }
|
4827 |
|
4828 |
|
4829 |
|
4830 |
|
4831 | var properties = {};
|
4832 |
|
4833 |
|
4834 | ['children', 'dangerouslySetInnerHTML',
|
4835 |
|
4836 |
|
4837 |
|
4838 | 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
|
4839 | properties[name] = new PropertyInfoRecord(name, RESERVED, false,
|
4840 | name,
|
4841 | null);
|
4842 | }
|
4843 | );
|
4844 |
|
4845 |
|
4846 |
|
4847 | [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
|
4848 | var name = _ref[0],
|
4849 | attributeName = _ref[1];
|
4850 |
|
4851 | properties[name] = new PropertyInfoRecord(name, STRING, false,
|
4852 | attributeName,
|
4853 | null);
|
4854 | }
|
4855 | );
|
4856 |
|
4857 |
|
4858 |
|
4859 |
|
4860 | ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
|
4861 | properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false,
|
4862 | name.toLowerCase(),
|
4863 | null);
|
4864 | }
|
4865 | );
|
4866 |
|
4867 |
|
4868 |
|
4869 |
|
4870 |
|
4871 | ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
|
4872 | properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false,
|
4873 | name,
|
4874 | null);
|
4875 | }
|
4876 | );
|
4877 |
|
4878 |
|
4879 | ['allowFullScreen', 'async',
|
4880 |
|
4881 |
|
4882 | 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless',
|
4883 |
|
4884 | 'itemScope'].forEach(function (name) {
|
4885 | properties[name] = new PropertyInfoRecord(name, BOOLEAN, false,
|
4886 | name.toLowerCase(),
|
4887 | null);
|
4888 | }
|
4889 | );
|
4890 |
|
4891 |
|
4892 |
|
4893 | ['checked',
|
4894 |
|
4895 |
|
4896 | 'multiple', 'muted', 'selected'].forEach(function (name) {
|
4897 | properties[name] = new PropertyInfoRecord(name, BOOLEAN, true,
|
4898 | name,
|
4899 | null);
|
4900 | }
|
4901 | );
|
4902 |
|
4903 |
|
4904 |
|
4905 | ['capture', 'download'].forEach(function (name) {
|
4906 | properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false,
|
4907 | name,
|
4908 | null);
|
4909 | }
|
4910 | );
|
4911 |
|
4912 |
|
4913 | ['cols', 'rows', 'size', 'span'].forEach(function (name) {
|
4914 | properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false,
|
4915 | name,
|
4916 | null);
|
4917 | }
|
4918 | );
|
4919 |
|
4920 |
|
4921 | ['rowSpan', 'start'].forEach(function (name) {
|
4922 | properties[name] = new PropertyInfoRecord(name, NUMERIC, false,
|
4923 | name.toLowerCase(),
|
4924 | null);
|
4925 | }
|
4926 | );
|
4927 |
|
4928 | var CAMELIZE = /[\-\:]([a-z])/g;
|
4929 | var capitalize = function (token) {
|
4930 | return token[1].toUpperCase();
|
4931 | };
|
4932 |
|
4933 |
|
4934 |
|
4935 |
|
4936 |
|
4937 |
|
4938 | ['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) {
|
4939 | var name = attributeName.replace(CAMELIZE, capitalize);
|
4940 | properties[name] = new PropertyInfoRecord(name, STRING, false,
|
4941 | attributeName, null);
|
4942 | }
|
4943 | );
|
4944 |
|
4945 |
|
4946 | ['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
|
4947 | var name = attributeName.replace(CAMELIZE, capitalize);
|
4948 | properties[name] = new PropertyInfoRecord(name, STRING, false,
|
4949 | attributeName, 'http://www.w3.org/1999/xlink');
|
4950 | });
|
4951 |
|
4952 |
|
4953 | ['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
|
4954 | var name = attributeName.replace(CAMELIZE, capitalize);
|
4955 | properties[name] = new PropertyInfoRecord(name, STRING, false,
|
4956 | attributeName, 'http://www.w3.org/XML/1998/namespace');
|
4957 | });
|
4958 |
|
4959 |
|
4960 |
|
4961 |
|
4962 | properties.tabIndex = new PropertyInfoRecord('tabIndex', STRING, false,
|
4963 | 'tabindex',
|
4964 | null);
|
4965 |
|
4966 |
|
4967 |
|
4968 |
|
4969 |
|
4970 |
|
4971 | function getValueForProperty(node, name, expected, propertyInfo) {
|
4972 | {
|
4973 | if (propertyInfo.mustUseProperty) {
|
4974 | var propertyName = propertyInfo.propertyName;
|
4975 |
|
4976 | return node[propertyName];
|
4977 | } else {
|
4978 | var attributeName = propertyInfo.attributeName;
|
4979 |
|
4980 | var stringValue = null;
|
4981 |
|
4982 | if (propertyInfo.type === OVERLOADED_BOOLEAN) {
|
4983 | if (node.hasAttribute(attributeName)) {
|
4984 | var value = node.getAttribute(attributeName);
|
4985 | if (value === '') {
|
4986 | return true;
|
4987 | }
|
4988 | if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
|
4989 | return value;
|
4990 | }
|
4991 | if (value === '' + expected) {
|
4992 | return expected;
|
4993 | }
|
4994 | return value;
|
4995 | }
|
4996 | } else if (node.hasAttribute(attributeName)) {
|
4997 | if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
|
4998 |
|
4999 |
|
5000 | return node.getAttribute(attributeName);
|
5001 | }
|
5002 | if (propertyInfo.type === BOOLEAN) {
|
5003 |
|
5004 |
|
5005 | return expected;
|
5006 | }
|
5007 |
|
5008 |
|
5009 |
|
5010 |
|
5011 | stringValue = node.getAttribute(attributeName);
|
5012 | }
|
5013 |
|
5014 | if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
|
5015 | return stringValue === null ? expected : stringValue;
|
5016 | } else if (stringValue === '' + expected) {
|
5017 | return expected;
|
5018 | } else {
|
5019 | return stringValue;
|
5020 | }
|
5021 | }
|
5022 | }
|
5023 | }
|
5024 |
|
5025 |
|
5026 |
|
5027 |
|
5028 |
|
5029 |
|
5030 | function getValueForAttribute(node, name, expected) {
|
5031 | {
|
5032 | if (!isAttributeNameSafe(name)) {
|
5033 | return;
|
5034 | }
|
5035 | if (!node.hasAttribute(name)) {
|
5036 | return expected === undefined ? undefined : null;
|
5037 | }
|
5038 | var value = node.getAttribute(name);
|
5039 | if (value === '' + expected) {
|
5040 | return expected;
|
5041 | }
|
5042 | return value;
|
5043 | }
|
5044 | }
|
5045 |
|
5046 |
|
5047 |
|
5048 |
|
5049 |
|
5050 |
|
5051 |
|
5052 |
|
5053 | function setValueForProperty(node, name, value, isCustomComponentTag) {
|
5054 | var propertyInfo = getPropertyInfo(name);
|
5055 | if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
|
5056 | return;
|
5057 | }
|
5058 | if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
|
5059 | value = null;
|
5060 | }
|
5061 |
|
5062 | if (isCustomComponentTag || propertyInfo === null) {
|
5063 | if (isAttributeNameSafe(name)) {
|
5064 | var _attributeName = name;
|
5065 | if (value === null) {
|
5066 | node.removeAttribute(_attributeName);
|
5067 | } else {
|
5068 | node.setAttribute(_attributeName, '' + value);
|
5069 | }
|
5070 | }
|
5071 | return;
|
5072 | }
|
5073 | var mustUseProperty = propertyInfo.mustUseProperty;
|
5074 |
|
5075 | if (mustUseProperty) {
|
5076 | var propertyName = propertyInfo.propertyName;
|
5077 |
|
5078 | if (value === null) {
|
5079 | var type = propertyInfo.type;
|
5080 |
|
5081 | node[propertyName] = type === BOOLEAN ? false : '';
|
5082 | } else {
|
5083 |
|
5084 |
|
5085 | node[propertyName] = value;
|
5086 | }
|
5087 | return;
|
5088 | }
|
5089 |
|
5090 | var attributeName = propertyInfo.attributeName,
|
5091 | attributeNamespace = propertyInfo.attributeNamespace;
|
5092 |
|
5093 | if (value === null) {
|
5094 | node.removeAttribute(attributeName);
|
5095 | } else {
|
5096 | var _type = propertyInfo.type;
|
5097 |
|
5098 | var attributeValue = void 0;
|
5099 | if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
|
5100 | attributeValue = '';
|
5101 | } else {
|
5102 |
|
5103 |
|
5104 | attributeValue = '' + value;
|
5105 | }
|
5106 | if (attributeNamespace) {
|
5107 | node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
|
5108 | } else {
|
5109 | node.setAttribute(attributeName, attributeValue);
|
5110 | }
|
5111 | }
|
5112 | }
|
5113 |
|
5114 |
|
5115 |
|
5116 |
|
5117 | function toString(value) {
|
5118 | return '' + value;
|
5119 | }
|
5120 |
|
5121 | function getToStringValue(value) {
|
5122 | switch (typeof value) {
|
5123 | case 'boolean':
|
5124 | case 'number':
|
5125 | case 'object':
|
5126 | case 'string':
|
5127 | case 'undefined':
|
5128 | return value;
|
5129 | default:
|
5130 |
|
5131 | return '';
|
5132 | }
|
5133 | }
|
5134 |
|
5135 | var ReactDebugCurrentFrame$1 = null;
|
5136 |
|
5137 | var ReactControlledValuePropTypes = {
|
5138 | checkPropTypes: null
|
5139 | };
|
5140 |
|
5141 | {
|
5142 | ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
5143 |
|
5144 | var hasReadOnlyValue = {
|
5145 | button: true,
|
5146 | checkbox: true,
|
5147 | image: true,
|
5148 | hidden: true,
|
5149 | radio: true,
|
5150 | reset: true,
|
5151 | submit: true
|
5152 | };
|
5153 |
|
5154 | var propTypes = {
|
5155 | value: function (props, propName, componentName) {
|
5156 | if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null) {
|
5157 | return null;
|
5158 | }
|
5159 | 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`.');
|
5160 | },
|
5161 | checked: function (props, propName, componentName) {
|
5162 | if (props.onChange || props.readOnly || props.disabled || props[propName] == null) {
|
5163 | return null;
|
5164 | }
|
5165 | 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`.');
|
5166 | }
|
5167 | };
|
5168 |
|
5169 | |
5170 |
|
5171 |
|
5172 |
|
5173 | ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
|
5174 | checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$1.getStackAddendum);
|
5175 | };
|
5176 | }
|
5177 |
|
5178 | var enableUserTimingAPI = true;
|
5179 |
|
5180 | var enableHooks = false;
|
5181 |
|
5182 | var debugRenderPhaseSideEffects = false;
|
5183 |
|
5184 |
|
5185 |
|
5186 |
|
5187 |
|
5188 | var debugRenderPhaseSideEffectsForStrictMode = true;
|
5189 |
|
5190 |
|
5191 |
|
5192 | var replayFailedUnitOfWorkWithInvokeGuardedCallback = true;
|
5193 |
|
5194 |
|
5195 | var warnAboutDeprecatedLifecycles = false;
|
5196 |
|
5197 |
|
5198 | var enableProfilerTimer = true;
|
5199 |
|
5200 |
|
5201 | var enableSchedulerTracing = true;
|
5202 |
|
5203 |
|
5204 |
|
5205 |
|
5206 |
|
5207 |
|
5208 |
|
5209 |
|
5210 |
|
5211 |
|
5212 |
|
5213 |
|
5214 | var disableInputAttributeSyncing = false;
|
5215 |
|
5216 |
|
5217 |
|
5218 | var enableStableConcurrentModeAPIs = false;
|
5219 |
|
5220 | var warnAboutShorthandPropertyCollision = false;
|
5221 |
|
5222 |
|
5223 | var didWarnValueDefaultValue = false;
|
5224 | var didWarnCheckedDefaultChecked = false;
|
5225 | var didWarnControlledToUncontrolled = false;
|
5226 | var didWarnUncontrolledToControlled = false;
|
5227 |
|
5228 | function isControlled(props) {
|
5229 | var usesChecked = props.type === 'checkbox' || props.type === 'radio';
|
5230 | return usesChecked ? props.checked != null : props.value != null;
|
5231 | }
|
5232 |
|
5233 |
|
5234 |
|
5235 |
|
5236 |
|
5237 |
|
5238 |
|
5239 |
|
5240 |
|
5241 |
|
5242 |
|
5243 |
|
5244 |
|
5245 |
|
5246 |
|
5247 |
|
5248 |
|
5249 |
|
5250 | function getHostProps(element, props) {
|
5251 | var node = element;
|
5252 | var checked = props.checked;
|
5253 |
|
5254 | var hostProps = _assign({}, props, {
|
5255 | defaultChecked: undefined,
|
5256 | defaultValue: undefined,
|
5257 | value: undefined,
|
5258 | checked: checked != null ? checked : node._wrapperState.initialChecked
|
5259 | });
|
5260 |
|
5261 | return hostProps;
|
5262 | }
|
5263 |
|
5264 | function initWrapperState(element, props) {
|
5265 | {
|
5266 | ReactControlledValuePropTypes.checkPropTypes('input', props);
|
5267 |
|
5268 | if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
|
5269 | 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', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
|
5270 | didWarnCheckedDefaultChecked = true;
|
5271 | }
|
5272 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
|
5273 | 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', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
|
5274 | didWarnValueDefaultValue = true;
|
5275 | }
|
5276 | }
|
5277 |
|
5278 | var node = element;
|
5279 | var defaultValue = props.defaultValue == null ? '' : props.defaultValue;
|
5280 |
|
5281 | node._wrapperState = {
|
5282 | initialChecked: props.checked != null ? props.checked : props.defaultChecked,
|
5283 | initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
|
5284 | controlled: isControlled(props)
|
5285 | };
|
5286 | }
|
5287 |
|
5288 | function updateChecked(element, props) {
|
5289 | var node = element;
|
5290 | var checked = props.checked;
|
5291 | if (checked != null) {
|
5292 | setValueForProperty(node, 'checked', checked, false);
|
5293 | }
|
5294 | }
|
5295 |
|
5296 | function updateWrapper(element, props) {
|
5297 | var node = element;
|
5298 | {
|
5299 | var _controlled = isControlled(props);
|
5300 |
|
5301 | if (!node._wrapperState.controlled && _controlled && !didWarnUncontrolledToControlled) {
|
5302 | warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
|
5303 | didWarnUncontrolledToControlled = true;
|
5304 | }
|
5305 | if (node._wrapperState.controlled && !_controlled && !didWarnControlledToUncontrolled) {
|
5306 | warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
|
5307 | didWarnControlledToUncontrolled = true;
|
5308 | }
|
5309 | }
|
5310 |
|
5311 | updateChecked(element, props);
|
5312 |
|
5313 | var value = getToStringValue(props.value);
|
5314 | var type = props.type;
|
5315 |
|
5316 | if (value != null) {
|
5317 | if (type === 'number') {
|
5318 | if (value === 0 && node.value === '' ||
|
5319 |
|
5320 |
|
5321 | node.value != value) {
|
5322 | node.value = toString(value);
|
5323 | }
|
5324 | } else if (node.value !== toString(value)) {
|
5325 | node.value = toString(value);
|
5326 | }
|
5327 | } else if (type === 'submit' || type === 'reset') {
|
5328 |
|
5329 |
|
5330 | node.removeAttribute('value');
|
5331 | return;
|
5332 | }
|
5333 |
|
5334 | if (disableInputAttributeSyncing) {
|
5335 |
|
5336 |
|
5337 |
|
5338 | if (props.hasOwnProperty('defaultValue')) {
|
5339 | setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
|
5340 | }
|
5341 | } else {
|
5342 |
|
5343 |
|
5344 |
|
5345 |
|
5346 |
|
5347 | if (props.hasOwnProperty('value')) {
|
5348 | setDefaultValue(node, props.type, value);
|
5349 | } else if (props.hasOwnProperty('defaultValue')) {
|
5350 | setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
|
5351 | }
|
5352 | }
|
5353 |
|
5354 | if (disableInputAttributeSyncing) {
|
5355 |
|
5356 |
|
5357 |
|
5358 | if (props.defaultChecked == null) {
|
5359 | node.removeAttribute('checked');
|
5360 | } else {
|
5361 | node.defaultChecked = !!props.defaultChecked;
|
5362 | }
|
5363 | } else {
|
5364 |
|
5365 |
|
5366 | if (props.checked == null && props.defaultChecked != null) {
|
5367 | node.defaultChecked = !!props.defaultChecked;
|
5368 | }
|
5369 | }
|
5370 | }
|
5371 |
|
5372 | function postMountWrapper(element, props, isHydrating) {
|
5373 | var node = element;
|
5374 |
|
5375 |
|
5376 |
|
5377 | if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {
|
5378 | var type = props.type;
|
5379 | var isButton = type === 'submit' || type === 'reset';
|
5380 |
|
5381 |
|
5382 |
|
5383 | if (isButton && (props.value === undefined || props.value === null)) {
|
5384 | return;
|
5385 | }
|
5386 |
|
5387 | var _initialValue = toString(node._wrapperState.initialValue);
|
5388 |
|
5389 |
|
5390 |
|
5391 | if (!isHydrating) {
|
5392 | if (disableInputAttributeSyncing) {
|
5393 | var value = getToStringValue(props.value);
|
5394 |
|
5395 |
|
5396 |
|
5397 | if (value != null) {
|
5398 |
|
5399 |
|
5400 |
|
5401 |
|
5402 |
|
5403 |
|
5404 |
|
5405 |
|
5406 | if (isButton || value !== node.value) {
|
5407 | node.value = toString(value);
|
5408 | }
|
5409 | }
|
5410 | } else {
|
5411 |
|
5412 |
|
5413 |
|
5414 |
|
5415 |
|
5416 |
|
5417 | if (_initialValue !== node.value) {
|
5418 | node.value = _initialValue;
|
5419 | }
|
5420 | }
|
5421 | }
|
5422 |
|
5423 | if (disableInputAttributeSyncing) {
|
5424 |
|
5425 |
|
5426 | var defaultValue = getToStringValue(props.defaultValue);
|
5427 | if (defaultValue != null) {
|
5428 | node.defaultValue = toString(defaultValue);
|
5429 | }
|
5430 | } else {
|
5431 |
|
5432 |
|
5433 |
|
5434 | node.defaultValue = _initialValue;
|
5435 | }
|
5436 | }
|
5437 |
|
5438 |
|
5439 |
|
5440 |
|
5441 |
|
5442 |
|
5443 | var name = node.name;
|
5444 | if (name !== '') {
|
5445 | node.name = '';
|
5446 | }
|
5447 |
|
5448 | if (disableInputAttributeSyncing) {
|
5449 |
|
5450 |
|
5451 |
|
5452 |
|
5453 | if (!isHydrating) {
|
5454 | updateChecked(element, props);
|
5455 | }
|
5456 |
|
5457 |
|
5458 |
|
5459 |
|
5460 | if (props.hasOwnProperty('defaultChecked')) {
|
5461 | node.defaultChecked = !node.defaultChecked;
|
5462 | node.defaultChecked = !!props.defaultChecked;
|
5463 | }
|
5464 | } else {
|
5465 |
|
5466 |
|
5467 |
|
5468 |
|
5469 |
|
5470 |
|
5471 | node.defaultChecked = !node.defaultChecked;
|
5472 | node.defaultChecked = !!node._wrapperState.initialChecked;
|
5473 | }
|
5474 |
|
5475 | if (name !== '') {
|
5476 | node.name = name;
|
5477 | }
|
5478 | }
|
5479 |
|
5480 | function restoreControlledState(element, props) {
|
5481 | var node = element;
|
5482 | updateWrapper(node, props);
|
5483 | updateNamedCousins(node, props);
|
5484 | }
|
5485 |
|
5486 | function updateNamedCousins(rootNode, props) {
|
5487 | var name = props.name;
|
5488 | if (props.type === 'radio' && name != null) {
|
5489 | var queryRoot = rootNode;
|
5490 |
|
5491 | while (queryRoot.parentNode) {
|
5492 | queryRoot = queryRoot.parentNode;
|
5493 | }
|
5494 |
|
5495 |
|
5496 |
|
5497 |
|
5498 |
|
5499 |
|
5500 |
|
5501 |
|
5502 | var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
|
5503 |
|
5504 | for (var i = 0; i < group.length; i++) {
|
5505 | var otherNode = group[i];
|
5506 | if (otherNode === rootNode || otherNode.form !== rootNode.form) {
|
5507 | continue;
|
5508 | }
|
5509 |
|
5510 |
|
5511 |
|
5512 |
|
5513 | var otherProps = getFiberCurrentPropsFromNode$1(otherNode);
|
5514 | !otherProps ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : void 0;
|
5515 |
|
5516 |
|
5517 |
|
5518 | updateValueIfChanged(otherNode);
|
5519 |
|
5520 |
|
5521 |
|
5522 |
|
5523 | updateWrapper(otherNode, otherProps);
|
5524 | }
|
5525 | }
|
5526 | }
|
5527 |
|
5528 |
|
5529 |
|
5530 |
|
5531 |
|
5532 |
|
5533 |
|
5534 |
|
5535 |
|
5536 | function setDefaultValue(node, type, value) {
|
5537 | if (
|
5538 |
|
5539 | type !== 'number' || node.ownerDocument.activeElement !== node) {
|
5540 | if (value == null) {
|
5541 | node.defaultValue = toString(node._wrapperState.initialValue);
|
5542 | } else if (node.defaultValue !== toString(value)) {
|
5543 | node.defaultValue = toString(value);
|
5544 | }
|
5545 | }
|
5546 | }
|
5547 |
|
5548 | var eventTypes$1 = {
|
5549 | change: {
|
5550 | phasedRegistrationNames: {
|
5551 | bubbled: 'onChange',
|
5552 | captured: 'onChangeCapture'
|
5553 | },
|
5554 | dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]
|
5555 | }
|
5556 | };
|
5557 |
|
5558 | function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
|
5559 | var event = SyntheticEvent.getPooled(eventTypes$1.change, inst, nativeEvent, target);
|
5560 | event.type = 'change';
|
5561 |
|
5562 | enqueueStateRestore(target);
|
5563 | accumulateTwoPhaseDispatches(event);
|
5564 | return event;
|
5565 | }
|
5566 |
|
5567 |
|
5568 |
|
5569 | var activeElement = null;
|
5570 | var activeElementInst = null;
|
5571 |
|
5572 |
|
5573 |
|
5574 |
|
5575 | function shouldUseChangeEvent(elem) {
|
5576 | var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
|
5577 | return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
|
5578 | }
|
5579 |
|
5580 | function manualDispatchChangeEvent(nativeEvent) {
|
5581 | var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent));
|
5582 |
|
5583 |
|
5584 |
|
5585 |
|
5586 |
|
5587 |
|
5588 |
|
5589 |
|
5590 |
|
5591 |
|
5592 |
|
5593 |
|
5594 | batchedUpdates(runEventInBatch, event);
|
5595 | }
|
5596 |
|
5597 | function runEventInBatch(event) {
|
5598 | runEventsInBatch(event);
|
5599 | }
|
5600 |
|
5601 | function getInstIfValueChanged(targetInst) {
|
5602 | var targetNode = getNodeFromInstance$1(targetInst);
|
5603 | if (updateValueIfChanged(targetNode)) {
|
5604 | return targetInst;
|
5605 | }
|
5606 | }
|
5607 |
|
5608 | function getTargetInstForChangeEvent(topLevelType, targetInst) {
|
5609 | if (topLevelType === TOP_CHANGE) {
|
5610 | return targetInst;
|
5611 | }
|
5612 | }
|
5613 |
|
5614 |
|
5615 |
|
5616 |
|
5617 | var isInputEventSupported = false;
|
5618 | if (canUseDOM) {
|
5619 |
|
5620 |
|
5621 | isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
|
5622 | }
|
5623 |
|
5624 |
|
5625 |
|
5626 |
|
5627 |
|
5628 |
|
5629 | function startWatchingForValueChange(target, targetInst) {
|
5630 | activeElement = target;
|
5631 | activeElementInst = targetInst;
|
5632 | activeElement.attachEvent('onpropertychange', handlePropertyChange);
|
5633 | }
|
5634 |
|
5635 |
|
5636 |
|
5637 |
|
5638 |
|
5639 | function stopWatchingForValueChange() {
|
5640 | if (!activeElement) {
|
5641 | return;
|
5642 | }
|
5643 | activeElement.detachEvent('onpropertychange', handlePropertyChange);
|
5644 | activeElement = null;
|
5645 | activeElementInst = null;
|
5646 | }
|
5647 |
|
5648 |
|
5649 |
|
5650 |
|
5651 |
|
5652 | function handlePropertyChange(nativeEvent) {
|
5653 | if (nativeEvent.propertyName !== 'value') {
|
5654 | return;
|
5655 | }
|
5656 | if (getInstIfValueChanged(activeElementInst)) {
|
5657 | manualDispatchChangeEvent(nativeEvent);
|
5658 | }
|
5659 | }
|
5660 |
|
5661 | function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
|
5662 | if (topLevelType === TOP_FOCUS) {
|
5663 |
|
5664 |
|
5665 |
|
5666 |
|
5667 |
|
5668 |
|
5669 |
|
5670 |
|
5671 |
|
5672 |
|
5673 | stopWatchingForValueChange();
|
5674 | startWatchingForValueChange(target, targetInst);
|
5675 | } else if (topLevelType === TOP_BLUR) {
|
5676 | stopWatchingForValueChange();
|
5677 | }
|
5678 | }
|
5679 |
|
5680 |
|
5681 | function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
|
5682 | if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {
|
5683 |
|
5684 |
|
5685 |
|
5686 |
|
5687 |
|
5688 |
|
5689 |
|
5690 |
|
5691 |
|
5692 |
|
5693 | return getInstIfValueChanged(activeElementInst);
|
5694 | }
|
5695 | }
|
5696 |
|
5697 |
|
5698 |
|
5699 |
|
5700 | function shouldUseClickEvent(elem) {
|
5701 |
|
5702 |
|
5703 |
|
5704 | var nodeName = elem.nodeName;
|
5705 | return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
|
5706 | }
|
5707 |
|
5708 | function getTargetInstForClickEvent(topLevelType, targetInst) {
|
5709 | if (topLevelType === TOP_CLICK) {
|
5710 | return getInstIfValueChanged(targetInst);
|
5711 | }
|
5712 | }
|
5713 |
|
5714 | function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
|
5715 | if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {
|
5716 | return getInstIfValueChanged(targetInst);
|
5717 | }
|
5718 | }
|
5719 |
|
5720 | function handleControlledInputBlur(node) {
|
5721 | var state = node._wrapperState;
|
5722 |
|
5723 | if (!state || !state.controlled || node.type !== 'number') {
|
5724 | return;
|
5725 | }
|
5726 |
|
5727 | if (!disableInputAttributeSyncing) {
|
5728 |
|
5729 | setDefaultValue(node, 'number', node.value);
|
5730 | }
|
5731 | }
|
5732 |
|
5733 |
|
5734 |
|
5735 |
|
5736 |
|
5737 |
|
5738 |
|
5739 |
|
5740 |
|
5741 |
|
5742 |
|
5743 | var ChangeEventPlugin = {
|
5744 | eventTypes: eventTypes$1,
|
5745 |
|
5746 | _isInputEventSupported: isInputEventSupported,
|
5747 |
|
5748 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
5749 | var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
|
5750 |
|
5751 | var getTargetInstFunc = void 0,
|
5752 | handleEventFunc = void 0;
|
5753 | if (shouldUseChangeEvent(targetNode)) {
|
5754 | getTargetInstFunc = getTargetInstForChangeEvent;
|
5755 | } else if (isTextInputElement(targetNode)) {
|
5756 | if (isInputEventSupported) {
|
5757 | getTargetInstFunc = getTargetInstForInputOrChangeEvent;
|
5758 | } else {
|
5759 | getTargetInstFunc = getTargetInstForInputEventPolyfill;
|
5760 | handleEventFunc = handleEventsForInputEventPolyfill;
|
5761 | }
|
5762 | } else if (shouldUseClickEvent(targetNode)) {
|
5763 | getTargetInstFunc = getTargetInstForClickEvent;
|
5764 | }
|
5765 |
|
5766 | if (getTargetInstFunc) {
|
5767 | var inst = getTargetInstFunc(topLevelType, targetInst);
|
5768 | if (inst) {
|
5769 | var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
|
5770 | return event;
|
5771 | }
|
5772 | }
|
5773 |
|
5774 | if (handleEventFunc) {
|
5775 | handleEventFunc(topLevelType, targetNode, targetInst);
|
5776 | }
|
5777 |
|
5778 |
|
5779 | if (topLevelType === TOP_BLUR) {
|
5780 | handleControlledInputBlur(targetNode);
|
5781 | }
|
5782 | }
|
5783 | };
|
5784 |
|
5785 |
|
5786 |
|
5787 |
|
5788 |
|
5789 |
|
5790 |
|
5791 |
|
5792 |
|
5793 |
|
5794 | var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
|
5795 |
|
5796 | var SyntheticUIEvent = SyntheticEvent.extend({
|
5797 | view: null,
|
5798 | detail: null
|
5799 | });
|
5800 |
|
5801 | var modifierKeyToProp = {
|
5802 | Alt: 'altKey',
|
5803 | Control: 'ctrlKey',
|
5804 | Meta: 'metaKey',
|
5805 | Shift: 'shiftKey'
|
5806 | };
|
5807 |
|
5808 |
|
5809 |
|
5810 |
|
5811 |
|
5812 |
|
5813 |
|
5814 |
|
5815 |
|
5816 | function modifierStateGetter(keyArg) {
|
5817 | var syntheticEvent = this;
|
5818 | var nativeEvent = syntheticEvent.nativeEvent;
|
5819 | if (nativeEvent.getModifierState) {
|
5820 | return nativeEvent.getModifierState(keyArg);
|
5821 | }
|
5822 | var keyProp = modifierKeyToProp[keyArg];
|
5823 | return keyProp ? !!nativeEvent[keyProp] : false;
|
5824 | }
|
5825 |
|
5826 | function getEventModifierState(nativeEvent) {
|
5827 | return modifierStateGetter;
|
5828 | }
|
5829 |
|
5830 | var previousScreenX = 0;
|
5831 | var previousScreenY = 0;
|
5832 |
|
5833 | var isMovementXSet = false;
|
5834 | var isMovementYSet = false;
|
5835 |
|
5836 |
|
5837 |
|
5838 |
|
5839 |
|
5840 | var SyntheticMouseEvent = SyntheticUIEvent.extend({
|
5841 | screenX: null,
|
5842 | screenY: null,
|
5843 | clientX: null,
|
5844 | clientY: null,
|
5845 | pageX: null,
|
5846 | pageY: null,
|
5847 | ctrlKey: null,
|
5848 | shiftKey: null,
|
5849 | altKey: null,
|
5850 | metaKey: null,
|
5851 | getModifierState: getEventModifierState,
|
5852 | button: null,
|
5853 | buttons: null,
|
5854 | relatedTarget: function (event) {
|
5855 | return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
|
5856 | },
|
5857 | movementX: function (event) {
|
5858 | if ('movementX' in event) {
|
5859 | return event.movementX;
|
5860 | }
|
5861 |
|
5862 | var screenX = previousScreenX;
|
5863 | previousScreenX = event.screenX;
|
5864 |
|
5865 | if (!isMovementXSet) {
|
5866 | isMovementXSet = true;
|
5867 | return 0;
|
5868 | }
|
5869 |
|
5870 | return event.type === 'mousemove' ? event.screenX - screenX : 0;
|
5871 | },
|
5872 | movementY: function (event) {
|
5873 | if ('movementY' in event) {
|
5874 | return event.movementY;
|
5875 | }
|
5876 |
|
5877 | var screenY = previousScreenY;
|
5878 | previousScreenY = event.screenY;
|
5879 |
|
5880 | if (!isMovementYSet) {
|
5881 | isMovementYSet = true;
|
5882 | return 0;
|
5883 | }
|
5884 |
|
5885 | return event.type === 'mousemove' ? event.screenY - screenY : 0;
|
5886 | }
|
5887 | });
|
5888 |
|
5889 |
|
5890 |
|
5891 |
|
5892 |
|
5893 | var SyntheticPointerEvent = SyntheticMouseEvent.extend({
|
5894 | pointerId: null,
|
5895 | width: null,
|
5896 | height: null,
|
5897 | pressure: null,
|
5898 | tangentialPressure: null,
|
5899 | tiltX: null,
|
5900 | tiltY: null,
|
5901 | twist: null,
|
5902 | pointerType: null,
|
5903 | isPrimary: null
|
5904 | });
|
5905 |
|
5906 | var eventTypes$2 = {
|
5907 | mouseEnter: {
|
5908 | registrationName: 'onMouseEnter',
|
5909 | dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
|
5910 | },
|
5911 | mouseLeave: {
|
5912 | registrationName: 'onMouseLeave',
|
5913 | dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
|
5914 | },
|
5915 | pointerEnter: {
|
5916 | registrationName: 'onPointerEnter',
|
5917 | dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
|
5918 | },
|
5919 | pointerLeave: {
|
5920 | registrationName: 'onPointerLeave',
|
5921 | dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
|
5922 | }
|
5923 | };
|
5924 |
|
5925 | var EnterLeaveEventPlugin = {
|
5926 | eventTypes: eventTypes$2,
|
5927 |
|
5928 | |
5929 |
|
5930 |
|
5931 |
|
5932 |
|
5933 |
|
5934 |
|
5935 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
5936 | var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;
|
5937 | var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;
|
5938 |
|
5939 | if (isOverEvent && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
|
5940 | return null;
|
5941 | }
|
5942 |
|
5943 | if (!isOutEvent && !isOverEvent) {
|
5944 |
|
5945 | return null;
|
5946 | }
|
5947 |
|
5948 | var win = void 0;
|
5949 | if (nativeEventTarget.window === nativeEventTarget) {
|
5950 |
|
5951 | win = nativeEventTarget;
|
5952 | } else {
|
5953 |
|
5954 | var doc = nativeEventTarget.ownerDocument;
|
5955 | if (doc) {
|
5956 | win = doc.defaultView || doc.parentWindow;
|
5957 | } else {
|
5958 | win = window;
|
5959 | }
|
5960 | }
|
5961 |
|
5962 | var from = void 0;
|
5963 | var to = void 0;
|
5964 | if (isOutEvent) {
|
5965 | from = targetInst;
|
5966 | var related = nativeEvent.relatedTarget || nativeEvent.toElement;
|
5967 | to = related ? getClosestInstanceFromNode(related) : null;
|
5968 | } else {
|
5969 |
|
5970 | from = null;
|
5971 | to = targetInst;
|
5972 | }
|
5973 |
|
5974 | if (from === to) {
|
5975 |
|
5976 | return null;
|
5977 | }
|
5978 |
|
5979 | var eventInterface = void 0,
|
5980 | leaveEventType = void 0,
|
5981 | enterEventType = void 0,
|
5982 | eventTypePrefix = void 0;
|
5983 |
|
5984 | if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {
|
5985 | eventInterface = SyntheticMouseEvent;
|
5986 | leaveEventType = eventTypes$2.mouseLeave;
|
5987 | enterEventType = eventTypes$2.mouseEnter;
|
5988 | eventTypePrefix = 'mouse';
|
5989 | } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {
|
5990 | eventInterface = SyntheticPointerEvent;
|
5991 | leaveEventType = eventTypes$2.pointerLeave;
|
5992 | enterEventType = eventTypes$2.pointerEnter;
|
5993 | eventTypePrefix = 'pointer';
|
5994 | }
|
5995 |
|
5996 | var fromNode = from == null ? win : getNodeFromInstance$1(from);
|
5997 | var toNode = to == null ? win : getNodeFromInstance$1(to);
|
5998 |
|
5999 | var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);
|
6000 | leave.type = eventTypePrefix + 'leave';
|
6001 | leave.target = fromNode;
|
6002 | leave.relatedTarget = toNode;
|
6003 |
|
6004 | var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);
|
6005 | enter.type = eventTypePrefix + 'enter';
|
6006 | enter.target = toNode;
|
6007 | enter.relatedTarget = fromNode;
|
6008 |
|
6009 | accumulateEnterLeaveDispatches(leave, enter, from, to);
|
6010 |
|
6011 | return [leave, enter];
|
6012 | }
|
6013 | };
|
6014 |
|
6015 |
|
6016 |
|
6017 | var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
6018 |
|
6019 |
|
6020 |
|
6021 |
|
6022 |
|
6023 | function is(x, y) {
|
6024 |
|
6025 | if (x === y) {
|
6026 |
|
6027 |
|
6028 |
|
6029 | return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
6030 | } else {
|
6031 |
|
6032 | return x !== x && y !== y;
|
6033 | }
|
6034 | }
|
6035 |
|
6036 |
|
6037 |
|
6038 |
|
6039 |
|
6040 |
|
6041 | function shallowEqual(objA, objB) {
|
6042 | if (is(objA, objB)) {
|
6043 | return true;
|
6044 | }
|
6045 |
|
6046 | if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
6047 | return false;
|
6048 | }
|
6049 |
|
6050 | var keysA = Object.keys(objA);
|
6051 | var keysB = Object.keys(objB);
|
6052 |
|
6053 | if (keysA.length !== keysB.length) {
|
6054 | return false;
|
6055 | }
|
6056 |
|
6057 |
|
6058 | for (var i = 0; i < keysA.length; i++) {
|
6059 | if (!hasOwnProperty$1.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
|
6060 | return false;
|
6061 | }
|
6062 | }
|
6063 |
|
6064 | return true;
|
6065 | }
|
6066 |
|
6067 |
|
6068 |
|
6069 |
|
6070 |
|
6071 |
|
6072 |
|
6073 |
|
6074 |
|
6075 |
|
6076 |
|
6077 |
|
6078 |
|
6079 |
|
6080 |
|
6081 |
|
6082 |
|
6083 |
|
6084 | function get(key) {
|
6085 | return key._reactInternalFiber;
|
6086 | }
|
6087 |
|
6088 | function has(key) {
|
6089 | return key._reactInternalFiber !== undefined;
|
6090 | }
|
6091 |
|
6092 | function set(key, value) {
|
6093 | key._reactInternalFiber = value;
|
6094 | }
|
6095 |
|
6096 |
|
6097 | var NoEffect = 0;
|
6098 | var PerformedWork = 1;
|
6099 |
|
6100 |
|
6101 | var Placement = 2;
|
6102 | var Update = 4;
|
6103 | var PlacementAndUpdate = 6;
|
6104 | var Deletion = 8;
|
6105 | var ContentReset = 16;
|
6106 | var Callback = 32;
|
6107 | var DidCapture = 64;
|
6108 | var Ref = 128;
|
6109 | var Snapshot = 256;
|
6110 | var Passive = 512;
|
6111 |
|
6112 |
|
6113 | var LifecycleEffectMask = 932;
|
6114 |
|
6115 |
|
6116 | var HostEffectMask = 1023;
|
6117 |
|
6118 | var Incomplete = 1024;
|
6119 | var ShouldCapture = 2048;
|
6120 |
|
6121 | var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
6122 |
|
6123 | var MOUNTING = 1;
|
6124 | var MOUNTED = 2;
|
6125 | var UNMOUNTED = 3;
|
6126 |
|
6127 | function isFiberMountedImpl(fiber) {
|
6128 | var node = fiber;
|
6129 | if (!fiber.alternate) {
|
6130 |
|
6131 |
|
6132 | if ((node.effectTag & Placement) !== NoEffect) {
|
6133 | return MOUNTING;
|
6134 | }
|
6135 | while (node.return) {
|
6136 | node = node.return;
|
6137 | if ((node.effectTag & Placement) !== NoEffect) {
|
6138 | return MOUNTING;
|
6139 | }
|
6140 | }
|
6141 | } else {
|
6142 | while (node.return) {
|
6143 | node = node.return;
|
6144 | }
|
6145 | }
|
6146 | if (node.tag === HostRoot) {
|
6147 |
|
6148 |
|
6149 | return MOUNTED;
|
6150 | }
|
6151 |
|
6152 |
|
6153 | return UNMOUNTED;
|
6154 | }
|
6155 |
|
6156 | function isFiberMounted(fiber) {
|
6157 | return isFiberMountedImpl(fiber) === MOUNTED;
|
6158 | }
|
6159 |
|
6160 | function isMounted(component) {
|
6161 | {
|
6162 | var owner = ReactCurrentOwner$1.current;
|
6163 | if (owner !== null && owner.tag === ClassComponent) {
|
6164 | var ownerFiber = owner;
|
6165 | var instance = ownerFiber.stateNode;
|
6166 | !instance._warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component') : void 0;
|
6167 | instance._warnedAboutRefsInRender = true;
|
6168 | }
|
6169 | }
|
6170 |
|
6171 | var fiber = get(component);
|
6172 | if (!fiber) {
|
6173 | return false;
|
6174 | }
|
6175 | return isFiberMountedImpl(fiber) === MOUNTED;
|
6176 | }
|
6177 |
|
6178 | function assertIsMounted(fiber) {
|
6179 | !(isFiberMountedImpl(fiber) === MOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
|
6180 | }
|
6181 |
|
6182 | function findCurrentFiberUsingSlowPath(fiber) {
|
6183 | var alternate = fiber.alternate;
|
6184 | if (!alternate) {
|
6185 |
|
6186 | var state = isFiberMountedImpl(fiber);
|
6187 | !(state !== UNMOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
|
6188 | if (state === MOUNTING) {
|
6189 | return null;
|
6190 | }
|
6191 | return fiber;
|
6192 | }
|
6193 |
|
6194 |
|
6195 |
|
6196 | var a = fiber;
|
6197 | var b = alternate;
|
6198 | while (true) {
|
6199 | var parentA = a.return;
|
6200 | var parentB = parentA ? parentA.alternate : null;
|
6201 | if (!parentA || !parentB) {
|
6202 |
|
6203 | break;
|
6204 | }
|
6205 |
|
6206 |
|
6207 |
|
6208 |
|
6209 | if (parentA.child === parentB.child) {
|
6210 | var child = parentA.child;
|
6211 | while (child) {
|
6212 | if (child === a) {
|
6213 |
|
6214 | assertIsMounted(parentA);
|
6215 | return fiber;
|
6216 | }
|
6217 | if (child === b) {
|
6218 |
|
6219 | assertIsMounted(parentA);
|
6220 | return alternate;
|
6221 | }
|
6222 | child = child.sibling;
|
6223 | }
|
6224 |
|
6225 |
|
6226 | invariant(false, 'Unable to find node on an unmounted component.');
|
6227 | }
|
6228 |
|
6229 | if (a.return !== b.return) {
|
6230 |
|
6231 |
|
6232 |
|
6233 |
|
6234 | a = parentA;
|
6235 | b = parentB;
|
6236 | } else {
|
6237 |
|
6238 |
|
6239 |
|
6240 |
|
6241 |
|
6242 | var didFindChild = false;
|
6243 | var _child = parentA.child;
|
6244 | while (_child) {
|
6245 | if (_child === a) {
|
6246 | didFindChild = true;
|
6247 | a = parentA;
|
6248 | b = parentB;
|
6249 | break;
|
6250 | }
|
6251 | if (_child === b) {
|
6252 | didFindChild = true;
|
6253 | b = parentA;
|
6254 | a = parentB;
|
6255 | break;
|
6256 | }
|
6257 | _child = _child.sibling;
|
6258 | }
|
6259 | if (!didFindChild) {
|
6260 |
|
6261 | _child = parentB.child;
|
6262 | while (_child) {
|
6263 | if (_child === a) {
|
6264 | didFindChild = true;
|
6265 | a = parentB;
|
6266 | b = parentA;
|
6267 | break;
|
6268 | }
|
6269 | if (_child === b) {
|
6270 | didFindChild = true;
|
6271 | b = parentB;
|
6272 | a = parentA;
|
6273 | break;
|
6274 | }
|
6275 | _child = _child.sibling;
|
6276 | }
|
6277 | !didFindChild ? invariant(false, 'Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.') : void 0;
|
6278 | }
|
6279 | }
|
6280 |
|
6281 | !(a.alternate === b) ? invariant(false, 'Return fibers should always be each others\' alternates. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
6282 | }
|
6283 |
|
6284 |
|
6285 | !(a.tag === HostRoot) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
|
6286 | if (a.stateNode.current === a) {
|
6287 |
|
6288 | return fiber;
|
6289 | }
|
6290 |
|
6291 | return alternate;
|
6292 | }
|
6293 |
|
6294 | function findCurrentHostFiber(parent) {
|
6295 | var currentParent = findCurrentFiberUsingSlowPath(parent);
|
6296 | if (!currentParent) {
|
6297 | return null;
|
6298 | }
|
6299 |
|
6300 |
|
6301 | var node = currentParent;
|
6302 | while (true) {
|
6303 | if (node.tag === HostComponent || node.tag === HostText) {
|
6304 | return node;
|
6305 | } else if (node.child) {
|
6306 | node.child.return = node;
|
6307 | node = node.child;
|
6308 | continue;
|
6309 | }
|
6310 | if (node === currentParent) {
|
6311 | return null;
|
6312 | }
|
6313 | while (!node.sibling) {
|
6314 | if (!node.return || node.return === currentParent) {
|
6315 | return null;
|
6316 | }
|
6317 | node = node.return;
|
6318 | }
|
6319 | node.sibling.return = node.return;
|
6320 | node = node.sibling;
|
6321 | }
|
6322 |
|
6323 |
|
6324 | return null;
|
6325 | }
|
6326 |
|
6327 | function findCurrentHostFiberWithNoPortals(parent) {
|
6328 | var currentParent = findCurrentFiberUsingSlowPath(parent);
|
6329 | if (!currentParent) {
|
6330 | return null;
|
6331 | }
|
6332 |
|
6333 |
|
6334 | var node = currentParent;
|
6335 | while (true) {
|
6336 | if (node.tag === HostComponent || node.tag === HostText) {
|
6337 | return node;
|
6338 | } else if (node.child && node.tag !== HostPortal) {
|
6339 | node.child.return = node;
|
6340 | node = node.child;
|
6341 | continue;
|
6342 | }
|
6343 | if (node === currentParent) {
|
6344 | return null;
|
6345 | }
|
6346 | while (!node.sibling) {
|
6347 | if (!node.return || node.return === currentParent) {
|
6348 | return null;
|
6349 | }
|
6350 | node = node.return;
|
6351 | }
|
6352 | node.sibling.return = node.return;
|
6353 | node = node.sibling;
|
6354 | }
|
6355 |
|
6356 |
|
6357 | return null;
|
6358 | }
|
6359 |
|
6360 | function addEventBubbleListener(element, eventType, listener) {
|
6361 | element.addEventListener(eventType, listener, false);
|
6362 | }
|
6363 |
|
6364 | function addEventCaptureListener(element, eventType, listener) {
|
6365 | element.addEventListener(eventType, listener, true);
|
6366 | }
|
6367 |
|
6368 |
|
6369 |
|
6370 |
|
6371 |
|
6372 |
|
6373 | var SyntheticAnimationEvent = SyntheticEvent.extend({
|
6374 | animationName: null,
|
6375 | elapsedTime: null,
|
6376 | pseudoElement: null
|
6377 | });
|
6378 |
|
6379 |
|
6380 |
|
6381 |
|
6382 |
|
6383 | var SyntheticClipboardEvent = SyntheticEvent.extend({
|
6384 | clipboardData: function (event) {
|
6385 | return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
|
6386 | }
|
6387 | });
|
6388 |
|
6389 |
|
6390 |
|
6391 |
|
6392 |
|
6393 | var SyntheticFocusEvent = SyntheticUIEvent.extend({
|
6394 | relatedTarget: null
|
6395 | });
|
6396 |
|
6397 |
|
6398 |
|
6399 |
|
6400 |
|
6401 |
|
6402 |
|
6403 |
|
6404 |
|
6405 |
|
6406 |
|
6407 | function getEventCharCode(nativeEvent) {
|
6408 | var charCode = void 0;
|
6409 | var keyCode = nativeEvent.keyCode;
|
6410 |
|
6411 | if ('charCode' in nativeEvent) {
|
6412 | charCode = nativeEvent.charCode;
|
6413 |
|
6414 |
|
6415 | if (charCode === 0 && keyCode === 13) {
|
6416 | charCode = 13;
|
6417 | }
|
6418 | } else {
|
6419 |
|
6420 | charCode = keyCode;
|
6421 | }
|
6422 |
|
6423 |
|
6424 |
|
6425 | if (charCode === 10) {
|
6426 | charCode = 13;
|
6427 | }
|
6428 |
|
6429 |
|
6430 |
|
6431 | if (charCode >= 32 || charCode === 13) {
|
6432 | return charCode;
|
6433 | }
|
6434 |
|
6435 | return 0;
|
6436 | }
|
6437 |
|
6438 |
|
6439 |
|
6440 |
|
6441 |
|
6442 | var normalizeKey = {
|
6443 | Esc: 'Escape',
|
6444 | Spacebar: ' ',
|
6445 | Left: 'ArrowLeft',
|
6446 | Up: 'ArrowUp',
|
6447 | Right: 'ArrowRight',
|
6448 | Down: 'ArrowDown',
|
6449 | Del: 'Delete',
|
6450 | Win: 'OS',
|
6451 | Menu: 'ContextMenu',
|
6452 | Apps: 'ContextMenu',
|
6453 | Scroll: 'ScrollLock',
|
6454 | MozPrintableKey: 'Unidentified'
|
6455 | };
|
6456 |
|
6457 |
|
6458 |
|
6459 |
|
6460 |
|
6461 |
|
6462 | var translateToKey = {
|
6463 | '8': 'Backspace',
|
6464 | '9': 'Tab',
|
6465 | '12': 'Clear',
|
6466 | '13': 'Enter',
|
6467 | '16': 'Shift',
|
6468 | '17': 'Control',
|
6469 | '18': 'Alt',
|
6470 | '19': 'Pause',
|
6471 | '20': 'CapsLock',
|
6472 | '27': 'Escape',
|
6473 | '32': ' ',
|
6474 | '33': 'PageUp',
|
6475 | '34': 'PageDown',
|
6476 | '35': 'End',
|
6477 | '36': 'Home',
|
6478 | '37': 'ArrowLeft',
|
6479 | '38': 'ArrowUp',
|
6480 | '39': 'ArrowRight',
|
6481 | '40': 'ArrowDown',
|
6482 | '45': 'Insert',
|
6483 | '46': 'Delete',
|
6484 | '112': 'F1',
|
6485 | '113': 'F2',
|
6486 | '114': 'F3',
|
6487 | '115': 'F4',
|
6488 | '116': 'F5',
|
6489 | '117': 'F6',
|
6490 | '118': 'F7',
|
6491 | '119': 'F8',
|
6492 | '120': 'F9',
|
6493 | '121': 'F10',
|
6494 | '122': 'F11',
|
6495 | '123': 'F12',
|
6496 | '144': 'NumLock',
|
6497 | '145': 'ScrollLock',
|
6498 | '224': 'Meta'
|
6499 | };
|
6500 |
|
6501 |
|
6502 |
|
6503 |
|
6504 |
|
6505 | function getEventKey(nativeEvent) {
|
6506 | if (nativeEvent.key) {
|
6507 |
|
6508 |
|
6509 |
|
6510 |
|
6511 |
|
6512 | var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
|
6513 | if (key !== 'Unidentified') {
|
6514 | return key;
|
6515 | }
|
6516 | }
|
6517 |
|
6518 |
|
6519 | if (nativeEvent.type === 'keypress') {
|
6520 | var charCode = getEventCharCode(nativeEvent);
|
6521 |
|
6522 |
|
6523 |
|
6524 | return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
|
6525 | }
|
6526 | if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
|
6527 |
|
6528 |
|
6529 | return translateToKey[nativeEvent.keyCode] || 'Unidentified';
|
6530 | }
|
6531 | return '';
|
6532 | }
|
6533 |
|
6534 |
|
6535 |
|
6536 |
|
6537 |
|
6538 | var SyntheticKeyboardEvent = SyntheticUIEvent.extend({
|
6539 | key: getEventKey,
|
6540 | location: null,
|
6541 | ctrlKey: null,
|
6542 | shiftKey: null,
|
6543 | altKey: null,
|
6544 | metaKey: null,
|
6545 | repeat: null,
|
6546 | locale: null,
|
6547 | getModifierState: getEventModifierState,
|
6548 |
|
6549 | charCode: function (event) {
|
6550 |
|
6551 |
|
6552 |
|
6553 |
|
6554 |
|
6555 | if (event.type === 'keypress') {
|
6556 | return getEventCharCode(event);
|
6557 | }
|
6558 | return 0;
|
6559 | },
|
6560 | keyCode: function (event) {
|
6561 |
|
6562 |
|
6563 |
|
6564 |
|
6565 |
|
6566 |
|
6567 |
|
6568 | if (event.type === 'keydown' || event.type === 'keyup') {
|
6569 | return event.keyCode;
|
6570 | }
|
6571 | return 0;
|
6572 | },
|
6573 | which: function (event) {
|
6574 |
|
6575 |
|
6576 | if (event.type === 'keypress') {
|
6577 | return getEventCharCode(event);
|
6578 | }
|
6579 | if (event.type === 'keydown' || event.type === 'keyup') {
|
6580 | return event.keyCode;
|
6581 | }
|
6582 | return 0;
|
6583 | }
|
6584 | });
|
6585 |
|
6586 |
|
6587 |
|
6588 |
|
6589 |
|
6590 | var SyntheticDragEvent = SyntheticMouseEvent.extend({
|
6591 | dataTransfer: null
|
6592 | });
|
6593 |
|
6594 |
|
6595 |
|
6596 |
|
6597 |
|
6598 | var SyntheticTouchEvent = SyntheticUIEvent.extend({
|
6599 | touches: null,
|
6600 | targetTouches: null,
|
6601 | changedTouches: null,
|
6602 | altKey: null,
|
6603 | metaKey: null,
|
6604 | ctrlKey: null,
|
6605 | shiftKey: null,
|
6606 | getModifierState: getEventModifierState
|
6607 | });
|
6608 |
|
6609 |
|
6610 |
|
6611 |
|
6612 |
|
6613 |
|
6614 | var SyntheticTransitionEvent = SyntheticEvent.extend({
|
6615 | propertyName: null,
|
6616 | elapsedTime: null,
|
6617 | pseudoElement: null
|
6618 | });
|
6619 |
|
6620 |
|
6621 |
|
6622 |
|
6623 |
|
6624 | var SyntheticWheelEvent = SyntheticMouseEvent.extend({
|
6625 | deltaX: function (event) {
|
6626 | return 'deltaX' in event ? event.deltaX :
|
6627 | 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
|
6628 | },
|
6629 | deltaY: function (event) {
|
6630 | return 'deltaY' in event ? event.deltaY :
|
6631 | 'wheelDeltaY' in event ? -event.wheelDeltaY :
|
6632 | 'wheelDelta' in event ? -event.wheelDelta : 0;
|
6633 | },
|
6634 |
|
6635 | deltaZ: null,
|
6636 |
|
6637 |
|
6638 |
|
6639 |
|
6640 |
|
6641 | deltaMode: null
|
6642 | });
|
6643 |
|
6644 |
|
6645 |
|
6646 |
|
6647 |
|
6648 |
|
6649 |
|
6650 |
|
6651 |
|
6652 |
|
6653 |
|
6654 |
|
6655 |
|
6656 |
|
6657 |
|
6658 |
|
6659 |
|
6660 |
|
6661 |
|
6662 |
|
6663 | var interactiveEventTypeNames = [[TOP_BLUR, 'blur'], [TOP_CANCEL, 'cancel'], [TOP_CLICK, 'click'], [TOP_CLOSE, 'close'], [TOP_CONTEXT_MENU, 'contextMenu'], [TOP_COPY, 'copy'], [TOP_CUT, 'cut'], [TOP_AUX_CLICK, 'auxClick'], [TOP_DOUBLE_CLICK, 'doubleClick'], [TOP_DRAG_END, 'dragEnd'], [TOP_DRAG_START, 'dragStart'], [TOP_DROP, 'drop'], [TOP_FOCUS, 'focus'], [TOP_INPUT, 'input'], [TOP_INVALID, 'invalid'], [TOP_KEY_DOWN, 'keyDown'], [TOP_KEY_PRESS, 'keyPress'], [TOP_KEY_UP, 'keyUp'], [TOP_MOUSE_DOWN, 'mouseDown'], [TOP_MOUSE_UP, 'mouseUp'], [TOP_PASTE, 'paste'], [TOP_PAUSE, 'pause'], [TOP_PLAY, 'play'], [TOP_POINTER_CANCEL, 'pointerCancel'], [TOP_POINTER_DOWN, 'pointerDown'], [TOP_POINTER_UP, 'pointerUp'], [TOP_RATE_CHANGE, 'rateChange'], [TOP_RESET, 'reset'], [TOP_SEEKED, 'seeked'], [TOP_SUBMIT, 'submit'], [TOP_TOUCH_CANCEL, 'touchCancel'], [TOP_TOUCH_END, 'touchEnd'], [TOP_TOUCH_START, 'touchStart'], [TOP_VOLUME_CHANGE, 'volumeChange']];
|
6664 | var nonInteractiveEventTypeNames = [[TOP_ABORT, 'abort'], [TOP_ANIMATION_END, 'animationEnd'], [TOP_ANIMATION_ITERATION, 'animationIteration'], [TOP_ANIMATION_START, 'animationStart'], [TOP_CAN_PLAY, 'canPlay'], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough'], [TOP_DRAG, 'drag'], [TOP_DRAG_ENTER, 'dragEnter'], [TOP_DRAG_EXIT, 'dragExit'], [TOP_DRAG_LEAVE, 'dragLeave'], [TOP_DRAG_OVER, 'dragOver'], [TOP_DURATION_CHANGE, 'durationChange'], [TOP_EMPTIED, 'emptied'], [TOP_ENCRYPTED, 'encrypted'], [TOP_ENDED, 'ended'], [TOP_ERROR, 'error'], [TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture'], [TOP_LOAD, 'load'], [TOP_LOADED_DATA, 'loadedData'], [TOP_LOADED_METADATA, 'loadedMetadata'], [TOP_LOAD_START, 'loadStart'], [TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture'], [TOP_MOUSE_MOVE, 'mouseMove'], [TOP_MOUSE_OUT, 'mouseOut'], [TOP_MOUSE_OVER, 'mouseOver'], [TOP_PLAYING, 'playing'], [TOP_POINTER_MOVE, 'pointerMove'], [TOP_POINTER_OUT, 'pointerOut'], [TOP_POINTER_OVER, 'pointerOver'], [TOP_PROGRESS, 'progress'], [TOP_SCROLL, 'scroll'], [TOP_SEEKING, 'seeking'], [TOP_STALLED, 'stalled'], [TOP_SUSPEND, 'suspend'], [TOP_TIME_UPDATE, 'timeUpdate'], [TOP_TOGGLE, 'toggle'], [TOP_TOUCH_MOVE, 'touchMove'], [TOP_TRANSITION_END, 'transitionEnd'], [TOP_WAITING, 'waiting'], [TOP_WHEEL, 'wheel']];
|
6665 |
|
6666 | var eventTypes$4 = {};
|
6667 | var topLevelEventsToDispatchConfig = {};
|
6668 |
|
6669 | function addEventTypeNameToConfig(_ref, isInteractive) {
|
6670 | var topEvent = _ref[0],
|
6671 | event = _ref[1];
|
6672 |
|
6673 | var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
|
6674 | var onEvent = 'on' + capitalizedEvent;
|
6675 |
|
6676 | var type = {
|
6677 | phasedRegistrationNames: {
|
6678 | bubbled: onEvent,
|
6679 | captured: onEvent + 'Capture'
|
6680 | },
|
6681 | dependencies: [topEvent],
|
6682 | isInteractive: isInteractive
|
6683 | };
|
6684 | eventTypes$4[event] = type;
|
6685 | topLevelEventsToDispatchConfig[topEvent] = type;
|
6686 | }
|
6687 |
|
6688 | interactiveEventTypeNames.forEach(function (eventTuple) {
|
6689 | addEventTypeNameToConfig(eventTuple, true);
|
6690 | });
|
6691 | nonInteractiveEventTypeNames.forEach(function (eventTuple) {
|
6692 | addEventTypeNameToConfig(eventTuple, false);
|
6693 | });
|
6694 |
|
6695 |
|
6696 | var knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];
|
6697 |
|
6698 | var SimpleEventPlugin = {
|
6699 | eventTypes: eventTypes$4,
|
6700 |
|
6701 | isInteractiveTopLevelEventType: function (topLevelType) {
|
6702 | var config = topLevelEventsToDispatchConfig[topLevelType];
|
6703 | return config !== undefined && config.isInteractive === true;
|
6704 | },
|
6705 |
|
6706 |
|
6707 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
6708 | var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
|
6709 | if (!dispatchConfig) {
|
6710 | return null;
|
6711 | }
|
6712 | var EventConstructor = void 0;
|
6713 | switch (topLevelType) {
|
6714 | case TOP_KEY_PRESS:
|
6715 |
|
6716 |
|
6717 |
|
6718 | if (getEventCharCode(nativeEvent) === 0) {
|
6719 | return null;
|
6720 | }
|
6721 |
|
6722 | case TOP_KEY_DOWN:
|
6723 | case TOP_KEY_UP:
|
6724 | EventConstructor = SyntheticKeyboardEvent;
|
6725 | break;
|
6726 | case TOP_BLUR:
|
6727 | case TOP_FOCUS:
|
6728 | EventConstructor = SyntheticFocusEvent;
|
6729 | break;
|
6730 | case TOP_CLICK:
|
6731 |
|
6732 |
|
6733 | if (nativeEvent.button === 2) {
|
6734 | return null;
|
6735 | }
|
6736 |
|
6737 | case TOP_AUX_CLICK:
|
6738 | case TOP_DOUBLE_CLICK:
|
6739 | case TOP_MOUSE_DOWN:
|
6740 | case TOP_MOUSE_MOVE:
|
6741 | case TOP_MOUSE_UP:
|
6742 |
|
6743 |
|
6744 | case TOP_MOUSE_OUT:
|
6745 | case TOP_MOUSE_OVER:
|
6746 | case TOP_CONTEXT_MENU:
|
6747 | EventConstructor = SyntheticMouseEvent;
|
6748 | break;
|
6749 | case TOP_DRAG:
|
6750 | case TOP_DRAG_END:
|
6751 | case TOP_DRAG_ENTER:
|
6752 | case TOP_DRAG_EXIT:
|
6753 | case TOP_DRAG_LEAVE:
|
6754 | case TOP_DRAG_OVER:
|
6755 | case TOP_DRAG_START:
|
6756 | case TOP_DROP:
|
6757 | EventConstructor = SyntheticDragEvent;
|
6758 | break;
|
6759 | case TOP_TOUCH_CANCEL:
|
6760 | case TOP_TOUCH_END:
|
6761 | case TOP_TOUCH_MOVE:
|
6762 | case TOP_TOUCH_START:
|
6763 | EventConstructor = SyntheticTouchEvent;
|
6764 | break;
|
6765 | case TOP_ANIMATION_END:
|
6766 | case TOP_ANIMATION_ITERATION:
|
6767 | case TOP_ANIMATION_START:
|
6768 | EventConstructor = SyntheticAnimationEvent;
|
6769 | break;
|
6770 | case TOP_TRANSITION_END:
|
6771 | EventConstructor = SyntheticTransitionEvent;
|
6772 | break;
|
6773 | case TOP_SCROLL:
|
6774 | EventConstructor = SyntheticUIEvent;
|
6775 | break;
|
6776 | case TOP_WHEEL:
|
6777 | EventConstructor = SyntheticWheelEvent;
|
6778 | break;
|
6779 | case TOP_COPY:
|
6780 | case TOP_CUT:
|
6781 | case TOP_PASTE:
|
6782 | EventConstructor = SyntheticClipboardEvent;
|
6783 | break;
|
6784 | case TOP_GOT_POINTER_CAPTURE:
|
6785 | case TOP_LOST_POINTER_CAPTURE:
|
6786 | case TOP_POINTER_CANCEL:
|
6787 | case TOP_POINTER_DOWN:
|
6788 | case TOP_POINTER_MOVE:
|
6789 | case TOP_POINTER_OUT:
|
6790 | case TOP_POINTER_OVER:
|
6791 | case TOP_POINTER_UP:
|
6792 | EventConstructor = SyntheticPointerEvent;
|
6793 | break;
|
6794 | default:
|
6795 | {
|
6796 | if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {
|
6797 | warningWithoutStack$1(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);
|
6798 | }
|
6799 | }
|
6800 |
|
6801 |
|
6802 | EventConstructor = SyntheticEvent;
|
6803 | break;
|
6804 | }
|
6805 | var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
|
6806 | accumulateTwoPhaseDispatches(event);
|
6807 | return event;
|
6808 | }
|
6809 | };
|
6810 |
|
6811 | var isInteractiveTopLevelEventType = SimpleEventPlugin.isInteractiveTopLevelEventType;
|
6812 |
|
6813 |
|
6814 | var CALLBACK_BOOKKEEPING_POOL_SIZE = 10;
|
6815 | var callbackBookkeepingPool = [];
|
6816 |
|
6817 |
|
6818 |
|
6819 |
|
6820 |
|
6821 |
|
6822 | function findRootContainerNode(inst) {
|
6823 |
|
6824 |
|
6825 |
|
6826 | while (inst.return) {
|
6827 | inst = inst.return;
|
6828 | }
|
6829 | if (inst.tag !== HostRoot) {
|
6830 |
|
6831 | return null;
|
6832 | }
|
6833 | return inst.stateNode.containerInfo;
|
6834 | }
|
6835 |
|
6836 |
|
6837 | function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst) {
|
6838 | if (callbackBookkeepingPool.length) {
|
6839 | var instance = callbackBookkeepingPool.pop();
|
6840 | instance.topLevelType = topLevelType;
|
6841 | instance.nativeEvent = nativeEvent;
|
6842 | instance.targetInst = targetInst;
|
6843 | return instance;
|
6844 | }
|
6845 | return {
|
6846 | topLevelType: topLevelType,
|
6847 | nativeEvent: nativeEvent,
|
6848 | targetInst: targetInst,
|
6849 | ancestors: []
|
6850 | };
|
6851 | }
|
6852 |
|
6853 | function releaseTopLevelCallbackBookKeeping(instance) {
|
6854 | instance.topLevelType = null;
|
6855 | instance.nativeEvent = null;
|
6856 | instance.targetInst = null;
|
6857 | instance.ancestors.length = 0;
|
6858 | if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {
|
6859 | callbackBookkeepingPool.push(instance);
|
6860 | }
|
6861 | }
|
6862 |
|
6863 | function handleTopLevel(bookKeeping) {
|
6864 | var targetInst = bookKeeping.targetInst;
|
6865 |
|
6866 |
|
6867 |
|
6868 |
|
6869 |
|
6870 | var ancestor = targetInst;
|
6871 | do {
|
6872 | if (!ancestor) {
|
6873 | bookKeeping.ancestors.push(ancestor);
|
6874 | break;
|
6875 | }
|
6876 | var root = findRootContainerNode(ancestor);
|
6877 | if (!root) {
|
6878 | break;
|
6879 | }
|
6880 | bookKeeping.ancestors.push(ancestor);
|
6881 | ancestor = getClosestInstanceFromNode(root);
|
6882 | } while (ancestor);
|
6883 |
|
6884 | for (var i = 0; i < bookKeeping.ancestors.length; i++) {
|
6885 | targetInst = bookKeeping.ancestors[i];
|
6886 | runExtractedEventsInBatch(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
|
6887 | }
|
6888 | }
|
6889 |
|
6890 |
|
6891 | var _enabled = true;
|
6892 |
|
6893 | function setEnabled(enabled) {
|
6894 | _enabled = !!enabled;
|
6895 | }
|
6896 |
|
6897 | function isEnabled() {
|
6898 | return _enabled;
|
6899 | }
|
6900 |
|
6901 |
|
6902 |
|
6903 |
|
6904 |
|
6905 |
|
6906 |
|
6907 |
|
6908 |
|
6909 |
|
6910 | function trapBubbledEvent(topLevelType, element) {
|
6911 | if (!element) {
|
6912 | return null;
|
6913 | }
|
6914 | var dispatch = isInteractiveTopLevelEventType(topLevelType) ? dispatchInteractiveEvent : dispatchEvent;
|
6915 |
|
6916 | addEventBubbleListener(element, getRawEventName(topLevelType),
|
6917 |
|
6918 | dispatch.bind(null, topLevelType));
|
6919 | }
|
6920 |
|
6921 |
|
6922 |
|
6923 |
|
6924 |
|
6925 |
|
6926 |
|
6927 |
|
6928 |
|
6929 |
|
6930 | function trapCapturedEvent(topLevelType, element) {
|
6931 | if (!element) {
|
6932 | return null;
|
6933 | }
|
6934 | var dispatch = isInteractiveTopLevelEventType(topLevelType) ? dispatchInteractiveEvent : dispatchEvent;
|
6935 |
|
6936 | addEventCaptureListener(element, getRawEventName(topLevelType),
|
6937 |
|
6938 | dispatch.bind(null, topLevelType));
|
6939 | }
|
6940 |
|
6941 | function dispatchInteractiveEvent(topLevelType, nativeEvent) {
|
6942 | interactiveUpdates(dispatchEvent, topLevelType, nativeEvent);
|
6943 | }
|
6944 |
|
6945 | function dispatchEvent(topLevelType, nativeEvent) {
|
6946 | if (!_enabled) {
|
6947 | return;
|
6948 | }
|
6949 |
|
6950 | var nativeEventTarget = getEventTarget(nativeEvent);
|
6951 | var targetInst = getClosestInstanceFromNode(nativeEventTarget);
|
6952 | if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) {
|
6953 |
|
6954 |
|
6955 |
|
6956 |
|
6957 | targetInst = null;
|
6958 | }
|
6959 |
|
6960 | var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst);
|
6961 |
|
6962 | try {
|
6963 |
|
6964 |
|
6965 | batchedUpdates(handleTopLevel, bookKeeping);
|
6966 | } finally {
|
6967 | releaseTopLevelCallbackBookKeeping(bookKeeping);
|
6968 | }
|
6969 | }
|
6970 |
|
6971 |
|
6972 |
|
6973 |
|
6974 |
|
6975 |
|
6976 |
|
6977 |
|
6978 |
|
6979 |
|
6980 |
|
6981 |
|
6982 |
|
6983 |
|
6984 |
|
6985 |
|
6986 |
|
6987 |
|
6988 |
|
6989 |
|
6990 |
|
6991 |
|
6992 |
|
6993 |
|
6994 |
|
6995 |
|
6996 |
|
6997 |
|
6998 |
|
6999 |
|
7000 |
|
7001 |
|
7002 |
|
7003 |
|
7004 |
|
7005 |
|
7006 |
|
7007 |
|
7008 |
|
7009 |
|
7010 |
|
7011 |
|
7012 |
|
7013 |
|
7014 |
|
7015 |
|
7016 |
|
7017 |
|
7018 |
|
7019 |
|
7020 |
|
7021 |
|
7022 |
|
7023 |
|
7024 |
|
7025 |
|
7026 |
|
7027 | var alreadyListeningTo = {};
|
7028 | var reactTopListenersCounter = 0;
|
7029 |
|
7030 |
|
7031 |
|
7032 |
|
7033 | var topListenersIDKey = '_reactListenersID' + ('' + Math.random()).slice(2);
|
7034 |
|
7035 | function getListeningForDocument(mountAt) {
|
7036 |
|
7037 |
|
7038 | if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
|
7039 | mountAt[topListenersIDKey] = reactTopListenersCounter++;
|
7040 | alreadyListeningTo[mountAt[topListenersIDKey]] = {};
|
7041 | }
|
7042 | return alreadyListeningTo[mountAt[topListenersIDKey]];
|
7043 | }
|
7044 |
|
7045 |
|
7046 |
|
7047 |
|
7048 |
|
7049 |
|
7050 |
|
7051 |
|
7052 |
|
7053 |
|
7054 |
|
7055 |
|
7056 |
|
7057 |
|
7058 |
|
7059 |
|
7060 |
|
7061 |
|
7062 |
|
7063 |
|
7064 |
|
7065 |
|
7066 | function listenTo(registrationName, mountAt) {
|
7067 | var isListening = getListeningForDocument(mountAt);
|
7068 | var dependencies = registrationNameDependencies[registrationName];
|
7069 |
|
7070 | for (var i = 0; i < dependencies.length; i++) {
|
7071 | var dependency = dependencies[i];
|
7072 | if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
|
7073 | switch (dependency) {
|
7074 | case TOP_SCROLL:
|
7075 | trapCapturedEvent(TOP_SCROLL, mountAt);
|
7076 | break;
|
7077 | case TOP_FOCUS:
|
7078 | case TOP_BLUR:
|
7079 | trapCapturedEvent(TOP_FOCUS, mountAt);
|
7080 | trapCapturedEvent(TOP_BLUR, mountAt);
|
7081 |
|
7082 |
|
7083 | isListening[TOP_BLUR] = true;
|
7084 | isListening[TOP_FOCUS] = true;
|
7085 | break;
|
7086 | case TOP_CANCEL:
|
7087 | case TOP_CLOSE:
|
7088 | if (isEventSupported(getRawEventName(dependency))) {
|
7089 | trapCapturedEvent(dependency, mountAt);
|
7090 | }
|
7091 | break;
|
7092 | case TOP_INVALID:
|
7093 | case TOP_SUBMIT:
|
7094 | case TOP_RESET:
|
7095 |
|
7096 |
|
7097 | break;
|
7098 | default:
|
7099 |
|
7100 |
|
7101 | var isMediaEvent = mediaEventTypes.indexOf(dependency) !== -1;
|
7102 | if (!isMediaEvent) {
|
7103 | trapBubbledEvent(dependency, mountAt);
|
7104 | }
|
7105 | break;
|
7106 | }
|
7107 | isListening[dependency] = true;
|
7108 | }
|
7109 | }
|
7110 | }
|
7111 |
|
7112 | function isListeningToAllDependencies(registrationName, mountAt) {
|
7113 | var isListening = getListeningForDocument(mountAt);
|
7114 | var dependencies = registrationNameDependencies[registrationName];
|
7115 | for (var i = 0; i < dependencies.length; i++) {
|
7116 | var dependency = dependencies[i];
|
7117 | if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
|
7118 | return false;
|
7119 | }
|
7120 | }
|
7121 | return true;
|
7122 | }
|
7123 |
|
7124 | function getActiveElement(doc) {
|
7125 | doc = doc || (typeof document !== 'undefined' ? document : undefined);
|
7126 | if (typeof doc === 'undefined') {
|
7127 | return null;
|
7128 | }
|
7129 | try {
|
7130 | return doc.activeElement || doc.body;
|
7131 | } catch (e) {
|
7132 | return doc.body;
|
7133 | }
|
7134 | }
|
7135 |
|
7136 |
|
7137 |
|
7138 |
|
7139 |
|
7140 |
|
7141 |
|
7142 | function getLeafNode(node) {
|
7143 | while (node && node.firstChild) {
|
7144 | node = node.firstChild;
|
7145 | }
|
7146 | return node;
|
7147 | }
|
7148 |
|
7149 |
|
7150 |
|
7151 |
|
7152 |
|
7153 |
|
7154 |
|
7155 |
|
7156 | function getSiblingNode(node) {
|
7157 | while (node) {
|
7158 | if (node.nextSibling) {
|
7159 | return node.nextSibling;
|
7160 | }
|
7161 | node = node.parentNode;
|
7162 | }
|
7163 | }
|
7164 |
|
7165 |
|
7166 |
|
7167 |
|
7168 |
|
7169 |
|
7170 |
|
7171 |
|
7172 | function getNodeForCharacterOffset(root, offset) {
|
7173 | var node = getLeafNode(root);
|
7174 | var nodeStart = 0;
|
7175 | var nodeEnd = 0;
|
7176 |
|
7177 | while (node) {
|
7178 | if (node.nodeType === TEXT_NODE) {
|
7179 | nodeEnd = nodeStart + node.textContent.length;
|
7180 |
|
7181 | if (nodeStart <= offset && nodeEnd >= offset) {
|
7182 | return {
|
7183 | node: node,
|
7184 | offset: offset - nodeStart
|
7185 | };
|
7186 | }
|
7187 |
|
7188 | nodeStart = nodeEnd;
|
7189 | }
|
7190 |
|
7191 | node = getLeafNode(getSiblingNode(node));
|
7192 | }
|
7193 | }
|
7194 |
|
7195 |
|
7196 |
|
7197 |
|
7198 |
|
7199 | function getOffsets(outerNode) {
|
7200 | var ownerDocument = outerNode.ownerDocument;
|
7201 |
|
7202 | var win = ownerDocument && ownerDocument.defaultView || window;
|
7203 | var selection = win.getSelection && win.getSelection();
|
7204 |
|
7205 | if (!selection || selection.rangeCount === 0) {
|
7206 | return null;
|
7207 | }
|
7208 |
|
7209 | var anchorNode = selection.anchorNode,
|
7210 | anchorOffset = selection.anchorOffset,
|
7211 | focusNode = selection.focusNode,
|
7212 | focusOffset = selection.focusOffset;
|
7213 |
|
7214 |
|
7215 |
|
7216 |
|
7217 |
|
7218 |
|
7219 |
|
7220 |
|
7221 |
|
7222 | try {
|
7223 |
|
7224 | anchorNode.nodeType;
|
7225 | focusNode.nodeType;
|
7226 |
|
7227 | } catch (e) {
|
7228 | return null;
|
7229 | }
|
7230 |
|
7231 | return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
|
7232 | }
|
7233 |
|
7234 |
|
7235 |
|
7236 |
|
7237 |
|
7238 |
|
7239 |
|
7240 |
|
7241 |
|
7242 |
|
7243 | function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
|
7244 | var length = 0;
|
7245 | var start = -1;
|
7246 | var end = -1;
|
7247 | var indexWithinAnchor = 0;
|
7248 | var indexWithinFocus = 0;
|
7249 | var node = outerNode;
|
7250 | var parentNode = null;
|
7251 |
|
7252 | outer: while (true) {
|
7253 | var next = null;
|
7254 |
|
7255 | while (true) {
|
7256 | if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
|
7257 | start = length + anchorOffset;
|
7258 | }
|
7259 | if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
|
7260 | end = length + focusOffset;
|
7261 | }
|
7262 |
|
7263 | if (node.nodeType === TEXT_NODE) {
|
7264 | length += node.nodeValue.length;
|
7265 | }
|
7266 |
|
7267 | if ((next = node.firstChild) === null) {
|
7268 | break;
|
7269 | }
|
7270 |
|
7271 | parentNode = node;
|
7272 | node = next;
|
7273 | }
|
7274 |
|
7275 | while (true) {
|
7276 | if (node === outerNode) {
|
7277 |
|
7278 |
|
7279 |
|
7280 |
|
7281 | break outer;
|
7282 | }
|
7283 | if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
|
7284 | start = length;
|
7285 | }
|
7286 | if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
|
7287 | end = length;
|
7288 | }
|
7289 | if ((next = node.nextSibling) !== null) {
|
7290 | break;
|
7291 | }
|
7292 | node = parentNode;
|
7293 | parentNode = node.parentNode;
|
7294 | }
|
7295 |
|
7296 |
|
7297 | node = next;
|
7298 | }
|
7299 |
|
7300 | if (start === -1 || end === -1) {
|
7301 |
|
7302 |
|
7303 | return null;
|
7304 | }
|
7305 |
|
7306 | return {
|
7307 | start: start,
|
7308 | end: end
|
7309 | };
|
7310 | }
|
7311 |
|
7312 |
|
7313 |
|
7314 |
|
7315 |
|
7316 |
|
7317 |
|
7318 |
|
7319 |
|
7320 |
|
7321 |
|
7322 |
|
7323 |
|
7324 | function setOffsets(node, offsets) {
|
7325 | var doc = node.ownerDocument || document;
|
7326 | var win = doc && doc.defaultView || window;
|
7327 |
|
7328 |
|
7329 |
|
7330 |
|
7331 | if (!win.getSelection) {
|
7332 | return;
|
7333 | }
|
7334 |
|
7335 | var selection = win.getSelection();
|
7336 | var length = node.textContent.length;
|
7337 | var start = Math.min(offsets.start, length);
|
7338 | var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
|
7339 |
|
7340 |
|
7341 |
|
7342 | if (!selection.extend && start > end) {
|
7343 | var temp = end;
|
7344 | end = start;
|
7345 | start = temp;
|
7346 | }
|
7347 |
|
7348 | var startMarker = getNodeForCharacterOffset(node, start);
|
7349 | var endMarker = getNodeForCharacterOffset(node, end);
|
7350 |
|
7351 | if (startMarker && endMarker) {
|
7352 | if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
|
7353 | return;
|
7354 | }
|
7355 | var range = doc.createRange();
|
7356 | range.setStart(startMarker.node, startMarker.offset);
|
7357 | selection.removeAllRanges();
|
7358 |
|
7359 | if (start > end) {
|
7360 | selection.addRange(range);
|
7361 | selection.extend(endMarker.node, endMarker.offset);
|
7362 | } else {
|
7363 | range.setEnd(endMarker.node, endMarker.offset);
|
7364 | selection.addRange(range);
|
7365 | }
|
7366 | }
|
7367 | }
|
7368 |
|
7369 | function isTextNode(node) {
|
7370 | return node && node.nodeType === TEXT_NODE;
|
7371 | }
|
7372 |
|
7373 | function containsNode(outerNode, innerNode) {
|
7374 | if (!outerNode || !innerNode) {
|
7375 | return false;
|
7376 | } else if (outerNode === innerNode) {
|
7377 | return true;
|
7378 | } else if (isTextNode(outerNode)) {
|
7379 | return false;
|
7380 | } else if (isTextNode(innerNode)) {
|
7381 | return containsNode(outerNode, innerNode.parentNode);
|
7382 | } else if ('contains' in outerNode) {
|
7383 | return outerNode.contains(innerNode);
|
7384 | } else if (outerNode.compareDocumentPosition) {
|
7385 | return !!(outerNode.compareDocumentPosition(innerNode) & 16);
|
7386 | } else {
|
7387 | return false;
|
7388 | }
|
7389 | }
|
7390 |
|
7391 | function isInDocument(node) {
|
7392 | return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
|
7393 | }
|
7394 |
|
7395 | function getActiveElementDeep() {
|
7396 | var win = window;
|
7397 | var element = getActiveElement();
|
7398 | while (element instanceof win.HTMLIFrameElement) {
|
7399 |
|
7400 |
|
7401 | try {
|
7402 | win = element.contentDocument.defaultView;
|
7403 | } catch (e) {
|
7404 | return element;
|
7405 | }
|
7406 | element = getActiveElement(win.document);
|
7407 | }
|
7408 | return element;
|
7409 | }
|
7410 |
|
7411 |
|
7412 |
|
7413 |
|
7414 |
|
7415 |
|
7416 |
|
7417 |
|
7418 |
|
7419 |
|
7420 |
|
7421 |
|
7422 |
|
7423 | function hasSelectionCapabilities(elem) {
|
7424 | var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
|
7425 | return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');
|
7426 | }
|
7427 |
|
7428 | function getSelectionInformation() {
|
7429 | var focusedElem = getActiveElementDeep();
|
7430 | return {
|
7431 | focusedElem: focusedElem,
|
7432 | selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection$1(focusedElem) : null
|
7433 | };
|
7434 | }
|
7435 |
|
7436 |
|
7437 |
|
7438 |
|
7439 |
|
7440 |
|
7441 | function restoreSelection(priorSelectionInformation) {
|
7442 | var curFocusedElem = getActiveElementDeep();
|
7443 | var priorFocusedElem = priorSelectionInformation.focusedElem;
|
7444 | var priorSelectionRange = priorSelectionInformation.selectionRange;
|
7445 | if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
|
7446 | if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
|
7447 | setSelection(priorFocusedElem, priorSelectionRange);
|
7448 | }
|
7449 |
|
7450 |
|
7451 | var ancestors = [];
|
7452 | var ancestor = priorFocusedElem;
|
7453 | while (ancestor = ancestor.parentNode) {
|
7454 | if (ancestor.nodeType === ELEMENT_NODE) {
|
7455 | ancestors.push({
|
7456 | element: ancestor,
|
7457 | left: ancestor.scrollLeft,
|
7458 | top: ancestor.scrollTop
|
7459 | });
|
7460 | }
|
7461 | }
|
7462 |
|
7463 | if (typeof priorFocusedElem.focus === 'function') {
|
7464 | priorFocusedElem.focus();
|
7465 | }
|
7466 |
|
7467 | for (var i = 0; i < ancestors.length; i++) {
|
7468 | var info = ancestors[i];
|
7469 | info.element.scrollLeft = info.left;
|
7470 | info.element.scrollTop = info.top;
|
7471 | }
|
7472 | }
|
7473 | }
|
7474 |
|
7475 |
|
7476 |
|
7477 |
|
7478 |
|
7479 |
|
7480 |
|
7481 | function getSelection$1(input) {
|
7482 | var selection = void 0;
|
7483 |
|
7484 | if ('selectionStart' in input) {
|
7485 |
|
7486 | selection = {
|
7487 | start: input.selectionStart,
|
7488 | end: input.selectionEnd
|
7489 | };
|
7490 | } else {
|
7491 |
|
7492 | selection = getOffsets(input);
|
7493 | }
|
7494 |
|
7495 | return selection || { start: 0, end: 0 };
|
7496 | }
|
7497 |
|
7498 |
|
7499 |
|
7500 |
|
7501 |
|
7502 |
|
7503 |
|
7504 | function setSelection(input, offsets) {
|
7505 | var start = offsets.start,
|
7506 | end = offsets.end;
|
7507 |
|
7508 | if (end === undefined) {
|
7509 | end = start;
|
7510 | }
|
7511 |
|
7512 | if ('selectionStart' in input) {
|
7513 | input.selectionStart = start;
|
7514 | input.selectionEnd = Math.min(end, input.value.length);
|
7515 | } else {
|
7516 | setOffsets(input, offsets);
|
7517 | }
|
7518 | }
|
7519 |
|
7520 | var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;
|
7521 |
|
7522 | var eventTypes$3 = {
|
7523 | select: {
|
7524 | phasedRegistrationNames: {
|
7525 | bubbled: 'onSelect',
|
7526 | captured: 'onSelectCapture'
|
7527 | },
|
7528 | dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE]
|
7529 | }
|
7530 | };
|
7531 |
|
7532 | var activeElement$1 = null;
|
7533 | var activeElementInst$1 = null;
|
7534 | var lastSelection = null;
|
7535 | var mouseDown = false;
|
7536 |
|
7537 |
|
7538 |
|
7539 |
|
7540 |
|
7541 |
|
7542 |
|
7543 |
|
7544 |
|
7545 |
|
7546 | function getSelection(node) {
|
7547 | if ('selectionStart' in node && hasSelectionCapabilities(node)) {
|
7548 | return {
|
7549 | start: node.selectionStart,
|
7550 | end: node.selectionEnd
|
7551 | };
|
7552 | } else {
|
7553 | var win = node.ownerDocument && node.ownerDocument.defaultView || window;
|
7554 | var selection = win.getSelection();
|
7555 | return {
|
7556 | anchorNode: selection.anchorNode,
|
7557 | anchorOffset: selection.anchorOffset,
|
7558 | focusNode: selection.focusNode,
|
7559 | focusOffset: selection.focusOffset
|
7560 | };
|
7561 | }
|
7562 | }
|
7563 |
|
7564 |
|
7565 |
|
7566 |
|
7567 |
|
7568 |
|
7569 |
|
7570 | function getEventTargetDocument(eventTarget) {
|
7571 | return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
|
7572 | }
|
7573 |
|
7574 |
|
7575 |
|
7576 |
|
7577 |
|
7578 |
|
7579 |
|
7580 |
|
7581 | function constructSelectEvent(nativeEvent, nativeEventTarget) {
|
7582 |
|
7583 |
|
7584 |
|
7585 |
|
7586 | var doc = getEventTargetDocument(nativeEventTarget);
|
7587 |
|
7588 | if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
|
7589 | return null;
|
7590 | }
|
7591 |
|
7592 |
|
7593 | var currentSelection = getSelection(activeElement$1);
|
7594 | if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
|
7595 | lastSelection = currentSelection;
|
7596 |
|
7597 | var syntheticEvent = SyntheticEvent.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget);
|
7598 |
|
7599 | syntheticEvent.type = 'select';
|
7600 | syntheticEvent.target = activeElement$1;
|
7601 |
|
7602 | accumulateTwoPhaseDispatches(syntheticEvent);
|
7603 |
|
7604 | return syntheticEvent;
|
7605 | }
|
7606 |
|
7607 | return null;
|
7608 | }
|
7609 |
|
7610 |
|
7611 |
|
7612 |
|
7613 |
|
7614 |
|
7615 |
|
7616 |
|
7617 |
|
7618 |
|
7619 |
|
7620 |
|
7621 |
|
7622 |
|
7623 |
|
7624 | var SelectEventPlugin = {
|
7625 | eventTypes: eventTypes$3,
|
7626 |
|
7627 | extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
|
7628 | var doc = getEventTargetDocument(nativeEventTarget);
|
7629 |
|
7630 |
|
7631 | if (!doc || !isListeningToAllDependencies('onSelect', doc)) {
|
7632 | return null;
|
7633 | }
|
7634 |
|
7635 | var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
|
7636 |
|
7637 | switch (topLevelType) {
|
7638 |
|
7639 | case TOP_FOCUS:
|
7640 | if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
|
7641 | activeElement$1 = targetNode;
|
7642 | activeElementInst$1 = targetInst;
|
7643 | lastSelection = null;
|
7644 | }
|
7645 | break;
|
7646 | case TOP_BLUR:
|
7647 | activeElement$1 = null;
|
7648 | activeElementInst$1 = null;
|
7649 | lastSelection = null;
|
7650 | break;
|
7651 |
|
7652 |
|
7653 | case TOP_MOUSE_DOWN:
|
7654 | mouseDown = true;
|
7655 | break;
|
7656 | case TOP_CONTEXT_MENU:
|
7657 | case TOP_MOUSE_UP:
|
7658 | case TOP_DRAG_END:
|
7659 | mouseDown = false;
|
7660 | return constructSelectEvent(nativeEvent, nativeEventTarget);
|
7661 |
|
7662 |
|
7663 |
|
7664 |
|
7665 |
|
7666 |
|
7667 |
|
7668 |
|
7669 |
|
7670 | case TOP_SELECTION_CHANGE:
|
7671 | if (skipSelectionChangeEvent) {
|
7672 | break;
|
7673 | }
|
7674 |
|
7675 | case TOP_KEY_DOWN:
|
7676 | case TOP_KEY_UP:
|
7677 | return constructSelectEvent(nativeEvent, nativeEventTarget);
|
7678 | }
|
7679 |
|
7680 | return null;
|
7681 | }
|
7682 | };
|
7683 |
|
7684 |
|
7685 |
|
7686 |
|
7687 | injection.injectEventPluginOrder(DOMEventPluginOrder);
|
7688 | setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1);
|
7689 |
|
7690 |
|
7691 |
|
7692 |
|
7693 |
|
7694 | injection.injectEventPluginsByName({
|
7695 | SimpleEventPlugin: SimpleEventPlugin,
|
7696 | EnterLeaveEventPlugin: EnterLeaveEventPlugin,
|
7697 | ChangeEventPlugin: ChangeEventPlugin,
|
7698 | SelectEventPlugin: SelectEventPlugin,
|
7699 | BeforeInputEventPlugin: BeforeInputEventPlugin
|
7700 | });
|
7701 |
|
7702 | var didWarnSelectedSetOnOption = false;
|
7703 | var didWarnInvalidChild = false;
|
7704 |
|
7705 | function flattenChildren(children) {
|
7706 | var content = '';
|
7707 |
|
7708 |
|
7709 |
|
7710 |
|
7711 |
|
7712 |
|
7713 | React.Children.forEach(children, function (child) {
|
7714 | if (child == null) {
|
7715 | return;
|
7716 | }
|
7717 | content += child;
|
7718 |
|
7719 |
|
7720 |
|
7721 | });
|
7722 |
|
7723 | return content;
|
7724 | }
|
7725 |
|
7726 |
|
7727 |
|
7728 |
|
7729 |
|
7730 | function validateProps(element, props) {
|
7731 | {
|
7732 |
|
7733 |
|
7734 |
|
7735 |
|
7736 | if (typeof props.children === 'object' && props.children !== null) {
|
7737 | React.Children.forEach(props.children, function (child) {
|
7738 | if (child == null) {
|
7739 | return;
|
7740 | }
|
7741 | if (typeof child === 'string' || typeof child === 'number') {
|
7742 | return;
|
7743 | }
|
7744 | if (typeof child.type !== 'string') {
|
7745 | return;
|
7746 | }
|
7747 | if (!didWarnInvalidChild) {
|
7748 | didWarnInvalidChild = true;
|
7749 | warning$1(false, 'Only strings and numbers are supported as <option> children.');
|
7750 | }
|
7751 | });
|
7752 | }
|
7753 |
|
7754 |
|
7755 | if (props.selected != null && !didWarnSelectedSetOnOption) {
|
7756 | warning$1(false, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');
|
7757 | didWarnSelectedSetOnOption = true;
|
7758 | }
|
7759 | }
|
7760 | }
|
7761 |
|
7762 | function postMountWrapper$1(element, props) {
|
7763 |
|
7764 | if (props.value != null) {
|
7765 | element.setAttribute('value', toString(getToStringValue(props.value)));
|
7766 | }
|
7767 | }
|
7768 |
|
7769 | function getHostProps$1(element, props) {
|
7770 | var hostProps = _assign({ children: undefined }, props);
|
7771 | var content = flattenChildren(props.children);
|
7772 |
|
7773 | if (content) {
|
7774 | hostProps.children = content;
|
7775 | }
|
7776 |
|
7777 | return hostProps;
|
7778 | }
|
7779 |
|
7780 |
|
7781 | var didWarnValueDefaultValue$1 = void 0;
|
7782 |
|
7783 | {
|
7784 | didWarnValueDefaultValue$1 = false;
|
7785 | }
|
7786 |
|
7787 | function getDeclarationErrorAddendum() {
|
7788 | var ownerName = getCurrentFiberOwnerNameInDevOrNull();
|
7789 | if (ownerName) {
|
7790 | return '\n\nCheck the render method of `' + ownerName + '`.';
|
7791 | }
|
7792 | return '';
|
7793 | }
|
7794 |
|
7795 | var valuePropNames = ['value', 'defaultValue'];
|
7796 |
|
7797 |
|
7798 |
|
7799 |
|
7800 | function checkSelectPropTypes(props) {
|
7801 | ReactControlledValuePropTypes.checkPropTypes('select', props);
|
7802 |
|
7803 | for (var i = 0; i < valuePropNames.length; i++) {
|
7804 | var propName = valuePropNames[i];
|
7805 | if (props[propName] == null) {
|
7806 | continue;
|
7807 | }
|
7808 | var isArray = Array.isArray(props[propName]);
|
7809 | if (props.multiple && !isArray) {
|
7810 | warning$1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
|
7811 | } else if (!props.multiple && isArray) {
|
7812 | warning$1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
|
7813 | }
|
7814 | }
|
7815 | }
|
7816 |
|
7817 | function updateOptions(node, multiple, propValue, setDefaultSelected) {
|
7818 | var options = node.options;
|
7819 |
|
7820 | if (multiple) {
|
7821 | var selectedValues = propValue;
|
7822 | var selectedValue = {};
|
7823 | for (var i = 0; i < selectedValues.length; i++) {
|
7824 |
|
7825 | selectedValue['$' + selectedValues[i]] = true;
|
7826 | }
|
7827 | for (var _i = 0; _i < options.length; _i++) {
|
7828 | var selected = selectedValue.hasOwnProperty('$' + options[_i].value);
|
7829 | if (options[_i].selected !== selected) {
|
7830 | options[_i].selected = selected;
|
7831 | }
|
7832 | if (selected && setDefaultSelected) {
|
7833 | options[_i].defaultSelected = true;
|
7834 | }
|
7835 | }
|
7836 | } else {
|
7837 |
|
7838 |
|
7839 | var _selectedValue = toString(getToStringValue(propValue));
|
7840 | var defaultSelected = null;
|
7841 | for (var _i2 = 0; _i2 < options.length; _i2++) {
|
7842 | if (options[_i2].value === _selectedValue) {
|
7843 | options[_i2].selected = true;
|
7844 | if (setDefaultSelected) {
|
7845 | options[_i2].defaultSelected = true;
|
7846 | }
|
7847 | return;
|
7848 | }
|
7849 | if (defaultSelected === null && !options[_i2].disabled) {
|
7850 | defaultSelected = options[_i2];
|
7851 | }
|
7852 | }
|
7853 | if (defaultSelected !== null) {
|
7854 | defaultSelected.selected = true;
|
7855 | }
|
7856 | }
|
7857 | }
|
7858 |
|
7859 |
|
7860 |
|
7861 |
|
7862 |
|
7863 |
|
7864 |
|
7865 |
|
7866 |
|
7867 |
|
7868 |
|
7869 |
|
7870 |
|
7871 |
|
7872 |
|
7873 |
|
7874 |
|
7875 | function getHostProps$2(element, props) {
|
7876 | return _assign({}, props, {
|
7877 | value: undefined
|
7878 | });
|
7879 | }
|
7880 |
|
7881 | function initWrapperState$1(element, props) {
|
7882 | var node = element;
|
7883 | {
|
7884 | checkSelectPropTypes(props);
|
7885 | }
|
7886 |
|
7887 | node._wrapperState = {
|
7888 | wasMultiple: !!props.multiple
|
7889 | };
|
7890 |
|
7891 | {
|
7892 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
|
7893 | 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');
|
7894 | didWarnValueDefaultValue$1 = true;
|
7895 | }
|
7896 | }
|
7897 | }
|
7898 |
|
7899 | function postMountWrapper$2(element, props) {
|
7900 | var node = element;
|
7901 | node.multiple = !!props.multiple;
|
7902 | var value = props.value;
|
7903 | if (value != null) {
|
7904 | updateOptions(node, !!props.multiple, value, false);
|
7905 | } else if (props.defaultValue != null) {
|
7906 | updateOptions(node, !!props.multiple, props.defaultValue, true);
|
7907 | }
|
7908 | }
|
7909 |
|
7910 | function postUpdateWrapper(element, props) {
|
7911 | var node = element;
|
7912 | var wasMultiple = node._wrapperState.wasMultiple;
|
7913 | node._wrapperState.wasMultiple = !!props.multiple;
|
7914 |
|
7915 | var value = props.value;
|
7916 | if (value != null) {
|
7917 | updateOptions(node, !!props.multiple, value, false);
|
7918 | } else if (wasMultiple !== !!props.multiple) {
|
7919 |
|
7920 | if (props.defaultValue != null) {
|
7921 | updateOptions(node, !!props.multiple, props.defaultValue, true);
|
7922 | } else {
|
7923 |
|
7924 | updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);
|
7925 | }
|
7926 | }
|
7927 | }
|
7928 |
|
7929 | function restoreControlledState$2(element, props) {
|
7930 | var node = element;
|
7931 | var value = props.value;
|
7932 |
|
7933 | if (value != null) {
|
7934 | updateOptions(node, !!props.multiple, value, false);
|
7935 | }
|
7936 | }
|
7937 |
|
7938 | var didWarnValDefaultVal = false;
|
7939 |
|
7940 |
|
7941 |
|
7942 |
|
7943 |
|
7944 |
|
7945 |
|
7946 |
|
7947 |
|
7948 |
|
7949 |
|
7950 |
|
7951 |
|
7952 |
|
7953 |
|
7954 |
|
7955 |
|
7956 | function getHostProps$3(element, props) {
|
7957 | var node = element;
|
7958 | !(props.dangerouslySetInnerHTML == null) ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : void 0;
|
7959 |
|
7960 |
|
7961 |
|
7962 |
|
7963 |
|
7964 |
|
7965 |
|
7966 | var hostProps = _assign({}, props, {
|
7967 | value: undefined,
|
7968 | defaultValue: undefined,
|
7969 | children: toString(node._wrapperState.initialValue)
|
7970 | });
|
7971 |
|
7972 | return hostProps;
|
7973 | }
|
7974 |
|
7975 | function initWrapperState$2(element, props) {
|
7976 | var node = element;
|
7977 | {
|
7978 | ReactControlledValuePropTypes.checkPropTypes('textarea', props);
|
7979 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
|
7980 | warning$1(false, '%s contains a textarea with both value and defaultValue props. ' + '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', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
|
7981 | didWarnValDefaultVal = true;
|
7982 | }
|
7983 | }
|
7984 |
|
7985 | var initialValue = props.value;
|
7986 |
|
7987 |
|
7988 | if (initialValue == null) {
|
7989 | var defaultValue = props.defaultValue;
|
7990 |
|
7991 | var children = props.children;
|
7992 | if (children != null) {
|
7993 | {
|
7994 | warning$1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
|
7995 | }
|
7996 | !(defaultValue == null) ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : void 0;
|
7997 | if (Array.isArray(children)) {
|
7998 | !(children.length <= 1) ? invariant(false, '<textarea> can only have at most one child.') : void 0;
|
7999 | children = children[0];
|
8000 | }
|
8001 |
|
8002 | defaultValue = children;
|
8003 | }
|
8004 | if (defaultValue == null) {
|
8005 | defaultValue = '';
|
8006 | }
|
8007 | initialValue = defaultValue;
|
8008 | }
|
8009 |
|
8010 | node._wrapperState = {
|
8011 | initialValue: getToStringValue(initialValue)
|
8012 | };
|
8013 | }
|
8014 |
|
8015 | function updateWrapper$1(element, props) {
|
8016 | var node = element;
|
8017 | var value = getToStringValue(props.value);
|
8018 | var defaultValue = getToStringValue(props.defaultValue);
|
8019 | if (value != null) {
|
8020 |
|
8021 |
|
8022 | var newValue = toString(value);
|
8023 |
|
8024 | if (newValue !== node.value) {
|
8025 | node.value = newValue;
|
8026 | }
|
8027 | if (props.defaultValue == null && node.defaultValue !== newValue) {
|
8028 | node.defaultValue = newValue;
|
8029 | }
|
8030 | }
|
8031 | if (defaultValue != null) {
|
8032 | node.defaultValue = toString(defaultValue);
|
8033 | }
|
8034 | }
|
8035 |
|
8036 | function postMountWrapper$3(element, props) {
|
8037 | var node = element;
|
8038 |
|
8039 |
|
8040 | var textContent = node.textContent;
|
8041 |
|
8042 |
|
8043 |
|
8044 |
|
8045 |
|
8046 | if (textContent === node._wrapperState.initialValue) {
|
8047 | node.value = textContent;
|
8048 | }
|
8049 | }
|
8050 |
|
8051 | function restoreControlledState$3(element, props) {
|
8052 |
|
8053 | updateWrapper$1(element, props);
|
8054 | }
|
8055 |
|
8056 | var HTML_NAMESPACE$1 = 'http://www.w3.org/1999/xhtml';
|
8057 | var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
8058 | var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
8059 |
|
8060 | var Namespaces = {
|
8061 | html: HTML_NAMESPACE$1,
|
8062 | mathml: MATH_NAMESPACE,
|
8063 | svg: SVG_NAMESPACE
|
8064 | };
|
8065 |
|
8066 |
|
8067 | function getIntrinsicNamespace(type) {
|
8068 | switch (type) {
|
8069 | case 'svg':
|
8070 | return SVG_NAMESPACE;
|
8071 | case 'math':
|
8072 | return MATH_NAMESPACE;
|
8073 | default:
|
8074 | return HTML_NAMESPACE$1;
|
8075 | }
|
8076 | }
|
8077 |
|
8078 | function getChildNamespace(parentNamespace, type) {
|
8079 | if (parentNamespace == null || parentNamespace === HTML_NAMESPACE$1) {
|
8080 |
|
8081 | return getIntrinsicNamespace(type);
|
8082 | }
|
8083 | if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
|
8084 |
|
8085 | return HTML_NAMESPACE$1;
|
8086 | }
|
8087 |
|
8088 | return parentNamespace;
|
8089 | }
|
8090 |
|
8091 |
|
8092 |
|
8093 |
|
8094 |
|
8095 |
|
8096 | var createMicrosoftUnsafeLocalFunction = function (func) {
|
8097 | if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
|
8098 | return function (arg0, arg1, arg2, arg3) {
|
8099 | MSApp.execUnsafeLocalFunction(function () {
|
8100 | return func(arg0, arg1, arg2, arg3);
|
8101 | });
|
8102 | };
|
8103 | } else {
|
8104 | return func;
|
8105 | }
|
8106 | };
|
8107 |
|
8108 |
|
8109 | var reusableSVGContainer = void 0;
|
8110 |
|
8111 |
|
8112 |
|
8113 |
|
8114 |
|
8115 |
|
8116 |
|
8117 |
|
8118 | var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
|
8119 |
|
8120 |
|
8121 |
|
8122 |
|
8123 | if (node.namespaceURI === Namespaces.svg && !('innerHTML' in node)) {
|
8124 | reusableSVGContainer = reusableSVGContainer || document.createElement('div');
|
8125 | reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
|
8126 | var svgNode = reusableSVGContainer.firstChild;
|
8127 | while (node.firstChild) {
|
8128 | node.removeChild(node.firstChild);
|
8129 | }
|
8130 | while (svgNode.firstChild) {
|
8131 | node.appendChild(svgNode.firstChild);
|
8132 | }
|
8133 | } else {
|
8134 | node.innerHTML = html;
|
8135 | }
|
8136 | });
|
8137 |
|
8138 |
|
8139 |
|
8140 |
|
8141 |
|
8142 |
|
8143 |
|
8144 |
|
8145 |
|
8146 |
|
8147 | var setTextContent = function (node, text) {
|
8148 | if (text) {
|
8149 | var firstChild = node.firstChild;
|
8150 |
|
8151 | if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
|
8152 | firstChild.nodeValue = text;
|
8153 | return;
|
8154 | }
|
8155 | }
|
8156 | node.textContent = text;
|
8157 | };
|
8158 |
|
8159 |
|
8160 |
|
8161 | var shorthandToLonghand = {
|
8162 | animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],
|
8163 | background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],
|
8164 | backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],
|
8165 | border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],
|
8166 | borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],
|
8167 | borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],
|
8168 | borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],
|
8169 | borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],
|
8170 | borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],
|
8171 | borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],
|
8172 | borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],
|
8173 | borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],
|
8174 | borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],
|
8175 | borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],
|
8176 | borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],
|
8177 | borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],
|
8178 | borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],
|
8179 | columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],
|
8180 | columns: ['columnCount', 'columnWidth'],
|
8181 | flex: ['flexBasis', 'flexGrow', 'flexShrink'],
|
8182 | flexFlow: ['flexDirection', 'flexWrap'],
|
8183 | font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],
|
8184 | fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],
|
8185 | gap: ['columnGap', 'rowGap'],
|
8186 | grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
|
8187 | gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],
|
8188 | gridColumn: ['gridColumnEnd', 'gridColumnStart'],
|
8189 | gridColumnGap: ['columnGap'],
|
8190 | gridGap: ['columnGap', 'rowGap'],
|
8191 | gridRow: ['gridRowEnd', 'gridRowStart'],
|
8192 | gridRowGap: ['rowGap'],
|
8193 | gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
|
8194 | listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],
|
8195 | margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],
|
8196 | marker: ['markerEnd', 'markerMid', 'markerStart'],
|
8197 | mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],
|
8198 | maskPosition: ['maskPositionX', 'maskPositionY'],
|
8199 | outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],
|
8200 | overflow: ['overflowX', 'overflowY'],
|
8201 | padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
|
8202 | placeContent: ['alignContent', 'justifyContent'],
|
8203 | placeItems: ['alignItems', 'justifyItems'],
|
8204 | placeSelf: ['alignSelf', 'justifySelf'],
|
8205 | textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],
|
8206 | textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],
|
8207 | transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],
|
8208 | wordWrap: ['overflowWrap']
|
8209 | };
|
8210 |
|
8211 |
|
8212 |
|
8213 |
|
8214 | var isUnitlessNumber = {
|
8215 | animationIterationCount: true,
|
8216 | borderImageOutset: true,
|
8217 | borderImageSlice: true,
|
8218 | borderImageWidth: true,
|
8219 | boxFlex: true,
|
8220 | boxFlexGroup: true,
|
8221 | boxOrdinalGroup: true,
|
8222 | columnCount: true,
|
8223 | columns: true,
|
8224 | flex: true,
|
8225 | flexGrow: true,
|
8226 | flexPositive: true,
|
8227 | flexShrink: true,
|
8228 | flexNegative: true,
|
8229 | flexOrder: true,
|
8230 | gridArea: true,
|
8231 | gridRow: true,
|
8232 | gridRowEnd: true,
|
8233 | gridRowSpan: true,
|
8234 | gridRowStart: true,
|
8235 | gridColumn: true,
|
8236 | gridColumnEnd: true,
|
8237 | gridColumnSpan: true,
|
8238 | gridColumnStart: true,
|
8239 | fontWeight: true,
|
8240 | lineClamp: true,
|
8241 | lineHeight: true,
|
8242 | opacity: true,
|
8243 | order: true,
|
8244 | orphans: true,
|
8245 | tabSize: true,
|
8246 | widows: true,
|
8247 | zIndex: true,
|
8248 | zoom: true,
|
8249 |
|
8250 |
|
8251 | fillOpacity: true,
|
8252 | floodOpacity: true,
|
8253 | stopOpacity: true,
|
8254 | strokeDasharray: true,
|
8255 | strokeDashoffset: true,
|
8256 | strokeMiterlimit: true,
|
8257 | strokeOpacity: true,
|
8258 | strokeWidth: true
|
8259 | };
|
8260 |
|
8261 |
|
8262 |
|
8263 |
|
8264 |
|
8265 |
|
8266 |
|
8267 | function prefixKey(prefix, key) {
|
8268 | return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
8269 | }
|
8270 |
|
8271 |
|
8272 |
|
8273 |
|
8274 |
|
8275 | var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
|
8276 |
|
8277 |
|
8278 |
|
8279 | Object.keys(isUnitlessNumber).forEach(function (prop) {
|
8280 | prefixes.forEach(function (prefix) {
|
8281 | isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
|
8282 | });
|
8283 | });
|
8284 |
|
8285 |
|
8286 |
|
8287 |
|
8288 |
|
8289 |
|
8290 |
|
8291 |
|
8292 |
|
8293 |
|
8294 | function dangerousStyleValue(name, value, isCustomProperty) {
|
8295 |
|
8296 |
|
8297 |
|
8298 |
|
8299 |
|
8300 |
|
8301 |
|
8302 |
|
8303 |
|
8304 |
|
8305 | var isEmpty = value == null || typeof value === 'boolean' || value === '';
|
8306 | if (isEmpty) {
|
8307 | return '';
|
8308 | }
|
8309 |
|
8310 | if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
|
8311 | return value + 'px';
|
8312 | }
|
8313 |
|
8314 | return ('' + value).trim();
|
8315 | }
|
8316 |
|
8317 | var uppercasePattern = /([A-Z])/g;
|
8318 | var msPattern = /^ms-/;
|
8319 |
|
8320 |
|
8321 |
|
8322 |
|
8323 |
|
8324 |
|
8325 |
|
8326 |
|
8327 |
|
8328 |
|
8329 |
|
8330 |
|
8331 |
|
8332 |
|
8333 | function hyphenateStyleName(name) {
|
8334 | return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
|
8335 | }
|
8336 |
|
8337 | var warnValidStyle = function () {};
|
8338 |
|
8339 | {
|
8340 |
|
8341 | var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
|
8342 | var msPattern$1 = /^-ms-/;
|
8343 | var hyphenPattern = /-(.)/g;
|
8344 |
|
8345 |
|
8346 | var badStyleValueWithSemicolonPattern = /;\s*$/;
|
8347 |
|
8348 | var warnedStyleNames = {};
|
8349 | var warnedStyleValues = {};
|
8350 | var warnedForNaNValue = false;
|
8351 | var warnedForInfinityValue = false;
|
8352 |
|
8353 | var camelize = function (string) {
|
8354 | return string.replace(hyphenPattern, function (_, character) {
|
8355 | return character.toUpperCase();
|
8356 | });
|
8357 | };
|
8358 |
|
8359 | var warnHyphenatedStyleName = function (name) {
|
8360 | if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
8361 | return;
|
8362 | }
|
8363 |
|
8364 | warnedStyleNames[name] = true;
|
8365 | warning$1(false, 'Unsupported style property %s. Did you mean %s?', name,
|
8366 |
|
8367 |
|
8368 |
|
8369 | camelize(name.replace(msPattern$1, 'ms-')));
|
8370 | };
|
8371 |
|
8372 | var warnBadVendoredStyleName = function (name) {
|
8373 | if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
|
8374 | return;
|
8375 | }
|
8376 |
|
8377 | warnedStyleNames[name] = true;
|
8378 | warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
|
8379 | };
|
8380 |
|
8381 | var warnStyleValueWithSemicolon = function (name, value) {
|
8382 | if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
|
8383 | return;
|
8384 | }
|
8385 |
|
8386 | warnedStyleValues[value] = true;
|
8387 | warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
|
8388 | };
|
8389 |
|
8390 | var warnStyleValueIsNaN = function (name, value) {
|
8391 | if (warnedForNaNValue) {
|
8392 | return;
|
8393 | }
|
8394 |
|
8395 | warnedForNaNValue = true;
|
8396 | warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name);
|
8397 | };
|
8398 |
|
8399 | var warnStyleValueIsInfinity = function (name, value) {
|
8400 | if (warnedForInfinityValue) {
|
8401 | return;
|
8402 | }
|
8403 |
|
8404 | warnedForInfinityValue = true;
|
8405 | warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name);
|
8406 | };
|
8407 |
|
8408 | warnValidStyle = function (name, value) {
|
8409 | if (name.indexOf('-') > -1) {
|
8410 | warnHyphenatedStyleName(name);
|
8411 | } else if (badVendoredStyleNamePattern.test(name)) {
|
8412 | warnBadVendoredStyleName(name);
|
8413 | } else if (badStyleValueWithSemicolonPattern.test(value)) {
|
8414 | warnStyleValueWithSemicolon(name, value);
|
8415 | }
|
8416 |
|
8417 | if (typeof value === 'number') {
|
8418 | if (isNaN(value)) {
|
8419 | warnStyleValueIsNaN(name, value);
|
8420 | } else if (!isFinite(value)) {
|
8421 | warnStyleValueIsInfinity(name, value);
|
8422 | }
|
8423 | }
|
8424 | };
|
8425 | }
|
8426 |
|
8427 | var warnValidStyle$1 = warnValidStyle;
|
8428 |
|
8429 |
|
8430 |
|
8431 |
|
8432 |
|
8433 |
|
8434 |
|
8435 |
|
8436 |
|
8437 |
|
8438 |
|
8439 | function createDangerousStringForStyles(styles) {
|
8440 | {
|
8441 | var serialized = '';
|
8442 | var delimiter = '';
|
8443 | for (var styleName in styles) {
|
8444 | if (!styles.hasOwnProperty(styleName)) {
|
8445 | continue;
|
8446 | }
|
8447 | var styleValue = styles[styleName];
|
8448 | if (styleValue != null) {
|
8449 | var isCustomProperty = styleName.indexOf('--') === 0;
|
8450 | serialized += delimiter + hyphenateStyleName(styleName) + ':';
|
8451 | serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
|
8452 |
|
8453 | delimiter = ';';
|
8454 | }
|
8455 | }
|
8456 | return serialized || null;
|
8457 | }
|
8458 | }
|
8459 |
|
8460 |
|
8461 |
|
8462 |
|
8463 |
|
8464 |
|
8465 |
|
8466 |
|
8467 | function setValueForStyles(node, styles) {
|
8468 | var style = node.style;
|
8469 | for (var styleName in styles) {
|
8470 | if (!styles.hasOwnProperty(styleName)) {
|
8471 | continue;
|
8472 | }
|
8473 | var isCustomProperty = styleName.indexOf('--') === 0;
|
8474 | {
|
8475 | if (!isCustomProperty) {
|
8476 | warnValidStyle$1(styleName, styles[styleName]);
|
8477 | }
|
8478 | }
|
8479 | var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
|
8480 | if (styleName === 'float') {
|
8481 | styleName = 'cssFloat';
|
8482 | }
|
8483 | if (isCustomProperty) {
|
8484 | style.setProperty(styleName, styleValue);
|
8485 | } else {
|
8486 | style[styleName] = styleValue;
|
8487 | }
|
8488 | }
|
8489 | }
|
8490 |
|
8491 | function isValueEmpty(value) {
|
8492 | return value == null || typeof value === 'boolean' || value === '';
|
8493 | }
|
8494 |
|
8495 |
|
8496 |
|
8497 |
|
8498 |
|
8499 |
|
8500 |
|
8501 |
|
8502 |
|
8503 | function expandShorthandMap(styles) {
|
8504 | var expanded = {};
|
8505 | for (var key in styles) {
|
8506 | var longhands = shorthandToLonghand[key] || [key];
|
8507 | for (var i = 0; i < longhands.length; i++) {
|
8508 | expanded[longhands[i]] = key;
|
8509 | }
|
8510 | }
|
8511 | return expanded;
|
8512 | }
|
8513 |
|
8514 |
|
8515 |
|
8516 |
|
8517 |
|
8518 |
|
8519 |
|
8520 |
|
8521 |
|
8522 |
|
8523 |
|
8524 |
|
8525 |
|
8526 |
|
8527 |
|
8528 | function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
|
8529 | if (!warnAboutShorthandPropertyCollision) {
|
8530 | return;
|
8531 | }
|
8532 |
|
8533 | if (!nextStyles) {
|
8534 | return;
|
8535 | }
|
8536 |
|
8537 | var expandedUpdates = expandShorthandMap(styleUpdates);
|
8538 | var expandedStyles = expandShorthandMap(nextStyles);
|
8539 | var warnedAbout = {};
|
8540 | for (var key in expandedUpdates) {
|
8541 | var originalKey = expandedUpdates[key];
|
8542 | var correctOriginalKey = expandedStyles[key];
|
8543 | if (correctOriginalKey && originalKey !== correctOriginalKey) {
|
8544 | var warningKey = originalKey + ',' + correctOriginalKey;
|
8545 | if (warnedAbout[warningKey]) {
|
8546 | continue;
|
8547 | }
|
8548 | warnedAbout[warningKey] = true;
|
8549 | warning$1(false, '%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);
|
8550 | }
|
8551 | }
|
8552 | }
|
8553 |
|
8554 |
|
8555 |
|
8556 |
|
8557 | var omittedCloseTags = {
|
8558 | area: true,
|
8559 | base: true,
|
8560 | br: true,
|
8561 | col: true,
|
8562 | embed: true,
|
8563 | hr: true,
|
8564 | img: true,
|
8565 | input: true,
|
8566 | keygen: true,
|
8567 | link: true,
|
8568 | meta: true,
|
8569 | param: true,
|
8570 | source: true,
|
8571 | track: true,
|
8572 | wbr: true
|
8573 |
|
8574 | };
|
8575 |
|
8576 |
|
8577 |
|
8578 |
|
8579 | var voidElementTags = _assign({
|
8580 | menuitem: true
|
8581 | }, omittedCloseTags);
|
8582 |
|
8583 |
|
8584 |
|
8585 | var HTML$1 = '__html';
|
8586 |
|
8587 | var ReactDebugCurrentFrame$2 = null;
|
8588 | {
|
8589 | ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
8590 | }
|
8591 |
|
8592 | function assertValidProps(tag, props) {
|
8593 | if (!props) {
|
8594 | return;
|
8595 | }
|
8596 |
|
8597 | if (voidElementTags[tag]) {
|
8598 | !(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$2.getStackAddendum()) : void 0;
|
8599 | }
|
8600 | if (props.dangerouslySetInnerHTML != null) {
|
8601 | !(props.children == null) ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : void 0;
|
8602 | !(typeof props.dangerouslySetInnerHTML === 'object' && HTML$1 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;
|
8603 | }
|
8604 | {
|
8605 | !(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;
|
8606 | }
|
8607 | !(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$2.getStackAddendum()) : void 0;
|
8608 | }
|
8609 |
|
8610 | function isCustomComponent(tagName, props) {
|
8611 | if (tagName.indexOf('-') === -1) {
|
8612 | return typeof props.is === 'string';
|
8613 | }
|
8614 | switch (tagName) {
|
8615 |
|
8616 |
|
8617 |
|
8618 |
|
8619 | case 'annotation-xml':
|
8620 | case 'color-profile':
|
8621 | case 'font-face':
|
8622 | case 'font-face-src':
|
8623 | case 'font-face-uri':
|
8624 | case 'font-face-format':
|
8625 | case 'font-face-name':
|
8626 | case 'missing-glyph':
|
8627 | return false;
|
8628 | default:
|
8629 | return true;
|
8630 | }
|
8631 | }
|
8632 |
|
8633 |
|
8634 |
|
8635 |
|
8636 | var possibleStandardNames = {
|
8637 |
|
8638 | accept: 'accept',
|
8639 | acceptcharset: 'acceptCharset',
|
8640 | 'accept-charset': 'acceptCharset',
|
8641 | accesskey: 'accessKey',
|
8642 | action: 'action',
|
8643 | allowfullscreen: 'allowFullScreen',
|
8644 | alt: 'alt',
|
8645 | as: 'as',
|
8646 | async: 'async',
|
8647 | autocapitalize: 'autoCapitalize',
|
8648 | autocomplete: 'autoComplete',
|
8649 | autocorrect: 'autoCorrect',
|
8650 | autofocus: 'autoFocus',
|
8651 | autoplay: 'autoPlay',
|
8652 | autosave: 'autoSave',
|
8653 | capture: 'capture',
|
8654 | cellpadding: 'cellPadding',
|
8655 | cellspacing: 'cellSpacing',
|
8656 | challenge: 'challenge',
|
8657 | charset: 'charSet',
|
8658 | checked: 'checked',
|
8659 | children: 'children',
|
8660 | cite: 'cite',
|
8661 | class: 'className',
|
8662 | classid: 'classID',
|
8663 | classname: 'className',
|
8664 | cols: 'cols',
|
8665 | colspan: 'colSpan',
|
8666 | content: 'content',
|
8667 | contenteditable: 'contentEditable',
|
8668 | contextmenu: 'contextMenu',
|
8669 | controls: 'controls',
|
8670 | controlslist: 'controlsList',
|
8671 | coords: 'coords',
|
8672 | crossorigin: 'crossOrigin',
|
8673 | dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
|
8674 | data: 'data',
|
8675 | datetime: 'dateTime',
|
8676 | default: 'default',
|
8677 | defaultchecked: 'defaultChecked',
|
8678 | defaultvalue: 'defaultValue',
|
8679 | defer: 'defer',
|
8680 | dir: 'dir',
|
8681 | disabled: 'disabled',
|
8682 | download: 'download',
|
8683 | draggable: 'draggable',
|
8684 | enctype: 'encType',
|
8685 | for: 'htmlFor',
|
8686 | form: 'form',
|
8687 | formmethod: 'formMethod',
|
8688 | formaction: 'formAction',
|
8689 | formenctype: 'formEncType',
|
8690 | formnovalidate: 'formNoValidate',
|
8691 | formtarget: 'formTarget',
|
8692 | frameborder: 'frameBorder',
|
8693 | headers: 'headers',
|
8694 | height: 'height',
|
8695 | hidden: 'hidden',
|
8696 | high: 'high',
|
8697 | href: 'href',
|
8698 | hreflang: 'hrefLang',
|
8699 | htmlfor: 'htmlFor',
|
8700 | httpequiv: 'httpEquiv',
|
8701 | 'http-equiv': 'httpEquiv',
|
8702 | icon: 'icon',
|
8703 | id: 'id',
|
8704 | innerhtml: 'innerHTML',
|
8705 | inputmode: 'inputMode',
|
8706 | integrity: 'integrity',
|
8707 | is: 'is',
|
8708 | itemid: 'itemID',
|
8709 | itemprop: 'itemProp',
|
8710 | itemref: 'itemRef',
|
8711 | itemscope: 'itemScope',
|
8712 | itemtype: 'itemType',
|
8713 | keyparams: 'keyParams',
|
8714 | keytype: 'keyType',
|
8715 | kind: 'kind',
|
8716 | label: 'label',
|
8717 | lang: 'lang',
|
8718 | list: 'list',
|
8719 | loop: 'loop',
|
8720 | low: 'low',
|
8721 | manifest: 'manifest',
|
8722 | marginwidth: 'marginWidth',
|
8723 | marginheight: 'marginHeight',
|
8724 | max: 'max',
|
8725 | maxlength: 'maxLength',
|
8726 | media: 'media',
|
8727 | mediagroup: 'mediaGroup',
|
8728 | method: 'method',
|
8729 | min: 'min',
|
8730 | minlength: 'minLength',
|
8731 | multiple: 'multiple',
|
8732 | muted: 'muted',
|
8733 | name: 'name',
|
8734 | nomodule: 'noModule',
|
8735 | nonce: 'nonce',
|
8736 | novalidate: 'noValidate',
|
8737 | open: 'open',
|
8738 | optimum: 'optimum',
|
8739 | pattern: 'pattern',
|
8740 | placeholder: 'placeholder',
|
8741 | playsinline: 'playsInline',
|
8742 | poster: 'poster',
|
8743 | preload: 'preload',
|
8744 | profile: 'profile',
|
8745 | radiogroup: 'radioGroup',
|
8746 | readonly: 'readOnly',
|
8747 | referrerpolicy: 'referrerPolicy',
|
8748 | rel: 'rel',
|
8749 | required: 'required',
|
8750 | reversed: 'reversed',
|
8751 | role: 'role',
|
8752 | rows: 'rows',
|
8753 | rowspan: 'rowSpan',
|
8754 | sandbox: 'sandbox',
|
8755 | scope: 'scope',
|
8756 | scoped: 'scoped',
|
8757 | scrolling: 'scrolling',
|
8758 | seamless: 'seamless',
|
8759 | selected: 'selected',
|
8760 | shape: 'shape',
|
8761 | size: 'size',
|
8762 | sizes: 'sizes',
|
8763 | span: 'span',
|
8764 | spellcheck: 'spellCheck',
|
8765 | src: 'src',
|
8766 | srcdoc: 'srcDoc',
|
8767 | srclang: 'srcLang',
|
8768 | srcset: 'srcSet',
|
8769 | start: 'start',
|
8770 | step: 'step',
|
8771 | style: 'style',
|
8772 | summary: 'summary',
|
8773 | tabindex: 'tabIndex',
|
8774 | target: 'target',
|
8775 | title: 'title',
|
8776 | type: 'type',
|
8777 | usemap: 'useMap',
|
8778 | value: 'value',
|
8779 | width: 'width',
|
8780 | wmode: 'wmode',
|
8781 | wrap: 'wrap',
|
8782 |
|
8783 |
|
8784 | about: 'about',
|
8785 | accentheight: 'accentHeight',
|
8786 | 'accent-height': 'accentHeight',
|
8787 | accumulate: 'accumulate',
|
8788 | additive: 'additive',
|
8789 | alignmentbaseline: 'alignmentBaseline',
|
8790 | 'alignment-baseline': 'alignmentBaseline',
|
8791 | allowreorder: 'allowReorder',
|
8792 | alphabetic: 'alphabetic',
|
8793 | amplitude: 'amplitude',
|
8794 | arabicform: 'arabicForm',
|
8795 | 'arabic-form': 'arabicForm',
|
8796 | ascent: 'ascent',
|
8797 | attributename: 'attributeName',
|
8798 | attributetype: 'attributeType',
|
8799 | autoreverse: 'autoReverse',
|
8800 | azimuth: 'azimuth',
|
8801 | basefrequency: 'baseFrequency',
|
8802 | baselineshift: 'baselineShift',
|
8803 | 'baseline-shift': 'baselineShift',
|
8804 | baseprofile: 'baseProfile',
|
8805 | bbox: 'bbox',
|
8806 | begin: 'begin',
|
8807 | bias: 'bias',
|
8808 | by: 'by',
|
8809 | calcmode: 'calcMode',
|
8810 | capheight: 'capHeight',
|
8811 | 'cap-height': 'capHeight',
|
8812 | clip: 'clip',
|
8813 | clippath: 'clipPath',
|
8814 | 'clip-path': 'clipPath',
|
8815 | clippathunits: 'clipPathUnits',
|
8816 | cliprule: 'clipRule',
|
8817 | 'clip-rule': 'clipRule',
|
8818 | color: 'color',
|
8819 | colorinterpolation: 'colorInterpolation',
|
8820 | 'color-interpolation': 'colorInterpolation',
|
8821 | colorinterpolationfilters: 'colorInterpolationFilters',
|
8822 | 'color-interpolation-filters': 'colorInterpolationFilters',
|
8823 | colorprofile: 'colorProfile',
|
8824 | 'color-profile': 'colorProfile',
|
8825 | colorrendering: 'colorRendering',
|
8826 | 'color-rendering': 'colorRendering',
|
8827 | contentscripttype: 'contentScriptType',
|
8828 | contentstyletype: 'contentStyleType',
|
8829 | cursor: 'cursor',
|
8830 | cx: 'cx',
|
8831 | cy: 'cy',
|
8832 | d: 'd',
|
8833 | datatype: 'datatype',
|
8834 | decelerate: 'decelerate',
|
8835 | descent: 'descent',
|
8836 | diffuseconstant: 'diffuseConstant',
|
8837 | direction: 'direction',
|
8838 | display: 'display',
|
8839 | divisor: 'divisor',
|
8840 | dominantbaseline: 'dominantBaseline',
|
8841 | 'dominant-baseline': 'dominantBaseline',
|
8842 | dur: 'dur',
|
8843 | dx: 'dx',
|
8844 | dy: 'dy',
|
8845 | edgemode: 'edgeMode',
|
8846 | elevation: 'elevation',
|
8847 | enablebackground: 'enableBackground',
|
8848 | 'enable-background': 'enableBackground',
|
8849 | end: 'end',
|
8850 | exponent: 'exponent',
|
8851 | externalresourcesrequired: 'externalResourcesRequired',
|
8852 | fill: 'fill',
|
8853 | fillopacity: 'fillOpacity',
|
8854 | 'fill-opacity': 'fillOpacity',
|
8855 | fillrule: 'fillRule',
|
8856 | 'fill-rule': 'fillRule',
|
8857 | filter: 'filter',
|
8858 | filterres: 'filterRes',
|
8859 | filterunits: 'filterUnits',
|
8860 | floodopacity: 'floodOpacity',
|
8861 | 'flood-opacity': 'floodOpacity',
|
8862 | floodcolor: 'floodColor',
|
8863 | 'flood-color': 'floodColor',
|
8864 | focusable: 'focusable',
|
8865 | fontfamily: 'fontFamily',
|
8866 | 'font-family': 'fontFamily',
|
8867 | fontsize: 'fontSize',
|
8868 | 'font-size': 'fontSize',
|
8869 | fontsizeadjust: 'fontSizeAdjust',
|
8870 | 'font-size-adjust': 'fontSizeAdjust',
|
8871 | fontstretch: 'fontStretch',
|
8872 | 'font-stretch': 'fontStretch',
|
8873 | fontstyle: 'fontStyle',
|
8874 | 'font-style': 'fontStyle',
|
8875 | fontvariant: 'fontVariant',
|
8876 | 'font-variant': 'fontVariant',
|
8877 | fontweight: 'fontWeight',
|
8878 | 'font-weight': 'fontWeight',
|
8879 | format: 'format',
|
8880 | from: 'from',
|
8881 | fx: 'fx',
|
8882 | fy: 'fy',
|
8883 | g1: 'g1',
|
8884 | g2: 'g2',
|
8885 | glyphname: 'glyphName',
|
8886 | 'glyph-name': 'glyphName',
|
8887 | glyphorientationhorizontal: 'glyphOrientationHorizontal',
|
8888 | 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
|
8889 | glyphorientationvertical: 'glyphOrientationVertical',
|
8890 | 'glyph-orientation-vertical': 'glyphOrientationVertical',
|
8891 | glyphref: 'glyphRef',
|
8892 | gradienttransform: 'gradientTransform',
|
8893 | gradientunits: 'gradientUnits',
|
8894 | hanging: 'hanging',
|
8895 | horizadvx: 'horizAdvX',
|
8896 | 'horiz-adv-x': 'horizAdvX',
|
8897 | horizoriginx: 'horizOriginX',
|
8898 | 'horiz-origin-x': 'horizOriginX',
|
8899 | ideographic: 'ideographic',
|
8900 | imagerendering: 'imageRendering',
|
8901 | 'image-rendering': 'imageRendering',
|
8902 | in2: 'in2',
|
8903 | in: 'in',
|
8904 | inlist: 'inlist',
|
8905 | intercept: 'intercept',
|
8906 | k1: 'k1',
|
8907 | k2: 'k2',
|
8908 | k3: 'k3',
|
8909 | k4: 'k4',
|
8910 | k: 'k',
|
8911 | kernelmatrix: 'kernelMatrix',
|
8912 | kernelunitlength: 'kernelUnitLength',
|
8913 | kerning: 'kerning',
|
8914 | keypoints: 'keyPoints',
|
8915 | keysplines: 'keySplines',
|
8916 | keytimes: 'keyTimes',
|
8917 | lengthadjust: 'lengthAdjust',
|
8918 | letterspacing: 'letterSpacing',
|
8919 | 'letter-spacing': 'letterSpacing',
|
8920 | lightingcolor: 'lightingColor',
|
8921 | 'lighting-color': 'lightingColor',
|
8922 | limitingconeangle: 'limitingConeAngle',
|
8923 | local: 'local',
|
8924 | markerend: 'markerEnd',
|
8925 | 'marker-end': 'markerEnd',
|
8926 | markerheight: 'markerHeight',
|
8927 | markermid: 'markerMid',
|
8928 | 'marker-mid': 'markerMid',
|
8929 | markerstart: 'markerStart',
|
8930 | 'marker-start': 'markerStart',
|
8931 | markerunits: 'markerUnits',
|
8932 | markerwidth: 'markerWidth',
|
8933 | mask: 'mask',
|
8934 | maskcontentunits: 'maskContentUnits',
|
8935 | maskunits: 'maskUnits',
|
8936 | mathematical: 'mathematical',
|
8937 | mode: 'mode',
|
8938 | numoctaves: 'numOctaves',
|
8939 | offset: 'offset',
|
8940 | opacity: 'opacity',
|
8941 | operator: 'operator',
|
8942 | order: 'order',
|
8943 | orient: 'orient',
|
8944 | orientation: 'orientation',
|
8945 | origin: 'origin',
|
8946 | overflow: 'overflow',
|
8947 | overlineposition: 'overlinePosition',
|
8948 | 'overline-position': 'overlinePosition',
|
8949 | overlinethickness: 'overlineThickness',
|
8950 | 'overline-thickness': 'overlineThickness',
|
8951 | paintorder: 'paintOrder',
|
8952 | 'paint-order': 'paintOrder',
|
8953 | panose1: 'panose1',
|
8954 | 'panose-1': 'panose1',
|
8955 | pathlength: 'pathLength',
|
8956 | patterncontentunits: 'patternContentUnits',
|
8957 | patterntransform: 'patternTransform',
|
8958 | patternunits: 'patternUnits',
|
8959 | pointerevents: 'pointerEvents',
|
8960 | 'pointer-events': 'pointerEvents',
|
8961 | points: 'points',
|
8962 | pointsatx: 'pointsAtX',
|
8963 | pointsaty: 'pointsAtY',
|
8964 | pointsatz: 'pointsAtZ',
|
8965 | prefix: 'prefix',
|
8966 | preservealpha: 'preserveAlpha',
|
8967 | preserveaspectratio: 'preserveAspectRatio',
|
8968 | primitiveunits: 'primitiveUnits',
|
8969 | property: 'property',
|
8970 | r: 'r',
|
8971 | radius: 'radius',
|
8972 | refx: 'refX',
|
8973 | refy: 'refY',
|
8974 | renderingintent: 'renderingIntent',
|
8975 | 'rendering-intent': 'renderingIntent',
|
8976 | repeatcount: 'repeatCount',
|
8977 | repeatdur: 'repeatDur',
|
8978 | requiredextensions: 'requiredExtensions',
|
8979 | requiredfeatures: 'requiredFeatures',
|
8980 | resource: 'resource',
|
8981 | restart: 'restart',
|
8982 | result: 'result',
|
8983 | results: 'results',
|
8984 | rotate: 'rotate',
|
8985 | rx: 'rx',
|
8986 | ry: 'ry',
|
8987 | scale: 'scale',
|
8988 | security: 'security',
|
8989 | seed: 'seed',
|
8990 | shaperendering: 'shapeRendering',
|
8991 | 'shape-rendering': 'shapeRendering',
|
8992 | slope: 'slope',
|
8993 | spacing: 'spacing',
|
8994 | specularconstant: 'specularConstant',
|
8995 | specularexponent: 'specularExponent',
|
8996 | speed: 'speed',
|
8997 | spreadmethod: 'spreadMethod',
|
8998 | startoffset: 'startOffset',
|
8999 | stddeviation: 'stdDeviation',
|
9000 | stemh: 'stemh',
|
9001 | stemv: 'stemv',
|
9002 | stitchtiles: 'stitchTiles',
|
9003 | stopcolor: 'stopColor',
|
9004 | 'stop-color': 'stopColor',
|
9005 | stopopacity: 'stopOpacity',
|
9006 | 'stop-opacity': 'stopOpacity',
|
9007 | strikethroughposition: 'strikethroughPosition',
|
9008 | 'strikethrough-position': 'strikethroughPosition',
|
9009 | strikethroughthickness: 'strikethroughThickness',
|
9010 | 'strikethrough-thickness': 'strikethroughThickness',
|
9011 | string: 'string',
|
9012 | stroke: 'stroke',
|
9013 | strokedasharray: 'strokeDasharray',
|
9014 | 'stroke-dasharray': 'strokeDasharray',
|
9015 | strokedashoffset: 'strokeDashoffset',
|
9016 | 'stroke-dashoffset': 'strokeDashoffset',
|
9017 | strokelinecap: 'strokeLinecap',
|
9018 | 'stroke-linecap': 'strokeLinecap',
|
9019 | strokelinejoin: 'strokeLinejoin',
|
9020 | 'stroke-linejoin': 'strokeLinejoin',
|
9021 | strokemiterlimit: 'strokeMiterlimit',
|
9022 | 'stroke-miterlimit': 'strokeMiterlimit',
|
9023 | strokewidth: 'strokeWidth',
|
9024 | 'stroke-width': 'strokeWidth',
|
9025 | strokeopacity: 'strokeOpacity',
|
9026 | 'stroke-opacity': 'strokeOpacity',
|
9027 | suppresscontenteditablewarning: 'suppressContentEditableWarning',
|
9028 | suppresshydrationwarning: 'suppressHydrationWarning',
|
9029 | surfacescale: 'surfaceScale',
|
9030 | systemlanguage: 'systemLanguage',
|
9031 | tablevalues: 'tableValues',
|
9032 | targetx: 'targetX',
|
9033 | targety: 'targetY',
|
9034 | textanchor: 'textAnchor',
|
9035 | 'text-anchor': 'textAnchor',
|
9036 | textdecoration: 'textDecoration',
|
9037 | 'text-decoration': 'textDecoration',
|
9038 | textlength: 'textLength',
|
9039 | textrendering: 'textRendering',
|
9040 | 'text-rendering': 'textRendering',
|
9041 | to: 'to',
|
9042 | transform: 'transform',
|
9043 | typeof: 'typeof',
|
9044 | u1: 'u1',
|
9045 | u2: 'u2',
|
9046 | underlineposition: 'underlinePosition',
|
9047 | 'underline-position': 'underlinePosition',
|
9048 | underlinethickness: 'underlineThickness',
|
9049 | 'underline-thickness': 'underlineThickness',
|
9050 | unicode: 'unicode',
|
9051 | unicodebidi: 'unicodeBidi',
|
9052 | 'unicode-bidi': 'unicodeBidi',
|
9053 | unicoderange: 'unicodeRange',
|
9054 | 'unicode-range': 'unicodeRange',
|
9055 | unitsperem: 'unitsPerEm',
|
9056 | 'units-per-em': 'unitsPerEm',
|
9057 | unselectable: 'unselectable',
|
9058 | valphabetic: 'vAlphabetic',
|
9059 | 'v-alphabetic': 'vAlphabetic',
|
9060 | values: 'values',
|
9061 | vectoreffect: 'vectorEffect',
|
9062 | 'vector-effect': 'vectorEffect',
|
9063 | version: 'version',
|
9064 | vertadvy: 'vertAdvY',
|
9065 | 'vert-adv-y': 'vertAdvY',
|
9066 | vertoriginx: 'vertOriginX',
|
9067 | 'vert-origin-x': 'vertOriginX',
|
9068 | vertoriginy: 'vertOriginY',
|
9069 | 'vert-origin-y': 'vertOriginY',
|
9070 | vhanging: 'vHanging',
|
9071 | 'v-hanging': 'vHanging',
|
9072 | videographic: 'vIdeographic',
|
9073 | 'v-ideographic': 'vIdeographic',
|
9074 | viewbox: 'viewBox',
|
9075 | viewtarget: 'viewTarget',
|
9076 | visibility: 'visibility',
|
9077 | vmathematical: 'vMathematical',
|
9078 | 'v-mathematical': 'vMathematical',
|
9079 | vocab: 'vocab',
|
9080 | widths: 'widths',
|
9081 | wordspacing: 'wordSpacing',
|
9082 | 'word-spacing': 'wordSpacing',
|
9083 | writingmode: 'writingMode',
|
9084 | 'writing-mode': 'writingMode',
|
9085 | x1: 'x1',
|
9086 | x2: 'x2',
|
9087 | x: 'x',
|
9088 | xchannelselector: 'xChannelSelector',
|
9089 | xheight: 'xHeight',
|
9090 | 'x-height': 'xHeight',
|
9091 | xlinkactuate: 'xlinkActuate',
|
9092 | 'xlink:actuate': 'xlinkActuate',
|
9093 | xlinkarcrole: 'xlinkArcrole',
|
9094 | 'xlink:arcrole': 'xlinkArcrole',
|
9095 | xlinkhref: 'xlinkHref',
|
9096 | 'xlink:href': 'xlinkHref',
|
9097 | xlinkrole: 'xlinkRole',
|
9098 | 'xlink:role': 'xlinkRole',
|
9099 | xlinkshow: 'xlinkShow',
|
9100 | 'xlink:show': 'xlinkShow',
|
9101 | xlinktitle: 'xlinkTitle',
|
9102 | 'xlink:title': 'xlinkTitle',
|
9103 | xlinktype: 'xlinkType',
|
9104 | 'xlink:type': 'xlinkType',
|
9105 | xmlbase: 'xmlBase',
|
9106 | 'xml:base': 'xmlBase',
|
9107 | xmllang: 'xmlLang',
|
9108 | 'xml:lang': 'xmlLang',
|
9109 | xmlns: 'xmlns',
|
9110 | 'xml:space': 'xmlSpace',
|
9111 | xmlnsxlink: 'xmlnsXlink',
|
9112 | 'xmlns:xlink': 'xmlnsXlink',
|
9113 | xmlspace: 'xmlSpace',
|
9114 | y1: 'y1',
|
9115 | y2: 'y2',
|
9116 | y: 'y',
|
9117 | ychannelselector: 'yChannelSelector',
|
9118 | z: 'z',
|
9119 | zoomandpan: 'zoomAndPan'
|
9120 | };
|
9121 |
|
9122 | var ariaProperties = {
|
9123 | 'aria-current': 0,
|
9124 | 'aria-details': 0,
|
9125 | 'aria-disabled': 0,
|
9126 | 'aria-hidden': 0,
|
9127 | 'aria-invalid': 0,
|
9128 | 'aria-keyshortcuts': 0,
|
9129 | 'aria-label': 0,
|
9130 | 'aria-roledescription': 0,
|
9131 |
|
9132 | 'aria-autocomplete': 0,
|
9133 | 'aria-checked': 0,
|
9134 | 'aria-expanded': 0,
|
9135 | 'aria-haspopup': 0,
|
9136 | 'aria-level': 0,
|
9137 | 'aria-modal': 0,
|
9138 | 'aria-multiline': 0,
|
9139 | 'aria-multiselectable': 0,
|
9140 | 'aria-orientation': 0,
|
9141 | 'aria-placeholder': 0,
|
9142 | 'aria-pressed': 0,
|
9143 | 'aria-readonly': 0,
|
9144 | 'aria-required': 0,
|
9145 | 'aria-selected': 0,
|
9146 | 'aria-sort': 0,
|
9147 | 'aria-valuemax': 0,
|
9148 | 'aria-valuemin': 0,
|
9149 | 'aria-valuenow': 0,
|
9150 | 'aria-valuetext': 0,
|
9151 |
|
9152 | 'aria-atomic': 0,
|
9153 | 'aria-busy': 0,
|
9154 | 'aria-live': 0,
|
9155 | 'aria-relevant': 0,
|
9156 |
|
9157 | 'aria-dropeffect': 0,
|
9158 | 'aria-grabbed': 0,
|
9159 |
|
9160 | 'aria-activedescendant': 0,
|
9161 | 'aria-colcount': 0,
|
9162 | 'aria-colindex': 0,
|
9163 | 'aria-colspan': 0,
|
9164 | 'aria-controls': 0,
|
9165 | 'aria-describedby': 0,
|
9166 | 'aria-errormessage': 0,
|
9167 | 'aria-flowto': 0,
|
9168 | 'aria-labelledby': 0,
|
9169 | 'aria-owns': 0,
|
9170 | 'aria-posinset': 0,
|
9171 | 'aria-rowcount': 0,
|
9172 | 'aria-rowindex': 0,
|
9173 | 'aria-rowspan': 0,
|
9174 | 'aria-setsize': 0
|
9175 | };
|
9176 |
|
9177 | var warnedProperties = {};
|
9178 | var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
|
9179 | var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
9180 |
|
9181 | var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
9182 |
|
9183 | function validateProperty(tagName, name) {
|
9184 | if (hasOwnProperty$2.call(warnedProperties, name) && warnedProperties[name]) {
|
9185 | return true;
|
9186 | }
|
9187 |
|
9188 | if (rARIACamel.test(name)) {
|
9189 | var ariaName = 'aria-' + name.slice(4).toLowerCase();
|
9190 | var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;
|
9191 |
|
9192 |
|
9193 |
|
9194 | if (correctName == null) {
|
9195 | warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
|
9196 | warnedProperties[name] = true;
|
9197 | return true;
|
9198 | }
|
9199 |
|
9200 | if (name !== correctName) {
|
9201 | warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
|
9202 | warnedProperties[name] = true;
|
9203 | return true;
|
9204 | }
|
9205 | }
|
9206 |
|
9207 | if (rARIA.test(name)) {
|
9208 | var lowerCasedName = name.toLowerCase();
|
9209 | var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
|
9210 |
|
9211 |
|
9212 |
|
9213 | if (standardName == null) {
|
9214 | warnedProperties[name] = true;
|
9215 | return false;
|
9216 | }
|
9217 |
|
9218 | if (name !== standardName) {
|
9219 | warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
|
9220 | warnedProperties[name] = true;
|
9221 | return true;
|
9222 | }
|
9223 | }
|
9224 |
|
9225 | return true;
|
9226 | }
|
9227 |
|
9228 | function warnInvalidARIAProps(type, props) {
|
9229 | var invalidProps = [];
|
9230 |
|
9231 | for (var key in props) {
|
9232 | var isValid = validateProperty(type, key);
|
9233 | if (!isValid) {
|
9234 | invalidProps.push(key);
|
9235 | }
|
9236 | }
|
9237 |
|
9238 | var unknownPropString = invalidProps.map(function (prop) {
|
9239 | return '`' + prop + '`';
|
9240 | }).join(', ');
|
9241 |
|
9242 | if (invalidProps.length === 1) {
|
9243 | warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
|
9244 | } else if (invalidProps.length > 1) {
|
9245 | warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
|
9246 | }
|
9247 | }
|
9248 |
|
9249 | function validateProperties(type, props) {
|
9250 | if (isCustomComponent(type, props)) {
|
9251 | return;
|
9252 | }
|
9253 | warnInvalidARIAProps(type, props);
|
9254 | }
|
9255 |
|
9256 | var didWarnValueNull = false;
|
9257 |
|
9258 | function validateProperties$1(type, props) {
|
9259 | if (type !== 'input' && type !== 'textarea' && type !== 'select') {
|
9260 | return;
|
9261 | }
|
9262 |
|
9263 | if (props != null && props.value === null && !didWarnValueNull) {
|
9264 | didWarnValueNull = true;
|
9265 | if (type === 'select' && props.multiple) {
|
9266 | 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);
|
9267 | } else {
|
9268 | 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);
|
9269 | }
|
9270 | }
|
9271 | }
|
9272 |
|
9273 | var validateProperty$1 = function () {};
|
9274 |
|
9275 | {
|
9276 | var warnedProperties$1 = {};
|
9277 | var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
9278 | var EVENT_NAME_REGEX = /^on./;
|
9279 | var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
|
9280 | var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
|
9281 | var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
|
9282 |
|
9283 | validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
|
9284 | if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
|
9285 | return true;
|
9286 | }
|
9287 |
|
9288 | var lowerCasedName = name.toLowerCase();
|
9289 | if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
|
9290 | 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.');
|
9291 | warnedProperties$1[name] = true;
|
9292 | return true;
|
9293 | }
|
9294 |
|
9295 |
|
9296 | if (canUseEventSystem) {
|
9297 | if (registrationNameModules.hasOwnProperty(name)) {
|
9298 | return true;
|
9299 | }
|
9300 | var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
|
9301 | if (registrationName != null) {
|
9302 | warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
|
9303 | warnedProperties$1[name] = true;
|
9304 | return true;
|
9305 | }
|
9306 | if (EVENT_NAME_REGEX.test(name)) {
|
9307 | warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name);
|
9308 | warnedProperties$1[name] = true;
|
9309 | return true;
|
9310 | }
|
9311 | } else if (EVENT_NAME_REGEX.test(name)) {
|
9312 |
|
9313 |
|
9314 |
|
9315 | if (INVALID_EVENT_NAME_REGEX.test(name)) {
|
9316 | warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
|
9317 | }
|
9318 | warnedProperties$1[name] = true;
|
9319 | return true;
|
9320 | }
|
9321 |
|
9322 |
|
9323 | if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
|
9324 | return true;
|
9325 | }
|
9326 |
|
9327 | if (lowerCasedName === 'innerhtml') {
|
9328 | warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
|
9329 | warnedProperties$1[name] = true;
|
9330 | return true;
|
9331 | }
|
9332 |
|
9333 | if (lowerCasedName === 'aria') {
|
9334 | warning$1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
|
9335 | warnedProperties$1[name] = true;
|
9336 | return true;
|
9337 | }
|
9338 |
|
9339 | if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
|
9340 | warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
|
9341 | warnedProperties$1[name] = true;
|
9342 | return true;
|
9343 | }
|
9344 |
|
9345 | if (typeof value === 'number' && isNaN(value)) {
|
9346 | warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
|
9347 | warnedProperties$1[name] = true;
|
9348 | return true;
|
9349 | }
|
9350 |
|
9351 | var propertyInfo = getPropertyInfo(name);
|
9352 | var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
|
9353 |
|
9354 |
|
9355 | if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
|
9356 | var standardName = possibleStandardNames[lowerCasedName];
|
9357 | if (standardName !== name) {
|
9358 | warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
|
9359 | warnedProperties$1[name] = true;
|
9360 | return true;
|
9361 | }
|
9362 | } else if (!isReserved && name !== lowerCasedName) {
|
9363 |
|
9364 |
|
9365 | 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);
|
9366 | warnedProperties$1[name] = true;
|
9367 | return true;
|
9368 | }
|
9369 |
|
9370 | if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
9371 | if (value) {
|
9372 | 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);
|
9373 | } else {
|
9374 | 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);
|
9375 | }
|
9376 | warnedProperties$1[name] = true;
|
9377 | return true;
|
9378 | }
|
9379 |
|
9380 |
|
9381 |
|
9382 | if (isReserved) {
|
9383 | return true;
|
9384 | }
|
9385 |
|
9386 |
|
9387 | if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
|
9388 | warnedProperties$1[name] = true;
|
9389 | return false;
|
9390 | }
|
9391 |
|
9392 |
|
9393 | if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
|
9394 | 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);
|
9395 | warnedProperties$1[name] = true;
|
9396 | return true;
|
9397 | }
|
9398 |
|
9399 | return true;
|
9400 | };
|
9401 | }
|
9402 |
|
9403 | var warnUnknownProperties = function (type, props, canUseEventSystem) {
|
9404 | var unknownProps = [];
|
9405 | for (var key in props) {
|
9406 | var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
|
9407 | if (!isValid) {
|
9408 | unknownProps.push(key);
|
9409 | }
|
9410 | }
|
9411 |
|
9412 | var unknownPropString = unknownProps.map(function (prop) {
|
9413 | return '`' + prop + '`';
|
9414 | }).join(', ');
|
9415 | if (unknownProps.length === 1) {
|
9416 | 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);
|
9417 | } else if (unknownProps.length > 1) {
|
9418 | 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);
|
9419 | }
|
9420 | };
|
9421 |
|
9422 | function validateProperties$2(type, props, canUseEventSystem) {
|
9423 | if (isCustomComponent(type, props)) {
|
9424 | return;
|
9425 | }
|
9426 | warnUnknownProperties(type, props, canUseEventSystem);
|
9427 | }
|
9428 |
|
9429 |
|
9430 | var didWarnInvalidHydration = false;
|
9431 | var didWarnShadyDOM = false;
|
9432 |
|
9433 | var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
|
9434 | var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
|
9435 | var SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';
|
9436 | var AUTOFOCUS = 'autoFocus';
|
9437 | var CHILDREN = 'children';
|
9438 | var STYLE$1 = 'style';
|
9439 | var HTML = '__html';
|
9440 |
|
9441 | var HTML_NAMESPACE = Namespaces.html;
|
9442 |
|
9443 |
|
9444 | var warnedUnknownTags = void 0;
|
9445 | var suppressHydrationWarning = void 0;
|
9446 |
|
9447 | var validatePropertiesInDevelopment = void 0;
|
9448 | var warnForTextDifference = void 0;
|
9449 | var warnForPropDifference = void 0;
|
9450 | var warnForExtraAttributes = void 0;
|
9451 | var warnForInvalidEventListener = void 0;
|
9452 | var canDiffStyleForHydrationWarning = void 0;
|
9453 |
|
9454 | var normalizeMarkupForTextOrAttribute = void 0;
|
9455 | var normalizeHTML = void 0;
|
9456 |
|
9457 | {
|
9458 | warnedUnknownTags = {
|
9459 |
|
9460 |
|
9461 |
|
9462 |
|
9463 | time: true,
|
9464 |
|
9465 | dialog: true,
|
9466 |
|
9467 |
|
9468 |
|
9469 |
|
9470 |
|
9471 | webview: true
|
9472 | };
|
9473 |
|
9474 | validatePropertiesInDevelopment = function (type, props) {
|
9475 | validateProperties(type, props);
|
9476 | validateProperties$1(type, props);
|
9477 | validateProperties$2(type, props, true);
|
9478 | };
|
9479 |
|
9480 |
|
9481 |
|
9482 |
|
9483 |
|
9484 |
|
9485 |
|
9486 |
|
9487 |
|
9488 | canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;
|
9489 |
|
9490 |
|
9491 |
|
9492 |
|
9493 |
|
9494 |
|
9495 | var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
|
9496 | var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
|
9497 |
|
9498 | normalizeMarkupForTextOrAttribute = function (markup) {
|
9499 | var markupString = typeof markup === 'string' ? markup : '' + markup;
|
9500 | return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');
|
9501 | };
|
9502 |
|
9503 | warnForTextDifference = function (serverText, clientText) {
|
9504 | if (didWarnInvalidHydration) {
|
9505 | return;
|
9506 | }
|
9507 | var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
|
9508 | var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
|
9509 | if (normalizedServerText === normalizedClientText) {
|
9510 | return;
|
9511 | }
|
9512 | didWarnInvalidHydration = true;
|
9513 | warningWithoutStack$1(false, 'Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
|
9514 | };
|
9515 |
|
9516 | warnForPropDifference = function (propName, serverValue, clientValue) {
|
9517 | if (didWarnInvalidHydration) {
|
9518 | return;
|
9519 | }
|
9520 | var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
|
9521 | var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
|
9522 | if (normalizedServerValue === normalizedClientValue) {
|
9523 | return;
|
9524 | }
|
9525 | didWarnInvalidHydration = true;
|
9526 | warningWithoutStack$1(false, 'Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
|
9527 | };
|
9528 |
|
9529 | warnForExtraAttributes = function (attributeNames) {
|
9530 | if (didWarnInvalidHydration) {
|
9531 | return;
|
9532 | }
|
9533 | didWarnInvalidHydration = true;
|
9534 | var names = [];
|
9535 | attributeNames.forEach(function (name) {
|
9536 | names.push(name);
|
9537 | });
|
9538 | warningWithoutStack$1(false, 'Extra attributes from the server: %s', names);
|
9539 | };
|
9540 |
|
9541 | warnForInvalidEventListener = function (registrationName, listener) {
|
9542 | if (listener === false) {
|
9543 | warning$1(false, 'Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);
|
9544 | } else {
|
9545 | warning$1(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);
|
9546 | }
|
9547 | };
|
9548 |
|
9549 |
|
9550 |
|
9551 | normalizeHTML = function (parent, html) {
|
9552 |
|
9553 |
|
9554 |
|
9555 |
|
9556 | var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
|
9557 | testElement.innerHTML = html;
|
9558 | return testElement.innerHTML;
|
9559 | };
|
9560 | }
|
9561 |
|
9562 | function ensureListeningTo(rootContainerElement, registrationName) {
|
9563 | var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;
|
9564 | var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;
|
9565 | listenTo(registrationName, doc);
|
9566 | }
|
9567 |
|
9568 | function getOwnerDocumentFromRootContainer(rootContainerElement) {
|
9569 | return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
|
9570 | }
|
9571 |
|
9572 | function noop() {}
|
9573 |
|
9574 | function trapClickOnNonInteractiveElement(node) {
|
9575 |
|
9576 |
|
9577 |
|
9578 |
|
9579 |
|
9580 |
|
9581 |
|
9582 |
|
9583 |
|
9584 | node.onclick = noop;
|
9585 | }
|
9586 |
|
9587 | function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
|
9588 | for (var propKey in nextProps) {
|
9589 | if (!nextProps.hasOwnProperty(propKey)) {
|
9590 | continue;
|
9591 | }
|
9592 | var nextProp = nextProps[propKey];
|
9593 | if (propKey === STYLE$1) {
|
9594 | {
|
9595 | if (nextProp) {
|
9596 |
|
9597 |
|
9598 | Object.freeze(nextProp);
|
9599 | }
|
9600 | }
|
9601 |
|
9602 | setValueForStyles(domElement, nextProp);
|
9603 | } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
|
9604 | var nextHtml = nextProp ? nextProp[HTML] : undefined;
|
9605 | if (nextHtml != null) {
|
9606 | setInnerHTML(domElement, nextHtml);
|
9607 | }
|
9608 | } else if (propKey === CHILDREN) {
|
9609 | if (typeof nextProp === 'string') {
|
9610 |
|
9611 |
|
9612 |
|
9613 |
|
9614 | var canSetTextContent = tag !== 'textarea' || nextProp !== '';
|
9615 | if (canSetTextContent) {
|
9616 | setTextContent(domElement, nextProp);
|
9617 | }
|
9618 | } else if (typeof nextProp === 'number') {
|
9619 | setTextContent(domElement, '' + nextProp);
|
9620 | }
|
9621 | } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {
|
9622 |
|
9623 | } else if (propKey === AUTOFOCUS) {
|
9624 |
|
9625 |
|
9626 |
|
9627 |
|
9628 | } else if (registrationNameModules.hasOwnProperty(propKey)) {
|
9629 | if (nextProp != null) {
|
9630 | if (true && typeof nextProp !== 'function') {
|
9631 | warnForInvalidEventListener(propKey, nextProp);
|
9632 | }
|
9633 | ensureListeningTo(rootContainerElement, propKey);
|
9634 | }
|
9635 | } else if (nextProp != null) {
|
9636 | setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
|
9637 | }
|
9638 | }
|
9639 | }
|
9640 |
|
9641 | function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
|
9642 |
|
9643 | for (var i = 0; i < updatePayload.length; i += 2) {
|
9644 | var propKey = updatePayload[i];
|
9645 | var propValue = updatePayload[i + 1];
|
9646 | if (propKey === STYLE$1) {
|
9647 | setValueForStyles(domElement, propValue);
|
9648 | } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
|
9649 | setInnerHTML(domElement, propValue);
|
9650 | } else if (propKey === CHILDREN) {
|
9651 | setTextContent(domElement, propValue);
|
9652 | } else {
|
9653 | setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
|
9654 | }
|
9655 | }
|
9656 | }
|
9657 |
|
9658 | function createElement(type, props, rootContainerElement, parentNamespace) {
|
9659 | var isCustomComponentTag = void 0;
|
9660 |
|
9661 |
|
9662 |
|
9663 | var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
|
9664 | var domElement = void 0;
|
9665 | var namespaceURI = parentNamespace;
|
9666 | if (namespaceURI === HTML_NAMESPACE) {
|
9667 | namespaceURI = getIntrinsicNamespace(type);
|
9668 | }
|
9669 | if (namespaceURI === HTML_NAMESPACE) {
|
9670 | {
|
9671 | isCustomComponentTag = isCustomComponent(type, props);
|
9672 |
|
9673 |
|
9674 | !(isCustomComponentTag || type === type.toLowerCase()) ? warning$1(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type) : void 0;
|
9675 | }
|
9676 |
|
9677 | if (type === 'script') {
|
9678 |
|
9679 |
|
9680 | var div = ownerDocument.createElement('div');
|
9681 | div.innerHTML = '<script><' + '/script>';
|
9682 |
|
9683 | var firstChild = div.firstChild;
|
9684 | domElement = div.removeChild(firstChild);
|
9685 | } else if (typeof props.is === 'string') {
|
9686 |
|
9687 | domElement = ownerDocument.createElement(type, { is: props.is });
|
9688 | } else {
|
9689 |
|
9690 |
|
9691 |
|
9692 | domElement = ownerDocument.createElement(type);
|
9693 |
|
9694 |
|
9695 |
|
9696 |
|
9697 |
|
9698 | if (type === 'select' && props.multiple) {
|
9699 | var node = domElement;
|
9700 | node.multiple = true;
|
9701 | }
|
9702 | }
|
9703 | } else {
|
9704 | domElement = ownerDocument.createElementNS(namespaceURI, type);
|
9705 | }
|
9706 |
|
9707 | {
|
9708 | if (namespaceURI === HTML_NAMESPACE) {
|
9709 | if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
|
9710 | warnedUnknownTags[type] = true;
|
9711 | warning$1(false, 'The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);
|
9712 | }
|
9713 | }
|
9714 | }
|
9715 |
|
9716 | return domElement;
|
9717 | }
|
9718 |
|
9719 | function createTextNode(text, rootContainerElement) {
|
9720 | return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
|
9721 | }
|
9722 |
|
9723 | function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
|
9724 | var isCustomComponentTag = isCustomComponent(tag, rawProps);
|
9725 | {
|
9726 | validatePropertiesInDevelopment(tag, rawProps);
|
9727 | if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
|
9728 | warning$1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
|
9729 | didWarnShadyDOM = true;
|
9730 | }
|
9731 | }
|
9732 |
|
9733 |
|
9734 | var props = void 0;
|
9735 | switch (tag) {
|
9736 | case 'iframe':
|
9737 | case 'object':
|
9738 | trapBubbledEvent(TOP_LOAD, domElement);
|
9739 | props = rawProps;
|
9740 | break;
|
9741 | case 'video':
|
9742 | case 'audio':
|
9743 |
|
9744 | for (var i = 0; i < mediaEventTypes.length; i++) {
|
9745 | trapBubbledEvent(mediaEventTypes[i], domElement);
|
9746 | }
|
9747 | props = rawProps;
|
9748 | break;
|
9749 | case 'source':
|
9750 | trapBubbledEvent(TOP_ERROR, domElement);
|
9751 | props = rawProps;
|
9752 | break;
|
9753 | case 'img':
|
9754 | case 'image':
|
9755 | case 'link':
|
9756 | trapBubbledEvent(TOP_ERROR, domElement);
|
9757 | trapBubbledEvent(TOP_LOAD, domElement);
|
9758 | props = rawProps;
|
9759 | break;
|
9760 | case 'form':
|
9761 | trapBubbledEvent(TOP_RESET, domElement);
|
9762 | trapBubbledEvent(TOP_SUBMIT, domElement);
|
9763 | props = rawProps;
|
9764 | break;
|
9765 | case 'details':
|
9766 | trapBubbledEvent(TOP_TOGGLE, domElement);
|
9767 | props = rawProps;
|
9768 | break;
|
9769 | case 'input':
|
9770 | initWrapperState(domElement, rawProps);
|
9771 | props = getHostProps(domElement, rawProps);
|
9772 | trapBubbledEvent(TOP_INVALID, domElement);
|
9773 |
|
9774 |
|
9775 | ensureListeningTo(rootContainerElement, 'onChange');
|
9776 | break;
|
9777 | case 'option':
|
9778 | validateProps(domElement, rawProps);
|
9779 | props = getHostProps$1(domElement, rawProps);
|
9780 | break;
|
9781 | case 'select':
|
9782 | initWrapperState$1(domElement, rawProps);
|
9783 | props = getHostProps$2(domElement, rawProps);
|
9784 | trapBubbledEvent(TOP_INVALID, domElement);
|
9785 |
|
9786 |
|
9787 | ensureListeningTo(rootContainerElement, 'onChange');
|
9788 | break;
|
9789 | case 'textarea':
|
9790 | initWrapperState$2(domElement, rawProps);
|
9791 | props = getHostProps$3(domElement, rawProps);
|
9792 | trapBubbledEvent(TOP_INVALID, domElement);
|
9793 |
|
9794 |
|
9795 | ensureListeningTo(rootContainerElement, 'onChange');
|
9796 | break;
|
9797 | default:
|
9798 | props = rawProps;
|
9799 | }
|
9800 |
|
9801 | assertValidProps(tag, props);
|
9802 |
|
9803 | setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
|
9804 |
|
9805 | switch (tag) {
|
9806 | case 'input':
|
9807 |
|
9808 |
|
9809 | track(domElement);
|
9810 | postMountWrapper(domElement, rawProps, false);
|
9811 | break;
|
9812 | case 'textarea':
|
9813 |
|
9814 |
|
9815 | track(domElement);
|
9816 | postMountWrapper$3(domElement, rawProps);
|
9817 | break;
|
9818 | case 'option':
|
9819 | postMountWrapper$1(domElement, rawProps);
|
9820 | break;
|
9821 | case 'select':
|
9822 | postMountWrapper$2(domElement, rawProps);
|
9823 | break;
|
9824 | default:
|
9825 | if (typeof props.onClick === 'function') {
|
9826 |
|
9827 | trapClickOnNonInteractiveElement(domElement);
|
9828 | }
|
9829 | break;
|
9830 | }
|
9831 | }
|
9832 |
|
9833 |
|
9834 | function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
|
9835 | {
|
9836 | validatePropertiesInDevelopment(tag, nextRawProps);
|
9837 | }
|
9838 |
|
9839 | var updatePayload = null;
|
9840 |
|
9841 | var lastProps = void 0;
|
9842 | var nextProps = void 0;
|
9843 | switch (tag) {
|
9844 | case 'input':
|
9845 | lastProps = getHostProps(domElement, lastRawProps);
|
9846 | nextProps = getHostProps(domElement, nextRawProps);
|
9847 | updatePayload = [];
|
9848 | break;
|
9849 | case 'option':
|
9850 | lastProps = getHostProps$1(domElement, lastRawProps);
|
9851 | nextProps = getHostProps$1(domElement, nextRawProps);
|
9852 | updatePayload = [];
|
9853 | break;
|
9854 | case 'select':
|
9855 | lastProps = getHostProps$2(domElement, lastRawProps);
|
9856 | nextProps = getHostProps$2(domElement, nextRawProps);
|
9857 | updatePayload = [];
|
9858 | break;
|
9859 | case 'textarea':
|
9860 | lastProps = getHostProps$3(domElement, lastRawProps);
|
9861 | nextProps = getHostProps$3(domElement, nextRawProps);
|
9862 | updatePayload = [];
|
9863 | break;
|
9864 | default:
|
9865 | lastProps = lastRawProps;
|
9866 | nextProps = nextRawProps;
|
9867 | if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {
|
9868 |
|
9869 | trapClickOnNonInteractiveElement(domElement);
|
9870 | }
|
9871 | break;
|
9872 | }
|
9873 |
|
9874 | assertValidProps(tag, nextProps);
|
9875 |
|
9876 | var propKey = void 0;
|
9877 | var styleName = void 0;
|
9878 | var styleUpdates = null;
|
9879 | for (propKey in lastProps) {
|
9880 | if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
|
9881 | continue;
|
9882 | }
|
9883 | if (propKey === STYLE$1) {
|
9884 | var lastStyle = lastProps[propKey];
|
9885 | for (styleName in lastStyle) {
|
9886 | if (lastStyle.hasOwnProperty(styleName)) {
|
9887 | if (!styleUpdates) {
|
9888 | styleUpdates = {};
|
9889 | }
|
9890 | styleUpdates[styleName] = '';
|
9891 | }
|
9892 | }
|
9893 | } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) {
|
9894 |
|
9895 | } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {
|
9896 |
|
9897 | } else if (propKey === AUTOFOCUS) {
|
9898 |
|
9899 | } else if (registrationNameModules.hasOwnProperty(propKey)) {
|
9900 |
|
9901 |
|
9902 |
|
9903 | if (!updatePayload) {
|
9904 | updatePayload = [];
|
9905 | }
|
9906 | } else {
|
9907 |
|
9908 |
|
9909 | (updatePayload = updatePayload || []).push(propKey, null);
|
9910 | }
|
9911 | }
|
9912 | for (propKey in nextProps) {
|
9913 | var nextProp = nextProps[propKey];
|
9914 | var lastProp = lastProps != null ? lastProps[propKey] : undefined;
|
9915 | if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
|
9916 | continue;
|
9917 | }
|
9918 | if (propKey === STYLE$1) {
|
9919 | {
|
9920 | if (nextProp) {
|
9921 |
|
9922 |
|
9923 | Object.freeze(nextProp);
|
9924 | }
|
9925 | }
|
9926 | if (lastProp) {
|
9927 |
|
9928 | for (styleName in lastProp) {
|
9929 | if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
|
9930 | if (!styleUpdates) {
|
9931 | styleUpdates = {};
|
9932 | }
|
9933 | styleUpdates[styleName] = '';
|
9934 | }
|
9935 | }
|
9936 |
|
9937 | for (styleName in nextProp) {
|
9938 | if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
|
9939 | if (!styleUpdates) {
|
9940 | styleUpdates = {};
|
9941 | }
|
9942 | styleUpdates[styleName] = nextProp[styleName];
|
9943 | }
|
9944 | }
|
9945 | } else {
|
9946 |
|
9947 | if (!styleUpdates) {
|
9948 | if (!updatePayload) {
|
9949 | updatePayload = [];
|
9950 | }
|
9951 | updatePayload.push(propKey, styleUpdates);
|
9952 | }
|
9953 | styleUpdates = nextProp;
|
9954 | }
|
9955 | } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
|
9956 | var nextHtml = nextProp ? nextProp[HTML] : undefined;
|
9957 | var lastHtml = lastProp ? lastProp[HTML] : undefined;
|
9958 | if (nextHtml != null) {
|
9959 | if (lastHtml !== nextHtml) {
|
9960 | (updatePayload = updatePayload || []).push(propKey, '' + nextHtml);
|
9961 | }
|
9962 | } else {
|
9963 |
|
9964 |
|
9965 | }
|
9966 | } else if (propKey === CHILDREN) {
|
9967 | if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {
|
9968 | (updatePayload = updatePayload || []).push(propKey, '' + nextProp);
|
9969 | }
|
9970 | } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {
|
9971 |
|
9972 | } else if (registrationNameModules.hasOwnProperty(propKey)) {
|
9973 | if (nextProp != null) {
|
9974 |
|
9975 | if (true && typeof nextProp !== 'function') {
|
9976 | warnForInvalidEventListener(propKey, nextProp);
|
9977 | }
|
9978 | ensureListeningTo(rootContainerElement, propKey);
|
9979 | }
|
9980 | if (!updatePayload && lastProp !== nextProp) {
|
9981 |
|
9982 |
|
9983 |
|
9984 | updatePayload = [];
|
9985 | }
|
9986 | } else {
|
9987 |
|
9988 |
|
9989 | (updatePayload = updatePayload || []).push(propKey, nextProp);
|
9990 | }
|
9991 | }
|
9992 | if (styleUpdates) {
|
9993 | {
|
9994 | validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE$1]);
|
9995 | }
|
9996 | (updatePayload = updatePayload || []).push(STYLE$1, styleUpdates);
|
9997 | }
|
9998 | return updatePayload;
|
9999 | }
|
10000 |
|
10001 |
|
10002 | function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
|
10003 |
|
10004 |
|
10005 |
|
10006 | if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {
|
10007 | updateChecked(domElement, nextRawProps);
|
10008 | }
|
10009 |
|
10010 | var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
|
10011 | var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
|
10012 |
|
10013 | updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
|
10014 |
|
10015 |
|
10016 |
|
10017 | switch (tag) {
|
10018 | case 'input':
|
10019 |
|
10020 |
|
10021 |
|
10022 | updateWrapper(domElement, nextRawProps);
|
10023 | break;
|
10024 | case 'textarea':
|
10025 | updateWrapper$1(domElement, nextRawProps);
|
10026 | break;
|
10027 | case 'select':
|
10028 |
|
10029 |
|
10030 | postUpdateWrapper(domElement, nextRawProps);
|
10031 | break;
|
10032 | }
|
10033 | }
|
10034 |
|
10035 | function getPossibleStandardName(propName) {
|
10036 | {
|
10037 | var lowerCasedName = propName.toLowerCase();
|
10038 | if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
|
10039 | return null;
|
10040 | }
|
10041 | return possibleStandardNames[lowerCasedName] || null;
|
10042 | }
|
10043 | return null;
|
10044 | }
|
10045 |
|
10046 | function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
|
10047 | var isCustomComponentTag = void 0;
|
10048 | var extraAttributeNames = void 0;
|
10049 |
|
10050 | {
|
10051 | suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING$1] === true;
|
10052 | isCustomComponentTag = isCustomComponent(tag, rawProps);
|
10053 | validatePropertiesInDevelopment(tag, rawProps);
|
10054 | if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
|
10055 | warning$1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
|
10056 | didWarnShadyDOM = true;
|
10057 | }
|
10058 | }
|
10059 |
|
10060 |
|
10061 | switch (tag) {
|
10062 | case 'iframe':
|
10063 | case 'object':
|
10064 | trapBubbledEvent(TOP_LOAD, domElement);
|
10065 | break;
|
10066 | case 'video':
|
10067 | case 'audio':
|
10068 |
|
10069 | for (var i = 0; i < mediaEventTypes.length; i++) {
|
10070 | trapBubbledEvent(mediaEventTypes[i], domElement);
|
10071 | }
|
10072 | break;
|
10073 | case 'source':
|
10074 | trapBubbledEvent(TOP_ERROR, domElement);
|
10075 | break;
|
10076 | case 'img':
|
10077 | case 'image':
|
10078 | case 'link':
|
10079 | trapBubbledEvent(TOP_ERROR, domElement);
|
10080 | trapBubbledEvent(TOP_LOAD, domElement);
|
10081 | break;
|
10082 | case 'form':
|
10083 | trapBubbledEvent(TOP_RESET, domElement);
|
10084 | trapBubbledEvent(TOP_SUBMIT, domElement);
|
10085 | break;
|
10086 | case 'details':
|
10087 | trapBubbledEvent(TOP_TOGGLE, domElement);
|
10088 | break;
|
10089 | case 'input':
|
10090 | initWrapperState(domElement, rawProps);
|
10091 | trapBubbledEvent(TOP_INVALID, domElement);
|
10092 |
|
10093 |
|
10094 | ensureListeningTo(rootContainerElement, 'onChange');
|
10095 | break;
|
10096 | case 'option':
|
10097 | validateProps(domElement, rawProps);
|
10098 | break;
|
10099 | case 'select':
|
10100 | initWrapperState$1(domElement, rawProps);
|
10101 | trapBubbledEvent(TOP_INVALID, domElement);
|
10102 |
|
10103 |
|
10104 | ensureListeningTo(rootContainerElement, 'onChange');
|
10105 | break;
|
10106 | case 'textarea':
|
10107 | initWrapperState$2(domElement, rawProps);
|
10108 | trapBubbledEvent(TOP_INVALID, domElement);
|
10109 |
|
10110 |
|
10111 | ensureListeningTo(rootContainerElement, 'onChange');
|
10112 | break;
|
10113 | }
|
10114 |
|
10115 | assertValidProps(tag, rawProps);
|
10116 |
|
10117 | {
|
10118 | extraAttributeNames = new Set();
|
10119 | var attributes = domElement.attributes;
|
10120 | for (var _i = 0; _i < attributes.length; _i++) {
|
10121 | var name = attributes[_i].name.toLowerCase();
|
10122 | switch (name) {
|
10123 |
|
10124 | case 'data-reactroot':
|
10125 | break;
|
10126 |
|
10127 |
|
10128 | case 'value':
|
10129 | break;
|
10130 | case 'checked':
|
10131 | break;
|
10132 | case 'selected':
|
10133 | break;
|
10134 | default:
|
10135 |
|
10136 |
|
10137 | extraAttributeNames.add(attributes[_i].name);
|
10138 | }
|
10139 | }
|
10140 | }
|
10141 |
|
10142 | var updatePayload = null;
|
10143 | for (var propKey in rawProps) {
|
10144 | if (!rawProps.hasOwnProperty(propKey)) {
|
10145 | continue;
|
10146 | }
|
10147 | var nextProp = rawProps[propKey];
|
10148 | if (propKey === CHILDREN) {
|
10149 |
|
10150 |
|
10151 |
|
10152 |
|
10153 |
|
10154 |
|
10155 |
|
10156 |
|
10157 |
|
10158 | if (typeof nextProp === 'string') {
|
10159 | if (domElement.textContent !== nextProp) {
|
10160 | if (true && !suppressHydrationWarning) {
|
10161 | warnForTextDifference(domElement.textContent, nextProp);
|
10162 | }
|
10163 | updatePayload = [CHILDREN, nextProp];
|
10164 | }
|
10165 | } else if (typeof nextProp === 'number') {
|
10166 | if (domElement.textContent !== '' + nextProp) {
|
10167 | if (true && !suppressHydrationWarning) {
|
10168 | warnForTextDifference(domElement.textContent, nextProp);
|
10169 | }
|
10170 | updatePayload = [CHILDREN, '' + nextProp];
|
10171 | }
|
10172 | }
|
10173 | } else if (registrationNameModules.hasOwnProperty(propKey)) {
|
10174 | if (nextProp != null) {
|
10175 | if (true && typeof nextProp !== 'function') {
|
10176 | warnForInvalidEventListener(propKey, nextProp);
|
10177 | }
|
10178 | ensureListeningTo(rootContainerElement, propKey);
|
10179 | }
|
10180 | } else if (true &&
|
10181 |
|
10182 | typeof isCustomComponentTag === 'boolean') {
|
10183 |
|
10184 | var serverValue = void 0;
|
10185 | var propertyInfo = getPropertyInfo(propKey);
|
10186 | if (suppressHydrationWarning) {
|
10187 |
|
10188 | } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1 ||
|
10189 |
|
10190 |
|
10191 | propKey === 'value' || propKey === 'checked' || propKey === 'selected') {
|
10192 |
|
10193 | } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
|
10194 | var serverHTML = domElement.innerHTML;
|
10195 | var nextHtml = nextProp ? nextProp[HTML] : undefined;
|
10196 | var expectedHTML = normalizeHTML(domElement, nextHtml != null ? nextHtml : '');
|
10197 | if (expectedHTML !== serverHTML) {
|
10198 | warnForPropDifference(propKey, serverHTML, expectedHTML);
|
10199 | }
|
10200 | } else if (propKey === STYLE$1) {
|
10201 |
|
10202 | extraAttributeNames.delete(propKey);
|
10203 |
|
10204 | if (canDiffStyleForHydrationWarning) {
|
10205 | var expectedStyle = createDangerousStringForStyles(nextProp);
|
10206 | serverValue = domElement.getAttribute('style');
|
10207 | if (expectedStyle !== serverValue) {
|
10208 | warnForPropDifference(propKey, serverValue, expectedStyle);
|
10209 | }
|
10210 | }
|
10211 | } else if (isCustomComponentTag) {
|
10212 |
|
10213 | extraAttributeNames.delete(propKey.toLowerCase());
|
10214 | serverValue = getValueForAttribute(domElement, propKey, nextProp);
|
10215 |
|
10216 | if (nextProp !== serverValue) {
|
10217 | warnForPropDifference(propKey, serverValue, nextProp);
|
10218 | }
|
10219 | } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
|
10220 | var isMismatchDueToBadCasing = false;
|
10221 | if (propertyInfo !== null) {
|
10222 |
|
10223 | extraAttributeNames.delete(propertyInfo.attributeName);
|
10224 | serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
|
10225 | } else {
|
10226 | var ownNamespace = parentNamespace;
|
10227 | if (ownNamespace === HTML_NAMESPACE) {
|
10228 | ownNamespace = getIntrinsicNamespace(tag);
|
10229 | }
|
10230 | if (ownNamespace === HTML_NAMESPACE) {
|
10231 |
|
10232 | extraAttributeNames.delete(propKey.toLowerCase());
|
10233 | } else {
|
10234 | var standardName = getPossibleStandardName(propKey);
|
10235 | if (standardName !== null && standardName !== propKey) {
|
10236 |
|
10237 |
|
10238 |
|
10239 |
|
10240 |
|
10241 | isMismatchDueToBadCasing = true;
|
10242 |
|
10243 | extraAttributeNames.delete(standardName);
|
10244 | }
|
10245 |
|
10246 | extraAttributeNames.delete(propKey);
|
10247 | }
|
10248 | serverValue = getValueForAttribute(domElement, propKey, nextProp);
|
10249 | }
|
10250 |
|
10251 | if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
|
10252 | warnForPropDifference(propKey, serverValue, nextProp);
|
10253 | }
|
10254 | }
|
10255 | }
|
10256 | }
|
10257 |
|
10258 | {
|
10259 |
|
10260 | if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
|
10261 |
|
10262 | warnForExtraAttributes(extraAttributeNames);
|
10263 | }
|
10264 | }
|
10265 |
|
10266 | switch (tag) {
|
10267 | case 'input':
|
10268 |
|
10269 |
|
10270 | track(domElement);
|
10271 | postMountWrapper(domElement, rawProps, true);
|
10272 | break;
|
10273 | case 'textarea':
|
10274 |
|
10275 |
|
10276 | track(domElement);
|
10277 | postMountWrapper$3(domElement, rawProps);
|
10278 | break;
|
10279 | case 'select':
|
10280 | case 'option':
|
10281 |
|
10282 |
|
10283 |
|
10284 |
|
10285 |
|
10286 | break;
|
10287 | default:
|
10288 | if (typeof rawProps.onClick === 'function') {
|
10289 |
|
10290 | trapClickOnNonInteractiveElement(domElement);
|
10291 | }
|
10292 | break;
|
10293 | }
|
10294 |
|
10295 | return updatePayload;
|
10296 | }
|
10297 |
|
10298 | function diffHydratedText(textNode, text) {
|
10299 | var isDifferent = textNode.nodeValue !== text;
|
10300 | return isDifferent;
|
10301 | }
|
10302 |
|
10303 | function warnForUnmatchedText(textNode, text) {
|
10304 | {
|
10305 | warnForTextDifference(textNode.nodeValue, text);
|
10306 | }
|
10307 | }
|
10308 |
|
10309 | function warnForDeletedHydratableElement(parentNode, child) {
|
10310 | {
|
10311 | if (didWarnInvalidHydration) {
|
10312 | return;
|
10313 | }
|
10314 | didWarnInvalidHydration = true;
|
10315 | warningWithoutStack$1(false, 'Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
|
10316 | }
|
10317 | }
|
10318 |
|
10319 | function warnForDeletedHydratableText(parentNode, child) {
|
10320 | {
|
10321 | if (didWarnInvalidHydration) {
|
10322 | return;
|
10323 | }
|
10324 | didWarnInvalidHydration = true;
|
10325 | warningWithoutStack$1(false, 'Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
|
10326 | }
|
10327 | }
|
10328 |
|
10329 | function warnForInsertedHydratedElement(parentNode, tag, props) {
|
10330 | {
|
10331 | if (didWarnInvalidHydration) {
|
10332 | return;
|
10333 | }
|
10334 | didWarnInvalidHydration = true;
|
10335 | warningWithoutStack$1(false, 'Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());
|
10336 | }
|
10337 | }
|
10338 |
|
10339 | function warnForInsertedHydratedText(parentNode, text) {
|
10340 | {
|
10341 | if (text === '') {
|
10342 |
|
10343 |
|
10344 |
|
10345 |
|
10346 | return;
|
10347 | }
|
10348 | if (didWarnInvalidHydration) {
|
10349 | return;
|
10350 | }
|
10351 | didWarnInvalidHydration = true;
|
10352 | warningWithoutStack$1(false, 'Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
|
10353 | }
|
10354 | }
|
10355 |
|
10356 | function restoreControlledState$1(domElement, tag, props) {
|
10357 | switch (tag) {
|
10358 | case 'input':
|
10359 | restoreControlledState(domElement, props);
|
10360 | return;
|
10361 | case 'textarea':
|
10362 | restoreControlledState$3(domElement, props);
|
10363 | return;
|
10364 | case 'select':
|
10365 | restoreControlledState$2(domElement, props);
|
10366 | return;
|
10367 | }
|
10368 | }
|
10369 |
|
10370 |
|
10371 | var validateDOMNesting = function () {};
|
10372 | var updatedAncestorInfo = function () {};
|
10373 |
|
10374 | {
|
10375 |
|
10376 |
|
10377 |
|
10378 |
|
10379 |
|
10380 |
|
10381 |
|
10382 |
|
10383 |
|
10384 |
|
10385 |
|
10386 |
|
10387 | var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
|
10388 |
|
10389 |
|
10390 | var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
|
10391 |
|
10392 |
|
10393 |
|
10394 |
|
10395 | 'foreignObject', 'desc', 'title'];
|
10396 |
|
10397 |
|
10398 | var buttonScopeTags = inScopeTags.concat(['button']);
|
10399 |
|
10400 |
|
10401 | var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
|
10402 |
|
10403 | var emptyAncestorInfo = {
|
10404 | current: null,
|
10405 |
|
10406 | formTag: null,
|
10407 | aTagInScope: null,
|
10408 | buttonTagInScope: null,
|
10409 | nobrTagInScope: null,
|
10410 | pTagInButtonScope: null,
|
10411 |
|
10412 | listItemTagAutoclosing: null,
|
10413 | dlItemTagAutoclosing: null
|
10414 | };
|
10415 |
|
10416 | updatedAncestorInfo = function (oldInfo, tag) {
|
10417 | var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
|
10418 | var info = { tag: tag };
|
10419 |
|
10420 | if (inScopeTags.indexOf(tag) !== -1) {
|
10421 | ancestorInfo.aTagInScope = null;
|
10422 | ancestorInfo.buttonTagInScope = null;
|
10423 | ancestorInfo.nobrTagInScope = null;
|
10424 | }
|
10425 | if (buttonScopeTags.indexOf(tag) !== -1) {
|
10426 | ancestorInfo.pTagInButtonScope = null;
|
10427 | }
|
10428 |
|
10429 |
|
10430 |
|
10431 | if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
|
10432 | ancestorInfo.listItemTagAutoclosing = null;
|
10433 | ancestorInfo.dlItemTagAutoclosing = null;
|
10434 | }
|
10435 |
|
10436 | ancestorInfo.current = info;
|
10437 |
|
10438 | if (tag === 'form') {
|
10439 | ancestorInfo.formTag = info;
|
10440 | }
|
10441 | if (tag === 'a') {
|
10442 | ancestorInfo.aTagInScope = info;
|
10443 | }
|
10444 | if (tag === 'button') {
|
10445 | ancestorInfo.buttonTagInScope = info;
|
10446 | }
|
10447 | if (tag === 'nobr') {
|
10448 | ancestorInfo.nobrTagInScope = info;
|
10449 | }
|
10450 | if (tag === 'p') {
|
10451 | ancestorInfo.pTagInButtonScope = info;
|
10452 | }
|
10453 | if (tag === 'li') {
|
10454 | ancestorInfo.listItemTagAutoclosing = info;
|
10455 | }
|
10456 | if (tag === 'dd' || tag === 'dt') {
|
10457 | ancestorInfo.dlItemTagAutoclosing = info;
|
10458 | }
|
10459 |
|
10460 | return ancestorInfo;
|
10461 | };
|
10462 |
|
10463 | |
10464 |
|
10465 |
|
10466 | var isTagValidWithParent = function (tag, parentTag) {
|
10467 |
|
10468 | switch (parentTag) {
|
10469 |
|
10470 | case 'select':
|
10471 | return tag === 'option' || tag === 'optgroup' || tag === '#text';
|
10472 | case 'optgroup':
|
10473 | return tag === 'option' || tag === '#text';
|
10474 |
|
10475 |
|
10476 | case 'option':
|
10477 | return tag === '#text';
|
10478 |
|
10479 |
|
10480 |
|
10481 |
|
10482 |
|
10483 |
|
10484 | case 'tr':
|
10485 | return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
|
10486 |
|
10487 | case 'tbody':
|
10488 | case 'thead':
|
10489 | case 'tfoot':
|
10490 | return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
|
10491 |
|
10492 | case 'colgroup':
|
10493 | return tag === 'col' || tag === 'template';
|
10494 |
|
10495 | case 'table':
|
10496 | return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
|
10497 |
|
10498 | case 'head':
|
10499 | return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
|
10500 |
|
10501 | case 'html':
|
10502 | return tag === 'head' || tag === 'body';
|
10503 | case '#document':
|
10504 | return tag === 'html';
|
10505 | }
|
10506 |
|
10507 |
|
10508 |
|
10509 |
|
10510 | switch (tag) {
|
10511 | case 'h1':
|
10512 | case 'h2':
|
10513 | case 'h3':
|
10514 | case 'h4':
|
10515 | case 'h5':
|
10516 | case 'h6':
|
10517 | return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
|
10518 |
|
10519 | case 'rp':
|
10520 | case 'rt':
|
10521 | return impliedEndTags.indexOf(parentTag) === -1;
|
10522 |
|
10523 | case 'body':
|
10524 | case 'caption':
|
10525 | case 'col':
|
10526 | case 'colgroup':
|
10527 | case 'frame':
|
10528 | case 'head':
|
10529 | case 'html':
|
10530 | case 'tbody':
|
10531 | case 'td':
|
10532 | case 'tfoot':
|
10533 | case 'th':
|
10534 | case 'thead':
|
10535 | case 'tr':
|
10536 |
|
10537 |
|
10538 |
|
10539 |
|
10540 | return parentTag == null;
|
10541 | }
|
10542 |
|
10543 | return true;
|
10544 | };
|
10545 |
|
10546 | |
10547 |
|
10548 |
|
10549 | var findInvalidAncestorForTag = function (tag, ancestorInfo) {
|
10550 | switch (tag) {
|
10551 | case 'address':
|
10552 | case 'article':
|
10553 | case 'aside':
|
10554 | case 'blockquote':
|
10555 | case 'center':
|
10556 | case 'details':
|
10557 | case 'dialog':
|
10558 | case 'dir':
|
10559 | case 'div':
|
10560 | case 'dl':
|
10561 | case 'fieldset':
|
10562 | case 'figcaption':
|
10563 | case 'figure':
|
10564 | case 'footer':
|
10565 | case 'header':
|
10566 | case 'hgroup':
|
10567 | case 'main':
|
10568 | case 'menu':
|
10569 | case 'nav':
|
10570 | case 'ol':
|
10571 | case 'p':
|
10572 | case 'section':
|
10573 | case 'summary':
|
10574 | case 'ul':
|
10575 | case 'pre':
|
10576 | case 'listing':
|
10577 | case 'table':
|
10578 | case 'hr':
|
10579 | case 'xmp':
|
10580 | case 'h1':
|
10581 | case 'h2':
|
10582 | case 'h3':
|
10583 | case 'h4':
|
10584 | case 'h5':
|
10585 | case 'h6':
|
10586 | return ancestorInfo.pTagInButtonScope;
|
10587 |
|
10588 | case 'form':
|
10589 | return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
|
10590 |
|
10591 | case 'li':
|
10592 | return ancestorInfo.listItemTagAutoclosing;
|
10593 |
|
10594 | case 'dd':
|
10595 | case 'dt':
|
10596 | return ancestorInfo.dlItemTagAutoclosing;
|
10597 |
|
10598 | case 'button':
|
10599 | return ancestorInfo.buttonTagInScope;
|
10600 |
|
10601 | case 'a':
|
10602 |
|
10603 |
|
10604 | return ancestorInfo.aTagInScope;
|
10605 |
|
10606 | case 'nobr':
|
10607 | return ancestorInfo.nobrTagInScope;
|
10608 | }
|
10609 |
|
10610 | return null;
|
10611 | };
|
10612 |
|
10613 | var didWarn = {};
|
10614 |
|
10615 | validateDOMNesting = function (childTag, childText, ancestorInfo) {
|
10616 | ancestorInfo = ancestorInfo || emptyAncestorInfo;
|
10617 | var parentInfo = ancestorInfo.current;
|
10618 | var parentTag = parentInfo && parentInfo.tag;
|
10619 |
|
10620 | if (childText != null) {
|
10621 | !(childTag == null) ? warningWithoutStack$1(false, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
|
10622 | childTag = '#text';
|
10623 | }
|
10624 |
|
10625 | var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
|
10626 | var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
|
10627 | var invalidParentOrAncestor = invalidParent || invalidAncestor;
|
10628 | if (!invalidParentOrAncestor) {
|
10629 | return;
|
10630 | }
|
10631 |
|
10632 | var ancestorTag = invalidParentOrAncestor.tag;
|
10633 | var addendum = getCurrentFiberStackInDev();
|
10634 |
|
10635 | var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;
|
10636 | if (didWarn[warnKey]) {
|
10637 | return;
|
10638 | }
|
10639 | didWarn[warnKey] = true;
|
10640 |
|
10641 | var tagDisplayName = childTag;
|
10642 | var whitespaceInfo = '';
|
10643 | if (childTag === '#text') {
|
10644 | if (/\S/.test(childText)) {
|
10645 | tagDisplayName = 'Text nodes';
|
10646 | } else {
|
10647 | tagDisplayName = 'Whitespace text nodes';
|
10648 | whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
|
10649 | }
|
10650 | } else {
|
10651 | tagDisplayName = '<' + childTag + '>';
|
10652 | }
|
10653 |
|
10654 | if (invalidParent) {
|
10655 | var info = '';
|
10656 | if (ancestorTag === 'table' && childTag === 'tr') {
|
10657 | info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
|
10658 | }
|
10659 | warningWithoutStack$1(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info, addendum);
|
10660 | } else {
|
10661 | warningWithoutStack$1(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.%s', tagDisplayName, ancestorTag, addendum);
|
10662 | }
|
10663 | };
|
10664 | }
|
10665 |
|
10666 |
|
10667 |
|
10668 |
|
10669 | function shim() {
|
10670 | invariant(false, 'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');
|
10671 | }
|
10672 |
|
10673 |
|
10674 | var supportsPersistence = false;
|
10675 | var cloneInstance = shim;
|
10676 | var createContainerChildSet = shim;
|
10677 | var appendChildToContainerChildSet = shim;
|
10678 | var finalizeContainerChildren = shim;
|
10679 | var replaceContainerChildren = shim;
|
10680 | var cloneHiddenInstance = shim;
|
10681 | var cloneUnhiddenInstance = shim;
|
10682 | var createHiddenTextInstance = shim;
|
10683 |
|
10684 | var SUPPRESS_HYDRATION_WARNING = void 0;
|
10685 | {
|
10686 | SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';
|
10687 | }
|
10688 |
|
10689 | var STYLE = 'style';
|
10690 |
|
10691 | var eventsEnabled = null;
|
10692 | var selectionInformation = null;
|
10693 |
|
10694 | function shouldAutoFocusHostComponent(type, props) {
|
10695 | switch (type) {
|
10696 | case 'button':
|
10697 | case 'input':
|
10698 | case 'select':
|
10699 | case 'textarea':
|
10700 | return !!props.autoFocus;
|
10701 | }
|
10702 | return false;
|
10703 | }
|
10704 |
|
10705 | function getRootHostContext(rootContainerInstance) {
|
10706 | var type = void 0;
|
10707 | var namespace = void 0;
|
10708 | var nodeType = rootContainerInstance.nodeType;
|
10709 | switch (nodeType) {
|
10710 | case DOCUMENT_NODE:
|
10711 | case DOCUMENT_FRAGMENT_NODE:
|
10712 | {
|
10713 | type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';
|
10714 | var root = rootContainerInstance.documentElement;
|
10715 | namespace = root ? root.namespaceURI : getChildNamespace(null, '');
|
10716 | break;
|
10717 | }
|
10718 | default:
|
10719 | {
|
10720 | var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
|
10721 | var ownNamespace = container.namespaceURI || null;
|
10722 | type = container.tagName;
|
10723 | namespace = getChildNamespace(ownNamespace, type);
|
10724 | break;
|
10725 | }
|
10726 | }
|
10727 | {
|
10728 | var validatedTag = type.toLowerCase();
|
10729 | var _ancestorInfo = updatedAncestorInfo(null, validatedTag);
|
10730 | return { namespace: namespace, ancestorInfo: _ancestorInfo };
|
10731 | }
|
10732 | return namespace;
|
10733 | }
|
10734 |
|
10735 | function getChildHostContext(parentHostContext, type, rootContainerInstance) {
|
10736 | {
|
10737 | var parentHostContextDev = parentHostContext;
|
10738 | var _namespace = getChildNamespace(parentHostContextDev.namespace, type);
|
10739 | var _ancestorInfo2 = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
|
10740 | return { namespace: _namespace, ancestorInfo: _ancestorInfo2 };
|
10741 | }
|
10742 | var parentNamespace = parentHostContext;
|
10743 | return getChildNamespace(parentNamespace, type);
|
10744 | }
|
10745 |
|
10746 | function getPublicInstance(instance) {
|
10747 | return instance;
|
10748 | }
|
10749 |
|
10750 | function prepareForCommit(containerInfo) {
|
10751 | eventsEnabled = isEnabled();
|
10752 | selectionInformation = getSelectionInformation();
|
10753 | setEnabled(false);
|
10754 | }
|
10755 |
|
10756 | function resetAfterCommit(containerInfo) {
|
10757 | restoreSelection(selectionInformation);
|
10758 | selectionInformation = null;
|
10759 | setEnabled(eventsEnabled);
|
10760 | eventsEnabled = null;
|
10761 | }
|
10762 |
|
10763 | function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
|
10764 | var parentNamespace = void 0;
|
10765 | {
|
10766 |
|
10767 | var hostContextDev = hostContext;
|
10768 | validateDOMNesting(type, null, hostContextDev.ancestorInfo);
|
10769 | if (typeof props.children === 'string' || typeof props.children === 'number') {
|
10770 | var string = '' + props.children;
|
10771 | var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
|
10772 | validateDOMNesting(null, string, ownAncestorInfo);
|
10773 | }
|
10774 | parentNamespace = hostContextDev.namespace;
|
10775 | }
|
10776 | var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
|
10777 | precacheFiberNode(internalInstanceHandle, domElement);
|
10778 | updateFiberProps(domElement, props);
|
10779 | return domElement;
|
10780 | }
|
10781 |
|
10782 | function appendInitialChild(parentInstance, child) {
|
10783 | parentInstance.appendChild(child);
|
10784 | }
|
10785 |
|
10786 | function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
|
10787 | setInitialProperties(domElement, type, props, rootContainerInstance);
|
10788 | return shouldAutoFocusHostComponent(type, props);
|
10789 | }
|
10790 |
|
10791 | function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
|
10792 | {
|
10793 | var hostContextDev = hostContext;
|
10794 | if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {
|
10795 | var string = '' + newProps.children;
|
10796 | var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
|
10797 | validateDOMNesting(null, string, ownAncestorInfo);
|
10798 | }
|
10799 | }
|
10800 | return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);
|
10801 | }
|
10802 |
|
10803 | function shouldSetTextContent(type, props) {
|
10804 | return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
|
10805 | }
|
10806 |
|
10807 | function shouldDeprioritizeSubtree(type, props) {
|
10808 | return !!props.hidden;
|
10809 | }
|
10810 |
|
10811 | function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
|
10812 | {
|
10813 | var hostContextDev = hostContext;
|
10814 | validateDOMNesting(null, text, hostContextDev.ancestorInfo);
|
10815 | }
|
10816 | var textNode = createTextNode(text, rootContainerInstance);
|
10817 | precacheFiberNode(internalInstanceHandle, textNode);
|
10818 | return textNode;
|
10819 | }
|
10820 |
|
10821 | var isPrimaryRenderer = true;
|
10822 |
|
10823 |
|
10824 |
|
10825 | var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;
|
10826 | var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;
|
10827 | var noTimeout = -1;
|
10828 |
|
10829 |
|
10830 |
|
10831 |
|
10832 |
|
10833 | var supportsMutation = true;
|
10834 |
|
10835 | function commitMount(domElement, type, newProps, internalInstanceHandle) {
|
10836 |
|
10837 |
|
10838 |
|
10839 |
|
10840 |
|
10841 |
|
10842 | if (shouldAutoFocusHostComponent(type, newProps)) {
|
10843 | domElement.focus();
|
10844 | }
|
10845 | }
|
10846 |
|
10847 | function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
|
10848 |
|
10849 |
|
10850 | updateFiberProps(domElement, newProps);
|
10851 |
|
10852 | updateProperties(domElement, updatePayload, type, oldProps, newProps);
|
10853 | }
|
10854 |
|
10855 | function resetTextContent(domElement) {
|
10856 | setTextContent(domElement, '');
|
10857 | }
|
10858 |
|
10859 | function commitTextUpdate(textInstance, oldText, newText) {
|
10860 | textInstance.nodeValue = newText;
|
10861 | }
|
10862 |
|
10863 | function appendChild(parentInstance, child) {
|
10864 | parentInstance.appendChild(child);
|
10865 | }
|
10866 |
|
10867 | function appendChildToContainer(container, child) {
|
10868 | var parentNode = void 0;
|
10869 | if (container.nodeType === COMMENT_NODE) {
|
10870 | parentNode = container.parentNode;
|
10871 | parentNode.insertBefore(child, container);
|
10872 | } else {
|
10873 | parentNode = container;
|
10874 | parentNode.appendChild(child);
|
10875 | }
|
10876 |
|
10877 |
|
10878 |
|
10879 |
|
10880 |
|
10881 |
|
10882 |
|
10883 |
|
10884 | var reactRootContainer = container._reactRootContainer;
|
10885 | if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {
|
10886 |
|
10887 | trapClickOnNonInteractiveElement(parentNode);
|
10888 | }
|
10889 | }
|
10890 |
|
10891 | function insertBefore(parentInstance, child, beforeChild) {
|
10892 | parentInstance.insertBefore(child, beforeChild);
|
10893 | }
|
10894 |
|
10895 | function insertInContainerBefore(container, child, beforeChild) {
|
10896 | if (container.nodeType === COMMENT_NODE) {
|
10897 | container.parentNode.insertBefore(child, beforeChild);
|
10898 | } else {
|
10899 | container.insertBefore(child, beforeChild);
|
10900 | }
|
10901 | }
|
10902 |
|
10903 | function removeChild(parentInstance, child) {
|
10904 | parentInstance.removeChild(child);
|
10905 | }
|
10906 |
|
10907 | function removeChildFromContainer(container, child) {
|
10908 | if (container.nodeType === COMMENT_NODE) {
|
10909 | container.parentNode.removeChild(child);
|
10910 | } else {
|
10911 | container.removeChild(child);
|
10912 | }
|
10913 | }
|
10914 |
|
10915 | function hideInstance(instance) {
|
10916 |
|
10917 |
|
10918 | instance = instance;
|
10919 | instance.style.display = 'none';
|
10920 | }
|
10921 |
|
10922 | function hideTextInstance(textInstance) {
|
10923 | textInstance.nodeValue = '';
|
10924 | }
|
10925 |
|
10926 | function unhideInstance(instance, props) {
|
10927 | instance = instance;
|
10928 | var styleProp = props[STYLE];
|
10929 | var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;
|
10930 | instance.style.display = dangerousStyleValue('display', display);
|
10931 | }
|
10932 |
|
10933 | function unhideTextInstance(textInstance, text) {
|
10934 | textInstance.nodeValue = text;
|
10935 | }
|
10936 |
|
10937 |
|
10938 |
|
10939 |
|
10940 |
|
10941 | var supportsHydration = true;
|
10942 |
|
10943 | function canHydrateInstance(instance, type, props) {
|
10944 | if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
|
10945 | return null;
|
10946 | }
|
10947 |
|
10948 | return instance;
|
10949 | }
|
10950 |
|
10951 | function canHydrateTextInstance(instance, text) {
|
10952 | if (text === '' || instance.nodeType !== TEXT_NODE) {
|
10953 |
|
10954 | return null;
|
10955 | }
|
10956 |
|
10957 | return instance;
|
10958 | }
|
10959 |
|
10960 | function getNextHydratableSibling(instance) {
|
10961 | var node = instance.nextSibling;
|
10962 |
|
10963 | while (node && node.nodeType !== ELEMENT_NODE && node.nodeType !== TEXT_NODE) {
|
10964 | node = node.nextSibling;
|
10965 | }
|
10966 | return node;
|
10967 | }
|
10968 |
|
10969 | function getFirstHydratableChild(parentInstance) {
|
10970 | var next = parentInstance.firstChild;
|
10971 |
|
10972 | while (next && next.nodeType !== ELEMENT_NODE && next.nodeType !== TEXT_NODE) {
|
10973 | next = next.nextSibling;
|
10974 | }
|
10975 | return next;
|
10976 | }
|
10977 |
|
10978 | function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
|
10979 | precacheFiberNode(internalInstanceHandle, instance);
|
10980 |
|
10981 |
|
10982 | updateFiberProps(instance, props);
|
10983 | var parentNamespace = void 0;
|
10984 | {
|
10985 | var hostContextDev = hostContext;
|
10986 | parentNamespace = hostContextDev.namespace;
|
10987 | }
|
10988 | return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance);
|
10989 | }
|
10990 |
|
10991 | function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
|
10992 | precacheFiberNode(internalInstanceHandle, textInstance);
|
10993 | return diffHydratedText(textInstance, text);
|
10994 | }
|
10995 |
|
10996 | function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
|
10997 | {
|
10998 | warnForUnmatchedText(textInstance, text);
|
10999 | }
|
11000 | }
|
11001 |
|
11002 | function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
|
11003 | if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
|
11004 | warnForUnmatchedText(textInstance, text);
|
11005 | }
|
11006 | }
|
11007 |
|
11008 | function didNotHydrateContainerInstance(parentContainer, instance) {
|
11009 | {
|
11010 | if (instance.nodeType === ELEMENT_NODE) {
|
11011 | warnForDeletedHydratableElement(parentContainer, instance);
|
11012 | } else {
|
11013 | warnForDeletedHydratableText(parentContainer, instance);
|
11014 | }
|
11015 | }
|
11016 | }
|
11017 |
|
11018 | function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
|
11019 | if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
|
11020 | if (instance.nodeType === ELEMENT_NODE) {
|
11021 | warnForDeletedHydratableElement(parentInstance, instance);
|
11022 | } else {
|
11023 | warnForDeletedHydratableText(parentInstance, instance);
|
11024 | }
|
11025 | }
|
11026 | }
|
11027 |
|
11028 | function didNotFindHydratableContainerInstance(parentContainer, type, props) {
|
11029 | {
|
11030 | warnForInsertedHydratedElement(parentContainer, type, props);
|
11031 | }
|
11032 | }
|
11033 |
|
11034 | function didNotFindHydratableContainerTextInstance(parentContainer, text) {
|
11035 | {
|
11036 | warnForInsertedHydratedText(parentContainer, text);
|
11037 | }
|
11038 | }
|
11039 |
|
11040 | function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
|
11041 | if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
|
11042 | warnForInsertedHydratedElement(parentInstance, type, props);
|
11043 | }
|
11044 | }
|
11045 |
|
11046 | function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
|
11047 | if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
|
11048 | warnForInsertedHydratedText(parentInstance, text);
|
11049 | }
|
11050 | }
|
11051 |
|
11052 |
|
11053 |
|
11054 | var reactEmoji = '\u269B';
|
11055 | var warningEmoji = '\u26D4';
|
11056 | var supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';
|
11057 |
|
11058 |
|
11059 |
|
11060 | var currentFiber = null;
|
11061 |
|
11062 |
|
11063 |
|
11064 |
|
11065 | var currentPhase = null;
|
11066 | var currentPhaseFiber = null;
|
11067 |
|
11068 |
|
11069 |
|
11070 | var isCommitting = false;
|
11071 | var hasScheduledUpdateInCurrentCommit = false;
|
11072 | var hasScheduledUpdateInCurrentPhase = false;
|
11073 | var commitCountInCurrentWorkLoop = 0;
|
11074 | var effectCountInCurrentCommit = 0;
|
11075 | var isWaitingForCallback = false;
|
11076 |
|
11077 |
|
11078 | var labelsInCurrentCommit = new Set();
|
11079 |
|
11080 | var formatMarkName = function (markName) {
|
11081 | return reactEmoji + ' ' + markName;
|
11082 | };
|
11083 |
|
11084 | var formatLabel = function (label, warning) {
|
11085 | var prefix = warning ? warningEmoji + ' ' : reactEmoji + ' ';
|
11086 | var suffix = warning ? ' Warning: ' + warning : '';
|
11087 | return '' + prefix + label + suffix;
|
11088 | };
|
11089 |
|
11090 | var beginMark = function (markName) {
|
11091 | performance.mark(formatMarkName(markName));
|
11092 | };
|
11093 |
|
11094 | var clearMark = function (markName) {
|
11095 | performance.clearMarks(formatMarkName(markName));
|
11096 | };
|
11097 |
|
11098 | var endMark = function (label, markName, warning) {
|
11099 | var formattedMarkName = formatMarkName(markName);
|
11100 | var formattedLabel = formatLabel(label, warning);
|
11101 | try {
|
11102 | performance.measure(formattedLabel, formattedMarkName);
|
11103 | } catch (err) {}
|
11104 |
|
11105 |
|
11106 |
|
11107 |
|
11108 |
|
11109 | performance.clearMarks(formattedMarkName);
|
11110 | performance.clearMeasures(formattedLabel);
|
11111 | };
|
11112 |
|
11113 | var getFiberMarkName = function (label, debugID) {
|
11114 | return label + ' (#' + debugID + ')';
|
11115 | };
|
11116 |
|
11117 | var getFiberLabel = function (componentName, isMounted, phase) {
|
11118 | if (phase === null) {
|
11119 |
|
11120 | return componentName + ' [' + (isMounted ? 'update' : 'mount') + ']';
|
11121 | } else {
|
11122 |
|
11123 | return componentName + '.' + phase;
|
11124 | }
|
11125 | };
|
11126 |
|
11127 | var beginFiberMark = function (fiber, phase) {
|
11128 | var componentName = getComponentName(fiber.type) || 'Unknown';
|
11129 | var debugID = fiber._debugID;
|
11130 | var isMounted = fiber.alternate !== null;
|
11131 | var label = getFiberLabel(componentName, isMounted, phase);
|
11132 |
|
11133 | if (isCommitting && labelsInCurrentCommit.has(label)) {
|
11134 |
|
11135 |
|
11136 |
|
11137 | return false;
|
11138 | }
|
11139 | labelsInCurrentCommit.add(label);
|
11140 |
|
11141 | var markName = getFiberMarkName(label, debugID);
|
11142 | beginMark(markName);
|
11143 | return true;
|
11144 | };
|
11145 |
|
11146 | var clearFiberMark = function (fiber, phase) {
|
11147 | var componentName = getComponentName(fiber.type) || 'Unknown';
|
11148 | var debugID = fiber._debugID;
|
11149 | var isMounted = fiber.alternate !== null;
|
11150 | var label = getFiberLabel(componentName, isMounted, phase);
|
11151 | var markName = getFiberMarkName(label, debugID);
|
11152 | clearMark(markName);
|
11153 | };
|
11154 |
|
11155 | var endFiberMark = function (fiber, phase, warning) {
|
11156 | var componentName = getComponentName(fiber.type) || 'Unknown';
|
11157 | var debugID = fiber._debugID;
|
11158 | var isMounted = fiber.alternate !== null;
|
11159 | var label = getFiberLabel(componentName, isMounted, phase);
|
11160 | var markName = getFiberMarkName(label, debugID);
|
11161 | endMark(label, markName, warning);
|
11162 | };
|
11163 |
|
11164 | var shouldIgnoreFiber = function (fiber) {
|
11165 |
|
11166 |
|
11167 | switch (fiber.tag) {
|
11168 | case HostRoot:
|
11169 | case HostComponent:
|
11170 | case HostText:
|
11171 | case HostPortal:
|
11172 | case Fragment:
|
11173 | case ContextProvider:
|
11174 | case ContextConsumer:
|
11175 | case Mode:
|
11176 | return true;
|
11177 | default:
|
11178 | return false;
|
11179 | }
|
11180 | };
|
11181 |
|
11182 | var clearPendingPhaseMeasurement = function () {
|
11183 | if (currentPhase !== null && currentPhaseFiber !== null) {
|
11184 | clearFiberMark(currentPhaseFiber, currentPhase);
|
11185 | }
|
11186 | currentPhaseFiber = null;
|
11187 | currentPhase = null;
|
11188 | hasScheduledUpdateInCurrentPhase = false;
|
11189 | };
|
11190 |
|
11191 | var pauseTimers = function () {
|
11192 |
|
11193 |
|
11194 | var fiber = currentFiber;
|
11195 | while (fiber) {
|
11196 | if (fiber._debugIsCurrentlyTiming) {
|
11197 | endFiberMark(fiber, null, null);
|
11198 | }
|
11199 | fiber = fiber.return;
|
11200 | }
|
11201 | };
|
11202 |
|
11203 | var resumeTimersRecursively = function (fiber) {
|
11204 | if (fiber.return !== null) {
|
11205 | resumeTimersRecursively(fiber.return);
|
11206 | }
|
11207 | if (fiber._debugIsCurrentlyTiming) {
|
11208 | beginFiberMark(fiber, null);
|
11209 | }
|
11210 | };
|
11211 |
|
11212 | var resumeTimers = function () {
|
11213 |
|
11214 | if (currentFiber !== null) {
|
11215 | resumeTimersRecursively(currentFiber);
|
11216 | }
|
11217 | };
|
11218 |
|
11219 | function recordEffect() {
|
11220 | if (enableUserTimingAPI) {
|
11221 | effectCountInCurrentCommit++;
|
11222 | }
|
11223 | }
|
11224 |
|
11225 | function recordScheduleUpdate() {
|
11226 | if (enableUserTimingAPI) {
|
11227 | if (isCommitting) {
|
11228 | hasScheduledUpdateInCurrentCommit = true;
|
11229 | }
|
11230 | if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') {
|
11231 | hasScheduledUpdateInCurrentPhase = true;
|
11232 | }
|
11233 | }
|
11234 | }
|
11235 |
|
11236 | function startRequestCallbackTimer() {
|
11237 | if (enableUserTimingAPI) {
|
11238 | if (supportsUserTiming && !isWaitingForCallback) {
|
11239 | isWaitingForCallback = true;
|
11240 | beginMark('(Waiting for async callback...)');
|
11241 | }
|
11242 | }
|
11243 | }
|
11244 |
|
11245 | function stopRequestCallbackTimer(didExpire, expirationTime) {
|
11246 | if (enableUserTimingAPI) {
|
11247 | if (supportsUserTiming) {
|
11248 | isWaitingForCallback = false;
|
11249 | var warning = didExpire ? 'React was blocked by main thread' : null;
|
11250 | endMark('(Waiting for async callback... will force flush in ' + expirationTime + ' ms)', '(Waiting for async callback...)', warning);
|
11251 | }
|
11252 | }
|
11253 | }
|
11254 |
|
11255 | function startWorkTimer(fiber) {
|
11256 | if (enableUserTimingAPI) {
|
11257 | if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
|
11258 | return;
|
11259 | }
|
11260 |
|
11261 | currentFiber = fiber;
|
11262 | if (!beginFiberMark(fiber, null)) {
|
11263 | return;
|
11264 | }
|
11265 | fiber._debugIsCurrentlyTiming = true;
|
11266 | }
|
11267 | }
|
11268 |
|
11269 | function cancelWorkTimer(fiber) {
|
11270 | if (enableUserTimingAPI) {
|
11271 | if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
|
11272 | return;
|
11273 | }
|
11274 |
|
11275 |
|
11276 | fiber._debugIsCurrentlyTiming = false;
|
11277 | clearFiberMark(fiber, null);
|
11278 | }
|
11279 | }
|
11280 |
|
11281 | function stopWorkTimer(fiber) {
|
11282 | if (enableUserTimingAPI) {
|
11283 | if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
|
11284 | return;
|
11285 | }
|
11286 |
|
11287 | currentFiber = fiber.return;
|
11288 | if (!fiber._debugIsCurrentlyTiming) {
|
11289 | return;
|
11290 | }
|
11291 | fiber._debugIsCurrentlyTiming = false;
|
11292 | endFiberMark(fiber, null, null);
|
11293 | }
|
11294 | }
|
11295 |
|
11296 | function stopFailedWorkTimer(fiber) {
|
11297 | if (enableUserTimingAPI) {
|
11298 | if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
|
11299 | return;
|
11300 | }
|
11301 |
|
11302 | currentFiber = fiber.return;
|
11303 | if (!fiber._debugIsCurrentlyTiming) {
|
11304 | return;
|
11305 | }
|
11306 | fiber._debugIsCurrentlyTiming = false;
|
11307 | var warning = fiber.tag === SuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary';
|
11308 | endFiberMark(fiber, null, warning);
|
11309 | }
|
11310 | }
|
11311 |
|
11312 | function startPhaseTimer(fiber, phase) {
|
11313 | if (enableUserTimingAPI) {
|
11314 | if (!supportsUserTiming) {
|
11315 | return;
|
11316 | }
|
11317 | clearPendingPhaseMeasurement();
|
11318 | if (!beginFiberMark(fiber, phase)) {
|
11319 | return;
|
11320 | }
|
11321 | currentPhaseFiber = fiber;
|
11322 | currentPhase = phase;
|
11323 | }
|
11324 | }
|
11325 |
|
11326 | function stopPhaseTimer() {
|
11327 | if (enableUserTimingAPI) {
|
11328 | if (!supportsUserTiming) {
|
11329 | return;
|
11330 | }
|
11331 | if (currentPhase !== null && currentPhaseFiber !== null) {
|
11332 | var warning = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null;
|
11333 | endFiberMark(currentPhaseFiber, currentPhase, warning);
|
11334 | }
|
11335 | currentPhase = null;
|
11336 | currentPhaseFiber = null;
|
11337 | }
|
11338 | }
|
11339 |
|
11340 | function startWorkLoopTimer(nextUnitOfWork) {
|
11341 | if (enableUserTimingAPI) {
|
11342 | currentFiber = nextUnitOfWork;
|
11343 | if (!supportsUserTiming) {
|
11344 | return;
|
11345 | }
|
11346 | commitCountInCurrentWorkLoop = 0;
|
11347 |
|
11348 |
|
11349 | beginMark('(React Tree Reconciliation)');
|
11350 |
|
11351 | resumeTimers();
|
11352 | }
|
11353 | }
|
11354 |
|
11355 | function stopWorkLoopTimer(interruptedBy, didCompleteRoot) {
|
11356 | if (enableUserTimingAPI) {
|
11357 | if (!supportsUserTiming) {
|
11358 | return;
|
11359 | }
|
11360 | var warning = null;
|
11361 | if (interruptedBy !== null) {
|
11362 | if (interruptedBy.tag === HostRoot) {
|
11363 | warning = 'A top-level update interrupted the previous render';
|
11364 | } else {
|
11365 | var componentName = getComponentName(interruptedBy.type) || 'Unknown';
|
11366 | warning = 'An update to ' + componentName + ' interrupted the previous render';
|
11367 | }
|
11368 | } else if (commitCountInCurrentWorkLoop > 1) {
|
11369 | warning = 'There were cascading updates';
|
11370 | }
|
11371 | commitCountInCurrentWorkLoop = 0;
|
11372 | var label = didCompleteRoot ? '(React Tree Reconciliation: Completed Root)' : '(React Tree Reconciliation: Yielded)';
|
11373 |
|
11374 | pauseTimers();
|
11375 | endMark(label, '(React Tree Reconciliation)', warning);
|
11376 | }
|
11377 | }
|
11378 |
|
11379 | function startCommitTimer() {
|
11380 | if (enableUserTimingAPI) {
|
11381 | if (!supportsUserTiming) {
|
11382 | return;
|
11383 | }
|
11384 | isCommitting = true;
|
11385 | hasScheduledUpdateInCurrentCommit = false;
|
11386 | labelsInCurrentCommit.clear();
|
11387 | beginMark('(Committing Changes)');
|
11388 | }
|
11389 | }
|
11390 |
|
11391 | function stopCommitTimer() {
|
11392 | if (enableUserTimingAPI) {
|
11393 | if (!supportsUserTiming) {
|
11394 | return;
|
11395 | }
|
11396 |
|
11397 | var warning = null;
|
11398 | if (hasScheduledUpdateInCurrentCommit) {
|
11399 | warning = 'Lifecycle hook scheduled a cascading update';
|
11400 | } else if (commitCountInCurrentWorkLoop > 0) {
|
11401 | warning = 'Caused by a cascading update in earlier commit';
|
11402 | }
|
11403 | hasScheduledUpdateInCurrentCommit = false;
|
11404 | commitCountInCurrentWorkLoop++;
|
11405 | isCommitting = false;
|
11406 | labelsInCurrentCommit.clear();
|
11407 |
|
11408 | endMark('(Committing Changes)', '(Committing Changes)', warning);
|
11409 | }
|
11410 | }
|
11411 |
|
11412 | function startCommitSnapshotEffectsTimer() {
|
11413 | if (enableUserTimingAPI) {
|
11414 | if (!supportsUserTiming) {
|
11415 | return;
|
11416 | }
|
11417 | effectCountInCurrentCommit = 0;
|
11418 | beginMark('(Committing Snapshot Effects)');
|
11419 | }
|
11420 | }
|
11421 |
|
11422 | function stopCommitSnapshotEffectsTimer() {
|
11423 | if (enableUserTimingAPI) {
|
11424 | if (!supportsUserTiming) {
|
11425 | return;
|
11426 | }
|
11427 | var count = effectCountInCurrentCommit;
|
11428 | effectCountInCurrentCommit = 0;
|
11429 | endMark('(Committing Snapshot Effects: ' + count + ' Total)', '(Committing Snapshot Effects)', null);
|
11430 | }
|
11431 | }
|
11432 |
|
11433 | function startCommitHostEffectsTimer() {
|
11434 | if (enableUserTimingAPI) {
|
11435 | if (!supportsUserTiming) {
|
11436 | return;
|
11437 | }
|
11438 | effectCountInCurrentCommit = 0;
|
11439 | beginMark('(Committing Host Effects)');
|
11440 | }
|
11441 | }
|
11442 |
|
11443 | function stopCommitHostEffectsTimer() {
|
11444 | if (enableUserTimingAPI) {
|
11445 | if (!supportsUserTiming) {
|
11446 | return;
|
11447 | }
|
11448 | var count = effectCountInCurrentCommit;
|
11449 | effectCountInCurrentCommit = 0;
|
11450 | endMark('(Committing Host Effects: ' + count + ' Total)', '(Committing Host Effects)', null);
|
11451 | }
|
11452 | }
|
11453 |
|
11454 | function startCommitLifeCyclesTimer() {
|
11455 | if (enableUserTimingAPI) {
|
11456 | if (!supportsUserTiming) {
|
11457 | return;
|
11458 | }
|
11459 | effectCountInCurrentCommit = 0;
|
11460 | beginMark('(Calling Lifecycle Methods)');
|
11461 | }
|
11462 | }
|
11463 |
|
11464 | function stopCommitLifeCyclesTimer() {
|
11465 | if (enableUserTimingAPI) {
|
11466 | if (!supportsUserTiming) {
|
11467 | return;
|
11468 | }
|
11469 | var count = effectCountInCurrentCommit;
|
11470 | effectCountInCurrentCommit = 0;
|
11471 | endMark('(Calling Lifecycle Methods: ' + count + ' Total)', '(Calling Lifecycle Methods)', null);
|
11472 | }
|
11473 | }
|
11474 |
|
11475 | var valueStack = [];
|
11476 |
|
11477 | var fiberStack = void 0;
|
11478 |
|
11479 | {
|
11480 | fiberStack = [];
|
11481 | }
|
11482 |
|
11483 | var index = -1;
|
11484 |
|
11485 | function createCursor(defaultValue) {
|
11486 | return {
|
11487 | current: defaultValue
|
11488 | };
|
11489 | }
|
11490 |
|
11491 | function pop(cursor, fiber) {
|
11492 | if (index < 0) {
|
11493 | {
|
11494 | warningWithoutStack$1(false, 'Unexpected pop.');
|
11495 | }
|
11496 | return;
|
11497 | }
|
11498 |
|
11499 | {
|
11500 | if (fiber !== fiberStack[index]) {
|
11501 | warningWithoutStack$1(false, 'Unexpected Fiber popped.');
|
11502 | }
|
11503 | }
|
11504 |
|
11505 | cursor.current = valueStack[index];
|
11506 |
|
11507 | valueStack[index] = null;
|
11508 |
|
11509 | {
|
11510 | fiberStack[index] = null;
|
11511 | }
|
11512 |
|
11513 | index--;
|
11514 | }
|
11515 |
|
11516 | function push(cursor, value, fiber) {
|
11517 | index++;
|
11518 |
|
11519 | valueStack[index] = cursor.current;
|
11520 |
|
11521 | {
|
11522 | fiberStack[index] = fiber;
|
11523 | }
|
11524 |
|
11525 | cursor.current = value;
|
11526 | }
|
11527 |
|
11528 | function checkThatStackIsEmpty() {
|
11529 | {
|
11530 | if (index !== -1) {
|
11531 | warningWithoutStack$1(false, 'Expected an empty stack. Something was not reset properly.');
|
11532 | }
|
11533 | }
|
11534 | }
|
11535 |
|
11536 | function resetStackAfterFatalErrorInDev() {
|
11537 | {
|
11538 | index = -1;
|
11539 | valueStack.length = 0;
|
11540 | fiberStack.length = 0;
|
11541 | }
|
11542 | }
|
11543 |
|
11544 | var warnedAboutMissingGetChildContext = void 0;
|
11545 |
|
11546 | {
|
11547 | warnedAboutMissingGetChildContext = {};
|
11548 | }
|
11549 |
|
11550 | var emptyContextObject = {};
|
11551 | {
|
11552 | Object.freeze(emptyContextObject);
|
11553 | }
|
11554 |
|
11555 |
|
11556 | var contextStackCursor = createCursor(emptyContextObject);
|
11557 |
|
11558 | var didPerformWorkStackCursor = createCursor(false);
|
11559 |
|
11560 |
|
11561 |
|
11562 | var previousContext = emptyContextObject;
|
11563 |
|
11564 | function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {
|
11565 | if (didPushOwnContextIfProvider && isContextProvider(Component)) {
|
11566 |
|
11567 |
|
11568 |
|
11569 |
|
11570 | return previousContext;
|
11571 | }
|
11572 | return contextStackCursor.current;
|
11573 | }
|
11574 |
|
11575 | function cacheContext(workInProgress, unmaskedContext, maskedContext) {
|
11576 | var instance = workInProgress.stateNode;
|
11577 | instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
|
11578 | instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
|
11579 | }
|
11580 |
|
11581 | function getMaskedContext(workInProgress, unmaskedContext) {
|
11582 | var type = workInProgress.type;
|
11583 | var contextTypes = type.contextTypes;
|
11584 | if (!contextTypes) {
|
11585 | return emptyContextObject;
|
11586 | }
|
11587 |
|
11588 |
|
11589 |
|
11590 |
|
11591 | var instance = workInProgress.stateNode;
|
11592 | if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
|
11593 | return instance.__reactInternalMemoizedMaskedChildContext;
|
11594 | }
|
11595 |
|
11596 | var context = {};
|
11597 | for (var key in contextTypes) {
|
11598 | context[key] = unmaskedContext[key];
|
11599 | }
|
11600 |
|
11601 | {
|
11602 | var name = getComponentName(type) || 'Unknown';
|
11603 | checkPropTypes(contextTypes, context, 'context', name, getCurrentFiberStackInDev);
|
11604 | }
|
11605 |
|
11606 |
|
11607 |
|
11608 | if (instance) {
|
11609 | cacheContext(workInProgress, unmaskedContext, context);
|
11610 | }
|
11611 |
|
11612 | return context;
|
11613 | }
|
11614 |
|
11615 | function hasContextChanged() {
|
11616 | return didPerformWorkStackCursor.current;
|
11617 | }
|
11618 |
|
11619 | function isContextProvider(type) {
|
11620 | var childContextTypes = type.childContextTypes;
|
11621 | return childContextTypes !== null && childContextTypes !== undefined;
|
11622 | }
|
11623 |
|
11624 | function popContext(fiber) {
|
11625 | pop(didPerformWorkStackCursor, fiber);
|
11626 | pop(contextStackCursor, fiber);
|
11627 | }
|
11628 |
|
11629 | function popTopLevelContextObject(fiber) {
|
11630 | pop(didPerformWorkStackCursor, fiber);
|
11631 | pop(contextStackCursor, fiber);
|
11632 | }
|
11633 |
|
11634 | function pushTopLevelContextObject(fiber, context, didChange) {
|
11635 | !(contextStackCursor.current === emptyContextObject) ? invariant(false, 'Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
11636 |
|
11637 | push(contextStackCursor, context, fiber);
|
11638 | push(didPerformWorkStackCursor, didChange, fiber);
|
11639 | }
|
11640 |
|
11641 | function processChildContext(fiber, type, parentContext) {
|
11642 | var instance = fiber.stateNode;
|
11643 | var childContextTypes = type.childContextTypes;
|
11644 |
|
11645 |
|
11646 |
|
11647 | if (typeof instance.getChildContext !== 'function') {
|
11648 | {
|
11649 | var componentName = getComponentName(type) || 'Unknown';
|
11650 |
|
11651 | if (!warnedAboutMissingGetChildContext[componentName]) {
|
11652 | warnedAboutMissingGetChildContext[componentName] = true;
|
11653 | warningWithoutStack$1(false, '%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);
|
11654 | }
|
11655 | }
|
11656 | return parentContext;
|
11657 | }
|
11658 |
|
11659 | var childContext = void 0;
|
11660 | {
|
11661 | setCurrentPhase('getChildContext');
|
11662 | }
|
11663 | startPhaseTimer(fiber, 'getChildContext');
|
11664 | childContext = instance.getChildContext();
|
11665 | stopPhaseTimer();
|
11666 | {
|
11667 | setCurrentPhase(null);
|
11668 | }
|
11669 | for (var contextKey in childContext) {
|
11670 | !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(type) || 'Unknown', contextKey) : void 0;
|
11671 | }
|
11672 | {
|
11673 | var name = getComponentName(type) || 'Unknown';
|
11674 | checkPropTypes(childContextTypes, childContext, 'child context', name,
|
11675 |
|
11676 |
|
11677 |
|
11678 |
|
11679 |
|
11680 | getCurrentFiberStackInDev);
|
11681 | }
|
11682 |
|
11683 | return _assign({}, parentContext, childContext);
|
11684 | }
|
11685 |
|
11686 | function pushContextProvider(workInProgress) {
|
11687 | var instance = workInProgress.stateNode;
|
11688 |
|
11689 |
|
11690 |
|
11691 | var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject;
|
11692 |
|
11693 |
|
11694 |
|
11695 | previousContext = contextStackCursor.current;
|
11696 | push(contextStackCursor, memoizedMergedChildContext, workInProgress);
|
11697 | push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
|
11698 |
|
11699 | return true;
|
11700 | }
|
11701 |
|
11702 | function invalidateContextProvider(workInProgress, type, didChange) {
|
11703 | var instance = workInProgress.stateNode;
|
11704 | !instance ? invariant(false, 'Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
11705 |
|
11706 | if (didChange) {
|
11707 |
|
11708 |
|
11709 |
|
11710 | var mergedContext = processChildContext(workInProgress, type, previousContext);
|
11711 | instance.__reactInternalMemoizedMergedChildContext = mergedContext;
|
11712 |
|
11713 |
|
11714 |
|
11715 | pop(didPerformWorkStackCursor, workInProgress);
|
11716 | pop(contextStackCursor, workInProgress);
|
11717 |
|
11718 | push(contextStackCursor, mergedContext, workInProgress);
|
11719 | push(didPerformWorkStackCursor, didChange, workInProgress);
|
11720 | } else {
|
11721 | pop(didPerformWorkStackCursor, workInProgress);
|
11722 | push(didPerformWorkStackCursor, didChange, workInProgress);
|
11723 | }
|
11724 | }
|
11725 |
|
11726 | function findCurrentUnmaskedContext(fiber) {
|
11727 |
|
11728 |
|
11729 | !(isFiberMounted(fiber) && fiber.tag === ClassComponent) ? invariant(false, 'Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
11730 |
|
11731 | var node = fiber;
|
11732 | do {
|
11733 | switch (node.tag) {
|
11734 | case HostRoot:
|
11735 | return node.stateNode.context;
|
11736 | case ClassComponent:
|
11737 | {
|
11738 | var Component = node.type;
|
11739 | if (isContextProvider(Component)) {
|
11740 | return node.stateNode.__reactInternalMemoizedMergedChildContext;
|
11741 | }
|
11742 | break;
|
11743 | }
|
11744 | }
|
11745 | node = node.return;
|
11746 | } while (node !== null);
|
11747 | invariant(false, 'Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.');
|
11748 | }
|
11749 |
|
11750 | var onCommitFiberRoot = null;
|
11751 | var onCommitFiberUnmount = null;
|
11752 | var hasLoggedError = false;
|
11753 |
|
11754 | function catchErrors(fn) {
|
11755 | return function (arg) {
|
11756 | try {
|
11757 | return fn(arg);
|
11758 | } catch (err) {
|
11759 | if (true && !hasLoggedError) {
|
11760 | hasLoggedError = true;
|
11761 | warningWithoutStack$1(false, 'React DevTools encountered an error: %s', err);
|
11762 | }
|
11763 | }
|
11764 | };
|
11765 | }
|
11766 |
|
11767 | var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';
|
11768 |
|
11769 | function injectInternals(internals) {
|
11770 | if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
|
11771 |
|
11772 | return false;
|
11773 | }
|
11774 | var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
11775 | if (hook.isDisabled) {
|
11776 |
|
11777 |
|
11778 |
|
11779 | return true;
|
11780 | }
|
11781 | if (!hook.supportsFiber) {
|
11782 | {
|
11783 | warningWithoutStack$1(false, 'The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools');
|
11784 | }
|
11785 |
|
11786 | return true;
|
11787 | }
|
11788 | try {
|
11789 | var rendererID = hook.inject(internals);
|
11790 |
|
11791 | onCommitFiberRoot = catchErrors(function (root) {
|
11792 | return hook.onCommitFiberRoot(rendererID, root);
|
11793 | });
|
11794 | onCommitFiberUnmount = catchErrors(function (fiber) {
|
11795 | return hook.onCommitFiberUnmount(rendererID, fiber);
|
11796 | });
|
11797 | } catch (err) {
|
11798 |
|
11799 | {
|
11800 | warningWithoutStack$1(false, 'React DevTools encountered an error: %s.', err);
|
11801 | }
|
11802 | }
|
11803 |
|
11804 | return true;
|
11805 | }
|
11806 |
|
11807 | function onCommitRoot(root) {
|
11808 | if (typeof onCommitFiberRoot === 'function') {
|
11809 | onCommitFiberRoot(root);
|
11810 | }
|
11811 | }
|
11812 |
|
11813 | function onCommitUnmount(fiber) {
|
11814 | if (typeof onCommitFiberUnmount === 'function') {
|
11815 | onCommitFiberUnmount(fiber);
|
11816 | }
|
11817 | }
|
11818 |
|
11819 |
|
11820 |
|
11821 |
|
11822 | var maxSigned31BitInt = 1073741823;
|
11823 |
|
11824 | var NoWork = 0;
|
11825 | var Never = 1;
|
11826 | var Sync = maxSigned31BitInt;
|
11827 |
|
11828 | var UNIT_SIZE = 10;
|
11829 | var MAGIC_NUMBER_OFFSET = maxSigned31BitInt - 1;
|
11830 |
|
11831 |
|
11832 | function msToExpirationTime(ms) {
|
11833 |
|
11834 | return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);
|
11835 | }
|
11836 |
|
11837 | function expirationTimeToMs(expirationTime) {
|
11838 | return (MAGIC_NUMBER_OFFSET - expirationTime) * UNIT_SIZE;
|
11839 | }
|
11840 |
|
11841 | function ceiling(num, precision) {
|
11842 | return ((num / precision | 0) + 1) * precision;
|
11843 | }
|
11844 |
|
11845 | function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {
|
11846 | return MAGIC_NUMBER_OFFSET - ceiling(MAGIC_NUMBER_OFFSET - currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);
|
11847 | }
|
11848 |
|
11849 | var LOW_PRIORITY_EXPIRATION = 5000;
|
11850 | var LOW_PRIORITY_BATCH_SIZE = 250;
|
11851 |
|
11852 | function computeAsyncExpiration(currentTime) {
|
11853 | return computeExpirationBucket(currentTime, LOW_PRIORITY_EXPIRATION, LOW_PRIORITY_BATCH_SIZE);
|
11854 | }
|
11855 |
|
11856 |
|
11857 |
|
11858 |
|
11859 |
|
11860 |
|
11861 |
|
11862 |
|
11863 |
|
11864 |
|
11865 |
|
11866 |
|
11867 | var HIGH_PRIORITY_EXPIRATION = 500;
|
11868 | var HIGH_PRIORITY_BATCH_SIZE = 100;
|
11869 |
|
11870 | function computeInteractiveExpiration(currentTime) {
|
11871 | return computeExpirationBucket(currentTime, HIGH_PRIORITY_EXPIRATION, HIGH_PRIORITY_BATCH_SIZE);
|
11872 | }
|
11873 |
|
11874 | var NoContext = 0;
|
11875 | var ConcurrentMode = 1;
|
11876 | var StrictMode = 2;
|
11877 | var ProfileMode = 4;
|
11878 |
|
11879 | var hasBadMapPolyfill = void 0;
|
11880 |
|
11881 | {
|
11882 | hasBadMapPolyfill = false;
|
11883 | try {
|
11884 | var nonExtensibleObject = Object.preventExtensions({});
|
11885 | var testMap = new Map([[nonExtensibleObject, null]]);
|
11886 | var testSet = new Set([nonExtensibleObject]);
|
11887 |
|
11888 |
|
11889 |
|
11890 | testMap.set(0, 0);
|
11891 | testSet.add(0);
|
11892 | } catch (e) {
|
11893 |
|
11894 | hasBadMapPolyfill = true;
|
11895 | }
|
11896 | }
|
11897 |
|
11898 |
|
11899 |
|
11900 |
|
11901 |
|
11902 | var debugCounter = void 0;
|
11903 |
|
11904 | {
|
11905 | debugCounter = 1;
|
11906 | }
|
11907 |
|
11908 | function FiberNode(tag, pendingProps, key, mode) {
|
11909 |
|
11910 | this.tag = tag;
|
11911 | this.key = key;
|
11912 | this.elementType = null;
|
11913 | this.type = null;
|
11914 | this.stateNode = null;
|
11915 |
|
11916 |
|
11917 | this.return = null;
|
11918 | this.child = null;
|
11919 | this.sibling = null;
|
11920 | this.index = 0;
|
11921 |
|
11922 | this.ref = null;
|
11923 |
|
11924 | this.pendingProps = pendingProps;
|
11925 | this.memoizedProps = null;
|
11926 | this.updateQueue = null;
|
11927 | this.memoizedState = null;
|
11928 | this.firstContextDependency = null;
|
11929 |
|
11930 | this.mode = mode;
|
11931 |
|
11932 |
|
11933 | this.effectTag = NoEffect;
|
11934 | this.nextEffect = null;
|
11935 |
|
11936 | this.firstEffect = null;
|
11937 | this.lastEffect = null;
|
11938 |
|
11939 | this.expirationTime = NoWork;
|
11940 | this.childExpirationTime = NoWork;
|
11941 |
|
11942 | this.alternate = null;
|
11943 |
|
11944 | if (enableProfilerTimer) {
|
11945 |
|
11946 |
|
11947 |
|
11948 |
|
11949 |
|
11950 |
|
11951 |
|
11952 |
|
11953 |
|
11954 |
|
11955 |
|
11956 |
|
11957 | this.actualDuration = Number.NaN;
|
11958 | this.actualStartTime = Number.NaN;
|
11959 | this.selfBaseDuration = Number.NaN;
|
11960 | this.treeBaseDuration = Number.NaN;
|
11961 |
|
11962 |
|
11963 |
|
11964 |
|
11965 | this.actualDuration = 0;
|
11966 | this.actualStartTime = -1;
|
11967 | this.selfBaseDuration = 0;
|
11968 | this.treeBaseDuration = 0;
|
11969 | }
|
11970 |
|
11971 | {
|
11972 | this._debugID = debugCounter++;
|
11973 | this._debugSource = null;
|
11974 | this._debugOwner = null;
|
11975 | this._debugIsCurrentlyTiming = false;
|
11976 | if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
|
11977 | Object.preventExtensions(this);
|
11978 | }
|
11979 | }
|
11980 | }
|
11981 |
|
11982 |
|
11983 |
|
11984 |
|
11985 |
|
11986 |
|
11987 |
|
11988 |
|
11989 |
|
11990 |
|
11991 |
|
11992 |
|
11993 |
|
11994 |
|
11995 | var createFiber = function (tag, pendingProps, key, mode) {
|
11996 |
|
11997 | return new FiberNode(tag, pendingProps, key, mode);
|
11998 | };
|
11999 |
|
12000 | function shouldConstruct(Component) {
|
12001 | var prototype = Component.prototype;
|
12002 | return !!(prototype && prototype.isReactComponent);
|
12003 | }
|
12004 |
|
12005 | function isSimpleFunctionComponent(type) {
|
12006 | return typeof type === 'function' && !shouldConstruct(type) && type.defaultProps === undefined;
|
12007 | }
|
12008 |
|
12009 | function resolveLazyComponentTag(Component) {
|
12010 | if (typeof Component === 'function') {
|
12011 | return shouldConstruct(Component) ? ClassComponent : FunctionComponent;
|
12012 | } else if (Component !== undefined && Component !== null) {
|
12013 | var $$typeof = Component.$$typeof;
|
12014 | if ($$typeof === REACT_FORWARD_REF_TYPE) {
|
12015 | return ForwardRef;
|
12016 | }
|
12017 | if ($$typeof === REACT_MEMO_TYPE) {
|
12018 | return MemoComponent;
|
12019 | }
|
12020 | }
|
12021 | return IndeterminateComponent;
|
12022 | }
|
12023 |
|
12024 |
|
12025 | function createWorkInProgress(current, pendingProps, expirationTime) {
|
12026 | var workInProgress = current.alternate;
|
12027 | if (workInProgress === null) {
|
12028 |
|
12029 |
|
12030 |
|
12031 |
|
12032 |
|
12033 | workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);
|
12034 | workInProgress.elementType = current.elementType;
|
12035 | workInProgress.type = current.type;
|
12036 | workInProgress.stateNode = current.stateNode;
|
12037 |
|
12038 | {
|
12039 |
|
12040 | workInProgress._debugID = current._debugID;
|
12041 | workInProgress._debugSource = current._debugSource;
|
12042 | workInProgress._debugOwner = current._debugOwner;
|
12043 | }
|
12044 |
|
12045 | workInProgress.alternate = current;
|
12046 | current.alternate = workInProgress;
|
12047 | } else {
|
12048 | workInProgress.pendingProps = pendingProps;
|
12049 |
|
12050 |
|
12051 |
|
12052 | workInProgress.effectTag = NoEffect;
|
12053 |
|
12054 |
|
12055 | workInProgress.nextEffect = null;
|
12056 | workInProgress.firstEffect = null;
|
12057 | workInProgress.lastEffect = null;
|
12058 |
|
12059 | if (enableProfilerTimer) {
|
12060 |
|
12061 |
|
12062 |
|
12063 |
|
12064 | workInProgress.actualDuration = 0;
|
12065 | workInProgress.actualStartTime = -1;
|
12066 | }
|
12067 | }
|
12068 |
|
12069 | workInProgress.childExpirationTime = current.childExpirationTime;
|
12070 | workInProgress.expirationTime = current.expirationTime;
|
12071 |
|
12072 | workInProgress.child = current.child;
|
12073 | workInProgress.memoizedProps = current.memoizedProps;
|
12074 | workInProgress.memoizedState = current.memoizedState;
|
12075 | workInProgress.updateQueue = current.updateQueue;
|
12076 | workInProgress.firstContextDependency = current.firstContextDependency;
|
12077 |
|
12078 |
|
12079 | workInProgress.sibling = current.sibling;
|
12080 | workInProgress.index = current.index;
|
12081 | workInProgress.ref = current.ref;
|
12082 |
|
12083 | if (enableProfilerTimer) {
|
12084 | workInProgress.selfBaseDuration = current.selfBaseDuration;
|
12085 | workInProgress.treeBaseDuration = current.treeBaseDuration;
|
12086 | }
|
12087 |
|
12088 | return workInProgress;
|
12089 | }
|
12090 |
|
12091 | function createHostRootFiber(isConcurrent) {
|
12092 | var mode = isConcurrent ? ConcurrentMode | StrictMode : NoContext;
|
12093 |
|
12094 | if (enableProfilerTimer && isDevToolsPresent) {
|
12095 |
|
12096 |
|
12097 |
|
12098 | mode |= ProfileMode;
|
12099 | }
|
12100 |
|
12101 | return createFiber(HostRoot, null, null, mode);
|
12102 | }
|
12103 |
|
12104 | function createFiberFromTypeAndProps(type, // React$ElementType
|
12105 | key, pendingProps, owner, mode, expirationTime) {
|
12106 | var fiber = void 0;
|
12107 |
|
12108 | var fiberTag = IndeterminateComponent;
|
12109 |
|
12110 | var resolvedType = type;
|
12111 | if (typeof type === 'function') {
|
12112 | if (shouldConstruct(type)) {
|
12113 | fiberTag = ClassComponent;
|
12114 | }
|
12115 | } else if (typeof type === 'string') {
|
12116 | fiberTag = HostComponent;
|
12117 | } else {
|
12118 | getTag: switch (type) {
|
12119 | case REACT_FRAGMENT_TYPE:
|
12120 | return createFiberFromFragment(pendingProps.children, mode, expirationTime, key);
|
12121 | case REACT_CONCURRENT_MODE_TYPE:
|
12122 | return createFiberFromMode(pendingProps, mode | ConcurrentMode | StrictMode, expirationTime, key);
|
12123 | case REACT_STRICT_MODE_TYPE:
|
12124 | return createFiberFromMode(pendingProps, mode | StrictMode, expirationTime, key);
|
12125 | case REACT_PROFILER_TYPE:
|
12126 | return createFiberFromProfiler(pendingProps, mode, expirationTime, key);
|
12127 | case REACT_SUSPENSE_TYPE:
|
12128 | return createFiberFromSuspense(pendingProps, mode, expirationTime, key);
|
12129 | default:
|
12130 | {
|
12131 | if (typeof type === 'object' && type !== null) {
|
12132 | switch (type.$$typeof) {
|
12133 | case REACT_PROVIDER_TYPE:
|
12134 | fiberTag = ContextProvider;
|
12135 | break getTag;
|
12136 | case REACT_CONTEXT_TYPE:
|
12137 |
|
12138 | fiberTag = ContextConsumer;
|
12139 | break getTag;
|
12140 | case REACT_FORWARD_REF_TYPE:
|
12141 | fiberTag = ForwardRef;
|
12142 | break getTag;
|
12143 | case REACT_MEMO_TYPE:
|
12144 | fiberTag = MemoComponent;
|
12145 | break getTag;
|
12146 | case REACT_LAZY_TYPE:
|
12147 | fiberTag = LazyComponent;
|
12148 | resolvedType = null;
|
12149 | break getTag;
|
12150 | }
|
12151 | }
|
12152 | var info = '';
|
12153 | {
|
12154 | if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
12155 | 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.';
|
12156 | }
|
12157 | var ownerName = owner ? getComponentName(owner.type) : null;
|
12158 | if (ownerName) {
|
12159 | info += '\n\nCheck the render method of `' + ownerName + '`.';
|
12160 | }
|
12161 | }
|
12162 | invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info);
|
12163 | }
|
12164 | }
|
12165 | }
|
12166 |
|
12167 | fiber = createFiber(fiberTag, pendingProps, key, mode);
|
12168 | fiber.elementType = type;
|
12169 | fiber.type = resolvedType;
|
12170 | fiber.expirationTime = expirationTime;
|
12171 |
|
12172 | return fiber;
|
12173 | }
|
12174 |
|
12175 | function createFiberFromElement(element, mode, expirationTime) {
|
12176 | var owner = null;
|
12177 | {
|
12178 | owner = element._owner;
|
12179 | }
|
12180 | var type = element.type;
|
12181 | var key = element.key;
|
12182 | var pendingProps = element.props;
|
12183 | var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, expirationTime);
|
12184 | {
|
12185 | fiber._debugSource = element._source;
|
12186 | fiber._debugOwner = element._owner;
|
12187 | }
|
12188 | return fiber;
|
12189 | }
|
12190 |
|
12191 | function createFiberFromFragment(elements, mode, expirationTime, key) {
|
12192 | var fiber = createFiber(Fragment, elements, key, mode);
|
12193 | fiber.expirationTime = expirationTime;
|
12194 | return fiber;
|
12195 | }
|
12196 |
|
12197 | function createFiberFromProfiler(pendingProps, mode, expirationTime, key) {
|
12198 | {
|
12199 | if (typeof pendingProps.id !== 'string' || typeof pendingProps.onRender !== 'function') {
|
12200 | warningWithoutStack$1(false, 'Profiler must specify an "id" string and "onRender" function as props');
|
12201 | }
|
12202 | }
|
12203 |
|
12204 | var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
|
12205 |
|
12206 | fiber.elementType = REACT_PROFILER_TYPE;
|
12207 | fiber.type = REACT_PROFILER_TYPE;
|
12208 | fiber.expirationTime = expirationTime;
|
12209 |
|
12210 | return fiber;
|
12211 | }
|
12212 |
|
12213 | function createFiberFromMode(pendingProps, mode, expirationTime, key) {
|
12214 | var fiber = createFiber(Mode, pendingProps, key, mode);
|
12215 |
|
12216 |
|
12217 | var type = (mode & ConcurrentMode) === NoContext ? REACT_STRICT_MODE_TYPE : REACT_CONCURRENT_MODE_TYPE;
|
12218 | fiber.elementType = type;
|
12219 | fiber.type = type;
|
12220 |
|
12221 | fiber.expirationTime = expirationTime;
|
12222 | return fiber;
|
12223 | }
|
12224 |
|
12225 | function createFiberFromSuspense(pendingProps, mode, expirationTime, key) {
|
12226 | var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);
|
12227 |
|
12228 |
|
12229 | var type = REACT_SUSPENSE_TYPE;
|
12230 | fiber.elementType = type;
|
12231 | fiber.type = type;
|
12232 |
|
12233 | fiber.expirationTime = expirationTime;
|
12234 | return fiber;
|
12235 | }
|
12236 |
|
12237 | function createFiberFromText(content, mode, expirationTime) {
|
12238 | var fiber = createFiber(HostText, content, null, mode);
|
12239 | fiber.expirationTime = expirationTime;
|
12240 | return fiber;
|
12241 | }
|
12242 |
|
12243 | function createFiberFromHostInstanceForDeletion() {
|
12244 | var fiber = createFiber(HostComponent, null, null, NoContext);
|
12245 |
|
12246 | fiber.elementType = 'DELETED';
|
12247 | fiber.type = 'DELETED';
|
12248 | return fiber;
|
12249 | }
|
12250 |
|
12251 | function createFiberFromPortal(portal, mode, expirationTime) {
|
12252 | var pendingProps = portal.children !== null ? portal.children : [];
|
12253 | var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
|
12254 | fiber.expirationTime = expirationTime;
|
12255 | fiber.stateNode = {
|
12256 | containerInfo: portal.containerInfo,
|
12257 | pendingChildren: null,
|
12258 | implementation: portal.implementation
|
12259 | };
|
12260 | return fiber;
|
12261 | }
|
12262 |
|
12263 |
|
12264 | function assignFiberPropertiesInDEV(target, source) {
|
12265 | if (target === null) {
|
12266 |
|
12267 |
|
12268 | target = createFiber(IndeterminateComponent, null, null, NoContext);
|
12269 | }
|
12270 |
|
12271 |
|
12272 |
|
12273 |
|
12274 |
|
12275 |
|
12276 |
|
12277 | target.tag = source.tag;
|
12278 | target.key = source.key;
|
12279 | target.elementType = source.elementType;
|
12280 | target.type = source.type;
|
12281 | target.stateNode = source.stateNode;
|
12282 | target.return = source.return;
|
12283 | target.child = source.child;
|
12284 | target.sibling = source.sibling;
|
12285 | target.index = source.index;
|
12286 | target.ref = source.ref;
|
12287 | target.pendingProps = source.pendingProps;
|
12288 | target.memoizedProps = source.memoizedProps;
|
12289 | target.updateQueue = source.updateQueue;
|
12290 | target.memoizedState = source.memoizedState;
|
12291 | target.firstContextDependency = source.firstContextDependency;
|
12292 | target.mode = source.mode;
|
12293 | target.effectTag = source.effectTag;
|
12294 | target.nextEffect = source.nextEffect;
|
12295 | target.firstEffect = source.firstEffect;
|
12296 | target.lastEffect = source.lastEffect;
|
12297 | target.expirationTime = source.expirationTime;
|
12298 | target.childExpirationTime = source.childExpirationTime;
|
12299 | target.alternate = source.alternate;
|
12300 | if (enableProfilerTimer) {
|
12301 | target.actualDuration = source.actualDuration;
|
12302 | target.actualStartTime = source.actualStartTime;
|
12303 | target.selfBaseDuration = source.selfBaseDuration;
|
12304 | target.treeBaseDuration = source.treeBaseDuration;
|
12305 | }
|
12306 | target._debugID = source._debugID;
|
12307 | target._debugSource = source._debugSource;
|
12308 | target._debugOwner = source._debugOwner;
|
12309 | target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
|
12310 | return target;
|
12311 | }
|
12312 |
|
12313 |
|
12314 |
|
12315 |
|
12316 |
|
12317 |
|
12318 |
|
12319 |
|
12320 |
|
12321 |
|
12322 |
|
12323 |
|
12324 |
|
12325 |
|
12326 |
|
12327 |
|
12328 |
|
12329 | function createFiberRoot(containerInfo, isConcurrent, hydrate) {
|
12330 |
|
12331 |
|
12332 | var uninitializedFiber = createHostRootFiber(isConcurrent);
|
12333 |
|
12334 | var root = void 0;
|
12335 | if (enableSchedulerTracing) {
|
12336 | root = {
|
12337 | current: uninitializedFiber,
|
12338 | containerInfo: containerInfo,
|
12339 | pendingChildren: null,
|
12340 |
|
12341 | earliestPendingTime: NoWork,
|
12342 | latestPendingTime: NoWork,
|
12343 | earliestSuspendedTime: NoWork,
|
12344 | latestSuspendedTime: NoWork,
|
12345 | latestPingedTime: NoWork,
|
12346 |
|
12347 | pingCache: null,
|
12348 |
|
12349 | didError: false,
|
12350 |
|
12351 | pendingCommitExpirationTime: NoWork,
|
12352 | finishedWork: null,
|
12353 | timeoutHandle: noTimeout,
|
12354 | context: null,
|
12355 | pendingContext: null,
|
12356 | hydrate: hydrate,
|
12357 | nextExpirationTimeToWorkOn: NoWork,
|
12358 | expirationTime: NoWork,
|
12359 | firstBatch: null,
|
12360 | nextScheduledRoot: null,
|
12361 |
|
12362 | interactionThreadID: tracing.unstable_getThreadID(),
|
12363 | memoizedInteractions: new Set(),
|
12364 | pendingInteractionMap: new Map()
|
12365 | };
|
12366 | } else {
|
12367 | root = {
|
12368 | current: uninitializedFiber,
|
12369 | containerInfo: containerInfo,
|
12370 | pendingChildren: null,
|
12371 |
|
12372 | pingCache: null,
|
12373 |
|
12374 | earliestPendingTime: NoWork,
|
12375 | latestPendingTime: NoWork,
|
12376 | earliestSuspendedTime: NoWork,
|
12377 | latestSuspendedTime: NoWork,
|
12378 | latestPingedTime: NoWork,
|
12379 |
|
12380 | didError: false,
|
12381 |
|
12382 | pendingCommitExpirationTime: NoWork,
|
12383 | finishedWork: null,
|
12384 | timeoutHandle: noTimeout,
|
12385 | context: null,
|
12386 | pendingContext: null,
|
12387 | hydrate: hydrate,
|
12388 | nextExpirationTimeToWorkOn: NoWork,
|
12389 | expirationTime: NoWork,
|
12390 | firstBatch: null,
|
12391 | nextScheduledRoot: null
|
12392 | };
|
12393 | }
|
12394 |
|
12395 | uninitializedFiber.stateNode = root;
|
12396 |
|
12397 |
|
12398 |
|
12399 |
|
12400 |
|
12401 | return root;
|
12402 | }
|
12403 |
|
12404 |
|
12405 |
|
12406 |
|
12407 |
|
12408 |
|
12409 |
|
12410 |
|
12411 |
|
12412 |
|
12413 |
|
12414 |
|
12415 |
|
12416 |
|
12417 |
|
12418 | var lowPriorityWarning = function () {};
|
12419 |
|
12420 | {
|
12421 | var printWarning = function (format) {
|
12422 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
12423 | args[_key - 1] = arguments[_key];
|
12424 | }
|
12425 |
|
12426 | var argIndex = 0;
|
12427 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
12428 | return args[argIndex++];
|
12429 | });
|
12430 | if (typeof console !== 'undefined') {
|
12431 | console.warn(message);
|
12432 | }
|
12433 | try {
|
12434 |
|
12435 |
|
12436 |
|
12437 | throw new Error(message);
|
12438 | } catch (x) {}
|
12439 | };
|
12440 |
|
12441 | lowPriorityWarning = function (condition, format) {
|
12442 | if (format === undefined) {
|
12443 | throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
12444 | }
|
12445 | if (!condition) {
|
12446 | for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
12447 | args[_key2 - 2] = arguments[_key2];
|
12448 | }
|
12449 |
|
12450 | printWarning.apply(undefined, [format].concat(args));
|
12451 | }
|
12452 | };
|
12453 | }
|
12454 |
|
12455 | var lowPriorityWarning$1 = lowPriorityWarning;
|
12456 |
|
12457 | var ReactStrictModeWarnings = {
|
12458 | discardPendingWarnings: function () {},
|
12459 | flushPendingDeprecationWarnings: function () {},
|
12460 | flushPendingUnsafeLifecycleWarnings: function () {},
|
12461 | recordDeprecationWarnings: function (fiber, instance) {},
|
12462 | recordUnsafeLifecycleWarnings: function (fiber, instance) {},
|
12463 | recordLegacyContextWarning: function (fiber, instance) {},
|
12464 | flushLegacyContextWarning: function () {}
|
12465 | };
|
12466 |
|
12467 | {
|
12468 | var LIFECYCLE_SUGGESTIONS = {
|
12469 | UNSAFE_componentWillMount: 'componentDidMount',
|
12470 | UNSAFE_componentWillReceiveProps: 'static getDerivedStateFromProps',
|
12471 | UNSAFE_componentWillUpdate: 'componentDidUpdate'
|
12472 | };
|
12473 |
|
12474 | var pendingComponentWillMountWarnings = [];
|
12475 | var pendingComponentWillReceivePropsWarnings = [];
|
12476 | var pendingComponentWillUpdateWarnings = [];
|
12477 | var pendingUnsafeLifecycleWarnings = new Map();
|
12478 | var pendingLegacyContextWarning = new Map();
|
12479 |
|
12480 |
|
12481 | var didWarnAboutDeprecatedLifecycles = new Set();
|
12482 | var didWarnAboutUnsafeLifecycles = new Set();
|
12483 | var didWarnAboutLegacyContext = new Set();
|
12484 |
|
12485 | var setToSortedString = function (set) {
|
12486 | var array = [];
|
12487 | set.forEach(function (value) {
|
12488 | array.push(value);
|
12489 | });
|
12490 | return array.sort().join(', ');
|
12491 | };
|
12492 |
|
12493 | ReactStrictModeWarnings.discardPendingWarnings = function () {
|
12494 | pendingComponentWillMountWarnings = [];
|
12495 | pendingComponentWillReceivePropsWarnings = [];
|
12496 | pendingComponentWillUpdateWarnings = [];
|
12497 | pendingUnsafeLifecycleWarnings = new Map();
|
12498 | pendingLegacyContextWarning = new Map();
|
12499 | };
|
12500 |
|
12501 | ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {
|
12502 | pendingUnsafeLifecycleWarnings.forEach(function (lifecycleWarningsMap, strictRoot) {
|
12503 | var lifecyclesWarningMesages = [];
|
12504 |
|
12505 | Object.keys(lifecycleWarningsMap).forEach(function (lifecycle) {
|
12506 | var lifecycleWarnings = lifecycleWarningsMap[lifecycle];
|
12507 | if (lifecycleWarnings.length > 0) {
|
12508 | var componentNames = new Set();
|
12509 | lifecycleWarnings.forEach(function (fiber) {
|
12510 | componentNames.add(getComponentName(fiber.type) || 'Component');
|
12511 | didWarnAboutUnsafeLifecycles.add(fiber.type);
|
12512 | });
|
12513 |
|
12514 | var formatted = lifecycle.replace('UNSAFE_', '');
|
12515 | var suggestion = LIFECYCLE_SUGGESTIONS[lifecycle];
|
12516 | var sortedComponentNames = setToSortedString(componentNames);
|
12517 |
|
12518 | lifecyclesWarningMesages.push(formatted + ': Please update the following components to use ' + (suggestion + ' instead: ' + sortedComponentNames));
|
12519 | }
|
12520 | });
|
12521 |
|
12522 | if (lifecyclesWarningMesages.length > 0) {
|
12523 | var strictRootComponentStack = getStackByFiberInDevAndProd(strictRoot);
|
12524 |
|
12525 | warningWithoutStack$1(false, 'Unsafe lifecycle methods were found within a strict-mode tree:%s' + '\n\n%s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-strict-mode-warnings', strictRootComponentStack, lifecyclesWarningMesages.join('\n\n'));
|
12526 | }
|
12527 | });
|
12528 |
|
12529 | pendingUnsafeLifecycleWarnings = new Map();
|
12530 | };
|
12531 |
|
12532 | var findStrictRoot = function (fiber) {
|
12533 | var maybeStrictRoot = null;
|
12534 |
|
12535 | var node = fiber;
|
12536 | while (node !== null) {
|
12537 | if (node.mode & StrictMode) {
|
12538 | maybeStrictRoot = node;
|
12539 | }
|
12540 | node = node.return;
|
12541 | }
|
12542 |
|
12543 | return maybeStrictRoot;
|
12544 | };
|
12545 |
|
12546 | ReactStrictModeWarnings.flushPendingDeprecationWarnings = function () {
|
12547 | if (pendingComponentWillMountWarnings.length > 0) {
|
12548 | var uniqueNames = new Set();
|
12549 | pendingComponentWillMountWarnings.forEach(function (fiber) {
|
12550 | uniqueNames.add(getComponentName(fiber.type) || 'Component');
|
12551 | didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
12552 | });
|
12553 |
|
12554 | var sortedNames = setToSortedString(uniqueNames);
|
12555 |
|
12556 | lowPriorityWarning$1(false, 'componentWillMount is deprecated and will be removed in the next major version. ' + 'Use componentDidMount instead. As a temporary workaround, ' + 'you can rename to UNSAFE_componentWillMount.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-async-component-lifecycle-hooks', sortedNames);
|
12557 |
|
12558 | pendingComponentWillMountWarnings = [];
|
12559 | }
|
12560 |
|
12561 | if (pendingComponentWillReceivePropsWarnings.length > 0) {
|
12562 | var _uniqueNames = new Set();
|
12563 | pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {
|
12564 | _uniqueNames.add(getComponentName(fiber.type) || 'Component');
|
12565 | didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
12566 | });
|
12567 |
|
12568 | var _sortedNames = setToSortedString(_uniqueNames);
|
12569 |
|
12570 | lowPriorityWarning$1(false, 'componentWillReceiveProps is deprecated and will be removed in the next major version. ' + 'Use static getDerivedStateFromProps instead.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-async-component-lifecycle-hooks', _sortedNames);
|
12571 |
|
12572 | pendingComponentWillReceivePropsWarnings = [];
|
12573 | }
|
12574 |
|
12575 | if (pendingComponentWillUpdateWarnings.length > 0) {
|
12576 | var _uniqueNames2 = new Set();
|
12577 | pendingComponentWillUpdateWarnings.forEach(function (fiber) {
|
12578 | _uniqueNames2.add(getComponentName(fiber.type) || 'Component');
|
12579 | didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
12580 | });
|
12581 |
|
12582 | var _sortedNames2 = setToSortedString(_uniqueNames2);
|
12583 |
|
12584 | lowPriorityWarning$1(false, 'componentWillUpdate is deprecated and will be removed in the next major version. ' + 'Use componentDidUpdate instead. As a temporary workaround, ' + 'you can rename to UNSAFE_componentWillUpdate.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-async-component-lifecycle-hooks', _sortedNames2);
|
12585 |
|
12586 | pendingComponentWillUpdateWarnings = [];
|
12587 | }
|
12588 | };
|
12589 |
|
12590 | ReactStrictModeWarnings.recordDeprecationWarnings = function (fiber, instance) {
|
12591 |
|
12592 | if (didWarnAboutDeprecatedLifecycles.has(fiber.type)) {
|
12593 | return;
|
12594 | }
|
12595 |
|
12596 |
|
12597 | if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {
|
12598 | pendingComponentWillMountWarnings.push(fiber);
|
12599 | }
|
12600 | if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
|
12601 | pendingComponentWillReceivePropsWarnings.push(fiber);
|
12602 | }
|
12603 | if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
|
12604 | pendingComponentWillUpdateWarnings.push(fiber);
|
12605 | }
|
12606 | };
|
12607 |
|
12608 | ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {
|
12609 | var strictRoot = findStrictRoot(fiber);
|
12610 | if (strictRoot === null) {
|
12611 | warningWithoutStack$1(false, 'Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');
|
12612 | return;
|
12613 | }
|
12614 |
|
12615 |
|
12616 |
|
12617 |
|
12618 |
|
12619 |
|
12620 | if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
|
12621 | return;
|
12622 | }
|
12623 |
|
12624 | var warningsForRoot = void 0;
|
12625 | if (!pendingUnsafeLifecycleWarnings.has(strictRoot)) {
|
12626 | warningsForRoot = {
|
12627 | UNSAFE_componentWillMount: [],
|
12628 | UNSAFE_componentWillReceiveProps: [],
|
12629 | UNSAFE_componentWillUpdate: []
|
12630 | };
|
12631 |
|
12632 | pendingUnsafeLifecycleWarnings.set(strictRoot, warningsForRoot);
|
12633 | } else {
|
12634 | warningsForRoot = pendingUnsafeLifecycleWarnings.get(strictRoot);
|
12635 | }
|
12636 |
|
12637 | var unsafeLifecycles = [];
|
12638 | if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true || typeof instance.UNSAFE_componentWillMount === 'function') {
|
12639 | unsafeLifecycles.push('UNSAFE_componentWillMount');
|
12640 | }
|
12641 | if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true || typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
|
12642 | unsafeLifecycles.push('UNSAFE_componentWillReceiveProps');
|
12643 | }
|
12644 | if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true || typeof instance.UNSAFE_componentWillUpdate === 'function') {
|
12645 | unsafeLifecycles.push('UNSAFE_componentWillUpdate');
|
12646 | }
|
12647 |
|
12648 | if (unsafeLifecycles.length > 0) {
|
12649 | unsafeLifecycles.forEach(function (lifecycle) {
|
12650 | warningsForRoot[lifecycle].push(fiber);
|
12651 | });
|
12652 | }
|
12653 | };
|
12654 |
|
12655 | ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {
|
12656 | var strictRoot = findStrictRoot(fiber);
|
12657 | if (strictRoot === null) {
|
12658 | warningWithoutStack$1(false, 'Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');
|
12659 | return;
|
12660 | }
|
12661 |
|
12662 |
|
12663 | if (didWarnAboutLegacyContext.has(fiber.type)) {
|
12664 | return;
|
12665 | }
|
12666 |
|
12667 | var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
|
12668 |
|
12669 | if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {
|
12670 | if (warningsForRoot === undefined) {
|
12671 | warningsForRoot = [];
|
12672 | pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
|
12673 | }
|
12674 | warningsForRoot.push(fiber);
|
12675 | }
|
12676 | };
|
12677 |
|
12678 | ReactStrictModeWarnings.flushLegacyContextWarning = function () {
|
12679 | pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {
|
12680 | var uniqueNames = new Set();
|
12681 | fiberArray.forEach(function (fiber) {
|
12682 | uniqueNames.add(getComponentName(fiber.type) || 'Component');
|
12683 | didWarnAboutLegacyContext.add(fiber.type);
|
12684 | });
|
12685 |
|
12686 | var sortedNames = setToSortedString(uniqueNames);
|
12687 | var strictRootComponentStack = getStackByFiberInDevAndProd(strictRoot);
|
12688 |
|
12689 | warningWithoutStack$1(false, 'Legacy context API has been detected within a strict-mode tree: %s' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-strict-mode-warnings', strictRootComponentStack, sortedNames);
|
12690 | });
|
12691 | };
|
12692 | }
|
12693 |
|
12694 |
|
12695 |
|
12696 |
|
12697 |
|
12698 | var ReactFiberInstrumentation = {
|
12699 | debugTool: null
|
12700 | };
|
12701 |
|
12702 | var ReactFiberInstrumentation_1 = ReactFiberInstrumentation;
|
12703 |
|
12704 |
|
12705 |
|
12706 |
|
12707 |
|
12708 | function markPendingPriorityLevel(root, expirationTime) {
|
12709 |
|
12710 |
|
12711 |
|
12712 | root.didError = false;
|
12713 |
|
12714 |
|
12715 | var earliestPendingTime = root.earliestPendingTime;
|
12716 | if (earliestPendingTime === NoWork) {
|
12717 |
|
12718 | root.earliestPendingTime = root.latestPendingTime = expirationTime;
|
12719 | } else {
|
12720 | if (earliestPendingTime < expirationTime) {
|
12721 |
|
12722 | root.earliestPendingTime = expirationTime;
|
12723 | } else {
|
12724 | var latestPendingTime = root.latestPendingTime;
|
12725 | if (latestPendingTime > expirationTime) {
|
12726 |
|
12727 | root.latestPendingTime = expirationTime;
|
12728 | }
|
12729 | }
|
12730 | }
|
12731 | findNextExpirationTimeToWorkOn(expirationTime, root);
|
12732 | }
|
12733 |
|
12734 | function markCommittedPriorityLevels(root, earliestRemainingTime) {
|
12735 | root.didError = false;
|
12736 |
|
12737 | if (earliestRemainingTime === NoWork) {
|
12738 |
|
12739 | root.earliestPendingTime = NoWork;
|
12740 | root.latestPendingTime = NoWork;
|
12741 | root.earliestSuspendedTime = NoWork;
|
12742 | root.latestSuspendedTime = NoWork;
|
12743 | root.latestPingedTime = NoWork;
|
12744 | findNextExpirationTimeToWorkOn(NoWork, root);
|
12745 | return;
|
12746 | }
|
12747 |
|
12748 | if (earliestRemainingTime < root.latestPingedTime) {
|
12749 | root.latestPingedTime = NoWork;
|
12750 | }
|
12751 |
|
12752 |
|
12753 | var latestPendingTime = root.latestPendingTime;
|
12754 | if (latestPendingTime !== NoWork) {
|
12755 | if (latestPendingTime > earliestRemainingTime) {
|
12756 |
|
12757 | root.earliestPendingTime = root.latestPendingTime = NoWork;
|
12758 | } else {
|
12759 | var earliestPendingTime = root.earliestPendingTime;
|
12760 | if (earliestPendingTime > earliestRemainingTime) {
|
12761 |
|
12762 |
|
12763 | root.earliestPendingTime = root.latestPendingTime;
|
12764 | }
|
12765 | }
|
12766 | }
|
12767 |
|
12768 |
|
12769 |
|
12770 |
|
12771 |
|
12772 | var earliestSuspendedTime = root.earliestSuspendedTime;
|
12773 | if (earliestSuspendedTime === NoWork) {
|
12774 |
|
12775 |
|
12776 | markPendingPriorityLevel(root, earliestRemainingTime);
|
12777 | findNextExpirationTimeToWorkOn(NoWork, root);
|
12778 | return;
|
12779 | }
|
12780 |
|
12781 | var latestSuspendedTime = root.latestSuspendedTime;
|
12782 | if (earliestRemainingTime < latestSuspendedTime) {
|
12783 |
|
12784 |
|
12785 | root.earliestSuspendedTime = NoWork;
|
12786 | root.latestSuspendedTime = NoWork;
|
12787 | root.latestPingedTime = NoWork;
|
12788 |
|
12789 |
|
12790 |
|
12791 | markPendingPriorityLevel(root, earliestRemainingTime);
|
12792 | findNextExpirationTimeToWorkOn(NoWork, root);
|
12793 | return;
|
12794 | }
|
12795 |
|
12796 | if (earliestRemainingTime > earliestSuspendedTime) {
|
12797 |
|
12798 |
|
12799 | markPendingPriorityLevel(root, earliestRemainingTime);
|
12800 | findNextExpirationTimeToWorkOn(NoWork, root);
|
12801 | return;
|
12802 | }
|
12803 |
|
12804 |
|
12805 |
|
12806 | findNextExpirationTimeToWorkOn(NoWork, root);
|
12807 | }
|
12808 |
|
12809 | function hasLowerPriorityWork(root, erroredExpirationTime) {
|
12810 | var latestPendingTime = root.latestPendingTime;
|
12811 | var latestSuspendedTime = root.latestSuspendedTime;
|
12812 | var latestPingedTime = root.latestPingedTime;
|
12813 | return latestPendingTime !== NoWork && latestPendingTime < erroredExpirationTime || latestSuspendedTime !== NoWork && latestSuspendedTime < erroredExpirationTime || latestPingedTime !== NoWork && latestPingedTime < erroredExpirationTime;
|
12814 | }
|
12815 |
|
12816 | function isPriorityLevelSuspended(root, expirationTime) {
|
12817 | var earliestSuspendedTime = root.earliestSuspendedTime;
|
12818 | var latestSuspendedTime = root.latestSuspendedTime;
|
12819 | return earliestSuspendedTime !== NoWork && expirationTime <= earliestSuspendedTime && expirationTime >= latestSuspendedTime;
|
12820 | }
|
12821 |
|
12822 | function markSuspendedPriorityLevel(root, suspendedTime) {
|
12823 | root.didError = false;
|
12824 | clearPing(root, suspendedTime);
|
12825 |
|
12826 |
|
12827 | var earliestPendingTime = root.earliestPendingTime;
|
12828 | var latestPendingTime = root.latestPendingTime;
|
12829 | if (earliestPendingTime === suspendedTime) {
|
12830 | if (latestPendingTime === suspendedTime) {
|
12831 |
|
12832 | root.earliestPendingTime = root.latestPendingTime = NoWork;
|
12833 | } else {
|
12834 |
|
12835 |
|
12836 | root.earliestPendingTime = latestPendingTime;
|
12837 | }
|
12838 | } else if (latestPendingTime === suspendedTime) {
|
12839 |
|
12840 |
|
12841 | root.latestPendingTime = earliestPendingTime;
|
12842 | }
|
12843 |
|
12844 |
|
12845 | var earliestSuspendedTime = root.earliestSuspendedTime;
|
12846 | var latestSuspendedTime = root.latestSuspendedTime;
|
12847 | if (earliestSuspendedTime === NoWork) {
|
12848 |
|
12849 | root.earliestSuspendedTime = root.latestSuspendedTime = suspendedTime;
|
12850 | } else {
|
12851 | if (earliestSuspendedTime < suspendedTime) {
|
12852 |
|
12853 | root.earliestSuspendedTime = suspendedTime;
|
12854 | } else if (latestSuspendedTime > suspendedTime) {
|
12855 |
|
12856 | root.latestSuspendedTime = suspendedTime;
|
12857 | }
|
12858 | }
|
12859 |
|
12860 | findNextExpirationTimeToWorkOn(suspendedTime, root);
|
12861 | }
|
12862 |
|
12863 | function markPingedPriorityLevel(root, pingedTime) {
|
12864 | root.didError = false;
|
12865 |
|
12866 |
|
12867 |
|
12868 |
|
12869 | var latestPingedTime = root.latestPingedTime;
|
12870 | if (latestPingedTime === NoWork || latestPingedTime > pingedTime) {
|
12871 | root.latestPingedTime = pingedTime;
|
12872 | }
|
12873 | findNextExpirationTimeToWorkOn(pingedTime, root);
|
12874 | }
|
12875 |
|
12876 | function clearPing(root, completedTime) {
|
12877 | var latestPingedTime = root.latestPingedTime;
|
12878 | if (latestPingedTime >= completedTime) {
|
12879 | root.latestPingedTime = NoWork;
|
12880 | }
|
12881 | }
|
12882 |
|
12883 | function findEarliestOutstandingPriorityLevel(root, renderExpirationTime) {
|
12884 | var earliestExpirationTime = renderExpirationTime;
|
12885 |
|
12886 | var earliestPendingTime = root.earliestPendingTime;
|
12887 | var earliestSuspendedTime = root.earliestSuspendedTime;
|
12888 | if (earliestPendingTime > earliestExpirationTime) {
|
12889 | earliestExpirationTime = earliestPendingTime;
|
12890 | }
|
12891 | if (earliestSuspendedTime > earliestExpirationTime) {
|
12892 | earliestExpirationTime = earliestSuspendedTime;
|
12893 | }
|
12894 | return earliestExpirationTime;
|
12895 | }
|
12896 |
|
12897 | function didExpireAtExpirationTime(root, currentTime) {
|
12898 | var expirationTime = root.expirationTime;
|
12899 | if (expirationTime !== NoWork && currentTime <= expirationTime) {
|
12900 |
|
12901 | root.nextExpirationTimeToWorkOn = currentTime;
|
12902 | }
|
12903 | }
|
12904 |
|
12905 | function findNextExpirationTimeToWorkOn(completedExpirationTime, root) {
|
12906 | var earliestSuspendedTime = root.earliestSuspendedTime;
|
12907 | var latestSuspendedTime = root.latestSuspendedTime;
|
12908 | var earliestPendingTime = root.earliestPendingTime;
|
12909 | var latestPingedTime = root.latestPingedTime;
|
12910 |
|
12911 |
|
12912 |
|
12913 | var nextExpirationTimeToWorkOn = earliestPendingTime !== NoWork ? earliestPendingTime : latestPingedTime;
|
12914 |
|
12915 |
|
12916 |
|
12917 | if (nextExpirationTimeToWorkOn === NoWork && (completedExpirationTime === NoWork || latestSuspendedTime < completedExpirationTime)) {
|
12918 |
|
12919 |
|
12920 |
|
12921 | nextExpirationTimeToWorkOn = latestSuspendedTime;
|
12922 | }
|
12923 |
|
12924 | var expirationTime = nextExpirationTimeToWorkOn;
|
12925 | if (expirationTime !== NoWork && earliestSuspendedTime > expirationTime) {
|
12926 |
|
12927 | expirationTime = earliestSuspendedTime;
|
12928 | }
|
12929 |
|
12930 | root.nextExpirationTimeToWorkOn = nextExpirationTimeToWorkOn;
|
12931 | root.expirationTime = expirationTime;
|
12932 | }
|
12933 |
|
12934 |
|
12935 |
|
12936 |
|
12937 |
|
12938 |
|
12939 |
|
12940 |
|
12941 |
|
12942 |
|
12943 |
|
12944 |
|
12945 |
|
12946 |
|
12947 |
|
12948 |
|
12949 |
|
12950 |
|
12951 |
|
12952 |
|
12953 |
|
12954 |
|
12955 |
|
12956 |
|
12957 |
|
12958 |
|
12959 |
|
12960 |
|
12961 |
|
12962 |
|
12963 |
|
12964 |
|
12965 |
|
12966 |
|
12967 |
|
12968 |
|
12969 |
|
12970 |
|
12971 |
|
12972 |
|
12973 |
|
12974 |
|
12975 |
|
12976 |
|
12977 |
|
12978 |
|
12979 |
|
12980 |
|
12981 |
|
12982 |
|
12983 |
|
12984 |
|
12985 |
|
12986 |
|
12987 |
|
12988 |
|
12989 |
|
12990 |
|
12991 |
|
12992 |
|
12993 |
|
12994 |
|
12995 |
|
12996 |
|
12997 |
|
12998 |
|
12999 |
|
13000 |
|
13001 |
|
13002 |
|
13003 |
|
13004 |
|
13005 |
|
13006 |
|
13007 |
|
13008 |
|
13009 |
|
13010 |
|
13011 | var UpdateState = 0;
|
13012 | var ReplaceState = 1;
|
13013 | var ForceUpdate = 2;
|
13014 | var CaptureUpdate = 3;
|
13015 |
|
13016 |
|
13017 |
|
13018 |
|
13019 | var hasForceUpdate = false;
|
13020 |
|
13021 | var didWarnUpdateInsideUpdate = void 0;
|
13022 | var currentlyProcessingQueue = void 0;
|
13023 | var resetCurrentlyProcessingQueue = void 0;
|
13024 | {
|
13025 | didWarnUpdateInsideUpdate = false;
|
13026 | currentlyProcessingQueue = null;
|
13027 | resetCurrentlyProcessingQueue = function () {
|
13028 | currentlyProcessingQueue = null;
|
13029 | };
|
13030 | }
|
13031 |
|
13032 | function createUpdateQueue(baseState) {
|
13033 | var queue = {
|
13034 | baseState: baseState,
|
13035 | firstUpdate: null,
|
13036 | lastUpdate: null,
|
13037 | firstCapturedUpdate: null,
|
13038 | lastCapturedUpdate: null,
|
13039 | firstEffect: null,
|
13040 | lastEffect: null,
|
13041 | firstCapturedEffect: null,
|
13042 | lastCapturedEffect: null
|
13043 | };
|
13044 | return queue;
|
13045 | }
|
13046 |
|
13047 | function cloneUpdateQueue(currentQueue) {
|
13048 | var queue = {
|
13049 | baseState: currentQueue.baseState,
|
13050 | firstUpdate: currentQueue.firstUpdate,
|
13051 | lastUpdate: currentQueue.lastUpdate,
|
13052 |
|
13053 |
|
13054 |
|
13055 | firstCapturedUpdate: null,
|
13056 | lastCapturedUpdate: null,
|
13057 |
|
13058 | firstEffect: null,
|
13059 | lastEffect: null,
|
13060 |
|
13061 | firstCapturedEffect: null,
|
13062 | lastCapturedEffect: null
|
13063 | };
|
13064 | return queue;
|
13065 | }
|
13066 |
|
13067 | function createUpdate(expirationTime) {
|
13068 | return {
|
13069 | expirationTime: expirationTime,
|
13070 |
|
13071 | tag: UpdateState,
|
13072 | payload: null,
|
13073 | callback: null,
|
13074 |
|
13075 | next: null,
|
13076 | nextEffect: null
|
13077 | };
|
13078 | }
|
13079 |
|
13080 | function appendUpdateToQueue(queue, update) {
|
13081 |
|
13082 | if (queue.lastUpdate === null) {
|
13083 |
|
13084 | queue.firstUpdate = queue.lastUpdate = update;
|
13085 | } else {
|
13086 | queue.lastUpdate.next = update;
|
13087 | queue.lastUpdate = update;
|
13088 | }
|
13089 | }
|
13090 |
|
13091 | function enqueueUpdate(fiber, update) {
|
13092 |
|
13093 | var alternate = fiber.alternate;
|
13094 | var queue1 = void 0;
|
13095 | var queue2 = void 0;
|
13096 | if (alternate === null) {
|
13097 |
|
13098 | queue1 = fiber.updateQueue;
|
13099 | queue2 = null;
|
13100 | if (queue1 === null) {
|
13101 | queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState);
|
13102 | }
|
13103 | } else {
|
13104 |
|
13105 | queue1 = fiber.updateQueue;
|
13106 | queue2 = alternate.updateQueue;
|
13107 | if (queue1 === null) {
|
13108 | if (queue2 === null) {
|
13109 |
|
13110 | queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState);
|
13111 | queue2 = alternate.updateQueue = createUpdateQueue(alternate.memoizedState);
|
13112 | } else {
|
13113 |
|
13114 | queue1 = fiber.updateQueue = cloneUpdateQueue(queue2);
|
13115 | }
|
13116 | } else {
|
13117 | if (queue2 === null) {
|
13118 |
|
13119 | queue2 = alternate.updateQueue = cloneUpdateQueue(queue1);
|
13120 | } else {
|
13121 |
|
13122 | }
|
13123 | }
|
13124 | }
|
13125 | if (queue2 === null || queue1 === queue2) {
|
13126 |
|
13127 | appendUpdateToQueue(queue1, update);
|
13128 | } else {
|
13129 |
|
13130 |
|
13131 |
|
13132 | if (queue1.lastUpdate === null || queue2.lastUpdate === null) {
|
13133 |
|
13134 | appendUpdateToQueue(queue1, update);
|
13135 | appendUpdateToQueue(queue2, update);
|
13136 | } else {
|
13137 |
|
13138 |
|
13139 | appendUpdateToQueue(queue1, update);
|
13140 |
|
13141 | queue2.lastUpdate = update;
|
13142 | }
|
13143 | }
|
13144 |
|
13145 | {
|
13146 | if (fiber.tag === ClassComponent && (currentlyProcessingQueue === queue1 || queue2 !== null && currentlyProcessingQueue === queue2) && !didWarnUpdateInsideUpdate) {
|
13147 | warningWithoutStack$1(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');
|
13148 | didWarnUpdateInsideUpdate = true;
|
13149 | }
|
13150 | }
|
13151 | }
|
13152 |
|
13153 | function enqueueCapturedUpdate(workInProgress, update) {
|
13154 |
|
13155 |
|
13156 | var workInProgressQueue = workInProgress.updateQueue;
|
13157 | if (workInProgressQueue === null) {
|
13158 | workInProgressQueue = workInProgress.updateQueue = createUpdateQueue(workInProgress.memoizedState);
|
13159 | } else {
|
13160 |
|
13161 |
|
13162 |
|
13163 | workInProgressQueue = ensureWorkInProgressQueueIsAClone(workInProgress, workInProgressQueue);
|
13164 | }
|
13165 |
|
13166 |
|
13167 | if (workInProgressQueue.lastCapturedUpdate === null) {
|
13168 |
|
13169 | workInProgressQueue.firstCapturedUpdate = workInProgressQueue.lastCapturedUpdate = update;
|
13170 | } else {
|
13171 | workInProgressQueue.lastCapturedUpdate.next = update;
|
13172 | workInProgressQueue.lastCapturedUpdate = update;
|
13173 | }
|
13174 | }
|
13175 |
|
13176 | function ensureWorkInProgressQueueIsAClone(workInProgress, queue) {
|
13177 | var current = workInProgress.alternate;
|
13178 | if (current !== null) {
|
13179 |
|
13180 |
|
13181 | if (queue === current.updateQueue) {
|
13182 | queue = workInProgress.updateQueue = cloneUpdateQueue(queue);
|
13183 | }
|
13184 | }
|
13185 | return queue;
|
13186 | }
|
13187 |
|
13188 | function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {
|
13189 | switch (update.tag) {
|
13190 | case ReplaceState:
|
13191 | {
|
13192 | var _payload = update.payload;
|
13193 | if (typeof _payload === 'function') {
|
13194 |
|
13195 | {
|
13196 | if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
|
13197 | _payload.call(instance, prevState, nextProps);
|
13198 | }
|
13199 | }
|
13200 | return _payload.call(instance, prevState, nextProps);
|
13201 | }
|
13202 |
|
13203 | return _payload;
|
13204 | }
|
13205 | case CaptureUpdate:
|
13206 | {
|
13207 | workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture;
|
13208 | }
|
13209 |
|
13210 | case UpdateState:
|
13211 | {
|
13212 | var _payload2 = update.payload;
|
13213 | var partialState = void 0;
|
13214 | if (typeof _payload2 === 'function') {
|
13215 |
|
13216 | {
|
13217 | if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
|
13218 | _payload2.call(instance, prevState, nextProps);
|
13219 | }
|
13220 | }
|
13221 | partialState = _payload2.call(instance, prevState, nextProps);
|
13222 | } else {
|
13223 |
|
13224 | partialState = _payload2;
|
13225 | }
|
13226 | if (partialState === null || partialState === undefined) {
|
13227 |
|
13228 | return prevState;
|
13229 | }
|
13230 |
|
13231 | return _assign({}, prevState, partialState);
|
13232 | }
|
13233 | case ForceUpdate:
|
13234 | {
|
13235 | hasForceUpdate = true;
|
13236 | return prevState;
|
13237 | }
|
13238 | }
|
13239 | return prevState;
|
13240 | }
|
13241 |
|
13242 | function processUpdateQueue(workInProgress, queue, props, instance, renderExpirationTime) {
|
13243 | hasForceUpdate = false;
|
13244 |
|
13245 | queue = ensureWorkInProgressQueueIsAClone(workInProgress, queue);
|
13246 |
|
13247 | {
|
13248 | currentlyProcessingQueue = queue;
|
13249 | }
|
13250 |
|
13251 |
|
13252 | var newBaseState = queue.baseState;
|
13253 | var newFirstUpdate = null;
|
13254 | var newExpirationTime = NoWork;
|
13255 |
|
13256 |
|
13257 | var update = queue.firstUpdate;
|
13258 | var resultState = newBaseState;
|
13259 | while (update !== null) {
|
13260 | var updateExpirationTime = update.expirationTime;
|
13261 | if (updateExpirationTime < renderExpirationTime) {
|
13262 |
|
13263 | if (newFirstUpdate === null) {
|
13264 |
|
13265 |
|
13266 | newFirstUpdate = update;
|
13267 |
|
13268 |
|
13269 | newBaseState = resultState;
|
13270 | }
|
13271 |
|
13272 |
|
13273 | if (newExpirationTime < updateExpirationTime) {
|
13274 | newExpirationTime = updateExpirationTime;
|
13275 | }
|
13276 | } else {
|
13277 |
|
13278 |
|
13279 | resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance);
|
13280 | var _callback = update.callback;
|
13281 | if (_callback !== null) {
|
13282 | workInProgress.effectTag |= Callback;
|
13283 |
|
13284 | update.nextEffect = null;
|
13285 | if (queue.lastEffect === null) {
|
13286 | queue.firstEffect = queue.lastEffect = update;
|
13287 | } else {
|
13288 | queue.lastEffect.nextEffect = update;
|
13289 | queue.lastEffect = update;
|
13290 | }
|
13291 | }
|
13292 | }
|
13293 |
|
13294 | update = update.next;
|
13295 | }
|
13296 |
|
13297 |
|
13298 | var newFirstCapturedUpdate = null;
|
13299 | update = queue.firstCapturedUpdate;
|
13300 | while (update !== null) {
|
13301 | var _updateExpirationTime = update.expirationTime;
|
13302 | if (_updateExpirationTime < renderExpirationTime) {
|
13303 |
|
13304 | if (newFirstCapturedUpdate === null) {
|
13305 |
|
13306 |
|
13307 | newFirstCapturedUpdate = update;
|
13308 |
|
13309 |
|
13310 | if (newFirstUpdate === null) {
|
13311 | newBaseState = resultState;
|
13312 | }
|
13313 | }
|
13314 |
|
13315 |
|
13316 | if (newExpirationTime < _updateExpirationTime) {
|
13317 | newExpirationTime = _updateExpirationTime;
|
13318 | }
|
13319 | } else {
|
13320 |
|
13321 |
|
13322 | resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance);
|
13323 | var _callback2 = update.callback;
|
13324 | if (_callback2 !== null) {
|
13325 | workInProgress.effectTag |= Callback;
|
13326 |
|
13327 | update.nextEffect = null;
|
13328 | if (queue.lastCapturedEffect === null) {
|
13329 | queue.firstCapturedEffect = queue.lastCapturedEffect = update;
|
13330 | } else {
|
13331 | queue.lastCapturedEffect.nextEffect = update;
|
13332 | queue.lastCapturedEffect = update;
|
13333 | }
|
13334 | }
|
13335 | }
|
13336 | update = update.next;
|
13337 | }
|
13338 |
|
13339 | if (newFirstUpdate === null) {
|
13340 | queue.lastUpdate = null;
|
13341 | }
|
13342 | if (newFirstCapturedUpdate === null) {
|
13343 | queue.lastCapturedUpdate = null;
|
13344 | } else {
|
13345 | workInProgress.effectTag |= Callback;
|
13346 | }
|
13347 | if (newFirstUpdate === null && newFirstCapturedUpdate === null) {
|
13348 |
|
13349 |
|
13350 | newBaseState = resultState;
|
13351 | }
|
13352 |
|
13353 | queue.baseState = newBaseState;
|
13354 | queue.firstUpdate = newFirstUpdate;
|
13355 | queue.firstCapturedUpdate = newFirstCapturedUpdate;
|
13356 |
|
13357 |
|
13358 |
|
13359 |
|
13360 |
|
13361 |
|
13362 |
|
13363 |
|
13364 | workInProgress.expirationTime = newExpirationTime;
|
13365 | workInProgress.memoizedState = resultState;
|
13366 |
|
13367 | {
|
13368 | currentlyProcessingQueue = null;
|
13369 | }
|
13370 | }
|
13371 |
|
13372 | function callCallback(callback, context) {
|
13373 | !(typeof callback === 'function') ? invariant(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', callback) : void 0;
|
13374 | callback.call(context);
|
13375 | }
|
13376 |
|
13377 | function resetHasForceUpdateBeforeProcessing() {
|
13378 | hasForceUpdate = false;
|
13379 | }
|
13380 |
|
13381 | function checkHasForceUpdateAfterProcessing() {
|
13382 | return hasForceUpdate;
|
13383 | }
|
13384 |
|
13385 | function commitUpdateQueue(finishedWork, finishedQueue, instance, renderExpirationTime) {
|
13386 |
|
13387 |
|
13388 |
|
13389 |
|
13390 | if (finishedQueue.firstCapturedUpdate !== null) {
|
13391 |
|
13392 | if (finishedQueue.lastUpdate !== null) {
|
13393 | finishedQueue.lastUpdate.next = finishedQueue.firstCapturedUpdate;
|
13394 | finishedQueue.lastUpdate = finishedQueue.lastCapturedUpdate;
|
13395 | }
|
13396 |
|
13397 | finishedQueue.firstCapturedUpdate = finishedQueue.lastCapturedUpdate = null;
|
13398 | }
|
13399 |
|
13400 |
|
13401 | commitUpdateEffects(finishedQueue.firstEffect, instance);
|
13402 | finishedQueue.firstEffect = finishedQueue.lastEffect = null;
|
13403 |
|
13404 | commitUpdateEffects(finishedQueue.firstCapturedEffect, instance);
|
13405 | finishedQueue.firstCapturedEffect = finishedQueue.lastCapturedEffect = null;
|
13406 | }
|
13407 |
|
13408 | function commitUpdateEffects(effect, instance) {
|
13409 | while (effect !== null) {
|
13410 | var _callback3 = effect.callback;
|
13411 | if (_callback3 !== null) {
|
13412 | effect.callback = null;
|
13413 | callCallback(_callback3, instance);
|
13414 | }
|
13415 | effect = effect.nextEffect;
|
13416 | }
|
13417 | }
|
13418 |
|
13419 | function createCapturedValue(value, source) {
|
13420 |
|
13421 |
|
13422 | return {
|
13423 | value: value,
|
13424 | source: source,
|
13425 | stack: getStackByFiberInDevAndProd(source)
|
13426 | };
|
13427 | }
|
13428 |
|
13429 | var valueCursor = createCursor(null);
|
13430 |
|
13431 | var rendererSigil = void 0;
|
13432 | {
|
13433 |
|
13434 | rendererSigil = {};
|
13435 | }
|
13436 |
|
13437 | var currentlyRenderingFiber = null;
|
13438 | var lastContextDependency = null;
|
13439 | var lastContextWithAllBitsObserved = null;
|
13440 |
|
13441 | function resetContextDependences() {
|
13442 |
|
13443 |
|
13444 | currentlyRenderingFiber = null;
|
13445 | lastContextDependency = null;
|
13446 | lastContextWithAllBitsObserved = null;
|
13447 | }
|
13448 |
|
13449 | function pushProvider(providerFiber, nextValue) {
|
13450 | var context = providerFiber.type._context;
|
13451 |
|
13452 | if (isPrimaryRenderer) {
|
13453 | push(valueCursor, context._currentValue, providerFiber);
|
13454 |
|
13455 | context._currentValue = nextValue;
|
13456 | {
|
13457 | !(context._currentRenderer === undefined || context._currentRenderer === null || context._currentRenderer === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0;
|
13458 | context._currentRenderer = rendererSigil;
|
13459 | }
|
13460 | } else {
|
13461 | push(valueCursor, context._currentValue2, providerFiber);
|
13462 |
|
13463 | context._currentValue2 = nextValue;
|
13464 | {
|
13465 | !(context._currentRenderer2 === undefined || context._currentRenderer2 === null || context._currentRenderer2 === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0;
|
13466 | context._currentRenderer2 = rendererSigil;
|
13467 | }
|
13468 | }
|
13469 | }
|
13470 |
|
13471 | function popProvider(providerFiber) {
|
13472 | var currentValue = valueCursor.current;
|
13473 |
|
13474 | pop(valueCursor, providerFiber);
|
13475 |
|
13476 | var context = providerFiber.type._context;
|
13477 | if (isPrimaryRenderer) {
|
13478 | context._currentValue = currentValue;
|
13479 | } else {
|
13480 | context._currentValue2 = currentValue;
|
13481 | }
|
13482 | }
|
13483 |
|
13484 | function calculateChangedBits(context, newValue, oldValue) {
|
13485 |
|
13486 |
|
13487 |
|
13488 | if (oldValue === newValue && (oldValue !== 0 || 1 / oldValue === 1 / newValue) || oldValue !== oldValue && newValue !== newValue
|
13489 | ) {
|
13490 |
|
13491 | return 0;
|
13492 | } else {
|
13493 | var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : maxSigned31BitInt;
|
13494 |
|
13495 | {
|
13496 | !((changedBits & maxSigned31BitInt) === changedBits) ? warning$1(false, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits) : void 0;
|
13497 | }
|
13498 | return changedBits | 0;
|
13499 | }
|
13500 | }
|
13501 |
|
13502 | function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {
|
13503 | var fiber = workInProgress.child;
|
13504 | if (fiber !== null) {
|
13505 |
|
13506 | fiber.return = workInProgress;
|
13507 | }
|
13508 | while (fiber !== null) {
|
13509 | var nextFiber = void 0;
|
13510 |
|
13511 |
|
13512 | var dependency = fiber.firstContextDependency;
|
13513 | if (dependency !== null) {
|
13514 | do {
|
13515 |
|
13516 | if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {
|
13517 |
|
13518 |
|
13519 | if (fiber.tag === ClassComponent) {
|
13520 |
|
13521 | var update = createUpdate(renderExpirationTime);
|
13522 | update.tag = ForceUpdate;
|
13523 |
|
13524 |
|
13525 |
|
13526 |
|
13527 | enqueueUpdate(fiber, update);
|
13528 | }
|
13529 |
|
13530 | if (fiber.expirationTime < renderExpirationTime) {
|
13531 | fiber.expirationTime = renderExpirationTime;
|
13532 | }
|
13533 | var alternate = fiber.alternate;
|
13534 | if (alternate !== null && alternate.expirationTime < renderExpirationTime) {
|
13535 | alternate.expirationTime = renderExpirationTime;
|
13536 | }
|
13537 |
|
13538 |
|
13539 | var node = fiber.return;
|
13540 | while (node !== null) {
|
13541 | alternate = node.alternate;
|
13542 | if (node.childExpirationTime < renderExpirationTime) {
|
13543 | node.childExpirationTime = renderExpirationTime;
|
13544 | if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
|
13545 | alternate.childExpirationTime = renderExpirationTime;
|
13546 | }
|
13547 | } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
|
13548 | alternate.childExpirationTime = renderExpirationTime;
|
13549 | } else {
|
13550 |
|
13551 |
|
13552 | break;
|
13553 | }
|
13554 | node = node.return;
|
13555 | }
|
13556 | }
|
13557 | nextFiber = fiber.child;
|
13558 | dependency = dependency.next;
|
13559 | } while (dependency !== null);
|
13560 | } else if (fiber.tag === ContextProvider) {
|
13561 |
|
13562 | nextFiber = fiber.type === workInProgress.type ? null : fiber.child;
|
13563 | } else {
|
13564 |
|
13565 | nextFiber = fiber.child;
|
13566 | }
|
13567 |
|
13568 | if (nextFiber !== null) {
|
13569 |
|
13570 | nextFiber.return = fiber;
|
13571 | } else {
|
13572 |
|
13573 | nextFiber = fiber;
|
13574 | while (nextFiber !== null) {
|
13575 | if (nextFiber === workInProgress) {
|
13576 |
|
13577 | nextFiber = null;
|
13578 | break;
|
13579 | }
|
13580 | var sibling = nextFiber.sibling;
|
13581 | if (sibling !== null) {
|
13582 |
|
13583 | sibling.return = nextFiber.return;
|
13584 | nextFiber = sibling;
|
13585 | break;
|
13586 | }
|
13587 |
|
13588 | nextFiber = nextFiber.return;
|
13589 | }
|
13590 | }
|
13591 | fiber = nextFiber;
|
13592 | }
|
13593 | }
|
13594 |
|
13595 | function prepareToReadContext(workInProgress, renderExpirationTime) {
|
13596 | currentlyRenderingFiber = workInProgress;
|
13597 | lastContextDependency = null;
|
13598 | lastContextWithAllBitsObserved = null;
|
13599 |
|
13600 |
|
13601 | workInProgress.firstContextDependency = null;
|
13602 | }
|
13603 |
|
13604 | function readContext(context, observedBits) {
|
13605 | if (lastContextWithAllBitsObserved === context) {
|
13606 |
|
13607 | } else if (observedBits === false || observedBits === 0) {
|
13608 |
|
13609 | } else {
|
13610 | var resolvedObservedBits = void 0;
|
13611 | if (typeof observedBits !== 'number' || observedBits === maxSigned31BitInt) {
|
13612 |
|
13613 | lastContextWithAllBitsObserved = context;
|
13614 | resolvedObservedBits = maxSigned31BitInt;
|
13615 | } else {
|
13616 | resolvedObservedBits = observedBits;
|
13617 | }
|
13618 |
|
13619 | var contextItem = {
|
13620 | context: context,
|
13621 | observedBits: resolvedObservedBits,
|
13622 | next: null
|
13623 | };
|
13624 |
|
13625 | if (lastContextDependency === null) {
|
13626 | !(currentlyRenderingFiber !== null) ? invariant(false, 'Context can only be read while React is rendering, e.g. inside the render method or getDerivedStateFromProps.') : void 0;
|
13627 |
|
13628 | currentlyRenderingFiber.firstContextDependency = lastContextDependency = contextItem;
|
13629 | } else {
|
13630 |
|
13631 | lastContextDependency = lastContextDependency.next = contextItem;
|
13632 | }
|
13633 | }
|
13634 | return isPrimaryRenderer ? context._currentValue : context._currentValue2;
|
13635 | }
|
13636 |
|
13637 | var NoEffect$1 = 0;
|
13638 | var UnmountSnapshot = 2;
|
13639 | var UnmountMutation = 4;
|
13640 | var MountMutation = 8;
|
13641 | var UnmountLayout = 16;
|
13642 | var MountLayout = 32;
|
13643 | var MountPassive = 64;
|
13644 | var UnmountPassive = 128;
|
13645 |
|
13646 | function areHookInputsEqual(arr1, arr2) {
|
13647 |
|
13648 |
|
13649 | {
|
13650 | !(arr1.length === arr2.length) ? warning$1(false, 'Detected a variable number of hook dependencies. The length of the ' + 'dependencies array should be constant between renders.\n\n' + 'Previous: %s\n' + 'Incoming: %s', arr1.join(', '), arr2.join(', ')) : void 0;
|
13651 | }
|
13652 | for (var i = 0; i < arr1.length; i++) {
|
13653 |
|
13654 |
|
13655 | var val1 = arr1[i];
|
13656 | var val2 = arr2[i];
|
13657 | if (val1 === val2 && (val1 !== 0 || 1 / val1 === 1 / val2) || val1 !== val1 && val2 !== val2
|
13658 | ) {
|
13659 | continue;
|
13660 | }
|
13661 | return false;
|
13662 | }
|
13663 | return true;
|
13664 | }
|
13665 |
|
13666 |
|
13667 | var renderExpirationTime = NoWork;
|
13668 |
|
13669 |
|
13670 | var currentlyRenderingFiber$1 = null;
|
13671 |
|
13672 |
|
13673 |
|
13674 |
|
13675 |
|
13676 | var firstCurrentHook = null;
|
13677 | var currentHook = null;
|
13678 | var firstWorkInProgressHook = null;
|
13679 | var workInProgressHook = null;
|
13680 |
|
13681 | var remainingExpirationTime = NoWork;
|
13682 | var componentUpdateQueue = null;
|
13683 |
|
13684 |
|
13685 |
|
13686 |
|
13687 |
|
13688 |
|
13689 |
|
13690 |
|
13691 |
|
13692 |
|
13693 | var isReRender = false;
|
13694 |
|
13695 | var didScheduleRenderPhaseUpdate = false;
|
13696 |
|
13697 | var renderPhaseUpdates = null;
|
13698 |
|
13699 | var numberOfReRenders = 0;
|
13700 | var RE_RENDER_LIMIT = 25;
|
13701 |
|
13702 | function resolveCurrentlyRenderingFiber() {
|
13703 | !(currentlyRenderingFiber$1 !== null) ? invariant(false, 'Hooks can only be called inside the body of a function component.') : void 0;
|
13704 | return currentlyRenderingFiber$1;
|
13705 | }
|
13706 |
|
13707 | function prepareToUseHooks(current, workInProgress, nextRenderExpirationTime) {
|
13708 | if (!enableHooks) {
|
13709 | return;
|
13710 | }
|
13711 | renderExpirationTime = nextRenderExpirationTime;
|
13712 | currentlyRenderingFiber$1 = workInProgress;
|
13713 | firstCurrentHook = current !== null ? current.memoizedState : null;
|
13714 |
|
13715 |
|
13716 |
|
13717 |
|
13718 |
|
13719 |
|
13720 |
|
13721 |
|
13722 |
|
13723 |
|
13724 |
|
13725 |
|
13726 | }
|
13727 |
|
13728 | function finishHooks(Component, props, children, refOrContext) {
|
13729 | if (!enableHooks) {
|
13730 | return children;
|
13731 | }
|
13732 |
|
13733 |
|
13734 |
|
13735 |
|
13736 | while (didScheduleRenderPhaseUpdate) {
|
13737 |
|
13738 |
|
13739 |
|
13740 |
|
13741 | didScheduleRenderPhaseUpdate = false;
|
13742 | numberOfReRenders += 1;
|
13743 |
|
13744 |
|
13745 | currentHook = null;
|
13746 | workInProgressHook = null;
|
13747 | componentUpdateQueue = null;
|
13748 |
|
13749 | children = Component(props, refOrContext);
|
13750 | }
|
13751 | renderPhaseUpdates = null;
|
13752 | numberOfReRenders = 0;
|
13753 |
|
13754 | var renderedWork = currentlyRenderingFiber$1;
|
13755 |
|
13756 | renderedWork.memoizedState = firstWorkInProgressHook;
|
13757 | renderedWork.expirationTime = remainingExpirationTime;
|
13758 | renderedWork.updateQueue = componentUpdateQueue;
|
13759 |
|
13760 | var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
|
13761 |
|
13762 | renderExpirationTime = NoWork;
|
13763 | currentlyRenderingFiber$1 = null;
|
13764 |
|
13765 | firstCurrentHook = null;
|
13766 | currentHook = null;
|
13767 | firstWorkInProgressHook = null;
|
13768 | workInProgressHook = null;
|
13769 |
|
13770 | remainingExpirationTime = NoWork;
|
13771 | componentUpdateQueue = null;
|
13772 |
|
13773 |
|
13774 |
|
13775 |
|
13776 |
|
13777 |
|
13778 |
|
13779 |
|
13780 |
|
13781 | !!didRenderTooFewHooks ? invariant(false, 'Rendered fewer hooks than expected. This may be caused by an accidental early return statement.') : void 0;
|
13782 |
|
13783 | return children;
|
13784 | }
|
13785 |
|
13786 | function resetHooks() {
|
13787 | if (!enableHooks) {
|
13788 | return;
|
13789 | }
|
13790 |
|
13791 |
|
13792 |
|
13793 |
|
13794 | renderExpirationTime = NoWork;
|
13795 | currentlyRenderingFiber$1 = null;
|
13796 |
|
13797 | firstCurrentHook = null;
|
13798 | currentHook = null;
|
13799 | firstWorkInProgressHook = null;
|
13800 | workInProgressHook = null;
|
13801 |
|
13802 | remainingExpirationTime = NoWork;
|
13803 | componentUpdateQueue = null;
|
13804 |
|
13805 |
|
13806 |
|
13807 |
|
13808 | didScheduleRenderPhaseUpdate = false;
|
13809 | renderPhaseUpdates = null;
|
13810 | numberOfReRenders = 0;
|
13811 | }
|
13812 |
|
13813 | function createHook() {
|
13814 | return {
|
13815 | memoizedState: null,
|
13816 |
|
13817 | baseState: null,
|
13818 | queue: null,
|
13819 | baseUpdate: null,
|
13820 |
|
13821 | next: null
|
13822 | };
|
13823 | }
|
13824 |
|
13825 | function cloneHook(hook) {
|
13826 | return {
|
13827 | memoizedState: hook.memoizedState,
|
13828 |
|
13829 | baseState: hook.baseState,
|
13830 | queue: hook.queue,
|
13831 | baseUpdate: hook.baseUpdate,
|
13832 |
|
13833 | next: null
|
13834 | };
|
13835 | }
|
13836 |
|
13837 | function createWorkInProgressHook() {
|
13838 | if (workInProgressHook === null) {
|
13839 |
|
13840 | if (firstWorkInProgressHook === null) {
|
13841 | isReRender = false;
|
13842 | currentHook = firstCurrentHook;
|
13843 | if (currentHook === null) {
|
13844 |
|
13845 | workInProgressHook = createHook();
|
13846 | } else {
|
13847 |
|
13848 | workInProgressHook = cloneHook(currentHook);
|
13849 | }
|
13850 | firstWorkInProgressHook = workInProgressHook;
|
13851 | } else {
|
13852 |
|
13853 | isReRender = true;
|
13854 | currentHook = firstCurrentHook;
|
13855 | workInProgressHook = firstWorkInProgressHook;
|
13856 | }
|
13857 | } else {
|
13858 | if (workInProgressHook.next === null) {
|
13859 | isReRender = false;
|
13860 | var hook = void 0;
|
13861 | if (currentHook === null) {
|
13862 |
|
13863 | hook = createHook();
|
13864 | } else {
|
13865 | currentHook = currentHook.next;
|
13866 | if (currentHook === null) {
|
13867 |
|
13868 | hook = createHook();
|
13869 | } else {
|
13870 |
|
13871 | hook = cloneHook(currentHook);
|
13872 | }
|
13873 | }
|
13874 |
|
13875 | workInProgressHook = workInProgressHook.next = hook;
|
13876 | } else {
|
13877 |
|
13878 | isReRender = true;
|
13879 | workInProgressHook = workInProgressHook.next;
|
13880 | currentHook = currentHook !== null ? currentHook.next : null;
|
13881 | }
|
13882 | }
|
13883 | return workInProgressHook;
|
13884 | }
|
13885 |
|
13886 | function createFunctionComponentUpdateQueue() {
|
13887 | return {
|
13888 | lastEffect: null
|
13889 | };
|
13890 | }
|
13891 |
|
13892 | function basicStateReducer(state, action) {
|
13893 | return typeof action === 'function' ? action(state) : action;
|
13894 | }
|
13895 |
|
13896 | function useContext(context, observedBits) {
|
13897 |
|
13898 |
|
13899 | resolveCurrentlyRenderingFiber();
|
13900 | return readContext(context, observedBits);
|
13901 | }
|
13902 |
|
13903 | function useState(initialState) {
|
13904 | return useReducer(basicStateReducer,
|
13905 |
|
13906 | initialState);
|
13907 | }
|
13908 |
|
13909 | function useReducer(reducer, initialState, initialAction) {
|
13910 | currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber();
|
13911 | workInProgressHook = createWorkInProgressHook();
|
13912 | var queue = workInProgressHook.queue;
|
13913 | if (queue !== null) {
|
13914 |
|
13915 | if (isReRender) {
|
13916 |
|
13917 | var _dispatch2 = queue.dispatch;
|
13918 | if (renderPhaseUpdates !== null) {
|
13919 |
|
13920 | var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
|
13921 | if (firstRenderPhaseUpdate !== undefined) {
|
13922 | renderPhaseUpdates.delete(queue);
|
13923 | var newState = workInProgressHook.memoizedState;
|
13924 | var update = firstRenderPhaseUpdate;
|
13925 | do {
|
13926 |
|
13927 |
|
13928 |
|
13929 | var _action = update.action;
|
13930 | newState = reducer(newState, _action);
|
13931 | update = update.next;
|
13932 | } while (update !== null);
|
13933 |
|
13934 | workInProgressHook.memoizedState = newState;
|
13935 |
|
13936 |
|
13937 |
|
13938 |
|
13939 |
|
13940 | if (workInProgressHook.baseUpdate === queue.last) {
|
13941 | workInProgressHook.baseState = newState;
|
13942 | }
|
13943 |
|
13944 | return [newState, _dispatch2];
|
13945 | }
|
13946 | }
|
13947 | return [workInProgressHook.memoizedState, _dispatch2];
|
13948 | }
|
13949 |
|
13950 |
|
13951 | var _last = queue.last;
|
13952 |
|
13953 | var _baseUpdate = workInProgressHook.baseUpdate;
|
13954 |
|
13955 |
|
13956 | var first = void 0;
|
13957 | if (_baseUpdate !== null) {
|
13958 | if (_last !== null) {
|
13959 |
|
13960 |
|
13961 |
|
13962 | _last.next = null;
|
13963 | }
|
13964 | first = _baseUpdate.next;
|
13965 | } else {
|
13966 | first = _last !== null ? _last.next : null;
|
13967 | }
|
13968 | if (first !== null) {
|
13969 | var _newState = workInProgressHook.baseState;
|
13970 | var newBaseState = null;
|
13971 | var newBaseUpdate = null;
|
13972 | var prevUpdate = _baseUpdate;
|
13973 | var _update = first;
|
13974 | var didSkip = false;
|
13975 | do {
|
13976 | var updateExpirationTime = _update.expirationTime;
|
13977 | if (updateExpirationTime < renderExpirationTime) {
|
13978 |
|
13979 |
|
13980 |
|
13981 | if (!didSkip) {
|
13982 | didSkip = true;
|
13983 | newBaseUpdate = prevUpdate;
|
13984 | newBaseState = _newState;
|
13985 | }
|
13986 |
|
13987 | if (updateExpirationTime > remainingExpirationTime) {
|
13988 | remainingExpirationTime = updateExpirationTime;
|
13989 | }
|
13990 | } else {
|
13991 |
|
13992 | var _action2 = _update.action;
|
13993 | _newState = reducer(_newState, _action2);
|
13994 | }
|
13995 | prevUpdate = _update;
|
13996 | _update = _update.next;
|
13997 | } while (_update !== null && _update !== first);
|
13998 |
|
13999 | if (!didSkip) {
|
14000 | newBaseUpdate = prevUpdate;
|
14001 | newBaseState = _newState;
|
14002 | }
|
14003 |
|
14004 | workInProgressHook.memoizedState = _newState;
|
14005 | workInProgressHook.baseUpdate = newBaseUpdate;
|
14006 | workInProgressHook.baseState = newBaseState;
|
14007 | }
|
14008 |
|
14009 | var _dispatch = queue.dispatch;
|
14010 | return [workInProgressHook.memoizedState, _dispatch];
|
14011 | }
|
14012 |
|
14013 |
|
14014 | if (reducer === basicStateReducer) {
|
14015 |
|
14016 | if (typeof initialState === 'function') {
|
14017 | initialState = initialState();
|
14018 | }
|
14019 | } else if (initialAction !== undefined && initialAction !== null) {
|
14020 | initialState = reducer(initialState, initialAction);
|
14021 | }
|
14022 | workInProgressHook.memoizedState = workInProgressHook.baseState = initialState;
|
14023 | queue = workInProgressHook.queue = {
|
14024 | last: null,
|
14025 | dispatch: null
|
14026 | };
|
14027 | var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
|
14028 | return [workInProgressHook.memoizedState, dispatch];
|
14029 | }
|
14030 |
|
14031 | function pushEffect(tag, create, destroy, inputs) {
|
14032 | var effect = {
|
14033 | tag: tag,
|
14034 | create: create,
|
14035 | destroy: destroy,
|
14036 | inputs: inputs,
|
14037 |
|
14038 | next: null
|
14039 | };
|
14040 | if (componentUpdateQueue === null) {
|
14041 | componentUpdateQueue = createFunctionComponentUpdateQueue();
|
14042 | componentUpdateQueue.lastEffect = effect.next = effect;
|
14043 | } else {
|
14044 | var _lastEffect = componentUpdateQueue.lastEffect;
|
14045 | if (_lastEffect === null) {
|
14046 | componentUpdateQueue.lastEffect = effect.next = effect;
|
14047 | } else {
|
14048 | var firstEffect = _lastEffect.next;
|
14049 | _lastEffect.next = effect;
|
14050 | effect.next = firstEffect;
|
14051 | componentUpdateQueue.lastEffect = effect;
|
14052 | }
|
14053 | }
|
14054 | return effect;
|
14055 | }
|
14056 |
|
14057 | function useRef(initialValue) {
|
14058 | currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber();
|
14059 | workInProgressHook = createWorkInProgressHook();
|
14060 | var ref = void 0;
|
14061 |
|
14062 | if (workInProgressHook.memoizedState === null) {
|
14063 | ref = { current: initialValue };
|
14064 | {
|
14065 | Object.seal(ref);
|
14066 | }
|
14067 | workInProgressHook.memoizedState = ref;
|
14068 | } else {
|
14069 | ref = workInProgressHook.memoizedState;
|
14070 | }
|
14071 | return ref;
|
14072 | }
|
14073 |
|
14074 | function useLayoutEffect(create, inputs) {
|
14075 | useEffectImpl(Update, UnmountMutation | MountLayout, create, inputs);
|
14076 | }
|
14077 |
|
14078 | function useEffect(create, inputs) {
|
14079 | useEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, inputs);
|
14080 | }
|
14081 |
|
14082 | function useEffectImpl(fiberEffectTag, hookEffectTag, create, inputs) {
|
14083 | currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber();
|
14084 | workInProgressHook = createWorkInProgressHook();
|
14085 |
|
14086 | var nextInputs = inputs !== undefined && inputs !== null ? inputs : [create];
|
14087 | var destroy = null;
|
14088 | if (currentHook !== null) {
|
14089 | var prevEffect = currentHook.memoizedState;
|
14090 | destroy = prevEffect.destroy;
|
14091 | if (areHookInputsEqual(nextInputs, prevEffect.inputs)) {
|
14092 | pushEffect(NoEffect$1, create, destroy, nextInputs);
|
14093 | return;
|
14094 | }
|
14095 | }
|
14096 |
|
14097 | currentlyRenderingFiber$1.effectTag |= fiberEffectTag;
|
14098 | workInProgressHook.memoizedState = pushEffect(hookEffectTag, create, destroy, nextInputs);
|
14099 | }
|
14100 |
|
14101 | function useImperativeMethods(ref, create, inputs) {
|
14102 |
|
14103 | var nextInputs = inputs !== null && inputs !== undefined ? inputs.concat([ref]) : [ref, create];
|
14104 |
|
14105 |
|
14106 |
|
14107 |
|
14108 | useLayoutEffect(function () {
|
14109 | if (typeof ref === 'function') {
|
14110 | var refCallback = ref;
|
14111 | var _inst = create();
|
14112 | refCallback(_inst);
|
14113 | return function () {
|
14114 | return refCallback(null);
|
14115 | };
|
14116 | } else if (ref !== null && ref !== undefined) {
|
14117 | var refObject = ref;
|
14118 | var _inst2 = create();
|
14119 | refObject.current = _inst2;
|
14120 | return function () {
|
14121 | refObject.current = null;
|
14122 | };
|
14123 | }
|
14124 | }, nextInputs);
|
14125 | }
|
14126 |
|
14127 | function useCallback(callback, inputs) {
|
14128 | currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber();
|
14129 | workInProgressHook = createWorkInProgressHook();
|
14130 |
|
14131 | var nextInputs = inputs !== undefined && inputs !== null ? inputs : [callback];
|
14132 |
|
14133 | var prevState = workInProgressHook.memoizedState;
|
14134 | if (prevState !== null) {
|
14135 | var prevInputs = prevState[1];
|
14136 | if (areHookInputsEqual(nextInputs, prevInputs)) {
|
14137 | return prevState[0];
|
14138 | }
|
14139 | }
|
14140 | workInProgressHook.memoizedState = [callback, nextInputs];
|
14141 | return callback;
|
14142 | }
|
14143 |
|
14144 | function useMemo(nextCreate, inputs) {
|
14145 | currentlyRenderingFiber$1 = resolveCurrentlyRenderingFiber();
|
14146 | workInProgressHook = createWorkInProgressHook();
|
14147 |
|
14148 | var nextInputs = inputs !== undefined && inputs !== null ? inputs : [nextCreate];
|
14149 |
|
14150 | var prevState = workInProgressHook.memoizedState;
|
14151 | if (prevState !== null) {
|
14152 | var prevInputs = prevState[1];
|
14153 | if (areHookInputsEqual(nextInputs, prevInputs)) {
|
14154 | return prevState[0];
|
14155 | }
|
14156 | }
|
14157 |
|
14158 | var nextValue = nextCreate();
|
14159 | workInProgressHook.memoizedState = [nextValue, nextInputs];
|
14160 | return nextValue;
|
14161 | }
|
14162 |
|
14163 | function dispatchAction(fiber, queue, action) {
|
14164 | !(numberOfReRenders < RE_RENDER_LIMIT) ? invariant(false, 'Too many re-renders. React limits the number of renders to prevent an infinite loop.') : void 0;
|
14165 |
|
14166 | var alternate = fiber.alternate;
|
14167 | if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
|
14168 |
|
14169 |
|
14170 |
|
14171 | didScheduleRenderPhaseUpdate = true;
|
14172 | var update = {
|
14173 | expirationTime: renderExpirationTime,
|
14174 | action: action,
|
14175 | next: null
|
14176 | };
|
14177 | if (renderPhaseUpdates === null) {
|
14178 | renderPhaseUpdates = new Map();
|
14179 | }
|
14180 | var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
|
14181 | if (firstRenderPhaseUpdate === undefined) {
|
14182 | renderPhaseUpdates.set(queue, update);
|
14183 | } else {
|
14184 |
|
14185 | var lastRenderPhaseUpdate = firstRenderPhaseUpdate;
|
14186 | while (lastRenderPhaseUpdate.next !== null) {
|
14187 | lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
|
14188 | }
|
14189 | lastRenderPhaseUpdate.next = update;
|
14190 | }
|
14191 | } else {
|
14192 | var currentTime = requestCurrentTime();
|
14193 | var _expirationTime = computeExpirationForFiber(currentTime, fiber);
|
14194 | var _update2 = {
|
14195 | expirationTime: _expirationTime,
|
14196 | action: action,
|
14197 | next: null
|
14198 | };
|
14199 | flushPassiveEffects();
|
14200 |
|
14201 | var _last2 = queue.last;
|
14202 | if (_last2 === null) {
|
14203 |
|
14204 | _update2.next = _update2;
|
14205 | } else {
|
14206 | var first = _last2.next;
|
14207 | if (first !== null) {
|
14208 |
|
14209 | _update2.next = first;
|
14210 | }
|
14211 | _last2.next = _update2;
|
14212 | }
|
14213 | queue.last = _update2;
|
14214 | scheduleWork(fiber, _expirationTime);
|
14215 | }
|
14216 | }
|
14217 |
|
14218 | var NO_CONTEXT = {};
|
14219 |
|
14220 | var contextStackCursor$1 = createCursor(NO_CONTEXT);
|
14221 | var contextFiberStackCursor = createCursor(NO_CONTEXT);
|
14222 | var rootInstanceStackCursor = createCursor(NO_CONTEXT);
|
14223 |
|
14224 | function requiredContext(c) {
|
14225 | !(c !== NO_CONTEXT) ? invariant(false, 'Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
14226 | return c;
|
14227 | }
|
14228 |
|
14229 | function getRootHostContainer() {
|
14230 | var rootInstance = requiredContext(rootInstanceStackCursor.current);
|
14231 | return rootInstance;
|
14232 | }
|
14233 |
|
14234 | function pushHostContainer(fiber, nextRootInstance) {
|
14235 |
|
14236 |
|
14237 | push(rootInstanceStackCursor, nextRootInstance, fiber);
|
14238 |
|
14239 |
|
14240 | push(contextFiberStackCursor, fiber, fiber);
|
14241 |
|
14242 |
|
14243 |
|
14244 |
|
14245 |
|
14246 |
|
14247 | push(contextStackCursor$1, NO_CONTEXT, fiber);
|
14248 | var nextRootContext = getRootHostContext(nextRootInstance);
|
14249 |
|
14250 | pop(contextStackCursor$1, fiber);
|
14251 | push(contextStackCursor$1, nextRootContext, fiber);
|
14252 | }
|
14253 |
|
14254 | function popHostContainer(fiber) {
|
14255 | pop(contextStackCursor$1, fiber);
|
14256 | pop(contextFiberStackCursor, fiber);
|
14257 | pop(rootInstanceStackCursor, fiber);
|
14258 | }
|
14259 |
|
14260 | function getHostContext() {
|
14261 | var context = requiredContext(contextStackCursor$1.current);
|
14262 | return context;
|
14263 | }
|
14264 |
|
14265 | function pushHostContext(fiber) {
|
14266 | var rootInstance = requiredContext(rootInstanceStackCursor.current);
|
14267 | var context = requiredContext(contextStackCursor$1.current);
|
14268 | var nextContext = getChildHostContext(context, fiber.type, rootInstance);
|
14269 |
|
14270 |
|
14271 | if (context === nextContext) {
|
14272 | return;
|
14273 | }
|
14274 |
|
14275 |
|
14276 |
|
14277 | push(contextFiberStackCursor, fiber, fiber);
|
14278 | push(contextStackCursor$1, nextContext, fiber);
|
14279 | }
|
14280 |
|
14281 | function popHostContext(fiber) {
|
14282 |
|
14283 |
|
14284 | if (contextFiberStackCursor.current !== fiber) {
|
14285 | return;
|
14286 | }
|
14287 |
|
14288 | pop(contextStackCursor$1, fiber);
|
14289 | pop(contextFiberStackCursor, fiber);
|
14290 | }
|
14291 |
|
14292 | var commitTime = 0;
|
14293 | var profilerStartTime = -1;
|
14294 |
|
14295 | function getCommitTime() {
|
14296 | return commitTime;
|
14297 | }
|
14298 |
|
14299 | function recordCommitTime() {
|
14300 | if (!enableProfilerTimer) {
|
14301 | return;
|
14302 | }
|
14303 | commitTime = scheduler.unstable_now();
|
14304 | }
|
14305 |
|
14306 | function startProfilerTimer(fiber) {
|
14307 | if (!enableProfilerTimer) {
|
14308 | return;
|
14309 | }
|
14310 |
|
14311 | profilerStartTime = scheduler.unstable_now();
|
14312 |
|
14313 | if (fiber.actualStartTime < 0) {
|
14314 | fiber.actualStartTime = scheduler.unstable_now();
|
14315 | }
|
14316 | }
|
14317 |
|
14318 | function stopProfilerTimerIfRunning(fiber) {
|
14319 | if (!enableProfilerTimer) {
|
14320 | return;
|
14321 | }
|
14322 | profilerStartTime = -1;
|
14323 | }
|
14324 |
|
14325 | function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
|
14326 | if (!enableProfilerTimer) {
|
14327 | return;
|
14328 | }
|
14329 |
|
14330 | if (profilerStartTime >= 0) {
|
14331 | var elapsedTime = scheduler.unstable_now() - profilerStartTime;
|
14332 | fiber.actualDuration += elapsedTime;
|
14333 | if (overrideBaseTime) {
|
14334 | fiber.selfBaseDuration = elapsedTime;
|
14335 | }
|
14336 | profilerStartTime = -1;
|
14337 | }
|
14338 | }
|
14339 |
|
14340 | function resolveDefaultProps(Component, baseProps) {
|
14341 | if (Component && Component.defaultProps) {
|
14342 |
|
14343 | var props = _assign({}, baseProps);
|
14344 | var defaultProps = Component.defaultProps;
|
14345 | for (var propName in defaultProps) {
|
14346 | if (props[propName] === undefined) {
|
14347 | props[propName] = defaultProps[propName];
|
14348 | }
|
14349 | }
|
14350 | return props;
|
14351 | }
|
14352 | return baseProps;
|
14353 | }
|
14354 |
|
14355 | function readLazyComponentType(lazyComponent) {
|
14356 | var status = lazyComponent._status;
|
14357 | var result = lazyComponent._result;
|
14358 | switch (status) {
|
14359 | case Resolved:
|
14360 | {
|
14361 | var Component = result;
|
14362 | return Component;
|
14363 | }
|
14364 | case Rejected:
|
14365 | {
|
14366 | var error = result;
|
14367 | throw error;
|
14368 | }
|
14369 | case Pending:
|
14370 | {
|
14371 | var thenable = result;
|
14372 | throw thenable;
|
14373 | }
|
14374 | default:
|
14375 | {
|
14376 | lazyComponent._status = Pending;
|
14377 | var ctor = lazyComponent._ctor;
|
14378 | var _thenable = ctor();
|
14379 | _thenable.then(function (moduleObject) {
|
14380 | if (lazyComponent._status === Pending) {
|
14381 | var defaultExport = moduleObject.default;
|
14382 | {
|
14383 | if (defaultExport === undefined) {
|
14384 | warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
|
14385 | }
|
14386 | }
|
14387 | lazyComponent._status = Resolved;
|
14388 | lazyComponent._result = defaultExport;
|
14389 | }
|
14390 | }, function (error) {
|
14391 | if (lazyComponent._status === Pending) {
|
14392 | lazyComponent._status = Rejected;
|
14393 | lazyComponent._result = error;
|
14394 | }
|
14395 | });
|
14396 | lazyComponent._result = _thenable;
|
14397 | throw _thenable;
|
14398 | }
|
14399 | }
|
14400 | }
|
14401 |
|
14402 | var ReactCurrentOwner$4 = ReactSharedInternals.ReactCurrentOwner;
|
14403 |
|
14404 | function readContext$1(contextType) {
|
14405 | var dispatcher = ReactCurrentOwner$4.currentDispatcher;
|
14406 | return dispatcher.readContext(contextType);
|
14407 | }
|
14408 |
|
14409 | var fakeInternalInstance = {};
|
14410 | var isArray$1 = Array.isArray;
|
14411 |
|
14412 |
|
14413 |
|
14414 | var emptyRefsObject = new React.Component().refs;
|
14415 |
|
14416 | var didWarnAboutStateAssignmentForComponent = void 0;
|
14417 | var didWarnAboutUninitializedState = void 0;
|
14418 | var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = void 0;
|
14419 | var didWarnAboutLegacyLifecyclesAndDerivedState = void 0;
|
14420 | var didWarnAboutUndefinedDerivedState = void 0;
|
14421 | var warnOnUndefinedDerivedState = void 0;
|
14422 | var warnOnInvalidCallback$1 = void 0;
|
14423 | var didWarnAboutDirectlyAssigningPropsToState = void 0;
|
14424 | var didWarnAboutContextTypeAndContextTypes = void 0;
|
14425 | var didWarnAboutInvalidateContextType = void 0;
|
14426 |
|
14427 | {
|
14428 | didWarnAboutStateAssignmentForComponent = new Set();
|
14429 | didWarnAboutUninitializedState = new Set();
|
14430 | didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
|
14431 | didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
|
14432 | didWarnAboutDirectlyAssigningPropsToState = new Set();
|
14433 | didWarnAboutUndefinedDerivedState = new Set();
|
14434 | didWarnAboutContextTypeAndContextTypes = new Set();
|
14435 | didWarnAboutInvalidateContextType = new Set();
|
14436 |
|
14437 | var didWarnOnInvalidCallback = new Set();
|
14438 |
|
14439 | warnOnInvalidCallback$1 = function (callback, callerName) {
|
14440 | if (callback === null || typeof callback === 'function') {
|
14441 | return;
|
14442 | }
|
14443 | var key = callerName + '_' + callback;
|
14444 | if (!didWarnOnInvalidCallback.has(key)) {
|
14445 | didWarnOnInvalidCallback.add(key);
|
14446 | warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
|
14447 | }
|
14448 | };
|
14449 |
|
14450 | warnOnUndefinedDerivedState = function (type, partialState) {
|
14451 | if (partialState === undefined) {
|
14452 | var componentName = getComponentName(type) || 'Component';
|
14453 | if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
|
14454 | didWarnAboutUndefinedDerivedState.add(componentName);
|
14455 | warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);
|
14456 | }
|
14457 | }
|
14458 | };
|
14459 |
|
14460 |
|
14461 |
|
14462 |
|
14463 |
|
14464 |
|
14465 | Object.defineProperty(fakeInternalInstance, '_processChildContext', {
|
14466 | enumerable: false,
|
14467 | value: function () {
|
14468 | invariant(false, '_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn\'t supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).');
|
14469 | }
|
14470 | });
|
14471 | Object.freeze(fakeInternalInstance);
|
14472 | }
|
14473 |
|
14474 | function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {
|
14475 | var prevState = workInProgress.memoizedState;
|
14476 |
|
14477 | {
|
14478 | if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
|
14479 |
|
14480 | getDerivedStateFromProps(nextProps, prevState);
|
14481 | }
|
14482 | }
|
14483 |
|
14484 | var partialState = getDerivedStateFromProps(nextProps, prevState);
|
14485 |
|
14486 | {
|
14487 | warnOnUndefinedDerivedState(ctor, partialState);
|
14488 | }
|
14489 |
|
14490 | var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);
|
14491 | workInProgress.memoizedState = memoizedState;
|
14492 |
|
14493 |
|
14494 |
|
14495 | var updateQueue = workInProgress.updateQueue;
|
14496 | if (updateQueue !== null && workInProgress.expirationTime === NoWork) {
|
14497 | updateQueue.baseState = memoizedState;
|
14498 | }
|
14499 | }
|
14500 |
|
14501 | var classComponentUpdater = {
|
14502 | isMounted: isMounted,
|
14503 | enqueueSetState: function (inst, payload, callback) {
|
14504 | var fiber = get(inst);
|
14505 | var currentTime = requestCurrentTime();
|
14506 | var expirationTime = computeExpirationForFiber(currentTime, fiber);
|
14507 |
|
14508 | var update = createUpdate(expirationTime);
|
14509 | update.payload = payload;
|
14510 | if (callback !== undefined && callback !== null) {
|
14511 | {
|
14512 | warnOnInvalidCallback$1(callback, 'setState');
|
14513 | }
|
14514 | update.callback = callback;
|
14515 | }
|
14516 |
|
14517 | flushPassiveEffects();
|
14518 | enqueueUpdate(fiber, update);
|
14519 | scheduleWork(fiber, expirationTime);
|
14520 | },
|
14521 | enqueueReplaceState: function (inst, payload, callback) {
|
14522 | var fiber = get(inst);
|
14523 | var currentTime = requestCurrentTime();
|
14524 | var expirationTime = computeExpirationForFiber(currentTime, fiber);
|
14525 |
|
14526 | var update = createUpdate(expirationTime);
|
14527 | update.tag = ReplaceState;
|
14528 | update.payload = payload;
|
14529 |
|
14530 | if (callback !== undefined && callback !== null) {
|
14531 | {
|
14532 | warnOnInvalidCallback$1(callback, 'replaceState');
|
14533 | }
|
14534 | update.callback = callback;
|
14535 | }
|
14536 |
|
14537 | flushPassiveEffects();
|
14538 | enqueueUpdate(fiber, update);
|
14539 | scheduleWork(fiber, expirationTime);
|
14540 | },
|
14541 | enqueueForceUpdate: function (inst, callback) {
|
14542 | var fiber = get(inst);
|
14543 | var currentTime = requestCurrentTime();
|
14544 | var expirationTime = computeExpirationForFiber(currentTime, fiber);
|
14545 |
|
14546 | var update = createUpdate(expirationTime);
|
14547 | update.tag = ForceUpdate;
|
14548 |
|
14549 | if (callback !== undefined && callback !== null) {
|
14550 | {
|
14551 | warnOnInvalidCallback$1(callback, 'forceUpdate');
|
14552 | }
|
14553 | update.callback = callback;
|
14554 | }
|
14555 |
|
14556 | flushPassiveEffects();
|
14557 | enqueueUpdate(fiber, update);
|
14558 | scheduleWork(fiber, expirationTime);
|
14559 | }
|
14560 | };
|
14561 |
|
14562 | function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {
|
14563 | var instance = workInProgress.stateNode;
|
14564 | if (typeof instance.shouldComponentUpdate === 'function') {
|
14565 | startPhaseTimer(workInProgress, 'shouldComponentUpdate');
|
14566 | var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
|
14567 | stopPhaseTimer();
|
14568 |
|
14569 | {
|
14570 | !(shouldUpdate !== undefined) ? warningWithoutStack$1(false, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component') : void 0;
|
14571 | }
|
14572 |
|
14573 | return shouldUpdate;
|
14574 | }
|
14575 |
|
14576 | if (ctor.prototype && ctor.prototype.isPureReactComponent) {
|
14577 | return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
|
14578 | }
|
14579 |
|
14580 | return true;
|
14581 | }
|
14582 |
|
14583 | function checkClassInstance(workInProgress, ctor, newProps) {
|
14584 | var instance = workInProgress.stateNode;
|
14585 | {
|
14586 | var name = getComponentName(ctor) || 'Component';
|
14587 | var renderPresent = instance.render;
|
14588 |
|
14589 | if (!renderPresent) {
|
14590 | if (ctor.prototype && typeof ctor.prototype.render === 'function') {
|
14591 | warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);
|
14592 | } else {
|
14593 | warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);
|
14594 | }
|
14595 | }
|
14596 |
|
14597 | var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state;
|
14598 | !noGetInitialStateOnES6 ? warningWithoutStack$1(false, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name) : void 0;
|
14599 | var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved;
|
14600 | !noGetDefaultPropsOnES6 ? warningWithoutStack$1(false, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name) : void 0;
|
14601 | var noInstancePropTypes = !instance.propTypes;
|
14602 | !noInstancePropTypes ? warningWithoutStack$1(false, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name) : void 0;
|
14603 | var noInstanceContextType = !instance.contextType;
|
14604 | !noInstanceContextType ? warningWithoutStack$1(false, 'contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name) : void 0;
|
14605 | var noInstanceContextTypes = !instance.contextTypes;
|
14606 | !noInstanceContextTypes ? warningWithoutStack$1(false, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name) : void 0;
|
14607 |
|
14608 | if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
|
14609 | didWarnAboutContextTypeAndContextTypes.add(ctor);
|
14610 | warningWithoutStack$1(false, '%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);
|
14611 | }
|
14612 |
|
14613 | var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function';
|
14614 | !noComponentShouldUpdate ? warningWithoutStack$1(false, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name) : void 0;
|
14615 | if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {
|
14616 | warningWithoutStack$1(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component');
|
14617 | }
|
14618 | var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function';
|
14619 | !noComponentDidUnmount ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name) : void 0;
|
14620 | var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function';
|
14621 | !noComponentDidReceiveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name) : void 0;
|
14622 | var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function';
|
14623 | !noComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name) : void 0;
|
14624 | var noUnsafeComponentWillRecieveProps = typeof instance.UNSAFE_componentWillRecieveProps !== 'function';
|
14625 | !noUnsafeComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name) : void 0;
|
14626 | var hasMutatedProps = instance.props !== newProps;
|
14627 | !(instance.props === undefined || !hasMutatedProps) ? warningWithoutStack$1(false, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name) : void 0;
|
14628 | var noInstanceDefaultProps = !instance.defaultProps;
|
14629 | !noInstanceDefaultProps ? warningWithoutStack$1(false, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name) : void 0;
|
14630 |
|
14631 | if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
|
14632 | didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
|
14633 | warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor));
|
14634 | }
|
14635 |
|
14636 | var noInstanceGetDerivedStateFromProps = typeof instance.getDerivedStateFromProps !== 'function';
|
14637 | !noInstanceGetDerivedStateFromProps ? warningWithoutStack$1(false, '%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
|
14638 | var noInstanceGetDerivedStateFromCatch = typeof instance.getDerivedStateFromError !== 'function';
|
14639 | !noInstanceGetDerivedStateFromCatch ? warningWithoutStack$1(false, '%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
|
14640 | var noStaticGetSnapshotBeforeUpdate = typeof ctor.getSnapshotBeforeUpdate !== 'function';
|
14641 | !noStaticGetSnapshotBeforeUpdate ? warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name) : void 0;
|
14642 | var _state = instance.state;
|
14643 | if (_state && (typeof _state !== 'object' || isArray$1(_state))) {
|
14644 | warningWithoutStack$1(false, '%s.state: must be set to an object or null', name);
|
14645 | }
|
14646 | if (typeof instance.getChildContext === 'function') {
|
14647 | !(typeof ctor.childContextTypes === 'object') ? warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name) : void 0;
|
14648 | }
|
14649 | }
|
14650 | }
|
14651 |
|
14652 | function adoptClassInstance(workInProgress, instance) {
|
14653 | instance.updater = classComponentUpdater;
|
14654 | workInProgress.stateNode = instance;
|
14655 |
|
14656 | set(instance, workInProgress);
|
14657 | {
|
14658 | instance._reactInternalInstance = fakeInternalInstance;
|
14659 | }
|
14660 | }
|
14661 |
|
14662 | function constructClassInstance(workInProgress, ctor, props, renderExpirationTime) {
|
14663 | var isLegacyContextConsumer = false;
|
14664 | var unmaskedContext = emptyContextObject;
|
14665 | var context = null;
|
14666 | var contextType = ctor.contextType;
|
14667 | if (typeof contextType === 'object' && contextType !== null) {
|
14668 | {
|
14669 | if (contextType.$$typeof !== REACT_CONTEXT_TYPE && !didWarnAboutInvalidateContextType.has(ctor)) {
|
14670 | didWarnAboutInvalidateContextType.add(ctor);
|
14671 | 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?', getComponentName(ctor) || 'Component');
|
14672 | }
|
14673 | }
|
14674 |
|
14675 | context = readContext$1(contextType);
|
14676 | } else {
|
14677 | unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
|
14678 | var contextTypes = ctor.contextTypes;
|
14679 | isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;
|
14680 | context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;
|
14681 | }
|
14682 |
|
14683 |
|
14684 | {
|
14685 | if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
|
14686 | new ctor(props, context);
|
14687 | }
|
14688 | }
|
14689 |
|
14690 | var instance = new ctor(props, context);
|
14691 | var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;
|
14692 | adoptClassInstance(workInProgress, instance);
|
14693 |
|
14694 | {
|
14695 | if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {
|
14696 | var componentName = getComponentName(ctor) || 'Component';
|
14697 | if (!didWarnAboutUninitializedState.has(componentName)) {
|
14698 | didWarnAboutUninitializedState.add(componentName);
|
14699 | 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, instance.state === null ? 'null' : 'undefined', componentName);
|
14700 | }
|
14701 | }
|
14702 |
|
14703 |
|
14704 |
|
14705 |
|
14706 | if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {
|
14707 | var foundWillMountName = null;
|
14708 | var foundWillReceivePropsName = null;
|
14709 | var foundWillUpdateName = null;
|
14710 | if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {
|
14711 | foundWillMountName = 'componentWillMount';
|
14712 | } else if (typeof instance.UNSAFE_componentWillMount === 'function') {
|
14713 | foundWillMountName = 'UNSAFE_componentWillMount';
|
14714 | }
|
14715 | if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
|
14716 | foundWillReceivePropsName = 'componentWillReceiveProps';
|
14717 | } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
|
14718 | foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
|
14719 | }
|
14720 | if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
|
14721 | foundWillUpdateName = 'componentWillUpdate';
|
14722 | } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
|
14723 | foundWillUpdateName = 'UNSAFE_componentWillUpdate';
|
14724 | }
|
14725 | if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
|
14726 | var _componentName = getComponentName(ctor) || 'Component';
|
14727 | var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
|
14728 | if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
|
14729 | didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
|
14730 | warningWithoutStack$1(false, 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks', _componentName, newApiName, foundWillMountName !== null ? '\n ' + foundWillMountName : '', foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '', foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '');
|
14731 | }
|
14732 | }
|
14733 | }
|
14734 | }
|
14735 |
|
14736 |
|
14737 |
|
14738 | if (isLegacyContextConsumer) {
|
14739 | cacheContext(workInProgress, unmaskedContext, context);
|
14740 | }
|
14741 |
|
14742 | return instance;
|
14743 | }
|
14744 |
|
14745 | function callComponentWillMount(workInProgress, instance) {
|
14746 | startPhaseTimer(workInProgress, 'componentWillMount');
|
14747 | var oldState = instance.state;
|
14748 |
|
14749 | if (typeof instance.componentWillMount === 'function') {
|
14750 | instance.componentWillMount();
|
14751 | }
|
14752 | if (typeof instance.UNSAFE_componentWillMount === 'function') {
|
14753 | instance.UNSAFE_componentWillMount();
|
14754 | }
|
14755 |
|
14756 | stopPhaseTimer();
|
14757 |
|
14758 | if (oldState !== instance.state) {
|
14759 | {
|
14760 | warningWithoutStack$1(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');
|
14761 | }
|
14762 | classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
|
14763 | }
|
14764 | }
|
14765 |
|
14766 | function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {
|
14767 | var oldState = instance.state;
|
14768 | startPhaseTimer(workInProgress, 'componentWillReceiveProps');
|
14769 | if (typeof instance.componentWillReceiveProps === 'function') {
|
14770 | instance.componentWillReceiveProps(newProps, nextContext);
|
14771 | }
|
14772 | if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
|
14773 | instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
|
14774 | }
|
14775 | stopPhaseTimer();
|
14776 |
|
14777 | if (instance.state !== oldState) {
|
14778 | {
|
14779 | var componentName = getComponentName(workInProgress.type) || 'Component';
|
14780 | if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
|
14781 | didWarnAboutStateAssignmentForComponent.add(componentName);
|
14782 | warningWithoutStack$1(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName);
|
14783 | }
|
14784 | }
|
14785 | classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
|
14786 | }
|
14787 | }
|
14788 |
|
14789 |
|
14790 | function mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
|
14791 | {
|
14792 | checkClassInstance(workInProgress, ctor, newProps);
|
14793 | }
|
14794 |
|
14795 | var instance = workInProgress.stateNode;
|
14796 | instance.props = newProps;
|
14797 | instance.state = workInProgress.memoizedState;
|
14798 | instance.refs = emptyRefsObject;
|
14799 |
|
14800 | var contextType = ctor.contextType;
|
14801 | if (typeof contextType === 'object' && contextType !== null) {
|
14802 | instance.context = readContext$1(contextType);
|
14803 | } else {
|
14804 | var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
|
14805 | instance.context = getMaskedContext(workInProgress, unmaskedContext);
|
14806 | }
|
14807 |
|
14808 | {
|
14809 | if (instance.state === newProps) {
|
14810 | var componentName = getComponentName(ctor) || 'Component';
|
14811 | if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
|
14812 | didWarnAboutDirectlyAssigningPropsToState.add(componentName);
|
14813 | warningWithoutStack$1(false, '%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName);
|
14814 | }
|
14815 | }
|
14816 |
|
14817 | if (workInProgress.mode & StrictMode) {
|
14818 | ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);
|
14819 |
|
14820 | ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);
|
14821 | }
|
14822 |
|
14823 | if (warnAboutDeprecatedLifecycles) {
|
14824 | ReactStrictModeWarnings.recordDeprecationWarnings(workInProgress, instance);
|
14825 | }
|
14826 | }
|
14827 |
|
14828 | var updateQueue = workInProgress.updateQueue;
|
14829 | if (updateQueue !== null) {
|
14830 | processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
|
14831 | instance.state = workInProgress.memoizedState;
|
14832 | }
|
14833 |
|
14834 | var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
|
14835 | if (typeof getDerivedStateFromProps === 'function') {
|
14836 | applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
|
14837 | instance.state = workInProgress.memoizedState;
|
14838 | }
|
14839 |
|
14840 |
|
14841 |
|
14842 | if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
|
14843 | callComponentWillMount(workInProgress, instance);
|
14844 |
|
14845 |
|
14846 | updateQueue = workInProgress.updateQueue;
|
14847 | if (updateQueue !== null) {
|
14848 | processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
|
14849 | instance.state = workInProgress.memoizedState;
|
14850 | }
|
14851 | }
|
14852 |
|
14853 | if (typeof instance.componentDidMount === 'function') {
|
14854 | workInProgress.effectTag |= Update;
|
14855 | }
|
14856 | }
|
14857 |
|
14858 | function resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
|
14859 | var instance = workInProgress.stateNode;
|
14860 |
|
14861 | var oldProps = workInProgress.memoizedProps;
|
14862 | instance.props = oldProps;
|
14863 |
|
14864 | var oldContext = instance.context;
|
14865 | var contextType = ctor.contextType;
|
14866 | var nextContext = void 0;
|
14867 | if (typeof contextType === 'object' && contextType !== null) {
|
14868 | nextContext = readContext$1(contextType);
|
14869 | } else {
|
14870 | var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
|
14871 | nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);
|
14872 | }
|
14873 |
|
14874 | var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
|
14875 | var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function';
|
14876 |
|
14877 |
|
14878 |
|
14879 |
|
14880 |
|
14881 |
|
14882 |
|
14883 | if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
|
14884 | if (oldProps !== newProps || oldContext !== nextContext) {
|
14885 | callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
|
14886 | }
|
14887 | }
|
14888 |
|
14889 | resetHasForceUpdateBeforeProcessing();
|
14890 |
|
14891 | var oldState = workInProgress.memoizedState;
|
14892 | var newState = instance.state = oldState;
|
14893 | var updateQueue = workInProgress.updateQueue;
|
14894 | if (updateQueue !== null) {
|
14895 | processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
|
14896 | newState = workInProgress.memoizedState;
|
14897 | }
|
14898 | if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
|
14899 |
|
14900 |
|
14901 | if (typeof instance.componentDidMount === 'function') {
|
14902 | workInProgress.effectTag |= Update;
|
14903 | }
|
14904 | return false;
|
14905 | }
|
14906 |
|
14907 | if (typeof getDerivedStateFromProps === 'function') {
|
14908 | applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
|
14909 | newState = workInProgress.memoizedState;
|
14910 | }
|
14911 |
|
14912 | var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);
|
14913 |
|
14914 | if (shouldUpdate) {
|
14915 |
|
14916 |
|
14917 | if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
|
14918 | startPhaseTimer(workInProgress, 'componentWillMount');
|
14919 | if (typeof instance.componentWillMount === 'function') {
|
14920 | instance.componentWillMount();
|
14921 | }
|
14922 | if (typeof instance.UNSAFE_componentWillMount === 'function') {
|
14923 | instance.UNSAFE_componentWillMount();
|
14924 | }
|
14925 | stopPhaseTimer();
|
14926 | }
|
14927 | if (typeof instance.componentDidMount === 'function') {
|
14928 | workInProgress.effectTag |= Update;
|
14929 | }
|
14930 | } else {
|
14931 |
|
14932 |
|
14933 | if (typeof instance.componentDidMount === 'function') {
|
14934 | workInProgress.effectTag |= Update;
|
14935 | }
|
14936 |
|
14937 |
|
14938 |
|
14939 | workInProgress.memoizedProps = newProps;
|
14940 | workInProgress.memoizedState = newState;
|
14941 | }
|
14942 |
|
14943 |
|
14944 |
|
14945 | instance.props = newProps;
|
14946 | instance.state = newState;
|
14947 | instance.context = nextContext;
|
14948 |
|
14949 | return shouldUpdate;
|
14950 | }
|
14951 |
|
14952 |
|
14953 | function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) {
|
14954 | var instance = workInProgress.stateNode;
|
14955 |
|
14956 | var oldProps = workInProgress.memoizedProps;
|
14957 | instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps);
|
14958 |
|
14959 | var oldContext = instance.context;
|
14960 | var contextType = ctor.contextType;
|
14961 | var nextContext = void 0;
|
14962 | if (typeof contextType === 'object' && contextType !== null) {
|
14963 | nextContext = readContext$1(contextType);
|
14964 | } else {
|
14965 | var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
|
14966 | nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);
|
14967 | }
|
14968 |
|
14969 | var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
|
14970 | var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function';
|
14971 |
|
14972 |
|
14973 |
|
14974 |
|
14975 |
|
14976 |
|
14977 |
|
14978 | if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
|
14979 | if (oldProps !== newProps || oldContext !== nextContext) {
|
14980 | callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
|
14981 | }
|
14982 | }
|
14983 |
|
14984 | resetHasForceUpdateBeforeProcessing();
|
14985 |
|
14986 | var oldState = workInProgress.memoizedState;
|
14987 | var newState = instance.state = oldState;
|
14988 | var updateQueue = workInProgress.updateQueue;
|
14989 | if (updateQueue !== null) {
|
14990 | processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
|
14991 | newState = workInProgress.memoizedState;
|
14992 | }
|
14993 |
|
14994 | if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
|
14995 |
|
14996 |
|
14997 | if (typeof instance.componentDidUpdate === 'function') {
|
14998 | if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
|
14999 | workInProgress.effectTag |= Update;
|
15000 | }
|
15001 | }
|
15002 | if (typeof instance.getSnapshotBeforeUpdate === 'function') {
|
15003 | if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
|
15004 | workInProgress.effectTag |= Snapshot;
|
15005 | }
|
15006 | }
|
15007 | return false;
|
15008 | }
|
15009 |
|
15010 | if (typeof getDerivedStateFromProps === 'function') {
|
15011 | applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
|
15012 | newState = workInProgress.memoizedState;
|
15013 | }
|
15014 |
|
15015 | var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);
|
15016 |
|
15017 | if (shouldUpdate) {
|
15018 |
|
15019 |
|
15020 | if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {
|
15021 | startPhaseTimer(workInProgress, 'componentWillUpdate');
|
15022 | if (typeof instance.componentWillUpdate === 'function') {
|
15023 | instance.componentWillUpdate(newProps, newState, nextContext);
|
15024 | }
|
15025 | if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
|
15026 | instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
|
15027 | }
|
15028 | stopPhaseTimer();
|
15029 | }
|
15030 | if (typeof instance.componentDidUpdate === 'function') {
|
15031 | workInProgress.effectTag |= Update;
|
15032 | }
|
15033 | if (typeof instance.getSnapshotBeforeUpdate === 'function') {
|
15034 | workInProgress.effectTag |= Snapshot;
|
15035 | }
|
15036 | } else {
|
15037 |
|
15038 |
|
15039 | if (typeof instance.componentDidUpdate === 'function') {
|
15040 | if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
|
15041 | workInProgress.effectTag |= Update;
|
15042 | }
|
15043 | }
|
15044 | if (typeof instance.getSnapshotBeforeUpdate === 'function') {
|
15045 | if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
|
15046 | workInProgress.effectTag |= Snapshot;
|
15047 | }
|
15048 | }
|
15049 |
|
15050 |
|
15051 |
|
15052 | workInProgress.memoizedProps = newProps;
|
15053 | workInProgress.memoizedState = newState;
|
15054 | }
|
15055 |
|
15056 |
|
15057 |
|
15058 | instance.props = newProps;
|
15059 | instance.state = newState;
|
15060 | instance.context = nextContext;
|
15061 |
|
15062 | return shouldUpdate;
|
15063 | }
|
15064 |
|
15065 | var didWarnAboutMaps = void 0;
|
15066 | var didWarnAboutGenerators = void 0;
|
15067 | var didWarnAboutStringRefInStrictMode = void 0;
|
15068 | var ownerHasKeyUseWarning = void 0;
|
15069 | var ownerHasFunctionTypeWarning = void 0;
|
15070 | var warnForMissingKey = function (child) {};
|
15071 |
|
15072 | {
|
15073 | didWarnAboutMaps = false;
|
15074 | didWarnAboutGenerators = false;
|
15075 | didWarnAboutStringRefInStrictMode = {};
|
15076 |
|
15077 | |
15078 |
|
15079 |
|
15080 |
|
15081 |
|
15082 | ownerHasKeyUseWarning = {};
|
15083 | ownerHasFunctionTypeWarning = {};
|
15084 |
|
15085 | warnForMissingKey = function (child) {
|
15086 | if (child === null || typeof child !== 'object') {
|
15087 | return;
|
15088 | }
|
15089 | if (!child._store || child._store.validated || child.key != null) {
|
15090 | return;
|
15091 | }
|
15092 | !(typeof child._store === 'object') ? invariant(false, 'React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
15093 | child._store.validated = true;
|
15094 |
|
15095 | var currentComponentErrorInfo = 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev();
|
15096 | if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
15097 | return;
|
15098 | }
|
15099 | ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
15100 |
|
15101 | warning$1(false, 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.');
|
15102 | };
|
15103 | }
|
15104 |
|
15105 | var isArray = Array.isArray;
|
15106 |
|
15107 | function coerceRef(returnFiber, current$$1, element) {
|
15108 | var mixedRef = element.ref;
|
15109 | if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {
|
15110 | {
|
15111 | if (returnFiber.mode & StrictMode) {
|
15112 | var componentName = getComponentName(returnFiber.type) || 'Component';
|
15113 | if (!didWarnAboutStringRefInStrictMode[componentName]) {
|
15114 | warningWithoutStack$1(false, 'A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using createRef() instead.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-string-ref', mixedRef, getStackByFiberInDevAndProd(returnFiber));
|
15115 | didWarnAboutStringRefInStrictMode[componentName] = true;
|
15116 | }
|
15117 | }
|
15118 | }
|
15119 |
|
15120 | if (element._owner) {
|
15121 | var owner = element._owner;
|
15122 | var inst = void 0;
|
15123 | if (owner) {
|
15124 | var ownerFiber = owner;
|
15125 | !(ownerFiber.tag === ClassComponent) ? invariant(false, 'Function components cannot have refs.') : void 0;
|
15126 | inst = ownerFiber.stateNode;
|
15127 | }
|
15128 | !inst ? invariant(false, 'Missing owner for string ref %s. This error is likely caused by a bug in React. Please file an issue.', mixedRef) : void 0;
|
15129 | var stringRef = '' + mixedRef;
|
15130 |
|
15131 | if (current$$1 !== null && current$$1.ref !== null && typeof current$$1.ref === 'function' && current$$1.ref._stringRef === stringRef) {
|
15132 | return current$$1.ref;
|
15133 | }
|
15134 | var ref = function (value) {
|
15135 | var refs = inst.refs;
|
15136 | if (refs === emptyRefsObject) {
|
15137 |
|
15138 | refs = inst.refs = {};
|
15139 | }
|
15140 | if (value === null) {
|
15141 | delete refs[stringRef];
|
15142 | } else {
|
15143 | refs[stringRef] = value;
|
15144 | }
|
15145 | };
|
15146 | ref._stringRef = stringRef;
|
15147 | return ref;
|
15148 | } else {
|
15149 | !(typeof mixedRef === 'string') ? invariant(false, 'Expected ref to be a function, a string, an object returned by React.createRef(), or null.') : void 0;
|
15150 | !element._owner ? invariant(false, 'Element ref was specified as a string (%s) but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component\'s render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information.', mixedRef) : void 0;
|
15151 | }
|
15152 | }
|
15153 | return mixedRef;
|
15154 | }
|
15155 |
|
15156 | function throwOnInvalidObjectType(returnFiber, newChild) {
|
15157 | if (returnFiber.type !== 'textarea') {
|
15158 | var addendum = '';
|
15159 | {
|
15160 | addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev();
|
15161 | }
|
15162 | invariant(false, 'Objects are not valid as a React child (found: %s).%s', Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild, addendum);
|
15163 | }
|
15164 | }
|
15165 |
|
15166 | function warnOnFunctionType() {
|
15167 | var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev();
|
15168 |
|
15169 | if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {
|
15170 | return;
|
15171 | }
|
15172 | ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;
|
15173 |
|
15174 | warning$1(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');
|
15175 | }
|
15176 |
|
15177 |
|
15178 |
|
15179 |
|
15180 |
|
15181 | function ChildReconciler(shouldTrackSideEffects) {
|
15182 | function deleteChild(returnFiber, childToDelete) {
|
15183 | if (!shouldTrackSideEffects) {
|
15184 |
|
15185 | return;
|
15186 | }
|
15187 |
|
15188 |
|
15189 |
|
15190 |
|
15191 |
|
15192 | var last = returnFiber.lastEffect;
|
15193 | if (last !== null) {
|
15194 | last.nextEffect = childToDelete;
|
15195 | returnFiber.lastEffect = childToDelete;
|
15196 | } else {
|
15197 | returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
|
15198 | }
|
15199 | childToDelete.nextEffect = null;
|
15200 | childToDelete.effectTag = Deletion;
|
15201 | }
|
15202 |
|
15203 | function deleteRemainingChildren(returnFiber, currentFirstChild) {
|
15204 | if (!shouldTrackSideEffects) {
|
15205 |
|
15206 | return null;
|
15207 | }
|
15208 |
|
15209 |
|
15210 |
|
15211 | var childToDelete = currentFirstChild;
|
15212 | while (childToDelete !== null) {
|
15213 | deleteChild(returnFiber, childToDelete);
|
15214 | childToDelete = childToDelete.sibling;
|
15215 | }
|
15216 | return null;
|
15217 | }
|
15218 |
|
15219 | function mapRemainingChildren(returnFiber, currentFirstChild) {
|
15220 |
|
15221 |
|
15222 | var existingChildren = new Map();
|
15223 |
|
15224 | var existingChild = currentFirstChild;
|
15225 | while (existingChild !== null) {
|
15226 | if (existingChild.key !== null) {
|
15227 | existingChildren.set(existingChild.key, existingChild);
|
15228 | } else {
|
15229 | existingChildren.set(existingChild.index, existingChild);
|
15230 | }
|
15231 | existingChild = existingChild.sibling;
|
15232 | }
|
15233 | return existingChildren;
|
15234 | }
|
15235 |
|
15236 | function useFiber(fiber, pendingProps, expirationTime) {
|
15237 |
|
15238 |
|
15239 | var clone = createWorkInProgress(fiber, pendingProps, expirationTime);
|
15240 | clone.index = 0;
|
15241 | clone.sibling = null;
|
15242 | return clone;
|
15243 | }
|
15244 |
|
15245 | function placeChild(newFiber, lastPlacedIndex, newIndex) {
|
15246 | newFiber.index = newIndex;
|
15247 | if (!shouldTrackSideEffects) {
|
15248 |
|
15249 | return lastPlacedIndex;
|
15250 | }
|
15251 | var current$$1 = newFiber.alternate;
|
15252 | if (current$$1 !== null) {
|
15253 | var oldIndex = current$$1.index;
|
15254 | if (oldIndex < lastPlacedIndex) {
|
15255 |
|
15256 | newFiber.effectTag = Placement;
|
15257 | return lastPlacedIndex;
|
15258 | } else {
|
15259 |
|
15260 | return oldIndex;
|
15261 | }
|
15262 | } else {
|
15263 |
|
15264 | newFiber.effectTag = Placement;
|
15265 | return lastPlacedIndex;
|
15266 | }
|
15267 | }
|
15268 |
|
15269 | function placeSingleChild(newFiber) {
|
15270 |
|
15271 |
|
15272 | if (shouldTrackSideEffects && newFiber.alternate === null) {
|
15273 | newFiber.effectTag = Placement;
|
15274 | }
|
15275 | return newFiber;
|
15276 | }
|
15277 |
|
15278 | function updateTextNode(returnFiber, current$$1, textContent, expirationTime) {
|
15279 | if (current$$1 === null || current$$1.tag !== HostText) {
|
15280 |
|
15281 | var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
|
15282 | created.return = returnFiber;
|
15283 | return created;
|
15284 | } else {
|
15285 |
|
15286 | var existing = useFiber(current$$1, textContent, expirationTime);
|
15287 | existing.return = returnFiber;
|
15288 | return existing;
|
15289 | }
|
15290 | }
|
15291 |
|
15292 | function updateElement(returnFiber, current$$1, element, expirationTime) {
|
15293 | if (current$$1 !== null && current$$1.elementType === element.type) {
|
15294 |
|
15295 | var existing = useFiber(current$$1, element.props, expirationTime);
|
15296 | existing.ref = coerceRef(returnFiber, current$$1, element);
|
15297 | existing.return = returnFiber;
|
15298 | {
|
15299 | existing._debugSource = element._source;
|
15300 | existing._debugOwner = element._owner;
|
15301 | }
|
15302 | return existing;
|
15303 | } else {
|
15304 |
|
15305 | var created = createFiberFromElement(element, returnFiber.mode, expirationTime);
|
15306 | created.ref = coerceRef(returnFiber, current$$1, element);
|
15307 | created.return = returnFiber;
|
15308 | return created;
|
15309 | }
|
15310 | }
|
15311 |
|
15312 | function updatePortal(returnFiber, current$$1, portal, expirationTime) {
|
15313 | if (current$$1 === null || current$$1.tag !== HostPortal || current$$1.stateNode.containerInfo !== portal.containerInfo || current$$1.stateNode.implementation !== portal.implementation) {
|
15314 |
|
15315 | var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
|
15316 | created.return = returnFiber;
|
15317 | return created;
|
15318 | } else {
|
15319 |
|
15320 | var existing = useFiber(current$$1, portal.children || [], expirationTime);
|
15321 | existing.return = returnFiber;
|
15322 | return existing;
|
15323 | }
|
15324 | }
|
15325 |
|
15326 | function updateFragment(returnFiber, current$$1, fragment, expirationTime, key) {
|
15327 | if (current$$1 === null || current$$1.tag !== Fragment) {
|
15328 |
|
15329 | var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key);
|
15330 | created.return = returnFiber;
|
15331 | return created;
|
15332 | } else {
|
15333 |
|
15334 | var existing = useFiber(current$$1, fragment, expirationTime);
|
15335 | existing.return = returnFiber;
|
15336 | return existing;
|
15337 | }
|
15338 | }
|
15339 |
|
15340 | function createChild(returnFiber, newChild, expirationTime) {
|
15341 | if (typeof newChild === 'string' || typeof newChild === 'number') {
|
15342 |
|
15343 |
|
15344 |
|
15345 | var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime);
|
15346 | created.return = returnFiber;
|
15347 | return created;
|
15348 | }
|
15349 |
|
15350 | if (typeof newChild === 'object' && newChild !== null) {
|
15351 | switch (newChild.$$typeof) {
|
15352 | case REACT_ELEMENT_TYPE:
|
15353 | {
|
15354 | var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime);
|
15355 | _created.ref = coerceRef(returnFiber, null, newChild);
|
15356 | _created.return = returnFiber;
|
15357 | return _created;
|
15358 | }
|
15359 | case REACT_PORTAL_TYPE:
|
15360 | {
|
15361 | var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime);
|
15362 | _created2.return = returnFiber;
|
15363 | return _created2;
|
15364 | }
|
15365 | }
|
15366 |
|
15367 | if (isArray(newChild) || getIteratorFn(newChild)) {
|
15368 | var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null);
|
15369 | _created3.return = returnFiber;
|
15370 | return _created3;
|
15371 | }
|
15372 |
|
15373 | throwOnInvalidObjectType(returnFiber, newChild);
|
15374 | }
|
15375 |
|
15376 | {
|
15377 | if (typeof newChild === 'function') {
|
15378 | warnOnFunctionType();
|
15379 | }
|
15380 | }
|
15381 |
|
15382 | return null;
|
15383 | }
|
15384 |
|
15385 | function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {
|
15386 |
|
15387 |
|
15388 | var key = oldFiber !== null ? oldFiber.key : null;
|
15389 |
|
15390 | if (typeof newChild === 'string' || typeof newChild === 'number') {
|
15391 |
|
15392 |
|
15393 |
|
15394 | if (key !== null) {
|
15395 | return null;
|
15396 | }
|
15397 | return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);
|
15398 | }
|
15399 |
|
15400 | if (typeof newChild === 'object' && newChild !== null) {
|
15401 | switch (newChild.$$typeof) {
|
15402 | case REACT_ELEMENT_TYPE:
|
15403 | {
|
15404 | if (newChild.key === key) {
|
15405 | if (newChild.type === REACT_FRAGMENT_TYPE) {
|
15406 | return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);
|
15407 | }
|
15408 | return updateElement(returnFiber, oldFiber, newChild, expirationTime);
|
15409 | } else {
|
15410 | return null;
|
15411 | }
|
15412 | }
|
15413 | case REACT_PORTAL_TYPE:
|
15414 | {
|
15415 | if (newChild.key === key) {
|
15416 | return updatePortal(returnFiber, oldFiber, newChild, expirationTime);
|
15417 | } else {
|
15418 | return null;
|
15419 | }
|
15420 | }
|
15421 | }
|
15422 |
|
15423 | if (isArray(newChild) || getIteratorFn(newChild)) {
|
15424 | if (key !== null) {
|
15425 | return null;
|
15426 | }
|
15427 |
|
15428 | return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);
|
15429 | }
|
15430 |
|
15431 | throwOnInvalidObjectType(returnFiber, newChild);
|
15432 | }
|
15433 |
|
15434 | {
|
15435 | if (typeof newChild === 'function') {
|
15436 | warnOnFunctionType();
|
15437 | }
|
15438 | }
|
15439 |
|
15440 | return null;
|
15441 | }
|
15442 |
|
15443 | function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {
|
15444 | if (typeof newChild === 'string' || typeof newChild === 'number') {
|
15445 |
|
15446 |
|
15447 | var matchedFiber = existingChildren.get(newIdx) || null;
|
15448 | return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);
|
15449 | }
|
15450 |
|
15451 | if (typeof newChild === 'object' && newChild !== null) {
|
15452 | switch (newChild.$$typeof) {
|
15453 | case REACT_ELEMENT_TYPE:
|
15454 | {
|
15455 | var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
|
15456 | if (newChild.type === REACT_FRAGMENT_TYPE) {
|
15457 | return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);
|
15458 | }
|
15459 | return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);
|
15460 | }
|
15461 | case REACT_PORTAL_TYPE:
|
15462 | {
|
15463 | var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
|
15464 | return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime);
|
15465 | }
|
15466 | }
|
15467 |
|
15468 | if (isArray(newChild) || getIteratorFn(newChild)) {
|
15469 | var _matchedFiber3 = existingChildren.get(newIdx) || null;
|
15470 | return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null);
|
15471 | }
|
15472 |
|
15473 | throwOnInvalidObjectType(returnFiber, newChild);
|
15474 | }
|
15475 |
|
15476 | {
|
15477 | if (typeof newChild === 'function') {
|
15478 | warnOnFunctionType();
|
15479 | }
|
15480 | }
|
15481 |
|
15482 | return null;
|
15483 | }
|
15484 |
|
15485 | |
15486 |
|
15487 |
|
15488 | function warnOnInvalidKey(child, knownKeys) {
|
15489 | {
|
15490 | if (typeof child !== 'object' || child === null) {
|
15491 | return knownKeys;
|
15492 | }
|
15493 | switch (child.$$typeof) {
|
15494 | case REACT_ELEMENT_TYPE:
|
15495 | case REACT_PORTAL_TYPE:
|
15496 | warnForMissingKey(child);
|
15497 | var key = child.key;
|
15498 | if (typeof key !== 'string') {
|
15499 | break;
|
15500 | }
|
15501 | if (knownKeys === null) {
|
15502 | knownKeys = new Set();
|
15503 | knownKeys.add(key);
|
15504 | break;
|
15505 | }
|
15506 | if (!knownKeys.has(key)) {
|
15507 | knownKeys.add(key);
|
15508 | break;
|
15509 | }
|
15510 | warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);
|
15511 | break;
|
15512 | default:
|
15513 | break;
|
15514 | }
|
15515 | }
|
15516 | return knownKeys;
|
15517 | }
|
15518 |
|
15519 | function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {
|
15520 |
|
15521 |
|
15522 |
|
15523 |
|
15524 |
|
15525 |
|
15526 |
|
15527 |
|
15528 |
|
15529 |
|
15530 |
|
15531 |
|
15532 |
|
15533 |
|
15534 |
|
15535 |
|
15536 |
|
15537 |
|
15538 |
|
15539 | {
|
15540 |
|
15541 | var knownKeys = null;
|
15542 | for (var i = 0; i < newChildren.length; i++) {
|
15543 | var child = newChildren[i];
|
15544 | knownKeys = warnOnInvalidKey(child, knownKeys);
|
15545 | }
|
15546 | }
|
15547 |
|
15548 | var resultingFirstChild = null;
|
15549 | var previousNewFiber = null;
|
15550 |
|
15551 | var oldFiber = currentFirstChild;
|
15552 | var lastPlacedIndex = 0;
|
15553 | var newIdx = 0;
|
15554 | var nextOldFiber = null;
|
15555 | for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
|
15556 | if (oldFiber.index > newIdx) {
|
15557 | nextOldFiber = oldFiber;
|
15558 | oldFiber = null;
|
15559 | } else {
|
15560 | nextOldFiber = oldFiber.sibling;
|
15561 | }
|
15562 | var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);
|
15563 | if (newFiber === null) {
|
15564 |
|
15565 |
|
15566 |
|
15567 |
|
15568 | if (oldFiber === null) {
|
15569 | oldFiber = nextOldFiber;
|
15570 | }
|
15571 | break;
|
15572 | }
|
15573 | if (shouldTrackSideEffects) {
|
15574 | if (oldFiber && newFiber.alternate === null) {
|
15575 |
|
15576 |
|
15577 | deleteChild(returnFiber, oldFiber);
|
15578 | }
|
15579 | }
|
15580 | lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
|
15581 | if (previousNewFiber === null) {
|
15582 |
|
15583 | resultingFirstChild = newFiber;
|
15584 | } else {
|
15585 |
|
15586 |
|
15587 |
|
15588 |
|
15589 | previousNewFiber.sibling = newFiber;
|
15590 | }
|
15591 | previousNewFiber = newFiber;
|
15592 | oldFiber = nextOldFiber;
|
15593 | }
|
15594 |
|
15595 | if (newIdx === newChildren.length) {
|
15596 |
|
15597 | deleteRemainingChildren(returnFiber, oldFiber);
|
15598 | return resultingFirstChild;
|
15599 | }
|
15600 |
|
15601 | if (oldFiber === null) {
|
15602 |
|
15603 |
|
15604 | for (; newIdx < newChildren.length; newIdx++) {
|
15605 | var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);
|
15606 | if (!_newFiber) {
|
15607 | continue;
|
15608 | }
|
15609 | lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
|
15610 | if (previousNewFiber === null) {
|
15611 |
|
15612 | resultingFirstChild = _newFiber;
|
15613 | } else {
|
15614 | previousNewFiber.sibling = _newFiber;
|
15615 | }
|
15616 | previousNewFiber = _newFiber;
|
15617 | }
|
15618 | return resultingFirstChild;
|
15619 | }
|
15620 |
|
15621 |
|
15622 | var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
|
15623 |
|
15624 |
|
15625 | for (; newIdx < newChildren.length; newIdx++) {
|
15626 | var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);
|
15627 | if (_newFiber2) {
|
15628 | if (shouldTrackSideEffects) {
|
15629 | if (_newFiber2.alternate !== null) {
|
15630 |
|
15631 |
|
15632 |
|
15633 |
|
15634 | existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
|
15635 | }
|
15636 | }
|
15637 | lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
|
15638 | if (previousNewFiber === null) {
|
15639 | resultingFirstChild = _newFiber2;
|
15640 | } else {
|
15641 | previousNewFiber.sibling = _newFiber2;
|
15642 | }
|
15643 | previousNewFiber = _newFiber2;
|
15644 | }
|
15645 | }
|
15646 |
|
15647 | if (shouldTrackSideEffects) {
|
15648 |
|
15649 |
|
15650 | existingChildren.forEach(function (child) {
|
15651 | return deleteChild(returnFiber, child);
|
15652 | });
|
15653 | }
|
15654 |
|
15655 | return resultingFirstChild;
|
15656 | }
|
15657 |
|
15658 | function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {
|
15659 |
|
15660 |
|
15661 |
|
15662 | var iteratorFn = getIteratorFn(newChildrenIterable);
|
15663 | !(typeof iteratorFn === 'function') ? invariant(false, 'An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
15664 |
|
15665 | {
|
15666 |
|
15667 |
|
15668 | if (typeof Symbol === 'function' &&
|
15669 |
|
15670 | newChildrenIterable[Symbol.toStringTag] === 'Generator') {
|
15671 | !didWarnAboutGenerators ? warning$1(false, 'Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.') : void 0;
|
15672 | didWarnAboutGenerators = true;
|
15673 | }
|
15674 |
|
15675 |
|
15676 | if (newChildrenIterable.entries === iteratorFn) {
|
15677 | !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
|
15678 | didWarnAboutMaps = true;
|
15679 | }
|
15680 |
|
15681 |
|
15682 |
|
15683 | var _newChildren = iteratorFn.call(newChildrenIterable);
|
15684 | if (_newChildren) {
|
15685 | var knownKeys = null;
|
15686 | var _step = _newChildren.next();
|
15687 | for (; !_step.done; _step = _newChildren.next()) {
|
15688 | var child = _step.value;
|
15689 | knownKeys = warnOnInvalidKey(child, knownKeys);
|
15690 | }
|
15691 | }
|
15692 | }
|
15693 |
|
15694 | var newChildren = iteratorFn.call(newChildrenIterable);
|
15695 | !(newChildren != null) ? invariant(false, 'An iterable object provided no iterator.') : void 0;
|
15696 |
|
15697 | var resultingFirstChild = null;
|
15698 | var previousNewFiber = null;
|
15699 |
|
15700 | var oldFiber = currentFirstChild;
|
15701 | var lastPlacedIndex = 0;
|
15702 | var newIdx = 0;
|
15703 | var nextOldFiber = null;
|
15704 |
|
15705 | var step = newChildren.next();
|
15706 | for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
|
15707 | if (oldFiber.index > newIdx) {
|
15708 | nextOldFiber = oldFiber;
|
15709 | oldFiber = null;
|
15710 | } else {
|
15711 | nextOldFiber = oldFiber.sibling;
|
15712 | }
|
15713 | var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);
|
15714 | if (newFiber === null) {
|
15715 |
|
15716 |
|
15717 |
|
15718 |
|
15719 | if (!oldFiber) {
|
15720 | oldFiber = nextOldFiber;
|
15721 | }
|
15722 | break;
|
15723 | }
|
15724 | if (shouldTrackSideEffects) {
|
15725 | if (oldFiber && newFiber.alternate === null) {
|
15726 |
|
15727 |
|
15728 | deleteChild(returnFiber, oldFiber);
|
15729 | }
|
15730 | }
|
15731 | lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
|
15732 | if (previousNewFiber === null) {
|
15733 |
|
15734 | resultingFirstChild = newFiber;
|
15735 | } else {
|
15736 |
|
15737 |
|
15738 |
|
15739 |
|
15740 | previousNewFiber.sibling = newFiber;
|
15741 | }
|
15742 | previousNewFiber = newFiber;
|
15743 | oldFiber = nextOldFiber;
|
15744 | }
|
15745 |
|
15746 | if (step.done) {
|
15747 |
|
15748 | deleteRemainingChildren(returnFiber, oldFiber);
|
15749 | return resultingFirstChild;
|
15750 | }
|
15751 |
|
15752 | if (oldFiber === null) {
|
15753 |
|
15754 |
|
15755 | for (; !step.done; newIdx++, step = newChildren.next()) {
|
15756 | var _newFiber3 = createChild(returnFiber, step.value, expirationTime);
|
15757 | if (_newFiber3 === null) {
|
15758 | continue;
|
15759 | }
|
15760 | lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
|
15761 | if (previousNewFiber === null) {
|
15762 |
|
15763 | resultingFirstChild = _newFiber3;
|
15764 | } else {
|
15765 | previousNewFiber.sibling = _newFiber3;
|
15766 | }
|
15767 | previousNewFiber = _newFiber3;
|
15768 | }
|
15769 | return resultingFirstChild;
|
15770 | }
|
15771 |
|
15772 |
|
15773 | var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
|
15774 |
|
15775 |
|
15776 | for (; !step.done; newIdx++, step = newChildren.next()) {
|
15777 | var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);
|
15778 | if (_newFiber4 !== null) {
|
15779 | if (shouldTrackSideEffects) {
|
15780 | if (_newFiber4.alternate !== null) {
|
15781 |
|
15782 |
|
15783 |
|
15784 |
|
15785 | existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
|
15786 | }
|
15787 | }
|
15788 | lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
|
15789 | if (previousNewFiber === null) {
|
15790 | resultingFirstChild = _newFiber4;
|
15791 | } else {
|
15792 | previousNewFiber.sibling = _newFiber4;
|
15793 | }
|
15794 | previousNewFiber = _newFiber4;
|
15795 | }
|
15796 | }
|
15797 |
|
15798 | if (shouldTrackSideEffects) {
|
15799 |
|
15800 |
|
15801 | existingChildren.forEach(function (child) {
|
15802 | return deleteChild(returnFiber, child);
|
15803 | });
|
15804 | }
|
15805 |
|
15806 | return resultingFirstChild;
|
15807 | }
|
15808 |
|
15809 | function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
|
15810 |
|
15811 |
|
15812 | if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
|
15813 |
|
15814 |
|
15815 | deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
|
15816 | var existing = useFiber(currentFirstChild, textContent, expirationTime);
|
15817 | existing.return = returnFiber;
|
15818 | return existing;
|
15819 | }
|
15820 |
|
15821 |
|
15822 | deleteRemainingChildren(returnFiber, currentFirstChild);
|
15823 | var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
|
15824 | created.return = returnFiber;
|
15825 | return created;
|
15826 | }
|
15827 |
|
15828 | function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
|
15829 | var key = element.key;
|
15830 | var child = currentFirstChild;
|
15831 | while (child !== null) {
|
15832 |
|
15833 |
|
15834 | if (child.key === key) {
|
15835 | if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.elementType === element.type) {
|
15836 | deleteRemainingChildren(returnFiber, child.sibling);
|
15837 | var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime);
|
15838 | existing.ref = coerceRef(returnFiber, child, element);
|
15839 | existing.return = returnFiber;
|
15840 | {
|
15841 | existing._debugSource = element._source;
|
15842 | existing._debugOwner = element._owner;
|
15843 | }
|
15844 | return existing;
|
15845 | } else {
|
15846 | deleteRemainingChildren(returnFiber, child);
|
15847 | break;
|
15848 | }
|
15849 | } else {
|
15850 | deleteChild(returnFiber, child);
|
15851 | }
|
15852 | child = child.sibling;
|
15853 | }
|
15854 |
|
15855 | if (element.type === REACT_FRAGMENT_TYPE) {
|
15856 | var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);
|
15857 | created.return = returnFiber;
|
15858 | return created;
|
15859 | } else {
|
15860 | var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);
|
15861 | _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
|
15862 | _created4.return = returnFiber;
|
15863 | return _created4;
|
15864 | }
|
15865 | }
|
15866 |
|
15867 | function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
|
15868 | var key = portal.key;
|
15869 | var child = currentFirstChild;
|
15870 | while (child !== null) {
|
15871 |
|
15872 |
|
15873 | if (child.key === key) {
|
15874 | if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
|
15875 | deleteRemainingChildren(returnFiber, child.sibling);
|
15876 | var existing = useFiber(child, portal.children || [], expirationTime);
|
15877 | existing.return = returnFiber;
|
15878 | return existing;
|
15879 | } else {
|
15880 | deleteRemainingChildren(returnFiber, child);
|
15881 | break;
|
15882 | }
|
15883 | } else {
|
15884 | deleteChild(returnFiber, child);
|
15885 | }
|
15886 | child = child.sibling;
|
15887 | }
|
15888 |
|
15889 | var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
|
15890 | created.return = returnFiber;
|
15891 | return created;
|
15892 | }
|
15893 |
|
15894 |
|
15895 |
|
15896 |
|
15897 | function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {
|
15898 |
|
15899 |
|
15900 |
|
15901 |
|
15902 |
|
15903 |
|
15904 |
|
15905 |
|
15906 | var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
|
15907 | if (isUnkeyedTopLevelFragment) {
|
15908 | newChild = newChild.props.children;
|
15909 | }
|
15910 |
|
15911 |
|
15912 | var isObject = typeof newChild === 'object' && newChild !== null;
|
15913 |
|
15914 | if (isObject) {
|
15915 | switch (newChild.$$typeof) {
|
15916 | case REACT_ELEMENT_TYPE:
|
15917 | return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));
|
15918 | case REACT_PORTAL_TYPE:
|
15919 | return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));
|
15920 | }
|
15921 | }
|
15922 |
|
15923 | if (typeof newChild === 'string' || typeof newChild === 'number') {
|
15924 | return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));
|
15925 | }
|
15926 |
|
15927 | if (isArray(newChild)) {
|
15928 | return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);
|
15929 | }
|
15930 |
|
15931 | if (getIteratorFn(newChild)) {
|
15932 | return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);
|
15933 | }
|
15934 |
|
15935 | if (isObject) {
|
15936 | throwOnInvalidObjectType(returnFiber, newChild);
|
15937 | }
|
15938 |
|
15939 | {
|
15940 | if (typeof newChild === 'function') {
|
15941 | warnOnFunctionType();
|
15942 | }
|
15943 | }
|
15944 | if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {
|
15945 |
|
15946 |
|
15947 |
|
15948 | switch (returnFiber.tag) {
|
15949 | case ClassComponent:
|
15950 | {
|
15951 | {
|
15952 | var instance = returnFiber.stateNode;
|
15953 | if (instance.render._isMockFunction) {
|
15954 |
|
15955 | break;
|
15956 | }
|
15957 | }
|
15958 | }
|
15959 |
|
15960 |
|
15961 |
|
15962 | case FunctionComponent:
|
15963 | {
|
15964 | var Component = returnFiber.type;
|
15965 | invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');
|
15966 | }
|
15967 | }
|
15968 | }
|
15969 |
|
15970 |
|
15971 | return deleteRemainingChildren(returnFiber, currentFirstChild);
|
15972 | }
|
15973 |
|
15974 | return reconcileChildFibers;
|
15975 | }
|
15976 |
|
15977 | var reconcileChildFibers = ChildReconciler(true);
|
15978 | var mountChildFibers = ChildReconciler(false);
|
15979 |
|
15980 | function cloneChildFibers(current$$1, workInProgress) {
|
15981 | !(current$$1 === null || workInProgress.child === current$$1.child) ? invariant(false, 'Resuming work not yet implemented.') : void 0;
|
15982 |
|
15983 | if (workInProgress.child === null) {
|
15984 | return;
|
15985 | }
|
15986 |
|
15987 | var currentChild = workInProgress.child;
|
15988 | var newChild = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
|
15989 | workInProgress.child = newChild;
|
15990 |
|
15991 | newChild.return = workInProgress;
|
15992 | while (currentChild.sibling !== null) {
|
15993 | currentChild = currentChild.sibling;
|
15994 | newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
|
15995 | newChild.return = workInProgress;
|
15996 | }
|
15997 | newChild.sibling = null;
|
15998 | }
|
15999 |
|
16000 |
|
16001 |
|
16002 | var hydrationParentFiber = null;
|
16003 | var nextHydratableInstance = null;
|
16004 | var isHydrating = false;
|
16005 |
|
16006 | function enterHydrationState(fiber) {
|
16007 | if (!supportsHydration) {
|
16008 | return false;
|
16009 | }
|
16010 |
|
16011 | var parentInstance = fiber.stateNode.containerInfo;
|
16012 | nextHydratableInstance = getFirstHydratableChild(parentInstance);
|
16013 | hydrationParentFiber = fiber;
|
16014 | isHydrating = true;
|
16015 | return true;
|
16016 | }
|
16017 |
|
16018 | function deleteHydratableInstance(returnFiber, instance) {
|
16019 | {
|
16020 | switch (returnFiber.tag) {
|
16021 | case HostRoot:
|
16022 | didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
|
16023 | break;
|
16024 | case HostComponent:
|
16025 | didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
|
16026 | break;
|
16027 | }
|
16028 | }
|
16029 |
|
16030 | var childToDelete = createFiberFromHostInstanceForDeletion();
|
16031 | childToDelete.stateNode = instance;
|
16032 | childToDelete.return = returnFiber;
|
16033 | childToDelete.effectTag = Deletion;
|
16034 |
|
16035 |
|
16036 |
|
16037 |
|
16038 |
|
16039 |
|
16040 | if (returnFiber.lastEffect !== null) {
|
16041 | returnFiber.lastEffect.nextEffect = childToDelete;
|
16042 | returnFiber.lastEffect = childToDelete;
|
16043 | } else {
|
16044 | returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
|
16045 | }
|
16046 | }
|
16047 |
|
16048 | function insertNonHydratedInstance(returnFiber, fiber) {
|
16049 | fiber.effectTag |= Placement;
|
16050 | {
|
16051 | switch (returnFiber.tag) {
|
16052 | case HostRoot:
|
16053 | {
|
16054 | var parentContainer = returnFiber.stateNode.containerInfo;
|
16055 | switch (fiber.tag) {
|
16056 | case HostComponent:
|
16057 | var type = fiber.type;
|
16058 | var props = fiber.pendingProps;
|
16059 | didNotFindHydratableContainerInstance(parentContainer, type, props);
|
16060 | break;
|
16061 | case HostText:
|
16062 | var text = fiber.pendingProps;
|
16063 | didNotFindHydratableContainerTextInstance(parentContainer, text);
|
16064 | break;
|
16065 | }
|
16066 | break;
|
16067 | }
|
16068 | case HostComponent:
|
16069 | {
|
16070 | var parentType = returnFiber.type;
|
16071 | var parentProps = returnFiber.memoizedProps;
|
16072 | var parentInstance = returnFiber.stateNode;
|
16073 | switch (fiber.tag) {
|
16074 | case HostComponent:
|
16075 | var _type = fiber.type;
|
16076 | var _props = fiber.pendingProps;
|
16077 | didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props);
|
16078 | break;
|
16079 | case HostText:
|
16080 | var _text = fiber.pendingProps;
|
16081 | didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
|
16082 | break;
|
16083 | }
|
16084 | break;
|
16085 | }
|
16086 | default:
|
16087 | return;
|
16088 | }
|
16089 | }
|
16090 | }
|
16091 |
|
16092 | function tryHydrate(fiber, nextInstance) {
|
16093 | switch (fiber.tag) {
|
16094 | case HostComponent:
|
16095 | {
|
16096 | var type = fiber.type;
|
16097 | var props = fiber.pendingProps;
|
16098 | var instance = canHydrateInstance(nextInstance, type, props);
|
16099 | if (instance !== null) {
|
16100 | fiber.stateNode = instance;
|
16101 | return true;
|
16102 | }
|
16103 | return false;
|
16104 | }
|
16105 | case HostText:
|
16106 | {
|
16107 | var text = fiber.pendingProps;
|
16108 | var textInstance = canHydrateTextInstance(nextInstance, text);
|
16109 | if (textInstance !== null) {
|
16110 | fiber.stateNode = textInstance;
|
16111 | return true;
|
16112 | }
|
16113 | return false;
|
16114 | }
|
16115 | default:
|
16116 | return false;
|
16117 | }
|
16118 | }
|
16119 |
|
16120 | function tryToClaimNextHydratableInstance(fiber) {
|
16121 | if (!isHydrating) {
|
16122 | return;
|
16123 | }
|
16124 | var nextInstance = nextHydratableInstance;
|
16125 | if (!nextInstance) {
|
16126 |
|
16127 | insertNonHydratedInstance(hydrationParentFiber, fiber);
|
16128 | isHydrating = false;
|
16129 | hydrationParentFiber = fiber;
|
16130 | return;
|
16131 | }
|
16132 | var firstAttemptedInstance = nextInstance;
|
16133 | if (!tryHydrate(fiber, nextInstance)) {
|
16134 |
|
16135 |
|
16136 |
|
16137 | nextInstance = getNextHydratableSibling(firstAttemptedInstance);
|
16138 | if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
|
16139 |
|
16140 | insertNonHydratedInstance(hydrationParentFiber, fiber);
|
16141 | isHydrating = false;
|
16142 | hydrationParentFiber = fiber;
|
16143 | return;
|
16144 | }
|
16145 |
|
16146 |
|
16147 |
|
16148 |
|
16149 | deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);
|
16150 | }
|
16151 | hydrationParentFiber = fiber;
|
16152 | nextHydratableInstance = getFirstHydratableChild(nextInstance);
|
16153 | }
|
16154 |
|
16155 | function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
|
16156 | if (!supportsHydration) {
|
16157 | invariant(false, 'Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.');
|
16158 | }
|
16159 |
|
16160 | var instance = fiber.stateNode;
|
16161 | var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber);
|
16162 |
|
16163 | fiber.updateQueue = updatePayload;
|
16164 |
|
16165 |
|
16166 | if (updatePayload !== null) {
|
16167 | return true;
|
16168 | }
|
16169 | return false;
|
16170 | }
|
16171 |
|
16172 | function prepareToHydrateHostTextInstance(fiber) {
|
16173 | if (!supportsHydration) {
|
16174 | invariant(false, 'Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.');
|
16175 | }
|
16176 |
|
16177 | var textInstance = fiber.stateNode;
|
16178 | var textContent = fiber.memoizedProps;
|
16179 | var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
|
16180 | {
|
16181 | if (shouldUpdate) {
|
16182 |
|
16183 |
|
16184 | var returnFiber = hydrationParentFiber;
|
16185 | if (returnFiber !== null) {
|
16186 | switch (returnFiber.tag) {
|
16187 | case HostRoot:
|
16188 | {
|
16189 | var parentContainer = returnFiber.stateNode.containerInfo;
|
16190 | didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
|
16191 | break;
|
16192 | }
|
16193 | case HostComponent:
|
16194 | {
|
16195 | var parentType = returnFiber.type;
|
16196 | var parentProps = returnFiber.memoizedProps;
|
16197 | var parentInstance = returnFiber.stateNode;
|
16198 | didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
|
16199 | break;
|
16200 | }
|
16201 | }
|
16202 | }
|
16203 | }
|
16204 | }
|
16205 | return shouldUpdate;
|
16206 | }
|
16207 |
|
16208 | function popToNextHostParent(fiber) {
|
16209 | var parent = fiber.return;
|
16210 | while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot) {
|
16211 | parent = parent.return;
|
16212 | }
|
16213 | hydrationParentFiber = parent;
|
16214 | }
|
16215 |
|
16216 | function popHydrationState(fiber) {
|
16217 | if (!supportsHydration) {
|
16218 | return false;
|
16219 | }
|
16220 | if (fiber !== hydrationParentFiber) {
|
16221 |
|
16222 |
|
16223 | return false;
|
16224 | }
|
16225 | if (!isHydrating) {
|
16226 |
|
16227 |
|
16228 |
|
16229 | popToNextHostParent(fiber);
|
16230 | isHydrating = true;
|
16231 | return false;
|
16232 | }
|
16233 |
|
16234 | var type = fiber.type;
|
16235 |
|
16236 |
|
16237 |
|
16238 |
|
16239 |
|
16240 |
|
16241 | if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {
|
16242 | var nextInstance = nextHydratableInstance;
|
16243 | while (nextInstance) {
|
16244 | deleteHydratableInstance(fiber, nextInstance);
|
16245 | nextInstance = getNextHydratableSibling(nextInstance);
|
16246 | }
|
16247 | }
|
16248 |
|
16249 | popToNextHostParent(fiber);
|
16250 | nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
|
16251 | return true;
|
16252 | }
|
16253 |
|
16254 | function resetHydrationState() {
|
16255 | if (!supportsHydration) {
|
16256 | return;
|
16257 | }
|
16258 |
|
16259 | hydrationParentFiber = null;
|
16260 | nextHydratableInstance = null;
|
16261 | isHydrating = false;
|
16262 | }
|
16263 |
|
16264 | var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
|
16265 |
|
16266 | var didWarnAboutBadClass = void 0;
|
16267 | var didWarnAboutContextTypeOnFunctionComponent = void 0;
|
16268 | var didWarnAboutGetDerivedStateOnFunctionComponent = void 0;
|
16269 | var didWarnAboutFunctionRefs = void 0;
|
16270 | var didWarnAboutReassigningProps = void 0;
|
16271 |
|
16272 | {
|
16273 | didWarnAboutBadClass = {};
|
16274 | didWarnAboutContextTypeOnFunctionComponent = {};
|
16275 | didWarnAboutGetDerivedStateOnFunctionComponent = {};
|
16276 | didWarnAboutFunctionRefs = {};
|
16277 | didWarnAboutReassigningProps = false;
|
16278 | }
|
16279 |
|
16280 | function reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime) {
|
16281 | if (current$$1 === null) {
|
16282 |
|
16283 |
|
16284 |
|
16285 |
|
16286 | workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
|
16287 | } else {
|
16288 |
|
16289 |
|
16290 |
|
16291 |
|
16292 |
|
16293 |
|
16294 | workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, nextChildren, renderExpirationTime);
|
16295 | }
|
16296 | }
|
16297 |
|
16298 | function forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime) {
|
16299 |
|
16300 |
|
16301 |
|
16302 |
|
16303 |
|
16304 |
|
16305 |
|
16306 |
|
16307 | workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, null, renderExpirationTime);
|
16308 |
|
16309 |
|
16310 |
|
16311 |
|
16312 | workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
|
16313 | }
|
16314 |
|
16315 | function updateForwardRef(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
|
16316 | {
|
16317 | if (workInProgress.type !== workInProgress.elementType) {
|
16318 |
|
16319 |
|
16320 | var innerPropTypes = Component.propTypes;
|
16321 | if (innerPropTypes) {
|
16322 | checkPropTypes(innerPropTypes, nextProps,
|
16323 | 'prop', getComponentName(Component), getCurrentFiberStackInDev);
|
16324 | }
|
16325 | }
|
16326 | }
|
16327 |
|
16328 | var render = Component.render;
|
16329 | var ref = workInProgress.ref;
|
16330 |
|
16331 |
|
16332 | var nextChildren = void 0;
|
16333 | prepareToReadContext(workInProgress, renderExpirationTime);
|
16334 | prepareToUseHooks(current$$1, workInProgress, renderExpirationTime);
|
16335 | {
|
16336 | ReactCurrentOwner$3.current = workInProgress;
|
16337 | setCurrentPhase('render');
|
16338 | nextChildren = render(nextProps, ref);
|
16339 | setCurrentPhase(null);
|
16340 | }
|
16341 | nextChildren = finishHooks(render, nextProps, nextChildren, ref);
|
16342 |
|
16343 |
|
16344 | workInProgress.effectTag |= PerformedWork;
|
16345 | reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
|
16346 | return workInProgress.child;
|
16347 | }
|
16348 |
|
16349 | function updateMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
|
16350 | if (current$$1 === null) {
|
16351 | var type = Component.type;
|
16352 | if (isSimpleFunctionComponent(type) && Component.compare === null &&
|
16353 |
|
16354 | Component.defaultProps === undefined) {
|
16355 |
|
16356 |
|
16357 |
|
16358 | workInProgress.tag = SimpleMemoComponent;
|
16359 | workInProgress.type = type;
|
16360 | {
|
16361 | validateFunctionComponentInDev(workInProgress, type);
|
16362 | }
|
16363 | return updateSimpleMemoComponent(current$$1, workInProgress, type, nextProps, updateExpirationTime, renderExpirationTime);
|
16364 | }
|
16365 | {
|
16366 | var innerPropTypes = type.propTypes;
|
16367 | if (innerPropTypes) {
|
16368 |
|
16369 |
|
16370 | checkPropTypes(innerPropTypes, nextProps,
|
16371 | 'prop', getComponentName(type), getCurrentFiberStackInDev);
|
16372 | }
|
16373 | }
|
16374 | var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime);
|
16375 | child.ref = workInProgress.ref;
|
16376 | child.return = workInProgress;
|
16377 | workInProgress.child = child;
|
16378 | return child;
|
16379 | }
|
16380 | {
|
16381 | var _type = Component.type;
|
16382 | var _innerPropTypes = _type.propTypes;
|
16383 | if (_innerPropTypes) {
|
16384 |
|
16385 |
|
16386 | checkPropTypes(_innerPropTypes, nextProps,
|
16387 | 'prop', getComponentName(_type), getCurrentFiberStackInDev);
|
16388 | }
|
16389 | }
|
16390 | var currentChild = current$$1.child;
|
16391 | if (updateExpirationTime < renderExpirationTime) {
|
16392 |
|
16393 |
|
16394 | var prevProps = currentChild.memoizedProps;
|
16395 |
|
16396 | var compare = Component.compare;
|
16397 | compare = compare !== null ? compare : shallowEqual;
|
16398 | if (compare(prevProps, nextProps) && current$$1.ref === workInProgress.ref) {
|
16399 | return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
|
16400 | }
|
16401 | }
|
16402 |
|
16403 | workInProgress.effectTag |= PerformedWork;
|
16404 | var newChild = createWorkInProgress(currentChild, nextProps, renderExpirationTime);
|
16405 | newChild.ref = workInProgress.ref;
|
16406 | newChild.return = workInProgress;
|
16407 | workInProgress.child = newChild;
|
16408 | return newChild;
|
16409 | }
|
16410 |
|
16411 | function updateSimpleMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
|
16412 | {
|
16413 | if (workInProgress.type !== workInProgress.elementType) {
|
16414 |
|
16415 |
|
16416 | var outerMemoType = workInProgress.elementType;
|
16417 | if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
|
16418 |
|
16419 |
|
16420 |
|
16421 | outerMemoType = refineResolvedLazyComponent(outerMemoType);
|
16422 | }
|
16423 | var outerPropTypes = outerMemoType && outerMemoType.propTypes;
|
16424 | if (outerPropTypes) {
|
16425 | checkPropTypes(outerPropTypes, nextProps,
|
16426 | 'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev);
|
16427 | }
|
16428 |
|
16429 | }
|
16430 | }
|
16431 | if (current$$1 !== null && updateExpirationTime < renderExpirationTime) {
|
16432 | var prevProps = current$$1.memoizedProps;
|
16433 | if (shallowEqual(prevProps, nextProps) && current$$1.ref === workInProgress.ref) {
|
16434 | return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
|
16435 | }
|
16436 | }
|
16437 | return updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime);
|
16438 | }
|
16439 |
|
16440 | function updateFragment(current$$1, workInProgress, renderExpirationTime) {
|
16441 | var nextChildren = workInProgress.pendingProps;
|
16442 | reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
|
16443 | return workInProgress.child;
|
16444 | }
|
16445 |
|
16446 | function updateMode(current$$1, workInProgress, renderExpirationTime) {
|
16447 | var nextChildren = workInProgress.pendingProps.children;
|
16448 | reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
|
16449 | return workInProgress.child;
|
16450 | }
|
16451 |
|
16452 | function updateProfiler(current$$1, workInProgress, renderExpirationTime) {
|
16453 | if (enableProfilerTimer) {
|
16454 | workInProgress.effectTag |= Update;
|
16455 | }
|
16456 | var nextProps = workInProgress.pendingProps;
|
16457 | var nextChildren = nextProps.children;
|
16458 | reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
|
16459 | return workInProgress.child;
|
16460 | }
|
16461 |
|
16462 | function markRef(current$$1, workInProgress) {
|
16463 | var ref = workInProgress.ref;
|
16464 | if (current$$1 === null && ref !== null || current$$1 !== null && current$$1.ref !== ref) {
|
16465 |
|
16466 | workInProgress.effectTag |= Ref;
|
16467 | }
|
16468 | }
|
16469 |
|
16470 | function updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
|
16471 | {
|
16472 | if (workInProgress.type !== workInProgress.elementType) {
|
16473 |
|
16474 |
|
16475 | var innerPropTypes = Component.propTypes;
|
16476 | if (innerPropTypes) {
|
16477 | checkPropTypes(innerPropTypes, nextProps,
|
16478 | 'prop', getComponentName(Component), getCurrentFiberStackInDev);
|
16479 | }
|
16480 | }
|
16481 | }
|
16482 |
|
16483 | var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
|
16484 | var context = getMaskedContext(workInProgress, unmaskedContext);
|
16485 |
|
16486 | var nextChildren = void 0;
|
16487 | prepareToReadContext(workInProgress, renderExpirationTime);
|
16488 | prepareToUseHooks(current$$1, workInProgress, renderExpirationTime);
|
16489 | {
|
16490 | ReactCurrentOwner$3.current = workInProgress;
|
16491 | setCurrentPhase('render');
|
16492 | nextChildren = Component(nextProps, context);
|
16493 | setCurrentPhase(null);
|
16494 | }
|
16495 | nextChildren = finishHooks(Component, nextProps, nextChildren, context);
|
16496 |
|
16497 |
|
16498 | workInProgress.effectTag |= PerformedWork;
|
16499 | reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
|
16500 | return workInProgress.child;
|
16501 | }
|
16502 |
|
16503 | function updateClassComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
|
16504 | {
|
16505 | if (workInProgress.type !== workInProgress.elementType) {
|
16506 |
|
16507 |
|
16508 | var innerPropTypes = Component.propTypes;
|
16509 | if (innerPropTypes) {
|
16510 | checkPropTypes(innerPropTypes, nextProps,
|
16511 | 'prop', getComponentName(Component), getCurrentFiberStackInDev);
|
16512 | }
|
16513 | }
|
16514 | }
|
16515 |
|
16516 |
|
16517 |
|
16518 |
|
16519 | var hasContext = void 0;
|
16520 | if (isContextProvider(Component)) {
|
16521 | hasContext = true;
|
16522 | pushContextProvider(workInProgress);
|
16523 | } else {
|
16524 | hasContext = false;
|
16525 | }
|
16526 | prepareToReadContext(workInProgress, renderExpirationTime);
|
16527 |
|
16528 | var instance = workInProgress.stateNode;
|
16529 | var shouldUpdate = void 0;
|
16530 | if (instance === null) {
|
16531 | if (current$$1 !== null) {
|
16532 |
|
16533 |
|
16534 |
|
16535 |
|
16536 | current$$1.alternate = null;
|
16537 | workInProgress.alternate = null;
|
16538 |
|
16539 | workInProgress.effectTag |= Placement;
|
16540 | }
|
16541 |
|
16542 | constructClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
|
16543 | mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
|
16544 | shouldUpdate = true;
|
16545 | } else if (current$$1 === null) {
|
16546 |
|
16547 | shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
|
16548 | } else {
|
16549 | shouldUpdate = updateClassInstance(current$$1, workInProgress, Component, nextProps, renderExpirationTime);
|
16550 | }
|
16551 | var nextUnitOfWork = finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);
|
16552 | {
|
16553 | var inst = workInProgress.stateNode;
|
16554 | if (inst.props !== nextProps) {
|
16555 | !didWarnAboutReassigningProps ? warning$1(false, 'It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component') : void 0;
|
16556 | didWarnAboutReassigningProps = true;
|
16557 | }
|
16558 | }
|
16559 | return nextUnitOfWork;
|
16560 | }
|
16561 |
|
16562 | function finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) {
|
16563 |
|
16564 | markRef(current$$1, workInProgress);
|
16565 |
|
16566 | var didCaptureError = (workInProgress.effectTag & DidCapture) !== NoEffect;
|
16567 |
|
16568 | if (!shouldUpdate && !didCaptureError) {
|
16569 |
|
16570 | if (hasContext) {
|
16571 | invalidateContextProvider(workInProgress, Component, false);
|
16572 | }
|
16573 |
|
16574 | return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
|
16575 | }
|
16576 |
|
16577 | var instance = workInProgress.stateNode;
|
16578 |
|
16579 |
|
16580 | ReactCurrentOwner$3.current = workInProgress;
|
16581 | var nextChildren = void 0;
|
16582 | if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {
|
16583 |
|
16584 |
|
16585 |
|
16586 |
|
16587 |
|
16588 | nextChildren = null;
|
16589 |
|
16590 | if (enableProfilerTimer) {
|
16591 | stopProfilerTimerIfRunning(workInProgress);
|
16592 | }
|
16593 | } else {
|
16594 | {
|
16595 | setCurrentPhase('render');
|
16596 | nextChildren = instance.render();
|
16597 | if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
|
16598 | instance.render();
|
16599 | }
|
16600 | setCurrentPhase(null);
|
16601 | }
|
16602 | }
|
16603 |
|
16604 |
|
16605 | workInProgress.effectTag |= PerformedWork;
|
16606 | if (current$$1 !== null && didCaptureError) {
|
16607 |
|
16608 |
|
16609 |
|
16610 |
|
16611 | forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime);
|
16612 | } else {
|
16613 | reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
|
16614 | }
|
16615 |
|
16616 |
|
16617 |
|
16618 | workInProgress.memoizedState = instance.state;
|
16619 |
|
16620 |
|
16621 | if (hasContext) {
|
16622 | invalidateContextProvider(workInProgress, Component, true);
|
16623 | }
|
16624 |
|
16625 | return workInProgress.child;
|
16626 | }
|
16627 |
|
16628 | function pushHostRootContext(workInProgress) {
|
16629 | var root = workInProgress.stateNode;
|
16630 | if (root.pendingContext) {
|
16631 | pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);
|
16632 | } else if (root.context) {
|
16633 |
|
16634 | pushTopLevelContextObject(workInProgress, root.context, false);
|
16635 | }
|
16636 | pushHostContainer(workInProgress, root.containerInfo);
|
16637 | }
|
16638 |
|
16639 | function updateHostRoot(current$$1, workInProgress, renderExpirationTime) {
|
16640 | pushHostRootContext(workInProgress);
|
16641 | var updateQueue = workInProgress.updateQueue;
|
16642 | !(updateQueue !== null) ? invariant(false, 'If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
16643 | var nextProps = workInProgress.pendingProps;
|
16644 | var prevState = workInProgress.memoizedState;
|
16645 | var prevChildren = prevState !== null ? prevState.element : null;
|
16646 | processUpdateQueue(workInProgress, updateQueue, nextProps, null, renderExpirationTime);
|
16647 | var nextState = workInProgress.memoizedState;
|
16648 |
|
16649 |
|
16650 | var nextChildren = nextState.element;
|
16651 | if (nextChildren === prevChildren) {
|
16652 |
|
16653 |
|
16654 | resetHydrationState();
|
16655 | return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
|
16656 | }
|
16657 | var root = workInProgress.stateNode;
|
16658 | if ((current$$1 === null || current$$1.child === null) && root.hydrate && enterHydrationState(workInProgress)) {
|
16659 |
|
16660 |
|
16661 |
|
16662 |
|
16663 |
|
16664 |
|
16665 |
|
16666 |
|
16667 |
|
16668 | workInProgress.effectTag |= Placement;
|
16669 |
|
16670 |
|
16671 |
|
16672 |
|
16673 | workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
|
16674 | } else {
|
16675 |
|
16676 |
|
16677 | reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
|
16678 | resetHydrationState();
|
16679 | }
|
16680 | return workInProgress.child;
|
16681 | }
|
16682 |
|
16683 | function updateHostComponent(current$$1, workInProgress, renderExpirationTime) {
|
16684 | pushHostContext(workInProgress);
|
16685 |
|
16686 | if (current$$1 === null) {
|
16687 | tryToClaimNextHydratableInstance(workInProgress);
|
16688 | }
|
16689 |
|
16690 | var type = workInProgress.type;
|
16691 | var nextProps = workInProgress.pendingProps;
|
16692 | var prevProps = current$$1 !== null ? current$$1.memoizedProps : null;
|
16693 |
|
16694 | var nextChildren = nextProps.children;
|
16695 | var isDirectTextChild = shouldSetTextContent(type, nextProps);
|
16696 |
|
16697 | if (isDirectTextChild) {
|
16698 |
|
16699 |
|
16700 |
|
16701 |
|
16702 | nextChildren = null;
|
16703 | } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
|
16704 |
|
16705 |
|
16706 | workInProgress.effectTag |= ContentReset;
|
16707 | }
|
16708 |
|
16709 | markRef(current$$1, workInProgress);
|
16710 |
|
16711 |
|
16712 | if (renderExpirationTime !== Never && workInProgress.mode & ConcurrentMode && shouldDeprioritizeSubtree(type, nextProps)) {
|
16713 |
|
16714 | workInProgress.expirationTime = Never;
|
16715 | return null;
|
16716 | }
|
16717 |
|
16718 | reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
|
16719 | return workInProgress.child;
|
16720 | }
|
16721 |
|
16722 | function updateHostText(current$$1, workInProgress) {
|
16723 | if (current$$1 === null) {
|
16724 | tryToClaimNextHydratableInstance(workInProgress);
|
16725 | }
|
16726 |
|
16727 |
|
16728 | return null;
|
16729 | }
|
16730 |
|
16731 | function mountLazyComponent(_current, workInProgress, elementType, updateExpirationTime, renderExpirationTime) {
|
16732 | if (_current !== null) {
|
16733 |
|
16734 |
|
16735 |
|
16736 |
|
16737 | _current.alternate = null;
|
16738 | workInProgress.alternate = null;
|
16739 |
|
16740 | workInProgress.effectTag |= Placement;
|
16741 | }
|
16742 |
|
16743 | var props = workInProgress.pendingProps;
|
16744 |
|
16745 |
|
16746 | cancelWorkTimer(workInProgress);
|
16747 | var Component = readLazyComponentType(elementType);
|
16748 |
|
16749 | workInProgress.type = Component;
|
16750 | var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);
|
16751 | startWorkTimer(workInProgress);
|
16752 | var resolvedProps = resolveDefaultProps(Component, props);
|
16753 | var child = void 0;
|
16754 | switch (resolvedTag) {
|
16755 | case FunctionComponent:
|
16756 | {
|
16757 | child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
|
16758 | break;
|
16759 | }
|
16760 | case ClassComponent:
|
16761 | {
|
16762 | child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
|
16763 | break;
|
16764 | }
|
16765 | case ForwardRef:
|
16766 | {
|
16767 | child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderExpirationTime);
|
16768 | break;
|
16769 | }
|
16770 | case MemoComponent:
|
16771 | {
|
16772 | {
|
16773 | if (workInProgress.type !== workInProgress.elementType) {
|
16774 | var outerPropTypes = Component.propTypes;
|
16775 | if (outerPropTypes) {
|
16776 | checkPropTypes(outerPropTypes, resolvedProps,
|
16777 | 'prop', getComponentName(Component), getCurrentFiberStackInDev);
|
16778 | }
|
16779 | }
|
16780 | }
|
16781 | child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps),
|
16782 | updateExpirationTime, renderExpirationTime);
|
16783 | break;
|
16784 | }
|
16785 | default:
|
16786 | {
|
16787 | var hint = '';
|
16788 | {
|
16789 | if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {
|
16790 | hint = ' Did you wrap a component in React.lazy() more than once?';
|
16791 | }
|
16792 | }
|
16793 |
|
16794 |
|
16795 |
|
16796 | invariant(false, 'Element type is invalid. Received a promise that resolves to: %s. Lazy element type must resolve to a class or function.%s', Component, hint);
|
16797 | }
|
16798 | }
|
16799 | return child;
|
16800 | }
|
16801 |
|
16802 | function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderExpirationTime) {
|
16803 | if (_current !== null) {
|
16804 |
|
16805 |
|
16806 |
|
16807 |
|
16808 | _current.alternate = null;
|
16809 | workInProgress.alternate = null;
|
16810 |
|
16811 | workInProgress.effectTag |= Placement;
|
16812 | }
|
16813 |
|
16814 |
|
16815 | workInProgress.tag = ClassComponent;
|
16816 |
|
16817 |
|
16818 |
|
16819 |
|
16820 |
|
16821 |
|
16822 | var hasContext = void 0;
|
16823 | if (isContextProvider(Component)) {
|
16824 | hasContext = true;
|
16825 | pushContextProvider(workInProgress);
|
16826 | } else {
|
16827 | hasContext = false;
|
16828 | }
|
16829 | prepareToReadContext(workInProgress, renderExpirationTime);
|
16830 |
|
16831 | constructClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
|
16832 | mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
|
16833 |
|
16834 | return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
|
16835 | }
|
16836 |
|
16837 | function mountIndeterminateComponent(_current, workInProgress, Component, renderExpirationTime) {
|
16838 | if (_current !== null) {
|
16839 |
|
16840 |
|
16841 |
|
16842 |
|
16843 | _current.alternate = null;
|
16844 | workInProgress.alternate = null;
|
16845 |
|
16846 | workInProgress.effectTag |= Placement;
|
16847 | }
|
16848 |
|
16849 | var props = workInProgress.pendingProps;
|
16850 | var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);
|
16851 | var context = getMaskedContext(workInProgress, unmaskedContext);
|
16852 |
|
16853 | prepareToReadContext(workInProgress, renderExpirationTime);
|
16854 | prepareToUseHooks(null, workInProgress, renderExpirationTime);
|
16855 |
|
16856 | var value = void 0;
|
16857 |
|
16858 | {
|
16859 | if (Component.prototype && typeof Component.prototype.render === 'function') {
|
16860 | var componentName = getComponentName(Component) || 'Unknown';
|
16861 |
|
16862 | if (!didWarnAboutBadClass[componentName]) {
|
16863 | 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.', componentName, componentName);
|
16864 | didWarnAboutBadClass[componentName] = true;
|
16865 | }
|
16866 | }
|
16867 |
|
16868 | if (workInProgress.mode & StrictMode) {
|
16869 | ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);
|
16870 | }
|
16871 |
|
16872 | ReactCurrentOwner$3.current = workInProgress;
|
16873 | value = Component(props, context);
|
16874 | }
|
16875 |
|
16876 | workInProgress.effectTag |= PerformedWork;
|
16877 |
|
16878 | if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {
|
16879 |
|
16880 | workInProgress.tag = ClassComponent;
|
16881 |
|
16882 |
|
16883 | resetHooks();
|
16884 |
|
16885 |
|
16886 |
|
16887 |
|
16888 | var hasContext = false;
|
16889 | if (isContextProvider(Component)) {
|
16890 | hasContext = true;
|
16891 | pushContextProvider(workInProgress);
|
16892 | } else {
|
16893 | hasContext = false;
|
16894 | }
|
16895 |
|
16896 | workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;
|
16897 |
|
16898 | var getDerivedStateFromProps = Component.getDerivedStateFromProps;
|
16899 | if (typeof getDerivedStateFromProps === 'function') {
|
16900 | applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);
|
16901 | }
|
16902 |
|
16903 | adoptClassInstance(workInProgress, value);
|
16904 | mountClassInstance(workInProgress, Component, props, renderExpirationTime);
|
16905 | return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
|
16906 | } else {
|
16907 |
|
16908 | workInProgress.tag = FunctionComponent;
|
16909 | value = finishHooks(Component, props, value, context);
|
16910 | reconcileChildren(null, workInProgress, value, renderExpirationTime);
|
16911 | {
|
16912 | validateFunctionComponentInDev(workInProgress, Component);
|
16913 | }
|
16914 | return workInProgress.child;
|
16915 | }
|
16916 | }
|
16917 |
|
16918 | function validateFunctionComponentInDev(workInProgress, Component) {
|
16919 | if (Component) {
|
16920 | !!Component.childContextTypes ? warningWithoutStack$1(false, '%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component') : void 0;
|
16921 | }
|
16922 | if (workInProgress.ref !== null) {
|
16923 | var info = '';
|
16924 | var ownerName = getCurrentFiberOwnerNameInDevOrNull();
|
16925 | if (ownerName) {
|
16926 | info += '\n\nCheck the render method of `' + ownerName + '`.';
|
16927 | }
|
16928 |
|
16929 | var warningKey = ownerName || workInProgress._debugID || '';
|
16930 | var debugSource = workInProgress._debugSource;
|
16931 | if (debugSource) {
|
16932 | warningKey = debugSource.fileName + ':' + debugSource.lineNumber;
|
16933 | }
|
16934 | if (!didWarnAboutFunctionRefs[warningKey]) {
|
16935 | didWarnAboutFunctionRefs[warningKey] = true;
|
16936 | warning$1(false, 'Function components cannot be given refs. ' + 'Attempts to access this ref will fail.%s', info);
|
16937 | }
|
16938 | }
|
16939 |
|
16940 | if (typeof Component.getDerivedStateFromProps === 'function') {
|
16941 | var componentName = getComponentName(Component) || 'Unknown';
|
16942 |
|
16943 | if (!didWarnAboutGetDerivedStateOnFunctionComponent[componentName]) {
|
16944 | warningWithoutStack$1(false, '%s: Function components do not support getDerivedStateFromProps.', componentName);
|
16945 | didWarnAboutGetDerivedStateOnFunctionComponent[componentName] = true;
|
16946 | }
|
16947 | }
|
16948 |
|
16949 | if (typeof Component.contextType === 'object' && Component.contextType !== null) {
|
16950 | var _componentName = getComponentName(Component) || 'Unknown';
|
16951 |
|
16952 | if (!didWarnAboutContextTypeOnFunctionComponent[_componentName]) {
|
16953 | warningWithoutStack$1(false, '%s: Function components do not support contextType.', _componentName);
|
16954 | didWarnAboutContextTypeOnFunctionComponent[_componentName] = true;
|
16955 | }
|
16956 | }
|
16957 | }
|
16958 |
|
16959 | function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime) {
|
16960 | var mode = workInProgress.mode;
|
16961 | var nextProps = workInProgress.pendingProps;
|
16962 |
|
16963 |
|
16964 |
|
16965 | var nextState = workInProgress.memoizedState;
|
16966 |
|
16967 | var nextDidTimeout = void 0;
|
16968 | if ((workInProgress.effectTag & DidCapture) === NoEffect) {
|
16969 |
|
16970 | nextState = null;
|
16971 | nextDidTimeout = false;
|
16972 | } else {
|
16973 |
|
16974 |
|
16975 | nextState = {
|
16976 | timedOutAt: nextState !== null ? nextState.timedOutAt : NoWork
|
16977 | };
|
16978 | nextDidTimeout = true;
|
16979 | workInProgress.effectTag &= ~DidCapture;
|
16980 | }
|
16981 |
|
16982 |
|
16983 |
|
16984 |
|
16985 |
|
16986 |
|
16987 |
|
16988 |
|
16989 |
|
16990 |
|
16991 |
|
16992 |
|
16993 |
|
16994 |
|
16995 |
|
16996 |
|
16997 |
|
16998 |
|
16999 |
|
17000 |
|
17001 |
|
17002 |
|
17003 |
|
17004 |
|
17005 |
|
17006 |
|
17007 | var child = void 0;
|
17008 |
|
17009 |
|
17010 |
|
17011 |
|
17012 | var next = void 0;
|
17013 | if (current$$1 === null) {
|
17014 |
|
17015 |
|
17016 | if (nextDidTimeout) {
|
17017 |
|
17018 | var nextFallbackChildren = nextProps.fallback;
|
17019 | var primaryChildFragment = createFiberFromFragment(null, mode, NoWork, null);
|
17020 |
|
17021 | if ((workInProgress.mode & ConcurrentMode) === NoContext) {
|
17022 |
|
17023 | var progressedState = workInProgress.memoizedState;
|
17024 | var progressedPrimaryChild = progressedState !== null ? workInProgress.child.child : workInProgress.child;
|
17025 | primaryChildFragment.child = progressedPrimaryChild;
|
17026 | }
|
17027 |
|
17028 | var fallbackChildFragment = createFiberFromFragment(nextFallbackChildren, mode, renderExpirationTime, null);
|
17029 | primaryChildFragment.sibling = fallbackChildFragment;
|
17030 | child = primaryChildFragment;
|
17031 |
|
17032 |
|
17033 | next = fallbackChildFragment;
|
17034 | child.return = next.return = workInProgress;
|
17035 | } else {
|
17036 |
|
17037 | var nextPrimaryChildren = nextProps.children;
|
17038 | child = next = mountChildFibers(workInProgress, null, nextPrimaryChildren, renderExpirationTime);
|
17039 | }
|
17040 | } else {
|
17041 |
|
17042 |
|
17043 | var prevState = current$$1.memoizedState;
|
17044 | var prevDidTimeout = prevState !== null;
|
17045 | if (prevDidTimeout) {
|
17046 |
|
17047 | var currentPrimaryChildFragment = current$$1.child;
|
17048 | var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
|
17049 | if (nextDidTimeout) {
|
17050 |
|
17051 |
|
17052 | var _nextFallbackChildren = nextProps.fallback;
|
17053 | var _primaryChildFragment = createWorkInProgress(currentPrimaryChildFragment, currentPrimaryChildFragment.pendingProps, NoWork);
|
17054 |
|
17055 | if ((workInProgress.mode & ConcurrentMode) === NoContext) {
|
17056 |
|
17057 | var _progressedState = workInProgress.memoizedState;
|
17058 | var _progressedPrimaryChild = _progressedState !== null ? workInProgress.child.child : workInProgress.child;
|
17059 | if (_progressedPrimaryChild !== currentPrimaryChildFragment.child) {
|
17060 | _primaryChildFragment.child = _progressedPrimaryChild;
|
17061 | }
|
17062 | }
|
17063 |
|
17064 |
|
17065 |
|
17066 | if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
|
17067 |
|
17068 | var treeBaseDuration = 0;
|
17069 | var hiddenChild = _primaryChildFragment.child;
|
17070 | while (hiddenChild !== null) {
|
17071 | treeBaseDuration += hiddenChild.treeBaseDuration;
|
17072 | hiddenChild = hiddenChild.sibling;
|
17073 | }
|
17074 | _primaryChildFragment.treeBaseDuration = treeBaseDuration;
|
17075 | }
|
17076 |
|
17077 |
|
17078 |
|
17079 | var _fallbackChildFragment = _primaryChildFragment.sibling = createWorkInProgress(currentFallbackChildFragment, _nextFallbackChildren, currentFallbackChildFragment.expirationTime);
|
17080 | child = _primaryChildFragment;
|
17081 | _primaryChildFragment.childExpirationTime = NoWork;
|
17082 |
|
17083 |
|
17084 | next = _fallbackChildFragment;
|
17085 | child.return = next.return = workInProgress;
|
17086 | } else {
|
17087 |
|
17088 |
|
17089 | var _nextPrimaryChildren = nextProps.children;
|
17090 | var currentPrimaryChild = currentPrimaryChildFragment.child;
|
17091 | var primaryChild = reconcileChildFibers(workInProgress, currentPrimaryChild, _nextPrimaryChildren, renderExpirationTime);
|
17092 |
|
17093 |
|
17094 |
|
17095 |
|
17096 |
|
17097 |
|
17098 |
|
17099 |
|
17100 | child = next = primaryChild;
|
17101 | }
|
17102 | } else {
|
17103 |
|
17104 |
|
17105 | var _currentPrimaryChild = current$$1.child;
|
17106 | if (nextDidTimeout) {
|
17107 |
|
17108 |
|
17109 | var _nextFallbackChildren2 = nextProps.fallback;
|
17110 | var _primaryChildFragment2 = createFiberFromFragment(
|
17111 |
|
17112 |
|
17113 | null, mode, NoWork, null);
|
17114 | _primaryChildFragment2.child = _currentPrimaryChild;
|
17115 |
|
17116 |
|
17117 |
|
17118 |
|
17119 |
|
17120 |
|
17121 | if ((workInProgress.mode & ConcurrentMode) === NoContext) {
|
17122 |
|
17123 | var _progressedState2 = workInProgress.memoizedState;
|
17124 | var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child;
|
17125 | _primaryChildFragment2.child = _progressedPrimaryChild2;
|
17126 | }
|
17127 |
|
17128 |
|
17129 |
|
17130 | if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
|
17131 |
|
17132 | var _treeBaseDuration = 0;
|
17133 | var _hiddenChild = _primaryChildFragment2.child;
|
17134 | while (_hiddenChild !== null) {
|
17135 | _treeBaseDuration += _hiddenChild.treeBaseDuration;
|
17136 | _hiddenChild = _hiddenChild.sibling;
|
17137 | }
|
17138 | _primaryChildFragment2.treeBaseDuration = _treeBaseDuration;
|
17139 | }
|
17140 |
|
17141 |
|
17142 | var _fallbackChildFragment2 = _primaryChildFragment2.sibling = createFiberFromFragment(_nextFallbackChildren2, mode, renderExpirationTime, null);
|
17143 | _fallbackChildFragment2.effectTag |= Placement;
|
17144 | child = _primaryChildFragment2;
|
17145 | _primaryChildFragment2.childExpirationTime = NoWork;
|
17146 |
|
17147 |
|
17148 | next = _fallbackChildFragment2;
|
17149 | child.return = next.return = workInProgress;
|
17150 | } else {
|
17151 |
|
17152 |
|
17153 | var _nextPrimaryChildren2 = nextProps.children;
|
17154 | next = child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime);
|
17155 | }
|
17156 | }
|
17157 | workInProgress.stateNode = current$$1.stateNode;
|
17158 | }
|
17159 |
|
17160 | workInProgress.memoizedState = nextState;
|
17161 | workInProgress.child = child;
|
17162 | return next;
|
17163 | }
|
17164 |
|
17165 | function updatePortalComponent(current$$1, workInProgress, renderExpirationTime) {
|
17166 | pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
|
17167 | var nextChildren = workInProgress.pendingProps;
|
17168 | if (current$$1 === null) {
|
17169 |
|
17170 |
|
17171 |
|
17172 |
|
17173 |
|
17174 | workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
|
17175 | } else {
|
17176 | reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
|
17177 | }
|
17178 | return workInProgress.child;
|
17179 | }
|
17180 |
|
17181 | function updateContextProvider(current$$1, workInProgress, renderExpirationTime) {
|
17182 | var providerType = workInProgress.type;
|
17183 | var context = providerType._context;
|
17184 |
|
17185 | var newProps = workInProgress.pendingProps;
|
17186 | var oldProps = workInProgress.memoizedProps;
|
17187 |
|
17188 | var newValue = newProps.value;
|
17189 |
|
17190 | {
|
17191 | var providerPropTypes = workInProgress.type.propTypes;
|
17192 |
|
17193 | if (providerPropTypes) {
|
17194 | checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev);
|
17195 | }
|
17196 | }
|
17197 |
|
17198 | pushProvider(workInProgress, newValue);
|
17199 |
|
17200 | if (oldProps !== null) {
|
17201 | var oldValue = oldProps.value;
|
17202 | var changedBits = calculateChangedBits(context, newValue, oldValue);
|
17203 | if (changedBits === 0) {
|
17204 |
|
17205 | if (oldProps.children === newProps.children && !hasContextChanged()) {
|
17206 | return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
|
17207 | }
|
17208 | } else {
|
17209 |
|
17210 |
|
17211 | propagateContextChange(workInProgress, context, changedBits, renderExpirationTime);
|
17212 | }
|
17213 | }
|
17214 |
|
17215 | var newChildren = newProps.children;
|
17216 | reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime);
|
17217 | return workInProgress.child;
|
17218 | }
|
17219 |
|
17220 | var hasWarnedAboutUsingContextAsConsumer = false;
|
17221 |
|
17222 | function updateContextConsumer(current$$1, workInProgress, renderExpirationTime) {
|
17223 | var context = workInProgress.type;
|
17224 |
|
17225 |
|
17226 |
|
17227 |
|
17228 |
|
17229 |
|
17230 |
|
17231 | {
|
17232 | if (context._context === undefined) {
|
17233 |
|
17234 |
|
17235 |
|
17236 | if (context !== context.Consumer) {
|
17237 | if (!hasWarnedAboutUsingContextAsConsumer) {
|
17238 | hasWarnedAboutUsingContextAsConsumer = true;
|
17239 | 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?');
|
17240 | }
|
17241 | }
|
17242 | } else {
|
17243 | context = context._context;
|
17244 | }
|
17245 | }
|
17246 | var newProps = workInProgress.pendingProps;
|
17247 | var render = newProps.children;
|
17248 |
|
17249 | {
|
17250 | !(typeof render === 'function') ? warningWithoutStack$1(false, 'A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.') : void 0;
|
17251 | }
|
17252 |
|
17253 | prepareToReadContext(workInProgress, renderExpirationTime);
|
17254 | var newValue = readContext(context, newProps.unstable_observedBits);
|
17255 | var newChildren = void 0;
|
17256 | {
|
17257 | ReactCurrentOwner$3.current = workInProgress;
|
17258 | setCurrentPhase('render');
|
17259 | newChildren = render(newValue);
|
17260 | setCurrentPhase(null);
|
17261 | }
|
17262 |
|
17263 |
|
17264 | workInProgress.effectTag |= PerformedWork;
|
17265 | reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime);
|
17266 | return workInProgress.child;
|
17267 | }
|
17268 |
|
17269 | function bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime) {
|
17270 | cancelWorkTimer(workInProgress);
|
17271 |
|
17272 | if (current$$1 !== null) {
|
17273 |
|
17274 | workInProgress.firstContextDependency = current$$1.firstContextDependency;
|
17275 | }
|
17276 |
|
17277 | if (enableProfilerTimer) {
|
17278 |
|
17279 | stopProfilerTimerIfRunning(workInProgress);
|
17280 | }
|
17281 |
|
17282 |
|
17283 | var childExpirationTime = workInProgress.childExpirationTime;
|
17284 | if (childExpirationTime < renderExpirationTime) {
|
17285 |
|
17286 |
|
17287 |
|
17288 | return null;
|
17289 | } else {
|
17290 |
|
17291 |
|
17292 | cloneChildFibers(current$$1, workInProgress);
|
17293 | return workInProgress.child;
|
17294 | }
|
17295 | }
|
17296 |
|
17297 | function beginWork(current$$1, workInProgress, renderExpirationTime) {
|
17298 | var updateExpirationTime = workInProgress.expirationTime;
|
17299 |
|
17300 | if (current$$1 !== null) {
|
17301 | var oldProps = current$$1.memoizedProps;
|
17302 | var newProps = workInProgress.pendingProps;
|
17303 | if (oldProps === newProps && !hasContextChanged() && updateExpirationTime < renderExpirationTime) {
|
17304 |
|
17305 |
|
17306 |
|
17307 | switch (workInProgress.tag) {
|
17308 | case HostRoot:
|
17309 | pushHostRootContext(workInProgress);
|
17310 | resetHydrationState();
|
17311 | break;
|
17312 | case HostComponent:
|
17313 | pushHostContext(workInProgress);
|
17314 | break;
|
17315 | case ClassComponent:
|
17316 | {
|
17317 | var Component = workInProgress.type;
|
17318 | if (isContextProvider(Component)) {
|
17319 | pushContextProvider(workInProgress);
|
17320 | }
|
17321 | break;
|
17322 | }
|
17323 | case HostPortal:
|
17324 | pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
|
17325 | break;
|
17326 | case ContextProvider:
|
17327 | {
|
17328 | var newValue = workInProgress.memoizedProps.value;
|
17329 | pushProvider(workInProgress, newValue);
|
17330 | break;
|
17331 | }
|
17332 | case Profiler:
|
17333 | if (enableProfilerTimer) {
|
17334 | workInProgress.effectTag |= Update;
|
17335 | }
|
17336 | break;
|
17337 | case SuspenseComponent:
|
17338 | {
|
17339 | var state = workInProgress.memoizedState;
|
17340 | var didTimeout = state !== null;
|
17341 | if (didTimeout) {
|
17342 |
|
17343 |
|
17344 |
|
17345 | var primaryChildFragment = workInProgress.child;
|
17346 | var primaryChildExpirationTime = primaryChildFragment.childExpirationTime;
|
17347 | if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) {
|
17348 |
|
17349 |
|
17350 | return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime);
|
17351 | } else {
|
17352 |
|
17353 |
|
17354 | var child = bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
|
17355 | if (child !== null) {
|
17356 |
|
17357 |
|
17358 | return child.sibling;
|
17359 | } else {
|
17360 | return null;
|
17361 | }
|
17362 | }
|
17363 | }
|
17364 | break;
|
17365 | }
|
17366 | }
|
17367 | return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
|
17368 | }
|
17369 | }
|
17370 |
|
17371 |
|
17372 | workInProgress.expirationTime = NoWork;
|
17373 |
|
17374 | switch (workInProgress.tag) {
|
17375 | case IndeterminateComponent:
|
17376 | {
|
17377 | var elementType = workInProgress.elementType;
|
17378 | return mountIndeterminateComponent(current$$1, workInProgress, elementType, renderExpirationTime);
|
17379 | }
|
17380 | case LazyComponent:
|
17381 | {
|
17382 | var _elementType = workInProgress.elementType;
|
17383 | return mountLazyComponent(current$$1, workInProgress, _elementType, updateExpirationTime, renderExpirationTime);
|
17384 | }
|
17385 | case FunctionComponent:
|
17386 | {
|
17387 | var _Component = workInProgress.type;
|
17388 | var unresolvedProps = workInProgress.pendingProps;
|
17389 | var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);
|
17390 | return updateFunctionComponent(current$$1, workInProgress, _Component, resolvedProps, renderExpirationTime);
|
17391 | }
|
17392 | case ClassComponent:
|
17393 | {
|
17394 | var _Component2 = workInProgress.type;
|
17395 | var _unresolvedProps = workInProgress.pendingProps;
|
17396 | var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);
|
17397 | return updateClassComponent(current$$1, workInProgress, _Component2, _resolvedProps, renderExpirationTime);
|
17398 | }
|
17399 | case HostRoot:
|
17400 | return updateHostRoot(current$$1, workInProgress, renderExpirationTime);
|
17401 | case HostComponent:
|
17402 | return updateHostComponent(current$$1, workInProgress, renderExpirationTime);
|
17403 | case HostText:
|
17404 | return updateHostText(current$$1, workInProgress);
|
17405 | case SuspenseComponent:
|
17406 | return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime);
|
17407 | case HostPortal:
|
17408 | return updatePortalComponent(current$$1, workInProgress, renderExpirationTime);
|
17409 | case ForwardRef:
|
17410 | {
|
17411 | var type = workInProgress.type;
|
17412 | var _unresolvedProps2 = workInProgress.pendingProps;
|
17413 | var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
|
17414 | return updateForwardRef(current$$1, workInProgress, type, _resolvedProps2, renderExpirationTime);
|
17415 | }
|
17416 | case Fragment:
|
17417 | return updateFragment(current$$1, workInProgress, renderExpirationTime);
|
17418 | case Mode:
|
17419 | return updateMode(current$$1, workInProgress, renderExpirationTime);
|
17420 | case Profiler:
|
17421 | return updateProfiler(current$$1, workInProgress, renderExpirationTime);
|
17422 | case ContextProvider:
|
17423 | return updateContextProvider(current$$1, workInProgress, renderExpirationTime);
|
17424 | case ContextConsumer:
|
17425 | return updateContextConsumer(current$$1, workInProgress, renderExpirationTime);
|
17426 | case MemoComponent:
|
17427 | {
|
17428 | var _type2 = workInProgress.type;
|
17429 | var _unresolvedProps3 = workInProgress.pendingProps;
|
17430 |
|
17431 | var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
|
17432 | {
|
17433 | if (workInProgress.type !== workInProgress.elementType) {
|
17434 | var outerPropTypes = _type2.propTypes;
|
17435 | if (outerPropTypes) {
|
17436 | checkPropTypes(outerPropTypes, _resolvedProps3,
|
17437 | 'prop', getComponentName(_type2), getCurrentFiberStackInDev);
|
17438 | }
|
17439 | }
|
17440 | }
|
17441 | _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
|
17442 | return updateMemoComponent(current$$1, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime);
|
17443 | }
|
17444 | case SimpleMemoComponent:
|
17445 | {
|
17446 | return updateSimpleMemoComponent(current$$1, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime);
|
17447 | }
|
17448 | case IncompleteClassComponent:
|
17449 | {
|
17450 | var _Component3 = workInProgress.type;
|
17451 | var _unresolvedProps4 = workInProgress.pendingProps;
|
17452 | var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);
|
17453 | return mountIncompleteClassComponent(current$$1, workInProgress, _Component3, _resolvedProps4, renderExpirationTime);
|
17454 | }
|
17455 | default:
|
17456 | invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
|
17457 | }
|
17458 | }
|
17459 |
|
17460 | function markUpdate(workInProgress) {
|
17461 |
|
17462 |
|
17463 | workInProgress.effectTag |= Update;
|
17464 | }
|
17465 |
|
17466 | function markRef$1(workInProgress) {
|
17467 | workInProgress.effectTag |= Ref;
|
17468 | }
|
17469 |
|
17470 | var appendAllChildren = void 0;
|
17471 | var updateHostContainer = void 0;
|
17472 | var updateHostComponent$1 = void 0;
|
17473 | var updateHostText$1 = void 0;
|
17474 | if (supportsMutation) {
|
17475 |
|
17476 |
|
17477 | appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
|
17478 |
|
17479 |
|
17480 | var node = workInProgress.child;
|
17481 | while (node !== null) {
|
17482 | if (node.tag === HostComponent || node.tag === HostText) {
|
17483 | appendInitialChild(parent, node.stateNode);
|
17484 | } else if (node.tag === HostPortal) {
|
17485 |
|
17486 |
|
17487 |
|
17488 | } else if (node.child !== null) {
|
17489 | node.child.return = node;
|
17490 | node = node.child;
|
17491 | continue;
|
17492 | }
|
17493 | if (node === workInProgress) {
|
17494 | return;
|
17495 | }
|
17496 | while (node.sibling === null) {
|
17497 | if (node.return === null || node.return === workInProgress) {
|
17498 | return;
|
17499 | }
|
17500 | node = node.return;
|
17501 | }
|
17502 | node.sibling.return = node.return;
|
17503 | node = node.sibling;
|
17504 | }
|
17505 | };
|
17506 |
|
17507 | updateHostContainer = function (workInProgress) {
|
17508 |
|
17509 | };
|
17510 | updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
|
17511 |
|
17512 |
|
17513 | var oldProps = current.memoizedProps;
|
17514 | if (oldProps === newProps) {
|
17515 |
|
17516 |
|
17517 | return;
|
17518 | }
|
17519 |
|
17520 |
|
17521 |
|
17522 |
|
17523 |
|
17524 | var instance = workInProgress.stateNode;
|
17525 | var currentHostContext = getHostContext();
|
17526 |
|
17527 |
|
17528 |
|
17529 | var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
|
17530 |
|
17531 | workInProgress.updateQueue = updatePayload;
|
17532 |
|
17533 |
|
17534 | if (updatePayload) {
|
17535 | markUpdate(workInProgress);
|
17536 | }
|
17537 | };
|
17538 | updateHostText$1 = function (current, workInProgress, oldText, newText) {
|
17539 |
|
17540 | if (oldText !== newText) {
|
17541 | markUpdate(workInProgress);
|
17542 | }
|
17543 | };
|
17544 | } else if (supportsPersistence) {
|
17545 |
|
17546 |
|
17547 | appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
|
17548 |
|
17549 |
|
17550 | var node = workInProgress.child;
|
17551 | while (node !== null) {
|
17552 |
|
17553 | branches: if (node.tag === HostComponent) {
|
17554 | var instance = node.stateNode;
|
17555 | if (needsVisibilityToggle) {
|
17556 | var props = node.memoizedProps;
|
17557 | var type = node.type;
|
17558 | if (isHidden) {
|
17559 |
|
17560 | instance = cloneHiddenInstance(instance, type, props, node);
|
17561 | } else {
|
17562 |
|
17563 |
|
17564 |
|
17565 | instance = cloneUnhiddenInstance(instance, type, props, node);
|
17566 | }
|
17567 | node.stateNode = instance;
|
17568 | }
|
17569 | appendInitialChild(parent, instance);
|
17570 | } else if (node.tag === HostText) {
|
17571 | var _instance = node.stateNode;
|
17572 | if (needsVisibilityToggle) {
|
17573 | var text = node.memoizedProps;
|
17574 | var rootContainerInstance = getRootHostContainer();
|
17575 | var currentHostContext = getHostContext();
|
17576 | if (isHidden) {
|
17577 | _instance = createHiddenTextInstance(text, rootContainerInstance, currentHostContext, workInProgress);
|
17578 | } else {
|
17579 | _instance = createTextInstance(text, rootContainerInstance, currentHostContext, workInProgress);
|
17580 | }
|
17581 | node.stateNode = _instance;
|
17582 | }
|
17583 | appendInitialChild(parent, _instance);
|
17584 | } else if (node.tag === HostPortal) {
|
17585 |
|
17586 |
|
17587 |
|
17588 | } else if (node.tag === SuspenseComponent) {
|
17589 | var current = node.alternate;
|
17590 | if (current !== null) {
|
17591 | var oldState = current.memoizedState;
|
17592 | var newState = node.memoizedState;
|
17593 | var oldIsHidden = oldState !== null;
|
17594 | var newIsHidden = newState !== null;
|
17595 | if (oldIsHidden !== newIsHidden) {
|
17596 |
|
17597 |
|
17598 |
|
17599 | var primaryChildParent = newIsHidden ? node.child : node;
|
17600 | if (primaryChildParent !== null) {
|
17601 | appendAllChildren(parent, primaryChildParent, true, newIsHidden);
|
17602 | }
|
17603 |
|
17604 | break branches;
|
17605 | }
|
17606 | }
|
17607 | if (node.child !== null) {
|
17608 |
|
17609 | node.child.return = node;
|
17610 | node = node.child;
|
17611 | continue;
|
17612 | }
|
17613 | } else if (node.child !== null) {
|
17614 | node.child.return = node;
|
17615 | node = node.child;
|
17616 | continue;
|
17617 | }
|
17618 |
|
17619 | node = node;
|
17620 | if (node === workInProgress) {
|
17621 | return;
|
17622 | }
|
17623 | while (node.sibling === null) {
|
17624 | if (node.return === null || node.return === workInProgress) {
|
17625 | return;
|
17626 | }
|
17627 | node = node.return;
|
17628 | }
|
17629 | node.sibling.return = node.return;
|
17630 | node = node.sibling;
|
17631 | }
|
17632 | };
|
17633 |
|
17634 |
|
17635 | var appendAllChildrenToContainer = function (containerChildSet, workInProgress, needsVisibilityToggle, isHidden) {
|
17636 |
|
17637 |
|
17638 | var node = workInProgress.child;
|
17639 | while (node !== null) {
|
17640 |
|
17641 | branches: if (node.tag === HostComponent) {
|
17642 | var instance = node.stateNode;
|
17643 | if (needsVisibilityToggle) {
|
17644 | var props = node.memoizedProps;
|
17645 | var type = node.type;
|
17646 | if (isHidden) {
|
17647 |
|
17648 | instance = cloneHiddenInstance(instance, type, props, node);
|
17649 | } else {
|
17650 |
|
17651 |
|
17652 |
|
17653 | instance = cloneUnhiddenInstance(instance, type, props, node);
|
17654 | }
|
17655 | node.stateNode = instance;
|
17656 | }
|
17657 | appendChildToContainerChildSet(containerChildSet, instance);
|
17658 | } else if (node.tag === HostText) {
|
17659 | var _instance2 = node.stateNode;
|
17660 | if (needsVisibilityToggle) {
|
17661 | var text = node.memoizedProps;
|
17662 | var rootContainerInstance = getRootHostContainer();
|
17663 | var currentHostContext = getHostContext();
|
17664 | if (isHidden) {
|
17665 | _instance2 = createHiddenTextInstance(text, rootContainerInstance, currentHostContext, workInProgress);
|
17666 | } else {
|
17667 | _instance2 = createTextInstance(text, rootContainerInstance, currentHostContext, workInProgress);
|
17668 | }
|
17669 | node.stateNode = _instance2;
|
17670 | }
|
17671 | appendChildToContainerChildSet(containerChildSet, _instance2);
|
17672 | } else if (node.tag === HostPortal) {
|
17673 |
|
17674 |
|
17675 |
|
17676 | } else if (node.tag === SuspenseComponent) {
|
17677 | var current = node.alternate;
|
17678 | if (current !== null) {
|
17679 | var oldState = current.memoizedState;
|
17680 | var newState = node.memoizedState;
|
17681 | var oldIsHidden = oldState !== null;
|
17682 | var newIsHidden = newState !== null;
|
17683 | if (oldIsHidden !== newIsHidden) {
|
17684 |
|
17685 |
|
17686 |
|
17687 | var primaryChildParent = newIsHidden ? node.child : node;
|
17688 | if (primaryChildParent !== null) {
|
17689 | appendAllChildrenToContainer(containerChildSet, primaryChildParent, true, newIsHidden);
|
17690 | }
|
17691 |
|
17692 | break branches;
|
17693 | }
|
17694 | }
|
17695 | if (node.child !== null) {
|
17696 |
|
17697 | node.child.return = node;
|
17698 | node = node.child;
|
17699 | continue;
|
17700 | }
|
17701 | } else if (node.child !== null) {
|
17702 | node.child.return = node;
|
17703 | node = node.child;
|
17704 | continue;
|
17705 | }
|
17706 |
|
17707 | node = node;
|
17708 | if (node === workInProgress) {
|
17709 | return;
|
17710 | }
|
17711 | while (node.sibling === null) {
|
17712 | if (node.return === null || node.return === workInProgress) {
|
17713 | return;
|
17714 | }
|
17715 | node = node.return;
|
17716 | }
|
17717 | node.sibling.return = node.return;
|
17718 | node = node.sibling;
|
17719 | }
|
17720 | };
|
17721 | updateHostContainer = function (workInProgress) {
|
17722 | var portalOrRoot = workInProgress.stateNode;
|
17723 | var childrenUnchanged = workInProgress.firstEffect === null;
|
17724 | if (childrenUnchanged) {
|
17725 |
|
17726 | } else {
|
17727 | var container = portalOrRoot.containerInfo;
|
17728 | var newChildSet = createContainerChildSet(container);
|
17729 |
|
17730 | appendAllChildrenToContainer(newChildSet, workInProgress, false, false);
|
17731 | portalOrRoot.pendingChildren = newChildSet;
|
17732 |
|
17733 | markUpdate(workInProgress);
|
17734 | finalizeContainerChildren(container, newChildSet);
|
17735 | }
|
17736 | };
|
17737 | updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
|
17738 | var currentInstance = current.stateNode;
|
17739 | var oldProps = current.memoizedProps;
|
17740 |
|
17741 |
|
17742 | var childrenUnchanged = workInProgress.firstEffect === null;
|
17743 | if (childrenUnchanged && oldProps === newProps) {
|
17744 |
|
17745 |
|
17746 | workInProgress.stateNode = currentInstance;
|
17747 | return;
|
17748 | }
|
17749 | var recyclableInstance = workInProgress.stateNode;
|
17750 | var currentHostContext = getHostContext();
|
17751 | var updatePayload = null;
|
17752 | if (oldProps !== newProps) {
|
17753 | updatePayload = prepareUpdate(recyclableInstance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
|
17754 | }
|
17755 | if (childrenUnchanged && updatePayload === null) {
|
17756 |
|
17757 |
|
17758 | workInProgress.stateNode = currentInstance;
|
17759 | return;
|
17760 | }
|
17761 | var newInstance = cloneInstance(currentInstance, updatePayload, type, oldProps, newProps, workInProgress, childrenUnchanged, recyclableInstance);
|
17762 | if (finalizeInitialChildren(newInstance, type, newProps, rootContainerInstance, currentHostContext)) {
|
17763 | markUpdate(workInProgress);
|
17764 | }
|
17765 | workInProgress.stateNode = newInstance;
|
17766 | if (childrenUnchanged) {
|
17767 |
|
17768 |
|
17769 |
|
17770 | markUpdate(workInProgress);
|
17771 | } else {
|
17772 |
|
17773 | appendAllChildren(newInstance, workInProgress, false, false);
|
17774 | }
|
17775 | };
|
17776 | updateHostText$1 = function (current, workInProgress, oldText, newText) {
|
17777 | if (oldText !== newText) {
|
17778 |
|
17779 | var rootContainerInstance = getRootHostContainer();
|
17780 | var currentHostContext = getHostContext();
|
17781 | workInProgress.stateNode = createTextInstance(newText, rootContainerInstance, currentHostContext, workInProgress);
|
17782 |
|
17783 |
|
17784 | markUpdate(workInProgress);
|
17785 | }
|
17786 | };
|
17787 | } else {
|
17788 |
|
17789 | updateHostContainer = function (workInProgress) {
|
17790 |
|
17791 | };
|
17792 | updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
|
17793 |
|
17794 | };
|
17795 | updateHostText$1 = function (current, workInProgress, oldText, newText) {
|
17796 |
|
17797 | };
|
17798 | }
|
17799 |
|
17800 | function completeWork(current, workInProgress, renderExpirationTime) {
|
17801 | var newProps = workInProgress.pendingProps;
|
17802 |
|
17803 | switch (workInProgress.tag) {
|
17804 | case IndeterminateComponent:
|
17805 | break;
|
17806 | case LazyComponent:
|
17807 | break;
|
17808 | case SimpleMemoComponent:
|
17809 | case FunctionComponent:
|
17810 | break;
|
17811 | case ClassComponent:
|
17812 | {
|
17813 | var Component = workInProgress.type;
|
17814 | if (isContextProvider(Component)) {
|
17815 | popContext(workInProgress);
|
17816 | }
|
17817 | break;
|
17818 | }
|
17819 | case HostRoot:
|
17820 | {
|
17821 | popHostContainer(workInProgress);
|
17822 | popTopLevelContextObject(workInProgress);
|
17823 | var fiberRoot = workInProgress.stateNode;
|
17824 | if (fiberRoot.pendingContext) {
|
17825 | fiberRoot.context = fiberRoot.pendingContext;
|
17826 | fiberRoot.pendingContext = null;
|
17827 | }
|
17828 | if (current === null || current.child === null) {
|
17829 |
|
17830 |
|
17831 | popHydrationState(workInProgress);
|
17832 |
|
17833 |
|
17834 | workInProgress.effectTag &= ~Placement;
|
17835 | }
|
17836 | updateHostContainer(workInProgress);
|
17837 | break;
|
17838 | }
|
17839 | case HostComponent:
|
17840 | {
|
17841 | popHostContext(workInProgress);
|
17842 | var rootContainerInstance = getRootHostContainer();
|
17843 | var type = workInProgress.type;
|
17844 | if (current !== null && workInProgress.stateNode != null) {
|
17845 | updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);
|
17846 |
|
17847 | if (current.ref !== workInProgress.ref) {
|
17848 | markRef$1(workInProgress);
|
17849 | }
|
17850 | } else {
|
17851 | if (!newProps) {
|
17852 | !(workInProgress.stateNode !== null) ? invariant(false, 'We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
17853 |
|
17854 | break;
|
17855 | }
|
17856 |
|
17857 | var currentHostContext = getHostContext();
|
17858 |
|
17859 |
|
17860 |
|
17861 |
|
17862 | var wasHydrated = popHydrationState(workInProgress);
|
17863 | if (wasHydrated) {
|
17864 |
|
17865 |
|
17866 | if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {
|
17867 |
|
17868 |
|
17869 | markUpdate(workInProgress);
|
17870 | }
|
17871 | } else {
|
17872 | var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);
|
17873 |
|
17874 | appendAllChildren(instance, workInProgress, false, false);
|
17875 |
|
17876 |
|
17877 |
|
17878 |
|
17879 | if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance, currentHostContext)) {
|
17880 | markUpdate(workInProgress);
|
17881 | }
|
17882 | workInProgress.stateNode = instance;
|
17883 | }
|
17884 |
|
17885 | if (workInProgress.ref !== null) {
|
17886 |
|
17887 | markRef$1(workInProgress);
|
17888 | }
|
17889 | }
|
17890 | break;
|
17891 | }
|
17892 | case HostText:
|
17893 | {
|
17894 | var newText = newProps;
|
17895 | if (current && workInProgress.stateNode != null) {
|
17896 | var oldText = current.memoizedProps;
|
17897 |
|
17898 |
|
17899 | updateHostText$1(current, workInProgress, oldText, newText);
|
17900 | } else {
|
17901 | if (typeof newText !== 'string') {
|
17902 | !(workInProgress.stateNode !== null) ? invariant(false, 'We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
17903 |
|
17904 | }
|
17905 | var _rootContainerInstance = getRootHostContainer();
|
17906 | var _currentHostContext = getHostContext();
|
17907 | var _wasHydrated = popHydrationState(workInProgress);
|
17908 | if (_wasHydrated) {
|
17909 | if (prepareToHydrateHostTextInstance(workInProgress)) {
|
17910 | markUpdate(workInProgress);
|
17911 | }
|
17912 | } else {
|
17913 | workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);
|
17914 | }
|
17915 | }
|
17916 | break;
|
17917 | }
|
17918 | case ForwardRef:
|
17919 | break;
|
17920 | case SuspenseComponent:
|
17921 | {
|
17922 | var nextState = workInProgress.memoizedState;
|
17923 | if ((workInProgress.effectTag & DidCapture) !== NoEffect) {
|
17924 |
|
17925 | workInProgress.expirationTime = renderExpirationTime;
|
17926 |
|
17927 | return workInProgress;
|
17928 | }
|
17929 |
|
17930 | var nextDidTimeout = nextState !== null;
|
17931 | var prevDidTimeout = current !== null && current.memoizedState !== null;
|
17932 |
|
17933 | if (current !== null && !nextDidTimeout && prevDidTimeout) {
|
17934 |
|
17935 |
|
17936 |
|
17937 | var currentFallbackChild = current.child.sibling;
|
17938 | if (currentFallbackChild !== null) {
|
17939 |
|
17940 | var first = workInProgress.firstEffect;
|
17941 | if (first !== null) {
|
17942 | workInProgress.firstEffect = currentFallbackChild;
|
17943 | currentFallbackChild.nextEffect = first;
|
17944 | } else {
|
17945 | workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChild;
|
17946 | currentFallbackChild.nextEffect = null;
|
17947 | }
|
17948 | currentFallbackChild.effectTag = Deletion;
|
17949 | }
|
17950 | }
|
17951 |
|
17952 |
|
17953 |
|
17954 |
|
17955 | if (
|
17956 |
|
17957 | nextDidTimeout !== prevDidTimeout ||
|
17958 |
|
17959 |
|
17960 |
|
17961 | (workInProgress.effectTag & ConcurrentMode) === NoContext && nextDidTimeout) {
|
17962 | workInProgress.effectTag |= Update;
|
17963 | }
|
17964 | break;
|
17965 | }
|
17966 | case Fragment:
|
17967 | break;
|
17968 | case Mode:
|
17969 | break;
|
17970 | case Profiler:
|
17971 | break;
|
17972 | case HostPortal:
|
17973 | popHostContainer(workInProgress);
|
17974 | updateHostContainer(workInProgress);
|
17975 | break;
|
17976 | case ContextProvider:
|
17977 |
|
17978 | popProvider(workInProgress);
|
17979 | break;
|
17980 | case ContextConsumer:
|
17981 | break;
|
17982 | case MemoComponent:
|
17983 | break;
|
17984 | case IncompleteClassComponent:
|
17985 | {
|
17986 |
|
17987 |
|
17988 | var _Component = workInProgress.type;
|
17989 | if (isContextProvider(_Component)) {
|
17990 | popContext(workInProgress);
|
17991 | }
|
17992 | break;
|
17993 | }
|
17994 | default:
|
17995 | invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
|
17996 | }
|
17997 |
|
17998 | return null;
|
17999 | }
|
18000 |
|
18001 | function shouldCaptureSuspense(workInProgress) {
|
18002 |
|
18003 | if (workInProgress.memoizedProps.fallback === undefined) {
|
18004 | return false;
|
18005 | }
|
18006 |
|
18007 |
|
18008 | var nextState = workInProgress.memoizedState;
|
18009 | return nextState === null;
|
18010 | }
|
18011 |
|
18012 |
|
18013 |
|
18014 |
|
18015 | function showErrorDialog(capturedError) {
|
18016 | return true;
|
18017 | }
|
18018 |
|
18019 | function logCapturedError(capturedError) {
|
18020 | var logError = showErrorDialog(capturedError);
|
18021 |
|
18022 |
|
18023 |
|
18024 | if (logError === false) {
|
18025 | return;
|
18026 | }
|
18027 |
|
18028 | var error = capturedError.error;
|
18029 | {
|
18030 | var componentName = capturedError.componentName,
|
18031 | componentStack = capturedError.componentStack,
|
18032 | errorBoundaryName = capturedError.errorBoundaryName,
|
18033 | errorBoundaryFound = capturedError.errorBoundaryFound,
|
18034 | willRetry = capturedError.willRetry;
|
18035 |
|
18036 |
|
18037 |
|
18038 |
|
18039 |
|
18040 | if (error != null && error._suppressLogging) {
|
18041 | if (errorBoundaryFound && willRetry) {
|
18042 |
|
18043 |
|
18044 |
|
18045 | return;
|
18046 | }
|
18047 |
|
18048 |
|
18049 |
|
18050 |
|
18051 | console.error(error);
|
18052 |
|
18053 |
|
18054 | }
|
18055 |
|
18056 | var componentNameMessage = componentName ? 'The above error occurred in the <' + componentName + '> component:' : 'The above error occurred in one of your React components:';
|
18057 |
|
18058 | var errorBoundaryMessage = void 0;
|
18059 |
|
18060 | if (errorBoundaryFound && errorBoundaryName) {
|
18061 | if (willRetry) {
|
18062 | errorBoundaryMessage = 'React will try to recreate this component tree from scratch ' + ('using the error boundary you provided, ' + errorBoundaryName + '.');
|
18063 | } else {
|
18064 | errorBoundaryMessage = 'This error was initially handled by the error boundary ' + errorBoundaryName + '.\n' + 'Recreating the tree from scratch failed so React will unmount the tree.';
|
18065 | }
|
18066 | } else {
|
18067 | errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.';
|
18068 | }
|
18069 | var combinedMessage = '' + componentNameMessage + componentStack + '\n\n' + ('' + errorBoundaryMessage);
|
18070 |
|
18071 |
|
18072 |
|
18073 |
|
18074 |
|
18075 | console.error(combinedMessage);
|
18076 | }
|
18077 | }
|
18078 |
|
18079 | var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
|
18080 | {
|
18081 | didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
|
18082 | }
|
18083 |
|
18084 | var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;
|
18085 |
|
18086 | function logError(boundary, errorInfo) {
|
18087 | var source = errorInfo.source;
|
18088 | var stack = errorInfo.stack;
|
18089 | if (stack === null && source !== null) {
|
18090 | stack = getStackByFiberInDevAndProd(source);
|
18091 | }
|
18092 |
|
18093 | var capturedError = {
|
18094 | componentName: source !== null ? getComponentName(source.type) : null,
|
18095 | componentStack: stack !== null ? stack : '',
|
18096 | error: errorInfo.value,
|
18097 | errorBoundary: null,
|
18098 | errorBoundaryName: null,
|
18099 | errorBoundaryFound: false,
|
18100 | willRetry: false
|
18101 | };
|
18102 |
|
18103 | if (boundary !== null && boundary.tag === ClassComponent) {
|
18104 | capturedError.errorBoundary = boundary.stateNode;
|
18105 | capturedError.errorBoundaryName = getComponentName(boundary.type);
|
18106 | capturedError.errorBoundaryFound = true;
|
18107 | capturedError.willRetry = true;
|
18108 | }
|
18109 |
|
18110 | try {
|
18111 | logCapturedError(capturedError);
|
18112 | } catch (e) {
|
18113 |
|
18114 |
|
18115 |
|
18116 |
|
18117 | setTimeout(function () {
|
18118 | throw e;
|
18119 | });
|
18120 | }
|
18121 | }
|
18122 |
|
18123 | var callComponentWillUnmountWithTimer = function (current$$1, instance) {
|
18124 | startPhaseTimer(current$$1, 'componentWillUnmount');
|
18125 | instance.props = current$$1.memoizedProps;
|
18126 | instance.state = current$$1.memoizedState;
|
18127 | instance.componentWillUnmount();
|
18128 | stopPhaseTimer();
|
18129 | };
|
18130 |
|
18131 |
|
18132 | function safelyCallComponentWillUnmount(current$$1, instance) {
|
18133 | {
|
18134 | invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current$$1, instance);
|
18135 | if (hasCaughtError()) {
|
18136 | var unmountError = clearCaughtError();
|
18137 | captureCommitPhaseError(current$$1, unmountError);
|
18138 | }
|
18139 | }
|
18140 | }
|
18141 |
|
18142 | function safelyDetachRef(current$$1) {
|
18143 | var ref = current$$1.ref;
|
18144 | if (ref !== null) {
|
18145 | if (typeof ref === 'function') {
|
18146 | {
|
18147 | invokeGuardedCallback(null, ref, null, null);
|
18148 | if (hasCaughtError()) {
|
18149 | var refError = clearCaughtError();
|
18150 | captureCommitPhaseError(current$$1, refError);
|
18151 | }
|
18152 | }
|
18153 | } else {
|
18154 | ref.current = null;
|
18155 | }
|
18156 | }
|
18157 | }
|
18158 |
|
18159 | function safelyCallDestroy(current$$1, destroy) {
|
18160 | {
|
18161 | invokeGuardedCallback(null, destroy, null);
|
18162 | if (hasCaughtError()) {
|
18163 | var error = clearCaughtError();
|
18164 | captureCommitPhaseError(current$$1, error);
|
18165 | }
|
18166 | }
|
18167 | }
|
18168 |
|
18169 | function commitBeforeMutationLifeCycles(current$$1, finishedWork) {
|
18170 | switch (finishedWork.tag) {
|
18171 | case FunctionComponent:
|
18172 | case ForwardRef:
|
18173 | case SimpleMemoComponent:
|
18174 | {
|
18175 | commitHookEffectList(UnmountSnapshot, NoEffect$1, finishedWork);
|
18176 | return;
|
18177 | }
|
18178 | case ClassComponent:
|
18179 | {
|
18180 | if (finishedWork.effectTag & Snapshot) {
|
18181 | if (current$$1 !== null) {
|
18182 | var prevProps = current$$1.memoizedProps;
|
18183 | var prevState = current$$1.memoizedState;
|
18184 | startPhaseTimer(finishedWork, 'getSnapshotBeforeUpdate');
|
18185 | var instance = finishedWork.stateNode;
|
18186 |
|
18187 |
|
18188 |
|
18189 | {
|
18190 | if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
|
18191 | !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
|
18192 | !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
|
18193 | }
|
18194 | }
|
18195 | var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
|
18196 | {
|
18197 | var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
|
18198 | if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {
|
18199 | didWarnSet.add(finishedWork.type);
|
18200 | warningWithoutStack$1(false, '%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));
|
18201 | }
|
18202 | }
|
18203 | instance.__reactInternalSnapshotBeforeUpdate = snapshot;
|
18204 | stopPhaseTimer();
|
18205 | }
|
18206 | }
|
18207 | return;
|
18208 | }
|
18209 | case HostRoot:
|
18210 | case HostComponent:
|
18211 | case HostText:
|
18212 | case HostPortal:
|
18213 | case IncompleteClassComponent:
|
18214 |
|
18215 | return;
|
18216 | default:
|
18217 | {
|
18218 | invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');
|
18219 | }
|
18220 | }
|
18221 | }
|
18222 |
|
18223 | function commitHookEffectList(unmountTag, mountTag, finishedWork) {
|
18224 | if (!enableHooks) {
|
18225 | return;
|
18226 | }
|
18227 | var updateQueue = finishedWork.updateQueue;
|
18228 | var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
|
18229 | if (lastEffect !== null) {
|
18230 | var firstEffect = lastEffect.next;
|
18231 | var effect = firstEffect;
|
18232 | do {
|
18233 | if ((effect.tag & unmountTag) !== NoEffect$1) {
|
18234 |
|
18235 | var destroy = effect.destroy;
|
18236 | effect.destroy = null;
|
18237 | if (destroy !== null) {
|
18238 | destroy();
|
18239 | }
|
18240 | }
|
18241 | if ((effect.tag & mountTag) !== NoEffect$1) {
|
18242 |
|
18243 | var create = effect.create;
|
18244 | var _destroy = create();
|
18245 | if (typeof _destroy !== 'function') {
|
18246 | {
|
18247 | if (_destroy !== null && _destroy !== undefined) {
|
18248 | warningWithoutStack$1(false, 'useEffect function must return a cleanup function or ' + 'nothing.%s%s', typeof _destroy.then === 'function' ? '\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, you may write an async function separately ' + 'and then call it from inside the effect:\n\n' + 'async function fetchComment(commentId) {\n' + ' // You can await here\n' + '}\n\n' + 'useEffect(() => {\n' + ' fetchComment(commentId);\n' + '}, [commentId]);\n\n' + 'In the future, React will provide a more idiomatic solution for data fetching ' + "that doesn't involve writing effects manually." : '', getStackByFiberInDevAndProd(finishedWork));
|
18249 | }
|
18250 | }
|
18251 | _destroy = null;
|
18252 | }
|
18253 | effect.destroy = _destroy;
|
18254 | }
|
18255 | effect = effect.next;
|
18256 | } while (effect !== firstEffect);
|
18257 | }
|
18258 | }
|
18259 |
|
18260 | function commitPassiveHookEffects(finishedWork) {
|
18261 | commitHookEffectList(UnmountPassive, NoEffect$1, finishedWork);
|
18262 | commitHookEffectList(NoEffect$1, MountPassive, finishedWork);
|
18263 | }
|
18264 |
|
18265 | function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpirationTime) {
|
18266 | switch (finishedWork.tag) {
|
18267 | case FunctionComponent:
|
18268 | case ForwardRef:
|
18269 | case SimpleMemoComponent:
|
18270 | {
|
18271 | commitHookEffectList(UnmountLayout, MountLayout, finishedWork);
|
18272 | break;
|
18273 | }
|
18274 | case ClassComponent:
|
18275 | {
|
18276 | var instance = finishedWork.stateNode;
|
18277 | if (finishedWork.effectTag & Update) {
|
18278 | if (current$$1 === null) {
|
18279 | startPhaseTimer(finishedWork, 'componentDidMount');
|
18280 |
|
18281 |
|
18282 |
|
18283 | {
|
18284 | if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
|
18285 | !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
|
18286 | !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
|
18287 | }
|
18288 | }
|
18289 | instance.componentDidMount();
|
18290 | stopPhaseTimer();
|
18291 | } else {
|
18292 | var prevProps = finishedWork.elementType === finishedWork.type ? current$$1.memoizedProps : resolveDefaultProps(finishedWork.type, current$$1.memoizedProps);
|
18293 | var prevState = current$$1.memoizedState;
|
18294 | startPhaseTimer(finishedWork, 'componentDidUpdate');
|
18295 |
|
18296 |
|
18297 |
|
18298 | {
|
18299 | if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
|
18300 | !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
|
18301 | !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
|
18302 | }
|
18303 | }
|
18304 | instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
|
18305 | stopPhaseTimer();
|
18306 | }
|
18307 | }
|
18308 | var updateQueue = finishedWork.updateQueue;
|
18309 | if (updateQueue !== null) {
|
18310 | {
|
18311 | if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
|
18312 | !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
|
18313 | !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
|
18314 | }
|
18315 | }
|
18316 |
|
18317 |
|
18318 |
|
18319 | commitUpdateQueue(finishedWork, updateQueue, instance, committedExpirationTime);
|
18320 | }
|
18321 | return;
|
18322 | }
|
18323 | case HostRoot:
|
18324 | {
|
18325 | var _updateQueue = finishedWork.updateQueue;
|
18326 | if (_updateQueue !== null) {
|
18327 | var _instance = null;
|
18328 | if (finishedWork.child !== null) {
|
18329 | switch (finishedWork.child.tag) {
|
18330 | case HostComponent:
|
18331 | _instance = getPublicInstance(finishedWork.child.stateNode);
|
18332 | break;
|
18333 | case ClassComponent:
|
18334 | _instance = finishedWork.child.stateNode;
|
18335 | break;
|
18336 | }
|
18337 | }
|
18338 | commitUpdateQueue(finishedWork, _updateQueue, _instance, committedExpirationTime);
|
18339 | }
|
18340 | return;
|
18341 | }
|
18342 | case HostComponent:
|
18343 | {
|
18344 | var _instance2 = finishedWork.stateNode;
|
18345 |
|
18346 |
|
18347 |
|
18348 |
|
18349 |
|
18350 | if (current$$1 === null && finishedWork.effectTag & Update) {
|
18351 | var type = finishedWork.type;
|
18352 | var props = finishedWork.memoizedProps;
|
18353 | commitMount(_instance2, type, props, finishedWork);
|
18354 | }
|
18355 |
|
18356 | return;
|
18357 | }
|
18358 | case HostText:
|
18359 | {
|
18360 |
|
18361 | return;
|
18362 | }
|
18363 | case HostPortal:
|
18364 | {
|
18365 |
|
18366 | return;
|
18367 | }
|
18368 | case Profiler:
|
18369 | {
|
18370 | if (enableProfilerTimer) {
|
18371 | var onRender = finishedWork.memoizedProps.onRender;
|
18372 |
|
18373 | if (enableSchedulerTracing) {
|
18374 | onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions);
|
18375 | } else {
|
18376 | onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime());
|
18377 | }
|
18378 | }
|
18379 | return;
|
18380 | }
|
18381 | case SuspenseComponent:
|
18382 | break;
|
18383 | case IncompleteClassComponent:
|
18384 | break;
|
18385 | default:
|
18386 | {
|
18387 | invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');
|
18388 | }
|
18389 | }
|
18390 | }
|
18391 |
|
18392 | function hideOrUnhideAllChildren(finishedWork, isHidden) {
|
18393 | if (supportsMutation) {
|
18394 |
|
18395 | var node = finishedWork;
|
18396 | while (true) {
|
18397 | if (node.tag === HostComponent) {
|
18398 | var instance = node.stateNode;
|
18399 | if (isHidden) {
|
18400 | hideInstance(instance);
|
18401 | } else {
|
18402 | unhideInstance(node.stateNode, node.memoizedProps);
|
18403 | }
|
18404 | } else if (node.tag === HostText) {
|
18405 | var _instance3 = node.stateNode;
|
18406 | if (isHidden) {
|
18407 | hideTextInstance(_instance3);
|
18408 | } else {
|
18409 | unhideTextInstance(_instance3, node.memoizedProps);
|
18410 | }
|
18411 | } else if (node.tag === SuspenseComponent && node.memoizedState !== null) {
|
18412 |
|
18413 | var fallbackChildFragment = node.child.sibling;
|
18414 | fallbackChildFragment.return = node;
|
18415 | node = fallbackChildFragment;
|
18416 | continue;
|
18417 | } else if (node.child !== null) {
|
18418 | node.child.return = node;
|
18419 | node = node.child;
|
18420 | continue;
|
18421 | }
|
18422 | if (node === finishedWork) {
|
18423 | return;
|
18424 | }
|
18425 | while (node.sibling === null) {
|
18426 | if (node.return === null || node.return === finishedWork) {
|
18427 | return;
|
18428 | }
|
18429 | node = node.return;
|
18430 | }
|
18431 | node.sibling.return = node.return;
|
18432 | node = node.sibling;
|
18433 | }
|
18434 | }
|
18435 | }
|
18436 |
|
18437 | function commitAttachRef(finishedWork) {
|
18438 | var ref = finishedWork.ref;
|
18439 | if (ref !== null) {
|
18440 | var instance = finishedWork.stateNode;
|
18441 | var instanceToUse = void 0;
|
18442 | switch (finishedWork.tag) {
|
18443 | case HostComponent:
|
18444 | instanceToUse = getPublicInstance(instance);
|
18445 | break;
|
18446 | default:
|
18447 | instanceToUse = instance;
|
18448 | }
|
18449 | if (typeof ref === 'function') {
|
18450 | ref(instanceToUse);
|
18451 | } else {
|
18452 | {
|
18453 | if (!ref.hasOwnProperty('current')) {
|
18454 | warningWithoutStack$1(false, 'Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork.type), getStackByFiberInDevAndProd(finishedWork));
|
18455 | }
|
18456 | }
|
18457 |
|
18458 | ref.current = instanceToUse;
|
18459 | }
|
18460 | }
|
18461 | }
|
18462 |
|
18463 | function commitDetachRef(current$$1) {
|
18464 | var currentRef = current$$1.ref;
|
18465 | if (currentRef !== null) {
|
18466 | if (typeof currentRef === 'function') {
|
18467 | currentRef(null);
|
18468 | } else {
|
18469 | currentRef.current = null;
|
18470 | }
|
18471 | }
|
18472 | }
|
18473 |
|
18474 |
|
18475 |
|
18476 |
|
18477 | function commitUnmount(current$$1) {
|
18478 | onCommitUnmount(current$$1);
|
18479 |
|
18480 | switch (current$$1.tag) {
|
18481 | case FunctionComponent:
|
18482 | case ForwardRef:
|
18483 | case MemoComponent:
|
18484 | case SimpleMemoComponent:
|
18485 | {
|
18486 | var updateQueue = current$$1.updateQueue;
|
18487 | if (updateQueue !== null) {
|
18488 | var lastEffect = updateQueue.lastEffect;
|
18489 | if (lastEffect !== null) {
|
18490 | var firstEffect = lastEffect.next;
|
18491 | var effect = firstEffect;
|
18492 | do {
|
18493 | var destroy = effect.destroy;
|
18494 | if (destroy !== null) {
|
18495 | safelyCallDestroy(current$$1, destroy);
|
18496 | }
|
18497 | effect = effect.next;
|
18498 | } while (effect !== firstEffect);
|
18499 | }
|
18500 | }
|
18501 | break;
|
18502 | }
|
18503 | case ClassComponent:
|
18504 | {
|
18505 | safelyDetachRef(current$$1);
|
18506 | var instance = current$$1.stateNode;
|
18507 | if (typeof instance.componentWillUnmount === 'function') {
|
18508 | safelyCallComponentWillUnmount(current$$1, instance);
|
18509 | }
|
18510 | return;
|
18511 | }
|
18512 | case HostComponent:
|
18513 | {
|
18514 | safelyDetachRef(current$$1);
|
18515 | return;
|
18516 | }
|
18517 | case HostPortal:
|
18518 | {
|
18519 |
|
18520 |
|
18521 |
|
18522 | if (supportsMutation) {
|
18523 | unmountHostComponents(current$$1);
|
18524 | } else if (supportsPersistence) {
|
18525 | emptyPortalContainer(current$$1);
|
18526 | }
|
18527 | return;
|
18528 | }
|
18529 | }
|
18530 | }
|
18531 |
|
18532 | function commitNestedUnmounts(root) {
|
18533 |
|
18534 |
|
18535 |
|
18536 |
|
18537 | var node = root;
|
18538 | while (true) {
|
18539 | commitUnmount(node);
|
18540 |
|
18541 |
|
18542 | if (node.child !== null && (
|
18543 |
|
18544 |
|
18545 | !supportsMutation || node.tag !== HostPortal)) {
|
18546 | node.child.return = node;
|
18547 | node = node.child;
|
18548 | continue;
|
18549 | }
|
18550 | if (node === root) {
|
18551 | return;
|
18552 | }
|
18553 | while (node.sibling === null) {
|
18554 | if (node.return === null || node.return === root) {
|
18555 | return;
|
18556 | }
|
18557 | node = node.return;
|
18558 | }
|
18559 | node.sibling.return = node.return;
|
18560 | node = node.sibling;
|
18561 | }
|
18562 | }
|
18563 |
|
18564 | function detachFiber(current$$1) {
|
18565 |
|
18566 |
|
18567 |
|
18568 |
|
18569 |
|
18570 | current$$1.return = null;
|
18571 | current$$1.child = null;
|
18572 | current$$1.memoizedState = null;
|
18573 | current$$1.updateQueue = null;
|
18574 | var alternate = current$$1.alternate;
|
18575 | if (alternate !== null) {
|
18576 | alternate.return = null;
|
18577 | alternate.child = null;
|
18578 | alternate.memoizedState = null;
|
18579 | alternate.updateQueue = null;
|
18580 | }
|
18581 | }
|
18582 |
|
18583 | function emptyPortalContainer(current$$1) {
|
18584 | if (!supportsPersistence) {
|
18585 | return;
|
18586 | }
|
18587 |
|
18588 | var portal = current$$1.stateNode;
|
18589 | var containerInfo = portal.containerInfo;
|
18590 |
|
18591 | var emptyChildSet = createContainerChildSet(containerInfo);
|
18592 | replaceContainerChildren(containerInfo, emptyChildSet);
|
18593 | }
|
18594 |
|
18595 | function commitContainer(finishedWork) {
|
18596 | if (!supportsPersistence) {
|
18597 | return;
|
18598 | }
|
18599 |
|
18600 | switch (finishedWork.tag) {
|
18601 | case ClassComponent:
|
18602 | {
|
18603 | return;
|
18604 | }
|
18605 | case HostComponent:
|
18606 | {
|
18607 | return;
|
18608 | }
|
18609 | case HostText:
|
18610 | {
|
18611 | return;
|
18612 | }
|
18613 | case HostRoot:
|
18614 | case HostPortal:
|
18615 | {
|
18616 | var portalOrRoot = finishedWork.stateNode;
|
18617 | var containerInfo = portalOrRoot.containerInfo,
|
18618 | _pendingChildren = portalOrRoot.pendingChildren;
|
18619 |
|
18620 | replaceContainerChildren(containerInfo, _pendingChildren);
|
18621 | return;
|
18622 | }
|
18623 | default:
|
18624 | {
|
18625 | invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');
|
18626 | }
|
18627 | }
|
18628 | }
|
18629 |
|
18630 | function getHostParentFiber(fiber) {
|
18631 | var parent = fiber.return;
|
18632 | while (parent !== null) {
|
18633 | if (isHostParent(parent)) {
|
18634 | return parent;
|
18635 | }
|
18636 | parent = parent.return;
|
18637 | }
|
18638 | invariant(false, 'Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.');
|
18639 | }
|
18640 |
|
18641 | function isHostParent(fiber) {
|
18642 | return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
|
18643 | }
|
18644 |
|
18645 | function getHostSibling(fiber) {
|
18646 |
|
18647 |
|
18648 |
|
18649 | var node = fiber;
|
18650 | siblings: while (true) {
|
18651 |
|
18652 | while (node.sibling === null) {
|
18653 | if (node.return === null || isHostParent(node.return)) {
|
18654 |
|
18655 |
|
18656 | return null;
|
18657 | }
|
18658 | node = node.return;
|
18659 | }
|
18660 | node.sibling.return = node.return;
|
18661 | node = node.sibling;
|
18662 | while (node.tag !== HostComponent && node.tag !== HostText) {
|
18663 |
|
18664 |
|
18665 | if (node.effectTag & Placement) {
|
18666 |
|
18667 | continue siblings;
|
18668 | }
|
18669 |
|
18670 |
|
18671 | if (node.child === null || node.tag === HostPortal) {
|
18672 | continue siblings;
|
18673 | } else {
|
18674 | node.child.return = node;
|
18675 | node = node.child;
|
18676 | }
|
18677 | }
|
18678 |
|
18679 | if (!(node.effectTag & Placement)) {
|
18680 |
|
18681 | return node.stateNode;
|
18682 | }
|
18683 | }
|
18684 | }
|
18685 |
|
18686 | function commitPlacement(finishedWork) {
|
18687 | if (!supportsMutation) {
|
18688 | return;
|
18689 | }
|
18690 |
|
18691 |
|
18692 | var parentFiber = getHostParentFiber(finishedWork);
|
18693 |
|
18694 |
|
18695 | var parent = void 0;
|
18696 | var isContainer = void 0;
|
18697 |
|
18698 | switch (parentFiber.tag) {
|
18699 | case HostComponent:
|
18700 | parent = parentFiber.stateNode;
|
18701 | isContainer = false;
|
18702 | break;
|
18703 | case HostRoot:
|
18704 | parent = parentFiber.stateNode.containerInfo;
|
18705 | isContainer = true;
|
18706 | break;
|
18707 | case HostPortal:
|
18708 | parent = parentFiber.stateNode.containerInfo;
|
18709 | isContainer = true;
|
18710 | break;
|
18711 | default:
|
18712 | invariant(false, 'Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.');
|
18713 | }
|
18714 | if (parentFiber.effectTag & ContentReset) {
|
18715 |
|
18716 | resetTextContent(parent);
|
18717 |
|
18718 | parentFiber.effectTag &= ~ContentReset;
|
18719 | }
|
18720 |
|
18721 | var before = getHostSibling(finishedWork);
|
18722 |
|
18723 |
|
18724 | var node = finishedWork;
|
18725 | while (true) {
|
18726 | if (node.tag === HostComponent || node.tag === HostText) {
|
18727 | if (before) {
|
18728 | if (isContainer) {
|
18729 | insertInContainerBefore(parent, node.stateNode, before);
|
18730 | } else {
|
18731 | insertBefore(parent, node.stateNode, before);
|
18732 | }
|
18733 | } else {
|
18734 | if (isContainer) {
|
18735 | appendChildToContainer(parent, node.stateNode);
|
18736 | } else {
|
18737 | appendChild(parent, node.stateNode);
|
18738 | }
|
18739 | }
|
18740 | } else if (node.tag === HostPortal) {
|
18741 |
|
18742 |
|
18743 |
|
18744 | } else if (node.child !== null) {
|
18745 | node.child.return = node;
|
18746 | node = node.child;
|
18747 | continue;
|
18748 | }
|
18749 | if (node === finishedWork) {
|
18750 | return;
|
18751 | }
|
18752 | while (node.sibling === null) {
|
18753 | if (node.return === null || node.return === finishedWork) {
|
18754 | return;
|
18755 | }
|
18756 | node = node.return;
|
18757 | }
|
18758 | node.sibling.return = node.return;
|
18759 | node = node.sibling;
|
18760 | }
|
18761 | }
|
18762 |
|
18763 | function unmountHostComponents(current$$1) {
|
18764 |
|
18765 | var node = current$$1;
|
18766 |
|
18767 |
|
18768 |
|
18769 | var currentParentIsValid = false;
|
18770 |
|
18771 |
|
18772 | var currentParent = void 0;
|
18773 | var currentParentIsContainer = void 0;
|
18774 |
|
18775 | while (true) {
|
18776 | if (!currentParentIsValid) {
|
18777 | var parent = node.return;
|
18778 | findParent: while (true) {
|
18779 | !(parent !== null) ? invariant(false, 'Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
18780 | switch (parent.tag) {
|
18781 | case HostComponent:
|
18782 | currentParent = parent.stateNode;
|
18783 | currentParentIsContainer = false;
|
18784 | break findParent;
|
18785 | case HostRoot:
|
18786 | currentParent = parent.stateNode.containerInfo;
|
18787 | currentParentIsContainer = true;
|
18788 | break findParent;
|
18789 | case HostPortal:
|
18790 | currentParent = parent.stateNode.containerInfo;
|
18791 | currentParentIsContainer = true;
|
18792 | break findParent;
|
18793 | }
|
18794 | parent = parent.return;
|
18795 | }
|
18796 | currentParentIsValid = true;
|
18797 | }
|
18798 |
|
18799 | if (node.tag === HostComponent || node.tag === HostText) {
|
18800 | commitNestedUnmounts(node);
|
18801 |
|
18802 |
|
18803 | if (currentParentIsContainer) {
|
18804 | removeChildFromContainer(currentParent, node.stateNode);
|
18805 | } else {
|
18806 | removeChild(currentParent, node.stateNode);
|
18807 | }
|
18808 |
|
18809 | } else if (node.tag === HostPortal) {
|
18810 |
|
18811 |
|
18812 | currentParent = node.stateNode.containerInfo;
|
18813 | currentParentIsContainer = true;
|
18814 |
|
18815 | if (node.child !== null) {
|
18816 | node.child.return = node;
|
18817 | node = node.child;
|
18818 | continue;
|
18819 | }
|
18820 | } else {
|
18821 | commitUnmount(node);
|
18822 |
|
18823 | if (node.child !== null) {
|
18824 | node.child.return = node;
|
18825 | node = node.child;
|
18826 | continue;
|
18827 | }
|
18828 | }
|
18829 | if (node === current$$1) {
|
18830 | return;
|
18831 | }
|
18832 | while (node.sibling === null) {
|
18833 | if (node.return === null || node.return === current$$1) {
|
18834 | return;
|
18835 | }
|
18836 | node = node.return;
|
18837 | if (node.tag === HostPortal) {
|
18838 |
|
18839 |
|
18840 | currentParentIsValid = false;
|
18841 | }
|
18842 | }
|
18843 | node.sibling.return = node.return;
|
18844 | node = node.sibling;
|
18845 | }
|
18846 | }
|
18847 |
|
18848 | function commitDeletion(current$$1) {
|
18849 | if (supportsMutation) {
|
18850 |
|
18851 |
|
18852 | unmountHostComponents(current$$1);
|
18853 | } else {
|
18854 |
|
18855 | commitNestedUnmounts(current$$1);
|
18856 | }
|
18857 | detachFiber(current$$1);
|
18858 | }
|
18859 |
|
18860 | function commitWork(current$$1, finishedWork) {
|
18861 | if (!supportsMutation) {
|
18862 | switch (finishedWork.tag) {
|
18863 | case FunctionComponent:
|
18864 | case ForwardRef:
|
18865 | case MemoComponent:
|
18866 | case SimpleMemoComponent:
|
18867 | {
|
18868 |
|
18869 |
|
18870 | commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
|
18871 | return;
|
18872 | }
|
18873 | }
|
18874 |
|
18875 | commitContainer(finishedWork);
|
18876 | return;
|
18877 | }
|
18878 |
|
18879 | switch (finishedWork.tag) {
|
18880 | case FunctionComponent:
|
18881 | case ForwardRef:
|
18882 | case MemoComponent:
|
18883 | case SimpleMemoComponent:
|
18884 | {
|
18885 |
|
18886 |
|
18887 | commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
|
18888 | return;
|
18889 | }
|
18890 | case ClassComponent:
|
18891 | {
|
18892 | return;
|
18893 | }
|
18894 | case HostComponent:
|
18895 | {
|
18896 | var instance = finishedWork.stateNode;
|
18897 | if (instance != null) {
|
18898 |
|
18899 | var newProps = finishedWork.memoizedProps;
|
18900 |
|
18901 |
|
18902 |
|
18903 | var oldProps = current$$1 !== null ? current$$1.memoizedProps : newProps;
|
18904 | var type = finishedWork.type;
|
18905 |
|
18906 | var updatePayload = finishedWork.updateQueue;
|
18907 | finishedWork.updateQueue = null;
|
18908 | if (updatePayload !== null) {
|
18909 | commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork);
|
18910 | }
|
18911 | }
|
18912 | return;
|
18913 | }
|
18914 | case HostText:
|
18915 | {
|
18916 | !(finishedWork.stateNode !== null) ? invariant(false, 'This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
18917 | var textInstance = finishedWork.stateNode;
|
18918 | var newText = finishedWork.memoizedProps;
|
18919 |
|
18920 |
|
18921 |
|
18922 | var oldText = current$$1 !== null ? current$$1.memoizedProps : newText;
|
18923 | commitTextUpdate(textInstance, oldText, newText);
|
18924 | return;
|
18925 | }
|
18926 | case HostRoot:
|
18927 | {
|
18928 | return;
|
18929 | }
|
18930 | case Profiler:
|
18931 | {
|
18932 | return;
|
18933 | }
|
18934 | case SuspenseComponent:
|
18935 | {
|
18936 | var newState = finishedWork.memoizedState;
|
18937 |
|
18938 | var newDidTimeout = void 0;
|
18939 | var primaryChildParent = finishedWork;
|
18940 | if (newState === null) {
|
18941 | newDidTimeout = false;
|
18942 | } else {
|
18943 | newDidTimeout = true;
|
18944 | primaryChildParent = finishedWork.child;
|
18945 | if (newState.timedOutAt === NoWork) {
|
18946 |
|
18947 |
|
18948 |
|
18949 | newState.timedOutAt = requestCurrentTime();
|
18950 | }
|
18951 | }
|
18952 |
|
18953 | if (primaryChildParent !== null) {
|
18954 | hideOrUnhideAllChildren(primaryChildParent, newDidTimeout);
|
18955 | }
|
18956 |
|
18957 |
|
18958 |
|
18959 |
|
18960 | var thenables = finishedWork.updateQueue;
|
18961 | if (thenables !== null) {
|
18962 | finishedWork.updateQueue = null;
|
18963 | var retryCache = finishedWork.stateNode;
|
18964 | if (retryCache === null) {
|
18965 | retryCache = finishedWork.stateNode = new PossiblyWeakSet();
|
18966 | }
|
18967 | thenables.forEach(function (thenable) {
|
18968 |
|
18969 | var retry = retryTimedOutBoundary.bind(null, finishedWork, thenable);
|
18970 | if (enableSchedulerTracing) {
|
18971 | retry = tracing.unstable_wrap(retry);
|
18972 | }
|
18973 | if (!retryCache.has(thenable)) {
|
18974 | retryCache.add(thenable);
|
18975 | thenable.then(retry, retry);
|
18976 | }
|
18977 | });
|
18978 | }
|
18979 |
|
18980 | return;
|
18981 | }
|
18982 | case IncompleteClassComponent:
|
18983 | {
|
18984 | return;
|
18985 | }
|
18986 | default:
|
18987 | {
|
18988 | invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');
|
18989 | }
|
18990 | }
|
18991 | }
|
18992 |
|
18993 | function commitResetTextContent(current$$1) {
|
18994 | if (!supportsMutation) {
|
18995 | return;
|
18996 | }
|
18997 | resetTextContent(current$$1.stateNode);
|
18998 | }
|
18999 |
|
19000 | var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
19001 |
|
19002 | function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
|
19003 | var update = createUpdate(expirationTime);
|
19004 |
|
19005 | update.tag = CaptureUpdate;
|
19006 |
|
19007 |
|
19008 | update.payload = { element: null };
|
19009 | var error = errorInfo.value;
|
19010 | update.callback = function () {
|
19011 | onUncaughtError(error);
|
19012 | logError(fiber, errorInfo);
|
19013 | };
|
19014 | return update;
|
19015 | }
|
19016 |
|
19017 | function createClassErrorUpdate(fiber, errorInfo, expirationTime) {
|
19018 | var update = createUpdate(expirationTime);
|
19019 | update.tag = CaptureUpdate;
|
19020 | var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
|
19021 | if (typeof getDerivedStateFromError === 'function') {
|
19022 | var error = errorInfo.value;
|
19023 | update.payload = function () {
|
19024 | return getDerivedStateFromError(error);
|
19025 | };
|
19026 | }
|
19027 |
|
19028 | var inst = fiber.stateNode;
|
19029 | if (inst !== null && typeof inst.componentDidCatch === 'function') {
|
19030 | update.callback = function callback() {
|
19031 | if (typeof getDerivedStateFromError !== 'function') {
|
19032 |
|
19033 |
|
19034 |
|
19035 |
|
19036 |
|
19037 | markLegacyErrorBoundaryAsFailed(this);
|
19038 | }
|
19039 | var error = errorInfo.value;
|
19040 | var stack = errorInfo.stack;
|
19041 | logError(fiber, errorInfo);
|
19042 | this.componentDidCatch(error, {
|
19043 | componentStack: stack !== null ? stack : ''
|
19044 | });
|
19045 | {
|
19046 | if (typeof getDerivedStateFromError !== 'function') {
|
19047 |
|
19048 |
|
19049 |
|
19050 | !(fiber.expirationTime === Sync) ? warningWithoutStack$1(false, '%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown') : void 0;
|
19051 | }
|
19052 | }
|
19053 | };
|
19054 | }
|
19055 | return update;
|
19056 | }
|
19057 |
|
19058 | function throwException(root, returnFiber, sourceFiber, value, renderExpirationTime) {
|
19059 |
|
19060 | sourceFiber.effectTag |= Incomplete;
|
19061 |
|
19062 | sourceFiber.firstEffect = sourceFiber.lastEffect = null;
|
19063 |
|
19064 | if (value !== null && typeof value === 'object' && typeof value.then === 'function') {
|
19065 |
|
19066 | var thenable = value;
|
19067 |
|
19068 |
|
19069 |
|
19070 |
|
19071 |
|
19072 |
|
19073 | var _workInProgress = returnFiber;
|
19074 | var earliestTimeoutMs = -1;
|
19075 | var startTimeMs = -1;
|
19076 | do {
|
19077 | if (_workInProgress.tag === SuspenseComponent) {
|
19078 | var current$$1 = _workInProgress.alternate;
|
19079 | if (current$$1 !== null) {
|
19080 | var currentState = current$$1.memoizedState;
|
19081 | if (currentState !== null) {
|
19082 |
|
19083 |
|
19084 | var timedOutAt = currentState.timedOutAt;
|
19085 | startTimeMs = expirationTimeToMs(timedOutAt);
|
19086 |
|
19087 | break;
|
19088 | }
|
19089 | }
|
19090 | var timeoutPropMs = _workInProgress.pendingProps.maxDuration;
|
19091 | if (typeof timeoutPropMs === 'number') {
|
19092 | if (timeoutPropMs <= 0) {
|
19093 | earliestTimeoutMs = 0;
|
19094 | } else if (earliestTimeoutMs === -1 || timeoutPropMs < earliestTimeoutMs) {
|
19095 | earliestTimeoutMs = timeoutPropMs;
|
19096 | }
|
19097 | }
|
19098 | }
|
19099 | _workInProgress = _workInProgress.return;
|
19100 | } while (_workInProgress !== null);
|
19101 |
|
19102 |
|
19103 | _workInProgress = returnFiber;
|
19104 | do {
|
19105 | if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress)) {
|
19106 |
|
19107 |
|
19108 |
|
19109 | var thenables = _workInProgress.updateQueue;
|
19110 | if (thenables === null) {
|
19111 | _workInProgress.updateQueue = new Set([thenable]);
|
19112 | } else {
|
19113 | thenables.add(thenable);
|
19114 | }
|
19115 |
|
19116 |
|
19117 |
|
19118 |
|
19119 |
|
19120 |
|
19121 |
|
19122 |
|
19123 |
|
19124 | if ((_workInProgress.mode & ConcurrentMode) === NoEffect) {
|
19125 | _workInProgress.effectTag |= DidCapture;
|
19126 |
|
19127 |
|
19128 |
|
19129 |
|
19130 | sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);
|
19131 |
|
19132 | if (sourceFiber.tag === ClassComponent) {
|
19133 | var currentSourceFiber = sourceFiber.alternate;
|
19134 | if (currentSourceFiber === null) {
|
19135 |
|
19136 |
|
19137 |
|
19138 | sourceFiber.tag = IncompleteClassComponent;
|
19139 | } else {
|
19140 |
|
19141 |
|
19142 |
|
19143 | var update = createUpdate(Sync);
|
19144 | update.tag = ForceUpdate;
|
19145 | enqueueUpdate(sourceFiber, update);
|
19146 | }
|
19147 | }
|
19148 |
|
19149 |
|
19150 |
|
19151 | sourceFiber.expirationTime = Sync;
|
19152 |
|
19153 |
|
19154 | return;
|
19155 | }
|
19156 |
|
19157 |
|
19158 |
|
19159 |
|
19160 |
|
19161 |
|
19162 |
|
19163 | var pingCache = root.pingCache;
|
19164 | var threadIDs = void 0;
|
19165 | if (pingCache === null) {
|
19166 | pingCache = root.pingCache = new PossiblyWeakMap();
|
19167 | threadIDs = new Set();
|
19168 | pingCache.set(thenable, threadIDs);
|
19169 | } else {
|
19170 | threadIDs = pingCache.get(thenable);
|
19171 | if (threadIDs === undefined) {
|
19172 | threadIDs = new Set();
|
19173 | pingCache.set(thenable, threadIDs);
|
19174 | }
|
19175 | }
|
19176 | if (!threadIDs.has(renderExpirationTime)) {
|
19177 |
|
19178 | threadIDs.add(renderExpirationTime);
|
19179 | var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime);
|
19180 | if (enableSchedulerTracing) {
|
19181 | ping = tracing.unstable_wrap(ping);
|
19182 | }
|
19183 | thenable.then(ping, ping);
|
19184 | }
|
19185 |
|
19186 | var absoluteTimeoutMs = void 0;
|
19187 | if (earliestTimeoutMs === -1) {
|
19188 |
|
19189 |
|
19190 |
|
19191 | absoluteTimeoutMs = maxSigned31BitInt;
|
19192 | } else {
|
19193 | if (startTimeMs === -1) {
|
19194 |
|
19195 |
|
19196 |
|
19197 |
|
19198 |
|
19199 |
|
19200 |
|
19201 |
|
19202 |
|
19203 | var earliestExpirationTime = findEarliestOutstandingPriorityLevel(root, renderExpirationTime);
|
19204 | var earliestExpirationTimeMs = expirationTimeToMs(earliestExpirationTime);
|
19205 | startTimeMs = earliestExpirationTimeMs - LOW_PRIORITY_EXPIRATION;
|
19206 | }
|
19207 | absoluteTimeoutMs = startTimeMs + earliestTimeoutMs;
|
19208 | }
|
19209 |
|
19210 |
|
19211 |
|
19212 |
|
19213 |
|
19214 | renderDidSuspend(root, absoluteTimeoutMs, renderExpirationTime);
|
19215 |
|
19216 | _workInProgress.effectTag |= ShouldCapture;
|
19217 | _workInProgress.expirationTime = renderExpirationTime;
|
19218 | return;
|
19219 | }
|
19220 |
|
19221 |
|
19222 | _workInProgress = _workInProgress.return;
|
19223 | } while (_workInProgress !== null);
|
19224 |
|
19225 |
|
19226 | value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.\n' + '\n' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.' + getStackByFiberInDevAndProd(sourceFiber));
|
19227 | }
|
19228 |
|
19229 |
|
19230 |
|
19231 |
|
19232 | renderDidError();
|
19233 | value = createCapturedValue(value, sourceFiber);
|
19234 | var workInProgress = returnFiber;
|
19235 | do {
|
19236 | switch (workInProgress.tag) {
|
19237 | case HostRoot:
|
19238 | {
|
19239 | var _errorInfo = value;
|
19240 | workInProgress.effectTag |= ShouldCapture;
|
19241 | workInProgress.expirationTime = renderExpirationTime;
|
19242 | var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);
|
19243 | enqueueCapturedUpdate(workInProgress, _update);
|
19244 | return;
|
19245 | }
|
19246 | case ClassComponent:
|
19247 |
|
19248 | var errorInfo = value;
|
19249 | var ctor = workInProgress.type;
|
19250 | var instance = workInProgress.stateNode;
|
19251 | if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {
|
19252 | workInProgress.effectTag |= ShouldCapture;
|
19253 | workInProgress.expirationTime = renderExpirationTime;
|
19254 |
|
19255 | var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);
|
19256 | enqueueCapturedUpdate(workInProgress, _update2);
|
19257 | return;
|
19258 | }
|
19259 | break;
|
19260 | default:
|
19261 | break;
|
19262 | }
|
19263 | workInProgress = workInProgress.return;
|
19264 | } while (workInProgress !== null);
|
19265 | }
|
19266 |
|
19267 | function unwindWork(workInProgress, renderExpirationTime) {
|
19268 | switch (workInProgress.tag) {
|
19269 | case ClassComponent:
|
19270 | {
|
19271 | var Component = workInProgress.type;
|
19272 | if (isContextProvider(Component)) {
|
19273 | popContext(workInProgress);
|
19274 | }
|
19275 | var effectTag = workInProgress.effectTag;
|
19276 | if (effectTag & ShouldCapture) {
|
19277 | workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture;
|
19278 | return workInProgress;
|
19279 | }
|
19280 | return null;
|
19281 | }
|
19282 | case HostRoot:
|
19283 | {
|
19284 | popHostContainer(workInProgress);
|
19285 | popTopLevelContextObject(workInProgress);
|
19286 | var _effectTag = workInProgress.effectTag;
|
19287 | !((_effectTag & DidCapture) === NoEffect) ? invariant(false, 'The root failed to unmount after an error. This is likely a bug in React. Please file an issue.') : void 0;
|
19288 | workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture;
|
19289 | return workInProgress;
|
19290 | }
|
19291 | case HostComponent:
|
19292 | {
|
19293 | popHostContext(workInProgress);
|
19294 | return null;
|
19295 | }
|
19296 | case SuspenseComponent:
|
19297 | {
|
19298 | var _effectTag2 = workInProgress.effectTag;
|
19299 | if (_effectTag2 & ShouldCapture) {
|
19300 | workInProgress.effectTag = _effectTag2 & ~ShouldCapture | DidCapture;
|
19301 |
|
19302 | return workInProgress;
|
19303 | }
|
19304 | return null;
|
19305 | }
|
19306 | case HostPortal:
|
19307 | popHostContainer(workInProgress);
|
19308 | return null;
|
19309 | case ContextProvider:
|
19310 | popProvider(workInProgress);
|
19311 | return null;
|
19312 | default:
|
19313 | return null;
|
19314 | }
|
19315 | }
|
19316 |
|
19317 | function unwindInterruptedWork(interruptedWork) {
|
19318 | switch (interruptedWork.tag) {
|
19319 | case ClassComponent:
|
19320 | {
|
19321 | var childContextTypes = interruptedWork.type.childContextTypes;
|
19322 | if (childContextTypes !== null && childContextTypes !== undefined) {
|
19323 | popContext(interruptedWork);
|
19324 | }
|
19325 | break;
|
19326 | }
|
19327 | case HostRoot:
|
19328 | {
|
19329 | popHostContainer(interruptedWork);
|
19330 | popTopLevelContextObject(interruptedWork);
|
19331 | break;
|
19332 | }
|
19333 | case HostComponent:
|
19334 | {
|
19335 | popHostContext(interruptedWork);
|
19336 | break;
|
19337 | }
|
19338 | case HostPortal:
|
19339 | popHostContainer(interruptedWork);
|
19340 | break;
|
19341 | case ContextProvider:
|
19342 | popProvider(interruptedWork);
|
19343 | break;
|
19344 | default:
|
19345 | break;
|
19346 | }
|
19347 | }
|
19348 |
|
19349 | var Dispatcher = {
|
19350 | readContext: readContext,
|
19351 | useCallback: useCallback,
|
19352 | useContext: useContext,
|
19353 | useEffect: useEffect,
|
19354 | useImperativeMethods: useImperativeMethods,
|
19355 | useLayoutEffect: useLayoutEffect,
|
19356 | useMemo: useMemo,
|
19357 | useReducer: useReducer,
|
19358 | useRef: useRef,
|
19359 | useState: useState
|
19360 | };
|
19361 | var DispatcherWithoutHooks = {
|
19362 | readContext: readContext
|
19363 | };
|
19364 |
|
19365 | var ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner;
|
19366 |
|
19367 |
|
19368 | var didWarnAboutStateTransition = void 0;
|
19369 | var didWarnSetStateChildContext = void 0;
|
19370 | var warnAboutUpdateOnUnmounted = void 0;
|
19371 | var warnAboutInvalidUpdates = void 0;
|
19372 |
|
19373 | if (enableSchedulerTracing) {
|
19374 |
|
19375 |
|
19376 | !(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null) ? invariant(false, 'It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling') : void 0;
|
19377 | }
|
19378 |
|
19379 | {
|
19380 | didWarnAboutStateTransition = false;
|
19381 | didWarnSetStateChildContext = false;
|
19382 | var didWarnStateUpdateForUnmountedComponent = {};
|
19383 |
|
19384 | warnAboutUpdateOnUnmounted = function (fiber, isClass) {
|
19385 |
|
19386 |
|
19387 | var componentName = getComponentName(fiber.type) || 'ReactComponent';
|
19388 | if (didWarnStateUpdateForUnmountedComponent[componentName]) {
|
19389 | return;
|
19390 | }
|
19391 | warningWithoutStack$1(false, "Can't perform a React state update on an unmounted component. This " + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.%s', isClass ? 'the componentWillUnmount method' : 'a useEffect cleanup function', getStackByFiberInDevAndProd(fiber));
|
19392 | didWarnStateUpdateForUnmountedComponent[componentName] = true;
|
19393 | };
|
19394 |
|
19395 | warnAboutInvalidUpdates = function (instance) {
|
19396 | switch (phase) {
|
19397 | case 'getChildContext':
|
19398 | if (didWarnSetStateChildContext) {
|
19399 | return;
|
19400 | }
|
19401 | warningWithoutStack$1(false, 'setState(...): Cannot call setState() inside getChildContext()');
|
19402 | didWarnSetStateChildContext = true;
|
19403 | break;
|
19404 | case 'render':
|
19405 | if (didWarnAboutStateTransition) {
|
19406 | return;
|
19407 | }
|
19408 | warningWithoutStack$1(false, 'Cannot update during an existing state transition (such as within ' + '`render`). Render methods should be a pure function of props and state.');
|
19409 | didWarnAboutStateTransition = true;
|
19410 | break;
|
19411 | }
|
19412 | };
|
19413 | }
|
19414 |
|
19415 |
|
19416 | var lastUniqueAsyncExpiration = Sync - 1;
|
19417 |
|
19418 |
|
19419 |
|
19420 |
|
19421 | var expirationContext = NoWork;
|
19422 |
|
19423 | var isWorking = false;
|
19424 |
|
19425 |
|
19426 | var nextUnitOfWork = null;
|
19427 | var nextRoot = null;
|
19428 |
|
19429 | var nextRenderExpirationTime = NoWork;
|
19430 | var nextLatestAbsoluteTimeoutMs = -1;
|
19431 | var nextRenderDidError = false;
|
19432 |
|
19433 |
|
19434 | var nextEffect = null;
|
19435 |
|
19436 | var isCommitting$1 = false;
|
19437 | var rootWithPendingPassiveEffects = null;
|
19438 | var passiveEffectCallbackHandle = null;
|
19439 | var passiveEffectCallback = null;
|
19440 |
|
19441 | var legacyErrorBoundariesThatAlreadyFailed = null;
|
19442 |
|
19443 |
|
19444 | var interruptedBy = null;
|
19445 |
|
19446 | var stashedWorkInProgressProperties = void 0;
|
19447 | var replayUnitOfWork = void 0;
|
19448 | var mayReplayFailedUnitOfWork = void 0;
|
19449 | var isReplayingFailedUnitOfWork = void 0;
|
19450 | var originalReplayError = void 0;
|
19451 | var rethrowOriginalError = void 0;
|
19452 | if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
|
19453 | stashedWorkInProgressProperties = null;
|
19454 | mayReplayFailedUnitOfWork = true;
|
19455 | isReplayingFailedUnitOfWork = false;
|
19456 | originalReplayError = null;
|
19457 | replayUnitOfWork = function (failedUnitOfWork, thrownValue, isYieldy) {
|
19458 | if (thrownValue !== null && typeof thrownValue === 'object' && typeof thrownValue.then === 'function') {
|
19459 |
|
19460 |
|
19461 |
|
19462 | return;
|
19463 | }
|
19464 |
|
19465 |
|
19466 | if (stashedWorkInProgressProperties === null) {
|
19467 |
|
19468 | warningWithoutStack$1(false, 'Could not replay rendering after an error. This is likely a bug in React. ' + 'Please file an issue.');
|
19469 | return;
|
19470 | }
|
19471 | assignFiberPropertiesInDEV(failedUnitOfWork, stashedWorkInProgressProperties);
|
19472 |
|
19473 | switch (failedUnitOfWork.tag) {
|
19474 | case HostRoot:
|
19475 | popHostContainer(failedUnitOfWork);
|
19476 | popTopLevelContextObject(failedUnitOfWork);
|
19477 | break;
|
19478 | case HostComponent:
|
19479 | popHostContext(failedUnitOfWork);
|
19480 | break;
|
19481 | case ClassComponent:
|
19482 | {
|
19483 | var Component = failedUnitOfWork.type;
|
19484 | if (isContextProvider(Component)) {
|
19485 | popContext(failedUnitOfWork);
|
19486 | }
|
19487 | break;
|
19488 | }
|
19489 | case HostPortal:
|
19490 | popHostContainer(failedUnitOfWork);
|
19491 | break;
|
19492 | case ContextProvider:
|
19493 | popProvider(failedUnitOfWork);
|
19494 | break;
|
19495 | }
|
19496 |
|
19497 | isReplayingFailedUnitOfWork = true;
|
19498 | originalReplayError = thrownValue;
|
19499 | invokeGuardedCallback(null, workLoop, null, isYieldy);
|
19500 | isReplayingFailedUnitOfWork = false;
|
19501 | originalReplayError = null;
|
19502 | if (hasCaughtError()) {
|
19503 | var replayError = clearCaughtError();
|
19504 | if (replayError != null && thrownValue != null) {
|
19505 | try {
|
19506 |
|
19507 |
|
19508 | if (replayError._suppressLogging) {
|
19509 |
|
19510 | thrownValue._suppressLogging = true;
|
19511 | }
|
19512 | } catch (inner) {
|
19513 |
|
19514 | }
|
19515 | }
|
19516 | } else {
|
19517 |
|
19518 |
|
19519 | nextUnitOfWork = failedUnitOfWork;
|
19520 | }
|
19521 | };
|
19522 | rethrowOriginalError = function () {
|
19523 | throw originalReplayError;
|
19524 | };
|
19525 | }
|
19526 |
|
19527 | function resetStack() {
|
19528 | if (nextUnitOfWork !== null) {
|
19529 | var interruptedWork = nextUnitOfWork.return;
|
19530 | while (interruptedWork !== null) {
|
19531 | unwindInterruptedWork(interruptedWork);
|
19532 | interruptedWork = interruptedWork.return;
|
19533 | }
|
19534 | }
|
19535 |
|
19536 | {
|
19537 | ReactStrictModeWarnings.discardPendingWarnings();
|
19538 | checkThatStackIsEmpty();
|
19539 | }
|
19540 |
|
19541 | nextRoot = null;
|
19542 | nextRenderExpirationTime = NoWork;
|
19543 | nextLatestAbsoluteTimeoutMs = -1;
|
19544 | nextRenderDidError = false;
|
19545 | nextUnitOfWork = null;
|
19546 | }
|
19547 |
|
19548 | function commitAllHostEffects() {
|
19549 | while (nextEffect !== null) {
|
19550 | {
|
19551 | setCurrentFiber(nextEffect);
|
19552 | }
|
19553 | recordEffect();
|
19554 |
|
19555 | var effectTag = nextEffect.effectTag;
|
19556 |
|
19557 | if (effectTag & ContentReset) {
|
19558 | commitResetTextContent(nextEffect);
|
19559 | }
|
19560 |
|
19561 | if (effectTag & Ref) {
|
19562 | var current$$1 = nextEffect.alternate;
|
19563 | if (current$$1 !== null) {
|
19564 | commitDetachRef(current$$1);
|
19565 | }
|
19566 | }
|
19567 |
|
19568 |
|
19569 |
|
19570 |
|
19571 |
|
19572 | var primaryEffectTag = effectTag & (Placement | Update | Deletion);
|
19573 | switch (primaryEffectTag) {
|
19574 | case Placement:
|
19575 | {
|
19576 | commitPlacement(nextEffect);
|
19577 |
|
19578 |
|
19579 |
|
19580 |
|
19581 |
|
19582 | nextEffect.effectTag &= ~Placement;
|
19583 | break;
|
19584 | }
|
19585 | case PlacementAndUpdate:
|
19586 | {
|
19587 |
|
19588 | commitPlacement(nextEffect);
|
19589 |
|
19590 |
|
19591 | nextEffect.effectTag &= ~Placement;
|
19592 |
|
19593 |
|
19594 | var _current = nextEffect.alternate;
|
19595 | commitWork(_current, nextEffect);
|
19596 | break;
|
19597 | }
|
19598 | case Update:
|
19599 | {
|
19600 | var _current2 = nextEffect.alternate;
|
19601 | commitWork(_current2, nextEffect);
|
19602 | break;
|
19603 | }
|
19604 | case Deletion:
|
19605 | {
|
19606 | commitDeletion(nextEffect);
|
19607 | break;
|
19608 | }
|
19609 | }
|
19610 | nextEffect = nextEffect.nextEffect;
|
19611 | }
|
19612 |
|
19613 | {
|
19614 | resetCurrentFiber();
|
19615 | }
|
19616 | }
|
19617 |
|
19618 | function commitBeforeMutationLifecycles() {
|
19619 | while (nextEffect !== null) {
|
19620 | {
|
19621 | setCurrentFiber(nextEffect);
|
19622 | }
|
19623 |
|
19624 | var effectTag = nextEffect.effectTag;
|
19625 | if (effectTag & Snapshot) {
|
19626 | recordEffect();
|
19627 | var current$$1 = nextEffect.alternate;
|
19628 | commitBeforeMutationLifeCycles(current$$1, nextEffect);
|
19629 | }
|
19630 |
|
19631 | nextEffect = nextEffect.nextEffect;
|
19632 | }
|
19633 |
|
19634 | {
|
19635 | resetCurrentFiber();
|
19636 | }
|
19637 | }
|
19638 |
|
19639 | function commitAllLifeCycles(finishedRoot, committedExpirationTime) {
|
19640 | {
|
19641 | ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
|
19642 | ReactStrictModeWarnings.flushLegacyContextWarning();
|
19643 |
|
19644 | if (warnAboutDeprecatedLifecycles) {
|
19645 | ReactStrictModeWarnings.flushPendingDeprecationWarnings();
|
19646 | }
|
19647 | }
|
19648 | while (nextEffect !== null) {
|
19649 | var effectTag = nextEffect.effectTag;
|
19650 |
|
19651 | if (effectTag & (Update | Callback)) {
|
19652 | recordEffect();
|
19653 | var current$$1 = nextEffect.alternate;
|
19654 | commitLifeCycles(finishedRoot, current$$1, nextEffect, committedExpirationTime);
|
19655 | }
|
19656 |
|
19657 | if (effectTag & Ref) {
|
19658 | recordEffect();
|
19659 | commitAttachRef(nextEffect);
|
19660 | }
|
19661 |
|
19662 | if (enableHooks && effectTag & Passive) {
|
19663 | rootWithPendingPassiveEffects = finishedRoot;
|
19664 | }
|
19665 |
|
19666 | nextEffect = nextEffect.nextEffect;
|
19667 | }
|
19668 | }
|
19669 |
|
19670 | function commitPassiveEffects(root, firstEffect) {
|
19671 | rootWithPendingPassiveEffects = null;
|
19672 | passiveEffectCallbackHandle = null;
|
19673 | passiveEffectCallback = null;
|
19674 |
|
19675 |
|
19676 | var previousIsRendering = isRendering;
|
19677 | isRendering = true;
|
19678 |
|
19679 | var effect = firstEffect;
|
19680 | do {
|
19681 | if (effect.effectTag & Passive) {
|
19682 | var didError = false;
|
19683 | var error = void 0;
|
19684 | {
|
19685 | invokeGuardedCallback(null, commitPassiveHookEffects, null, effect);
|
19686 | if (hasCaughtError()) {
|
19687 | didError = true;
|
19688 | error = clearCaughtError();
|
19689 | }
|
19690 | }
|
19691 | if (didError) {
|
19692 | captureCommitPhaseError(effect, error);
|
19693 | }
|
19694 | }
|
19695 | effect = effect.nextEffect;
|
19696 | } while (effect !== null);
|
19697 |
|
19698 | isRendering = previousIsRendering;
|
19699 |
|
19700 |
|
19701 | var rootExpirationTime = root.expirationTime;
|
19702 | if (rootExpirationTime !== NoWork) {
|
19703 | requestWork(root, rootExpirationTime);
|
19704 | }
|
19705 | }
|
19706 |
|
19707 | function isAlreadyFailedLegacyErrorBoundary(instance) {
|
19708 | return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
|
19709 | }
|
19710 |
|
19711 | function markLegacyErrorBoundaryAsFailed(instance) {
|
19712 | if (legacyErrorBoundariesThatAlreadyFailed === null) {
|
19713 | legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);
|
19714 | } else {
|
19715 | legacyErrorBoundariesThatAlreadyFailed.add(instance);
|
19716 | }
|
19717 | }
|
19718 |
|
19719 | function flushPassiveEffects() {
|
19720 | if (passiveEffectCallback !== null) {
|
19721 | scheduler.unstable_cancelCallback(passiveEffectCallbackHandle);
|
19722 |
|
19723 |
|
19724 | passiveEffectCallback();
|
19725 | }
|
19726 | }
|
19727 |
|
19728 | function commitRoot(root, finishedWork) {
|
19729 | isWorking = true;
|
19730 | isCommitting$1 = true;
|
19731 | startCommitTimer();
|
19732 |
|
19733 | !(root.current !== finishedWork) ? invariant(false, 'Cannot commit the same tree as before. This is probably a bug related to the return field. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
19734 | var committedExpirationTime = root.pendingCommitExpirationTime;
|
19735 | !(committedExpirationTime !== NoWork) ? invariant(false, 'Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
19736 | root.pendingCommitExpirationTime = NoWork;
|
19737 |
|
19738 |
|
19739 |
|
19740 |
|
19741 | var updateExpirationTimeBeforeCommit = finishedWork.expirationTime;
|
19742 | var childExpirationTimeBeforeCommit = finishedWork.childExpirationTime;
|
19743 | var earliestRemainingTimeBeforeCommit = childExpirationTimeBeforeCommit > updateExpirationTimeBeforeCommit ? childExpirationTimeBeforeCommit : updateExpirationTimeBeforeCommit;
|
19744 | markCommittedPriorityLevels(root, earliestRemainingTimeBeforeCommit);
|
19745 |
|
19746 | var prevInteractions = null;
|
19747 | if (enableSchedulerTracing) {
|
19748 |
|
19749 |
|
19750 | prevInteractions = tracing.__interactionsRef.current;
|
19751 | tracing.__interactionsRef.current = root.memoizedInteractions;
|
19752 | }
|
19753 |
|
19754 |
|
19755 | ReactCurrentOwner$2.current = null;
|
19756 |
|
19757 | var firstEffect = void 0;
|
19758 | if (finishedWork.effectTag > PerformedWork) {
|
19759 |
|
19760 |
|
19761 |
|
19762 |
|
19763 | if (finishedWork.lastEffect !== null) {
|
19764 | finishedWork.lastEffect.nextEffect = finishedWork;
|
19765 | firstEffect = finishedWork.firstEffect;
|
19766 | } else {
|
19767 | firstEffect = finishedWork;
|
19768 | }
|
19769 | } else {
|
19770 |
|
19771 | firstEffect = finishedWork.firstEffect;
|
19772 | }
|
19773 |
|
19774 | prepareForCommit(root.containerInfo);
|
19775 |
|
19776 |
|
19777 | nextEffect = firstEffect;
|
19778 | startCommitSnapshotEffectsTimer();
|
19779 | while (nextEffect !== null) {
|
19780 | var didError = false;
|
19781 | var error = void 0;
|
19782 | {
|
19783 | invokeGuardedCallback(null, commitBeforeMutationLifecycles, null);
|
19784 | if (hasCaughtError()) {
|
19785 | didError = true;
|
19786 | error = clearCaughtError();
|
19787 | }
|
19788 | }
|
19789 | if (didError) {
|
19790 | !(nextEffect !== null) ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
19791 | captureCommitPhaseError(nextEffect, error);
|
19792 |
|
19793 | if (nextEffect !== null) {
|
19794 | nextEffect = nextEffect.nextEffect;
|
19795 | }
|
19796 | }
|
19797 | }
|
19798 | stopCommitSnapshotEffectsTimer();
|
19799 |
|
19800 | if (enableProfilerTimer) {
|
19801 |
|
19802 |
|
19803 | recordCommitTime();
|
19804 | }
|
19805 |
|
19806 |
|
19807 |
|
19808 |
|
19809 | nextEffect = firstEffect;
|
19810 | startCommitHostEffectsTimer();
|
19811 | while (nextEffect !== null) {
|
19812 | var _didError = false;
|
19813 | var _error = void 0;
|
19814 | {
|
19815 | invokeGuardedCallback(null, commitAllHostEffects, null);
|
19816 | if (hasCaughtError()) {
|
19817 | _didError = true;
|
19818 | _error = clearCaughtError();
|
19819 | }
|
19820 | }
|
19821 | if (_didError) {
|
19822 | !(nextEffect !== null) ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
19823 | captureCommitPhaseError(nextEffect, _error);
|
19824 |
|
19825 | if (nextEffect !== null) {
|
19826 | nextEffect = nextEffect.nextEffect;
|
19827 | }
|
19828 | }
|
19829 | }
|
19830 | stopCommitHostEffectsTimer();
|
19831 |
|
19832 | resetAfterCommit(root.containerInfo);
|
19833 |
|
19834 |
|
19835 |
|
19836 |
|
19837 |
|
19838 | root.current = finishedWork;
|
19839 |
|
19840 |
|
19841 |
|
19842 |
|
19843 |
|
19844 | nextEffect = firstEffect;
|
19845 | startCommitLifeCyclesTimer();
|
19846 | while (nextEffect !== null) {
|
19847 | var _didError2 = false;
|
19848 | var _error2 = void 0;
|
19849 | {
|
19850 | invokeGuardedCallback(null, commitAllLifeCycles, null, root, committedExpirationTime);
|
19851 | if (hasCaughtError()) {
|
19852 | _didError2 = true;
|
19853 | _error2 = clearCaughtError();
|
19854 | }
|
19855 | }
|
19856 | if (_didError2) {
|
19857 | !(nextEffect !== null) ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
19858 | captureCommitPhaseError(nextEffect, _error2);
|
19859 | if (nextEffect !== null) {
|
19860 | nextEffect = nextEffect.nextEffect;
|
19861 | }
|
19862 | }
|
19863 | }
|
19864 |
|
19865 | if (enableHooks && firstEffect !== null && rootWithPendingPassiveEffects !== null) {
|
19866 |
|
19867 |
|
19868 |
|
19869 |
|
19870 | var callback = commitPassiveEffects.bind(null, root, firstEffect);
|
19871 | if (enableSchedulerTracing) {
|
19872 |
|
19873 |
|
19874 |
|
19875 | callback = tracing.unstable_wrap(callback);
|
19876 | }
|
19877 | passiveEffectCallbackHandle = scheduler.unstable_scheduleCallback(callback);
|
19878 | passiveEffectCallback = callback;
|
19879 | }
|
19880 |
|
19881 | isCommitting$1 = false;
|
19882 | isWorking = false;
|
19883 | stopCommitLifeCyclesTimer();
|
19884 | stopCommitTimer();
|
19885 | onCommitRoot(finishedWork.stateNode);
|
19886 | if (true && ReactFiberInstrumentation_1.debugTool) {
|
19887 | ReactFiberInstrumentation_1.debugTool.onCommitWork(finishedWork);
|
19888 | }
|
19889 |
|
19890 | var updateExpirationTimeAfterCommit = finishedWork.expirationTime;
|
19891 | var childExpirationTimeAfterCommit = finishedWork.childExpirationTime;
|
19892 | var earliestRemainingTimeAfterCommit = childExpirationTimeAfterCommit > updateExpirationTimeAfterCommit ? childExpirationTimeAfterCommit : updateExpirationTimeAfterCommit;
|
19893 | if (earliestRemainingTimeAfterCommit === NoWork) {
|
19894 |
|
19895 |
|
19896 | legacyErrorBoundariesThatAlreadyFailed = null;
|
19897 | }
|
19898 | onCommit(root, earliestRemainingTimeAfterCommit);
|
19899 |
|
19900 | if (enableSchedulerTracing) {
|
19901 | tracing.__interactionsRef.current = prevInteractions;
|
19902 |
|
19903 | var subscriber = void 0;
|
19904 |
|
19905 | try {
|
19906 | subscriber = tracing.__subscriberRef.current;
|
19907 | if (subscriber !== null && root.memoizedInteractions.size > 0) {
|
19908 | var threadID = computeThreadID(committedExpirationTime, root.interactionThreadID);
|
19909 | subscriber.onWorkStopped(root.memoizedInteractions, threadID);
|
19910 | }
|
19911 | } catch (error) {
|
19912 |
|
19913 |
|
19914 | if (!hasUnhandledError) {
|
19915 | hasUnhandledError = true;
|
19916 | unhandledError = error;
|
19917 | }
|
19918 | } finally {
|
19919 |
|
19920 |
|
19921 |
|
19922 | var pendingInteractionMap = root.pendingInteractionMap;
|
19923 | pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
|
19924 |
|
19925 |
|
19926 |
|
19927 | if (scheduledExpirationTime > earliestRemainingTimeAfterCommit) {
|
19928 | pendingInteractionMap.delete(scheduledExpirationTime);
|
19929 |
|
19930 | scheduledInteractions.forEach(function (interaction) {
|
19931 | interaction.__count--;
|
19932 |
|
19933 | if (subscriber !== null && interaction.__count === 0) {
|
19934 | try {
|
19935 | subscriber.onInteractionScheduledWorkCompleted(interaction);
|
19936 | } catch (error) {
|
19937 |
|
19938 |
|
19939 | if (!hasUnhandledError) {
|
19940 | hasUnhandledError = true;
|
19941 | unhandledError = error;
|
19942 | }
|
19943 | }
|
19944 | }
|
19945 | });
|
19946 | }
|
19947 | });
|
19948 | }
|
19949 | }
|
19950 | }
|
19951 |
|
19952 | function resetChildExpirationTime(workInProgress, renderTime) {
|
19953 | if (renderTime !== Never && workInProgress.childExpirationTime === Never) {
|
19954 |
|
19955 |
|
19956 | return;
|
19957 | }
|
19958 |
|
19959 | var newChildExpirationTime = NoWork;
|
19960 |
|
19961 |
|
19962 | if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
|
19963 |
|
19964 |
|
19965 | var actualDuration = workInProgress.actualDuration;
|
19966 | var treeBaseDuration = workInProgress.selfBaseDuration;
|
19967 |
|
19968 |
|
19969 |
|
19970 |
|
19971 |
|
19972 |
|
19973 |
|
19974 |
|
19975 | var shouldBubbleActualDurations = workInProgress.alternate === null || workInProgress.child !== workInProgress.alternate.child;
|
19976 |
|
19977 | var child = workInProgress.child;
|
19978 | while (child !== null) {
|
19979 | var childUpdateExpirationTime = child.expirationTime;
|
19980 | var childChildExpirationTime = child.childExpirationTime;
|
19981 | if (childUpdateExpirationTime > newChildExpirationTime) {
|
19982 | newChildExpirationTime = childUpdateExpirationTime;
|
19983 | }
|
19984 | if (childChildExpirationTime > newChildExpirationTime) {
|
19985 | newChildExpirationTime = childChildExpirationTime;
|
19986 | }
|
19987 | if (shouldBubbleActualDurations) {
|
19988 | actualDuration += child.actualDuration;
|
19989 | }
|
19990 | treeBaseDuration += child.treeBaseDuration;
|
19991 | child = child.sibling;
|
19992 | }
|
19993 | workInProgress.actualDuration = actualDuration;
|
19994 | workInProgress.treeBaseDuration = treeBaseDuration;
|
19995 | } else {
|
19996 | var _child = workInProgress.child;
|
19997 | while (_child !== null) {
|
19998 | var _childUpdateExpirationTime = _child.expirationTime;
|
19999 | var _childChildExpirationTime = _child.childExpirationTime;
|
20000 | if (_childUpdateExpirationTime > newChildExpirationTime) {
|
20001 | newChildExpirationTime = _childUpdateExpirationTime;
|
20002 | }
|
20003 | if (_childChildExpirationTime > newChildExpirationTime) {
|
20004 | newChildExpirationTime = _childChildExpirationTime;
|
20005 | }
|
20006 | _child = _child.sibling;
|
20007 | }
|
20008 | }
|
20009 |
|
20010 | workInProgress.childExpirationTime = newChildExpirationTime;
|
20011 | }
|
20012 |
|
20013 | function completeUnitOfWork(workInProgress) {
|
20014 |
|
20015 |
|
20016 |
|
20017 | while (true) {
|
20018 |
|
20019 |
|
20020 |
|
20021 |
|
20022 | var current$$1 = workInProgress.alternate;
|
20023 | {
|
20024 | setCurrentFiber(workInProgress);
|
20025 | }
|
20026 |
|
20027 | var returnFiber = workInProgress.return;
|
20028 | var siblingFiber = workInProgress.sibling;
|
20029 |
|
20030 | if ((workInProgress.effectTag & Incomplete) === NoEffect) {
|
20031 | if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
|
20032 |
|
20033 | mayReplayFailedUnitOfWork = false;
|
20034 | }
|
20035 |
|
20036 |
|
20037 | nextUnitOfWork = workInProgress;
|
20038 | if (enableProfilerTimer) {
|
20039 | if (workInProgress.mode & ProfileMode) {
|
20040 | startProfilerTimer(workInProgress);
|
20041 | }
|
20042 | nextUnitOfWork = completeWork(current$$1, workInProgress, nextRenderExpirationTime);
|
20043 | if (workInProgress.mode & ProfileMode) {
|
20044 |
|
20045 | stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);
|
20046 | }
|
20047 | } else {
|
20048 | nextUnitOfWork = completeWork(current$$1, workInProgress, nextRenderExpirationTime);
|
20049 | }
|
20050 | if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
|
20051 |
|
20052 | mayReplayFailedUnitOfWork = true;
|
20053 | }
|
20054 | stopWorkTimer(workInProgress);
|
20055 | resetChildExpirationTime(workInProgress, nextRenderExpirationTime);
|
20056 | {
|
20057 | resetCurrentFiber();
|
20058 | }
|
20059 |
|
20060 | if (nextUnitOfWork !== null) {
|
20061 |
|
20062 | return nextUnitOfWork;
|
20063 | }
|
20064 |
|
20065 | if (returnFiber !== null &&
|
20066 |
|
20067 | (returnFiber.effectTag & Incomplete) === NoEffect) {
|
20068 |
|
20069 |
|
20070 |
|
20071 | if (returnFiber.firstEffect === null) {
|
20072 | returnFiber.firstEffect = workInProgress.firstEffect;
|
20073 | }
|
20074 | if (workInProgress.lastEffect !== null) {
|
20075 | if (returnFiber.lastEffect !== null) {
|
20076 | returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;
|
20077 | }
|
20078 | returnFiber.lastEffect = workInProgress.lastEffect;
|
20079 | }
|
20080 |
|
20081 |
|
20082 |
|
20083 |
|
20084 |
|
20085 |
|
20086 |
|
20087 | var effectTag = workInProgress.effectTag;
|
20088 |
|
20089 |
|
20090 | if (effectTag > PerformedWork) {
|
20091 | if (returnFiber.lastEffect !== null) {
|
20092 | returnFiber.lastEffect.nextEffect = workInProgress;
|
20093 | } else {
|
20094 | returnFiber.firstEffect = workInProgress;
|
20095 | }
|
20096 | returnFiber.lastEffect = workInProgress;
|
20097 | }
|
20098 | }
|
20099 |
|
20100 | if (true && ReactFiberInstrumentation_1.debugTool) {
|
20101 | ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress);
|
20102 | }
|
20103 |
|
20104 | if (siblingFiber !== null) {
|
20105 |
|
20106 | return siblingFiber;
|
20107 | } else if (returnFiber !== null) {
|
20108 |
|
20109 | workInProgress = returnFiber;
|
20110 | continue;
|
20111 | } else {
|
20112 |
|
20113 | return null;
|
20114 | }
|
20115 | } else {
|
20116 | if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
|
20117 |
|
20118 | stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);
|
20119 |
|
20120 |
|
20121 | var actualDuration = workInProgress.actualDuration;
|
20122 | var child = workInProgress.child;
|
20123 | while (child !== null) {
|
20124 | actualDuration += child.actualDuration;
|
20125 | child = child.sibling;
|
20126 | }
|
20127 | workInProgress.actualDuration = actualDuration;
|
20128 | }
|
20129 |
|
20130 |
|
20131 |
|
20132 |
|
20133 | var next = unwindWork(workInProgress, nextRenderExpirationTime);
|
20134 |
|
20135 | if (workInProgress.effectTag & DidCapture) {
|
20136 |
|
20137 | stopFailedWorkTimer(workInProgress);
|
20138 | } else {
|
20139 | stopWorkTimer(workInProgress);
|
20140 | }
|
20141 |
|
20142 | {
|
20143 | resetCurrentFiber();
|
20144 | }
|
20145 |
|
20146 | if (next !== null) {
|
20147 | stopWorkTimer(workInProgress);
|
20148 | if (true && ReactFiberInstrumentation_1.debugTool) {
|
20149 | ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress);
|
20150 | }
|
20151 |
|
20152 |
|
20153 |
|
20154 |
|
20155 |
|
20156 | next.effectTag &= HostEffectMask;
|
20157 | return next;
|
20158 | }
|
20159 |
|
20160 | if (returnFiber !== null) {
|
20161 |
|
20162 | returnFiber.firstEffect = returnFiber.lastEffect = null;
|
20163 | returnFiber.effectTag |= Incomplete;
|
20164 | }
|
20165 |
|
20166 | if (true && ReactFiberInstrumentation_1.debugTool) {
|
20167 | ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress);
|
20168 | }
|
20169 |
|
20170 | if (siblingFiber !== null) {
|
20171 |
|
20172 | return siblingFiber;
|
20173 | } else if (returnFiber !== null) {
|
20174 |
|
20175 | workInProgress = returnFiber;
|
20176 | continue;
|
20177 | } else {
|
20178 | return null;
|
20179 | }
|
20180 | }
|
20181 | }
|
20182 |
|
20183 |
|
20184 |
|
20185 |
|
20186 | return null;
|
20187 | }
|
20188 |
|
20189 | function performUnitOfWork(workInProgress) {
|
20190 |
|
20191 |
|
20192 |
|
20193 |
|
20194 | var current$$1 = workInProgress.alternate;
|
20195 |
|
20196 |
|
20197 | startWorkTimer(workInProgress);
|
20198 | {
|
20199 | setCurrentFiber(workInProgress);
|
20200 | }
|
20201 |
|
20202 | if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
|
20203 | stashedWorkInProgressProperties = assignFiberPropertiesInDEV(stashedWorkInProgressProperties, workInProgress);
|
20204 | }
|
20205 |
|
20206 | var next = void 0;
|
20207 | if (enableProfilerTimer) {
|
20208 | if (workInProgress.mode & ProfileMode) {
|
20209 | startProfilerTimer(workInProgress);
|
20210 | }
|
20211 |
|
20212 | next = beginWork(current$$1, workInProgress, nextRenderExpirationTime);
|
20213 | workInProgress.memoizedProps = workInProgress.pendingProps;
|
20214 |
|
20215 | if (workInProgress.mode & ProfileMode) {
|
20216 |
|
20217 | stopProfilerTimerIfRunningAndRecordDelta(workInProgress, true);
|
20218 | }
|
20219 | } else {
|
20220 | next = beginWork(current$$1, workInProgress, nextRenderExpirationTime);
|
20221 | workInProgress.memoizedProps = workInProgress.pendingProps;
|
20222 | }
|
20223 |
|
20224 | {
|
20225 | resetCurrentFiber();
|
20226 | if (isReplayingFailedUnitOfWork) {
|
20227 |
|
20228 |
|
20229 |
|
20230 |
|
20231 | rethrowOriginalError();
|
20232 | }
|
20233 | }
|
20234 | if (true && ReactFiberInstrumentation_1.debugTool) {
|
20235 | ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress);
|
20236 | }
|
20237 |
|
20238 | if (next === null) {
|
20239 |
|
20240 | next = completeUnitOfWork(workInProgress);
|
20241 | }
|
20242 |
|
20243 | ReactCurrentOwner$2.current = null;
|
20244 |
|
20245 | return next;
|
20246 | }
|
20247 |
|
20248 | function workLoop(isYieldy) {
|
20249 | if (!isYieldy) {
|
20250 |
|
20251 | while (nextUnitOfWork !== null) {
|
20252 | nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
|
20253 | }
|
20254 | } else {
|
20255 |
|
20256 | while (nextUnitOfWork !== null && !shouldYieldToRenderer()) {
|
20257 | nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
|
20258 | }
|
20259 | }
|
20260 | }
|
20261 |
|
20262 | function renderRoot(root, isYieldy) {
|
20263 | !!isWorking ? invariant(false, 'renderRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
20264 |
|
20265 | flushPassiveEffects();
|
20266 |
|
20267 | isWorking = true;
|
20268 | if (enableHooks) {
|
20269 | ReactCurrentOwner$2.currentDispatcher = Dispatcher;
|
20270 | } else {
|
20271 | ReactCurrentOwner$2.currentDispatcher = DispatcherWithoutHooks;
|
20272 | }
|
20273 |
|
20274 | var expirationTime = root.nextExpirationTimeToWorkOn;
|
20275 |
|
20276 |
|
20277 |
|
20278 | if (expirationTime !== nextRenderExpirationTime || root !== nextRoot || nextUnitOfWork === null) {
|
20279 |
|
20280 | resetStack();
|
20281 | nextRoot = root;
|
20282 | nextRenderExpirationTime = expirationTime;
|
20283 | nextUnitOfWork = createWorkInProgress(nextRoot.current, null, nextRenderExpirationTime);
|
20284 | root.pendingCommitExpirationTime = NoWork;
|
20285 |
|
20286 | if (enableSchedulerTracing) {
|
20287 |
|
20288 |
|
20289 | var interactions = new Set();
|
20290 | root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
|
20291 | if (scheduledExpirationTime >= expirationTime) {
|
20292 | scheduledInteractions.forEach(function (interaction) {
|
20293 | return interactions.add(interaction);
|
20294 | });
|
20295 | }
|
20296 | });
|
20297 |
|
20298 |
|
20299 |
|
20300 |
|
20301 |
|
20302 | root.memoizedInteractions = interactions;
|
20303 |
|
20304 | if (interactions.size > 0) {
|
20305 | var subscriber = tracing.__subscriberRef.current;
|
20306 | if (subscriber !== null) {
|
20307 | var threadID = computeThreadID(expirationTime, root.interactionThreadID);
|
20308 | try {
|
20309 | subscriber.onWorkStarted(interactions, threadID);
|
20310 | } catch (error) {
|
20311 |
|
20312 |
|
20313 |
|
20314 | if (!hasUnhandledError) {
|
20315 | hasUnhandledError = true;
|
20316 | unhandledError = error;
|
20317 | }
|
20318 | }
|
20319 | }
|
20320 | }
|
20321 | }
|
20322 | }
|
20323 |
|
20324 | var prevInteractions = null;
|
20325 | if (enableSchedulerTracing) {
|
20326 |
|
20327 |
|
20328 | prevInteractions = tracing.__interactionsRef.current;
|
20329 | tracing.__interactionsRef.current = root.memoizedInteractions;
|
20330 | }
|
20331 |
|
20332 | var didFatal = false;
|
20333 |
|
20334 | startWorkLoopTimer(nextUnitOfWork);
|
20335 |
|
20336 | do {
|
20337 | try {
|
20338 | workLoop(isYieldy);
|
20339 | } catch (thrownValue) {
|
20340 | resetContextDependences();
|
20341 | resetHooks();
|
20342 |
|
20343 |
|
20344 |
|
20345 | var mayReplay = void 0;
|
20346 | if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
|
20347 | mayReplay = mayReplayFailedUnitOfWork;
|
20348 | mayReplayFailedUnitOfWork = true;
|
20349 | }
|
20350 |
|
20351 | if (nextUnitOfWork === null) {
|
20352 |
|
20353 | didFatal = true;
|
20354 | onUncaughtError(thrownValue);
|
20355 | } else {
|
20356 | if (enableProfilerTimer && nextUnitOfWork.mode & ProfileMode) {
|
20357 |
|
20358 |
|
20359 | stopProfilerTimerIfRunningAndRecordDelta(nextUnitOfWork, true);
|
20360 | }
|
20361 |
|
20362 | {
|
20363 |
|
20364 |
|
20365 | resetCurrentlyProcessingQueue();
|
20366 | }
|
20367 |
|
20368 | if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
|
20369 | if (mayReplay) {
|
20370 | var failedUnitOfWork = nextUnitOfWork;
|
20371 | replayUnitOfWork(failedUnitOfWork, thrownValue, isYieldy);
|
20372 | }
|
20373 | }
|
20374 |
|
20375 |
|
20376 |
|
20377 |
|
20378 | !(nextUnitOfWork !== null) ? invariant(false, 'Failed to replay rendering after an error. This is likely caused by a bug in React. Please file an issue with a reproducing case to help us find it.') : void 0;
|
20379 |
|
20380 | var sourceFiber = nextUnitOfWork;
|
20381 | var returnFiber = sourceFiber.return;
|
20382 | if (returnFiber === null) {
|
20383 |
|
20384 |
|
20385 |
|
20386 |
|
20387 |
|
20388 |
|
20389 | didFatal = true;
|
20390 | onUncaughtError(thrownValue);
|
20391 | } else {
|
20392 | throwException(root, returnFiber, sourceFiber, thrownValue, nextRenderExpirationTime);
|
20393 | nextUnitOfWork = completeUnitOfWork(sourceFiber);
|
20394 | continue;
|
20395 | }
|
20396 | }
|
20397 | }
|
20398 | break;
|
20399 | } while (true);
|
20400 |
|
20401 | if (enableSchedulerTracing) {
|
20402 |
|
20403 | tracing.__interactionsRef.current = prevInteractions;
|
20404 | }
|
20405 |
|
20406 |
|
20407 | isWorking = false;
|
20408 | ReactCurrentOwner$2.currentDispatcher = null;
|
20409 | resetContextDependences();
|
20410 | resetHooks();
|
20411 |
|
20412 |
|
20413 | if (didFatal) {
|
20414 | var _didCompleteRoot = false;
|
20415 | stopWorkLoopTimer(interruptedBy, _didCompleteRoot);
|
20416 | interruptedBy = null;
|
20417 |
|
20418 | {
|
20419 | resetStackAfterFatalErrorInDev();
|
20420 | }
|
20421 |
|
20422 |
|
20423 |
|
20424 | nextRoot = null;
|
20425 | onFatal(root);
|
20426 | return;
|
20427 | }
|
20428 |
|
20429 | if (nextUnitOfWork !== null) {
|
20430 |
|
20431 |
|
20432 |
|
20433 |
|
20434 | var _didCompleteRoot2 = false;
|
20435 | stopWorkLoopTimer(interruptedBy, _didCompleteRoot2);
|
20436 | interruptedBy = null;
|
20437 | onYield(root);
|
20438 | return;
|
20439 | }
|
20440 |
|
20441 |
|
20442 | var didCompleteRoot = true;
|
20443 | stopWorkLoopTimer(interruptedBy, didCompleteRoot);
|
20444 | var rootWorkInProgress = root.current.alternate;
|
20445 | !(rootWorkInProgress !== null) ? invariant(false, 'Finished root should have a work-in-progress. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
20446 |
|
20447 |
|
20448 |
|
20449 |
|
20450 | nextRoot = null;
|
20451 | interruptedBy = null;
|
20452 |
|
20453 | if (nextRenderDidError) {
|
20454 |
|
20455 | if (hasLowerPriorityWork(root, expirationTime)) {
|
20456 |
|
20457 |
|
20458 |
|
20459 |
|
20460 |
|
20461 | markSuspendedPriorityLevel(root, expirationTime);
|
20462 | var suspendedExpirationTime = expirationTime;
|
20463 | var rootExpirationTime = root.expirationTime;
|
20464 | onSuspend(root, rootWorkInProgress, suspendedExpirationTime, rootExpirationTime, -1
|
20465 | );
|
20466 | return;
|
20467 | } else if (
|
20468 |
|
20469 |
|
20470 |
|
20471 |
|
20472 | !root.didError && isYieldy) {
|
20473 | root.didError = true;
|
20474 | var _suspendedExpirationTime = root.nextExpirationTimeToWorkOn = expirationTime;
|
20475 | var _rootExpirationTime = root.expirationTime = Sync;
|
20476 | onSuspend(root, rootWorkInProgress, _suspendedExpirationTime, _rootExpirationTime, -1
|
20477 | );
|
20478 | return;
|
20479 | }
|
20480 | }
|
20481 |
|
20482 | if (isYieldy && nextLatestAbsoluteTimeoutMs !== -1) {
|
20483 |
|
20484 | var _suspendedExpirationTime2 = expirationTime;
|
20485 | markSuspendedPriorityLevel(root, _suspendedExpirationTime2);
|
20486 |
|
20487 |
|
20488 |
|
20489 |
|
20490 | var earliestExpirationTime = findEarliestOutstandingPriorityLevel(root, expirationTime);
|
20491 | var earliestExpirationTimeMs = expirationTimeToMs(earliestExpirationTime);
|
20492 | if (earliestExpirationTimeMs < nextLatestAbsoluteTimeoutMs) {
|
20493 | nextLatestAbsoluteTimeoutMs = earliestExpirationTimeMs;
|
20494 | }
|
20495 |
|
20496 |
|
20497 |
|
20498 |
|
20499 |
|
20500 | var currentTimeMs = expirationTimeToMs(requestCurrentTime());
|
20501 | var msUntilTimeout = nextLatestAbsoluteTimeoutMs - currentTimeMs;
|
20502 | msUntilTimeout = msUntilTimeout < 0 ? 0 : msUntilTimeout;
|
20503 |
|
20504 |
|
20505 |
|
20506 | var _rootExpirationTime2 = root.expirationTime;
|
20507 | onSuspend(root, rootWorkInProgress, _suspendedExpirationTime2, _rootExpirationTime2, msUntilTimeout);
|
20508 | return;
|
20509 | }
|
20510 |
|
20511 |
|
20512 | onComplete(root, rootWorkInProgress, expirationTime);
|
20513 | }
|
20514 |
|
20515 | function captureCommitPhaseError(sourceFiber, value) {
|
20516 | var expirationTime = Sync;
|
20517 | var fiber = sourceFiber.return;
|
20518 | while (fiber !== null) {
|
20519 | switch (fiber.tag) {
|
20520 | case ClassComponent:
|
20521 | var ctor = fiber.type;
|
20522 | var instance = fiber.stateNode;
|
20523 | if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {
|
20524 | var errorInfo = createCapturedValue(value, sourceFiber);
|
20525 | var update = createClassErrorUpdate(fiber, errorInfo, expirationTime);
|
20526 | enqueueUpdate(fiber, update);
|
20527 | scheduleWork(fiber, expirationTime);
|
20528 | return;
|
20529 | }
|
20530 | break;
|
20531 | case HostRoot:
|
20532 | {
|
20533 | var _errorInfo = createCapturedValue(value, sourceFiber);
|
20534 | var _update = createRootErrorUpdate(fiber, _errorInfo, expirationTime);
|
20535 | enqueueUpdate(fiber, _update);
|
20536 | scheduleWork(fiber, expirationTime);
|
20537 | return;
|
20538 | }
|
20539 | }
|
20540 | fiber = fiber.return;
|
20541 | }
|
20542 |
|
20543 | if (sourceFiber.tag === HostRoot) {
|
20544 |
|
20545 |
|
20546 | var rootFiber = sourceFiber;
|
20547 | var _errorInfo2 = createCapturedValue(value, rootFiber);
|
20548 | var _update2 = createRootErrorUpdate(rootFiber, _errorInfo2, expirationTime);
|
20549 | enqueueUpdate(rootFiber, _update2);
|
20550 | scheduleWork(rootFiber, expirationTime);
|
20551 | }
|
20552 | }
|
20553 |
|
20554 | function computeThreadID(expirationTime, interactionThreadID) {
|
20555 |
|
20556 | return expirationTime * 1000 + interactionThreadID;
|
20557 | }
|
20558 |
|
20559 |
|
20560 | function computeUniqueAsyncExpiration() {
|
20561 | var currentTime = requestCurrentTime();
|
20562 | var result = computeAsyncExpiration(currentTime);
|
20563 | if (result >= lastUniqueAsyncExpiration) {
|
20564 |
|
20565 |
|
20566 |
|
20567 | result = lastUniqueAsyncExpiration - 1;
|
20568 | }
|
20569 | lastUniqueAsyncExpiration = result;
|
20570 | return lastUniqueAsyncExpiration;
|
20571 | }
|
20572 |
|
20573 | function computeExpirationForFiber(currentTime, fiber) {
|
20574 | var expirationTime = void 0;
|
20575 | if (expirationContext !== NoWork) {
|
20576 |
|
20577 | expirationTime = expirationContext;
|
20578 | } else if (isWorking) {
|
20579 | if (isCommitting$1) {
|
20580 |
|
20581 |
|
20582 | expirationTime = Sync;
|
20583 | } else {
|
20584 |
|
20585 |
|
20586 | expirationTime = nextRenderExpirationTime;
|
20587 | }
|
20588 | } else {
|
20589 |
|
20590 |
|
20591 | if (fiber.mode & ConcurrentMode) {
|
20592 | if (isBatchingInteractiveUpdates) {
|
20593 |
|
20594 | expirationTime = computeInteractiveExpiration(currentTime);
|
20595 | } else {
|
20596 |
|
20597 | expirationTime = computeAsyncExpiration(currentTime);
|
20598 | }
|
20599 |
|
20600 |
|
20601 | if (nextRoot !== null && expirationTime === nextRenderExpirationTime) {
|
20602 | expirationTime -= 1;
|
20603 | }
|
20604 | } else {
|
20605 |
|
20606 | expirationTime = Sync;
|
20607 | }
|
20608 | }
|
20609 | if (isBatchingInteractiveUpdates) {
|
20610 |
|
20611 |
|
20612 |
|
20613 | if (lowestPriorityPendingInteractiveExpirationTime === NoWork || expirationTime < lowestPriorityPendingInteractiveExpirationTime) {
|
20614 | lowestPriorityPendingInteractiveExpirationTime = expirationTime;
|
20615 | }
|
20616 | }
|
20617 | return expirationTime;
|
20618 | }
|
20619 |
|
20620 | function renderDidSuspend(root, absoluteTimeoutMs, suspendedTime) {
|
20621 |
|
20622 | if (absoluteTimeoutMs >= 0 && nextLatestAbsoluteTimeoutMs < absoluteTimeoutMs) {
|
20623 | nextLatestAbsoluteTimeoutMs = absoluteTimeoutMs;
|
20624 | }
|
20625 | }
|
20626 |
|
20627 | function renderDidError() {
|
20628 | nextRenderDidError = true;
|
20629 | }
|
20630 |
|
20631 | function pingSuspendedRoot(root, thenable, pingTime) {
|
20632 |
|
20633 |
|
20634 |
|
20635 | var pingCache = root.pingCache;
|
20636 | if (pingCache !== null) {
|
20637 |
|
20638 |
|
20639 | pingCache.delete(thenable);
|
20640 | }
|
20641 |
|
20642 | if (nextRoot !== null && nextRenderExpirationTime === pingTime) {
|
20643 |
|
20644 |
|
20645 | nextRoot = null;
|
20646 | } else {
|
20647 |
|
20648 | if (isPriorityLevelSuspended(root, pingTime)) {
|
20649 |
|
20650 | markPingedPriorityLevel(root, pingTime);
|
20651 | var rootExpirationTime = root.expirationTime;
|
20652 | if (rootExpirationTime !== NoWork) {
|
20653 | requestWork(root, rootExpirationTime);
|
20654 | }
|
20655 | }
|
20656 | }
|
20657 | }
|
20658 |
|
20659 | function retryTimedOutBoundary(boundaryFiber, thenable) {
|
20660 |
|
20661 |
|
20662 |
|
20663 | var retryCache = boundaryFiber.stateNode;
|
20664 | if (retryCache !== null) {
|
20665 |
|
20666 |
|
20667 | retryCache.delete(thenable);
|
20668 | }
|
20669 |
|
20670 | var currentTime = requestCurrentTime();
|
20671 | var retryTime = computeExpirationForFiber(currentTime, boundaryFiber);
|
20672 | var root = scheduleWorkToRoot(boundaryFiber, retryTime);
|
20673 | if (root !== null) {
|
20674 | markPendingPriorityLevel(root, retryTime);
|
20675 | var rootExpirationTime = root.expirationTime;
|
20676 | if (rootExpirationTime !== NoWork) {
|
20677 | requestWork(root, rootExpirationTime);
|
20678 | }
|
20679 | }
|
20680 | }
|
20681 |
|
20682 | function scheduleWorkToRoot(fiber, expirationTime) {
|
20683 | recordScheduleUpdate();
|
20684 |
|
20685 | {
|
20686 | if (fiber.tag === ClassComponent) {
|
20687 | var instance = fiber.stateNode;
|
20688 | warnAboutInvalidUpdates(instance);
|
20689 | }
|
20690 | }
|
20691 |
|
20692 |
|
20693 | if (fiber.expirationTime < expirationTime) {
|
20694 | fiber.expirationTime = expirationTime;
|
20695 | }
|
20696 | var alternate = fiber.alternate;
|
20697 | if (alternate !== null && alternate.expirationTime < expirationTime) {
|
20698 | alternate.expirationTime = expirationTime;
|
20699 | }
|
20700 |
|
20701 | var node = fiber.return;
|
20702 | var root = null;
|
20703 | if (node === null && fiber.tag === HostRoot) {
|
20704 | root = fiber.stateNode;
|
20705 | } else {
|
20706 | while (node !== null) {
|
20707 | alternate = node.alternate;
|
20708 | if (node.childExpirationTime < expirationTime) {
|
20709 | node.childExpirationTime = expirationTime;
|
20710 | if (alternate !== null && alternate.childExpirationTime < expirationTime) {
|
20711 | alternate.childExpirationTime = expirationTime;
|
20712 | }
|
20713 | } else if (alternate !== null && alternate.childExpirationTime < expirationTime) {
|
20714 | alternate.childExpirationTime = expirationTime;
|
20715 | }
|
20716 | if (node.return === null && node.tag === HostRoot) {
|
20717 | root = node.stateNode;
|
20718 | break;
|
20719 | }
|
20720 | node = node.return;
|
20721 | }
|
20722 | }
|
20723 |
|
20724 | if (enableSchedulerTracing) {
|
20725 | if (root !== null) {
|
20726 | var interactions = tracing.__interactionsRef.current;
|
20727 | if (interactions.size > 0) {
|
20728 | var pendingInteractionMap = root.pendingInteractionMap;
|
20729 | var pendingInteractions = pendingInteractionMap.get(expirationTime);
|
20730 | if (pendingInteractions != null) {
|
20731 | interactions.forEach(function (interaction) {
|
20732 | if (!pendingInteractions.has(interaction)) {
|
20733 |
|
20734 | interaction.__count++;
|
20735 | }
|
20736 |
|
20737 | pendingInteractions.add(interaction);
|
20738 | });
|
20739 | } else {
|
20740 | pendingInteractionMap.set(expirationTime, new Set(interactions));
|
20741 |
|
20742 |
|
20743 | interactions.forEach(function (interaction) {
|
20744 | interaction.__count++;
|
20745 | });
|
20746 | }
|
20747 |
|
20748 | var subscriber = tracing.__subscriberRef.current;
|
20749 | if (subscriber !== null) {
|
20750 | var threadID = computeThreadID(expirationTime, root.interactionThreadID);
|
20751 | subscriber.onWorkScheduled(interactions, threadID);
|
20752 | }
|
20753 | }
|
20754 | }
|
20755 | }
|
20756 | return root;
|
20757 | }
|
20758 |
|
20759 | function scheduleWork(fiber, expirationTime) {
|
20760 | var root = scheduleWorkToRoot(fiber, expirationTime);
|
20761 | if (root === null) {
|
20762 | {
|
20763 | switch (fiber.tag) {
|
20764 | case ClassComponent:
|
20765 | warnAboutUpdateOnUnmounted(fiber, true);
|
20766 | break;
|
20767 | case FunctionComponent:
|
20768 | case ForwardRef:
|
20769 | case MemoComponent:
|
20770 | case SimpleMemoComponent:
|
20771 | warnAboutUpdateOnUnmounted(fiber, false);
|
20772 | break;
|
20773 | }
|
20774 | }
|
20775 | return;
|
20776 | }
|
20777 |
|
20778 | if (!isWorking && nextRenderExpirationTime !== NoWork && expirationTime > nextRenderExpirationTime) {
|
20779 |
|
20780 | interruptedBy = fiber;
|
20781 | resetStack();
|
20782 | }
|
20783 | markPendingPriorityLevel(root, expirationTime);
|
20784 | if (
|
20785 |
|
20786 |
|
20787 | !isWorking || isCommitting$1 ||
|
20788 |
|
20789 | nextRoot !== root) {
|
20790 | var rootExpirationTime = root.expirationTime;
|
20791 | requestWork(root, rootExpirationTime);
|
20792 | }
|
20793 | if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
|
20794 |
|
20795 | nestedUpdateCount = 0;
|
20796 | invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');
|
20797 | }
|
20798 | }
|
20799 |
|
20800 | function syncUpdates(fn, a, b, c, d) {
|
20801 | var previousExpirationContext = expirationContext;
|
20802 | expirationContext = Sync;
|
20803 | try {
|
20804 | return fn(a, b, c, d);
|
20805 | } finally {
|
20806 | expirationContext = previousExpirationContext;
|
20807 | }
|
20808 | }
|
20809 |
|
20810 |
|
20811 |
|
20812 |
|
20813 |
|
20814 | var firstScheduledRoot = null;
|
20815 | var lastScheduledRoot = null;
|
20816 |
|
20817 | var callbackExpirationTime = NoWork;
|
20818 | var callbackID = void 0;
|
20819 | var isRendering = false;
|
20820 | var nextFlushedRoot = null;
|
20821 | var nextFlushedExpirationTime = NoWork;
|
20822 | var lowestPriorityPendingInteractiveExpirationTime = NoWork;
|
20823 | var hasUnhandledError = false;
|
20824 | var unhandledError = null;
|
20825 |
|
20826 | var isBatchingUpdates = false;
|
20827 | var isUnbatchingUpdates = false;
|
20828 | var isBatchingInteractiveUpdates = false;
|
20829 |
|
20830 | var completedBatches = null;
|
20831 |
|
20832 | var originalStartTimeMs = scheduler.unstable_now();
|
20833 | var currentRendererTime = msToExpirationTime(originalStartTimeMs);
|
20834 | var currentSchedulerTime = currentRendererTime;
|
20835 |
|
20836 |
|
20837 | var NESTED_UPDATE_LIMIT = 50;
|
20838 | var nestedUpdateCount = 0;
|
20839 | var lastCommittedRootDuringThisBatch = null;
|
20840 |
|
20841 | function recomputeCurrentRendererTime() {
|
20842 | var currentTimeMs = scheduler.unstable_now() - originalStartTimeMs;
|
20843 | currentRendererTime = msToExpirationTime(currentTimeMs);
|
20844 | }
|
20845 |
|
20846 | function scheduleCallbackWithExpirationTime(root, expirationTime) {
|
20847 | if (callbackExpirationTime !== NoWork) {
|
20848 |
|
20849 | if (expirationTime < callbackExpirationTime) {
|
20850 |
|
20851 | return;
|
20852 | } else {
|
20853 | if (callbackID !== null) {
|
20854 |
|
20855 |
|
20856 | scheduler.unstable_cancelCallback(callbackID);
|
20857 | }
|
20858 | }
|
20859 |
|
20860 | } else {
|
20861 | startRequestCallbackTimer();
|
20862 | }
|
20863 |
|
20864 | callbackExpirationTime = expirationTime;
|
20865 | var currentMs = scheduler.unstable_now() - originalStartTimeMs;
|
20866 | var expirationTimeMs = expirationTimeToMs(expirationTime);
|
20867 | var timeout = expirationTimeMs - currentMs;
|
20868 | callbackID = scheduler.unstable_scheduleCallback(performAsyncWork, { timeout: timeout });
|
20869 | }
|
20870 |
|
20871 |
|
20872 |
|
20873 |
|
20874 |
|
20875 | function onFatal(root) {
|
20876 | root.finishedWork = null;
|
20877 | }
|
20878 |
|
20879 | function onComplete(root, finishedWork, expirationTime) {
|
20880 | root.pendingCommitExpirationTime = expirationTime;
|
20881 | root.finishedWork = finishedWork;
|
20882 | }
|
20883 |
|
20884 | function onSuspend(root, finishedWork, suspendedExpirationTime, rootExpirationTime, msUntilTimeout) {
|
20885 | root.expirationTime = rootExpirationTime;
|
20886 | if (msUntilTimeout === 0 && !shouldYieldToRenderer()) {
|
20887 |
|
20888 | root.pendingCommitExpirationTime = suspendedExpirationTime;
|
20889 | root.finishedWork = finishedWork;
|
20890 | } else if (msUntilTimeout > 0) {
|
20891 |
|
20892 | root.timeoutHandle = scheduleTimeout(onTimeout.bind(null, root, finishedWork, suspendedExpirationTime), msUntilTimeout);
|
20893 | }
|
20894 | }
|
20895 |
|
20896 | function onYield(root) {
|
20897 | root.finishedWork = null;
|
20898 | }
|
20899 |
|
20900 | function onTimeout(root, finishedWork, suspendedExpirationTime) {
|
20901 |
|
20902 | root.pendingCommitExpirationTime = suspendedExpirationTime;
|
20903 | root.finishedWork = finishedWork;
|
20904 |
|
20905 |
|
20906 |
|
20907 | recomputeCurrentRendererTime();
|
20908 | currentSchedulerTime = currentRendererTime;
|
20909 | flushRoot(root, suspendedExpirationTime);
|
20910 | }
|
20911 |
|
20912 | function onCommit(root, expirationTime) {
|
20913 | root.expirationTime = expirationTime;
|
20914 | root.finishedWork = null;
|
20915 | }
|
20916 |
|
20917 | function requestCurrentTime() {
|
20918 |
|
20919 |
|
20920 |
|
20921 |
|
20922 |
|
20923 |
|
20924 |
|
20925 |
|
20926 |
|
20927 |
|
20928 |
|
20929 |
|
20930 |
|
20931 |
|
20932 |
|
20933 |
|
20934 |
|
20935 |
|
20936 |
|
20937 | if (isRendering) {
|
20938 |
|
20939 | return currentSchedulerTime;
|
20940 | }
|
20941 |
|
20942 | findHighestPriorityRoot();
|
20943 | if (nextFlushedExpirationTime === NoWork || nextFlushedExpirationTime === Never) {
|
20944 |
|
20945 |
|
20946 | recomputeCurrentRendererTime();
|
20947 | currentSchedulerTime = currentRendererTime;
|
20948 | return currentSchedulerTime;
|
20949 | }
|
20950 |
|
20951 |
|
20952 |
|
20953 |
|
20954 |
|
20955 | return currentSchedulerTime;
|
20956 | }
|
20957 |
|
20958 |
|
20959 |
|
20960 | function requestWork(root, expirationTime) {
|
20961 | addRootToSchedule(root, expirationTime);
|
20962 | if (isRendering) {
|
20963 |
|
20964 |
|
20965 | return;
|
20966 | }
|
20967 |
|
20968 | if (isBatchingUpdates) {
|
20969 |
|
20970 | if (isUnbatchingUpdates) {
|
20971 |
|
20972 |
|
20973 | nextFlushedRoot = root;
|
20974 | nextFlushedExpirationTime = Sync;
|
20975 | performWorkOnRoot(root, Sync, false);
|
20976 | }
|
20977 | return;
|
20978 | }
|
20979 |
|
20980 |
|
20981 | if (expirationTime === Sync) {
|
20982 | performSyncWork();
|
20983 | } else {
|
20984 | scheduleCallbackWithExpirationTime(root, expirationTime);
|
20985 | }
|
20986 | }
|
20987 |
|
20988 | function addRootToSchedule(root, expirationTime) {
|
20989 |
|
20990 |
|
20991 | if (root.nextScheduledRoot === null) {
|
20992 |
|
20993 | root.expirationTime = expirationTime;
|
20994 | if (lastScheduledRoot === null) {
|
20995 | firstScheduledRoot = lastScheduledRoot = root;
|
20996 | root.nextScheduledRoot = root;
|
20997 | } else {
|
20998 | lastScheduledRoot.nextScheduledRoot = root;
|
20999 | lastScheduledRoot = root;
|
21000 | lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;
|
21001 | }
|
21002 | } else {
|
21003 |
|
21004 | var remainingExpirationTime = root.expirationTime;
|
21005 | if (expirationTime > remainingExpirationTime) {
|
21006 |
|
21007 | root.expirationTime = expirationTime;
|
21008 | }
|
21009 | }
|
21010 | }
|
21011 |
|
21012 | function findHighestPriorityRoot() {
|
21013 | var highestPriorityWork = NoWork;
|
21014 | var highestPriorityRoot = null;
|
21015 | if (lastScheduledRoot !== null) {
|
21016 | var previousScheduledRoot = lastScheduledRoot;
|
21017 | var root = firstScheduledRoot;
|
21018 | while (root !== null) {
|
21019 | var remainingExpirationTime = root.expirationTime;
|
21020 | if (remainingExpirationTime === NoWork) {
|
21021 |
|
21022 |
|
21023 |
|
21024 |
|
21025 |
|
21026 | !(previousScheduledRoot !== null && lastScheduledRoot !== null) ? invariant(false, 'Should have a previous and last root. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
21027 | if (root === root.nextScheduledRoot) {
|
21028 |
|
21029 | root.nextScheduledRoot = null;
|
21030 | firstScheduledRoot = lastScheduledRoot = null;
|
21031 | break;
|
21032 | } else if (root === firstScheduledRoot) {
|
21033 |
|
21034 | var next = root.nextScheduledRoot;
|
21035 | firstScheduledRoot = next;
|
21036 | lastScheduledRoot.nextScheduledRoot = next;
|
21037 | root.nextScheduledRoot = null;
|
21038 | } else if (root === lastScheduledRoot) {
|
21039 |
|
21040 | lastScheduledRoot = previousScheduledRoot;
|
21041 | lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;
|
21042 | root.nextScheduledRoot = null;
|
21043 | break;
|
21044 | } else {
|
21045 | previousScheduledRoot.nextScheduledRoot = root.nextScheduledRoot;
|
21046 | root.nextScheduledRoot = null;
|
21047 | }
|
21048 | root = previousScheduledRoot.nextScheduledRoot;
|
21049 | } else {
|
21050 | if (remainingExpirationTime > highestPriorityWork) {
|
21051 |
|
21052 | highestPriorityWork = remainingExpirationTime;
|
21053 | highestPriorityRoot = root;
|
21054 | }
|
21055 | if (root === lastScheduledRoot) {
|
21056 | break;
|
21057 | }
|
21058 | if (highestPriorityWork === Sync) {
|
21059 |
|
21060 |
|
21061 | break;
|
21062 | }
|
21063 | previousScheduledRoot = root;
|
21064 | root = root.nextScheduledRoot;
|
21065 | }
|
21066 | }
|
21067 | }
|
21068 |
|
21069 | nextFlushedRoot = highestPriorityRoot;
|
21070 | nextFlushedExpirationTime = highestPriorityWork;
|
21071 | }
|
21072 |
|
21073 |
|
21074 |
|
21075 |
|
21076 | var didYield = false;
|
21077 | function shouldYieldToRenderer() {
|
21078 | if (didYield) {
|
21079 | return true;
|
21080 | }
|
21081 | if (scheduler.unstable_shouldYield()) {
|
21082 | didYield = true;
|
21083 | return true;
|
21084 | }
|
21085 | return false;
|
21086 | }
|
21087 |
|
21088 | function performAsyncWork() {
|
21089 | try {
|
21090 | if (!shouldYieldToRenderer()) {
|
21091 |
|
21092 |
|
21093 |
|
21094 |
|
21095 |
|
21096 | if (firstScheduledRoot !== null) {
|
21097 | recomputeCurrentRendererTime();
|
21098 | var root = firstScheduledRoot;
|
21099 | do {
|
21100 | didExpireAtExpirationTime(root, currentRendererTime);
|
21101 |
|
21102 | root = root.nextScheduledRoot;
|
21103 | } while (root !== firstScheduledRoot);
|
21104 | }
|
21105 | }
|
21106 | performWork(NoWork, true);
|
21107 | } finally {
|
21108 | didYield = false;
|
21109 | }
|
21110 | }
|
21111 |
|
21112 | function performSyncWork() {
|
21113 | performWork(Sync, false);
|
21114 | }
|
21115 |
|
21116 | function performWork(minExpirationTime, isYieldy) {
|
21117 |
|
21118 |
|
21119 | findHighestPriorityRoot();
|
21120 |
|
21121 | if (isYieldy) {
|
21122 | recomputeCurrentRendererTime();
|
21123 | currentSchedulerTime = currentRendererTime;
|
21124 |
|
21125 | if (enableUserTimingAPI) {
|
21126 | var didExpire = nextFlushedExpirationTime > currentRendererTime;
|
21127 | var timeout = expirationTimeToMs(nextFlushedExpirationTime);
|
21128 | stopRequestCallbackTimer(didExpire, timeout);
|
21129 | }
|
21130 |
|
21131 | while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && minExpirationTime <= nextFlushedExpirationTime && !(didYield && currentRendererTime > nextFlushedExpirationTime)) {
|
21132 | performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime, currentRendererTime > nextFlushedExpirationTime);
|
21133 | findHighestPriorityRoot();
|
21134 | recomputeCurrentRendererTime();
|
21135 | currentSchedulerTime = currentRendererTime;
|
21136 | }
|
21137 | } else {
|
21138 | while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && minExpirationTime <= nextFlushedExpirationTime) {
|
21139 | performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime, false);
|
21140 | findHighestPriorityRoot();
|
21141 | }
|
21142 | }
|
21143 |
|
21144 |
|
21145 |
|
21146 |
|
21147 |
|
21148 | if (isYieldy) {
|
21149 | callbackExpirationTime = NoWork;
|
21150 | callbackID = null;
|
21151 | }
|
21152 |
|
21153 | if (nextFlushedExpirationTime !== NoWork) {
|
21154 | scheduleCallbackWithExpirationTime(nextFlushedRoot, nextFlushedExpirationTime);
|
21155 | }
|
21156 |
|
21157 |
|
21158 | finishRendering();
|
21159 | }
|
21160 |
|
21161 | function flushRoot(root, expirationTime) {
|
21162 | !!isRendering ? invariant(false, 'work.commit(): Cannot commit while already rendering. This likely means you attempted to commit from inside a lifecycle method.') : void 0;
|
21163 |
|
21164 |
|
21165 |
|
21166 | nextFlushedRoot = root;
|
21167 | nextFlushedExpirationTime = expirationTime;
|
21168 | performWorkOnRoot(root, expirationTime, false);
|
21169 |
|
21170 | performSyncWork();
|
21171 | }
|
21172 |
|
21173 | function finishRendering() {
|
21174 | nestedUpdateCount = 0;
|
21175 | lastCommittedRootDuringThisBatch = null;
|
21176 |
|
21177 | if (completedBatches !== null) {
|
21178 | var batches = completedBatches;
|
21179 | completedBatches = null;
|
21180 | for (var i = 0; i < batches.length; i++) {
|
21181 | var batch = batches[i];
|
21182 | try {
|
21183 | batch._onComplete();
|
21184 | } catch (error) {
|
21185 | if (!hasUnhandledError) {
|
21186 | hasUnhandledError = true;
|
21187 | unhandledError = error;
|
21188 | }
|
21189 | }
|
21190 | }
|
21191 | }
|
21192 |
|
21193 | if (hasUnhandledError) {
|
21194 | var error = unhandledError;
|
21195 | unhandledError = null;
|
21196 | hasUnhandledError = false;
|
21197 | throw error;
|
21198 | }
|
21199 | }
|
21200 |
|
21201 | function performWorkOnRoot(root, expirationTime, isYieldy) {
|
21202 | !!isRendering ? invariant(false, 'performWorkOnRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
21203 |
|
21204 | isRendering = true;
|
21205 |
|
21206 |
|
21207 | if (!isYieldy) {
|
21208 |
|
21209 |
|
21210 |
|
21211 |
|
21212 |
|
21213 | var finishedWork = root.finishedWork;
|
21214 | if (finishedWork !== null) {
|
21215 |
|
21216 | completeRoot(root, finishedWork, expirationTime);
|
21217 | } else {
|
21218 | root.finishedWork = null;
|
21219 |
|
21220 |
|
21221 | var timeoutHandle = root.timeoutHandle;
|
21222 | if (timeoutHandle !== noTimeout) {
|
21223 | root.timeoutHandle = noTimeout;
|
21224 |
|
21225 | cancelTimeout(timeoutHandle);
|
21226 | }
|
21227 | renderRoot(root, isYieldy);
|
21228 | finishedWork = root.finishedWork;
|
21229 | if (finishedWork !== null) {
|
21230 |
|
21231 | completeRoot(root, finishedWork, expirationTime);
|
21232 | }
|
21233 | }
|
21234 | } else {
|
21235 |
|
21236 | var _finishedWork = root.finishedWork;
|
21237 | if (_finishedWork !== null) {
|
21238 |
|
21239 | completeRoot(root, _finishedWork, expirationTime);
|
21240 | } else {
|
21241 | root.finishedWork = null;
|
21242 |
|
21243 |
|
21244 | var _timeoutHandle = root.timeoutHandle;
|
21245 | if (_timeoutHandle !== noTimeout) {
|
21246 | root.timeoutHandle = noTimeout;
|
21247 |
|
21248 | cancelTimeout(_timeoutHandle);
|
21249 | }
|
21250 | renderRoot(root, isYieldy);
|
21251 | _finishedWork = root.finishedWork;
|
21252 | if (_finishedWork !== null) {
|
21253 |
|
21254 |
|
21255 | if (!shouldYieldToRenderer()) {
|
21256 |
|
21257 | completeRoot(root, _finishedWork, expirationTime);
|
21258 | } else {
|
21259 |
|
21260 |
|
21261 | root.finishedWork = _finishedWork;
|
21262 | }
|
21263 | }
|
21264 | }
|
21265 | }
|
21266 |
|
21267 | isRendering = false;
|
21268 | }
|
21269 |
|
21270 | function completeRoot(root, finishedWork, expirationTime) {
|
21271 |
|
21272 | var firstBatch = root.firstBatch;
|
21273 | if (firstBatch !== null && firstBatch._expirationTime >= expirationTime) {
|
21274 | if (completedBatches === null) {
|
21275 | completedBatches = [firstBatch];
|
21276 | } else {
|
21277 | completedBatches.push(firstBatch);
|
21278 | }
|
21279 | if (firstBatch._defer) {
|
21280 |
|
21281 |
|
21282 | root.finishedWork = finishedWork;
|
21283 | root.expirationTime = NoWork;
|
21284 | return;
|
21285 | }
|
21286 | }
|
21287 |
|
21288 |
|
21289 | root.finishedWork = null;
|
21290 |
|
21291 |
|
21292 |
|
21293 | if (root === lastCommittedRootDuringThisBatch) {
|
21294 |
|
21295 |
|
21296 | nestedUpdateCount++;
|
21297 | } else {
|
21298 |
|
21299 | lastCommittedRootDuringThisBatch = root;
|
21300 | nestedUpdateCount = 0;
|
21301 | }
|
21302 | commitRoot(root, finishedWork);
|
21303 | }
|
21304 |
|
21305 | function onUncaughtError(error) {
|
21306 | !(nextFlushedRoot !== null) ? invariant(false, 'Should be working on a root. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
21307 |
|
21308 |
|
21309 | nextFlushedRoot.expirationTime = NoWork;
|
21310 | if (!hasUnhandledError) {
|
21311 | hasUnhandledError = true;
|
21312 | unhandledError = error;
|
21313 | }
|
21314 | }
|
21315 |
|
21316 |
|
21317 |
|
21318 | function batchedUpdates$1(fn, a) {
|
21319 | var previousIsBatchingUpdates = isBatchingUpdates;
|
21320 | isBatchingUpdates = true;
|
21321 | try {
|
21322 | return fn(a);
|
21323 | } finally {
|
21324 | isBatchingUpdates = previousIsBatchingUpdates;
|
21325 | if (!isBatchingUpdates && !isRendering) {
|
21326 | performSyncWork();
|
21327 | }
|
21328 | }
|
21329 | }
|
21330 |
|
21331 |
|
21332 |
|
21333 | function unbatchedUpdates(fn, a) {
|
21334 | if (isBatchingUpdates && !isUnbatchingUpdates) {
|
21335 | isUnbatchingUpdates = true;
|
21336 | try {
|
21337 | return fn(a);
|
21338 | } finally {
|
21339 | isUnbatchingUpdates = false;
|
21340 | }
|
21341 | }
|
21342 | return fn(a);
|
21343 | }
|
21344 |
|
21345 |
|
21346 |
|
21347 | function flushSync(fn, a) {
|
21348 | !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0;
|
21349 | var previousIsBatchingUpdates = isBatchingUpdates;
|
21350 | isBatchingUpdates = true;
|
21351 | try {
|
21352 | return syncUpdates(fn, a);
|
21353 | } finally {
|
21354 | isBatchingUpdates = previousIsBatchingUpdates;
|
21355 | performSyncWork();
|
21356 | }
|
21357 | }
|
21358 |
|
21359 | function interactiveUpdates$1(fn, a, b) {
|
21360 | if (isBatchingInteractiveUpdates) {
|
21361 | return fn(a, b);
|
21362 | }
|
21363 |
|
21364 |
|
21365 |
|
21366 |
|
21367 | if (!isBatchingUpdates && !isRendering && lowestPriorityPendingInteractiveExpirationTime !== NoWork) {
|
21368 |
|
21369 | performWork(lowestPriorityPendingInteractiveExpirationTime, false);
|
21370 | lowestPriorityPendingInteractiveExpirationTime = NoWork;
|
21371 | }
|
21372 | var previousIsBatchingInteractiveUpdates = isBatchingInteractiveUpdates;
|
21373 | var previousIsBatchingUpdates = isBatchingUpdates;
|
21374 | isBatchingInteractiveUpdates = true;
|
21375 | isBatchingUpdates = true;
|
21376 | try {
|
21377 | return fn(a, b);
|
21378 | } finally {
|
21379 | isBatchingInteractiveUpdates = previousIsBatchingInteractiveUpdates;
|
21380 | isBatchingUpdates = previousIsBatchingUpdates;
|
21381 | if (!isBatchingUpdates && !isRendering) {
|
21382 | performSyncWork();
|
21383 | }
|
21384 | }
|
21385 | }
|
21386 |
|
21387 | function flushInteractiveUpdates$1() {
|
21388 | if (!isRendering && lowestPriorityPendingInteractiveExpirationTime !== NoWork) {
|
21389 |
|
21390 | performWork(lowestPriorityPendingInteractiveExpirationTime, false);
|
21391 | lowestPriorityPendingInteractiveExpirationTime = NoWork;
|
21392 | }
|
21393 | }
|
21394 |
|
21395 | function flushControlled(fn) {
|
21396 | var previousIsBatchingUpdates = isBatchingUpdates;
|
21397 | isBatchingUpdates = true;
|
21398 | try {
|
21399 | syncUpdates(fn);
|
21400 | } finally {
|
21401 | isBatchingUpdates = previousIsBatchingUpdates;
|
21402 | if (!isBatchingUpdates && !isRendering) {
|
21403 | performSyncWork();
|
21404 | }
|
21405 | }
|
21406 | }
|
21407 |
|
21408 |
|
21409 |
|
21410 |
|
21411 |
|
21412 | var didWarnAboutNestedUpdates = void 0;
|
21413 | var didWarnAboutFindNodeInStrictMode = void 0;
|
21414 |
|
21415 | {
|
21416 | didWarnAboutNestedUpdates = false;
|
21417 | didWarnAboutFindNodeInStrictMode = {};
|
21418 | }
|
21419 |
|
21420 | function getContextForSubtree(parentComponent) {
|
21421 | if (!parentComponent) {
|
21422 | return emptyContextObject;
|
21423 | }
|
21424 |
|
21425 | var fiber = get(parentComponent);
|
21426 | var parentContext = findCurrentUnmaskedContext(fiber);
|
21427 |
|
21428 | if (fiber.tag === ClassComponent) {
|
21429 | var Component = fiber.type;
|
21430 | if (isContextProvider(Component)) {
|
21431 | return processChildContext(fiber, Component, parentContext);
|
21432 | }
|
21433 | }
|
21434 |
|
21435 | return parentContext;
|
21436 | }
|
21437 |
|
21438 | function scheduleRootUpdate(current$$1, element, expirationTime, callback) {
|
21439 | {
|
21440 | if (phase === 'render' && current !== null && !didWarnAboutNestedUpdates) {
|
21441 | didWarnAboutNestedUpdates = true;
|
21442 | warningWithoutStack$1(false, 'Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');
|
21443 | }
|
21444 | }
|
21445 |
|
21446 | var update = createUpdate(expirationTime);
|
21447 |
|
21448 |
|
21449 | update.payload = { element: element };
|
21450 |
|
21451 | callback = callback === undefined ? null : callback;
|
21452 | if (callback !== null) {
|
21453 | !(typeof callback === 'function') ? warningWithoutStack$1(false, 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback) : void 0;
|
21454 | update.callback = callback;
|
21455 | }
|
21456 |
|
21457 | flushPassiveEffects();
|
21458 | enqueueUpdate(current$$1, update);
|
21459 | scheduleWork(current$$1, expirationTime);
|
21460 |
|
21461 | return expirationTime;
|
21462 | }
|
21463 |
|
21464 | function updateContainerAtExpirationTime(element, container, parentComponent, expirationTime, callback) {
|
21465 |
|
21466 | var current$$1 = container.current;
|
21467 |
|
21468 | {
|
21469 | if (ReactFiberInstrumentation_1.debugTool) {
|
21470 | if (current$$1.alternate === null) {
|
21471 | ReactFiberInstrumentation_1.debugTool.onMountContainer(container);
|
21472 | } else if (element === null) {
|
21473 | ReactFiberInstrumentation_1.debugTool.onUnmountContainer(container);
|
21474 | } else {
|
21475 | ReactFiberInstrumentation_1.debugTool.onUpdateContainer(container);
|
21476 | }
|
21477 | }
|
21478 | }
|
21479 |
|
21480 | var context = getContextForSubtree(parentComponent);
|
21481 | if (container.context === null) {
|
21482 | container.context = context;
|
21483 | } else {
|
21484 | container.pendingContext = context;
|
21485 | }
|
21486 |
|
21487 | return scheduleRootUpdate(current$$1, element, expirationTime, callback);
|
21488 | }
|
21489 |
|
21490 | function findHostInstance(component) {
|
21491 | var fiber = get(component);
|
21492 | if (fiber === undefined) {
|
21493 | if (typeof component.render === 'function') {
|
21494 | invariant(false, 'Unable to find node on an unmounted component.');
|
21495 | } else {
|
21496 | invariant(false, 'Argument appears to not be a ReactComponent. Keys: %s', Object.keys(component));
|
21497 | }
|
21498 | }
|
21499 | var hostFiber = findCurrentHostFiber(fiber);
|
21500 | if (hostFiber === null) {
|
21501 | return null;
|
21502 | }
|
21503 | return hostFiber.stateNode;
|
21504 | }
|
21505 |
|
21506 | function findHostInstanceWithWarning(component, methodName) {
|
21507 | {
|
21508 | var fiber = get(component);
|
21509 | if (fiber === undefined) {
|
21510 | if (typeof component.render === 'function') {
|
21511 | invariant(false, 'Unable to find node on an unmounted component.');
|
21512 | } else {
|
21513 | invariant(false, 'Argument appears to not be a ReactComponent. Keys: %s', Object.keys(component));
|
21514 | }
|
21515 | }
|
21516 | var hostFiber = findCurrentHostFiber(fiber);
|
21517 | if (hostFiber === null) {
|
21518 | return null;
|
21519 | }
|
21520 | if (hostFiber.mode & StrictMode) {
|
21521 | var componentName = getComponentName(fiber.type) || 'Component';
|
21522 | if (!didWarnAboutFindNodeInStrictMode[componentName]) {
|
21523 | didWarnAboutFindNodeInStrictMode[componentName] = true;
|
21524 | if (fiber.mode & StrictMode) {
|
21525 | warningWithoutStack$1(false, '%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-find-node', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
|
21526 | } else {
|
21527 | warningWithoutStack$1(false, '%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-find-node', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
|
21528 | }
|
21529 | }
|
21530 | }
|
21531 | return hostFiber.stateNode;
|
21532 | }
|
21533 | return findHostInstance(component);
|
21534 | }
|
21535 |
|
21536 | function createContainer(containerInfo, isConcurrent, hydrate) {
|
21537 | return createFiberRoot(containerInfo, isConcurrent, hydrate);
|
21538 | }
|
21539 |
|
21540 | function updateContainer(element, container, parentComponent, callback) {
|
21541 | var current$$1 = container.current;
|
21542 | var currentTime = requestCurrentTime();
|
21543 | var expirationTime = computeExpirationForFiber(currentTime, current$$1);
|
21544 | return updateContainerAtExpirationTime(element, container, parentComponent, expirationTime, callback);
|
21545 | }
|
21546 |
|
21547 | function getPublicRootInstance(container) {
|
21548 | var containerFiber = container.current;
|
21549 | if (!containerFiber.child) {
|
21550 | return null;
|
21551 | }
|
21552 | switch (containerFiber.child.tag) {
|
21553 | case HostComponent:
|
21554 | return getPublicInstance(containerFiber.child.stateNode);
|
21555 | default:
|
21556 | return containerFiber.child.stateNode;
|
21557 | }
|
21558 | }
|
21559 |
|
21560 | function findHostInstanceWithNoPortals(fiber) {
|
21561 | var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
|
21562 | if (hostFiber === null) {
|
21563 | return null;
|
21564 | }
|
21565 | return hostFiber.stateNode;
|
21566 | }
|
21567 |
|
21568 | var overrideProps = null;
|
21569 |
|
21570 | {
|
21571 | var copyWithSetImpl = function (obj, path, idx, value) {
|
21572 | if (idx >= path.length) {
|
21573 | return value;
|
21574 | }
|
21575 | var key = path[idx];
|
21576 | var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
|
21577 |
|
21578 | updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);
|
21579 | return updated;
|
21580 | };
|
21581 |
|
21582 | var copyWithSet = function (obj, path, value) {
|
21583 | return copyWithSetImpl(obj, path, 0, value);
|
21584 | };
|
21585 |
|
21586 |
|
21587 | overrideProps = function (fiber, path, value) {
|
21588 | flushPassiveEffects();
|
21589 | fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
|
21590 | if (fiber.alternate) {
|
21591 | fiber.alternate.pendingProps = fiber.pendingProps;
|
21592 | }
|
21593 | scheduleWork(fiber, Sync);
|
21594 | };
|
21595 | }
|
21596 |
|
21597 | function injectIntoDevTools(devToolsConfig) {
|
21598 | var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
|
21599 |
|
21600 | return injectInternals(_assign({}, devToolsConfig, {
|
21601 | overrideProps: overrideProps,
|
21602 | findHostInstanceByFiber: function (fiber) {
|
21603 | var hostFiber = findCurrentHostFiber(fiber);
|
21604 | if (hostFiber === null) {
|
21605 | return null;
|
21606 | }
|
21607 | return hostFiber.stateNode;
|
21608 | },
|
21609 | findFiberByHostInstance: function (instance) {
|
21610 | if (!findFiberByHostInstance) {
|
21611 |
|
21612 | return null;
|
21613 | }
|
21614 | return findFiberByHostInstance(instance);
|
21615 | }
|
21616 | }));
|
21617 | }
|
21618 |
|
21619 |
|
21620 |
|
21621 |
|
21622 | function createPortal$1(children, containerInfo,
|
21623 | // TODO: figure out the API for cross-renderer implementation.
|
21624 | implementation) {
|
21625 | var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
21626 |
|
21627 | return {
|
21628 |
|
21629 | $$typeof: REACT_PORTAL_TYPE,
|
21630 | key: key == null ? null : '' + key,
|
21631 | children: children,
|
21632 | containerInfo: containerInfo,
|
21633 | implementation: implementation
|
21634 | };
|
21635 | }
|
21636 |
|
21637 |
|
21638 |
|
21639 | var ReactVersion = '16.7.0';
|
21640 |
|
21641 |
|
21642 |
|
21643 | var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
21644 |
|
21645 | var topLevelUpdateWarnings = void 0;
|
21646 | var warnOnInvalidCallback = void 0;
|
21647 | var didWarnAboutUnstableCreatePortal = false;
|
21648 |
|
21649 | {
|
21650 | if (typeof Map !== 'function' ||
|
21651 |
|
21652 | Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' ||
|
21653 |
|
21654 | Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {
|
21655 | warningWithoutStack$1(false, 'React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
|
21656 | }
|
21657 |
|
21658 | topLevelUpdateWarnings = function (container) {
|
21659 | if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
|
21660 | var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);
|
21661 | if (hostInstance) {
|
21662 | !(hostInstance.parentNode === container) ? warningWithoutStack$1(false, 'render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.') : void 0;
|
21663 | }
|
21664 | }
|
21665 |
|
21666 | var isRootRenderedBySomeReact = !!container._reactRootContainer;
|
21667 | var rootEl = getReactRootElementInContainer(container);
|
21668 | var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl));
|
21669 |
|
21670 | !(!hasNonRootReactChild || isRootRenderedBySomeReact) ? warningWithoutStack$1(false, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;
|
21671 |
|
21672 | !(container.nodeType !== ELEMENT_NODE || !container.tagName || container.tagName.toUpperCase() !== 'BODY') ? warningWithoutStack$1(false, 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
|
21673 | };
|
21674 |
|
21675 | warnOnInvalidCallback = function (callback, callerName) {
|
21676 | !(callback === null || typeof callback === 'function') ? warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback) : void 0;
|
21677 | };
|
21678 | }
|
21679 |
|
21680 | setRestoreImplementation(restoreControlledState$1);
|
21681 |
|
21682 | function ReactBatch(root) {
|
21683 | var expirationTime = computeUniqueAsyncExpiration();
|
21684 | this._expirationTime = expirationTime;
|
21685 | this._root = root;
|
21686 | this._next = null;
|
21687 | this._callbacks = null;
|
21688 | this._didComplete = false;
|
21689 | this._hasChildren = false;
|
21690 | this._children = null;
|
21691 | this._defer = true;
|
21692 | }
|
21693 | ReactBatch.prototype.render = function (children) {
|
21694 | !this._defer ? invariant(false, 'batch.render: Cannot render a batch that already committed.') : void 0;
|
21695 | this._hasChildren = true;
|
21696 | this._children = children;
|
21697 | var internalRoot = this._root._internalRoot;
|
21698 | var expirationTime = this._expirationTime;
|
21699 | var work = new ReactWork();
|
21700 | updateContainerAtExpirationTime(children, internalRoot, null, expirationTime, work._onCommit);
|
21701 | return work;
|
21702 | };
|
21703 | ReactBatch.prototype.then = function (onComplete) {
|
21704 | if (this._didComplete) {
|
21705 | onComplete();
|
21706 | return;
|
21707 | }
|
21708 | var callbacks = this._callbacks;
|
21709 | if (callbacks === null) {
|
21710 | callbacks = this._callbacks = [];
|
21711 | }
|
21712 | callbacks.push(onComplete);
|
21713 | };
|
21714 | ReactBatch.prototype.commit = function () {
|
21715 | var internalRoot = this._root._internalRoot;
|
21716 | var firstBatch = internalRoot.firstBatch;
|
21717 | !(this._defer && firstBatch !== null) ? invariant(false, 'batch.commit: Cannot commit a batch multiple times.') : void 0;
|
21718 |
|
21719 | if (!this._hasChildren) {
|
21720 |
|
21721 | this._next = null;
|
21722 | this._defer = false;
|
21723 | return;
|
21724 | }
|
21725 |
|
21726 | var expirationTime = this._expirationTime;
|
21727 |
|
21728 |
|
21729 | if (firstBatch !== this) {
|
21730 |
|
21731 |
|
21732 |
|
21733 | if (this._hasChildren) {
|
21734 | expirationTime = this._expirationTime = firstBatch._expirationTime;
|
21735 |
|
21736 |
|
21737 |
|
21738 |
|
21739 | this.render(this._children);
|
21740 | }
|
21741 |
|
21742 |
|
21743 | var previous = null;
|
21744 | var batch = firstBatch;
|
21745 | while (batch !== this) {
|
21746 | previous = batch;
|
21747 | batch = batch._next;
|
21748 | }
|
21749 | !(previous !== null) ? invariant(false, 'batch.commit: Cannot commit a batch multiple times.') : void 0;
|
21750 | previous._next = batch._next;
|
21751 |
|
21752 |
|
21753 | this._next = firstBatch;
|
21754 | firstBatch = internalRoot.firstBatch = this;
|
21755 | }
|
21756 |
|
21757 |
|
21758 | this._defer = false;
|
21759 | flushRoot(internalRoot, expirationTime);
|
21760 |
|
21761 |
|
21762 | var next = this._next;
|
21763 | this._next = null;
|
21764 | firstBatch = internalRoot.firstBatch = next;
|
21765 |
|
21766 |
|
21767 | if (firstBatch !== null && firstBatch._hasChildren) {
|
21768 | firstBatch.render(firstBatch._children);
|
21769 | }
|
21770 | };
|
21771 | ReactBatch.prototype._onComplete = function () {
|
21772 | if (this._didComplete) {
|
21773 | return;
|
21774 | }
|
21775 | this._didComplete = true;
|
21776 | var callbacks = this._callbacks;
|
21777 | if (callbacks === null) {
|
21778 | return;
|
21779 | }
|
21780 |
|
21781 | for (var i = 0; i < callbacks.length; i++) {
|
21782 | var _callback = callbacks[i];
|
21783 | _callback();
|
21784 | }
|
21785 | };
|
21786 |
|
21787 | function ReactWork() {
|
21788 | this._callbacks = null;
|
21789 | this._didCommit = false;
|
21790 |
|
21791 |
|
21792 | this._onCommit = this._onCommit.bind(this);
|
21793 | }
|
21794 | ReactWork.prototype.then = function (onCommit) {
|
21795 | if (this._didCommit) {
|
21796 | onCommit();
|
21797 | return;
|
21798 | }
|
21799 | var callbacks = this._callbacks;
|
21800 | if (callbacks === null) {
|
21801 | callbacks = this._callbacks = [];
|
21802 | }
|
21803 | callbacks.push(onCommit);
|
21804 | };
|
21805 | ReactWork.prototype._onCommit = function () {
|
21806 | if (this._didCommit) {
|
21807 | return;
|
21808 | }
|
21809 | this._didCommit = true;
|
21810 | var callbacks = this._callbacks;
|
21811 | if (callbacks === null) {
|
21812 | return;
|
21813 | }
|
21814 |
|
21815 | for (var i = 0; i < callbacks.length; i++) {
|
21816 | var _callback2 = callbacks[i];
|
21817 | !(typeof _callback2 === 'function') ? invariant(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', _callback2) : void 0;
|
21818 | _callback2();
|
21819 | }
|
21820 | };
|
21821 |
|
21822 | function ReactRoot(container, isConcurrent, hydrate) {
|
21823 | var root = createContainer(container, isConcurrent, hydrate);
|
21824 | this._internalRoot = root;
|
21825 | }
|
21826 | ReactRoot.prototype.render = function (children, callback) {
|
21827 | var root = this._internalRoot;
|
21828 | var work = new ReactWork();
|
21829 | callback = callback === undefined ? null : callback;
|
21830 | {
|
21831 | warnOnInvalidCallback(callback, 'render');
|
21832 | }
|
21833 | if (callback !== null) {
|
21834 | work.then(callback);
|
21835 | }
|
21836 | updateContainer(children, root, null, work._onCommit);
|
21837 | return work;
|
21838 | };
|
21839 | ReactRoot.prototype.unmount = function (callback) {
|
21840 | var root = this._internalRoot;
|
21841 | var work = new ReactWork();
|
21842 | callback = callback === undefined ? null : callback;
|
21843 | {
|
21844 | warnOnInvalidCallback(callback, 'render');
|
21845 | }
|
21846 | if (callback !== null) {
|
21847 | work.then(callback);
|
21848 | }
|
21849 | updateContainer(null, root, null, work._onCommit);
|
21850 | return work;
|
21851 | };
|
21852 | ReactRoot.prototype.legacy_renderSubtreeIntoContainer = function (parentComponent, children, callback) {
|
21853 | var root = this._internalRoot;
|
21854 | var work = new ReactWork();
|
21855 | callback = callback === undefined ? null : callback;
|
21856 | {
|
21857 | warnOnInvalidCallback(callback, 'render');
|
21858 | }
|
21859 | if (callback !== null) {
|
21860 | work.then(callback);
|
21861 | }
|
21862 | updateContainer(children, root, parentComponent, work._onCommit);
|
21863 | return work;
|
21864 | };
|
21865 | ReactRoot.prototype.createBatch = function () {
|
21866 | var batch = new ReactBatch(this);
|
21867 | var expirationTime = batch._expirationTime;
|
21868 |
|
21869 | var internalRoot = this._internalRoot;
|
21870 | var firstBatch = internalRoot.firstBatch;
|
21871 | if (firstBatch === null) {
|
21872 | internalRoot.firstBatch = batch;
|
21873 | batch._next = null;
|
21874 | } else {
|
21875 |
|
21876 | var insertAfter = null;
|
21877 | var insertBefore = firstBatch;
|
21878 | while (insertBefore !== null && insertBefore._expirationTime >= expirationTime) {
|
21879 | insertAfter = insertBefore;
|
21880 | insertBefore = insertBefore._next;
|
21881 | }
|
21882 | batch._next = insertBefore;
|
21883 | if (insertAfter !== null) {
|
21884 | insertAfter._next = batch;
|
21885 | }
|
21886 | }
|
21887 |
|
21888 | return batch;
|
21889 | };
|
21890 |
|
21891 |
|
21892 |
|
21893 |
|
21894 |
|
21895 |
|
21896 |
|
21897 |
|
21898 | function isValidContainer(node) {
|
21899 | return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));
|
21900 | }
|
21901 |
|
21902 | function getReactRootElementInContainer(container) {
|
21903 | if (!container) {
|
21904 | return null;
|
21905 | }
|
21906 |
|
21907 | if (container.nodeType === DOCUMENT_NODE) {
|
21908 | return container.documentElement;
|
21909 | } else {
|
21910 | return container.firstChild;
|
21911 | }
|
21912 | }
|
21913 |
|
21914 | function shouldHydrateDueToLegacyHeuristic(container) {
|
21915 | var rootElement = getReactRootElementInContainer(container);
|
21916 | return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
|
21917 | }
|
21918 |
|
21919 | setBatchingImplementation(batchedUpdates$1, interactiveUpdates$1, flushInteractiveUpdates$1);
|
21920 |
|
21921 | var warnedAboutHydrateAPI = false;
|
21922 |
|
21923 | function legacyCreateRootFromDOMContainer(container, forceHydrate) {
|
21924 | var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container);
|
21925 |
|
21926 | if (!shouldHydrate) {
|
21927 | var warned = false;
|
21928 | var rootSibling = void 0;
|
21929 | while (rootSibling = container.lastChild) {
|
21930 | {
|
21931 | if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
|
21932 | warned = true;
|
21933 | warningWithoutStack$1(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');
|
21934 | }
|
21935 | }
|
21936 | container.removeChild(rootSibling);
|
21937 | }
|
21938 | }
|
21939 | {
|
21940 | if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
|
21941 | warnedAboutHydrateAPI = true;
|
21942 | lowPriorityWarning$1(false, 'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');
|
21943 | }
|
21944 | }
|
21945 |
|
21946 | var isConcurrent = false;
|
21947 | return new ReactRoot(container, isConcurrent, shouldHydrate);
|
21948 | }
|
21949 |
|
21950 | function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
|
21951 |
|
21952 | !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0;
|
21953 |
|
21954 | {
|
21955 | topLevelUpdateWarnings(container);
|
21956 | }
|
21957 |
|
21958 |
|
21959 |
|
21960 | var root = container._reactRootContainer;
|
21961 | if (!root) {
|
21962 |
|
21963 | root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);
|
21964 | if (typeof callback === 'function') {
|
21965 | var originalCallback = callback;
|
21966 | callback = function () {
|
21967 | var instance = getPublicRootInstance(root._internalRoot);
|
21968 | originalCallback.call(instance);
|
21969 | };
|
21970 | }
|
21971 |
|
21972 | unbatchedUpdates(function () {
|
21973 | if (parentComponent != null) {
|
21974 | root.legacy_renderSubtreeIntoContainer(parentComponent, children, callback);
|
21975 | } else {
|
21976 | root.render(children, callback);
|
21977 | }
|
21978 | });
|
21979 | } else {
|
21980 | if (typeof callback === 'function') {
|
21981 | var _originalCallback = callback;
|
21982 | callback = function () {
|
21983 | var instance = getPublicRootInstance(root._internalRoot);
|
21984 | _originalCallback.call(instance);
|
21985 | };
|
21986 | }
|
21987 |
|
21988 | if (parentComponent != null) {
|
21989 | root.legacy_renderSubtreeIntoContainer(parentComponent, children, callback);
|
21990 | } else {
|
21991 | root.render(children, callback);
|
21992 | }
|
21993 | }
|
21994 | return getPublicRootInstance(root._internalRoot);
|
21995 | }
|
21996 |
|
21997 | function createPortal$$1(children, container) {
|
21998 | var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
21999 |
|
22000 | !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0;
|
22001 |
|
22002 | return createPortal$1(children, container, null, key);
|
22003 | }
|
22004 |
|
22005 | var ReactDOM = {
|
22006 | createPortal: createPortal$$1,
|
22007 |
|
22008 | findDOMNode: function (componentOrElement) {
|
22009 | {
|
22010 | var owner = ReactCurrentOwner.current;
|
22011 | if (owner !== null && owner.stateNode !== null) {
|
22012 | var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
|
22013 | !warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner.type) || 'A component') : void 0;
|
22014 | owner.stateNode._warnedAboutRefsInRender = true;
|
22015 | }
|
22016 | }
|
22017 | if (componentOrElement == null) {
|
22018 | return null;
|
22019 | }
|
22020 | if (componentOrElement.nodeType === ELEMENT_NODE) {
|
22021 | return componentOrElement;
|
22022 | }
|
22023 | {
|
22024 | return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');
|
22025 | }
|
22026 | return findHostInstance(componentOrElement);
|
22027 | },
|
22028 | hydrate: function (element, container, callback) {
|
22029 |
|
22030 | return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
|
22031 | },
|
22032 | render: function (element, container, callback) {
|
22033 | return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
|
22034 | },
|
22035 | unstable_renderSubtreeIntoContainer: function (parentComponent, element, containerNode, callback) {
|
22036 | !(parentComponent != null && has(parentComponent)) ? invariant(false, 'parentComponent must be a valid React Component') : void 0;
|
22037 | return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
|
22038 | },
|
22039 | unmountComponentAtNode: function (container) {
|
22040 | !isValidContainer(container) ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : void 0;
|
22041 |
|
22042 | if (container._reactRootContainer) {
|
22043 | {
|
22044 | var rootEl = getReactRootElementInContainer(container);
|
22045 | var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);
|
22046 | !!renderedByDifferentReact ? warningWithoutStack$1(false, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.') : void 0;
|
22047 | }
|
22048 |
|
22049 |
|
22050 | unbatchedUpdates(function () {
|
22051 | legacyRenderSubtreeIntoContainer(null, null, container, false, function () {
|
22052 | container._reactRootContainer = null;
|
22053 | });
|
22054 | });
|
22055 |
|
22056 |
|
22057 | return true;
|
22058 | } else {
|
22059 | {
|
22060 | var _rootEl = getReactRootElementInContainer(container);
|
22061 | var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl));
|
22062 |
|
22063 |
|
22064 | var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;
|
22065 |
|
22066 | !!hasNonRootReactChild ? warningWithoutStack$1(false, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
|
22067 | }
|
22068 |
|
22069 | return false;
|
22070 | }
|
22071 | },
|
22072 |
|
22073 |
|
22074 |
|
22075 |
|
22076 | unstable_createPortal: function () {
|
22077 | if (!didWarnAboutUnstableCreatePortal) {
|
22078 | didWarnAboutUnstableCreatePortal = true;
|
22079 | lowPriorityWarning$1(false, 'The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the "unstable_" prefix.');
|
22080 | }
|
22081 | return createPortal$$1.apply(undefined, arguments);
|
22082 | },
|
22083 |
|
22084 |
|
22085 | unstable_batchedUpdates: batchedUpdates$1,
|
22086 |
|
22087 | unstable_interactiveUpdates: interactiveUpdates$1,
|
22088 |
|
22089 | flushSync: flushSync,
|
22090 |
|
22091 | unstable_createRoot: createRoot,
|
22092 | unstable_flushControlled: flushControlled,
|
22093 |
|
22094 | __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
|
22095 |
|
22096 |
|
22097 | Events: [getInstanceFromNode$1, getNodeFromInstance$1, getFiberCurrentPropsFromNode$1, injection.injectEventPluginsByName, eventNameDispatchConfigs, accumulateTwoPhaseDispatches, accumulateDirectDispatches, enqueueStateRestore, restoreStateIfNeeded, dispatchEvent, runEventsInBatch]
|
22098 | }
|
22099 | };
|
22100 |
|
22101 | function createRoot(container, options) {
|
22102 | var functionName = enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot';
|
22103 | !isValidContainer(container) ? invariant(false, '%s(...): Target container is not a DOM element.', functionName) : void 0;
|
22104 | var hydrate = options != null && options.hydrate === true;
|
22105 | return new ReactRoot(container, true, hydrate);
|
22106 | }
|
22107 |
|
22108 | if (enableStableConcurrentModeAPIs) {
|
22109 | ReactDOM.createRoot = createRoot;
|
22110 | ReactDOM.unstable_createRoot = undefined;
|
22111 | }
|
22112 |
|
22113 | var foundDevTools = injectIntoDevTools({
|
22114 | findFiberByHostInstance: getClosestInstanceFromNode,
|
22115 | bundleType: 1,
|
22116 | version: ReactVersion,
|
22117 | rendererPackageName: 'react-dom'
|
22118 | });
|
22119 |
|
22120 | {
|
22121 | if (!foundDevTools && canUseDOM && window.top === window.self) {
|
22122 |
|
22123 | if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
|
22124 | var protocol = window.location.protocol;
|
22125 |
|
22126 | if (/^(https?|file):$/.test(protocol)) {
|
22127 | console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://fb.me/react-devtools' + (protocol === 'file:' ? '\nYou might need to use a local HTTP server (instead of file://): ' + 'https://fb.me/react-devtools-faq' : ''), 'font-weight:bold');
|
22128 | }
|
22129 | }
|
22130 | }
|
22131 | }
|
22132 |
|
22133 |
|
22134 |
|
22135 | var ReactDOM$2 = Object.freeze({
|
22136 | default: ReactDOM
|
22137 | });
|
22138 |
|
22139 | var ReactDOM$3 = ( ReactDOM$2 && ReactDOM ) || ReactDOM$2;
|
22140 |
|
22141 |
|
22142 |
|
22143 | var reactDom = ReactDOM$3.default || ReactDOM$3;
|
22144 |
|
22145 | module.exports = reactDom;
|
22146 | })();
|
22147 | }
|
22148 |
|
22149 | },{"object-assign":23,"prop-types/checkPropTypes":25,"react":"react","scheduler":71,"scheduler/tracing":72}],30:[function(require,module,exports){
|
22150 |
|
22151 |
|
22152 |
|
22153 |
|
22154 |
|
22155 |
|
22156 |
|
22157 |
|
22158 |
|
22159 |
|
22160 |
|
22161 |
|
22162 | 'use strict';var aa=require("react"),n=require("object-assign"),ba=require("scheduler");function ca(a,b,c,d,e,f,g,h){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var k=[c,d,e,f,g,h],l=0;a=Error(b.replace(/%s/g,function(){return k[l++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}
|
22163 | function t(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=0;d<b;d++)c+="&args[]="+encodeURIComponent(arguments[d+1]);ca(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",c)}aa?void 0:t("227");function da(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l)}catch(m){this.onError(m)}}
|
22164 | var ea=!1,fa=null,ha=!1,ia=null,ja={onError:function(a){ea=!0;fa=a}};function ka(a,b,c,d,e,f,g,h,k){ea=!1;fa=null;da.apply(ja,arguments)}function la(a,b,c,d,e,f,g,h,k){ka.apply(this,arguments);if(ea){if(ea){var l=fa;ea=!1;fa=null}else t("198"),l=void 0;ha||(ha=!0,ia=l)}}var ma=null,na={};
|
22165 | function oa(){if(ma)for(var a in na){var b=na[a],c=ma.indexOf(a);-1<c?void 0:t("96",a);if(!pa[c]){b.extractEvents?void 0:t("97",a);pa[c]=b;c=b.eventTypes;for(var d in c){var e=void 0;var f=c[d],g=b,h=d;qa.hasOwnProperty(h)?t("99",h):void 0;qa[h]=f;var k=f.phasedRegistrationNames;if(k){for(e in k)k.hasOwnProperty(e)&&ra(k[e],g,h);e=!0}else f.registrationName?(ra(f.registrationName,g,h),e=!0):e=!1;e?void 0:t("98",d,a)}}}}
|
22166 | function ra(a,b,c){sa[a]?t("100",a):void 0;sa[a]=b;ta[a]=b.eventTypes[c].dependencies}var pa=[],qa={},sa={},ta={},ua=null,va=null,wa=null;function xa(a,b,c){var d=a.type||"unknown-event";a.currentTarget=wa(c);la(d,b,void 0,a);a.currentTarget=null}function ya(a,b){null==b?t("30"):void 0;if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}
|
22167 | function za(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}var Aa=null;function Ba(a){if(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))for(var d=0;d<b.length&&!a.isPropagationStopped();d++)xa(a,b[d],c[d]);else b&&xa(a,b,c);a._dispatchListeners=null;a._dispatchInstances=null;a.isPersistent()||a.constructor.release(a)}}
|
22168 | var Ca={injectEventPluginOrder:function(a){ma?t("101"):void 0;ma=Array.prototype.slice.call(a);oa()},injectEventPluginsByName:function(a){var b=!1,c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];na.hasOwnProperty(c)&&na[c]===d||(na[c]?t("102",c):void 0,na[c]=d,b=!0)}b&&oa()}};
|
22169 | function Da(a,b){var c=a.stateNode;if(!c)return null;var d=ua(c);if(!d)return null;c=d[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":(d=!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;c&&"function"!==typeof c?t("231",b,typeof c):void 0;
|
22170 | return c}function Ea(a){null!==a&&(Aa=ya(Aa,a));a=Aa;Aa=null;if(a&&(za(a,Ba),Aa?t("95"):void 0,ha))throw a=ia,ha=!1,ia=null,a;}var Fa=Math.random().toString(36).slice(2),Ga="__reactInternalInstance$"+Fa,Ha="__reactEventHandlers$"+Fa;function Ia(a){if(a[Ga])return a[Ga];for(;!a[Ga];)if(a.parentNode)a=a.parentNode;else return null;a=a[Ga];return 5===a.tag||6===a.tag?a:null}function Ja(a){a=a[Ga];return!a||5!==a.tag&&6!==a.tag?null:a}
|
22171 | function Ka(a){if(5===a.tag||6===a.tag)return a.stateNode;t("33")}function La(a){return a[Ha]||null}function Ma(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}function Na(a,b,c){if(b=Da(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=ya(c._dispatchListeners,b),c._dispatchInstances=ya(c._dispatchInstances,a)}
|
22172 | function Oa(a){if(a&&a.dispatchConfig.phasedRegistrationNames){for(var b=a._targetInst,c=[];b;)c.push(b),b=Ma(b);for(b=c.length;0<b--;)Na(c[b],"captured",a);for(b=0;b<c.length;b++)Na(c[b],"bubbled",a)}}function Pa(a,b,c){a&&c&&c.dispatchConfig.registrationName&&(b=Da(a,c.dispatchConfig.registrationName))&&(c._dispatchListeners=ya(c._dispatchListeners,b),c._dispatchInstances=ya(c._dispatchInstances,a))}function Qa(a){a&&a.dispatchConfig.registrationName&&Pa(a._targetInst,null,a)}
|
22173 | function Ra(a){za(a,Oa)}var Sa=!("undefined"===typeof window||!window.document||!window.document.createElement);function Ta(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}var Ua={animationend:Ta("Animation","AnimationEnd"),animationiteration:Ta("Animation","AnimationIteration"),animationstart:Ta("Animation","AnimationStart"),transitionend:Ta("Transition","TransitionEnd")},Va={},Wa={};
|
22174 | Sa&&(Wa=document.createElement("div").style,"AnimationEvent"in window||(delete Ua.animationend.animation,delete Ua.animationiteration.animation,delete Ua.animationstart.animation),"TransitionEvent"in window||delete Ua.transitionend.transition);function Xa(a){if(Va[a])return Va[a];if(!Ua[a])return a;var b=Ua[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Wa)return Va[a]=b[c];return a}
|
22175 | var Ya=Xa("animationend"),Za=Xa("animationiteration"),$a=Xa("animationstart"),ab=Xa("transitionend"),bb="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),cb=null,eb=null,fb=null;
|
22176 | function gb(){if(fb)return fb;var a,b=eb,c=b.length,d,e="value"in cb?cb.value:cb.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);return fb=e.slice(a,1<d?1-d:void 0)}function hb(){return!0}function ib(){return!1}
|
22177 | function z(a,b,c,d){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var e in a)a.hasOwnProperty(e)&&((b=a[e])?this[e]=b(c):"target"===e?this.target=d:this[e]=c[e]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?hb:ib;this.isPropagationStopped=ib;return this}
|
22178 | n(z.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=hb)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=hb)},persist:function(){this.isPersistent=hb},isPersistent:ib,destructor:function(){var a=this.constructor.Interface,
|
22179 | b;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=ib;this._dispatchInstances=this._dispatchListeners=null}});z.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};
|
22180 | z.extend=function(a){function b(){}function c(){return d.apply(this,arguments)}var d=this;b.prototype=d.prototype;var e=new b;n(e,c.prototype);c.prototype=e;c.prototype.constructor=c;c.Interface=n({},d.Interface,a);c.extend=d.extend;jb(c);return c};jb(z);function kb(a,b,c,d){if(this.eventPool.length){var e=this.eventPool.pop();this.call(e,a,b,c,d);return e}return new this(a,b,c,d)}function lb(a){a instanceof this?void 0:t("279");a.destructor();10>this.eventPool.length&&this.eventPool.push(a)}
|
22181 | function jb(a){a.eventPool=[];a.getPooled=kb;a.release=lb}var mb=z.extend({data:null}),nb=z.extend({data:null}),ob=[9,13,27,32],pb=Sa&&"CompositionEvent"in window,qb=null;Sa&&"documentMode"in document&&(qb=document.documentMode);
|
22182 | var rb=Sa&&"TextEvent"in window&&!qb,sb=Sa&&(!pb||qb&&8<qb&&11>=qb),tb=String.fromCharCode(32),ub={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",
|
22183 | captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},vb=!1;
|
22184 | function wb(a,b){switch(a){case "keyup":return-1!==ob.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return!0;default:return!1}}function xb(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var yb=!1;function zb(a,b){switch(a){case "compositionend":return xb(b);case "keypress":if(32!==b.which)return null;vb=!0;return tb;case "textInput":return a=b.data,a===tb&&vb?null:a;default:return null}}
|
22185 | function Ab(a,b){if(yb)return"compositionend"===a||!pb&&wb(a,b)?(a=gb(),fb=eb=cb=null,yb=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case "compositionend":return sb&&"ko"!==b.locale?null:b.data;default:return null}}
|
22186 | var Bb={eventTypes:ub,extractEvents:function(a,b,c,d){var e=void 0;var f=void 0;if(pb)b:{switch(a){case "compositionstart":e=ub.compositionStart;break b;case "compositionend":e=ub.compositionEnd;break b;case "compositionupdate":e=ub.compositionUpdate;break b}e=void 0}else yb?wb(a,c)&&(e=ub.compositionEnd):"keydown"===a&&229===c.keyCode&&(e=ub.compositionStart);e?(sb&&"ko"!==c.locale&&(yb||e!==ub.compositionStart?e===ub.compositionEnd&&yb&&(f=gb()):(cb=d,eb="value"in cb?cb.value:cb.textContent,yb=
|
22187 | !0)),e=mb.getPooled(e,b,c,d),f?e.data=f:(f=xb(c),null!==f&&(e.data=f)),Ra(e),f=e):f=null;(a=rb?zb(a,c):Ab(a,c))?(b=nb.getPooled(ub.beforeInput,b,c,d),b.data=a,Ra(b)):b=null;return null===f?b:null===b?f:[f,b]}},Cb=null,Db=null,Eb=null;function Hb(a){if(a=va(a)){"function"!==typeof Cb?t("280"):void 0;var b=ua(a.stateNode);Cb(a.stateNode,a.type,b)}}function Ib(a){Db?Eb?Eb.push(a):Eb=[a]:Db=a}function Jb(){if(Db){var a=Db,b=Eb;Eb=Db=null;Hb(a);if(b)for(a=0;a<b.length;a++)Hb(b[a])}}
|
22188 | function Kb(a,b){return a(b)}function Lb(a,b,c){return a(b,c)}function Mb(){}var Nb=!1;function Ob(a,b){if(Nb)return a(b);Nb=!0;try{return Kb(a,b)}finally{if(Nb=!1,null!==Db||null!==Eb)Mb(),Jb()}}var Pb={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Qb(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return"input"===b?!!Pb[a.type]:"textarea"===b?!0:!1}
|
22189 | function Rb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}function Sb(a){if(!Sa)return!1;a="on"+a;var b=a in document;b||(b=document.createElement("div"),b.setAttribute(a,"return;"),b="function"===typeof b[a]);return b}function Tb(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)}
|
22190 | function Ub(a){var b=Tb(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker=
|
22191 | null;delete a[b]}}}}function Vb(a){a._valueTracker||(a._valueTracker=Ub(a))}function Wb(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=Tb(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}
|
22192 | var Xb=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Yb=/^(.*)[\\\/]/,D="function"===typeof Symbol&&Symbol.for,Zb=D?Symbol.for("react.element"):60103,$b=D?Symbol.for("react.portal"):60106,ac=D?Symbol.for("react.fragment"):60107,bc=D?Symbol.for("react.strict_mode"):60108,cc=D?Symbol.for("react.profiler"):60114,dc=D?Symbol.for("react.provider"):60109,ec=D?Symbol.for("react.context"):60110,fc=D?Symbol.for("react.concurrent_mode"):60111,gc=D?Symbol.for("react.forward_ref"):60112,hc=D?Symbol.for("react.suspense"):
|
22193 | 60113,ic=D?Symbol.for("react.memo"):60115,jc=D?Symbol.for("react.lazy"):60116,kc="function"===typeof Symbol&&Symbol.iterator;function lc(a){if(null===a||"object"!==typeof a)return null;a=kc&&a[kc]||a["@@iterator"];return"function"===typeof a?a:null}
|
22194 | function mc(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case fc:return"ConcurrentMode";case ac:return"Fragment";case $b:return"Portal";case cc:return"Profiler";case bc:return"StrictMode";case hc:return"Suspense"}if("object"===typeof a)switch(a.$$typeof){case ec:return"Context.Consumer";case dc:return"Context.Provider";case gc:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+
|
22195 | ")":"ForwardRef");case ic:return mc(a.type);case jc:if(a=1===a._status?a._result:null)return mc(a)}return null}function nc(a){var b="";do{a:switch(a.tag){case 3:case 4:case 6:case 7:case 10:case 9:var c="";break a;default:var d=a._debugOwner,e=a._debugSource,f=mc(a.type);c=null;d&&(c=mc(d.type));d=f;f="";e?f=" (at "+e.fileName.replace(Yb,"")+":"+e.lineNumber+")":c&&(f=" (created by "+c+")");c="\n in "+(d||"Unknown")+f}b+=c;a=a.return}while(a);return b}
|
22196 | var oc=/^[: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][: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\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,pc=Object.prototype.hasOwnProperty,qc={},rc={};
|
22197 | function sc(a){if(pc.call(rc,a))return!0;if(pc.call(qc,a))return!1;if(oc.test(a))return rc[a]=!0;qc[a]=!0;return!1}function tc(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}}
|
22198 | function uc(a,b,c,d){if(null===b||"undefined"===typeof b||tc(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function E(a,b,c,d,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b}var F={};
|
22199 | "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){F[a]=new E(a,0,!1,a,null)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];F[b]=new E(b,1,!1,a[1],null)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){F[a]=new E(a,2,!1,a.toLowerCase(),null)});
|
22200 | ["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){F[a]=new E(a,2,!1,a,null)});"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){F[a]=new E(a,3,!1,a.toLowerCase(),null)});["checked","multiple","muted","selected"].forEach(function(a){F[a]=new E(a,3,!0,a,null)});
|
22201 | ["capture","download"].forEach(function(a){F[a]=new E(a,4,!1,a,null)});["cols","rows","size","span"].forEach(function(a){F[a]=new E(a,6,!1,a,null)});["rowSpan","start"].forEach(function(a){F[a]=new E(a,5,!1,a.toLowerCase(),null)});var vc=/[\-:]([a-z])/g;function wc(a){return a[1].toUpperCase()}
|
22202 | "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".split(" ").forEach(function(a){var b=a.replace(vc,
|
22203 | wc);F[b]=new E(b,1,!1,a,null)});"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(vc,wc);F[b]=new E(b,1,!1,a,"http://www.w3.org/1999/xlink")});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(vc,wc);F[b]=new E(b,1,!1,a,"http://www.w3.org/XML/1998/namespace")});F.tabIndex=new E("tabIndex",1,!1,"tabindex",null);
|
22204 | function xc(a,b,c,d){var e=F.hasOwnProperty(b)?F[b]:null;var f=null!==e?0===e.type:d?!1:!(2<b.length)||"o"!==b[0]&&"O"!==b[0]||"n"!==b[1]&&"N"!==b[1]?!1:!0;f||(uc(b,c,e,d)&&(c=null),d||null===e?sc(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,""+c)):e.mustUseProperty?a[e.propertyName]=null===c?3===e.type?!1:"":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(e=e.type,c=3===e||4===e&&!0===c?"":""+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c))))}
|
22205 | function yc(a){switch(typeof a){case "boolean":case "number":case "object":case "string":case "undefined":return a;default:return""}}function zc(a,b){var c=b.checked;return n({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}
|
22206 | function Ac(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=yc(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function Bc(a,b){b=b.checked;null!=b&&xc(a,"checked",b,!1)}
|
22207 | function Cc(a,b){Bc(a,b);var c=yc(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?Dc(a,b.type,c):b.hasOwnProperty("defaultValue")&&Dc(a,b.type,yc(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}
|
22208 | function Ec(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!a.defaultChecked;a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)}
|
22209 | function Dc(a,b,c){if("number"!==b||a.ownerDocument.activeElement!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}var Fc={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function Gc(a,b,c){a=z.getPooled(Fc.change,a,b,c);a.type="change";Ib(c);Ra(a);return a}var Jc=null,Kc=null;function Lc(a){Ea(a)}
|
22210 | function Mc(a){var b=Ka(a);if(Wb(b))return a}function Nc(a,b){if("change"===a)return b}var Oc=!1;Sa&&(Oc=Sb("input")&&(!document.documentMode||9<document.documentMode));function Pc(){Jc&&(Jc.detachEvent("onpropertychange",Qc),Kc=Jc=null)}function Qc(a){"value"===a.propertyName&&Mc(Kc)&&(a=Gc(Kc,a,Rb(a)),Ob(Lc,a))}function Rc(a,b,c){"focus"===a?(Pc(),Jc=b,Kc=c,Jc.attachEvent("onpropertychange",Qc)):"blur"===a&&Pc()}function Sc(a){if("selectionchange"===a||"keyup"===a||"keydown"===a)return Mc(Kc)}
|
22211 | function Tc(a,b){if("click"===a)return Mc(b)}function Uc(a,b){if("input"===a||"change"===a)return Mc(b)}
|
22212 | var Vc={eventTypes:Fc,_isInputEventSupported:Oc,extractEvents:function(a,b,c,d){var e=b?Ka(b):window,f=void 0,g=void 0,h=e.nodeName&&e.nodeName.toLowerCase();"select"===h||"input"===h&&"file"===e.type?f=Nc:Qb(e)?Oc?f=Uc:(f=Sc,g=Rc):(h=e.nodeName)&&"input"===h.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)&&(f=Tc);if(f&&(f=f(a,b)))return Gc(f,c,d);g&&g(a,e,b);"blur"===a&&(a=e._wrapperState)&&a.controlled&&"number"===e.type&&Dc(e,"number",e.value)}},Wc=z.extend({view:null,detail:null}),Xc={Alt:"altKey",
|
22213 | Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yc(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Xc[a])?!!b[a]:!1}function Zc(){return Yc}
|
22214 | var $c=0,ad=0,bd=!1,cd=!1,dd=Wc.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Zc,button:null,buttons:null,relatedTarget:function(a){return a.relatedTarget||(a.fromElement===a.srcElement?a.toElement:a.fromElement)},movementX:function(a){if("movementX"in a)return a.movementX;var b=$c;$c=a.screenX;return bd?"mousemove"===a.type?a.screenX-b:0:(bd=!0,0)},movementY:function(a){if("movementY"in a)return a.movementY;
|
22215 | var b=ad;ad=a.screenY;return cd?"mousemove"===a.type?a.screenY-b:0:(cd=!0,0)}}),ed=dd.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),fd={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",
|
22216 | dependencies:["pointerout","pointerover"]}},gd={eventTypes:fd,extractEvents:function(a,b,c,d){var e="mouseover"===a||"pointerover"===a,f="mouseout"===a||"pointerout"===a;if(e&&(c.relatedTarget||c.fromElement)||!f&&!e)return null;e=d.window===d?d:(e=d.ownerDocument)?e.defaultView||e.parentWindow:window;f?(f=b,b=(b=c.relatedTarget||c.toElement)?Ia(b):null):f=null;if(f===b)return null;var g=void 0,h=void 0,k=void 0,l=void 0;if("mouseout"===a||"mouseover"===a)g=dd,h=fd.mouseLeave,k=fd.mouseEnter,l="mouse";
|
22217 | else if("pointerout"===a||"pointerover"===a)g=ed,h=fd.pointerLeave,k=fd.pointerEnter,l="pointer";var m=null==f?e:Ka(f);e=null==b?e:Ka(b);a=g.getPooled(h,f,c,d);a.type=l+"leave";a.target=m;a.relatedTarget=e;c=g.getPooled(k,b,c,d);c.type=l+"enter";c.target=e;c.relatedTarget=m;d=b;if(f&&d)a:{b=f;e=d;l=0;for(g=b;g;g=Ma(g))l++;g=0;for(k=e;k;k=Ma(k))g++;for(;0<l-g;)b=Ma(b),l--;for(;0<g-l;)e=Ma(e),g--;for(;l--;){if(b===e||b===e.alternate)break a;b=Ma(b);e=Ma(e)}b=null}else b=null;e=b;for(b=[];f&&f!==e;){l=
|
22218 | f.alternate;if(null!==l&&l===e)break;b.push(f);f=Ma(f)}for(f=[];d&&d!==e;){l=d.alternate;if(null!==l&&l===e)break;f.push(d);d=Ma(d)}for(d=0;d<b.length;d++)Pa(b[d],"bubbled",a);for(d=f.length;0<d--;)Pa(f[d],"captured",c);return[a,c]}},hd=Object.prototype.hasOwnProperty;function id(a,b){return a===b?0!==a||0!==b||1/a===1/b:a!==a&&b!==b}
|
22219 | function jd(a,b){if(id(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++)if(!hd.call(b,c[d])||!id(a[c[d]],b[c[d]]))return!1;return!0}function kd(a){var b=a;if(a.alternate)for(;b.return;)b=b.return;else{if(0!==(b.effectTag&2))return 1;for(;b.return;)if(b=b.return,0!==(b.effectTag&2))return 1}return 3===b.tag?2:3}function ld(a){2!==kd(a)?t("188"):void 0}
|
22220 | function md(a){var b=a.alternate;if(!b)return b=kd(a),3===b?t("188"):void 0,1===b?null:a;for(var c=a,d=b;;){var e=c.return,f=e?e.alternate:null;if(!e||!f)break;if(e.child===f.child){for(var g=e.child;g;){if(g===c)return ld(e),a;if(g===d)return ld(e),b;g=g.sibling}t("188")}if(c.return!==d.return)c=e,d=f;else{g=!1;for(var h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===c){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}g?
|
22221 | void 0:t("189")}}c.alternate!==d?t("190"):void 0}3!==c.tag?t("188"):void 0;return c.stateNode.current===c?a:b}function nd(a){a=md(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child.return=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}}return null}
|
22222 | var od=z.extend({animationName:null,elapsedTime:null,pseudoElement:null}),pd=z.extend({clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),qd=Wc.extend({relatedTarget:null});function rd(a){var b=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}
|
22223 | var sd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},td={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",
|
22224 | 116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ud=Wc.extend({key:function(a){if(a.key){var b=sd[a.key]||a.key;if("Unidentified"!==b)return b}return"keypress"===a.type?(a=rd(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?td[a.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Zc,charCode:function(a){return"keypress"===
|
22225 | a.type?rd(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"===a.type?rd(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}}),vd=dd.extend({dataTransfer:null}),wd=Wc.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Zc}),xd=z.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),yd=dd.extend({deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in
|
22226 | a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:null,deltaMode:null}),zd=[["abort","abort"],[Ya,"animationEnd"],[Za,"animationIteration"],[$a,"animationStart"],["canplay","canPlay"],["canplaythrough","canPlayThrough"],["drag","drag"],["dragenter","dragEnter"],["dragexit","dragExit"],["dragleave","dragLeave"],["dragover","dragOver"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],
|
22227 | ["ended","ended"],["error","error"],["gotpointercapture","gotPointerCapture"],["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["loadstart","loadStart"],["lostpointercapture","lostPointerCapture"],["mousemove","mouseMove"],["mouseout","mouseOut"],["mouseover","mouseOver"],["playing","playing"],["pointermove","pointerMove"],["pointerout","pointerOut"],["pointerover","pointerOver"],["progress","progress"],["scroll","scroll"],["seeking","seeking"],["stalled","stalled"],
|
22228 | ["suspend","suspend"],["timeupdate","timeUpdate"],["toggle","toggle"],["touchmove","touchMove"],[ab,"transitionEnd"],["waiting","waiting"],["wheel","wheel"]],Ad={},Bd={};function Cd(a,b){var c=a[0];a=a[1];var d="on"+(a[0].toUpperCase()+a.slice(1));b={phasedRegistrationNames:{bubbled:d,captured:d+"Capture"},dependencies:[c],isInteractive:b};Ad[a]=b;Bd[c]=b}
|
22229 | [["blur","blur"],["cancel","cancel"],["click","click"],["close","close"],["contextmenu","contextMenu"],["copy","copy"],["cut","cut"],["auxclick","auxClick"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragstart","dragStart"],["drop","drop"],["focus","focus"],["input","input"],["invalid","invalid"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["mousedown","mouseDown"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["pointercancel","pointerCancel"],
|
22230 | ["pointerdown","pointerDown"],["pointerup","pointerUp"],["ratechange","rateChange"],["reset","reset"],["seeked","seeked"],["submit","submit"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchstart","touchStart"],["volumechange","volumeChange"]].forEach(function(a){Cd(a,!0)});zd.forEach(function(a){Cd(a,!1)});
|
22231 | var Dd={eventTypes:Ad,isInteractiveTopLevelEventType:function(a){a=Bd[a];return void 0!==a&&!0===a.isInteractive},extractEvents:function(a,b,c,d){var e=Bd[a];if(!e)return null;switch(a){case "keypress":if(0===rd(c))return null;case "keydown":case "keyup":a=ud;break;case "blur":case "focus":a=qd;break;case "click":if(2===c.button)return null;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":a=dd;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":a=
|
22232 | vd;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":a=wd;break;case Ya:case Za:case $a:a=od;break;case ab:a=xd;break;case "scroll":a=Wc;break;case "wheel":a=yd;break;case "copy":case "cut":case "paste":a=pd;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":a=ed;break;default:a=z}b=a.getPooled(e,b,c,d);Ra(b);return b}},Ed=Dd.isInteractiveTopLevelEventType,
|
22233 | Fd=[];function Gd(a){var b=a.targetInst,c=b;do{if(!c){a.ancestors.push(c);break}var d;for(d=c;d.return;)d=d.return;d=3!==d.tag?null:d.stateNode.containerInfo;if(!d)break;a.ancestors.push(c);c=Ia(d)}while(c);for(c=0;c<a.ancestors.length;c++){b=a.ancestors[c];var e=Rb(a.nativeEvent);d=a.topLevelType;for(var f=a.nativeEvent,g=null,h=0;h<pa.length;h++){var k=pa[h];k&&(k=k.extractEvents(d,b,f,e))&&(g=ya(g,k))}Ea(g)}}var Hd=!0;
|
22234 | function H(a,b){if(!b)return null;var c=(Ed(a)?Id:Jd).bind(null,a);b.addEventListener(a,c,!1)}function Kd(a,b){if(!b)return null;var c=(Ed(a)?Id:Jd).bind(null,a);b.addEventListener(a,c,!0)}function Id(a,b){Lb(Jd,a,b)}
|
22235 | function Jd(a,b){if(Hd){var c=Rb(b);c=Ia(c);null===c||"number"!==typeof c.tag||2===kd(c)||(c=null);if(Fd.length){var d=Fd.pop();d.topLevelType=a;d.nativeEvent=b;d.targetInst=c;a=d}else a={topLevelType:a,nativeEvent:b,targetInst:c,ancestors:[]};try{Ob(Gd,a)}finally{a.topLevelType=null,a.nativeEvent=null,a.targetInst=null,a.ancestors.length=0,10>Fd.length&&Fd.push(a)}}}var Ld={},Md=0,Nd="_reactListenersID"+(""+Math.random()).slice(2);
|
22236 | function Od(a){Object.prototype.hasOwnProperty.call(a,Nd)||(a[Nd]=Md++,Ld[a[Nd]]={});return Ld[a[Nd]]}function Pd(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function Qd(a){for(;a&&a.firstChild;)a=a.firstChild;return a}
|
22237 | function Rd(a,b){var c=Qd(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Qd(c)}}function Sd(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Sd(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}
|
22238 | function Td(){for(var a=window,b=Pd();b instanceof a.HTMLIFrameElement;){try{a=b.contentDocument.defaultView}catch(c){break}b=Pd(a.document)}return b}function Ud(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}
|
22239 | var Vd=Sa&&"documentMode"in document&&11>=document.documentMode,Wd={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Xd=null,Yd=null,Zd=null,$d=!1;
|
22240 | function ae(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if($d||null==Xd||Xd!==Pd(c))return null;c=Xd;"selectionStart"in c&&Ud(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return Zd&&jd(Zd,c)?null:(Zd=c,a=z.getPooled(Wd.select,Yd,a,b),a.type="select",a.target=Xd,Ra(a),a)}
|
22241 | var be={eventTypes:Wd,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Od(e);f=ta.onSelect;for(var g=0;g<f.length;g++){var h=f[g];if(!e.hasOwnProperty(h)||!e[h]){e=!1;break a}}e=!0}f=!e}if(f)return null;e=b?Ka(b):window;switch(a){case "focus":if(Qb(e)||"true"===e.contentEditable)Xd=e,Yd=b,Zd=null;break;case "blur":Zd=Yd=Xd=null;break;case "mousedown":$d=!0;break;case "contextmenu":case "mouseup":case "dragend":return $d=!1,ae(c,d);case "selectionchange":if(Vd)break;
|
22242 | case "keydown":case "keyup":return ae(c,d)}return null}};Ca.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" "));ua=La;va=Ja;wa=Ka;Ca.injectEventPluginsByName({SimpleEventPlugin:Dd,EnterLeaveEventPlugin:gd,ChangeEventPlugin:Vc,SelectEventPlugin:be,BeforeInputEventPlugin:Bb});function de(a){var b="";aa.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}
|
22243 | function ee(a,b){a=n({children:void 0},b);if(b=de(b.children))a.children=b;return a}function fe(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b["$"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty("$"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0)}else{c=""+yc(c);b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e])}null!==b&&(b.selected=!0)}}
|
22244 | function ge(a,b){null!=b.dangerouslySetInnerHTML?t("91"):void 0;return n({},b,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function he(a,b){var c=b.value;null==c&&(c=b.defaultValue,b=b.children,null!=b&&(null!=c?t("92"):void 0,Array.isArray(b)&&(1>=b.length?void 0:t("93"),b=b[0]),c=b),null==c&&(c=""));a._wrapperState={initialValue:yc(c)}}
|
22245 | function ie(a,b){var c=yc(b.value),d=yc(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function je(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b)}var ke={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};
|
22246 | function le(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function me(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?le(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}
|
22247 | var ne=void 0,oe=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==ke.svg||"innerHTML"in a)a.innerHTML=b;else{ne=ne||document.createElement("div");ne.innerHTML="<svg>"+b+"</svg>";for(b=ne.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});
|
22248 | function pe(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}
|
22249 | var qe={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,
|
22250 | floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},re=["Webkit","ms","Moz","O"];Object.keys(qe).forEach(function(a){re.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);qe[b]=qe[a]})});function se(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||qe.hasOwnProperty(a)&&qe[a]?(""+b).trim():b+"px"}
|
22251 | function te(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=se(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var ue=n({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});
|
22252 | function ve(a,b){b&&(ue[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?t("137",a,""):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?t("60"):void 0,"object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML?void 0:t("61")),null!=b.style&&"object"!==typeof b.style?t("62",""):void 0)}
|
22253 | function we(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}}
|
22254 | function xe(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Od(a);b=ta[b];for(var d=0;d<b.length;d++){var e=b[d];if(!c.hasOwnProperty(e)||!c[e]){switch(e){case "scroll":Kd("scroll",a);break;case "focus":case "blur":Kd("focus",a);Kd("blur",a);c.blur=!0;c.focus=!0;break;case "cancel":case "close":Sb(e)&&Kd(e,a);break;case "invalid":case "submit":case "reset":break;default:-1===bb.indexOf(e)&&H(e,a)}c[e]=!0}}}function ye(){}var ze=null,Ae=null;
|
22255 | function Be(a,b){switch(a){case "button":case "input":case "select":case "textarea":return!!b.autoFocus}return!1}function Ce(a,b){return"textarea"===a||"option"===a||"noscript"===a||"string"===typeof b.children||"number"===typeof b.children||"object"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}var De="function"===typeof setTimeout?setTimeout:void 0,Ee="function"===typeof clearTimeout?clearTimeout:void 0;
|
22256 | function Fe(a,b,c,d,e){a[Ha]=e;"input"===c&&"radio"===e.type&&null!=e.name&&Bc(a,e);we(c,d);d=we(c,e);for(var f=0;f<b.length;f+=2){var g=b[f],h=b[f+1];"style"===g?te(a,h):"dangerouslySetInnerHTML"===g?oe(a,h):"children"===g?pe(a,h):xc(a,g,h,d)}switch(c){case "input":Cc(a,e);break;case "textarea":ie(a,e);break;case "select":b=a._wrapperState.wasMultiple,a._wrapperState.wasMultiple=!!e.multiple,c=e.value,null!=c?fe(a,!!e.multiple,c,!1):b!==!!e.multiple&&(null!=e.defaultValue?fe(a,!!e.multiple,e.defaultValue,
|
22257 | !0):fe(a,!!e.multiple,e.multiple?[]:"",!1))}}function Ge(a){for(a=a.nextSibling;a&&1!==a.nodeType&&3!==a.nodeType;)a=a.nextSibling;return a}function He(a){for(a=a.firstChild;a&&1!==a.nodeType&&3!==a.nodeType;)a=a.nextSibling;return a}new Set;var Ie=[],Je=-1;function I(a){0>Je||(a.current=Ie[Je],Ie[Je]=null,Je--)}function J(a,b){Je++;Ie[Je]=a.current;a.current=b}var Ke={},K={current:Ke},L={current:!1},Le=Ke;
|
22258 | function Me(a,b){var c=a.type.contextTypes;if(!c)return Ke;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function M(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Ne(a){I(L,a);I(K,a)}function Oe(a){I(L,a);I(K,a)}
|
22259 | function Pe(a,b,c){K.current!==Ke?t("168"):void 0;J(K,b,a);J(L,c,a)}function Qe(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)e in a?void 0:t("108",mc(b)||"Unknown",e);return n({},c,d)}function Re(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||Ke;Le=K.current;J(K,b,a);J(L,L.current,a);return!0}
|
22260 | function Se(a,b,c){var d=a.stateNode;d?void 0:t("169");c?(b=Qe(a,b,Le),d.__reactInternalMemoizedMergedChildContext=b,I(L,a),I(K,a),J(K,b,a)):I(L,a);J(L,c,a)}var Te=null,Ue=null;function Ve(a){return function(b){try{return a(b)}catch(c){}}}
|
22261 | function We(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);Te=Ve(function(a){return b.onCommitFiberRoot(c,a)});Ue=Ve(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0}
|
22262 | function Xe(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.firstContextDependency=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null}function N(a,b,c,d){return new Xe(a,b,c,d)}
|
22263 | function Ye(a){a=a.prototype;return!(!a||!a.isReactComponent)}function Ze(a){if("function"===typeof a)return Ye(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===gc)return 11;if(a===ic)return 14}return 2}
|
22264 | function $e(a,b){var c=a.alternate;null===c?(c=N(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;c.firstContextDependency=a.firstContextDependency;c.sibling=a.sibling;
|
22265 | c.index=a.index;c.ref=a.ref;return c}
|
22266 | function af(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)Ye(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case ac:return bf(c.children,e,f,b);case fc:return cf(c,e|3,f,b);case bc:return cf(c,e|2,f,b);case cc:return a=N(12,c,b,e|4),a.elementType=cc,a.type=cc,a.expirationTime=f,a;case hc:return a=N(13,c,b,e),a.elementType=hc,a.type=hc,a.expirationTime=f,a;default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case dc:g=10;break a;case ec:g=9;break a;case gc:g=11;break a;case ic:g=
|
22267 | 14;break a;case jc:g=16;d=null;break a}t("130",null==a?a:typeof a,"")}b=N(g,c,b,e);b.elementType=a;b.type=d;b.expirationTime=f;return b}function bf(a,b,c,d){a=N(7,a,d,b);a.expirationTime=c;return a}function cf(a,b,c,d){a=N(8,a,d,b);b=0===(b&1)?bc:fc;a.elementType=b;a.type=b;a.expirationTime=c;return a}function df(a,b,c){a=N(6,a,null,b);a.expirationTime=c;return a}
|
22268 | function ef(a,b,c){b=N(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}function ff(a,b){a.didError=!1;var c=a.earliestPendingTime;0===c?a.earliestPendingTime=a.latestPendingTime=b:c<b?a.earliestPendingTime=b:a.latestPendingTime>b&&(a.latestPendingTime=b);gf(b,a)}
|
22269 | function hf(a,b){a.didError=!1;a.latestPingedTime>=b&&(a.latestPingedTime=0);var c=a.earliestPendingTime,d=a.latestPendingTime;c===b?a.earliestPendingTime=d===b?a.latestPendingTime=0:d:d===b&&(a.latestPendingTime=c);c=a.earliestSuspendedTime;d=a.latestSuspendedTime;0===c?a.earliestSuspendedTime=a.latestSuspendedTime=b:c<b?a.earliestSuspendedTime=b:d>b&&(a.latestSuspendedTime=b);gf(b,a)}function jf(a,b){var c=a.earliestPendingTime;a=a.earliestSuspendedTime;c>b&&(b=c);a>b&&(b=a);return b}
|
22270 | function gf(a,b){var c=b.earliestSuspendedTime,d=b.latestSuspendedTime,e=b.earliestPendingTime,f=b.latestPingedTime;e=0!==e?e:f;0===e&&(0===a||d<a)&&(e=d);a=e;0!==a&&c>a&&(a=c);b.nextExpirationTimeToWorkOn=e;b.expirationTime=a}var kf=!1;function lf(a){return{baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}
|
22271 | function mf(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function nf(a){return{expirationTime:a,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function of(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b)}
|
22272 | function pf(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=lf(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=lf(a.memoizedState),e=c.updateQueue=lf(c.memoizedState)):d=a.updateQueue=mf(e):null===e&&(e=c.updateQueue=mf(d));null===e||d===e?of(d,b):null===d.lastUpdate||null===e.lastUpdate?(of(d,b),of(e,b)):(of(d,b),e.lastUpdate=b)}
|
22273 | function qf(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=lf(a.memoizedState):rf(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function rf(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=mf(b));return b}
|
22274 | function sf(a,b,c,d,e,f){switch(c.tag){case 1:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case 3:a.effectTag=a.effectTag&-2049|64;case 0:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return n({},d,e);case 2:kf=!0}return d}
|
22275 | function tf(a,b,c,d,e){kf=!1;b=rf(a,b);for(var f=b.baseState,g=null,h=0,k=b.firstUpdate,l=f;null!==k;){var m=k.expirationTime;m<e?(null===g&&(g=k,f=l),h<m&&(h=m)):(l=sf(a,b,k,l,c,d),null!==k.callback&&(a.effectTag|=32,k.nextEffect=null,null===b.lastEffect?b.firstEffect=b.lastEffect=k:(b.lastEffect.nextEffect=k,b.lastEffect=k)));k=k.next}m=null;for(k=b.firstCapturedUpdate;null!==k;){var r=k.expirationTime;r<e?(null===m&&(m=k,null===g&&(f=l)),h<r&&(h=r)):(l=sf(a,b,k,l,c,d),null!==k.callback&&(a.effectTag|=
|
22276 | 32,k.nextEffect=null,null===b.lastCapturedEffect?b.firstCapturedEffect=b.lastCapturedEffect=k:(b.lastCapturedEffect.nextEffect=k,b.lastCapturedEffect=k)));k=k.next}null===g&&(b.lastUpdate=null);null===m?b.lastCapturedUpdate=null:a.effectTag|=32;null===g&&null===m&&(f=l);b.baseState=f;b.firstUpdate=g;b.firstCapturedUpdate=m;a.expirationTime=h;a.memoizedState=l}
|
22277 | function uf(a,b,c){null!==b.firstCapturedUpdate&&(null!==b.lastUpdate&&(b.lastUpdate.next=b.firstCapturedUpdate,b.lastUpdate=b.lastCapturedUpdate),b.firstCapturedUpdate=b.lastCapturedUpdate=null);vf(b.firstEffect,c);b.firstEffect=b.lastEffect=null;vf(b.firstCapturedEffect,c);b.firstCapturedEffect=b.lastCapturedEffect=null}function vf(a,b){for(;null!==a;){var c=a.callback;if(null!==c){a.callback=null;var d=b;"function"!==typeof c?t("191",c):void 0;c.call(d)}a=a.nextEffect}}
|
22278 | function wf(a,b){return{value:a,source:b,stack:nc(b)}}var xf={current:null},yf=null,zf=null,Af=null;function Bf(a,b){var c=a.type._context;J(xf,c._currentValue,a);c._currentValue=b}function Cf(a){var b=xf.current;I(xf,a);a.type._context._currentValue=b}function Df(a){yf=a;Af=zf=null;a.firstContextDependency=null}
|
22279 | function Ef(a,b){if(Af!==a&&!1!==b&&0!==b){if("number"!==typeof b||1073741823===b)Af=a,b=1073741823;b={context:a,observedBits:b,next:null};null===zf?(null===yf?t("293"):void 0,yf.firstContextDependency=zf=b):zf=zf.next=b}return a._currentValue}var Ff={},O={current:Ff},Gf={current:Ff},Hf={current:Ff};function If(a){a===Ff?t("174"):void 0;return a}
|
22280 | function Jf(a,b){J(Hf,b,a);J(Gf,a,a);J(O,Ff,a);var c=b.nodeType;switch(c){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:me(null,"");break;default:c=8===c?b.parentNode:b,b=c.namespaceURI||null,c=c.tagName,b=me(b,c)}I(O,a);J(O,b,a)}function Kf(a){I(O,a);I(Gf,a);I(Hf,a)}function Lf(a){If(Hf.current);var b=If(O.current);var c=me(b,a.type);b!==c&&(J(Gf,a,a),J(O,c,a))}function Mf(a){Gf.current===a&&(I(O,a),I(Gf,a))}
|
22281 | function P(a,b){if(a&&a.defaultProps){b=n({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c])}return b}function Nf(a){var b=a._result;switch(a._status){case 1:return b;case 2:throw b;case 0:throw b;default:throw a._status=0,b=a._ctor,b=b(),b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)}),a._result=b,b;}}var Of=Xb.ReactCurrentOwner,Pf=(new aa.Component).refs;
|
22282 | function Qf(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:n({},b,c);a.memoizedState=c;d=a.updateQueue;null!==d&&0===a.expirationTime&&(d.baseState=c)}
|
22283 | var Vf={isMounted:function(a){return(a=a._reactInternalFiber)?2===kd(a):!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=Rf();d=Sf(d,a);var e=nf(d);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);Tf();pf(a,e);Uf(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=Rf();d=Sf(d,a);var e=nf(d);e.tag=1;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);Tf();pf(a,e);Uf(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=Rf();c=Sf(c,a);var d=nf(c);d.tag=
|
22284 | 2;void 0!==b&&null!==b&&(d.callback=b);Tf();pf(a,d);Uf(a,c)}};function Wf(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!jd(c,d)||!jd(e,f):!0}
|
22285 | function Xf(a,b,c){var d=!1,e=Ke;var f=b.contextType;"object"===typeof f&&null!==f?f=Of.currentDispatcher.readContext(f):(e=M(b)?Le:K.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Me(a,e):Ke);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=Vf;a.stateNode=b;b._reactInternalFiber=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b}
|
22286 | function Zf(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&Vf.enqueueReplaceState(b,b.state,null)}
|
22287 | function $f(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=Pf;var f=b.contextType;"object"===typeof f&&null!==f?e.context=Of.currentDispatcher.readContext(f):(f=M(b)?Le:K.current,e.context=Me(a,f));f=a.updateQueue;null!==f&&(tf(a,f,c,e,d),e.state=a.memoizedState);f=b.getDerivedStateFromProps;"function"===typeof f&&(Qf(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!==typeof e.UNSAFE_componentWillMount&&
|
22288 | "function"!==typeof e.componentWillMount||(b=e.state,"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&Vf.enqueueReplaceState(e,e.state,null),f=a.updateQueue,null!==f&&(tf(a,f,c,e,d),e.state=a.memoizedState));"function"===typeof e.componentDidMount&&(a.effectTag|=4)}var ag=Array.isArray;
|
22289 | function bg(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;var d=void 0;c&&(1!==c.tag?t("289"):void 0,d=c.stateNode);d?void 0:t("147",a);var e=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===Pf&&(b=d.refs={});null===a?delete b[e]:b[e]=a};b._stringRef=e;return b}"string"!==typeof a?t("284"):void 0;c._owner?void 0:t("290",a)}return a}
|
22290 | function cg(a,b){"textarea"!==a.type&&t("31","[object Object]"===Object.prototype.toString.call(b)?"object with keys {"+Object.keys(b).join(", ")+"}":b,"")}
|
22291 | function dg(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.effectTag=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b,c){a=$e(a,b,c);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.effectTag=
|
22292 | 2,c):d;b.effectTag=2;return c}function g(b){a&&null===b.alternate&&(b.effectTag=2);return b}function h(a,b,c,d){if(null===b||6!==b.tag)return b=df(c,a.mode,d),b.return=a,b;b=e(b,c,d);b.return=a;return b}function k(a,b,c,d){if(null!==b&&b.elementType===c.type)return d=e(b,c.props,d),d.ref=bg(a,b,c),d.return=a,d;d=af(c.type,c.key,c.props,null,a.mode,d);d.ref=bg(a,b,c);d.return=a;return d}function l(a,b,c,d){if(null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==
|
22293 | c.implementation)return b=ef(c,a.mode,d),b.return=a,b;b=e(b,c.children||[],d);b.return=a;return b}function m(a,b,c,d,g){if(null===b||7!==b.tag)return b=bf(c,a.mode,d,g),b.return=a,b;b=e(b,c,d);b.return=a;return b}function r(a,b,c){if("string"===typeof b||"number"===typeof b)return b=df(""+b,a.mode,c),b.return=a,b;if("object"===typeof b&&null!==b){switch(b.$$typeof){case Zb:return c=af(b.type,b.key,b.props,null,a.mode,c),c.ref=bg(a,null,b),c.return=a,c;case $b:return b=ef(b,a.mode,c),b.return=a,b}if(ag(b)||
|
22294 | lc(b))return b=bf(b,a.mode,c,null),b.return=a,b;cg(a,b)}return null}function w(a,b,c,d){var e=null!==b?b.key:null;if("string"===typeof c||"number"===typeof c)return null!==e?null:h(a,b,""+c,d);if("object"===typeof c&&null!==c){switch(c.$$typeof){case Zb:return c.key===e?c.type===ac?m(a,b,c.props.children,d,e):k(a,b,c,d):null;case $b:return c.key===e?l(a,b,c,d):null}if(ag(c)||lc(c))return null!==e?null:m(a,b,c,d,null);cg(a,c)}return null}function y(a,b,c,d,e){if("string"===typeof d||"number"===typeof d)return a=
|
22295 | a.get(c)||null,h(b,a,""+d,e);if("object"===typeof d&&null!==d){switch(d.$$typeof){case Zb:return a=a.get(null===d.key?c:d.key)||null,d.type===ac?m(b,a,d.props.children,e,d.key):k(b,a,d,e);case $b:return a=a.get(null===d.key?c:d.key)||null,l(b,a,d,e)}if(ag(d)||lc(d))return a=a.get(c)||null,m(b,a,d,e,null);cg(b,d)}return null}function B(e,g,h,k){for(var l=null,q=null,m=g,u=g=0,p=null;null!==m&&u<h.length;u++){m.index>u?(p=m,m=null):p=m.sibling;var v=w(e,m,h[u],k);if(null===v){null===m&&(m=p);break}a&&
|
22296 | m&&null===v.alternate&&b(e,m);g=f(v,g,u);null===q?l=v:q.sibling=v;q=v;m=p}if(u===h.length)return c(e,m),l;if(null===m){for(;u<h.length;u++)if(m=r(e,h[u],k))g=f(m,g,u),null===q?l=m:q.sibling=m,q=m;return l}for(m=d(e,m);u<h.length;u++)if(p=y(m,e,u,h[u],k))a&&null!==p.alternate&&m.delete(null===p.key?u:p.key),g=f(p,g,u),null===q?l=p:q.sibling=p,q=p;a&&m.forEach(function(a){return b(e,a)});return l}function R(e,g,h,k){var l=lc(h);"function"!==typeof l?t("150"):void 0;h=l.call(h);null==h?t("151"):void 0;
|
22297 | for(var m=l=null,q=g,u=g=0,p=null,v=h.next();null!==q&&!v.done;u++,v=h.next()){q.index>u?(p=q,q=null):p=q.sibling;var A=w(e,q,v.value,k);if(null===A){q||(q=p);break}a&&q&&null===A.alternate&&b(e,q);g=f(A,g,u);null===m?l=A:m.sibling=A;m=A;q=p}if(v.done)return c(e,q),l;if(null===q){for(;!v.done;u++,v=h.next())v=r(e,v.value,k),null!==v&&(g=f(v,g,u),null===m?l=v:m.sibling=v,m=v);return l}for(q=d(e,q);!v.done;u++,v=h.next())v=y(q,e,u,v.value,k),null!==v&&(a&&null!==v.alternate&&q.delete(null===v.key?u:
|
22298 | v.key),g=f(v,g,u),null===m?l=v:m.sibling=v,m=v);a&&q.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===ac&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Zb:a:{l=f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===ac:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===ac?f.props.children:f.props,h);d.ref=bg(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a,k);k=
|
22299 | k.sibling}f.type===ac?(d=bf(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=af(f.type,f.key,f.props,null,a.mode,h),h.ref=bg(a,d,f),h.return=a,a=h)}return g(a);case $b:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=ef(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===typeof f||"number"===typeof f)return f=
|
22300 | ""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=df(f,a.mode,h),d.return=a,a=d),g(a);if(ag(f))return B(a,d,f,h);if(lc(f))return R(a,d,f,h);l&&cg(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:h=a.type,t("152",h.displayName||h.name||"Component")}return c(a,d)}}var eg=dg(!0),fg=dg(!1),gg=null,hg=null,ig=!1;
|
22301 | function jg(a,b){var c=N(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function kg(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;default:return!1}}
|
22302 | function lg(a){if(ig){var b=hg;if(b){var c=b;if(!kg(a,b)){b=Ge(c);if(!b||!kg(a,b)){a.effectTag|=2;ig=!1;gg=a;return}jg(gg,c)}gg=a;hg=He(b)}else a.effectTag|=2,ig=!1,gg=a}}function mg(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag;)a=a.return;gg=a}function ng(a){if(a!==gg)return!1;if(!ig)return mg(a),ig=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!Ce(b,a.memoizedProps))for(b=hg;b;)jg(a,b),b=Ge(b);mg(a);hg=gg?Ge(a.stateNode):null;return!0}function og(){hg=gg=null;ig=!1}var pg=Xb.ReactCurrentOwner;
|
22303 | function Q(a,b,c,d){b.child=null===a?fg(b,null,c,d):eg(b,a.child,c,d)}function qg(a,b,c,d,e){c=c.render;var f=b.ref;Df(b,e);d=c(d,f);b.effectTag|=1;Q(a,b,d,e);return b.child}
|
22304 | function rg(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!Ye(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,sg(a,b,g,d,e,f);a=af(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e<f&&(e=g.memoizedProps,c=c.compare,c=null!==c?c:jd,c(e,d)&&a.ref===b.ref))return tg(a,b,f);b.effectTag|=1;a=$e(g,d,f);a.ref=b.ref;a.return=b;return b.child=a}
|
22305 | function sg(a,b,c,d,e,f){return null!==a&&e<f&&jd(a.memoizedProps,d)&&a.ref===b.ref?tg(a,b,f):ug(a,b,c,d,f)}function vg(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.effectTag|=128}function ug(a,b,c,d,e){var f=M(c)?Le:K.current;f=Me(b,f);Df(b,e);c=c(d,f);b.effectTag|=1;Q(a,b,c,e);return b.child}
|
22306 | function wg(a,b,c,d,e){if(M(c)){var f=!0;Re(b)}else f=!1;Df(b,e);if(null===b.stateNode)null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),Xf(b,c,d,e),$f(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;"object"===typeof l&&null!==l?l=Of.currentDispatcher.readContext(l):(l=M(c)?Le:K.current,l=Me(b,l));var m=c.getDerivedStateFromProps,r="function"===typeof m||"function"===typeof g.getSnapshotBeforeUpdate;r||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&
|
22307 | "function"!==typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Zf(b,g,d,l);kf=!1;var w=b.memoizedState;k=g.state=w;var y=b.updateQueue;null!==y&&(tf(b,y,d,g,e),k=b.memoizedState);h!==d||w!==k||L.current||kf?("function"===typeof m&&(Qf(b,c,m,d),k=b.memoizedState),(h=kf||Wf(b,c,h,d,w,k,l))?(r||"function"!==typeof g.UNSAFE_componentWillMount&&"function"!==typeof g.componentWillMount||("function"===typeof g.componentWillMount&&g.componentWillMount(),"function"===typeof g.UNSAFE_componentWillMount&&
|
22308 | g.UNSAFE_componentWillMount()),"function"===typeof g.componentDidMount&&(b.effectTag|=4)):("function"===typeof g.componentDidMount&&(b.effectTag|=4),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):("function"===typeof g.componentDidMount&&(b.effectTag|=4),d=!1)}else g=b.stateNode,h=b.memoizedProps,g.props=b.type===b.elementType?h:P(b.type,h),k=g.context,l=c.contextType,"object"===typeof l&&null!==l?l=Of.currentDispatcher.readContext(l):(l=M(c)?Le:K.current,l=Me(b,l)),m=c.getDerivedStateFromProps,
|
22309 | (r="function"===typeof m||"function"===typeof g.getSnapshotBeforeUpdate)||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Zf(b,g,d,l),kf=!1,k=b.memoizedState,w=g.state=k,y=b.updateQueue,null!==y&&(tf(b,y,d,g,e),w=b.memoizedState),h!==d||k!==w||L.current||kf?("function"===typeof m&&(Qf(b,c,m,d),w=b.memoizedState),(m=kf||Wf(b,c,h,d,k,w,l))?(r||"function"!==typeof g.UNSAFE_componentWillUpdate&&"function"!==typeof g.componentWillUpdate||
|
22310 | ("function"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,w,l),"function"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,w,l)),"function"===typeof g.componentDidUpdate&&(b.effectTag|=4),"function"===typeof g.getSnapshotBeforeUpdate&&(b.effectTag|=256)):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=256),b.memoizedProps=
|
22311 | d,b.memoizedState=w),g.props=d,g.state=w,g.context=l,d=m):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=256),d=!1);return xg(a,b,c,d,f,e)}
|
22312 | function xg(a,b,c,d,e,f){vg(a,b);var g=0!==(b.effectTag&64);if(!d&&!g)return e&&Se(b,c,!1),tg(a,b,f);d=b.stateNode;pg.current=b;var h=g&&"function"!==typeof c.getDerivedStateFromError?null:d.render();b.effectTag|=1;null!==a&&g?(b.child=eg(b,a.child,null,f),b.child=eg(b,null,h,f)):Q(a,b,h,f);b.memoizedState=d.state;e&&Se(b,c,!0);return b.child}function yg(a){var b=a.stateNode;b.pendingContext?Pe(a,b.pendingContext,b.pendingContext!==b.context):b.context&&Pe(a,b.context,!1);Jf(a,b.containerInfo)}
|
22313 | function zg(a,b,c){var d=b.mode,e=b.pendingProps,f=b.memoizedState;if(0===(b.effectTag&64)){f=null;var g=!1}else f={timedOutAt:null!==f?f.timedOutAt:0},g=!0,b.effectTag&=-65;if(null===a)if(g){var h=e.fallback;a=bf(null,d,0,null);0===(b.mode&1)&&(a.child=null!==b.memoizedState?b.child.child:b.child);d=bf(h,d,c,null);a.sibling=d;c=a;c.return=d.return=b}else c=d=fg(b,null,e.children,c);else null!==a.memoizedState?(d=a.child,h=d.sibling,g?(c=e.fallback,e=$e(d,d.pendingProps,0),0===(b.mode&1)&&(g=null!==
|
22314 | b.memoizedState?b.child.child:b.child,g!==d.child&&(e.child=g)),d=e.sibling=$e(h,c,h.expirationTime),c=e,e.childExpirationTime=0,c.return=d.return=b):c=d=eg(b,d.child,e.children,c)):(h=a.child,g?(g=e.fallback,e=bf(null,d,0,null),e.child=h,0===(b.mode&1)&&(e.child=null!==b.memoizedState?b.child.child:b.child),d=e.sibling=bf(g,d,c,null),d.effectTag|=2,c=e,e.childExpirationTime=0,c.return=d.return=b):d=c=eg(b,h,e.children,c)),b.stateNode=a.stateNode;b.memoizedState=f;b.child=c;return d}
|
22315 | function tg(a,b,c){null!==a&&(b.firstContextDependency=a.firstContextDependency);if(b.childExpirationTime<c)return null;null!==a&&b.child!==a.child?t("153"):void 0;if(null!==b.child){a=b.child;c=$e(a,a.pendingProps,a.expirationTime);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=$e(a,a.pendingProps,a.expirationTime),c.return=b;c.sibling=null}return b.child}
|
22316 | function Ag(a,b,c){var d=b.expirationTime;if(null!==a&&a.memoizedProps===b.pendingProps&&!L.current&&d<c){switch(b.tag){case 3:yg(b);og();break;case 5:Lf(b);break;case 1:M(b.type)&&Re(b);break;case 4:Jf(b,b.stateNode.containerInfo);break;case 10:Bf(b,b.memoizedProps.value);break;case 13:if(null!==b.memoizedState){d=b.child.childExpirationTime;if(0!==d&&d>=c)return zg(a,b,c);b=tg(a,b,c);return null!==b?b.sibling:null}}return tg(a,b,c)}b.expirationTime=0;switch(b.tag){case 2:d=b.elementType;null!==
|
22317 | a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;var e=Me(b,K.current);Df(b,c);e=d(a,e);b.effectTag|=1;if("object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;if(M(d)){var f=!0;Re(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"===typeof g&&Qf(b,d,g,a);e.updater=Vf;b.stateNode=e;e._reactInternalFiber=b;$f(b,d,a,c);b=xg(null,b,d,!0,f,c)}else b.tag=0,Q(null,b,e,c),b=b.child;
|
22318 | return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);f=b.pendingProps;a=Nf(e);b.type=a;e=b.tag=Ze(a);f=P(a,f);g=void 0;switch(e){case 0:g=ug(null,b,a,f,c);break;case 1:g=wg(null,b,a,f,c);break;case 11:g=qg(null,b,a,f,c);break;case 14:g=rg(null,b,a,P(a.type,f),d,c);break;default:t("306",a,"")}return g;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:P(d,e),ug(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:P(d,e),wg(a,b,
|
22319 | d,e,c);case 3:yg(b);d=b.updateQueue;null===d?t("282"):void 0;e=b.memoizedState;e=null!==e?e.element:null;tf(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)og(),b=tg(a,b,c);else{e=b.stateNode;if(e=(null===a||null===a.child)&&e.hydrate)hg=He(b.stateNode.containerInfo),gg=b,e=ig=!0;e?(b.effectTag|=2,b.child=fg(b,null,d,c)):(Q(a,b,d,c),og());b=b.child}return b;case 5:return Lf(b),null===a&&lg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ce(d,e)?g=null:null!==
|
22320 | f&&Ce(d,f)&&(b.effectTag|=16),vg(a,b),1!==c&&b.mode&1&&e.hidden?(b.expirationTime=1,b=null):(Q(a,b,g,c),b=b.child),b;case 6:return null===a&&lg(b),null;case 13:return zg(a,b,c);case 4:return Jf(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=eg(b,null,d,c):Q(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:P(d,e),qg(a,b,d,e,c);case 7:return Q(a,b,b.pendingProps,c),b.child;case 8:return Q(a,b,b.pendingProps.children,c),b.child;case 12:return Q(a,b,b.pendingProps.children,
|
22321 | c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;Bf(b,f);if(null!==g){var h=g.value;f=h===f&&(0!==h||1/h===1/f)||h!==h&&f!==f?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0;if(0===f){if(g.children===e.children&&!L.current){b=tg(a,b,c);break a}}else for(g=b.child,null!==g&&(g.return=b);null!==g;){h=g.firstContextDependency;if(null!==h){do{if(h.context===d&&0!==(h.observedBits&f)){if(1===g.tag){var k=nf(c);k.tag=2;pf(g,k)}g.expirationTime<
|
22322 | c&&(g.expirationTime=c);k=g.alternate;null!==k&&k.expirationTime<c&&(k.expirationTime=c);for(var l=g.return;null!==l;){k=l.alternate;if(l.childExpirationTime<c)l.childExpirationTime=c,null!==k&&k.childExpirationTime<c&&(k.childExpirationTime=c);else if(null!==k&&k.childExpirationTime<c)k.childExpirationTime=c;else break;l=l.return}}k=g.child;h=h.next}while(null!==h)}else k=10===g.tag?g.type===b.type?null:g.child:g.child;if(null!==k)k.return=g;else for(k=g;null!==k;){if(k===b){k=null;break}g=k.sibling;
|
22323 | if(null!==g){g.return=k.return;k=g;break}k=k.return}g=k}}Q(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,f=b.pendingProps,d=f.children,Df(b,c),e=Ef(e,f.unstable_observedBits),d=d(e),b.effectTag|=1,Q(a,b,d,c),b.child;case 14:return e=b.type,f=P(e,b.pendingProps),f=P(e.type,f),rg(a,b,e,f,d,c);case 15:return sg(a,b,b.type,b.pendingProps,d,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:P(d,e),null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),b.tag=1,M(d)?(a=
|
22324 | !0,Re(b)):a=!1,Df(b,c),Xf(b,d,e,c),$f(b,d,e,c),xg(null,b,d,!0,a,c);default:t("156")}}function Bg(a){a.effectTag|=4}var Cg=void 0,Gg=void 0,Hg=void 0,Ig=void 0;Cg=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};Gg=function(){};
|
22325 | Hg=function(a,b,c,d,e){var f=a.memoizedProps;if(f!==d){var g=b.stateNode;If(O.current);a=null;switch(c){case "input":f=zc(g,f);d=zc(g,d);a=[];break;case "option":f=ee(g,f);d=ee(g,d);a=[];break;case "select":f=n({},f,{value:void 0});d=n({},d,{value:void 0});a=[];break;case "textarea":f=ge(g,f);d=ge(g,d);a=[];break;default:"function"!==typeof f.onClick&&"function"===typeof d.onClick&&(g.onclick=ye)}ve(c,d);g=c=void 0;var h=null;for(c in f)if(!d.hasOwnProperty(c)&&f.hasOwnProperty(c)&&null!=f[c])if("style"===
|
22326 | c){var k=f[c];for(g in k)k.hasOwnProperty(g)&&(h||(h={}),h[g]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(sa.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in d){var l=d[c];k=null!=f?f[c]:void 0;if(d.hasOwnProperty(c)&&l!==k&&(null!=l||null!=k))if("style"===c)if(k){for(g in k)!k.hasOwnProperty(g)||l&&l.hasOwnProperty(g)||(h||(h={}),h[g]="");for(g in l)l.hasOwnProperty(g)&&k[g]!==l[g]&&(h||
|
22327 | (h={}),h[g]=l[g])}else h||(a||(a=[]),a.push(c,h)),h=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,k=k?k.__html:void 0,null!=l&&k!==l&&(a=a||[]).push(c,""+l)):"children"===c?k===l||"string"!==typeof l&&"number"!==typeof l||(a=a||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(sa.hasOwnProperty(c)?(null!=l&&xe(e,c),a||k===l||(a=[])):(a=a||[]).push(c,l))}h&&(a=a||[]).push("style",h);e=a;(b.updateQueue=e)&&Bg(b)}};Ig=function(a,b,c,d){c!==d&&Bg(b)};
|
22328 | var Jg="function"===typeof WeakSet?WeakSet:Set;function Kg(a,b){var c=b.source,d=b.stack;null===d&&null!==c&&(d=nc(c));null!==c&&mc(c.type);b=b.value;null!==a&&1===a.tag&&mc(a.type);try{console.error(b)}catch(e){setTimeout(function(){throw e;})}}function Lg(a){var b=a.ref;if(null!==b)if("function"===typeof b)try{b(null)}catch(c){Mg(a,c)}else b.current=null}
|
22329 | function Ng(a,b){for(var c=a;;){if(5===c.tag){var d=c.stateNode;if(b)d.style.display="none";else{d=c.stateNode;var e=c.memoizedProps.style;e=void 0!==e&&null!==e&&e.hasOwnProperty("display")?e.display:null;d.style.display=se("display",e)}}else if(6===c.tag)c.stateNode.nodeValue=b?"":c.memoizedProps;else if(13===c.tag&&null!==c.memoizedState){d=c.child.sibling;d.return=c;c=d;continue}else if(null!==c.child){c.child.return=c;c=c.child;continue}if(c===a)break;for(;null===c.sibling;){if(null===c.return||
|
22330 | c.return===a)return;c=c.return}c.sibling.return=c.return;c=c.sibling}}
|
22331 | function Og(a){"function"===typeof Ue&&Ue(a);switch(a.tag){case 0:case 11:case 14:case 15:var b=a.updateQueue;if(null!==b&&(b=b.lastEffect,null!==b)){var c=b=b.next;do{var d=c.destroy;if(null!==d){var e=a;try{d()}catch(f){Mg(e,f)}}c=c.next}while(c!==b)}break;case 1:Lg(a);b=a.stateNode;if("function"===typeof b.componentWillUnmount)try{b.props=a.memoizedProps,b.state=a.memoizedState,b.componentWillUnmount()}catch(f){Mg(a,f)}break;case 5:Lg(a);break;case 4:Pg(a)}}
|
22332 | function Qg(a){return 5===a.tag||3===a.tag||4===a.tag}
|
22333 | function Rg(a){a:{for(var b=a.return;null!==b;){if(Qg(b)){var c=b;break a}b=b.return}t("160");c=void 0}var d=b=void 0;switch(c.tag){case 5:b=c.stateNode;d=!1;break;case 3:b=c.stateNode.containerInfo;d=!0;break;case 4:b=c.stateNode.containerInfo;d=!0;break;default:t("161")}c.effectTag&16&&(pe(b,""),c.effectTag&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||Qg(c.return)){c=null;break a}c=c.return}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag;){if(c.effectTag&2)continue b;
|
22334 | if(null===c.child||4===c.tag)continue b;else c.child.return=c,c=c.child}if(!(c.effectTag&2)){c=c.stateNode;break a}}for(var e=a;;){if(5===e.tag||6===e.tag)if(c)if(d){var f=b,g=e.stateNode,h=c;8===f.nodeType?f.parentNode.insertBefore(g,h):f.insertBefore(g,h)}else b.insertBefore(e.stateNode,c);else d?(g=b,h=e.stateNode,8===g.nodeType?(f=g.parentNode,f.insertBefore(h,g)):(f=g,f.appendChild(h)),g=g._reactRootContainer,null!==g&&void 0!==g||null!==f.onclick||(f.onclick=ye)):b.appendChild(e.stateNode);
|
22335 | else if(4!==e.tag&&null!==e.child){e.child.return=e;e=e.child;continue}if(e===a)break;for(;null===e.sibling;){if(null===e.return||e.return===a)return;e=e.return}e.sibling.return=e.return;e=e.sibling}}
|
22336 | function Pg(a){for(var b=a,c=!1,d=void 0,e=void 0;;){if(!c){c=b.return;a:for(;;){null===c?t("160"):void 0;switch(c.tag){case 5:d=c.stateNode;e=!1;break a;case 3:d=c.stateNode.containerInfo;e=!0;break a;case 4:d=c.stateNode.containerInfo;e=!0;break a}c=c.return}c=!0}if(5===b.tag||6===b.tag){a:for(var f=b,g=f;;)if(Og(g),null!==g.child&&4!==g.tag)g.child.return=g,g=g.child;else{if(g===f)break;for(;null===g.sibling;){if(null===g.return||g.return===f)break a;g=g.return}g.sibling.return=g.return;g=g.sibling}e?
|
22337 | (f=d,g=b.stateNode,8===f.nodeType?f.parentNode.removeChild(g):f.removeChild(g)):d.removeChild(b.stateNode)}else if(4===b.tag?(d=b.stateNode.containerInfo,e=!0):Og(b),null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return;b=b.return;4===b.tag&&(c=!1)}b.sibling.return=b.return;b=b.sibling}}
|
22338 | function Sg(a,b){switch(b.tag){case 0:case 11:case 14:case 15:break;case 1:break;case 5:var c=b.stateNode;if(null!=c){var d=b.memoizedProps;a=null!==a?a.memoizedProps:d;var e=b.type,f=b.updateQueue;b.updateQueue=null;null!==f&&Fe(c,f,e,a,d,b)}break;case 6:null===b.stateNode?t("162"):void 0;b.stateNode.nodeValue=b.memoizedProps;break;case 3:break;case 12:break;case 13:c=b.memoizedState;d=void 0;a=b;null===c?d=!1:(d=!0,a=b.child,0===c.timedOutAt&&(c.timedOutAt=Rf()));null!==a&&Ng(a,d);c=b.updateQueue;
|
22339 | if(null!==c){b.updateQueue=null;var g=b.stateNode;null===g&&(g=b.stateNode=new Jg);c.forEach(function(a){var c=Tg.bind(null,b,a);g.has(a)||(g.add(a),a.then(c,c))})}break;case 17:break;default:t("163")}}var Ug="function"===typeof WeakMap?WeakMap:Map;function Vg(a,b,c){c=nf(c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Wg(d);Kg(a,b)};return c}
|
22340 | function Xg(a,b,c){c=nf(c);c.tag=3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){return d(e)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){"function"!==typeof d&&(null===Yg?Yg=new Set([this]):Yg.add(this));var c=b.value,e=b.stack;Kg(a,b);this.componentDidCatch(c,{componentStack:null!==e?e:""})});return c}
|
22341 | function Zg(a){switch(a.tag){case 1:M(a.type)&&Ne(a);var b=a.effectTag;return b&2048?(a.effectTag=b&-2049|64,a):null;case 3:return Kf(a),Oe(a),b=a.effectTag,0!==(b&64)?t("285"):void 0,a.effectTag=b&-2049|64,a;case 5:return Mf(a),null;case 13:return b=a.effectTag,b&2048?(a.effectTag=b&-2049|64,a):null;case 4:return Kf(a),null;case 10:return Cf(a),null;default:return null}}
|
22342 | var $g={readContext:Ef},ah=Xb.ReactCurrentOwner,bh=1073741822,ch=0,dh=!1,S=null,T=null,U=0,eh=-1,fh=!1,V=null,gh=!1,hh=null,ih=null,Yg=null;function jh(){if(null!==S)for(var a=S.return;null!==a;){var b=a;switch(b.tag){case 1:var c=b.type.childContextTypes;null!==c&&void 0!==c&&Ne(b);break;case 3:Kf(b);Oe(b);break;case 5:Mf(b);break;case 4:Kf(b);break;case 10:Cf(b)}a=a.return}T=null;U=0;eh=-1;fh=!1;S=null}function Tf(){null!==ih&&(ba.unstable_cancelCallback(hh),ih())}
|
22343 | function kh(a){for(;;){var b=a.alternate,c=a.return,d=a.sibling;if(0===(a.effectTag&1024)){S=a;a:{var e=b;b=a;var f=U;var g=b.pendingProps;switch(b.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:M(b.type)&&Ne(b);break;case 3:Kf(b);Oe(b);g=b.stateNode;g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null);if(null===e||null===e.child)ng(b),b.effectTag&=-3;Gg(b);break;case 5:Mf(b);var h=If(Hf.current);f=b.type;if(null!==e&&null!=b.stateNode)Hg(e,b,f,g,h),e.ref!==b.ref&&(b.effectTag|=
|
22344 | 128);else if(g){var k=If(O.current);if(ng(b)){g=b;e=g.stateNode;var l=g.type,m=g.memoizedProps,r=h;e[Ga]=g;e[Ha]=m;f=void 0;h=l;switch(h){case "iframe":case "object":H("load",e);break;case "video":case "audio":for(l=0;l<bb.length;l++)H(bb[l],e);break;case "source":H("error",e);break;case "img":case "image":case "link":H("error",e);H("load",e);break;case "form":H("reset",e);H("submit",e);break;case "details":H("toggle",e);break;case "input":Ac(e,m);H("invalid",e);xe(r,"onChange");break;case "select":e._wrapperState=
|
22345 | {wasMultiple:!!m.multiple};H("invalid",e);xe(r,"onChange");break;case "textarea":he(e,m),H("invalid",e),xe(r,"onChange")}ve(h,m);l=null;for(f in m)m.hasOwnProperty(f)&&(k=m[f],"children"===f?"string"===typeof k?e.textContent!==k&&(l=["children",k]):"number"===typeof k&&e.textContent!==""+k&&(l=["children",""+k]):sa.hasOwnProperty(f)&&null!=k&&xe(r,f));switch(h){case "input":Vb(e);Ec(e,m,!0);break;case "textarea":Vb(e);je(e,m);break;case "select":case "option":break;default:"function"===typeof m.onClick&&
|
22346 | (e.onclick=ye)}f=l;g.updateQueue=f;g=null!==f?!0:!1;g&&Bg(b)}else{m=b;e=f;r=g;l=9===h.nodeType?h:h.ownerDocument;k===ke.html&&(k=le(e));k===ke.html?"script"===e?(e=l.createElement("div"),e.innerHTML="<script>\x3c/script>",l=e.removeChild(e.firstChild)):"string"===typeof r.is?l=l.createElement(e,{is:r.is}):(l=l.createElement(e),"select"===e&&r.multiple&&(l.multiple=!0)):l=l.createElementNS(k,e);e=l;e[Ga]=m;e[Ha]=g;Cg(e,b,!1,!1);r=e;l=f;m=g;var w=h,y=we(l,m);switch(l){case "iframe":case "object":H("load",
|
22347 | r);h=m;break;case "video":case "audio":for(h=0;h<bb.length;h++)H(bb[h],r);h=m;break;case "source":H("error",r);h=m;break;case "img":case "image":case "link":H("error",r);H("load",r);h=m;break;case "form":H("reset",r);H("submit",r);h=m;break;case "details":H("toggle",r);h=m;break;case "input":Ac(r,m);h=zc(r,m);H("invalid",r);xe(w,"onChange");break;case "option":h=ee(r,m);break;case "select":r._wrapperState={wasMultiple:!!m.multiple};h=n({},m,{value:void 0});H("invalid",r);xe(w,"onChange");break;case "textarea":he(r,
|
22348 | m);h=ge(r,m);H("invalid",r);xe(w,"onChange");break;default:h=m}ve(l,h);k=void 0;var B=l,R=r,v=h;for(k in v)if(v.hasOwnProperty(k)){var q=v[k];"style"===k?te(R,q):"dangerouslySetInnerHTML"===k?(q=q?q.__html:void 0,null!=q&&oe(R,q)):"children"===k?"string"===typeof q?("textarea"!==B||""!==q)&&pe(R,q):"number"===typeof q&&pe(R,""+q):"suppressContentEditableWarning"!==k&&"suppressHydrationWarning"!==k&&"autoFocus"!==k&&(sa.hasOwnProperty(k)?null!=q&&xe(w,k):null!=q&&xc(R,k,q,y))}switch(l){case "input":Vb(r);
|
22349 | Ec(r,m,!1);break;case "textarea":Vb(r);je(r,m);break;case "option":null!=m.value&&r.setAttribute("value",""+yc(m.value));break;case "select":h=r;h.multiple=!!m.multiple;r=m.value;null!=r?fe(h,!!m.multiple,r,!1):null!=m.defaultValue&&fe(h,!!m.multiple,m.defaultValue,!0);break;default:"function"===typeof h.onClick&&(r.onclick=ye)}(g=Be(f,g))&&Bg(b);b.stateNode=e}null!==b.ref&&(b.effectTag|=128)}else null===b.stateNode?t("166"):void 0;break;case 6:e&&null!=b.stateNode?Ig(e,b,e.memoizedProps,g):("string"!==
|
22350 | typeof g&&(null===b.stateNode?t("166"):void 0),e=If(Hf.current),If(O.current),ng(b)?(g=b,f=g.stateNode,e=g.memoizedProps,f[Ga]=g,(g=f.nodeValue!==e)&&Bg(b)):(f=b,g=(9===e.nodeType?e:e.ownerDocument).createTextNode(g),g[Ga]=b,f.stateNode=g));break;case 11:break;case 13:g=b.memoizedState;if(0!==(b.effectTag&64)){b.expirationTime=f;S=b;break a}g=null!==g;f=null!==e&&null!==e.memoizedState;null!==e&&!g&&f&&(e=e.child.sibling,null!==e&&(h=b.firstEffect,null!==h?(b.firstEffect=e,e.nextEffect=h):(b.firstEffect=
|
22351 | b.lastEffect=e,e.nextEffect=null),e.effectTag=8));if(g!==f||0===(b.effectTag&1)&&g)b.effectTag|=4;break;case 7:break;case 8:break;case 12:break;case 4:Kf(b);Gg(b);break;case 10:Cf(b);break;case 9:break;case 14:break;case 17:M(b.type)&&Ne(b);break;default:t("156")}S=null}b=a;if(1===U||1!==b.childExpirationTime){g=0;for(f=b.child;null!==f;)e=f.expirationTime,h=f.childExpirationTime,e>g&&(g=e),h>g&&(g=h),f=f.sibling;b.childExpirationTime=g}if(null!==S)return S;null!==c&&0===(c.effectTag&1024)&&(null===
|
22352 | c.firstEffect&&(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect),1<a.effectTag&&(null!==c.lastEffect?c.lastEffect.nextEffect=a:c.firstEffect=a,c.lastEffect=a))}else{a=Zg(a,U);if(null!==a)return a.effectTag&=1023,a;null!==c&&(c.firstEffect=c.lastEffect=null,c.effectTag|=1024)}if(null!==d)return d;if(null!==c)a=c;else break}return null}
|
22353 | function lh(a){var b=Ag(a.alternate,a,U);a.memoizedProps=a.pendingProps;null===b&&(b=kh(a));ah.current=null;return b}
|
22354 | function mh(a,b){dh?t("243"):void 0;Tf();dh=!0;ah.currentDispatcher=$g;var c=a.nextExpirationTimeToWorkOn;if(c!==U||a!==T||null===S)jh(),T=a,U=c,S=$e(T.current,null,U),a.pendingCommitExpirationTime=0;var d=!1;do{try{if(b)for(;null!==S&&!nh();)S=lh(S);else for(;null!==S;)S=lh(S)}catch(B){if(Af=zf=yf=null,null===S)d=!0,Wg(B);else{null===S?t("271"):void 0;var e=S,f=e.return;if(null===f)d=!0,Wg(B);else{a:{var g=a,h=f,k=e,l=B;f=U;k.effectTag|=1024;k.firstEffect=k.lastEffect=null;if(null!==l&&"object"===
|
22355 | typeof l&&"function"===typeof l.then){var m=l;l=h;var r=-1,w=-1;do{if(13===l.tag){var y=l.alternate;if(null!==y&&(y=y.memoizedState,null!==y)){w=10*(1073741822-y.timedOutAt);break}y=l.pendingProps.maxDuration;if("number"===typeof y)if(0>=y)r=0;else if(-1===r||y<r)r=y}l=l.return}while(null!==l);l=h;do{if(y=13===l.tag)y=void 0===l.memoizedProps.fallback?!1:null===l.memoizedState;if(y){h=l.updateQueue;null===h?l.updateQueue=new Set([m]):h.add(m);if(0===(l.mode&1)){l.effectTag|=64;k.effectTag&=-1957;
|
22356 | 1===k.tag&&(null===k.alternate?k.tag=17:(f=nf(1073741823),f.tag=2,pf(k,f)));k.expirationTime=1073741823;break a}k=g.pingCache;null===k?(k=g.pingCache=new Ug,h=new Set,k.set(m,h)):(h=k.get(m),void 0===h&&(h=new Set,k.set(m,h)));h.has(f)||(h.add(f),k=oh.bind(null,g,m,f),m.then(k,k));-1===r?g=1073741823:(-1===w&&(w=10*(1073741822-jf(g,f))-5E3),g=w+r);0<=g&&eh<g&&(eh=g);l.effectTag|=2048;l.expirationTime=f;break a}l=l.return}while(null!==l);l=Error((mc(k.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+
|
22357 | nc(k))}fh=!0;l=wf(l,k);g=h;do{switch(g.tag){case 3:g.effectTag|=2048;g.expirationTime=f;f=Vg(g,l,f);qf(g,f);break a;case 1:if(m=l,r=g.type,w=g.stateNode,0===(g.effectTag&64)&&("function"===typeof r.getDerivedStateFromError||null!==w&&"function"===typeof w.componentDidCatch&&(null===Yg||!Yg.has(w)))){g.effectTag|=2048;g.expirationTime=f;f=Xg(g,m,f);qf(g,f);break a}}g=g.return}while(null!==g)}S=kh(e);continue}}}break}while(1);dh=!1;Af=zf=yf=ah.currentDispatcher=null;if(d)T=null,a.finishedWork=null;
|
22358 | else if(null!==S)a.finishedWork=null;else{d=a.current.alternate;null===d?t("281"):void 0;T=null;if(fh){e=a.latestPendingTime;f=a.latestSuspendedTime;g=a.latestPingedTime;if(0!==e&&e<c||0!==f&&f<c||0!==g&&g<c){hf(a,c);ph(a,d,c,a.expirationTime,-1);return}if(!a.didError&&b){a.didError=!0;c=a.nextExpirationTimeToWorkOn=c;b=a.expirationTime=1073741823;ph(a,d,c,b,-1);return}}b&&-1!==eh?(hf(a,c),b=10*(1073741822-jf(a,c)),b<eh&&(eh=b),b=10*(1073741822-Rf()),b=eh-b,ph(a,d,c,a.expirationTime,0>b?0:b)):(a.pendingCommitExpirationTime=
|
22359 | c,a.finishedWork=d)}}function Mg(a,b){for(var c=a.return;null!==c;){switch(c.tag){case 1:var d=c.stateNode;if("function"===typeof c.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===Yg||!Yg.has(d))){a=wf(b,a);a=Xg(c,a,1073741823);pf(c,a);Uf(c,1073741823);return}break;case 3:a=wf(b,a);a=Vg(c,a,1073741823);pf(c,a);Uf(c,1073741823);return}c=c.return}3===a.tag&&(c=wf(b,a),c=Vg(a,c,1073741823),pf(a,c),Uf(a,1073741823))}
|
22360 | function Sf(a,b){0!==ch?a=ch:dh?a=gh?1073741823:U:b.mode&1?(a=qh?1073741822-10*(((1073741822-a+15)/10|0)+1):1073741822-25*(((1073741822-a+500)/25|0)+1),null!==T&&a===U&&--a):a=1073741823;qh&&(0===rh||a<rh)&&(rh=a);return a}function oh(a,b,c){var d=a.pingCache;null!==d&&d.delete(b);if(null!==T&&U===c)T=null;else if(b=a.earliestSuspendedTime,d=a.latestSuspendedTime,0!==b&&c<=b&&c>=d){a.didError=!1;b=a.latestPingedTime;if(0===b||b>c)a.latestPingedTime=c;gf(c,a);c=a.expirationTime;0!==c&&sh(a,c)}}
|
22361 | function Tg(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=Rf();b=Sf(b,a);a=th(a,b);null!==a&&(ff(a,b),b=a.expirationTime,0!==b&&sh(a,b))}
|
22362 | function th(a,b){a.expirationTime<b&&(a.expirationTime=b);var c=a.alternate;null!==c&&c.expirationTime<b&&(c.expirationTime=b);var d=a.return,e=null;if(null===d&&3===a.tag)e=a.stateNode;else for(;null!==d;){c=d.alternate;d.childExpirationTime<b&&(d.childExpirationTime=b);null!==c&&c.childExpirationTime<b&&(c.childExpirationTime=b);if(null===d.return&&3===d.tag){e=d.stateNode;break}d=d.return}return e}
|
22363 | function Uf(a,b){a=th(a,b);null!==a&&(!dh&&0!==U&&b>U&&jh(),ff(a,b),dh&&!gh&&T===a||sh(a,a.expirationTime),uh>vh&&(uh=0,t("185")))}function wh(a,b,c,d,e){var f=ch;ch=1073741823;try{return a(b,c,d,e)}finally{ch=f}}var xh=null,W=null,yh=0,zh=void 0,X=!1,Ah=null,Y=0,rh=0,Bh=!1,Ch=null,Z=!1,Dh=!1,qh=!1,Eh=null,Fh=ba.unstable_now(),Gh=1073741822-(Fh/10|0),Hh=Gh,vh=50,uh=0,Ih=null;function Jh(){Gh=1073741822-((ba.unstable_now()-Fh)/10|0)}
|
22364 | function Kh(a,b){if(0!==yh){if(b<yh)return;null!==zh&&ba.unstable_cancelCallback(zh)}yh=b;a=ba.unstable_now()-Fh;zh=ba.unstable_scheduleCallback(Lh,{timeout:10*(1073741822-b)-a})}function ph(a,b,c,d,e){a.expirationTime=d;0!==e||nh()?0<e&&(a.timeoutHandle=De(Mh.bind(null,a,b,c),e)):(a.pendingCommitExpirationTime=c,a.finishedWork=b)}function Mh(a,b,c){a.pendingCommitExpirationTime=c;a.finishedWork=b;Jh();Hh=Gh;Nh(a,c)}function Rf(){if(X)return Hh;Oh();if(0===Y||1===Y)Jh(),Hh=Gh;return Hh}
|
22365 | function sh(a,b){null===a.nextScheduledRoot?(a.expirationTime=b,null===W?(xh=W=a,a.nextScheduledRoot=a):(W=W.nextScheduledRoot=a,W.nextScheduledRoot=xh)):b>a.expirationTime&&(a.expirationTime=b);X||(Z?Dh&&(Ah=a,Y=1073741823,Ph(a,1073741823,!1)):1073741823===b?Qh(1073741823,!1):Kh(a,b))}
|
22366 | function Oh(){var a=0,b=null;if(null!==W)for(var c=W,d=xh;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===W?t("244"):void 0;if(d===d.nextScheduledRoot){xh=W=d.nextScheduledRoot=null;break}else if(d===xh)xh=e=d.nextScheduledRoot,W.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===W){W=c;W.nextScheduledRoot=xh;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot}else{e>a&&(a=e,b=d);if(d===W)break;if(1073741823===
|
22367 | a)break;c=d;d=d.nextScheduledRoot}}Ah=b;Y=a}var Rh=!1;function nh(){return Rh?!0:ba.unstable_shouldYield()?Rh=!0:!1}function Lh(){try{if(!nh()&&null!==xh){Jh();var a=xh;do{var b=a.expirationTime;0!==b&&Gh<=b&&(a.nextExpirationTimeToWorkOn=Gh);a=a.nextScheduledRoot}while(a!==xh)}Qh(0,!0)}finally{Rh=!1}}
|
22368 | function Qh(a,b){Oh();if(b)for(Jh(),Hh=Gh;null!==Ah&&0!==Y&&a<=Y&&!(Rh&&Gh>Y);)Ph(Ah,Y,Gh>Y),Oh(),Jh(),Hh=Gh;else for(;null!==Ah&&0!==Y&&a<=Y;)Ph(Ah,Y,!1),Oh();b&&(yh=0,zh=null);0!==Y&&Kh(Ah,Y);uh=0;Ih=null;if(null!==Eh)for(a=Eh,Eh=null,b=0;b<a.length;b++){var c=a[b];try{c._onComplete()}catch(d){Bh||(Bh=!0,Ch=d)}}if(Bh)throw a=Ch,Ch=null,Bh=!1,a;}function Nh(a,b){X?t("253"):void 0;Ah=a;Y=b;Ph(a,b,!1);Qh(1073741823,!1)}
|
22369 | function Ph(a,b,c){X?t("245"):void 0;X=!0;if(c){var d=a.finishedWork;null!==d?Sh(a,d,b):(a.finishedWork=null,d=a.timeoutHandle,-1!==d&&(a.timeoutHandle=-1,Ee(d)),mh(a,c),d=a.finishedWork,null!==d&&(nh()?a.finishedWork=d:Sh(a,d,b)))}else d=a.finishedWork,null!==d?Sh(a,d,b):(a.finishedWork=null,d=a.timeoutHandle,-1!==d&&(a.timeoutHandle=-1,Ee(d)),mh(a,c),d=a.finishedWork,null!==d&&Sh(a,d,b));X=!1}
|
22370 | function Sh(a,b,c){var d=a.firstBatch;if(null!==d&&d._expirationTime>=c&&(null===Eh?Eh=[d]:Eh.push(d),d._defer)){a.finishedWork=b;a.expirationTime=0;return}a.finishedWork=null;a===Ih?uh++:(Ih=a,uh=0);gh=dh=!0;a.current===b?t("177"):void 0;c=a.pendingCommitExpirationTime;0===c?t("261"):void 0;a.pendingCommitExpirationTime=0;d=b.expirationTime;var e=b.childExpirationTime;d=e>d?e:d;a.didError=!1;0===d?(a.earliestPendingTime=0,a.latestPendingTime=0,a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=
|
22371 | 0):(d<a.latestPingedTime&&(a.latestPingedTime=0),e=a.latestPendingTime,0!==e&&(e>d?a.earliestPendingTime=a.latestPendingTime=0:a.earliestPendingTime>d&&(a.earliestPendingTime=a.latestPendingTime)),e=a.earliestSuspendedTime,0===e?ff(a,d):d<a.latestSuspendedTime?(a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=0,ff(a,d)):d>e&&ff(a,d));gf(0,a);ah.current=null;1<b.effectTag?null!==b.lastEffect?(b.lastEffect.nextEffect=b,d=b.firstEffect):d=b:d=b.firstEffect;ze=Hd;e=Td();if(Ud(e)){if("selectionStart"in
|
22372 | e)var f={start:e.selectionStart,end:e.selectionEnd};else a:{f=(f=e.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&0!==g.rangeCount){f=g.anchorNode;var h=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{f.nodeType,k.nodeType}catch(db){f=null;break a}var l=0,m=-1,r=-1,w=0,y=0,B=e,R=null;b:for(;;){for(var v;;){B!==f||0!==h&&3!==B.nodeType||(m=l+h);B!==k||0!==g&&3!==B.nodeType||(r=l+g);3===B.nodeType&&(l+=B.nodeValue.length);if(null===(v=B.firstChild))break;R=B;B=v}for(;;){if(B===
|
22373 | e)break b;R===f&&++w===h&&(m=l);R===k&&++y===g&&(r=l);if(null!==(v=B.nextSibling))break;B=R;R=B.parentNode}B=v}f=-1===m||-1===r?null:{start:m,end:r}}else f=null}f=f||{start:0,end:0}}else f=null;Ae={focusedElem:e,selectionRange:f};Hd=!1;for(V=d;null!==V;){e=!1;f=void 0;try{for(;null!==V;){if(V.effectTag&256)a:{var q=V.alternate;h=V;switch(h.tag){case 0:case 11:case 15:break a;case 1:if(h.effectTag&256&&null!==q){var u=q.memoizedProps,A=q.memoizedState,Yf=h.stateNode,Vh=Yf.getSnapshotBeforeUpdate(h.elementType===
|
22374 | h.type?u:P(h.type,u),A);Yf.__reactInternalSnapshotBeforeUpdate=Vh}break a;case 3:case 5:case 6:case 4:case 17:break a;default:t("163")}}V=V.nextEffect}}catch(db){e=!0,f=db}e&&(null===V?t("178"):void 0,Mg(V,f),null!==V&&(V=V.nextEffect))}for(V=d;null!==V;){q=!1;u=void 0;try{for(;null!==V;){var x=V.effectTag;x&16&&pe(V.stateNode,"");if(x&128){var C=V.alternate;if(null!==C){var p=C.ref;null!==p&&("function"===typeof p?p(null):p.current=null)}}switch(x&14){case 2:Rg(V);V.effectTag&=-3;break;case 6:Rg(V);
|
22375 | V.effectTag&=-3;Sg(V.alternate,V);break;case 4:Sg(V.alternate,V);break;case 8:A=V;Pg(A);A.return=null;A.child=null;A.memoizedState=null;A.updateQueue=null;var G=A.alternate;null!==G&&(G.return=null,G.child=null,G.memoizedState=null,G.updateQueue=null)}V=V.nextEffect}}catch(db){q=!0,u=db}q&&(null===V?t("178"):void 0,Mg(V,u),null!==V&&(V=V.nextEffect))}p=Ae;C=Td();x=p.focusedElem;q=p.selectionRange;if(C!==x&&x&&x.ownerDocument&&Sd(x.ownerDocument.documentElement,x)){null!==q&&Ud(x)&&(C=q.start,p=q.end,
|
22376 | void 0===p&&(p=C),"selectionStart"in x?(x.selectionStart=C,x.selectionEnd=Math.min(p,x.value.length)):(p=(C=x.ownerDocument||document)&&C.defaultView||window,p.getSelection&&(p=p.getSelection(),u=x.textContent.length,G=Math.min(q.start,u),q=void 0===q.end?G:Math.min(q.end,u),!p.extend&&G>q&&(u=q,q=G,G=u),u=Rd(x,G),A=Rd(x,q),u&&A&&(1!==p.rangeCount||p.anchorNode!==u.node||p.anchorOffset!==u.offset||p.focusNode!==A.node||p.focusOffset!==A.offset)&&(C=C.createRange(),C.setStart(u.node,u.offset),p.removeAllRanges(),
|
22377 | G>q?(p.addRange(C),p.extend(A.node,A.offset)):(C.setEnd(A.node,A.offset),p.addRange(C))))));C=[];for(p=x;p=p.parentNode;)1===p.nodeType&&C.push({element:p,left:p.scrollLeft,top:p.scrollTop});"function"===typeof x.focus&&x.focus();for(x=0;x<C.length;x++)p=C[x],p.element.scrollLeft=p.left,p.element.scrollTop=p.top}Ae=null;Hd=!!ze;ze=null;a.current=b;for(V=d;null!==V;){d=!1;x=void 0;try{for(C=c;null!==V;){var Fb=V.effectTag;if(Fb&36){var Gb=V.alternate;p=V;G=C;switch(p.tag){case 0:case 11:case 15:break;
|
22378 | case 1:var Hc=p.stateNode;if(p.effectTag&4)if(null===Gb)Hc.componentDidMount();else{var ii=p.elementType===p.type?Gb.memoizedProps:P(p.type,Gb.memoizedProps);Hc.componentDidUpdate(ii,Gb.memoizedState,Hc.__reactInternalSnapshotBeforeUpdate)}var Dg=p.updateQueue;null!==Dg&&uf(p,Dg,Hc,G);break;case 3:var Eg=p.updateQueue;if(null!==Eg){q=null;if(null!==p.child)switch(p.child.tag){case 5:q=p.child.stateNode;break;case 1:q=p.child.stateNode}uf(p,Eg,q,G)}break;case 5:var ji=p.stateNode;null===Gb&&p.effectTag&
|
22379 | 4&&Be(p.type,p.memoizedProps)&&ji.focus();break;case 6:break;case 4:break;case 12:break;case 13:break;case 17:break;default:t("163")}}if(Fb&128){var Ic=V.ref;if(null!==Ic){var Fg=V.stateNode;switch(V.tag){case 5:var ce=Fg;break;default:ce=Fg}"function"===typeof Ic?Ic(ce):Ic.current=ce}}V=V.nextEffect}}catch(db){d=!0,x=db}d&&(null===V?t("178"):void 0,Mg(V,x),null!==V&&(V=V.nextEffect))}dh=gh=!1;"function"===typeof Te&&Te(b.stateNode);Fb=b.expirationTime;b=b.childExpirationTime;b=b>Fb?b:Fb;0===b&&(Yg=
|
22380 | null);a.expirationTime=b;a.finishedWork=null}function Wg(a){null===Ah?t("246"):void 0;Ah.expirationTime=0;Bh||(Bh=!0,Ch=a)}function Th(a,b){var c=Z;Z=!0;try{return a(b)}finally{(Z=c)||X||Qh(1073741823,!1)}}function Uh(a,b){if(Z&&!Dh){Dh=!0;try{return a(b)}finally{Dh=!1}}return a(b)}function Wh(a,b,c){if(qh)return a(b,c);Z||X||0===rh||(Qh(rh,!1),rh=0);var d=qh,e=Z;Z=qh=!0;try{return a(b,c)}finally{qh=d,(Z=e)||X||Qh(1073741823,!1)}}
|
22381 | function Xh(a,b,c,d,e){var f=b.current;a:if(c){c=c._reactInternalFiber;b:{2===kd(c)&&1===c.tag?void 0:t("170");var g=c;do{switch(g.tag){case 3:g=g.stateNode.context;break b;case 1:if(M(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break b}}g=g.return}while(null!==g);t("171");g=void 0}if(1===c.tag){var h=c.type;if(M(h)){c=Qe(c,h,g);break a}}c=g}else c=Ke;null===b.context?b.context=c:b.pendingContext=c;b=e;e=nf(d);e.payload={element:a};b=void 0===b?null:b;null!==b&&(e.callback=b);
|
22382 | Tf();pf(f,e);Uf(f,d);return d}function Yh(a,b,c,d){var e=b.current,f=Rf();e=Sf(f,e);return Xh(a,b,c,e,d)}function Zh(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function $h(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:$b,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}}
|
22383 | Cb=function(a,b,c){switch(b){case "input":Cc(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=La(d);e?void 0:t("90");Wb(d);Cc(d,e)}}}break;case "textarea":ie(a,c);break;case "select":b=c.value,null!=b&&fe(a,!!c.multiple,b,!1)}};
|
22384 | function ai(a){var b=1073741822-25*(((1073741822-Rf()+500)/25|0)+1);b>=bh&&(b=bh-1);this._expirationTime=bh=b;this._root=a;this._callbacks=this._next=null;this._hasChildren=this._didComplete=!1;this._children=null;this._defer=!0}ai.prototype.render=function(a){this._defer?void 0:t("250");this._hasChildren=!0;this._children=a;var b=this._root._internalRoot,c=this._expirationTime,d=new bi;Xh(a,b,null,c,d._onCommit);return d};
|
22385 | ai.prototype.then=function(a){if(this._didComplete)a();else{var b=this._callbacks;null===b&&(b=this._callbacks=[]);b.push(a)}};
|
22386 | ai.prototype.commit=function(){var a=this._root._internalRoot,b=a.firstBatch;this._defer&&null!==b?void 0:t("251");if(this._hasChildren){var c=this._expirationTime;if(b!==this){this._hasChildren&&(c=this._expirationTime=b._expirationTime,this.render(this._children));for(var d=null,e=b;e!==this;)d=e,e=e._next;null===d?t("251"):void 0;d._next=e._next;this._next=b;a.firstBatch=this}this._defer=!1;Nh(a,c);b=this._next;this._next=null;b=a.firstBatch=b;null!==b&&b._hasChildren&&b.render(b._children)}else this._next=
|
22387 | null,this._defer=!1};ai.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var a=this._callbacks;if(null!==a)for(var b=0;b<a.length;b++)(0,a[b])()}};function bi(){this._callbacks=null;this._didCommit=!1;this._onCommit=this._onCommit.bind(this)}bi.prototype.then=function(a){if(this._didCommit)a();else{var b=this._callbacks;null===b&&(b=this._callbacks=[]);b.push(a)}};
|
22388 | bi.prototype._onCommit=function(){if(!this._didCommit){this._didCommit=!0;var a=this._callbacks;if(null!==a)for(var b=0;b<a.length;b++){var c=a[b];"function"!==typeof c?t("191",c):void 0;c()}}};
|
22389 | function ci(a,b,c){b=N(3,null,null,b?3:0);a={current:b,containerInfo:a,pendingChildren:null,pingCache:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,didError:!1,pendingCommitExpirationTime:0,finishedWork:null,timeoutHandle:-1,context:null,pendingContext:null,hydrate:c,nextExpirationTimeToWorkOn:0,expirationTime:0,firstBatch:null,nextScheduledRoot:null};this._internalRoot=b.stateNode=a}
|
22390 | ci.prototype.render=function(a,b){var c=this._internalRoot,d=new bi;b=void 0===b?null:b;null!==b&&d.then(b);Yh(a,c,null,d._onCommit);return d};ci.prototype.unmount=function(a){var b=this._internalRoot,c=new bi;a=void 0===a?null:a;null!==a&&c.then(a);Yh(null,b,null,c._onCommit);return c};ci.prototype.legacy_renderSubtreeIntoContainer=function(a,b,c){var d=this._internalRoot,e=new bi;c=void 0===c?null:c;null!==c&&e.then(c);Yh(b,d,a,e._onCommit);return e};
|
22391 | ci.prototype.createBatch=function(){var a=new ai(this),b=a._expirationTime,c=this._internalRoot,d=c.firstBatch;if(null===d)c.firstBatch=a,a._next=null;else{for(c=null;null!==d&&d._expirationTime>=b;)c=d,d=d._next;a._next=d;null!==c&&(c._next=a)}return a};function di(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}Kb=Th;Lb=Wh;Mb=function(){X||0===rh||(Qh(rh,!1),rh=0)};
|
22392 | function ei(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new ci(a,!1,b)}
|
22393 | function fi(a,b,c,d,e){di(c)?void 0:t("200");var f=c._reactRootContainer;if(f){if("function"===typeof e){var g=e;e=function(){var a=Zh(f._internalRoot);g.call(a)}}null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)}else{f=c._reactRootContainer=ei(c,d);if("function"===typeof e){var h=e;e=function(){var a=Zh(f._internalRoot);h.call(a)}}Uh(function(){null!=a?f.legacy_renderSubtreeIntoContainer(a,b,e):f.render(b,e)})}return Zh(f._internalRoot)}
|
22394 | function gi(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;di(b)?void 0:t("200");return $h(a,b,null,c)}
|
22395 | var ki={createPortal:gi,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;void 0===b&&("function"===typeof a.render?t("188"):t("268",Object.keys(a)));a=nd(b);a=null===a?null:a.stateNode;return a},hydrate:function(a,b,c){return fi(null,a,b,!0,c)},render:function(a,b,c){return fi(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){null==a||void 0===a._reactInternalFiber?t("38"):void 0;return fi(a,b,c,!1,d)},unmountComponentAtNode:function(a){di(a)?
|
22396 | void 0:t("40");return a._reactRootContainer?(Uh(function(){fi(null,null,a,!1,function(){a._reactRootContainer=null})}),!0):!1},unstable_createPortal:function(){return gi.apply(void 0,arguments)},unstable_batchedUpdates:Th,unstable_interactiveUpdates:Wh,flushSync:function(a,b){X?t("187"):void 0;var c=Z;Z=!0;try{return wh(a,b)}finally{Z=c,Qh(1073741823,!1)}},unstable_createRoot:hi,unstable_flushControlled:function(a){var b=Z;Z=!0;try{wh(a)}finally{(Z=b)||X||Qh(1073741823,!1)}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Ja,
|
22397 | Ka,La,Ca.injectEventPluginsByName,qa,Ra,function(a){za(a,Qa)},Ib,Jb,Jd,Ea]}};function hi(a,b){di(a)?void 0:t("299","unstable_createRoot");return new ci(a,!0,null!=b&&!0===b.hydrate)}(function(a){var b=a.findFiberByHostInstance;return We(n({},a,{overrideProps:null,findHostInstanceByFiber:function(a){a=nd(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:Ia,bundleType:0,version:"16.7.0",rendererPackageName:"react-dom"});
|
22398 | var li={default:ki},mi=li&&ki||li;module.exports=mi.default||mi;
|
22399 |
|
22400 | },{"object-assign":23,"react":"react","scheduler":71}],31:[function(require,module,exports){
|
22401 | (function (process){
|
22402 |
|
22403 |
|
22404 |
|
22405 |
|
22406 |
|
22407 |
|
22408 |
|
22409 |
|
22410 |
|
22411 | 'use strict';
|
22412 |
|
22413 |
|
22414 |
|
22415 | if (process.env.NODE_ENV !== "production") {
|
22416 | (function() {
|
22417 | 'use strict';
|
22418 |
|
22419 | Object.defineProperty(exports, '__esModule', { value: true });
|
22420 |
|
22421 |
|
22422 |
|
22423 | var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
22424 |
|
22425 | var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
22426 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
22427 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
22428 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
22429 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
22430 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
22431 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
22432 | var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
22433 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
22434 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
22435 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
22436 | var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
22437 | var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
22438 |
|
22439 | function isValidElementType(type) {
|
22440 | return typeof type === 'string' || typeof type === 'function' ||
|
22441 |
|
22442 | type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
|
22443 | }
|
22444 |
|
22445 |
|
22446 |
|
22447 |
|
22448 |
|
22449 |
|
22450 |
|
22451 |
|
22452 |
|
22453 |
|
22454 |
|
22455 |
|
22456 |
|
22457 |
|
22458 |
|
22459 | var lowPriorityWarning = function () {};
|
22460 |
|
22461 | {
|
22462 | var printWarning = function (format) {
|
22463 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
22464 | args[_key - 1] = arguments[_key];
|
22465 | }
|
22466 |
|
22467 | var argIndex = 0;
|
22468 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
22469 | return args[argIndex++];
|
22470 | });
|
22471 | if (typeof console !== 'undefined') {
|
22472 | console.warn(message);
|
22473 | }
|
22474 | try {
|
22475 |
|
22476 |
|
22477 |
|
22478 | throw new Error(message);
|
22479 | } catch (x) {}
|
22480 | };
|
22481 |
|
22482 | lowPriorityWarning = function (condition, format) {
|
22483 | if (format === undefined) {
|
22484 | throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
22485 | }
|
22486 | if (!condition) {
|
22487 | for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
22488 | args[_key2 - 2] = arguments[_key2];
|
22489 | }
|
22490 |
|
22491 | printWarning.apply(undefined, [format].concat(args));
|
22492 | }
|
22493 | };
|
22494 | }
|
22495 |
|
22496 | var lowPriorityWarning$1 = lowPriorityWarning;
|
22497 |
|
22498 | function typeOf(object) {
|
22499 | if (typeof object === 'object' && object !== null) {
|
22500 | var $$typeof = object.$$typeof;
|
22501 | switch ($$typeof) {
|
22502 | case REACT_ELEMENT_TYPE:
|
22503 | var type = object.type;
|
22504 |
|
22505 | switch (type) {
|
22506 | case REACT_ASYNC_MODE_TYPE:
|
22507 | case REACT_CONCURRENT_MODE_TYPE:
|
22508 | case REACT_FRAGMENT_TYPE:
|
22509 | case REACT_PROFILER_TYPE:
|
22510 | case REACT_STRICT_MODE_TYPE:
|
22511 | case REACT_SUSPENSE_TYPE:
|
22512 | return type;
|
22513 | default:
|
22514 | var $$typeofType = type && type.$$typeof;
|
22515 |
|
22516 | switch ($$typeofType) {
|
22517 | case REACT_CONTEXT_TYPE:
|
22518 | case REACT_FORWARD_REF_TYPE:
|
22519 | case REACT_PROVIDER_TYPE:
|
22520 | return $$typeofType;
|
22521 | default:
|
22522 | return $$typeof;
|
22523 | }
|
22524 | }
|
22525 | case REACT_LAZY_TYPE:
|
22526 | case REACT_MEMO_TYPE:
|
22527 | case REACT_PORTAL_TYPE:
|
22528 | return $$typeof;
|
22529 | }
|
22530 | }
|
22531 |
|
22532 | return undefined;
|
22533 | }
|
22534 |
|
22535 |
|
22536 | var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
22537 | var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
22538 | var ContextConsumer = REACT_CONTEXT_TYPE;
|
22539 | var ContextProvider = REACT_PROVIDER_TYPE;
|
22540 | var Element = REACT_ELEMENT_TYPE;
|
22541 | var ForwardRef = REACT_FORWARD_REF_TYPE;
|
22542 | var Fragment = REACT_FRAGMENT_TYPE;
|
22543 | var Lazy = REACT_LAZY_TYPE;
|
22544 | var Memo = REACT_MEMO_TYPE;
|
22545 | var Portal = REACT_PORTAL_TYPE;
|
22546 | var Profiler = REACT_PROFILER_TYPE;
|
22547 | var StrictMode = REACT_STRICT_MODE_TYPE;
|
22548 | var Suspense = REACT_SUSPENSE_TYPE;
|
22549 |
|
22550 | var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
22551 |
|
22552 |
|
22553 | function isAsyncMode(object) {
|
22554 | {
|
22555 | if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
22556 | hasWarnedAboutDeprecatedIsAsyncMode = true;
|
22557 | lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
22558 | }
|
22559 | }
|
22560 | return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
22561 | }
|
22562 | function isConcurrentMode(object) {
|
22563 | return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
22564 | }
|
22565 | function isContextConsumer(object) {
|
22566 | return typeOf(object) === REACT_CONTEXT_TYPE;
|
22567 | }
|
22568 | function isContextProvider(object) {
|
22569 | return typeOf(object) === REACT_PROVIDER_TYPE;
|
22570 | }
|
22571 | function isElement(object) {
|
22572 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
22573 | }
|
22574 | function isForwardRef(object) {
|
22575 | return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
22576 | }
|
22577 | function isFragment(object) {
|
22578 | return typeOf(object) === REACT_FRAGMENT_TYPE;
|
22579 | }
|
22580 | function isLazy(object) {
|
22581 | return typeOf(object) === REACT_LAZY_TYPE;
|
22582 | }
|
22583 | function isMemo(object) {
|
22584 | return typeOf(object) === REACT_MEMO_TYPE;
|
22585 | }
|
22586 | function isPortal(object) {
|
22587 | return typeOf(object) === REACT_PORTAL_TYPE;
|
22588 | }
|
22589 | function isProfiler(object) {
|
22590 | return typeOf(object) === REACT_PROFILER_TYPE;
|
22591 | }
|
22592 | function isStrictMode(object) {
|
22593 | return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
22594 | }
|
22595 | function isSuspense(object) {
|
22596 | return typeOf(object) === REACT_SUSPENSE_TYPE;
|
22597 | }
|
22598 |
|
22599 | exports.typeOf = typeOf;
|
22600 | exports.AsyncMode = AsyncMode;
|
22601 | exports.ConcurrentMode = ConcurrentMode;
|
22602 | exports.ContextConsumer = ContextConsumer;
|
22603 | exports.ContextProvider = ContextProvider;
|
22604 | exports.Element = Element;
|
22605 | exports.ForwardRef = ForwardRef;
|
22606 | exports.Fragment = Fragment;
|
22607 | exports.Lazy = Lazy;
|
22608 | exports.Memo = Memo;
|
22609 | exports.Portal = Portal;
|
22610 | exports.Profiler = Profiler;
|
22611 | exports.StrictMode = StrictMode;
|
22612 | exports.Suspense = Suspense;
|
22613 | exports.isValidElementType = isValidElementType;
|
22614 | exports.isAsyncMode = isAsyncMode;
|
22615 | exports.isConcurrentMode = isConcurrentMode;
|
22616 | exports.isContextConsumer = isContextConsumer;
|
22617 | exports.isContextProvider = isContextProvider;
|
22618 | exports.isElement = isElement;
|
22619 | exports.isForwardRef = isForwardRef;
|
22620 | exports.isFragment = isFragment;
|
22621 | exports.isLazy = isLazy;
|
22622 | exports.isMemo = isMemo;
|
22623 | exports.isPortal = isPortal;
|
22624 | exports.isProfiler = isProfiler;
|
22625 | exports.isStrictMode = isStrictMode;
|
22626 | exports.isSuspense = isSuspense;
|
22627 | })();
|
22628 | }
|
22629 |
|
22630 | }).call(this,require('_process'))
|
22631 |
|
22632 | },{"_process":24}],32:[function(require,module,exports){
|
22633 |
|
22634 |
|
22635 |
|
22636 |
|
22637 |
|
22638 |
|
22639 |
|
22640 |
|
22641 |
|
22642 | 'use strict';Object.defineProperty(exports,"__esModule",{value:!0});
|
22643 | var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"):
|
22644 | 60115,r=b?Symbol.for("react.lazy"):60116;function t(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;
|
22645 | exports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k};
|
22646 | exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f};
|
22647 | exports.isSuspense=function(a){return t(a)===p};
|
22648 |
|
22649 | },{}],33:[function(require,module,exports){
|
22650 | (function (process){
|
22651 | 'use strict';
|
22652 |
|
22653 | if (process.env.NODE_ENV === 'production') {
|
22654 | module.exports = require('./cjs/react-is.production.min.js');
|
22655 | } else {
|
22656 | module.exports = require('./cjs/react-is.development.js');
|
22657 | }
|
22658 |
|
22659 | }).call(this,require('_process'))
|
22660 |
|
22661 | },{"./cjs/react-is.development.js":31,"./cjs/react-is.production.min.js":32,"_process":24}],34:[function(require,module,exports){
|
22662 | "use strict";
|
22663 |
|
22664 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
22665 |
|
22666 | exports.__esModule = true;
|
22667 | exports.createProvider = createProvider;
|
22668 | exports.default = void 0;
|
22669 |
|
22670 | var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
22671 |
|
22672 | var _react = require("react");
|
22673 |
|
22674 | var _propTypes = _interopRequireDefault(require("prop-types"));
|
22675 |
|
22676 | var _PropTypes = require("../utils/PropTypes");
|
22677 |
|
22678 | var _warning = _interopRequireDefault(require("../utils/warning"));
|
22679 |
|
22680 | var didWarnAboutReceivingStore = false;
|
22681 |
|
22682 | function warnAboutReceivingStore() {
|
22683 | if (didWarnAboutReceivingStore) {
|
22684 | return;
|
22685 | }
|
22686 |
|
22687 | didWarnAboutReceivingStore = true;
|
22688 | (0, _warning.default)('<Provider> does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reduxjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.');
|
22689 | }
|
22690 |
|
22691 | function createProvider(storeKey) {
|
22692 | var _Provider$childContex;
|
22693 |
|
22694 | if (storeKey === void 0) {
|
22695 | storeKey = 'store';
|
22696 | }
|
22697 |
|
22698 | var subscriptionKey = storeKey + "Subscription";
|
22699 |
|
22700 | var Provider =
|
22701 |
|
22702 | function (_Component) {
|
22703 | (0, _inheritsLoose2.default)(Provider, _Component);
|
22704 | var _proto = Provider.prototype;
|
22705 |
|
22706 | _proto.getChildContext = function getChildContext() {
|
22707 | var _ref;
|
22708 |
|
22709 | return _ref = {}, _ref[storeKey] = this[storeKey], _ref[subscriptionKey] = null, _ref;
|
22710 | };
|
22711 |
|
22712 | function Provider(props, context) {
|
22713 | var _this;
|
22714 |
|
22715 | _this = _Component.call(this, props, context) || this;
|
22716 | _this[storeKey] = props.store;
|
22717 | return _this;
|
22718 | }
|
22719 |
|
22720 | _proto.render = function render() {
|
22721 | return _react.Children.only(this.props.children);
|
22722 | };
|
22723 |
|
22724 | return Provider;
|
22725 | }(_react.Component);
|
22726 |
|
22727 | if ("development" !== 'production') {
|
22728 | Provider.prototype.componentWillReceiveProps = function (nextProps) {
|
22729 | if (this[storeKey] !== nextProps.store) {
|
22730 | warnAboutReceivingStore();
|
22731 | }
|
22732 | };
|
22733 | }
|
22734 |
|
22735 | Provider.propTypes = {
|
22736 | store: _PropTypes.storeShape.isRequired,
|
22737 | children: _propTypes.default.element.isRequired
|
22738 | };
|
22739 | Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = _PropTypes.storeShape.isRequired, _Provider$childContex[subscriptionKey] = _PropTypes.subscriptionShape, _Provider$childContex);
|
22740 | return Provider;
|
22741 | }
|
22742 |
|
22743 | var _default = createProvider();
|
22744 |
|
22745 | exports.default = _default;
|
22746 | },{"../utils/PropTypes":44,"../utils/warning":49,"@babel/runtime/helpers/inheritsLoose":3,"@babel/runtime/helpers/interopRequireDefault":4,"prop-types":"prop-types","react":"react"}],35:[function(require,module,exports){
|
22747 | "use strict";
|
22748 |
|
22749 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
22750 |
|
22751 | exports.__esModule = true;
|
22752 | exports.default = connectAdvanced;
|
22753 |
|
22754 | var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
22755 |
|
22756 | var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
22757 |
|
22758 | var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
22759 |
|
22760 | var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
22761 |
|
22762 | var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
|
22763 |
|
22764 | var _invariant = _interopRequireDefault(require("invariant"));
|
22765 |
|
22766 | var _react = require("react");
|
22767 |
|
22768 | var _reactIs = require("react-is");
|
22769 |
|
22770 | var _Subscription = _interopRequireDefault(require("../utils/Subscription"));
|
22771 |
|
22772 | var _PropTypes = require("../utils/PropTypes");
|
22773 |
|
22774 | var hotReloadingVersion = 0;
|
22775 | var dummyState = {};
|
22776 |
|
22777 | function noop() {}
|
22778 |
|
22779 | function makeSelectorStateful(sourceSelector, store) {
|
22780 |
|
22781 | var selector = {
|
22782 | run: function runComponentSelector(props) {
|
22783 | try {
|
22784 | var nextProps = sourceSelector(store.getState(), props);
|
22785 |
|
22786 | if (nextProps !== selector.props || selector.error) {
|
22787 | selector.shouldComponentUpdate = true;
|
22788 | selector.props = nextProps;
|
22789 | selector.error = null;
|
22790 | }
|
22791 | } catch (error) {
|
22792 | selector.shouldComponentUpdate = true;
|
22793 | selector.error = error;
|
22794 | }
|
22795 | }
|
22796 | };
|
22797 | return selector;
|
22798 | }
|
22799 |
|
22800 | function connectAdvanced(
|
22801 | /*
|
22802 | selectorFactory is a func that is responsible for returning the selector function used to
|
22803 | compute new props from state, props, and dispatch. For example:
|
22804 | export default connectAdvanced((dispatch, options) => (state, props) => ({
|
22805 | thing: state.things[props.thingId],
|
22806 | saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),
|
22807 | }))(YourComponent)
|
22808 | Access to dispatch is provided to the factory so selectorFactories can bind actionCreators
|
22809 | outside of their selector as an optimization. Options passed to connectAdvanced are passed to
|
22810 | the selectorFactory, along with displayName and WrappedComponent, as the second argument.
|
22811 | Note that selectorFactory is responsible for all caching/memoization of inbound and outbound
|
22812 | props. Do not use connectAdvanced directly without memoizing results between calls to your
|
22813 | selector, otherwise the Connect component will re-render on every state or props change.
|
22814 | */
|
22815 | selectorFactory, // options object:
|
22816 | _ref) {
|
22817 | var _contextTypes, _childContextTypes;
|
22818 |
|
22819 | if (_ref === void 0) {
|
22820 | _ref = {};
|
22821 | }
|
22822 |
|
22823 | var _ref2 = _ref,
|
22824 | _ref2$getDisplayName = _ref2.getDisplayName,
|
22825 | getDisplayName = _ref2$getDisplayName === void 0 ? function (name) {
|
22826 | return "ConnectAdvanced(" + name + ")";
|
22827 | } : _ref2$getDisplayName,
|
22828 | _ref2$methodName = _ref2.methodName,
|
22829 | methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName,
|
22830 | _ref2$renderCountProp = _ref2.renderCountProp,
|
22831 | renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp,
|
22832 | _ref2$shouldHandleSta = _ref2.shouldHandleStateChanges,
|
22833 | shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta,
|
22834 | _ref2$storeKey = _ref2.storeKey,
|
22835 | storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey,
|
22836 | _ref2$withRef = _ref2.withRef,
|
22837 | withRef = _ref2$withRef === void 0 ? false : _ref2$withRef,
|
22838 | connectOptions = (0, _objectWithoutPropertiesLoose2.default)(_ref2, ["getDisplayName", "methodName", "renderCountProp", "shouldHandleStateChanges", "storeKey", "withRef"]);
|
22839 | var subscriptionKey = storeKey + 'Subscription';
|
22840 | var version = hotReloadingVersion++;
|
22841 | var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = _PropTypes.storeShape, _contextTypes[subscriptionKey] = _PropTypes.subscriptionShape, _contextTypes);
|
22842 | var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = _PropTypes.subscriptionShape, _childContextTypes);
|
22843 | return function wrapWithConnect(WrappedComponent) {
|
22844 | (0, _invariant.default)((0, _reactIs.isValidElementType)(WrappedComponent), "You must pass a component to the function returned by " + (methodName + ". Instead received " + JSON.stringify(WrappedComponent)));
|
22845 | var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
22846 | var displayName = getDisplayName(wrappedComponentName);
|
22847 | var selectorFactoryOptions = (0, _extends2.default)({}, connectOptions, {
|
22848 | getDisplayName: getDisplayName,
|
22849 | methodName: methodName,
|
22850 | renderCountProp: renderCountProp,
|
22851 | shouldHandleStateChanges: shouldHandleStateChanges,
|
22852 | storeKey: storeKey,
|
22853 | withRef: withRef,
|
22854 | displayName: displayName,
|
22855 | wrappedComponentName: wrappedComponentName,
|
22856 | WrappedComponent: WrappedComponent
|
22857 |
|
22858 |
|
22859 |
|
22860 | });
|
22861 |
|
22862 | var Connect =
|
22863 |
|
22864 | function (_Component) {
|
22865 | (0, _inheritsLoose2.default)(Connect, _Component);
|
22866 |
|
22867 | function Connect(props, context) {
|
22868 | var _this;
|
22869 |
|
22870 | _this = _Component.call(this, props, context) || this;
|
22871 | _this.version = version;
|
22872 | _this.state = {};
|
22873 | _this.renderCount = 0;
|
22874 | _this.store = props[storeKey] || context[storeKey];
|
22875 | _this.propsMode = Boolean(props[storeKey]);
|
22876 | _this.setWrappedInstance = _this.setWrappedInstance.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
22877 | (0, _invariant.default)(_this.store, "Could not find \"" + storeKey + "\" in either the context or props of " + ("\"" + displayName + "\". Either wrap the root component in a <Provider>, ") + ("or explicitly pass \"" + storeKey + "\" as a prop to \"" + displayName + "\"."));
|
22878 |
|
22879 | _this.initSelector();
|
22880 |
|
22881 | _this.initSubscription();
|
22882 |
|
22883 | return _this;
|
22884 | }
|
22885 |
|
22886 | var _proto = Connect.prototype;
|
22887 |
|
22888 | _proto.getChildContext = function getChildContext() {
|
22889 | var _ref3;
|
22890 |
|
22891 |
|
22892 |
|
22893 |
|
22894 |
|
22895 | var subscription = this.propsMode ? null : this.subscription;
|
22896 | return _ref3 = {}, _ref3[subscriptionKey] = subscription || this.context[subscriptionKey], _ref3;
|
22897 | };
|
22898 |
|
22899 | _proto.componentDidMount = function componentDidMount() {
|
22900 | if (!shouldHandleStateChanges) return;
|
22901 |
|
22902 |
|
22903 |
|
22904 |
|
22905 |
|
22906 |
|
22907 | this.subscription.trySubscribe();
|
22908 | this.selector.run(this.props);
|
22909 | if (this.selector.shouldComponentUpdate) this.forceUpdate();
|
22910 | };
|
22911 |
|
22912 | _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
22913 | this.selector.run(nextProps);
|
22914 | };
|
22915 |
|
22916 | _proto.shouldComponentUpdate = function shouldComponentUpdate() {
|
22917 | return this.selector.shouldComponentUpdate;
|
22918 | };
|
22919 |
|
22920 | _proto.componentWillUnmount = function componentWillUnmount() {
|
22921 | if (this.subscription) this.subscription.tryUnsubscribe();
|
22922 | this.subscription = null;
|
22923 | this.notifyNestedSubs = noop;
|
22924 | this.store = null;
|
22925 | this.selector.run = noop;
|
22926 | this.selector.shouldComponentUpdate = false;
|
22927 | };
|
22928 |
|
22929 | _proto.getWrappedInstance = function getWrappedInstance() {
|
22930 | (0, _invariant.default)(withRef, "To access the wrapped instance, you need to specify " + ("{ withRef: true } in the options argument of the " + methodName + "() call."));
|
22931 | return this.wrappedInstance;
|
22932 | };
|
22933 |
|
22934 | _proto.setWrappedInstance = function setWrappedInstance(ref) {
|
22935 | this.wrappedInstance = ref;
|
22936 | };
|
22937 |
|
22938 | _proto.initSelector = function initSelector() {
|
22939 | var sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions);
|
22940 | this.selector = makeSelectorStateful(sourceSelector, this.store);
|
22941 | this.selector.run(this.props);
|
22942 | };
|
22943 |
|
22944 | _proto.initSubscription = function initSubscription() {
|
22945 | if (!shouldHandleStateChanges) return;
|
22946 |
|
22947 |
|
22948 | var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey];
|
22949 | this.subscription = new _Subscription.default(this.store, parentSub, this.onStateChange.bind(this));
|
22950 |
|
22951 |
|
22952 |
|
22953 |
|
22954 |
|
22955 |
|
22956 | this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription);
|
22957 | };
|
22958 |
|
22959 | _proto.onStateChange = function onStateChange() {
|
22960 | this.selector.run(this.props);
|
22961 |
|
22962 | if (!this.selector.shouldComponentUpdate) {
|
22963 | this.notifyNestedSubs();
|
22964 | } else {
|
22965 | this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate;
|
22966 | this.setState(dummyState);
|
22967 | }
|
22968 | };
|
22969 |
|
22970 | _proto.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate() {
|
22971 |
|
22972 |
|
22973 |
|
22974 |
|
22975 |
|
22976 | this.componentDidUpdate = undefined;
|
22977 | this.notifyNestedSubs();
|
22978 | };
|
22979 |
|
22980 | _proto.isSubscribed = function isSubscribed() {
|
22981 | return Boolean(this.subscription) && this.subscription.isSubscribed();
|
22982 | };
|
22983 |
|
22984 | _proto.addExtraProps = function addExtraProps(props) {
|
22985 | if (!withRef && !renderCountProp && !(this.propsMode && this.subscription)) return props;
|
22986 |
|
22987 |
|
22988 |
|
22989 |
|
22990 | var withExtras = (0, _extends2.default)({}, props);
|
22991 | if (withRef) withExtras.ref = this.setWrappedInstance;
|
22992 | if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;
|
22993 | if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription;
|
22994 | return withExtras;
|
22995 | };
|
22996 |
|
22997 | _proto.render = function render() {
|
22998 | var selector = this.selector;
|
22999 | selector.shouldComponentUpdate = false;
|
23000 |
|
23001 | if (selector.error) {
|
23002 | throw selector.error;
|
23003 | } else {
|
23004 | return (0, _react.createElement)(WrappedComponent, this.addExtraProps(selector.props));
|
23005 | }
|
23006 | };
|
23007 |
|
23008 | return Connect;
|
23009 | }(_react.Component);
|
23010 |
|
23011 |
|
23012 |
|
23013 | Connect.WrappedComponent = WrappedComponent;
|
23014 | Connect.displayName = displayName;
|
23015 | Connect.childContextTypes = childContextTypes;
|
23016 | Connect.contextTypes = contextTypes;
|
23017 | Connect.propTypes = contextTypes;
|
23018 |
|
23019 | if ("development" !== 'production') {
|
23020 | Connect.prototype.componentWillUpdate = function componentWillUpdate() {
|
23021 | var _this2 = this;
|
23022 |
|
23023 |
|
23024 | if (this.version !== version) {
|
23025 | this.version = version;
|
23026 | this.initSelector();
|
23027 |
|
23028 |
|
23029 |
|
23030 |
|
23031 |
|
23032 | var oldListeners = [];
|
23033 |
|
23034 | if (this.subscription) {
|
23035 | oldListeners = this.subscription.listeners.get();
|
23036 | this.subscription.tryUnsubscribe();
|
23037 | }
|
23038 |
|
23039 | this.initSubscription();
|
23040 |
|
23041 | if (shouldHandleStateChanges) {
|
23042 | this.subscription.trySubscribe();
|
23043 | oldListeners.forEach(function (listener) {
|
23044 | return _this2.subscription.listeners.subscribe(listener);
|
23045 | });
|
23046 | }
|
23047 | }
|
23048 | };
|
23049 | }
|
23050 |
|
23051 | return (0, _hoistNonReactStatics.default)(Connect, WrappedComponent);
|
23052 | };
|
23053 | }
|
23054 | },{"../utils/PropTypes":44,"../utils/Subscription":45,"@babel/runtime/helpers/assertThisInitialized":1,"@babel/runtime/helpers/extends":2,"@babel/runtime/helpers/inheritsLoose":3,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/helpers/objectWithoutPropertiesLoose":6,"hoist-non-react-statics":9,"invariant":11,"react":"react","react-is":33}],36:[function(require,module,exports){
|
23055 | "use strict";
|
23056 |
|
23057 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
23058 |
|
23059 | exports.__esModule = true;
|
23060 | exports.createConnect = createConnect;
|
23061 | exports.default = void 0;
|
23062 |
|
23063 | var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
23064 |
|
23065 | var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
23066 |
|
23067 | var _connectAdvanced = _interopRequireDefault(require("../components/connectAdvanced"));
|
23068 |
|
23069 | var _shallowEqual = _interopRequireDefault(require("../utils/shallowEqual"));
|
23070 |
|
23071 | var _mapDispatchToProps = _interopRequireDefault(require("./mapDispatchToProps"));
|
23072 |
|
23073 | var _mapStateToProps = _interopRequireDefault(require("./mapStateToProps"));
|
23074 |
|
23075 | var _mergeProps = _interopRequireDefault(require("./mergeProps"));
|
23076 |
|
23077 | var _selectorFactory = _interopRequireDefault(require("./selectorFactory"));
|
23078 |
|
23079 |
|
23080 |
|
23081 |
|
23082 |
|
23083 |
|
23084 |
|
23085 |
|
23086 |
|
23087 |
|
23088 |
|
23089 |
|
23090 |
|
23091 |
|
23092 |
|
23093 |
|
23094 |
|
23095 | function match(arg, factories, name) {
|
23096 | for (var i = factories.length - 1; i >= 0; i--) {
|
23097 | var result = factories[i](arg);
|
23098 | if (result) return result;
|
23099 | }
|
23100 |
|
23101 | return function (dispatch, options) {
|
23102 | throw new Error("Invalid value of type " + typeof arg + " for " + name + " argument when connecting component " + options.wrappedComponentName + ".");
|
23103 | };
|
23104 | }
|
23105 |
|
23106 | function strictEqual(a, b) {
|
23107 | return a === b;
|
23108 | }
|
23109 |
|
23110 |
|
23111 |
|
23112 | function createConnect(_temp) {
|
23113 | var _ref = _temp === void 0 ? {} : _temp,
|
23114 | _ref$connectHOC = _ref.connectHOC,
|
23115 | connectHOC = _ref$connectHOC === void 0 ? _connectAdvanced.default : _ref$connectHOC,
|
23116 | _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,
|
23117 | mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? _mapStateToProps.default : _ref$mapStateToPropsF,
|
23118 | _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,
|
23119 | mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? _mapDispatchToProps.default : _ref$mapDispatchToPro,
|
23120 | _ref$mergePropsFactor = _ref.mergePropsFactories,
|
23121 | mergePropsFactories = _ref$mergePropsFactor === void 0 ? _mergeProps.default : _ref$mergePropsFactor,
|
23122 | _ref$selectorFactory = _ref.selectorFactory,
|
23123 | selectorFactory = _ref$selectorFactory === void 0 ? _selectorFactory.default : _ref$selectorFactory;
|
23124 |
|
23125 | return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {
|
23126 | if (_ref2 === void 0) {
|
23127 | _ref2 = {};
|
23128 | }
|
23129 |
|
23130 | var _ref3 = _ref2,
|
23131 | _ref3$pure = _ref3.pure,
|
23132 | pure = _ref3$pure === void 0 ? true : _ref3$pure,
|
23133 | _ref3$areStatesEqual = _ref3.areStatesEqual,
|
23134 | areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,
|
23135 | _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,
|
23136 | areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? _shallowEqual.default : _ref3$areOwnPropsEqua,
|
23137 | _ref3$areStatePropsEq = _ref3.areStatePropsEqual,
|
23138 | areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? _shallowEqual.default : _ref3$areStatePropsEq,
|
23139 | _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,
|
23140 | areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? _shallowEqual.default : _ref3$areMergedPropsE,
|
23141 | extraOptions = (0, _objectWithoutPropertiesLoose2.default)(_ref3, ["pure", "areStatesEqual", "areOwnPropsEqual", "areStatePropsEqual", "areMergedPropsEqual"]);
|
23142 | var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');
|
23143 | var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');
|
23144 | var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');
|
23145 | return connectHOC(selectorFactory, (0, _extends2.default)({
|
23146 |
|
23147 | methodName: 'connect',
|
23148 |
|
23149 | getDisplayName: function getDisplayName(name) {
|
23150 | return "Connect(" + name + ")";
|
23151 | },
|
23152 |
|
23153 | shouldHandleStateChanges: Boolean(mapStateToProps),
|
23154 |
|
23155 | initMapStateToProps: initMapStateToProps,
|
23156 | initMapDispatchToProps: initMapDispatchToProps,
|
23157 | initMergeProps: initMergeProps,
|
23158 | pure: pure,
|
23159 | areStatesEqual: areStatesEqual,
|
23160 | areOwnPropsEqual: areOwnPropsEqual,
|
23161 | areStatePropsEqual: areStatePropsEqual,
|
23162 | areMergedPropsEqual: areMergedPropsEqual
|
23163 | }, extraOptions));
|
23164 | };
|
23165 | }
|
23166 |
|
23167 | var _default = createConnect();
|
23168 |
|
23169 | exports.default = _default;
|
23170 | },{"../components/connectAdvanced":35,"../utils/shallowEqual":47,"./mapDispatchToProps":37,"./mapStateToProps":38,"./mergeProps":39,"./selectorFactory":40,"@babel/runtime/helpers/extends":2,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/helpers/objectWithoutPropertiesLoose":6}],37:[function(require,module,exports){
|
23171 | "use strict";
|
23172 |
|
23173 | exports.__esModule = true;
|
23174 | exports.whenMapDispatchToPropsIsFunction = whenMapDispatchToPropsIsFunction;
|
23175 | exports.whenMapDispatchToPropsIsMissing = whenMapDispatchToPropsIsMissing;
|
23176 | exports.whenMapDispatchToPropsIsObject = whenMapDispatchToPropsIsObject;
|
23177 | exports.default = void 0;
|
23178 |
|
23179 | var _redux = require("redux");
|
23180 |
|
23181 | var _wrapMapToProps = require("./wrapMapToProps");
|
23182 |
|
23183 | function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {
|
23184 | return typeof mapDispatchToProps === 'function' ? (0, _wrapMapToProps.wrapMapToPropsFunc)(mapDispatchToProps, 'mapDispatchToProps') : undefined;
|
23185 | }
|
23186 |
|
23187 | function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {
|
23188 | return !mapDispatchToProps ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function (dispatch) {
|
23189 | return {
|
23190 | dispatch: dispatch
|
23191 | };
|
23192 | }) : undefined;
|
23193 | }
|
23194 |
|
23195 | function whenMapDispatchToPropsIsObject(mapDispatchToProps) {
|
23196 | return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function (dispatch) {
|
23197 | return (0, _redux.bindActionCreators)(mapDispatchToProps, dispatch);
|
23198 | }) : undefined;
|
23199 | }
|
23200 |
|
23201 | var _default = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];
|
23202 | exports.default = _default;
|
23203 | },{"./wrapMapToProps":42,"redux":63}],38:[function(require,module,exports){
|
23204 | "use strict";
|
23205 |
|
23206 | exports.__esModule = true;
|
23207 | exports.whenMapStateToPropsIsFunction = whenMapStateToPropsIsFunction;
|
23208 | exports.whenMapStateToPropsIsMissing = whenMapStateToPropsIsMissing;
|
23209 | exports.default = void 0;
|
23210 |
|
23211 | var _wrapMapToProps = require("./wrapMapToProps");
|
23212 |
|
23213 | function whenMapStateToPropsIsFunction(mapStateToProps) {
|
23214 | return typeof mapStateToProps === 'function' ? (0, _wrapMapToProps.wrapMapToPropsFunc)(mapStateToProps, 'mapStateToProps') : undefined;
|
23215 | }
|
23216 |
|
23217 | function whenMapStateToPropsIsMissing(mapStateToProps) {
|
23218 | return !mapStateToProps ? (0, _wrapMapToProps.wrapMapToPropsConstant)(function () {
|
23219 | return {};
|
23220 | }) : undefined;
|
23221 | }
|
23222 |
|
23223 | var _default = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];
|
23224 | exports.default = _default;
|
23225 | },{"./wrapMapToProps":42}],39:[function(require,module,exports){
|
23226 | "use strict";
|
23227 |
|
23228 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
23229 |
|
23230 | exports.__esModule = true;
|
23231 | exports.defaultMergeProps = defaultMergeProps;
|
23232 | exports.wrapMergePropsFunc = wrapMergePropsFunc;
|
23233 | exports.whenMergePropsIsFunction = whenMergePropsIsFunction;
|
23234 | exports.whenMergePropsIsOmitted = whenMergePropsIsOmitted;
|
23235 | exports.default = void 0;
|
23236 |
|
23237 | var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
23238 |
|
23239 | var _verifyPlainObject = _interopRequireDefault(require("../utils/verifyPlainObject"));
|
23240 |
|
23241 | function defaultMergeProps(stateProps, dispatchProps, ownProps) {
|
23242 | return (0, _extends2.default)({}, ownProps, stateProps, dispatchProps);
|
23243 | }
|
23244 |
|
23245 | function wrapMergePropsFunc(mergeProps) {
|
23246 | return function initMergePropsProxy(dispatch, _ref) {
|
23247 | var displayName = _ref.displayName,
|
23248 | pure = _ref.pure,
|
23249 | areMergedPropsEqual = _ref.areMergedPropsEqual;
|
23250 | var hasRunOnce = false;
|
23251 | var mergedProps;
|
23252 | return function mergePropsProxy(stateProps, dispatchProps, ownProps) {
|
23253 | var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
23254 |
|
23255 | if (hasRunOnce) {
|
23256 | if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;
|
23257 | } else {
|
23258 | hasRunOnce = true;
|
23259 | mergedProps = nextMergedProps;
|
23260 | if ("development" !== 'production') (0, _verifyPlainObject.default)(mergedProps, displayName, 'mergeProps');
|
23261 | }
|
23262 |
|
23263 | return mergedProps;
|
23264 | };
|
23265 | };
|
23266 | }
|
23267 |
|
23268 | function whenMergePropsIsFunction(mergeProps) {
|
23269 | return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;
|
23270 | }
|
23271 |
|
23272 | function whenMergePropsIsOmitted(mergeProps) {
|
23273 | return !mergeProps ? function () {
|
23274 | return defaultMergeProps;
|
23275 | } : undefined;
|
23276 | }
|
23277 |
|
23278 | var _default = [whenMergePropsIsFunction, whenMergePropsIsOmitted];
|
23279 | exports.default = _default;
|
23280 | },{"../utils/verifyPlainObject":48,"@babel/runtime/helpers/extends":2,"@babel/runtime/helpers/interopRequireDefault":4}],40:[function(require,module,exports){
|
23281 | "use strict";
|
23282 |
|
23283 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
23284 |
|
23285 | exports.__esModule = true;
|
23286 | exports.impureFinalPropsSelectorFactory = impureFinalPropsSelectorFactory;
|
23287 | exports.pureFinalPropsSelectorFactory = pureFinalPropsSelectorFactory;
|
23288 | exports.default = finalPropsSelectorFactory;
|
23289 |
|
23290 | var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
23291 |
|
23292 | var _verifySubselectors = _interopRequireDefault(require("./verifySubselectors"));
|
23293 |
|
23294 | function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {
|
23295 | return function impureFinalPropsSelector(state, ownProps) {
|
23296 | return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);
|
23297 | };
|
23298 | }
|
23299 |
|
23300 | function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {
|
23301 | var areStatesEqual = _ref.areStatesEqual,
|
23302 | areOwnPropsEqual = _ref.areOwnPropsEqual,
|
23303 | areStatePropsEqual = _ref.areStatePropsEqual;
|
23304 | var hasRunAtLeastOnce = false;
|
23305 | var state;
|
23306 | var ownProps;
|
23307 | var stateProps;
|
23308 | var dispatchProps;
|
23309 | var mergedProps;
|
23310 |
|
23311 | function handleFirstCall(firstState, firstOwnProps) {
|
23312 | state = firstState;
|
23313 | ownProps = firstOwnProps;
|
23314 | stateProps = mapStateToProps(state, ownProps);
|
23315 | dispatchProps = mapDispatchToProps(dispatch, ownProps);
|
23316 | mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
23317 | hasRunAtLeastOnce = true;
|
23318 | return mergedProps;
|
23319 | }
|
23320 |
|
23321 | function handleNewPropsAndNewState() {
|
23322 | stateProps = mapStateToProps(state, ownProps);
|
23323 | if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
|
23324 | mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
23325 | return mergedProps;
|
23326 | }
|
23327 |
|
23328 | function handleNewProps() {
|
23329 | if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);
|
23330 | if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);
|
23331 | mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
23332 | return mergedProps;
|
23333 | }
|
23334 |
|
23335 | function handleNewState() {
|
23336 | var nextStateProps = mapStateToProps(state, ownProps);
|
23337 | var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);
|
23338 | stateProps = nextStateProps;
|
23339 | if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);
|
23340 | return mergedProps;
|
23341 | }
|
23342 |
|
23343 | function handleSubsequentCalls(nextState, nextOwnProps) {
|
23344 | var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);
|
23345 | var stateChanged = !areStatesEqual(nextState, state);
|
23346 | state = nextState;
|
23347 | ownProps = nextOwnProps;
|
23348 | if (propsChanged && stateChanged) return handleNewPropsAndNewState();
|
23349 | if (propsChanged) return handleNewProps();
|
23350 | if (stateChanged) return handleNewState();
|
23351 | return mergedProps;
|
23352 | }
|
23353 |
|
23354 | return function pureFinalPropsSelector(nextState, nextOwnProps) {
|
23355 | return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);
|
23356 | };
|
23357 | }
|
23358 |
|
23359 |
|
23360 |
|
23361 |
|
23362 |
|
23363 |
|
23364 | function finalPropsSelectorFactory(dispatch, _ref2) {
|
23365 | var initMapStateToProps = _ref2.initMapStateToProps,
|
23366 | initMapDispatchToProps = _ref2.initMapDispatchToProps,
|
23367 | initMergeProps = _ref2.initMergeProps,
|
23368 | options = (0, _objectWithoutPropertiesLoose2.default)(_ref2, ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"]);
|
23369 | var mapStateToProps = initMapStateToProps(dispatch, options);
|
23370 | var mapDispatchToProps = initMapDispatchToProps(dispatch, options);
|
23371 | var mergeProps = initMergeProps(dispatch, options);
|
23372 |
|
23373 | if ("development" !== 'production') {
|
23374 | (0, _verifySubselectors.default)(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);
|
23375 | }
|
23376 |
|
23377 | var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;
|
23378 | return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);
|
23379 | }
|
23380 | },{"./verifySubselectors":41,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/helpers/objectWithoutPropertiesLoose":6}],41:[function(require,module,exports){
|
23381 | "use strict";
|
23382 |
|
23383 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
23384 |
|
23385 | exports.__esModule = true;
|
23386 | exports.default = verifySubselectors;
|
23387 |
|
23388 | var _warning = _interopRequireDefault(require("../utils/warning"));
|
23389 |
|
23390 | function verify(selector, methodName, displayName) {
|
23391 | if (!selector) {
|
23392 | throw new Error("Unexpected value for " + methodName + " in " + displayName + ".");
|
23393 | } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') {
|
23394 | if (!selector.hasOwnProperty('dependsOnOwnProps')) {
|
23395 | (0, _warning.default)("The selector for " + methodName + " of " + displayName + " did not specify a value for dependsOnOwnProps.");
|
23396 | }
|
23397 | }
|
23398 | }
|
23399 |
|
23400 | function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) {
|
23401 | verify(mapStateToProps, 'mapStateToProps', displayName);
|
23402 | verify(mapDispatchToProps, 'mapDispatchToProps', displayName);
|
23403 | verify(mergeProps, 'mergeProps', displayName);
|
23404 | }
|
23405 | },{"../utils/warning":49,"@babel/runtime/helpers/interopRequireDefault":4}],42:[function(require,module,exports){
|
23406 | "use strict";
|
23407 |
|
23408 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
23409 |
|
23410 | exports.__esModule = true;
|
23411 | exports.wrapMapToPropsConstant = wrapMapToPropsConstant;
|
23412 | exports.getDependsOnOwnProps = getDependsOnOwnProps;
|
23413 | exports.wrapMapToPropsFunc = wrapMapToPropsFunc;
|
23414 |
|
23415 | var _verifyPlainObject = _interopRequireDefault(require("../utils/verifyPlainObject"));
|
23416 |
|
23417 | function wrapMapToPropsConstant(getConstant) {
|
23418 | return function initConstantSelector(dispatch, options) {
|
23419 | var constant = getConstant(dispatch, options);
|
23420 |
|
23421 | function constantSelector() {
|
23422 | return constant;
|
23423 | }
|
23424 |
|
23425 | constantSelector.dependsOnOwnProps = false;
|
23426 | return constantSelector;
|
23427 | };
|
23428 | }
|
23429 |
|
23430 |
|
23431 |
|
23432 |
|
23433 |
|
23434 |
|
23435 |
|
23436 |
|
23437 | function getDependsOnOwnProps(mapToProps) {
|
23438 | return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;
|
23439 | }
|
23440 |
|
23441 |
|
23442 |
|
23443 |
|
23444 |
|
23445 |
|
23446 |
|
23447 |
|
23448 |
|
23449 |
|
23450 |
|
23451 |
|
23452 |
|
23453 | function wrapMapToPropsFunc(mapToProps, methodName) {
|
23454 | return function initProxySelector(dispatch, _ref) {
|
23455 | var displayName = _ref.displayName;
|
23456 |
|
23457 | var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {
|
23458 | return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);
|
23459 | };
|
23460 |
|
23461 |
|
23462 | proxy.dependsOnOwnProps = true;
|
23463 |
|
23464 | proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
|
23465 | proxy.mapToProps = mapToProps;
|
23466 | proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
|
23467 | var props = proxy(stateOrDispatch, ownProps);
|
23468 |
|
23469 | if (typeof props === 'function') {
|
23470 | proxy.mapToProps = props;
|
23471 | proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
|
23472 | props = proxy(stateOrDispatch, ownProps);
|
23473 | }
|
23474 |
|
23475 | if ("development" !== 'production') (0, _verifyPlainObject.default)(props, displayName, methodName);
|
23476 | return props;
|
23477 | };
|
23478 |
|
23479 | return proxy;
|
23480 | };
|
23481 | }
|
23482 | },{"../utils/verifyPlainObject":48,"@babel/runtime/helpers/interopRequireDefault":4}],43:[function(require,module,exports){
|
23483 | "use strict";
|
23484 |
|
23485 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
23486 |
|
23487 | var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
23488 |
|
23489 | exports.__esModule = true;
|
23490 |
|
23491 | var _Provider = _interopRequireWildcard(require("./components/Provider"));
|
23492 |
|
23493 | exports.Provider = _Provider.default;
|
23494 | exports.createProvider = _Provider.createProvider;
|
23495 |
|
23496 | var _connectAdvanced = _interopRequireDefault(require("./components/connectAdvanced"));
|
23497 |
|
23498 | exports.connectAdvanced = _connectAdvanced.default;
|
23499 |
|
23500 | var _connect = _interopRequireDefault(require("./connect/connect"));
|
23501 |
|
23502 | exports.connect = _connect.default;
|
23503 | },{"./components/Provider":34,"./components/connectAdvanced":35,"./connect/connect":36,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/helpers/interopRequireWildcard":5}],44:[function(require,module,exports){
|
23504 | "use strict";
|
23505 |
|
23506 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
23507 |
|
23508 | exports.__esModule = true;
|
23509 | exports.storeShape = exports.subscriptionShape = void 0;
|
23510 |
|
23511 | var _propTypes = _interopRequireDefault(require("prop-types"));
|
23512 |
|
23513 | var subscriptionShape = _propTypes.default.shape({
|
23514 | trySubscribe: _propTypes.default.func.isRequired,
|
23515 | tryUnsubscribe: _propTypes.default.func.isRequired,
|
23516 | notifyNestedSubs: _propTypes.default.func.isRequired,
|
23517 | isSubscribed: _propTypes.default.func.isRequired
|
23518 | });
|
23519 |
|
23520 | exports.subscriptionShape = subscriptionShape;
|
23521 |
|
23522 | var storeShape = _propTypes.default.shape({
|
23523 | subscribe: _propTypes.default.func.isRequired,
|
23524 | dispatch: _propTypes.default.func.isRequired,
|
23525 | getState: _propTypes.default.func.isRequired
|
23526 | });
|
23527 |
|
23528 | exports.storeShape = storeShape;
|
23529 | },{"@babel/runtime/helpers/interopRequireDefault":4,"prop-types":"prop-types"}],45:[function(require,module,exports){
|
23530 | "use strict";
|
23531 |
|
23532 | exports.__esModule = true;
|
23533 | exports.default = void 0;
|
23534 |
|
23535 |
|
23536 |
|
23537 | var CLEARED = null;
|
23538 | var nullListeners = {
|
23539 | notify: function notify() {}
|
23540 | };
|
23541 |
|
23542 | function createListenerCollection() {
|
23543 |
|
23544 |
|
23545 | var current = [];
|
23546 | var next = [];
|
23547 | return {
|
23548 | clear: function clear() {
|
23549 | next = CLEARED;
|
23550 | current = CLEARED;
|
23551 | },
|
23552 | notify: function notify() {
|
23553 | var listeners = current = next;
|
23554 |
|
23555 | for (var i = 0; i < listeners.length; i++) {
|
23556 | listeners[i]();
|
23557 | }
|
23558 | },
|
23559 | get: function get() {
|
23560 | return next;
|
23561 | },
|
23562 | subscribe: function subscribe(listener) {
|
23563 | var isSubscribed = true;
|
23564 | if (next === current) next = current.slice();
|
23565 | next.push(listener);
|
23566 | return function unsubscribe() {
|
23567 | if (!isSubscribed || current === CLEARED) return;
|
23568 | isSubscribed = false;
|
23569 | if (next === current) next = current.slice();
|
23570 | next.splice(next.indexOf(listener), 1);
|
23571 | };
|
23572 | }
|
23573 | };
|
23574 | }
|
23575 |
|
23576 | var Subscription =
|
23577 |
|
23578 | function () {
|
23579 | function Subscription(store, parentSub, onStateChange) {
|
23580 | this.store = store;
|
23581 | this.parentSub = parentSub;
|
23582 | this.onStateChange = onStateChange;
|
23583 | this.unsubscribe = null;
|
23584 | this.listeners = nullListeners;
|
23585 | }
|
23586 |
|
23587 | var _proto = Subscription.prototype;
|
23588 |
|
23589 | _proto.addNestedSub = function addNestedSub(listener) {
|
23590 | this.trySubscribe();
|
23591 | return this.listeners.subscribe(listener);
|
23592 | };
|
23593 |
|
23594 | _proto.notifyNestedSubs = function notifyNestedSubs() {
|
23595 | this.listeners.notify();
|
23596 | };
|
23597 |
|
23598 | _proto.isSubscribed = function isSubscribed() {
|
23599 | return Boolean(this.unsubscribe);
|
23600 | };
|
23601 |
|
23602 | _proto.trySubscribe = function trySubscribe() {
|
23603 | if (!this.unsubscribe) {
|
23604 | this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange);
|
23605 | this.listeners = createListenerCollection();
|
23606 | }
|
23607 | };
|
23608 |
|
23609 | _proto.tryUnsubscribe = function tryUnsubscribe() {
|
23610 | if (this.unsubscribe) {
|
23611 | this.unsubscribe();
|
23612 | this.unsubscribe = null;
|
23613 | this.listeners.clear();
|
23614 | this.listeners = nullListeners;
|
23615 | }
|
23616 | };
|
23617 |
|
23618 | return Subscription;
|
23619 | }();
|
23620 |
|
23621 | exports.default = Subscription;
|
23622 | },{}],46:[function(require,module,exports){
|
23623 | "use strict";
|
23624 |
|
23625 | exports.__esModule = true;
|
23626 | exports.default = isPlainObject;
|
23627 |
|
23628 |
|
23629 |
|
23630 |
|
23631 |
|
23632 | function isPlainObject(obj) {
|
23633 | if (typeof obj !== 'object' || obj === null) return false;
|
23634 | var proto = Object.getPrototypeOf(obj);
|
23635 | if (proto === null) return true;
|
23636 | var baseProto = proto;
|
23637 |
|
23638 | while (Object.getPrototypeOf(baseProto) !== null) {
|
23639 | baseProto = Object.getPrototypeOf(baseProto);
|
23640 | }
|
23641 |
|
23642 | return proto === baseProto;
|
23643 | }
|
23644 | },{}],47:[function(require,module,exports){
|
23645 | "use strict";
|
23646 |
|
23647 | exports.__esModule = true;
|
23648 | exports.default = shallowEqual;
|
23649 | var hasOwn = Object.prototype.hasOwnProperty;
|
23650 |
|
23651 | function is(x, y) {
|
23652 | if (x === y) {
|
23653 | return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
23654 | } else {
|
23655 | return x !== x && y !== y;
|
23656 | }
|
23657 | }
|
23658 |
|
23659 | function shallowEqual(objA, objB) {
|
23660 | if (is(objA, objB)) return true;
|
23661 |
|
23662 | if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
|
23663 | return false;
|
23664 | }
|
23665 |
|
23666 | var keysA = Object.keys(objA);
|
23667 | var keysB = Object.keys(objB);
|
23668 | if (keysA.length !== keysB.length) return false;
|
23669 |
|
23670 | for (var i = 0; i < keysA.length; i++) {
|
23671 | if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
|
23672 | return false;
|
23673 | }
|
23674 | }
|
23675 |
|
23676 | return true;
|
23677 | }
|
23678 | },{}],48:[function(require,module,exports){
|
23679 | "use strict";
|
23680 |
|
23681 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
23682 |
|
23683 | exports.__esModule = true;
|
23684 | exports.default = verifyPlainObject;
|
23685 |
|
23686 | var _isPlainObject = _interopRequireDefault(require("./isPlainObject"));
|
23687 |
|
23688 | var _warning = _interopRequireDefault(require("./warning"));
|
23689 |
|
23690 | function verifyPlainObject(value, displayName, methodName) {
|
23691 | if (!(0, _isPlainObject.default)(value)) {
|
23692 | (0, _warning.default)(methodName + "() in " + displayName + " must return a plain object. Instead received " + value + ".");
|
23693 | }
|
23694 | }
|
23695 | },{"./isPlainObject":46,"./warning":49,"@babel/runtime/helpers/interopRequireDefault":4}],49:[function(require,module,exports){
|
23696 | "use strict";
|
23697 |
|
23698 | exports.__esModule = true;
|
23699 | exports.default = warning;
|
23700 |
|
23701 |
|
23702 |
|
23703 |
|
23704 |
|
23705 |
|
23706 |
|
23707 | function warning(message) {
|
23708 |
|
23709 | if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
23710 | console.error(message);
|
23711 | }
|
23712 |
|
23713 |
|
23714 |
|
23715 | try {
|
23716 |
|
23717 |
|
23718 |
|
23719 | throw new Error(message);
|
23720 |
|
23721 | } catch (e) {}
|
23722 |
|
23723 |
|
23724 | }
|
23725 | },{}],50:[function(require,module,exports){
|
23726 |
|
23727 |
|
23728 |
|
23729 |
|
23730 |
|
23731 |
|
23732 |
|
23733 |
|
23734 |
|
23735 | 'use strict';
|
23736 |
|
23737 |
|
23738 |
|
23739 | if ("development" !== "production") {
|
23740 | (function() {
|
23741 | 'use strict';
|
23742 |
|
23743 | var _assign = require('object-assign');
|
23744 | var checkPropTypes = require('prop-types/checkPropTypes');
|
23745 |
|
23746 |
|
23747 |
|
23748 | var ReactVersion = '16.7.0';
|
23749 |
|
23750 |
|
23751 |
|
23752 | var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
23753 |
|
23754 | var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
23755 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
23756 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
23757 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
23758 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
23759 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
23760 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
23761 |
|
23762 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
23763 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
23764 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
23765 | var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
23766 | var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
23767 |
|
23768 | var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
23769 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
23770 |
|
23771 | function getIteratorFn(maybeIterable) {
|
23772 | if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
23773 | return null;
|
23774 | }
|
23775 | var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
23776 | if (typeof maybeIterator === 'function') {
|
23777 | return maybeIterator;
|
23778 | }
|
23779 | return null;
|
23780 | }
|
23781 |
|
23782 | var enableHooks = false;
|
23783 |
|
23784 |
|
23785 |
|
23786 |
|
23787 |
|
23788 |
|
23789 |
|
23790 |
|
23791 |
|
23792 |
|
23793 |
|
23794 |
|
23795 |
|
23796 |
|
23797 |
|
23798 |
|
23799 |
|
23800 |
|
23801 |
|
23802 |
|
23803 |
|
23804 |
|
23805 |
|
23806 |
|
23807 |
|
23808 |
|
23809 |
|
23810 |
|
23811 |
|
23812 |
|
23813 |
|
23814 |
|
23815 |
|
23816 |
|
23817 |
|
23818 |
|
23819 |
|
23820 | var enableStableConcurrentModeAPIs = false;
|
23821 |
|
23822 |
|
23823 |
|
23824 |
|
23825 |
|
23826 |
|
23827 |
|
23828 |
|
23829 |
|
23830 |
|
23831 |
|
23832 |
|
23833 | var validateFormat = function () {};
|
23834 |
|
23835 | {
|
23836 | validateFormat = function (format) {
|
23837 | if (format === undefined) {
|
23838 | throw new Error('invariant requires an error message argument');
|
23839 | }
|
23840 | };
|
23841 | }
|
23842 |
|
23843 | function invariant(condition, format, a, b, c, d, e, f) {
|
23844 | validateFormat(format);
|
23845 |
|
23846 | if (!condition) {
|
23847 | var error = void 0;
|
23848 | if (format === undefined) {
|
23849 | error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
23850 | } else {
|
23851 | var args = [a, b, c, d, e, f];
|
23852 | var argIndex = 0;
|
23853 | error = new Error(format.replace(/%s/g, function () {
|
23854 | return args[argIndex++];
|
23855 | }));
|
23856 | error.name = 'Invariant Violation';
|
23857 | }
|
23858 |
|
23859 | error.framesToPop = 1;
|
23860 | throw error;
|
23861 | }
|
23862 | }
|
23863 |
|
23864 |
|
23865 |
|
23866 |
|
23867 |
|
23868 |
|
23869 |
|
23870 |
|
23871 |
|
23872 |
|
23873 |
|
23874 |
|
23875 |
|
23876 |
|
23877 |
|
23878 |
|
23879 |
|
23880 |
|
23881 | var lowPriorityWarning = function () {};
|
23882 |
|
23883 | {
|
23884 | var printWarning = function (format) {
|
23885 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
23886 | args[_key - 1] = arguments[_key];
|
23887 | }
|
23888 |
|
23889 | var argIndex = 0;
|
23890 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
23891 | return args[argIndex++];
|
23892 | });
|
23893 | if (typeof console !== 'undefined') {
|
23894 | console.warn(message);
|
23895 | }
|
23896 | try {
|
23897 |
|
23898 |
|
23899 |
|
23900 | throw new Error(message);
|
23901 | } catch (x) {}
|
23902 | };
|
23903 |
|
23904 | lowPriorityWarning = function (condition, format) {
|
23905 | if (format === undefined) {
|
23906 | throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
23907 | }
|
23908 | if (!condition) {
|
23909 | for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
23910 | args[_key2 - 2] = arguments[_key2];
|
23911 | }
|
23912 |
|
23913 | printWarning.apply(undefined, [format].concat(args));
|
23914 | }
|
23915 | };
|
23916 | }
|
23917 |
|
23918 | var lowPriorityWarning$1 = lowPriorityWarning;
|
23919 |
|
23920 |
|
23921 |
|
23922 |
|
23923 |
|
23924 |
|
23925 |
|
23926 |
|
23927 | var warningWithoutStack = function () {};
|
23928 |
|
23929 | {
|
23930 | warningWithoutStack = function (condition, format) {
|
23931 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
23932 | args[_key - 2] = arguments[_key];
|
23933 | }
|
23934 |
|
23935 | if (format === undefined) {
|
23936 | throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
23937 | }
|
23938 | if (args.length > 8) {
|
23939 |
|
23940 | throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
|
23941 | }
|
23942 | if (condition) {
|
23943 | return;
|
23944 | }
|
23945 | if (typeof console !== 'undefined') {
|
23946 | var argsWithFormat = args.map(function (item) {
|
23947 | return '' + item;
|
23948 | });
|
23949 | argsWithFormat.unshift('Warning: ' + format);
|
23950 |
|
23951 |
|
23952 |
|
23953 | Function.prototype.apply.call(console.error, console, argsWithFormat);
|
23954 | }
|
23955 | try {
|
23956 |
|
23957 |
|
23958 |
|
23959 | var argIndex = 0;
|
23960 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
23961 | return args[argIndex++];
|
23962 | });
|
23963 | throw new Error(message);
|
23964 | } catch (x) {}
|
23965 | };
|
23966 | }
|
23967 |
|
23968 | var warningWithoutStack$1 = warningWithoutStack;
|
23969 |
|
23970 | var didWarnStateUpdateForUnmountedComponent = {};
|
23971 |
|
23972 | function warnNoop(publicInstance, callerName) {
|
23973 | {
|
23974 | var _constructor = publicInstance.constructor;
|
23975 | var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
23976 | var warningKey = componentName + '.' + callerName;
|
23977 | if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
23978 | return;
|
23979 | }
|
23980 | warningWithoutStack$1(false, "Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
|
23981 | didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
23982 | }
|
23983 | }
|
23984 |
|
23985 |
|
23986 |
|
23987 |
|
23988 | var ReactNoopUpdateQueue = {
|
23989 | |
23990 |
|
23991 |
|
23992 |
|
23993 |
|
23994 |
|
23995 |
|
23996 | isMounted: function (publicInstance) {
|
23997 | return false;
|
23998 | },
|
23999 |
|
24000 | |
24001 |
|
24002 |
|
24003 |
|
24004 |
|
24005 |
|
24006 |
|
24007 |
|
24008 |
|
24009 |
|
24010 |
|
24011 |
|
24012 |
|
24013 |
|
24014 |
|
24015 | enqueueForceUpdate: function (publicInstance, callback, callerName) {
|
24016 | warnNoop(publicInstance, 'forceUpdate');
|
24017 | },
|
24018 |
|
24019 | |
24020 |
|
24021 |
|
24022 |
|
24023 |
|
24024 |
|
24025 |
|
24026 |
|
24027 |
|
24028 |
|
24029 |
|
24030 |
|
24031 |
|
24032 | enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
|
24033 | warnNoop(publicInstance, 'replaceState');
|
24034 | },
|
24035 |
|
24036 | |
24037 |
|
24038 |
|
24039 |
|
24040 |
|
24041 |
|
24042 |
|
24043 |
|
24044 |
|
24045 |
|
24046 |
|
24047 |
|
24048 | enqueueSetState: function (publicInstance, partialState, callback, callerName) {
|
24049 | warnNoop(publicInstance, 'setState');
|
24050 | }
|
24051 | };
|
24052 |
|
24053 | var emptyObject = {};
|
24054 | {
|
24055 | Object.freeze(emptyObject);
|
24056 | }
|
24057 |
|
24058 |
|
24059 |
|
24060 |
|
24061 | function Component(props, context, updater) {
|
24062 | this.props = props;
|
24063 | this.context = context;
|
24064 |
|
24065 | this.refs = emptyObject;
|
24066 |
|
24067 |
|
24068 | this.updater = updater || ReactNoopUpdateQueue;
|
24069 | }
|
24070 |
|
24071 | Component.prototype.isReactComponent = {};
|
24072 |
|
24073 |
|
24074 |
|
24075 |
|
24076 |
|
24077 |
|
24078 |
|
24079 |
|
24080 |
|
24081 |
|
24082 |
|
24083 |
|
24084 |
|
24085 |
|
24086 |
|
24087 |
|
24088 |
|
24089 |
|
24090 |
|
24091 |
|
24092 |
|
24093 |
|
24094 |
|
24095 |
|
24096 |
|
24097 |
|
24098 | Component.prototype.setState = function (partialState, callback) {
|
24099 | !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;
|
24100 | this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
24101 | };
|
24102 |
|
24103 |
|
24104 |
|
24105 |
|
24106 |
|
24107 |
|
24108 |
|
24109 |
|
24110 |
|
24111 |
|
24112 |
|
24113 |
|
24114 |
|
24115 |
|
24116 |
|
24117 | Component.prototype.forceUpdate = function (callback) {
|
24118 | this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
24119 | };
|
24120 |
|
24121 |
|
24122 |
|
24123 |
|
24124 |
|
24125 |
|
24126 | {
|
24127 | var deprecatedAPIs = {
|
24128 | isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
24129 | replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
24130 | };
|
24131 | var defineDeprecationWarning = function (methodName, info) {
|
24132 | Object.defineProperty(Component.prototype, methodName, {
|
24133 | get: function () {
|
24134 | lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
24135 | return undefined;
|
24136 | }
|
24137 | });
|
24138 | };
|
24139 | for (var fnName in deprecatedAPIs) {
|
24140 | if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
24141 | defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
24142 | }
|
24143 | }
|
24144 | }
|
24145 |
|
24146 | function ComponentDummy() {}
|
24147 | ComponentDummy.prototype = Component.prototype;
|
24148 |
|
24149 |
|
24150 |
|
24151 |
|
24152 | function PureComponent(props, context, updater) {
|
24153 | this.props = props;
|
24154 | this.context = context;
|
24155 |
|
24156 | this.refs = emptyObject;
|
24157 | this.updater = updater || ReactNoopUpdateQueue;
|
24158 | }
|
24159 |
|
24160 | var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
24161 | pureComponentPrototype.constructor = PureComponent;
|
24162 |
|
24163 | _assign(pureComponentPrototype, Component.prototype);
|
24164 | pureComponentPrototype.isPureReactComponent = true;
|
24165 |
|
24166 |
|
24167 | function createRef() {
|
24168 | var refObject = {
|
24169 | current: null
|
24170 | };
|
24171 | {
|
24172 | Object.seal(refObject);
|
24173 | }
|
24174 | return refObject;
|
24175 | }
|
24176 |
|
24177 |
|
24178 |
|
24179 |
|
24180 |
|
24181 |
|
24182 |
|
24183 | var ReactCurrentOwner = {
|
24184 | |
24185 |
|
24186 |
|
24187 |
|
24188 | current: null,
|
24189 | currentDispatcher: null
|
24190 | };
|
24191 |
|
24192 | var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
24193 |
|
24194 | var describeComponentFrame = function (name, source, ownerName) {
|
24195 | var sourceInfo = '';
|
24196 | if (source) {
|
24197 | var path = source.fileName;
|
24198 | var fileName = path.replace(BEFORE_SLASH_RE, '');
|
24199 | {
|
24200 |
|
24201 |
|
24202 | if (/^index\./.test(fileName)) {
|
24203 | var match = path.match(BEFORE_SLASH_RE);
|
24204 | if (match) {
|
24205 | var pathBeforeSlash = match[1];
|
24206 | if (pathBeforeSlash) {
|
24207 | var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
24208 | fileName = folderName + '/' + fileName;
|
24209 | }
|
24210 | }
|
24211 | }
|
24212 | }
|
24213 | sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
24214 | } else if (ownerName) {
|
24215 | sourceInfo = ' (created by ' + ownerName + ')';
|
24216 | }
|
24217 | return '\n in ' + (name || 'Unknown') + sourceInfo;
|
24218 | };
|
24219 |
|
24220 | var Resolved = 1;
|
24221 |
|
24222 |
|
24223 | function refineResolvedLazyComponent(lazyComponent) {
|
24224 | return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
24225 | }
|
24226 |
|
24227 | function getWrappedName(outerType, innerType, wrapperName) {
|
24228 | var functionName = innerType.displayName || innerType.name || '';
|
24229 | return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
|
24230 | }
|
24231 |
|
24232 | function getComponentName(type) {
|
24233 | if (type == null) {
|
24234 |
|
24235 | return null;
|
24236 | }
|
24237 | {
|
24238 | if (typeof type.tag === 'number') {
|
24239 | warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
24240 | }
|
24241 | }
|
24242 | if (typeof type === 'function') {
|
24243 | return type.displayName || type.name || null;
|
24244 | }
|
24245 | if (typeof type === 'string') {
|
24246 | return type;
|
24247 | }
|
24248 | switch (type) {
|
24249 | case REACT_CONCURRENT_MODE_TYPE:
|
24250 | return 'ConcurrentMode';
|
24251 | case REACT_FRAGMENT_TYPE:
|
24252 | return 'Fragment';
|
24253 | case REACT_PORTAL_TYPE:
|
24254 | return 'Portal';
|
24255 | case REACT_PROFILER_TYPE:
|
24256 | return 'Profiler';
|
24257 | case REACT_STRICT_MODE_TYPE:
|
24258 | return 'StrictMode';
|
24259 | case REACT_SUSPENSE_TYPE:
|
24260 | return 'Suspense';
|
24261 | }
|
24262 | if (typeof type === 'object') {
|
24263 | switch (type.$$typeof) {
|
24264 | case REACT_CONTEXT_TYPE:
|
24265 | return 'Context.Consumer';
|
24266 | case REACT_PROVIDER_TYPE:
|
24267 | return 'Context.Provider';
|
24268 | case REACT_FORWARD_REF_TYPE:
|
24269 | return getWrappedName(type, type.render, 'ForwardRef');
|
24270 | case REACT_MEMO_TYPE:
|
24271 | return getComponentName(type.type);
|
24272 | case REACT_LAZY_TYPE:
|
24273 | {
|
24274 | var thenable = type;
|
24275 | var resolvedThenable = refineResolvedLazyComponent(thenable);
|
24276 | if (resolvedThenable) {
|
24277 | return getComponentName(resolvedThenable);
|
24278 | }
|
24279 | }
|
24280 | }
|
24281 | }
|
24282 | return null;
|
24283 | }
|
24284 |
|
24285 | var ReactDebugCurrentFrame = {};
|
24286 |
|
24287 | var currentlyValidatingElement = null;
|
24288 |
|
24289 | function setCurrentlyValidatingElement(element) {
|
24290 | {
|
24291 | currentlyValidatingElement = element;
|
24292 | }
|
24293 | }
|
24294 |
|
24295 | {
|
24296 |
|
24297 | ReactDebugCurrentFrame.getCurrentStack = null;
|
24298 |
|
24299 | ReactDebugCurrentFrame.getStackAddendum = function () {
|
24300 | var stack = '';
|
24301 |
|
24302 |
|
24303 | if (currentlyValidatingElement) {
|
24304 | var name = getComponentName(currentlyValidatingElement.type);
|
24305 | var owner = currentlyValidatingElement._owner;
|
24306 | stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
24307 | }
|
24308 |
|
24309 |
|
24310 | var impl = ReactDebugCurrentFrame.getCurrentStack;
|
24311 | if (impl) {
|
24312 | stack += impl() || '';
|
24313 | }
|
24314 |
|
24315 | return stack;
|
24316 | };
|
24317 | }
|
24318 |
|
24319 | var ReactSharedInternals = {
|
24320 | ReactCurrentOwner: ReactCurrentOwner,
|
24321 |
|
24322 | assign: _assign
|
24323 | };
|
24324 |
|
24325 | {
|
24326 | _assign(ReactSharedInternals, {
|
24327 |
|
24328 | ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
24329 |
|
24330 |
|
24331 | ReactComponentTreeHook: {}
|
24332 | });
|
24333 | }
|
24334 |
|
24335 |
|
24336 |
|
24337 |
|
24338 |
|
24339 |
|
24340 |
|
24341 |
|
24342 | var warning = warningWithoutStack$1;
|
24343 |
|
24344 | {
|
24345 | warning = function (condition, format) {
|
24346 | if (condition) {
|
24347 | return;
|
24348 | }
|
24349 | var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
24350 | var stack = ReactDebugCurrentFrame.getStackAddendum();
|
24351 |
|
24352 |
|
24353 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
24354 | args[_key - 2] = arguments[_key];
|
24355 | }
|
24356 |
|
24357 | warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
|
24358 | };
|
24359 | }
|
24360 |
|
24361 | var warning$1 = warning;
|
24362 |
|
24363 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
24364 |
|
24365 | var RESERVED_PROPS = {
|
24366 | key: true,
|
24367 | ref: true,
|
24368 | __self: true,
|
24369 | __source: true
|
24370 | };
|
24371 |
|
24372 | var specialPropKeyWarningShown = void 0;
|
24373 | var specialPropRefWarningShown = void 0;
|
24374 |
|
24375 | function hasValidRef(config) {
|
24376 | {
|
24377 | if (hasOwnProperty.call(config, 'ref')) {
|
24378 | var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
24379 | if (getter && getter.isReactWarning) {
|
24380 | return false;
|
24381 | }
|
24382 | }
|
24383 | }
|
24384 | return config.ref !== undefined;
|
24385 | }
|
24386 |
|
24387 | function hasValidKey(config) {
|
24388 | {
|
24389 | if (hasOwnProperty.call(config, 'key')) {
|
24390 | var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
24391 | if (getter && getter.isReactWarning) {
|
24392 | return false;
|
24393 | }
|
24394 | }
|
24395 | }
|
24396 | return config.key !== undefined;
|
24397 | }
|
24398 |
|
24399 | function defineKeyPropWarningGetter(props, displayName) {
|
24400 | var warnAboutAccessingKey = function () {
|
24401 | if (!specialPropKeyWarningShown) {
|
24402 | specialPropKeyWarningShown = true;
|
24403 | warningWithoutStack$1(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
|
24404 | }
|
24405 | };
|
24406 | warnAboutAccessingKey.isReactWarning = true;
|
24407 | Object.defineProperty(props, 'key', {
|
24408 | get: warnAboutAccessingKey,
|
24409 | configurable: true
|
24410 | });
|
24411 | }
|
24412 |
|
24413 | function defineRefPropWarningGetter(props, displayName) {
|
24414 | var warnAboutAccessingRef = function () {
|
24415 | if (!specialPropRefWarningShown) {
|
24416 | specialPropRefWarningShown = true;
|
24417 | warningWithoutStack$1(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
|
24418 | }
|
24419 | };
|
24420 | warnAboutAccessingRef.isReactWarning = true;
|
24421 | Object.defineProperty(props, 'ref', {
|
24422 | get: warnAboutAccessingRef,
|
24423 | configurable: true
|
24424 | });
|
24425 | }
|
24426 |
|
24427 | /**
|
24428 | * Factory method to create a new React element. This no longer adheres to
|
24429 | * the class pattern, so do not use new to call it. Also, no instanceof check
|
24430 | * will work. Instead test $$typeof field against Symbol.for('react.element') to check
|
24431 | * if something is a React Element.
|
24432 | *
|
24433 | * @param {*} type
|
24434 | * @param {*} key
|
24435 | * @param {string|object} ref
|
24436 | * @param {*} self A *temporary* helper to detect places where `this` is
|
24437 | * different from the `owner` when React.createElement is called, so that we
|
24438 | * can warn. We want to get rid of owner and replace string `ref`s with arrow
|
24439 | * functions, and as long as `this` and owner are the same, there will be no
|
24440 | * change in behavior.
|
24441 | * @param {*} source An annotation object (added by a transpiler or otherwise)
|
24442 | * indicating filename, line number, and/or other information.
|
24443 | * @param {*} owner
|
24444 | * @param {*} props
|
24445 | * @internal
|
24446 | */
|
24447 | var ReactElement = function (type, key, ref, self, source, owner, props) {
|
24448 | var element = {
|
24449 |
|
24450 | $$typeof: REACT_ELEMENT_TYPE,
|
24451 |
|
24452 |
|
24453 | type: type,
|
24454 | key: key,
|
24455 | ref: ref,
|
24456 | props: props,
|
24457 |
|
24458 |
|
24459 | _owner: owner
|
24460 | };
|
24461 |
|
24462 | {
|
24463 |
|
24464 |
|
24465 |
|
24466 |
|
24467 | element._store = {};
|
24468 |
|
24469 |
|
24470 |
|
24471 |
|
24472 |
|
24473 | Object.defineProperty(element._store, 'validated', {
|
24474 | configurable: false,
|
24475 | enumerable: false,
|
24476 | writable: true,
|
24477 | value: false
|
24478 | });
|
24479 |
|
24480 | Object.defineProperty(element, '_self', {
|
24481 | configurable: false,
|
24482 | enumerable: false,
|
24483 | writable: false,
|
24484 | value: self
|
24485 | });
|
24486 |
|
24487 |
|
24488 | Object.defineProperty(element, '_source', {
|
24489 | configurable: false,
|
24490 | enumerable: false,
|
24491 | writable: false,
|
24492 | value: source
|
24493 | });
|
24494 | if (Object.freeze) {
|
24495 | Object.freeze(element.props);
|
24496 | Object.freeze(element);
|
24497 | }
|
24498 | }
|
24499 |
|
24500 | return element;
|
24501 | };
|
24502 |
|
24503 |
|
24504 |
|
24505 |
|
24506 |
|
24507 | function createElement(type, config, children) {
|
24508 | var propName = void 0;
|
24509 |
|
24510 |
|
24511 | var props = {};
|
24512 |
|
24513 | var key = null;
|
24514 | var ref = null;
|
24515 | var self = null;
|
24516 | var source = null;
|
24517 |
|
24518 | if (config != null) {
|
24519 | if (hasValidRef(config)) {
|
24520 | ref = config.ref;
|
24521 | }
|
24522 | if (hasValidKey(config)) {
|
24523 | key = '' + config.key;
|
24524 | }
|
24525 |
|
24526 | self = config.__self === undefined ? null : config.__self;
|
24527 | source = config.__source === undefined ? null : config.__source;
|
24528 |
|
24529 | for (propName in config) {
|
24530 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
24531 | props[propName] = config[propName];
|
24532 | }
|
24533 | }
|
24534 | }
|
24535 |
|
24536 |
|
24537 |
|
24538 | var childrenLength = arguments.length - 2;
|
24539 | if (childrenLength === 1) {
|
24540 | props.children = children;
|
24541 | } else if (childrenLength > 1) {
|
24542 | var childArray = Array(childrenLength);
|
24543 | for (var i = 0; i < childrenLength; i++) {
|
24544 | childArray[i] = arguments[i + 2];
|
24545 | }
|
24546 | {
|
24547 | if (Object.freeze) {
|
24548 | Object.freeze(childArray);
|
24549 | }
|
24550 | }
|
24551 | props.children = childArray;
|
24552 | }
|
24553 |
|
24554 |
|
24555 | if (type && type.defaultProps) {
|
24556 | var defaultProps = type.defaultProps;
|
24557 | for (propName in defaultProps) {
|
24558 | if (props[propName] === undefined) {
|
24559 | props[propName] = defaultProps[propName];
|
24560 | }
|
24561 | }
|
24562 | }
|
24563 | {
|
24564 | if (key || ref) {
|
24565 | var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
24566 | if (key) {
|
24567 | defineKeyPropWarningGetter(props, displayName);
|
24568 | }
|
24569 | if (ref) {
|
24570 | defineRefPropWarningGetter(props, displayName);
|
24571 | }
|
24572 | }
|
24573 | }
|
24574 | return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
24575 | }
|
24576 |
|
24577 |
|
24578 |
|
24579 |
|
24580 |
|
24581 |
|
24582 |
|
24583 | function cloneAndReplaceKey(oldElement, newKey) {
|
24584 | var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
24585 |
|
24586 | return newElement;
|
24587 | }
|
24588 |
|
24589 |
|
24590 |
|
24591 |
|
24592 |
|
24593 | function cloneElement(element, config, children) {
|
24594 | !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;
|
24595 |
|
24596 | var propName = void 0;
|
24597 |
|
24598 |
|
24599 | var props = _assign({}, element.props);
|
24600 |
|
24601 |
|
24602 | var key = element.key;
|
24603 | var ref = element.ref;
|
24604 |
|
24605 | var self = element._self;
|
24606 |
|
24607 |
|
24608 |
|
24609 | var source = element._source;
|
24610 |
|
24611 |
|
24612 | var owner = element._owner;
|
24613 |
|
24614 | if (config != null) {
|
24615 | if (hasValidRef(config)) {
|
24616 |
|
24617 | ref = config.ref;
|
24618 | owner = ReactCurrentOwner.current;
|
24619 | }
|
24620 | if (hasValidKey(config)) {
|
24621 | key = '' + config.key;
|
24622 | }
|
24623 |
|
24624 |
|
24625 | var defaultProps = void 0;
|
24626 | if (element.type && element.type.defaultProps) {
|
24627 | defaultProps = element.type.defaultProps;
|
24628 | }
|
24629 | for (propName in config) {
|
24630 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
24631 | if (config[propName] === undefined && defaultProps !== undefined) {
|
24632 |
|
24633 | props[propName] = defaultProps[propName];
|
24634 | } else {
|
24635 | props[propName] = config[propName];
|
24636 | }
|
24637 | }
|
24638 | }
|
24639 | }
|
24640 |
|
24641 |
|
24642 |
|
24643 | var childrenLength = arguments.length - 2;
|
24644 | if (childrenLength === 1) {
|
24645 | props.children = children;
|
24646 | } else if (childrenLength > 1) {
|
24647 | var childArray = Array(childrenLength);
|
24648 | for (var i = 0; i < childrenLength; i++) {
|
24649 | childArray[i] = arguments[i + 2];
|
24650 | }
|
24651 | props.children = childArray;
|
24652 | }
|
24653 |
|
24654 | return ReactElement(element.type, key, ref, self, source, owner, props);
|
24655 | }
|
24656 |
|
24657 |
|
24658 |
|
24659 |
|
24660 |
|
24661 |
|
24662 |
|
24663 |
|
24664 | function isValidElement(object) {
|
24665 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
24666 | }
|
24667 |
|
24668 | var SEPARATOR = '.';
|
24669 | var SUBSEPARATOR = ':';
|
24670 |
|
24671 |
|
24672 |
|
24673 |
|
24674 |
|
24675 |
|
24676 |
|
24677 | function escape(key) {
|
24678 | var escapeRegex = /[=:]/g;
|
24679 | var escaperLookup = {
|
24680 | '=': '=0',
|
24681 | ':': '=2'
|
24682 | };
|
24683 | var escapedString = ('' + key).replace(escapeRegex, function (match) {
|
24684 | return escaperLookup[match];
|
24685 | });
|
24686 |
|
24687 | return '$' + escapedString;
|
24688 | }
|
24689 |
|
24690 |
|
24691 |
|
24692 |
|
24693 |
|
24694 |
|
24695 | var didWarnAboutMaps = false;
|
24696 |
|
24697 | var userProvidedKeyEscapeRegex = /\/+/g;
|
24698 | function escapeUserProvidedKey(text) {
|
24699 | return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
24700 | }
|
24701 |
|
24702 | var POOL_SIZE = 10;
|
24703 | var traverseContextPool = [];
|
24704 | function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
|
24705 | if (traverseContextPool.length) {
|
24706 | var traverseContext = traverseContextPool.pop();
|
24707 | traverseContext.result = mapResult;
|
24708 | traverseContext.keyPrefix = keyPrefix;
|
24709 | traverseContext.func = mapFunction;
|
24710 | traverseContext.context = mapContext;
|
24711 | traverseContext.count = 0;
|
24712 | return traverseContext;
|
24713 | } else {
|
24714 | return {
|
24715 | result: mapResult,
|
24716 | keyPrefix: keyPrefix,
|
24717 | func: mapFunction,
|
24718 | context: mapContext,
|
24719 | count: 0
|
24720 | };
|
24721 | }
|
24722 | }
|
24723 |
|
24724 | function releaseTraverseContext(traverseContext) {
|
24725 | traverseContext.result = null;
|
24726 | traverseContext.keyPrefix = null;
|
24727 | traverseContext.func = null;
|
24728 | traverseContext.context = null;
|
24729 | traverseContext.count = 0;
|
24730 | if (traverseContextPool.length < POOL_SIZE) {
|
24731 | traverseContextPool.push(traverseContext);
|
24732 | }
|
24733 | }
|
24734 |
|
24735 |
|
24736 |
|
24737 |
|
24738 |
|
24739 |
|
24740 |
|
24741 |
|
24742 |
|
24743 | function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
24744 | var type = typeof children;
|
24745 |
|
24746 | if (type === 'undefined' || type === 'boolean') {
|
24747 |
|
24748 | children = null;
|
24749 | }
|
24750 |
|
24751 | var invokeCallback = false;
|
24752 |
|
24753 | if (children === null) {
|
24754 | invokeCallback = true;
|
24755 | } else {
|
24756 | switch (type) {
|
24757 | case 'string':
|
24758 | case 'number':
|
24759 | invokeCallback = true;
|
24760 | break;
|
24761 | case 'object':
|
24762 | switch (children.$$typeof) {
|
24763 | case REACT_ELEMENT_TYPE:
|
24764 | case REACT_PORTAL_TYPE:
|
24765 | invokeCallback = true;
|
24766 | }
|
24767 | }
|
24768 | }
|
24769 |
|
24770 | if (invokeCallback) {
|
24771 | callback(traverseContext, children,
|
24772 |
|
24773 |
|
24774 | nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
24775 | return 1;
|
24776 | }
|
24777 |
|
24778 | var child = void 0;
|
24779 | var nextName = void 0;
|
24780 | var subtreeCount = 0;
|
24781 | var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
24782 |
|
24783 | if (Array.isArray(children)) {
|
24784 | for (var i = 0; i < children.length; i++) {
|
24785 | child = children[i];
|
24786 | nextName = nextNamePrefix + getComponentKey(child, i);
|
24787 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
24788 | }
|
24789 | } else {
|
24790 | var iteratorFn = getIteratorFn(children);
|
24791 | if (typeof iteratorFn === 'function') {
|
24792 | {
|
24793 |
|
24794 | if (iteratorFn === children.entries) {
|
24795 | !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
|
24796 | didWarnAboutMaps = true;
|
24797 | }
|
24798 | }
|
24799 |
|
24800 | var iterator = iteratorFn.call(children);
|
24801 | var step = void 0;
|
24802 | var ii = 0;
|
24803 | while (!(step = iterator.next()).done) {
|
24804 | child = step.value;
|
24805 | nextName = nextNamePrefix + getComponentKey(child, ii++);
|
24806 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
24807 | }
|
24808 | } else if (type === 'object') {
|
24809 | var addendum = '';
|
24810 | {
|
24811 | addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
|
24812 | }
|
24813 | var childrenString = '' + children;
|
24814 | invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
|
24815 | }
|
24816 | }
|
24817 |
|
24818 | return subtreeCount;
|
24819 | }
|
24820 |
|
24821 |
|
24822 |
|
24823 |
|
24824 |
|
24825 |
|
24826 |
|
24827 |
|
24828 |
|
24829 |
|
24830 |
|
24831 |
|
24832 |
|
24833 |
|
24834 |
|
24835 |
|
24836 |
|
24837 | function traverseAllChildren(children, callback, traverseContext) {
|
24838 | if (children == null) {
|
24839 | return 0;
|
24840 | }
|
24841 |
|
24842 | return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
24843 | }
|
24844 |
|
24845 |
|
24846 |
|
24847 |
|
24848 |
|
24849 |
|
24850 |
|
24851 |
|
24852 | function getComponentKey(component, index) {
|
24853 |
|
24854 |
|
24855 | if (typeof component === 'object' && component !== null && component.key != null) {
|
24856 |
|
24857 | return escape(component.key);
|
24858 | }
|
24859 |
|
24860 | return index.toString(36);
|
24861 | }
|
24862 |
|
24863 | function forEachSingleChild(bookKeeping, child, name) {
|
24864 | var func = bookKeeping.func,
|
24865 | context = bookKeeping.context;
|
24866 |
|
24867 | func.call(context, child, bookKeeping.count++);
|
24868 | }
|
24869 |
|
24870 |
|
24871 |
|
24872 |
|
24873 |
|
24874 |
|
24875 |
|
24876 |
|
24877 |
|
24878 |
|
24879 |
|
24880 |
|
24881 |
|
24882 | function forEachChildren(children, forEachFunc, forEachContext) {
|
24883 | if (children == null) {
|
24884 | return children;
|
24885 | }
|
24886 | var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
|
24887 | traverseAllChildren(children, forEachSingleChild, traverseContext);
|
24888 | releaseTraverseContext(traverseContext);
|
24889 | }
|
24890 |
|
24891 | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
24892 | var result = bookKeeping.result,
|
24893 | keyPrefix = bookKeeping.keyPrefix,
|
24894 | func = bookKeeping.func,
|
24895 | context = bookKeeping.context;
|
24896 |
|
24897 |
|
24898 | var mappedChild = func.call(context, child, bookKeeping.count++);
|
24899 | if (Array.isArray(mappedChild)) {
|
24900 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
|
24901 | return c;
|
24902 | });
|
24903 | } else if (mappedChild != null) {
|
24904 | if (isValidElement(mappedChild)) {
|
24905 | mappedChild = cloneAndReplaceKey(mappedChild,
|
24906 |
|
24907 |
|
24908 | keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
|
24909 | }
|
24910 | result.push(mappedChild);
|
24911 | }
|
24912 | }
|
24913 |
|
24914 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
24915 | var escapedPrefix = '';
|
24916 | if (prefix != null) {
|
24917 | escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
24918 | }
|
24919 | var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
|
24920 | traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
24921 | releaseTraverseContext(traverseContext);
|
24922 | }
|
24923 |
|
24924 |
|
24925 |
|
24926 |
|
24927 |
|
24928 |
|
24929 |
|
24930 |
|
24931 |
|
24932 |
|
24933 |
|
24934 |
|
24935 |
|
24936 |
|
24937 | function mapChildren(children, func, context) {
|
24938 | if (children == null) {
|
24939 | return children;
|
24940 | }
|
24941 | var result = [];
|
24942 | mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
24943 | return result;
|
24944 | }
|
24945 |
|
24946 |
|
24947 |
|
24948 |
|
24949 |
|
24950 |
|
24951 |
|
24952 |
|
24953 |
|
24954 |
|
24955 | function countChildren(children) {
|
24956 | return traverseAllChildren(children, function () {
|
24957 | return null;
|
24958 | }, null);
|
24959 | }
|
24960 |
|
24961 |
|
24962 |
|
24963 |
|
24964 |
|
24965 |
|
24966 |
|
24967 | function toArray(children) {
|
24968 | var result = [];
|
24969 | mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
|
24970 | return child;
|
24971 | });
|
24972 | return result;
|
24973 | }
|
24974 |
|
24975 |
|
24976 |
|
24977 |
|
24978 |
|
24979 |
|
24980 |
|
24981 |
|
24982 |
|
24983 |
|
24984 |
|
24985 |
|
24986 |
|
24987 |
|
24988 |
|
24989 | function onlyChild(children) {
|
24990 | !isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
|
24991 | return children;
|
24992 | }
|
24993 |
|
24994 | function createContext(defaultValue, calculateChangedBits) {
|
24995 | if (calculateChangedBits === undefined) {
|
24996 | calculateChangedBits = null;
|
24997 | } else {
|
24998 | {
|
24999 | !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0;
|
25000 | }
|
25001 | }
|
25002 |
|
25003 | var context = {
|
25004 | $$typeof: REACT_CONTEXT_TYPE,
|
25005 | _calculateChangedBits: calculateChangedBits,
|
25006 |
|
25007 |
|
25008 |
|
25009 |
|
25010 |
|
25011 | _currentValue: defaultValue,
|
25012 | _currentValue2: defaultValue,
|
25013 |
|
25014 |
|
25015 | _threadCount: 0,
|
25016 |
|
25017 | Provider: null,
|
25018 | Consumer: null
|
25019 | };
|
25020 |
|
25021 | context.Provider = {
|
25022 | $$typeof: REACT_PROVIDER_TYPE,
|
25023 | _context: context
|
25024 | };
|
25025 |
|
25026 | var hasWarnedAboutUsingNestedContextConsumers = false;
|
25027 | var hasWarnedAboutUsingConsumerProvider = false;
|
25028 |
|
25029 | {
|
25030 |
|
25031 |
|
25032 |
|
25033 | var Consumer = {
|
25034 | $$typeof: REACT_CONTEXT_TYPE,
|
25035 | _context: context,
|
25036 | _calculateChangedBits: context._calculateChangedBits
|
25037 | };
|
25038 |
|
25039 | Object.defineProperties(Consumer, {
|
25040 | Provider: {
|
25041 | get: function () {
|
25042 | if (!hasWarnedAboutUsingConsumerProvider) {
|
25043 | hasWarnedAboutUsingConsumerProvider = true;
|
25044 | warning$1(false, 'Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
|
25045 | }
|
25046 | return context.Provider;
|
25047 | },
|
25048 | set: function (_Provider) {
|
25049 | context.Provider = _Provider;
|
25050 | }
|
25051 | },
|
25052 | _currentValue: {
|
25053 | get: function () {
|
25054 | return context._currentValue;
|
25055 | },
|
25056 | set: function (_currentValue) {
|
25057 | context._currentValue = _currentValue;
|
25058 | }
|
25059 | },
|
25060 | _currentValue2: {
|
25061 | get: function () {
|
25062 | return context._currentValue2;
|
25063 | },
|
25064 | set: function (_currentValue2) {
|
25065 | context._currentValue2 = _currentValue2;
|
25066 | }
|
25067 | },
|
25068 | _threadCount: {
|
25069 | get: function () {
|
25070 | return context._threadCount;
|
25071 | },
|
25072 | set: function (_threadCount) {
|
25073 | context._threadCount = _threadCount;
|
25074 | }
|
25075 | },
|
25076 | Consumer: {
|
25077 | get: function () {
|
25078 | if (!hasWarnedAboutUsingNestedContextConsumers) {
|
25079 | hasWarnedAboutUsingNestedContextConsumers = true;
|
25080 | warning$1(false, 'Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
25081 | }
|
25082 | return context.Consumer;
|
25083 | }
|
25084 | }
|
25085 | });
|
25086 |
|
25087 | context.Consumer = Consumer;
|
25088 | }
|
25089 |
|
25090 | {
|
25091 | context._currentRenderer = null;
|
25092 | context._currentRenderer2 = null;
|
25093 | }
|
25094 |
|
25095 | return context;
|
25096 | }
|
25097 |
|
25098 | function lazy(ctor) {
|
25099 | var lazyType = {
|
25100 | $$typeof: REACT_LAZY_TYPE,
|
25101 | _ctor: ctor,
|
25102 |
|
25103 | _status: -1,
|
25104 | _result: null
|
25105 | };
|
25106 |
|
25107 | {
|
25108 |
|
25109 | var defaultProps = void 0;
|
25110 | var propTypes = void 0;
|
25111 | Object.defineProperties(lazyType, {
|
25112 | defaultProps: {
|
25113 | configurable: true,
|
25114 | get: function () {
|
25115 | return defaultProps;
|
25116 | },
|
25117 | set: function (newDefaultProps) {
|
25118 | warning$1(false, 'React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
25119 | defaultProps = newDefaultProps;
|
25120 |
|
25121 | Object.defineProperty(lazyType, 'defaultProps', {
|
25122 | enumerable: true
|
25123 | });
|
25124 | }
|
25125 | },
|
25126 | propTypes: {
|
25127 | configurable: true,
|
25128 | get: function () {
|
25129 | return propTypes;
|
25130 | },
|
25131 | set: function (newPropTypes) {
|
25132 | warning$1(false, 'React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
25133 | propTypes = newPropTypes;
|
25134 |
|
25135 | Object.defineProperty(lazyType, 'propTypes', {
|
25136 | enumerable: true
|
25137 | });
|
25138 | }
|
25139 | }
|
25140 | });
|
25141 | }
|
25142 |
|
25143 | return lazyType;
|
25144 | }
|
25145 |
|
25146 | function forwardRef(render) {
|
25147 | {
|
25148 | if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
25149 | warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
25150 | } else if (typeof render !== 'function') {
|
25151 | warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
25152 | } else {
|
25153 | !(
|
25154 |
|
25155 | render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, 'forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.') : void 0;
|
25156 | }
|
25157 |
|
25158 | if (render != null) {
|
25159 | !(render.defaultProps == null && render.propTypes == null) ? warningWithoutStack$1(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0;
|
25160 | }
|
25161 | }
|
25162 |
|
25163 | return {
|
25164 | $$typeof: REACT_FORWARD_REF_TYPE,
|
25165 | render: render
|
25166 | };
|
25167 | }
|
25168 |
|
25169 | function isValidElementType(type) {
|
25170 | return typeof type === 'string' || typeof type === 'function' ||
|
25171 |
|
25172 | type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
|
25173 | }
|
25174 |
|
25175 | function memo(type, compare) {
|
25176 | {
|
25177 | if (!isValidElementType(type)) {
|
25178 | warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
25179 | }
|
25180 | }
|
25181 | return {
|
25182 | $$typeof: REACT_MEMO_TYPE,
|
25183 | type: type,
|
25184 | compare: compare === undefined ? null : compare
|
25185 | };
|
25186 | }
|
25187 |
|
25188 | function resolveDispatcher() {
|
25189 | var dispatcher = ReactCurrentOwner.currentDispatcher;
|
25190 | !(dispatcher !== null) ? invariant(false, 'Hooks can only be called inside the body of a function component.') : void 0;
|
25191 | return dispatcher;
|
25192 | }
|
25193 |
|
25194 | function useContext(Context, observedBits) {
|
25195 | var dispatcher = resolveDispatcher();
|
25196 | {
|
25197 |
|
25198 | if (Context._context !== undefined) {
|
25199 | var realContext = Context._context;
|
25200 |
|
25201 |
|
25202 | if (realContext.Consumer === Context) {
|
25203 | warning$1(false, 'Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
|
25204 | } else if (realContext.Provider === Context) {
|
25205 | warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
25206 | }
|
25207 | }
|
25208 | }
|
25209 | return dispatcher.useContext(Context, observedBits);
|
25210 | }
|
25211 |
|
25212 | function useState(initialState) {
|
25213 | var dispatcher = resolveDispatcher();
|
25214 | return dispatcher.useState(initialState);
|
25215 | }
|
25216 |
|
25217 | function useReducer(reducer, initialState, initialAction) {
|
25218 | var dispatcher = resolveDispatcher();
|
25219 | return dispatcher.useReducer(reducer, initialState, initialAction);
|
25220 | }
|
25221 |
|
25222 | function useRef(initialValue) {
|
25223 | var dispatcher = resolveDispatcher();
|
25224 | return dispatcher.useRef(initialValue);
|
25225 | }
|
25226 |
|
25227 | function useEffect(create, inputs) {
|
25228 | var dispatcher = resolveDispatcher();
|
25229 | return dispatcher.useEffect(create, inputs);
|
25230 | }
|
25231 |
|
25232 | function useLayoutEffect(create, inputs) {
|
25233 | var dispatcher = resolveDispatcher();
|
25234 | return dispatcher.useLayoutEffect(create, inputs);
|
25235 | }
|
25236 |
|
25237 | function useCallback(callback, inputs) {
|
25238 | var dispatcher = resolveDispatcher();
|
25239 | return dispatcher.useCallback(callback, inputs);
|
25240 | }
|
25241 |
|
25242 | function useMemo(create, inputs) {
|
25243 | var dispatcher = resolveDispatcher();
|
25244 | return dispatcher.useMemo(create, inputs);
|
25245 | }
|
25246 |
|
25247 | function useImperativeMethods(ref, create, inputs) {
|
25248 | var dispatcher = resolveDispatcher();
|
25249 | return dispatcher.useImperativeMethods(ref, create, inputs);
|
25250 | }
|
25251 |
|
25252 |
|
25253 |
|
25254 |
|
25255 |
|
25256 |
|
25257 |
|
25258 |
|
25259 | var propTypesMisspellWarningShown = void 0;
|
25260 |
|
25261 | {
|
25262 | propTypesMisspellWarningShown = false;
|
25263 | }
|
25264 |
|
25265 | function getDeclarationErrorAddendum() {
|
25266 | if (ReactCurrentOwner.current) {
|
25267 | var name = getComponentName(ReactCurrentOwner.current.type);
|
25268 | if (name) {
|
25269 | return '\n\nCheck the render method of `' + name + '`.';
|
25270 | }
|
25271 | }
|
25272 | return '';
|
25273 | }
|
25274 |
|
25275 | function getSourceInfoErrorAddendum(elementProps) {
|
25276 | if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
|
25277 | var source = elementProps.__source;
|
25278 | var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
25279 | var lineNumber = source.lineNumber;
|
25280 | return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
25281 | }
|
25282 | return '';
|
25283 | }
|
25284 |
|
25285 |
|
25286 |
|
25287 |
|
25288 |
|
25289 |
|
25290 | var ownerHasKeyUseWarning = {};
|
25291 |
|
25292 | function getCurrentComponentErrorInfo(parentType) {
|
25293 | var info = getDeclarationErrorAddendum();
|
25294 |
|
25295 | if (!info) {
|
25296 | var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
25297 | if (parentName) {
|
25298 | info = '\n\nCheck the top-level render call using <' + parentName + '>.';
|
25299 | }
|
25300 | }
|
25301 | return info;
|
25302 | }
|
25303 |
|
25304 |
|
25305 |
|
25306 |
|
25307 |
|
25308 |
|
25309 |
|
25310 |
|
25311 |
|
25312 |
|
25313 |
|
25314 |
|
25315 | function validateExplicitKey(element, parentType) {
|
25316 | if (!element._store || element._store.validated || element.key != null) {
|
25317 | return;
|
25318 | }
|
25319 | element._store.validated = true;
|
25320 |
|
25321 | var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
25322 | if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
25323 | return;
|
25324 | }
|
25325 | ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
25326 |
|
25327 |
|
25328 |
|
25329 |
|
25330 | var childOwner = '';
|
25331 | if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
25332 |
|
25333 | childOwner = ' It was passed a child from ' + getComponentName(element._owner.type) + '.';
|
25334 | }
|
25335 |
|
25336 | setCurrentlyValidatingElement(element);
|
25337 | {
|
25338 | warning$1(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
25339 | }
|
25340 | setCurrentlyValidatingElement(null);
|
25341 | }
|
25342 |
|
25343 |
|
25344 |
|
25345 |
|
25346 |
|
25347 |
|
25348 |
|
25349 |
|
25350 |
|
25351 |
|
25352 | function validateChildKeys(node, parentType) {
|
25353 | if (typeof node !== 'object') {
|
25354 | return;
|
25355 | }
|
25356 | if (Array.isArray(node)) {
|
25357 | for (var i = 0; i < node.length; i++) {
|
25358 | var child = node[i];
|
25359 | if (isValidElement(child)) {
|
25360 | validateExplicitKey(child, parentType);
|
25361 | }
|
25362 | }
|
25363 | } else if (isValidElement(node)) {
|
25364 |
|
25365 | if (node._store) {
|
25366 | node._store.validated = true;
|
25367 | }
|
25368 | } else if (node) {
|
25369 | var iteratorFn = getIteratorFn(node);
|
25370 | if (typeof iteratorFn === 'function') {
|
25371 |
|
25372 |
|
25373 | if (iteratorFn !== node.entries) {
|
25374 | var iterator = iteratorFn.call(node);
|
25375 | var step = void 0;
|
25376 | while (!(step = iterator.next()).done) {
|
25377 | if (isValidElement(step.value)) {
|
25378 | validateExplicitKey(step.value, parentType);
|
25379 | }
|
25380 | }
|
25381 | }
|
25382 | }
|
25383 | }
|
25384 | }
|
25385 |
|
25386 |
|
25387 |
|
25388 |
|
25389 |
|
25390 |
|
25391 |
|
25392 | function validatePropTypes(element) {
|
25393 | var type = element.type;
|
25394 | if (type === null || type === undefined || typeof type === 'string') {
|
25395 | return;
|
25396 | }
|
25397 | var name = getComponentName(type);
|
25398 | var propTypes = void 0;
|
25399 | if (typeof type === 'function') {
|
25400 | propTypes = type.propTypes;
|
25401 | } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
25402 |
|
25403 |
|
25404 | type.$$typeof === REACT_MEMO_TYPE)) {
|
25405 | propTypes = type.propTypes;
|
25406 | } else {
|
25407 | return;
|
25408 | }
|
25409 | if (propTypes) {
|
25410 | setCurrentlyValidatingElement(element);
|
25411 | checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
|
25412 | setCurrentlyValidatingElement(null);
|
25413 | } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
25414 | propTypesMisspellWarningShown = true;
|
25415 | warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
|
25416 | }
|
25417 | if (typeof type.getDefaultProps === 'function') {
|
25418 | !type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
25419 | }
|
25420 | }
|
25421 |
|
25422 |
|
25423 |
|
25424 |
|
25425 |
|
25426 | function validateFragmentProps(fragment) {
|
25427 | setCurrentlyValidatingElement(fragment);
|
25428 |
|
25429 | var keys = Object.keys(fragment.props);
|
25430 | for (var i = 0; i < keys.length; i++) {
|
25431 | var key = keys[i];
|
25432 | if (key !== 'children' && key !== 'key') {
|
25433 | warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
25434 | break;
|
25435 | }
|
25436 | }
|
25437 |
|
25438 | if (fragment.ref !== null) {
|
25439 | warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.');
|
25440 | }
|
25441 |
|
25442 | setCurrentlyValidatingElement(null);
|
25443 | }
|
25444 |
|
25445 | function createElementWithValidation(type, props, children) {
|
25446 | var validType = isValidElementType(type);
|
25447 |
|
25448 |
|
25449 |
|
25450 | if (!validType) {
|
25451 | var info = '';
|
25452 | if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
25453 | 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.";
|
25454 | }
|
25455 |
|
25456 | var sourceInfo = getSourceInfoErrorAddendum(props);
|
25457 | if (sourceInfo) {
|
25458 | info += sourceInfo;
|
25459 | } else {
|
25460 | info += getDeclarationErrorAddendum();
|
25461 | }
|
25462 |
|
25463 | var typeString = void 0;
|
25464 | if (type === null) {
|
25465 | typeString = 'null';
|
25466 | } else if (Array.isArray(type)) {
|
25467 | typeString = 'array';
|
25468 | } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
25469 | typeString = '<' + (getComponentName(type.type) || 'Unknown') + ' />';
|
25470 | info = ' Did you accidentally export a JSX literal instead of a component?';
|
25471 | } else {
|
25472 | typeString = typeof type;
|
25473 | }
|
25474 |
|
25475 | warning$1(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
25476 | }
|
25477 |
|
25478 | var element = createElement.apply(this, arguments);
|
25479 |
|
25480 |
|
25481 |
|
25482 | if (element == null) {
|
25483 | return element;
|
25484 | }
|
25485 |
|
25486 |
|
25487 |
|
25488 |
|
25489 |
|
25490 |
|
25491 | if (validType) {
|
25492 | for (var i = 2; i < arguments.length; i++) {
|
25493 | validateChildKeys(arguments[i], type);
|
25494 | }
|
25495 | }
|
25496 |
|
25497 | if (type === REACT_FRAGMENT_TYPE) {
|
25498 | validateFragmentProps(element);
|
25499 | } else {
|
25500 | validatePropTypes(element);
|
25501 | }
|
25502 |
|
25503 | return element;
|
25504 | }
|
25505 |
|
25506 | function createFactoryWithValidation(type) {
|
25507 | var validatedFactory = createElementWithValidation.bind(null, type);
|
25508 | validatedFactory.type = type;
|
25509 |
|
25510 | {
|
25511 | Object.defineProperty(validatedFactory, 'type', {
|
25512 | enumerable: false,
|
25513 | get: function () {
|
25514 | lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
25515 | Object.defineProperty(this, 'type', {
|
25516 | value: type
|
25517 | });
|
25518 | return type;
|
25519 | }
|
25520 | });
|
25521 | }
|
25522 |
|
25523 | return validatedFactory;
|
25524 | }
|
25525 |
|
25526 | function cloneElementWithValidation(element, props, children) {
|
25527 | var newElement = cloneElement.apply(this, arguments);
|
25528 | for (var i = 2; i < arguments.length; i++) {
|
25529 | validateChildKeys(arguments[i], newElement.type);
|
25530 | }
|
25531 | validatePropTypes(newElement);
|
25532 | return newElement;
|
25533 | }
|
25534 |
|
25535 | var React = {
|
25536 | Children: {
|
25537 | map: mapChildren,
|
25538 | forEach: forEachChildren,
|
25539 | count: countChildren,
|
25540 | toArray: toArray,
|
25541 | only: onlyChild
|
25542 | },
|
25543 |
|
25544 | createRef: createRef,
|
25545 | Component: Component,
|
25546 | PureComponent: PureComponent,
|
25547 |
|
25548 | createContext: createContext,
|
25549 | forwardRef: forwardRef,
|
25550 | lazy: lazy,
|
25551 | memo: memo,
|
25552 |
|
25553 | Fragment: REACT_FRAGMENT_TYPE,
|
25554 | StrictMode: REACT_STRICT_MODE_TYPE,
|
25555 | Suspense: REACT_SUSPENSE_TYPE,
|
25556 |
|
25557 | createElement: createElementWithValidation,
|
25558 | cloneElement: cloneElementWithValidation,
|
25559 | createFactory: createFactoryWithValidation,
|
25560 | isValidElement: isValidElement,
|
25561 |
|
25562 | version: ReactVersion,
|
25563 |
|
25564 | unstable_ConcurrentMode: REACT_CONCURRENT_MODE_TYPE,
|
25565 | unstable_Profiler: REACT_PROFILER_TYPE,
|
25566 |
|
25567 | __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
|
25568 | };
|
25569 |
|
25570 |
|
25571 |
|
25572 |
|
25573 |
|
25574 |
|
25575 | if (enableStableConcurrentModeAPIs) {
|
25576 | React.ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
25577 | React.Profiler = REACT_PROFILER_TYPE;
|
25578 | React.unstable_ConcurrentMode = undefined;
|
25579 | React.unstable_Profiler = undefined;
|
25580 | }
|
25581 |
|
25582 | if (enableHooks) {
|
25583 | React.useCallback = useCallback;
|
25584 | React.useContext = useContext;
|
25585 | React.useEffect = useEffect;
|
25586 | React.useImperativeMethods = useImperativeMethods;
|
25587 | React.useLayoutEffect = useLayoutEffect;
|
25588 | React.useMemo = useMemo;
|
25589 | React.useReducer = useReducer;
|
25590 | React.useRef = useRef;
|
25591 | React.useState = useState;
|
25592 | }
|
25593 |
|
25594 |
|
25595 |
|
25596 | var React$2 = Object.freeze({
|
25597 | default: React
|
25598 | });
|
25599 |
|
25600 | var React$3 = ( React$2 && React ) || React$2;
|
25601 |
|
25602 |
|
25603 |
|
25604 | var react = React$3.default || React$3;
|
25605 |
|
25606 | module.exports = react;
|
25607 | })();
|
25608 | }
|
25609 |
|
25610 | },{"object-assign":23,"prop-types/checkPropTypes":25}],51:[function(require,module,exports){
|
25611 |
|
25612 |
|
25613 |
|
25614 |
|
25615 |
|
25616 |
|
25617 |
|
25618 |
|
25619 |
|
25620 | 'use strict';var k=require("object-assign"),n="function"===typeof Symbol&&Symbol.for,p=n?Symbol.for("react.element"):60103,q=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,t=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,v=n?Symbol.for("react.provider"):60109,w=n?Symbol.for("react.context"):60110,x=n?Symbol.for("react.concurrent_mode"):60111,y=n?Symbol.for("react.forward_ref"):60112,z=n?Symbol.for("react.suspense"):60113,A=n?Symbol.for("react.memo"):
|
25621 | 60115,B=n?Symbol.for("react.lazy"):60116,C="function"===typeof Symbol&&Symbol.iterator;function aa(a,b,e,c,d,g,h,f){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[e,c,d,g,h,f],m=0;a=Error(b.replace(/%s/g,function(){return l[m++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}
|
25622 | function D(a){for(var b=arguments.length-1,e="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c<b;c++)e+="&args[]="+encodeURIComponent(arguments[c+1]);aa(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",e)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F={};
|
25623 | function G(a,b,e){this.props=a;this.context=b;this.refs=F;this.updater=e||E}G.prototype.isReactComponent={};G.prototype.setState=function(a,b){"object"!==typeof a&&"function"!==typeof a&&null!=a?D("85"):void 0;this.updater.enqueueSetState(this,a,b,"setState")};G.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function H(){}H.prototype=G.prototype;function I(a,b,e){this.props=a;this.context=b;this.refs=F;this.updater=e||E}var J=I.prototype=new H;
|
25624 | J.constructor=I;k(J,G.prototype);J.isPureReactComponent=!0;var K={current:null,currentDispatcher:null},L=Object.prototype.hasOwnProperty,M={key:!0,ref:!0,__self:!0,__source:!0};
|
25625 | function N(a,b,e){var c=void 0,d={},g=null,h=null;if(null!=b)for(c in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(g=""+b.key),b)L.call(b,c)&&!M.hasOwnProperty(c)&&(d[c]=b[c]);var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){for(var l=Array(f),m=0;m<f;m++)l[m]=arguments[m+2];d.children=l}if(a&&a.defaultProps)for(c in f=a.defaultProps,f)void 0===d[c]&&(d[c]=f[c]);return{$$typeof:p,type:a,key:g,ref:h,props:d,_owner:K.current}}
|
25626 | function ba(a,b){return{$$typeof:p,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return"object"===typeof a&&null!==a&&a.$$typeof===p}function escape(a){var b={"=":"=0",":":"=2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var P=/\/+/g,Q=[];function R(a,b,e,c){if(Q.length){var d=Q.pop();d.result=a;d.keyPrefix=b;d.func=e;d.context=c;d.count=0;return d}return{result:a,keyPrefix:b,func:e,context:c,count:0}}
|
25627 | function S(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>Q.length&&Q.push(a)}
|
25628 | function T(a,b,e,c){var d=typeof a;if("undefined"===d||"boolean"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case p:case q:g=!0}}if(g)return e(c,a,""===b?"."+U(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var h=0;h<a.length;h++){d=a[h];var f=b+U(d,h);g+=T(d,f,e,c)}else if(null===a||"object"!==typeof a?f=null:(f=C&&a[C]||a["@@iterator"],f="function"===typeof f?f:null),"function"===typeof f)for(a=f.call(a),h=
|
25629 | 0;!(d=a.next()).done;)d=d.value,f=b+U(d,h++),g+=T(d,f,e,c);else"object"===d&&(e=""+a,D("31","[object Object]"===e?"object with keys {"+Object.keys(a).join(", ")+"}":e,""));return g}function V(a,b,e){return null==a?0:T(a,"",b,e)}function U(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function ca(a,b){a.func.call(a.context,b,a.count++)}
|
25630 | function da(a,b,e){var c=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?W(a,c,e,function(a){return a}):null!=a&&(O(a)&&(a=ba(a,d+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(P,"$&/")+"/")+e)),c.push(a))}function W(a,b,e,c,d){var g="";null!=e&&(g=(""+e).replace(P,"$&/")+"/");b=R(b,g,c,d);V(a,da,b);S(b)}
|
25631 | var X={Children:{map:function(a,b,e){if(null==a)return a;var c=[];W(a,c,null,b,e);return c},forEach:function(a,b,e){if(null==a)return a;b=R(null,null,b,e);V(a,ca,b);S(b)},count:function(a){return V(a,function(){return null},null)},toArray:function(a){var b=[];W(a,b,null,function(a){return a});return b},only:function(a){O(a)?void 0:D("143");return a}},createRef:function(){return{current:null}},Component:G,PureComponent:I,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:w,_calculateChangedBits:b,
|
25632 | _currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:v,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:y,render:a}},lazy:function(a){return{$$typeof:B,_ctor:a,_status:-1,_result:null}},memo:function(a,b){return{$$typeof:A,type:a,compare:void 0===b?null:b}},Fragment:r,StrictMode:t,Suspense:z,createElement:N,cloneElement:function(a,b,e){null===a||void 0===a?D("267",a):void 0;var c=void 0,d=k({},a.props),g=a.key,h=a.ref,f=a._owner;
|
25633 | if(null!=b){void 0!==b.ref&&(h=b.ref,f=K.current);void 0!==b.key&&(g=""+b.key);var l=void 0;a.type&&a.type.defaultProps&&(l=a.type.defaultProps);for(c in b)L.call(b,c)&&!M.hasOwnProperty(c)&&(d[c]=void 0===b[c]&&void 0!==l?l[c]:b[c])}c=arguments.length-2;if(1===c)d.children=e;else if(1<c){l=Array(c);for(var m=0;m<c;m++)l[m]=arguments[m+2];d.children=l}return{$$typeof:p,type:a.type,key:g,ref:h,props:d,_owner:f}},createFactory:function(a){var b=N.bind(null,a);b.type=a;return b},isValidElement:O,version:"16.7.0",
|
25634 | unstable_ConcurrentMode:x,unstable_Profiler:u,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:K,assign:k}},Y={default:X},Z=Y&&X||Y;module.exports=Z.default||Z;
|
25635 |
|
25636 | },{"object-assign":23}],52:[function(require,module,exports){
|
25637 | 'use strict';
|
25638 |
|
25639 | Object.defineProperty(exports, "__esModule", {
|
25640 | value: true
|
25641 | });
|
25642 |
|
25643 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
25644 |
|
25645 | exports.printBuffer = printBuffer;
|
25646 |
|
25647 | var _helpers = require('./helpers');
|
25648 |
|
25649 | var _diff = require('./diff');
|
25650 |
|
25651 | var _diff2 = _interopRequireDefault(_diff);
|
25652 |
|
25653 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25654 |
|
25655 | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
25656 |
|
25657 |
|
25658 |
|
25659 |
|
25660 |
|
25661 |
|
25662 |
|
25663 |
|
25664 |
|
25665 |
|
25666 |
|
25667 | function getLogLevel(level, action, payload, type) {
|
25668 | switch (typeof level === 'undefined' ? 'undefined' : _typeof(level)) {
|
25669 | case 'object':
|
25670 | return typeof level[type] === 'function' ? level[type].apply(level, _toConsumableArray(payload)) : level[type];
|
25671 | case 'function':
|
25672 | return level(action);
|
25673 | default:
|
25674 | return level;
|
25675 | }
|
25676 | }
|
25677 |
|
25678 | function defaultTitleFormatter(options) {
|
25679 | var timestamp = options.timestamp,
|
25680 | duration = options.duration;
|
25681 |
|
25682 |
|
25683 | return function (action, time, took) {
|
25684 | var parts = ['action'];
|
25685 |
|
25686 | parts.push('%c' + String(action.type));
|
25687 | if (timestamp) parts.push('%c@ ' + time);
|
25688 | if (duration) parts.push('%c(in ' + took.toFixed(2) + ' ms)');
|
25689 |
|
25690 | return parts.join(' ');
|
25691 | };
|
25692 | }
|
25693 |
|
25694 | function printBuffer(buffer, options) {
|
25695 | var logger = options.logger,
|
25696 | actionTransformer = options.actionTransformer,
|
25697 | _options$titleFormatt = options.titleFormatter,
|
25698 | titleFormatter = _options$titleFormatt === undefined ? defaultTitleFormatter(options) : _options$titleFormatt,
|
25699 | collapsed = options.collapsed,
|
25700 | colors = options.colors,
|
25701 | level = options.level,
|
25702 | diff = options.diff;
|
25703 |
|
25704 |
|
25705 | buffer.forEach(function (logEntry, key) {
|
25706 | var started = logEntry.started,
|
25707 | startedTime = logEntry.startedTime,
|
25708 | action = logEntry.action,
|
25709 | prevState = logEntry.prevState,
|
25710 | error = logEntry.error;
|
25711 | var took = logEntry.took,
|
25712 | nextState = logEntry.nextState;
|
25713 |
|
25714 | var nextEntry = buffer[key + 1];
|
25715 |
|
25716 | if (nextEntry) {
|
25717 | nextState = nextEntry.prevState;
|
25718 | took = nextEntry.started - started;
|
25719 | }
|
25720 |
|
25721 |
|
25722 | var formattedAction = actionTransformer(action);
|
25723 | var isCollapsed = typeof collapsed === 'function' ? collapsed(function () {
|
25724 | return nextState;
|
25725 | }, action, logEntry) : collapsed;
|
25726 |
|
25727 | var formattedTime = (0, _helpers.formatTime)(startedTime);
|
25728 | var titleCSS = colors.title ? 'color: ' + colors.title(formattedAction) + ';' : '';
|
25729 | var headerCSS = ['color: gray; font-weight: lighter;'];
|
25730 | headerCSS.push(titleCSS);
|
25731 | if (options.timestamp) headerCSS.push('color: gray; font-weight: lighter;');
|
25732 | if (options.duration) headerCSS.push('color: gray; font-weight: lighter;');
|
25733 | var title = titleFormatter(formattedAction, formattedTime, took);
|
25734 |
|
25735 |
|
25736 | try {
|
25737 | if (isCollapsed) {
|
25738 | if (colors.title) logger.groupCollapsed.apply(logger, ['%c ' + title].concat(headerCSS));else logger.groupCollapsed(title);
|
25739 | } else {
|
25740 | if (colors.title) logger.group.apply(logger, ['%c ' + title].concat(headerCSS));else logger.group(title);
|
25741 | }
|
25742 | } catch (e) {
|
25743 | logger.log(title);
|
25744 | }
|
25745 |
|
25746 | var prevStateLevel = getLogLevel(level, formattedAction, [prevState], 'prevState');
|
25747 | var actionLevel = getLogLevel(level, formattedAction, [formattedAction], 'action');
|
25748 | var errorLevel = getLogLevel(level, formattedAction, [error, prevState], 'error');
|
25749 | var nextStateLevel = getLogLevel(level, formattedAction, [nextState], 'nextState');
|
25750 |
|
25751 | if (prevStateLevel) {
|
25752 | if (colors.prevState) logger[prevStateLevel]('%c prev state', 'color: ' + colors.prevState(prevState) + '; font-weight: bold', prevState);else logger[prevStateLevel]('prev state', prevState);
|
25753 | }
|
25754 |
|
25755 | if (actionLevel) {
|
25756 | if (colors.action) logger[actionLevel]('%c action ', 'color: ' + colors.action(formattedAction) + '; font-weight: bold', formattedAction);else logger[actionLevel]('action ', formattedAction);
|
25757 | }
|
25758 |
|
25759 | if (error && errorLevel) {
|
25760 | if (colors.error) logger[errorLevel]('%c error ', 'color: ' + colors.error(error, prevState) + '; font-weight: bold;', error);else logger[errorLevel]('error ', error);
|
25761 | }
|
25762 |
|
25763 | if (nextStateLevel) {
|
25764 | if (colors.nextState) logger[nextStateLevel]('%c next state', 'color: ' + colors.nextState(nextState) + '; font-weight: bold', nextState);else logger[nextStateLevel]('next state', nextState);
|
25765 | }
|
25766 |
|
25767 | if (diff) {
|
25768 | (0, _diff2.default)(prevState, nextState, logger, isCollapsed);
|
25769 | }
|
25770 |
|
25771 | try {
|
25772 | logger.groupEnd();
|
25773 | } catch (e) {
|
25774 | logger.log('\u2014\u2014 log end \u2014\u2014');
|
25775 | }
|
25776 | });
|
25777 | }
|
25778 | },{"./diff":54,"./helpers":55}],53:[function(require,module,exports){
|
25779 | "use strict";
|
25780 |
|
25781 | Object.defineProperty(exports, "__esModule", {
|
25782 | value: true
|
25783 | });
|
25784 | exports.default = {
|
25785 | level: "log",
|
25786 | logger: console,
|
25787 | logErrors: true,
|
25788 | collapsed: undefined,
|
25789 | predicate: undefined,
|
25790 | duration: false,
|
25791 | timestamp: true,
|
25792 | stateTransformer: function stateTransformer(state) {
|
25793 | return state;
|
25794 | },
|
25795 | actionTransformer: function actionTransformer(action) {
|
25796 | return action;
|
25797 | },
|
25798 | errorTransformer: function errorTransformer(error) {
|
25799 | return error;
|
25800 | },
|
25801 | colors: {
|
25802 | title: function title() {
|
25803 | return "inherit";
|
25804 | },
|
25805 | prevState: function prevState() {
|
25806 | return "#9E9E9E";
|
25807 | },
|
25808 | action: function action() {
|
25809 | return "#03A9F4";
|
25810 | },
|
25811 | nextState: function nextState() {
|
25812 | return "#4CAF50";
|
25813 | },
|
25814 | error: function error() {
|
25815 | return "#F20404";
|
25816 | }
|
25817 | },
|
25818 | diff: false,
|
25819 | diffPredicate: undefined,
|
25820 |
|
25821 |
|
25822 | transformer: undefined
|
25823 | };
|
25824 | module.exports = exports["default"];
|
25825 | },{}],54:[function(require,module,exports){
|
25826 | 'use strict';
|
25827 |
|
25828 | Object.defineProperty(exports, "__esModule", {
|
25829 | value: true
|
25830 | });
|
25831 | exports.default = diffLogger;
|
25832 |
|
25833 | var _deepDiff = require('deep-diff');
|
25834 |
|
25835 | var _deepDiff2 = _interopRequireDefault(_deepDiff);
|
25836 |
|
25837 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25838 |
|
25839 | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
25840 |
|
25841 |
|
25842 | var dictionary = {
|
25843 | 'E': {
|
25844 | color: '#2196F3',
|
25845 | text: 'CHANGED:'
|
25846 | },
|
25847 | 'N': {
|
25848 | color: '#4CAF50',
|
25849 | text: 'ADDED:'
|
25850 | },
|
25851 | 'D': {
|
25852 | color: '#F44336',
|
25853 | text: 'DELETED:'
|
25854 | },
|
25855 | 'A': {
|
25856 | color: '#2196F3',
|
25857 | text: 'ARRAY:'
|
25858 | }
|
25859 | };
|
25860 |
|
25861 | function style(kind) {
|
25862 | return 'color: ' + dictionary[kind].color + '; font-weight: bold';
|
25863 | }
|
25864 |
|
25865 | function render(diff) {
|
25866 | var kind = diff.kind,
|
25867 | path = diff.path,
|
25868 | lhs = diff.lhs,
|
25869 | rhs = diff.rhs,
|
25870 | index = diff.index,
|
25871 | item = diff.item;
|
25872 |
|
25873 |
|
25874 | switch (kind) {
|
25875 | case 'E':
|
25876 | return [path.join('.'), lhs, '\u2192', rhs];
|
25877 | case 'N':
|
25878 | return [path.join('.'), rhs];
|
25879 | case 'D':
|
25880 | return [path.join('.')];
|
25881 | case 'A':
|
25882 | return [path.join('.') + '[' + index + ']', item];
|
25883 | default:
|
25884 | return [];
|
25885 | }
|
25886 | }
|
25887 |
|
25888 | function diffLogger(prevState, newState, logger, isCollapsed) {
|
25889 | var diff = (0, _deepDiff2.default)(prevState, newState);
|
25890 |
|
25891 | try {
|
25892 | if (isCollapsed) {
|
25893 | logger.groupCollapsed('diff');
|
25894 | } else {
|
25895 | logger.group('diff');
|
25896 | }
|
25897 | } catch (e) {
|
25898 | logger.log('diff');
|
25899 | }
|
25900 |
|
25901 | if (diff) {
|
25902 | diff.forEach(function (elem) {
|
25903 | var kind = elem.kind;
|
25904 |
|
25905 | var output = render(elem);
|
25906 |
|
25907 | logger.log.apply(logger, ['%c ' + dictionary[kind].text, style(kind)].concat(_toConsumableArray(output)));
|
25908 | });
|
25909 | } else {
|
25910 | logger.log('\u2014\u2014 no diff \u2014\u2014');
|
25911 | }
|
25912 |
|
25913 | try {
|
25914 | logger.groupEnd();
|
25915 | } catch (e) {
|
25916 | logger.log('\u2014\u2014 diff end \u2014\u2014 ');
|
25917 | }
|
25918 | }
|
25919 | module.exports = exports['default'];
|
25920 | },{"deep-diff":8}],55:[function(require,module,exports){
|
25921 | "use strict";
|
25922 |
|
25923 | Object.defineProperty(exports, "__esModule", {
|
25924 | value: true
|
25925 | });
|
25926 | var repeat = exports.repeat = function repeat(str, times) {
|
25927 | return new Array(times + 1).join(str);
|
25928 | };
|
25929 |
|
25930 | var pad = exports.pad = function pad(num, maxLength) {
|
25931 | return repeat("0", maxLength - num.toString().length) + num;
|
25932 | };
|
25933 |
|
25934 | var formatTime = exports.formatTime = function formatTime(time) {
|
25935 | return pad(time.getHours(), 2) + ":" + pad(time.getMinutes(), 2) + ":" + pad(time.getSeconds(), 2) + "." + pad(time.getMilliseconds(), 3);
|
25936 | };
|
25937 |
|
25938 |
|
25939 | var timer = exports.timer = typeof performance !== "undefined" && performance !== null && typeof performance.now === "function" ? performance : Date;
|
25940 | },{}],56:[function(require,module,exports){
|
25941 | 'use strict';
|
25942 |
|
25943 | Object.defineProperty(exports, "__esModule", {
|
25944 | value: true
|
25945 | });
|
25946 | exports.logger = exports.defaults = undefined;
|
25947 |
|
25948 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
25949 |
|
25950 | var _core = require('./core');
|
25951 |
|
25952 | var _helpers = require('./helpers');
|
25953 |
|
25954 | var _defaults = require('./defaults');
|
25955 |
|
25956 | var _defaults2 = _interopRequireDefault(_defaults);
|
25957 |
|
25958 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25959 |
|
25960 |
|
25961 |
|
25962 |
|
25963 |
|
25964 |
|
25965 |
|
25966 |
|
25967 |
|
25968 |
|
25969 |
|
25970 |
|
25971 |
|
25972 |
|
25973 |
|
25974 |
|
25975 |
|
25976 |
|
25977 |
|
25978 |
|
25979 | function createLogger() {
|
25980 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
25981 |
|
25982 | var loggerOptions = _extends({}, _defaults2.default, options);
|
25983 |
|
25984 | var logger = loggerOptions.logger,
|
25985 | transformer = loggerOptions.transformer,
|
25986 | stateTransformer = loggerOptions.stateTransformer,
|
25987 | errorTransformer = loggerOptions.errorTransformer,
|
25988 | predicate = loggerOptions.predicate,
|
25989 | logErrors = loggerOptions.logErrors,
|
25990 | diffPredicate = loggerOptions.diffPredicate;
|
25991 |
|
25992 |
|
25993 |
|
25994 | if (typeof logger === 'undefined') {
|
25995 | return function () {
|
25996 | return function (next) {
|
25997 | return function (action) {
|
25998 | return next(action);
|
25999 | };
|
26000 | };
|
26001 | };
|
26002 | }
|
26003 |
|
26004 | if (transformer) {
|
26005 | console.error('Option \'transformer\' is deprecated, use \'stateTransformer\' instead!');
|
26006 | }
|
26007 |
|
26008 |
|
26009 | if (options.getState && options.dispatch) {
|
26010 |
|
26011 | console.error('[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:\n\n// Logger with default options\nimport { logger } from \'redux-logger\'\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n\n\n// Or you can create your own logger with custom options http://bit.ly/redux-logger-options\nimport createLogger from \'redux-logger\'\n\nconst logger = createLogger({\n // ...options\n});\n\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n');
|
26012 |
|
26013 | return function () {
|
26014 | return function (next) {
|
26015 | return function (action) {
|
26016 | return next(action);
|
26017 | };
|
26018 | };
|
26019 | };
|
26020 | }
|
26021 |
|
26022 | var logBuffer = [];
|
26023 |
|
26024 | return function (_ref) {
|
26025 | var getState = _ref.getState;
|
26026 | return function (next) {
|
26027 | return function (action) {
|
26028 |
|
26029 | if (typeof predicate === 'function' && !predicate(getState, action)) {
|
26030 | return next(action);
|
26031 | }
|
26032 |
|
26033 | var logEntry = {};
|
26034 | logBuffer.push(logEntry);
|
26035 |
|
26036 | logEntry.started = _helpers.timer.now();
|
26037 | logEntry.startedTime = new Date();
|
26038 | logEntry.prevState = stateTransformer(getState());
|
26039 | logEntry.action = action;
|
26040 |
|
26041 | var returnedValue = void 0;
|
26042 | if (logErrors) {
|
26043 | try {
|
26044 | returnedValue = next(action);
|
26045 | } catch (e) {
|
26046 | logEntry.error = errorTransformer(e);
|
26047 | }
|
26048 | } else {
|
26049 | returnedValue = next(action);
|
26050 | }
|
26051 |
|
26052 | logEntry.took = _helpers.timer.now() - logEntry.started;
|
26053 | logEntry.nextState = stateTransformer(getState());
|
26054 |
|
26055 | var diff = loggerOptions.diff && typeof diffPredicate === 'function' ? diffPredicate(getState, action) : loggerOptions.diff;
|
26056 |
|
26057 | (0, _core.printBuffer)(logBuffer, _extends({}, loggerOptions, { diff: diff }));
|
26058 | logBuffer.length = 0;
|
26059 |
|
26060 | if (logEntry.error) throw logEntry.error;
|
26061 | return returnedValue;
|
26062 | };
|
26063 | };
|
26064 | };
|
26065 | }
|
26066 |
|
26067 | var defaultLogger = createLogger();
|
26068 |
|
26069 | exports.defaults = _defaults2.default;
|
26070 | exports.logger = defaultLogger;
|
26071 | exports.default = createLogger;
|
26072 | module.exports = exports['default'];
|
26073 |
|
26074 | },{"./core":52,"./defaults":53,"./helpers":55}],57:[function(require,module,exports){
|
26075 | 'use strict';
|
26076 |
|
26077 | exports.__esModule = true;
|
26078 | function createThunkMiddleware(extraArgument) {
|
26079 | return function (_ref) {
|
26080 | var dispatch = _ref.dispatch,
|
26081 | getState = _ref.getState;
|
26082 | return function (next) {
|
26083 | return function (action) {
|
26084 | if (typeof action === 'function') {
|
26085 | return action(dispatch, getState, extraArgument);
|
26086 | }
|
26087 |
|
26088 | return next(action);
|
26089 | };
|
26090 | };
|
26091 | };
|
26092 | }
|
26093 |
|
26094 | var thunk = createThunkMiddleware();
|
26095 | thunk.withExtraArgument = createThunkMiddleware;
|
26096 |
|
26097 | exports['default'] = thunk;
|
26098 | },{}],58:[function(require,module,exports){
|
26099 | 'use strict';
|
26100 |
|
26101 | exports.__esModule = true;
|
26102 |
|
26103 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
26104 |
|
26105 | exports['default'] = applyMiddleware;
|
26106 |
|
26107 | var _compose = require('./compose');
|
26108 |
|
26109 | var _compose2 = _interopRequireDefault(_compose);
|
26110 |
|
26111 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
26112 |
|
26113 |
|
26114 |
|
26115 |
|
26116 |
|
26117 |
|
26118 |
|
26119 |
|
26120 |
|
26121 |
|
26122 |
|
26123 |
|
26124 |
|
26125 |
|
26126 |
|
26127 |
|
26128 |
|
26129 | function applyMiddleware() {
|
26130 | for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) {
|
26131 | middlewares[_key] = arguments[_key];
|
26132 | }
|
26133 |
|
26134 | return function (createStore) {
|
26135 | return function (reducer, preloadedState, enhancer) {
|
26136 | var store = createStore(reducer, preloadedState, enhancer);
|
26137 | var _dispatch = store.dispatch;
|
26138 | var chain = [];
|
26139 |
|
26140 | var middlewareAPI = {
|
26141 | getState: store.getState,
|
26142 | dispatch: function dispatch(action) {
|
26143 | return _dispatch(action);
|
26144 | }
|
26145 | };
|
26146 | chain = middlewares.map(function (middleware) {
|
26147 | return middleware(middlewareAPI);
|
26148 | });
|
26149 | _dispatch = _compose2['default'].apply(undefined, chain)(store.dispatch);
|
26150 |
|
26151 | return _extends({}, store, {
|
26152 | dispatch: _dispatch
|
26153 | });
|
26154 | };
|
26155 | };
|
26156 | }
|
26157 | },{"./compose":61}],59:[function(require,module,exports){
|
26158 | 'use strict';
|
26159 |
|
26160 | exports.__esModule = true;
|
26161 | exports['default'] = bindActionCreators;
|
26162 | function bindActionCreator(actionCreator, dispatch) {
|
26163 | return function () {
|
26164 | return dispatch(actionCreator.apply(undefined, arguments));
|
26165 | };
|
26166 | }
|
26167 |
|
26168 |
|
26169 |
|
26170 |
|
26171 |
|
26172 |
|
26173 |
|
26174 |
|
26175 |
|
26176 |
|
26177 |
|
26178 |
|
26179 |
|
26180 |
|
26181 |
|
26182 |
|
26183 |
|
26184 |
|
26185 |
|
26186 |
|
26187 |
|
26188 |
|
26189 | function bindActionCreators(actionCreators, dispatch) {
|
26190 | if (typeof actionCreators === 'function') {
|
26191 | return bindActionCreator(actionCreators, dispatch);
|
26192 | }
|
26193 |
|
26194 | if (typeof actionCreators !== 'object' || actionCreators === null) {
|
26195 | throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');
|
26196 | }
|
26197 |
|
26198 | var keys = Object.keys(actionCreators);
|
26199 | var boundActionCreators = {};
|
26200 | for (var i = 0; i < keys.length; i++) {
|
26201 | var key = keys[i];
|
26202 | var actionCreator = actionCreators[key];
|
26203 | if (typeof actionCreator === 'function') {
|
26204 | boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
|
26205 | }
|
26206 | }
|
26207 | return boundActionCreators;
|
26208 | }
|
26209 | },{}],60:[function(require,module,exports){
|
26210 | 'use strict';
|
26211 |
|
26212 | exports.__esModule = true;
|
26213 | exports['default'] = combineReducers;
|
26214 |
|
26215 | var _createStore = require('./createStore');
|
26216 |
|
26217 | var _isPlainObject = require('lodash/isPlainObject');
|
26218 |
|
26219 | var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
|
26220 |
|
26221 | var _warning = require('./utils/warning');
|
26222 |
|
26223 | var _warning2 = _interopRequireDefault(_warning);
|
26224 |
|
26225 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
26226 |
|
26227 | function getUndefinedStateErrorMessage(key, action) {
|
26228 | var actionType = action && action.type;
|
26229 | var actionName = actionType && '"' + actionType.toString() + '"' || 'an action';
|
26230 |
|
26231 | return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.';
|
26232 | }
|
26233 |
|
26234 | function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
|
26235 | var reducerKeys = Object.keys(reducers);
|
26236 | var argumentName = action && action.type === _createStore.ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
|
26237 |
|
26238 | if (reducerKeys.length === 0) {
|
26239 | return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
|
26240 | }
|
26241 |
|
26242 | if (!(0, _isPlainObject2['default'])(inputState)) {
|
26243 | return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"');
|
26244 | }
|
26245 |
|
26246 | var unexpectedKeys = Object.keys(inputState).filter(function (key) {
|
26247 | return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
|
26248 | });
|
26249 |
|
26250 | unexpectedKeys.forEach(function (key) {
|
26251 | unexpectedKeyCache[key] = true;
|
26252 | });
|
26253 |
|
26254 | if (unexpectedKeys.length > 0) {
|
26255 | return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.');
|
26256 | }
|
26257 | }
|
26258 |
|
26259 | function assertReducerShape(reducers) {
|
26260 | Object.keys(reducers).forEach(function (key) {
|
26261 | var reducer = reducers[key];
|
26262 | var initialState = reducer(undefined, { type: _createStore.ActionTypes.INIT });
|
26263 |
|
26264 | if (typeof initialState === 'undefined') {
|
26265 | throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.');
|
26266 | }
|
26267 |
|
26268 | var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.');
|
26269 | if (typeof reducer(undefined, { type: type }) === 'undefined') {
|
26270 | throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + _createStore.ActionTypes.INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.');
|
26271 | }
|
26272 | });
|
26273 | }
|
26274 |
|
26275 |
|
26276 |
|
26277 |
|
26278 |
|
26279 |
|
26280 |
|
26281 |
|
26282 |
|
26283 |
|
26284 |
|
26285 |
|
26286 |
|
26287 |
|
26288 |
|
26289 |
|
26290 |
|
26291 | function combineReducers(reducers) {
|
26292 | var reducerKeys = Object.keys(reducers);
|
26293 | var finalReducers = {};
|
26294 | for (var i = 0; i < reducerKeys.length; i++) {
|
26295 | var key = reducerKeys[i];
|
26296 |
|
26297 | if ("development" !== 'production') {
|
26298 | if (typeof reducers[key] === 'undefined') {
|
26299 | (0, _warning2['default'])('No reducer provided for key "' + key + '"');
|
26300 | }
|
26301 | }
|
26302 |
|
26303 | if (typeof reducers[key] === 'function') {
|
26304 | finalReducers[key] = reducers[key];
|
26305 | }
|
26306 | }
|
26307 | var finalReducerKeys = Object.keys(finalReducers);
|
26308 |
|
26309 | var unexpectedKeyCache = void 0;
|
26310 | if ("development" !== 'production') {
|
26311 | unexpectedKeyCache = {};
|
26312 | }
|
26313 |
|
26314 | var shapeAssertionError = void 0;
|
26315 | try {
|
26316 | assertReducerShape(finalReducers);
|
26317 | } catch (e) {
|
26318 | shapeAssertionError = e;
|
26319 | }
|
26320 |
|
26321 | return function combination() {
|
26322 | var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
26323 | var action = arguments[1];
|
26324 |
|
26325 | if (shapeAssertionError) {
|
26326 | throw shapeAssertionError;
|
26327 | }
|
26328 |
|
26329 | if ("development" !== 'production') {
|
26330 | var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
|
26331 | if (warningMessage) {
|
26332 | (0, _warning2['default'])(warningMessage);
|
26333 | }
|
26334 | }
|
26335 |
|
26336 | var hasChanged = false;
|
26337 | var nextState = {};
|
26338 | for (var _i = 0; _i < finalReducerKeys.length; _i++) {
|
26339 | var _key = finalReducerKeys[_i];
|
26340 | var reducer = finalReducers[_key];
|
26341 | var previousStateForKey = state[_key];
|
26342 | var nextStateForKey = reducer(previousStateForKey, action);
|
26343 | if (typeof nextStateForKey === 'undefined') {
|
26344 | var errorMessage = getUndefinedStateErrorMessage(_key, action);
|
26345 | throw new Error(errorMessage);
|
26346 | }
|
26347 | nextState[_key] = nextStateForKey;
|
26348 | hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
|
26349 | }
|
26350 | return hasChanged ? nextState : state;
|
26351 | };
|
26352 | }
|
26353 | },{"./createStore":62,"./utils/warning":64,"lodash/isPlainObject":21}],61:[function(require,module,exports){
|
26354 | "use strict";
|
26355 |
|
26356 | exports.__esModule = true;
|
26357 | exports["default"] = compose;
|
26358 |
|
26359 |
|
26360 |
|
26361 |
|
26362 |
|
26363 |
|
26364 |
|
26365 |
|
26366 |
|
26367 |
|
26368 |
|
26369 | function compose() {
|
26370 | for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
|
26371 | funcs[_key] = arguments[_key];
|
26372 | }
|
26373 |
|
26374 | if (funcs.length === 0) {
|
26375 | return function (arg) {
|
26376 | return arg;
|
26377 | };
|
26378 | }
|
26379 |
|
26380 | if (funcs.length === 1) {
|
26381 | return funcs[0];
|
26382 | }
|
26383 |
|
26384 | return funcs.reduce(function (a, b) {
|
26385 | return function () {
|
26386 | return a(b.apply(undefined, arguments));
|
26387 | };
|
26388 | });
|
26389 | }
|
26390 | },{}],62:[function(require,module,exports){
|
26391 | 'use strict';
|
26392 |
|
26393 | exports.__esModule = true;
|
26394 | exports.ActionTypes = undefined;
|
26395 | exports['default'] = createStore;
|
26396 |
|
26397 | var _isPlainObject = require('lodash/isPlainObject');
|
26398 |
|
26399 | var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
|
26400 |
|
26401 | var _symbolObservable = require('symbol-observable');
|
26402 |
|
26403 | var _symbolObservable2 = _interopRequireDefault(_symbolObservable);
|
26404 |
|
26405 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
26406 |
|
26407 |
|
26408 |
|
26409 |
|
26410 |
|
26411 |
|
26412 |
|
26413 | var ActionTypes = exports.ActionTypes = {
|
26414 | INIT: '@@redux/INIT'
|
26415 |
|
26416 | |
26417 |
|
26418 |
|
26419 |
|
26420 |
|
26421 |
|
26422 |
|
26423 |
|
26424 |
|
26425 |
|
26426 |
|
26427 |
|
26428 |
|
26429 |
|
26430 |
|
26431 |
|
26432 |
|
26433 |
|
26434 |
|
26435 |
|
26436 |
|
26437 |
|
26438 |
|
26439 |
|
26440 |
|
26441 | };function createStore(reducer, preloadedState, enhancer) {
|
26442 | var _ref2;
|
26443 |
|
26444 | if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
|
26445 | enhancer = preloadedState;
|
26446 | preloadedState = undefined;
|
26447 | }
|
26448 |
|
26449 | if (typeof enhancer !== 'undefined') {
|
26450 | if (typeof enhancer !== 'function') {
|
26451 | throw new Error('Expected the enhancer to be a function.');
|
26452 | }
|
26453 |
|
26454 | return enhancer(createStore)(reducer, preloadedState);
|
26455 | }
|
26456 |
|
26457 | if (typeof reducer !== 'function') {
|
26458 | throw new Error('Expected the reducer to be a function.');
|
26459 | }
|
26460 |
|
26461 | var currentReducer = reducer;
|
26462 | var currentState = preloadedState;
|
26463 | var currentListeners = [];
|
26464 | var nextListeners = currentListeners;
|
26465 | var isDispatching = false;
|
26466 |
|
26467 | function ensureCanMutateNextListeners() {
|
26468 | if (nextListeners === currentListeners) {
|
26469 | nextListeners = currentListeners.slice();
|
26470 | }
|
26471 | }
|
26472 |
|
26473 | |
26474 |
|
26475 |
|
26476 |
|
26477 |
|
26478 | function getState() {
|
26479 | return currentState;
|
26480 | }
|
26481 |
|
26482 | |
26483 |
|
26484 |
|
26485 |
|
26486 |
|
26487 |
|
26488 |
|
26489 |
|
26490 |
|
26491 |
|
26492 |
|
26493 |
|
26494 |
|
26495 |
|
26496 |
|
26497 |
|
26498 |
|
26499 |
|
26500 |
|
26501 |
|
26502 |
|
26503 |
|
26504 |
|
26505 | function subscribe(listener) {
|
26506 | if (typeof listener !== 'function') {
|
26507 | throw new Error('Expected listener to be a function.');
|
26508 | }
|
26509 |
|
26510 | var isSubscribed = true;
|
26511 |
|
26512 | ensureCanMutateNextListeners();
|
26513 | nextListeners.push(listener);
|
26514 |
|
26515 | return function unsubscribe() {
|
26516 | if (!isSubscribed) {
|
26517 | return;
|
26518 | }
|
26519 |
|
26520 | isSubscribed = false;
|
26521 |
|
26522 | ensureCanMutateNextListeners();
|
26523 | var index = nextListeners.indexOf(listener);
|
26524 | nextListeners.splice(index, 1);
|
26525 | };
|
26526 | }
|
26527 |
|
26528 | |
26529 |
|
26530 |
|
26531 |
|
26532 |
|
26533 |
|
26534 |
|
26535 |
|
26536 |
|
26537 |
|
26538 |
|
26539 |
|
26540 |
|
26541 |
|
26542 |
|
26543 |
|
26544 |
|
26545 |
|
26546 |
|
26547 |
|
26548 |
|
26549 |
|
26550 |
|
26551 |
|
26552 |
|
26553 | function dispatch(action) {
|
26554 | if (!(0, _isPlainObject2['default'])(action)) {
|
26555 | throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
|
26556 | }
|
26557 |
|
26558 | if (typeof action.type === 'undefined') {
|
26559 | throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
|
26560 | }
|
26561 |
|
26562 | if (isDispatching) {
|
26563 | throw new Error('Reducers may not dispatch actions.');
|
26564 | }
|
26565 |
|
26566 | try {
|
26567 | isDispatching = true;
|
26568 | currentState = currentReducer(currentState, action);
|
26569 | } finally {
|
26570 | isDispatching = false;
|
26571 | }
|
26572 |
|
26573 | var listeners = currentListeners = nextListeners;
|
26574 | for (var i = 0; i < listeners.length; i++) {
|
26575 | var listener = listeners[i];
|
26576 | listener();
|
26577 | }
|
26578 |
|
26579 | return action;
|
26580 | }
|
26581 |
|
26582 | |
26583 |
|
26584 |
|
26585 |
|
26586 |
|
26587 |
|
26588 |
|
26589 |
|
26590 |
|
26591 |
|
26592 | function replaceReducer(nextReducer) {
|
26593 | if (typeof nextReducer !== 'function') {
|
26594 | throw new Error('Expected the nextReducer to be a function.');
|
26595 | }
|
26596 |
|
26597 | currentReducer = nextReducer;
|
26598 | dispatch({ type: ActionTypes.INIT });
|
26599 | }
|
26600 |
|
26601 | |
26602 |
|
26603 |
|
26604 |
|
26605 |
|
26606 |
|
26607 | function observable() {
|
26608 | var _ref;
|
26609 |
|
26610 | var outerSubscribe = subscribe;
|
26611 | return _ref = {
|
26612 | |
26613 |
|
26614 |
|
26615 |
|
26616 |
|
26617 |
|
26618 |
|
26619 |
|
26620 | subscribe: function subscribe(observer) {
|
26621 | if (typeof observer !== 'object') {
|
26622 | throw new TypeError('Expected the observer to be an object.');
|
26623 | }
|
26624 |
|
26625 | function observeState() {
|
26626 | if (observer.next) {
|
26627 | observer.next(getState());
|
26628 | }
|
26629 | }
|
26630 |
|
26631 | observeState();
|
26632 | var unsubscribe = outerSubscribe(observeState);
|
26633 | return { unsubscribe: unsubscribe };
|
26634 | }
|
26635 | }, _ref[_symbolObservable2['default']] = function () {
|
26636 | return this;
|
26637 | }, _ref;
|
26638 | }
|
26639 |
|
26640 |
|
26641 |
|
26642 |
|
26643 | dispatch({ type: ActionTypes.INIT });
|
26644 |
|
26645 | return _ref2 = {
|
26646 | dispatch: dispatch,
|
26647 | subscribe: subscribe,
|
26648 | getState: getState,
|
26649 | replaceReducer: replaceReducer
|
26650 | }, _ref2[_symbolObservable2['default']] = observable, _ref2;
|
26651 | }
|
26652 | },{"lodash/isPlainObject":21,"symbol-observable":74}],63:[function(require,module,exports){
|
26653 | 'use strict';
|
26654 |
|
26655 | exports.__esModule = true;
|
26656 | exports.compose = exports.applyMiddleware = exports.bindActionCreators = exports.combineReducers = exports.createStore = undefined;
|
26657 |
|
26658 | var _createStore = require('./createStore');
|
26659 |
|
26660 | var _createStore2 = _interopRequireDefault(_createStore);
|
26661 |
|
26662 | var _combineReducers = require('./combineReducers');
|
26663 |
|
26664 | var _combineReducers2 = _interopRequireDefault(_combineReducers);
|
26665 |
|
26666 | var _bindActionCreators = require('./bindActionCreators');
|
26667 |
|
26668 | var _bindActionCreators2 = _interopRequireDefault(_bindActionCreators);
|
26669 |
|
26670 | var _applyMiddleware = require('./applyMiddleware');
|
26671 |
|
26672 | var _applyMiddleware2 = _interopRequireDefault(_applyMiddleware);
|
26673 |
|
26674 | var _compose = require('./compose');
|
26675 |
|
26676 | var _compose2 = _interopRequireDefault(_compose);
|
26677 |
|
26678 | var _warning = require('./utils/warning');
|
26679 |
|
26680 | var _warning2 = _interopRequireDefault(_warning);
|
26681 |
|
26682 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
26683 |
|
26684 |
|
26685 |
|
26686 |
|
26687 |
|
26688 | function isCrushed() {}
|
26689 |
|
26690 | if ("development" !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
|
26691 | (0, _warning2['default'])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');
|
26692 | }
|
26693 |
|
26694 | exports.createStore = _createStore2['default'];
|
26695 | exports.combineReducers = _combineReducers2['default'];
|
26696 | exports.bindActionCreators = _bindActionCreators2['default'];
|
26697 | exports.applyMiddleware = _applyMiddleware2['default'];
|
26698 | exports.compose = _compose2['default'];
|
26699 | },{"./applyMiddleware":58,"./bindActionCreators":59,"./combineReducers":60,"./compose":61,"./createStore":62,"./utils/warning":64}],64:[function(require,module,exports){
|
26700 | 'use strict';
|
26701 |
|
26702 | exports.__esModule = true;
|
26703 | exports['default'] = warning;
|
26704 |
|
26705 |
|
26706 |
|
26707 |
|
26708 |
|
26709 |
|
26710 | function warning(message) {
|
26711 |
|
26712 | if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
26713 | console.error(message);
|
26714 | }
|
26715 |
|
26716 | try {
|
26717 |
|
26718 |
|
26719 |
|
26720 | throw new Error(message);
|
26721 |
|
26722 | } catch (e) {}
|
26723 |
|
26724 | }
|
26725 | },{}],65:[function(require,module,exports){
|
26726 | (function (global){
|
26727 |
|
26728 |
|
26729 | var g =
|
26730 | typeof global === "object" ? global :
|
26731 | typeof window === "object" ? window :
|
26732 | typeof self === "object" ? self : this;
|
26733 |
|
26734 |
|
26735 |
|
26736 | var hadRuntime = g.regeneratorRuntime &&
|
26737 | Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
|
26738 |
|
26739 |
|
26740 | var oldRuntime = hadRuntime && g.regeneratorRuntime;
|
26741 |
|
26742 |
|
26743 | g.regeneratorRuntime = undefined;
|
26744 |
|
26745 | module.exports = require("./runtime");
|
26746 |
|
26747 | if (hadRuntime) {
|
26748 |
|
26749 | g.regeneratorRuntime = oldRuntime;
|
26750 | } else {
|
26751 |
|
26752 | try {
|
26753 | delete g.regeneratorRuntime;
|
26754 | } catch(e) {
|
26755 | g.regeneratorRuntime = undefined;
|
26756 | }
|
26757 | }
|
26758 |
|
26759 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
26760 |
|
26761 | },{"./runtime":66}],66:[function(require,module,exports){
|
26762 | (function (global){
|
26763 |
|
26764 |
|
26765 |
|
26766 |
|
26767 |
|
26768 |
|
26769 |
|
26770 |
|
26771 |
|
26772 |
|
26773 | !(function(global) {
|
26774 | "use strict";
|
26775 |
|
26776 | var Op = Object.prototype;
|
26777 | var hasOwn = Op.hasOwnProperty;
|
26778 | var undefined;
|
26779 | var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
26780 | var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
26781 | var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
26782 | var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
26783 |
|
26784 | var inModule = typeof module === "object";
|
26785 | var runtime = global.regeneratorRuntime;
|
26786 | if (runtime) {
|
26787 | if (inModule) {
|
26788 |
|
26789 |
|
26790 | module.exports = runtime;
|
26791 | }
|
26792 |
|
26793 |
|
26794 | return;
|
26795 | }
|
26796 |
|
26797 |
|
26798 |
|
26799 | runtime = global.regeneratorRuntime = inModule ? module.exports : {};
|
26800 |
|
26801 | function wrap(innerFn, outerFn, self, tryLocsList) {
|
26802 |
|
26803 | var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
26804 | var generator = Object.create(protoGenerator.prototype);
|
26805 | var context = new Context(tryLocsList || []);
|
26806 |
|
26807 |
|
26808 |
|
26809 | generator._invoke = makeInvokeMethod(innerFn, self, context);
|
26810 |
|
26811 | return generator;
|
26812 | }
|
26813 | runtime.wrap = wrap;
|
26814 |
|
26815 |
|
26816 |
|
26817 |
|
26818 |
|
26819 |
|
26820 |
|
26821 |
|
26822 |
|
26823 |
|
26824 |
|
26825 | function tryCatch(fn, obj, arg) {
|
26826 | try {
|
26827 | return { type: "normal", arg: fn.call(obj, arg) };
|
26828 | } catch (err) {
|
26829 | return { type: "throw", arg: err };
|
26830 | }
|
26831 | }
|
26832 |
|
26833 | var GenStateSuspendedStart = "suspendedStart";
|
26834 | var GenStateSuspendedYield = "suspendedYield";
|
26835 | var GenStateExecuting = "executing";
|
26836 | var GenStateCompleted = "completed";
|
26837 |
|
26838 |
|
26839 |
|
26840 | var ContinueSentinel = {};
|
26841 |
|
26842 |
|
26843 |
|
26844 |
|
26845 |
|
26846 | function Generator() {}
|
26847 | function GeneratorFunction() {}
|
26848 | function GeneratorFunctionPrototype() {}
|
26849 |
|
26850 |
|
26851 |
|
26852 | var IteratorPrototype = {};
|
26853 | IteratorPrototype[iteratorSymbol] = function () {
|
26854 | return this;
|
26855 | };
|
26856 |
|
26857 | var getProto = Object.getPrototypeOf;
|
26858 | var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
26859 | if (NativeIteratorPrototype &&
|
26860 | NativeIteratorPrototype !== Op &&
|
26861 | hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
26862 |
|
26863 |
|
26864 | IteratorPrototype = NativeIteratorPrototype;
|
26865 | }
|
26866 |
|
26867 | var Gp = GeneratorFunctionPrototype.prototype =
|
26868 | Generator.prototype = Object.create(IteratorPrototype);
|
26869 | GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
26870 | GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
26871 | GeneratorFunctionPrototype[toStringTagSymbol] =
|
26872 | GeneratorFunction.displayName = "GeneratorFunction";
|
26873 |
|
26874 |
|
26875 |
|
26876 | function defineIteratorMethods(prototype) {
|
26877 | ["next", "throw", "return"].forEach(function(method) {
|
26878 | prototype[method] = function(arg) {
|
26879 | return this._invoke(method, arg);
|
26880 | };
|
26881 | });
|
26882 | }
|
26883 |
|
26884 | runtime.isGeneratorFunction = function(genFun) {
|
26885 | var ctor = typeof genFun === "function" && genFun.constructor;
|
26886 | return ctor
|
26887 | ? ctor === GeneratorFunction ||
|
26888 |
|
26889 |
|
26890 | (ctor.displayName || ctor.name) === "GeneratorFunction"
|
26891 | : false;
|
26892 | };
|
26893 |
|
26894 | runtime.mark = function(genFun) {
|
26895 | if (Object.setPrototypeOf) {
|
26896 | Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
26897 | } else {
|
26898 | genFun.__proto__ = GeneratorFunctionPrototype;
|
26899 | if (!(toStringTagSymbol in genFun)) {
|
26900 | genFun[toStringTagSymbol] = "GeneratorFunction";
|
26901 | }
|
26902 | }
|
26903 | genFun.prototype = Object.create(Gp);
|
26904 | return genFun;
|
26905 | };
|
26906 |
|
26907 |
|
26908 |
|
26909 |
|
26910 |
|
26911 | runtime.awrap = function(arg) {
|
26912 | return { __await: arg };
|
26913 | };
|
26914 |
|
26915 | function AsyncIterator(generator) {
|
26916 | function invoke(method, arg, resolve, reject) {
|
26917 | var record = tryCatch(generator[method], generator, arg);
|
26918 | if (record.type === "throw") {
|
26919 | reject(record.arg);
|
26920 | } else {
|
26921 | var result = record.arg;
|
26922 | var value = result.value;
|
26923 | if (value &&
|
26924 | typeof value === "object" &&
|
26925 | hasOwn.call(value, "__await")) {
|
26926 | return Promise.resolve(value.__await).then(function(value) {
|
26927 | invoke("next", value, resolve, reject);
|
26928 | }, function(err) {
|
26929 | invoke("throw", err, resolve, reject);
|
26930 | });
|
26931 | }
|
26932 |
|
26933 | return Promise.resolve(value).then(function(unwrapped) {
|
26934 |
|
26935 |
|
26936 |
|
26937 |
|
26938 |
|
26939 |
|
26940 |
|
26941 |
|
26942 |
|
26943 |
|
26944 |
|
26945 |
|
26946 |
|
26947 |
|
26948 |
|
26949 | result.value = unwrapped;
|
26950 | resolve(result);
|
26951 | }, reject);
|
26952 | }
|
26953 | }
|
26954 |
|
26955 | if (typeof global.process === "object" && global.process.domain) {
|
26956 | invoke = global.process.domain.bind(invoke);
|
26957 | }
|
26958 |
|
26959 | var previousPromise;
|
26960 |
|
26961 | function enqueue(method, arg) {
|
26962 | function callInvokeWithMethodAndArg() {
|
26963 | return new Promise(function(resolve, reject) {
|
26964 | invoke(method, arg, resolve, reject);
|
26965 | });
|
26966 | }
|
26967 |
|
26968 | return previousPromise =
|
26969 |
|
26970 |
|
26971 |
|
26972 |
|
26973 |
|
26974 |
|
26975 |
|
26976 |
|
26977 |
|
26978 |
|
26979 |
|
26980 |
|
26981 | previousPromise ? previousPromise.then(
|
26982 | callInvokeWithMethodAndArg,
|
26983 |
|
26984 |
|
26985 | callInvokeWithMethodAndArg
|
26986 | ) : callInvokeWithMethodAndArg();
|
26987 | }
|
26988 |
|
26989 |
|
26990 |
|
26991 | this._invoke = enqueue;
|
26992 | }
|
26993 |
|
26994 | defineIteratorMethods(AsyncIterator.prototype);
|
26995 | AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
26996 | return this;
|
26997 | };
|
26998 | runtime.AsyncIterator = AsyncIterator;
|
26999 |
|
27000 |
|
27001 |
|
27002 |
|
27003 | runtime.async = function(innerFn, outerFn, self, tryLocsList) {
|
27004 | var iter = new AsyncIterator(
|
27005 | wrap(innerFn, outerFn, self, tryLocsList)
|
27006 | );
|
27007 |
|
27008 | return runtime.isGeneratorFunction(outerFn)
|
27009 | ? iter
|
27010 | : iter.next().then(function(result) {
|
27011 | return result.done ? result.value : iter.next();
|
27012 | });
|
27013 | };
|
27014 |
|
27015 | function makeInvokeMethod(innerFn, self, context) {
|
27016 | var state = GenStateSuspendedStart;
|
27017 |
|
27018 | return function invoke(method, arg) {
|
27019 | if (state === GenStateExecuting) {
|
27020 | throw new Error("Generator is already running");
|
27021 | }
|
27022 |
|
27023 | if (state === GenStateCompleted) {
|
27024 | if (method === "throw") {
|
27025 | throw arg;
|
27026 | }
|
27027 |
|
27028 |
|
27029 |
|
27030 | return doneResult();
|
27031 | }
|
27032 |
|
27033 | context.method = method;
|
27034 | context.arg = arg;
|
27035 |
|
27036 | while (true) {
|
27037 | var delegate = context.delegate;
|
27038 | if (delegate) {
|
27039 | var delegateResult = maybeInvokeDelegate(delegate, context);
|
27040 | if (delegateResult) {
|
27041 | if (delegateResult === ContinueSentinel) continue;
|
27042 | return delegateResult;
|
27043 | }
|
27044 | }
|
27045 |
|
27046 | if (context.method === "next") {
|
27047 |
|
27048 |
|
27049 | context.sent = context._sent = context.arg;
|
27050 |
|
27051 | } else if (context.method === "throw") {
|
27052 | if (state === GenStateSuspendedStart) {
|
27053 | state = GenStateCompleted;
|
27054 | throw context.arg;
|
27055 | }
|
27056 |
|
27057 | context.dispatchException(context.arg);
|
27058 |
|
27059 | } else if (context.method === "return") {
|
27060 | context.abrupt("return", context.arg);
|
27061 | }
|
27062 |
|
27063 | state = GenStateExecuting;
|
27064 |
|
27065 | var record = tryCatch(innerFn, self, context);
|
27066 | if (record.type === "normal") {
|
27067 |
|
27068 |
|
27069 | state = context.done
|
27070 | ? GenStateCompleted
|
27071 | : GenStateSuspendedYield;
|
27072 |
|
27073 | if (record.arg === ContinueSentinel) {
|
27074 | continue;
|
27075 | }
|
27076 |
|
27077 | return {
|
27078 | value: record.arg,
|
27079 | done: context.done
|
27080 | };
|
27081 |
|
27082 | } else if (record.type === "throw") {
|
27083 | state = GenStateCompleted;
|
27084 |
|
27085 |
|
27086 | context.method = "throw";
|
27087 | context.arg = record.arg;
|
27088 | }
|
27089 | }
|
27090 | };
|
27091 | }
|
27092 |
|
27093 |
|
27094 |
|
27095 |
|
27096 |
|
27097 | function maybeInvokeDelegate(delegate, context) {
|
27098 | var method = delegate.iterator[context.method];
|
27099 | if (method === undefined) {
|
27100 |
|
27101 |
|
27102 | context.delegate = null;
|
27103 |
|
27104 | if (context.method === "throw") {
|
27105 | if (delegate.iterator.return) {
|
27106 |
|
27107 |
|
27108 | context.method = "return";
|
27109 | context.arg = undefined;
|
27110 | maybeInvokeDelegate(delegate, context);
|
27111 |
|
27112 | if (context.method === "throw") {
|
27113 |
|
27114 |
|
27115 | return ContinueSentinel;
|
27116 | }
|
27117 | }
|
27118 |
|
27119 | context.method = "throw";
|
27120 | context.arg = new TypeError(
|
27121 | "The iterator does not provide a 'throw' method");
|
27122 | }
|
27123 |
|
27124 | return ContinueSentinel;
|
27125 | }
|
27126 |
|
27127 | var record = tryCatch(method, delegate.iterator, context.arg);
|
27128 |
|
27129 | if (record.type === "throw") {
|
27130 | context.method = "throw";
|
27131 | context.arg = record.arg;
|
27132 | context.delegate = null;
|
27133 | return ContinueSentinel;
|
27134 | }
|
27135 |
|
27136 | var info = record.arg;
|
27137 |
|
27138 | if (! info) {
|
27139 | context.method = "throw";
|
27140 | context.arg = new TypeError("iterator result is not an object");
|
27141 | context.delegate = null;
|
27142 | return ContinueSentinel;
|
27143 | }
|
27144 |
|
27145 | if (info.done) {
|
27146 |
|
27147 |
|
27148 | context[delegate.resultName] = info.value;
|
27149 |
|
27150 |
|
27151 | context.next = delegate.nextLoc;
|
27152 |
|
27153 |
|
27154 |
|
27155 |
|
27156 |
|
27157 |
|
27158 |
|
27159 | if (context.method !== "return") {
|
27160 | context.method = "next";
|
27161 | context.arg = undefined;
|
27162 | }
|
27163 |
|
27164 | } else {
|
27165 |
|
27166 | return info;
|
27167 | }
|
27168 |
|
27169 |
|
27170 |
|
27171 | context.delegate = null;
|
27172 | return ContinueSentinel;
|
27173 | }
|
27174 |
|
27175 |
|
27176 |
|
27177 | defineIteratorMethods(Gp);
|
27178 |
|
27179 | Gp[toStringTagSymbol] = "Generator";
|
27180 |
|
27181 |
|
27182 |
|
27183 |
|
27184 |
|
27185 |
|
27186 | Gp[iteratorSymbol] = function() {
|
27187 | return this;
|
27188 | };
|
27189 |
|
27190 | Gp.toString = function() {
|
27191 | return "[object Generator]";
|
27192 | };
|
27193 |
|
27194 | function pushTryEntry(locs) {
|
27195 | var entry = { tryLoc: locs[0] };
|
27196 |
|
27197 | if (1 in locs) {
|
27198 | entry.catchLoc = locs[1];
|
27199 | }
|
27200 |
|
27201 | if (2 in locs) {
|
27202 | entry.finallyLoc = locs[2];
|
27203 | entry.afterLoc = locs[3];
|
27204 | }
|
27205 |
|
27206 | this.tryEntries.push(entry);
|
27207 | }
|
27208 |
|
27209 | function resetTryEntry(entry) {
|
27210 | var record = entry.completion || {};
|
27211 | record.type = "normal";
|
27212 | delete record.arg;
|
27213 | entry.completion = record;
|
27214 | }
|
27215 |
|
27216 | function Context(tryLocsList) {
|
27217 |
|
27218 |
|
27219 |
|
27220 | this.tryEntries = [{ tryLoc: "root" }];
|
27221 | tryLocsList.forEach(pushTryEntry, this);
|
27222 | this.reset(true);
|
27223 | }
|
27224 |
|
27225 | runtime.keys = function(object) {
|
27226 | var keys = [];
|
27227 | for (var key in object) {
|
27228 | keys.push(key);
|
27229 | }
|
27230 | keys.reverse();
|
27231 |
|
27232 |
|
27233 |
|
27234 | return function next() {
|
27235 | while (keys.length) {
|
27236 | var key = keys.pop();
|
27237 | if (key in object) {
|
27238 | next.value = key;
|
27239 | next.done = false;
|
27240 | return next;
|
27241 | }
|
27242 | }
|
27243 |
|
27244 |
|
27245 |
|
27246 |
|
27247 | next.done = true;
|
27248 | return next;
|
27249 | };
|
27250 | };
|
27251 |
|
27252 | function values(iterable) {
|
27253 | if (iterable) {
|
27254 | var iteratorMethod = iterable[iteratorSymbol];
|
27255 | if (iteratorMethod) {
|
27256 | return iteratorMethod.call(iterable);
|
27257 | }
|
27258 |
|
27259 | if (typeof iterable.next === "function") {
|
27260 | return iterable;
|
27261 | }
|
27262 |
|
27263 | if (!isNaN(iterable.length)) {
|
27264 | var i = -1, next = function next() {
|
27265 | while (++i < iterable.length) {
|
27266 | if (hasOwn.call(iterable, i)) {
|
27267 | next.value = iterable[i];
|
27268 | next.done = false;
|
27269 | return next;
|
27270 | }
|
27271 | }
|
27272 |
|
27273 | next.value = undefined;
|
27274 | next.done = true;
|
27275 |
|
27276 | return next;
|
27277 | };
|
27278 |
|
27279 | return next.next = next;
|
27280 | }
|
27281 | }
|
27282 |
|
27283 |
|
27284 | return { next: doneResult };
|
27285 | }
|
27286 | runtime.values = values;
|
27287 |
|
27288 | function doneResult() {
|
27289 | return { value: undefined, done: true };
|
27290 | }
|
27291 |
|
27292 | Context.prototype = {
|
27293 | constructor: Context,
|
27294 |
|
27295 | reset: function(skipTempReset) {
|
27296 | this.prev = 0;
|
27297 | this.next = 0;
|
27298 |
|
27299 |
|
27300 | this.sent = this._sent = undefined;
|
27301 | this.done = false;
|
27302 | this.delegate = null;
|
27303 |
|
27304 | this.method = "next";
|
27305 | this.arg = undefined;
|
27306 |
|
27307 | this.tryEntries.forEach(resetTryEntry);
|
27308 |
|
27309 | if (!skipTempReset) {
|
27310 | for (var name in this) {
|
27311 |
|
27312 | if (name.charAt(0) === "t" &&
|
27313 | hasOwn.call(this, name) &&
|
27314 | !isNaN(+name.slice(1))) {
|
27315 | this[name] = undefined;
|
27316 | }
|
27317 | }
|
27318 | }
|
27319 | },
|
27320 |
|
27321 | stop: function() {
|
27322 | this.done = true;
|
27323 |
|
27324 | var rootEntry = this.tryEntries[0];
|
27325 | var rootRecord = rootEntry.completion;
|
27326 | if (rootRecord.type === "throw") {
|
27327 | throw rootRecord.arg;
|
27328 | }
|
27329 |
|
27330 | return this.rval;
|
27331 | },
|
27332 |
|
27333 | dispatchException: function(exception) {
|
27334 | if (this.done) {
|
27335 | throw exception;
|
27336 | }
|
27337 |
|
27338 | var context = this;
|
27339 | function handle(loc, caught) {
|
27340 | record.type = "throw";
|
27341 | record.arg = exception;
|
27342 | context.next = loc;
|
27343 |
|
27344 | if (caught) {
|
27345 |
|
27346 |
|
27347 | context.method = "next";
|
27348 | context.arg = undefined;
|
27349 | }
|
27350 |
|
27351 | return !! caught;
|
27352 | }
|
27353 |
|
27354 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
27355 | var entry = this.tryEntries[i];
|
27356 | var record = entry.completion;
|
27357 |
|
27358 | if (entry.tryLoc === "root") {
|
27359 |
|
27360 |
|
27361 |
|
27362 | return handle("end");
|
27363 | }
|
27364 |
|
27365 | if (entry.tryLoc <= this.prev) {
|
27366 | var hasCatch = hasOwn.call(entry, "catchLoc");
|
27367 | var hasFinally = hasOwn.call(entry, "finallyLoc");
|
27368 |
|
27369 | if (hasCatch && hasFinally) {
|
27370 | if (this.prev < entry.catchLoc) {
|
27371 | return handle(entry.catchLoc, true);
|
27372 | } else if (this.prev < entry.finallyLoc) {
|
27373 | return handle(entry.finallyLoc);
|
27374 | }
|
27375 |
|
27376 | } else if (hasCatch) {
|
27377 | if (this.prev < entry.catchLoc) {
|
27378 | return handle(entry.catchLoc, true);
|
27379 | }
|
27380 |
|
27381 | } else if (hasFinally) {
|
27382 | if (this.prev < entry.finallyLoc) {
|
27383 | return handle(entry.finallyLoc);
|
27384 | }
|
27385 |
|
27386 | } else {
|
27387 | throw new Error("try statement without catch or finally");
|
27388 | }
|
27389 | }
|
27390 | }
|
27391 | },
|
27392 |
|
27393 | abrupt: function(type, arg) {
|
27394 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
27395 | var entry = this.tryEntries[i];
|
27396 | if (entry.tryLoc <= this.prev &&
|
27397 | hasOwn.call(entry, "finallyLoc") &&
|
27398 | this.prev < entry.finallyLoc) {
|
27399 | var finallyEntry = entry;
|
27400 | break;
|
27401 | }
|
27402 | }
|
27403 |
|
27404 | if (finallyEntry &&
|
27405 | (type === "break" ||
|
27406 | type === "continue") &&
|
27407 | finallyEntry.tryLoc <= arg &&
|
27408 | arg <= finallyEntry.finallyLoc) {
|
27409 |
|
27410 |
|
27411 | finallyEntry = null;
|
27412 | }
|
27413 |
|
27414 | var record = finallyEntry ? finallyEntry.completion : {};
|
27415 | record.type = type;
|
27416 | record.arg = arg;
|
27417 |
|
27418 | if (finallyEntry) {
|
27419 | this.method = "next";
|
27420 | this.next = finallyEntry.finallyLoc;
|
27421 | return ContinueSentinel;
|
27422 | }
|
27423 |
|
27424 | return this.complete(record);
|
27425 | },
|
27426 |
|
27427 | complete: function(record, afterLoc) {
|
27428 | if (record.type === "throw") {
|
27429 | throw record.arg;
|
27430 | }
|
27431 |
|
27432 | if (record.type === "break" ||
|
27433 | record.type === "continue") {
|
27434 | this.next = record.arg;
|
27435 | } else if (record.type === "return") {
|
27436 | this.rval = this.arg = record.arg;
|
27437 | this.method = "return";
|
27438 | this.next = "end";
|
27439 | } else if (record.type === "normal" && afterLoc) {
|
27440 | this.next = afterLoc;
|
27441 | }
|
27442 |
|
27443 | return ContinueSentinel;
|
27444 | },
|
27445 |
|
27446 | finish: function(finallyLoc) {
|
27447 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
27448 | var entry = this.tryEntries[i];
|
27449 | if (entry.finallyLoc === finallyLoc) {
|
27450 | this.complete(entry.completion, entry.afterLoc);
|
27451 | resetTryEntry(entry);
|
27452 | return ContinueSentinel;
|
27453 | }
|
27454 | }
|
27455 | },
|
27456 |
|
27457 | "catch": function(tryLoc) {
|
27458 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
27459 | var entry = this.tryEntries[i];
|
27460 | if (entry.tryLoc === tryLoc) {
|
27461 | var record = entry.completion;
|
27462 | if (record.type === "throw") {
|
27463 | var thrown = record.arg;
|
27464 | resetTryEntry(entry);
|
27465 | }
|
27466 | return thrown;
|
27467 | }
|
27468 | }
|
27469 |
|
27470 |
|
27471 |
|
27472 | throw new Error("illegal catch attempt");
|
27473 | },
|
27474 |
|
27475 | delegateYield: function(iterable, resultName, nextLoc) {
|
27476 | this.delegate = {
|
27477 | iterator: values(iterable),
|
27478 | resultName: resultName,
|
27479 | nextLoc: nextLoc
|
27480 | };
|
27481 |
|
27482 | if (this.method === "next") {
|
27483 |
|
27484 |
|
27485 | this.arg = undefined;
|
27486 | }
|
27487 |
|
27488 | return ContinueSentinel;
|
27489 | }
|
27490 | };
|
27491 | })(
|
27492 |
|
27493 |
|
27494 |
|
27495 | typeof global === "object" ? global :
|
27496 | typeof window === "object" ? window :
|
27497 | typeof self === "object" ? self : this
|
27498 | );
|
27499 |
|
27500 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
27501 |
|
27502 | },{}],67:[function(require,module,exports){
|
27503 |
|
27504 |
|
27505 |
|
27506 |
|
27507 |
|
27508 |
|
27509 |
|
27510 |
|
27511 |
|
27512 | 'use strict';
|
27513 |
|
27514 |
|
27515 |
|
27516 | if ("development" !== "production") {
|
27517 | (function() {
|
27518 | 'use strict';
|
27519 |
|
27520 | Object.defineProperty(exports, '__esModule', { value: true });
|
27521 |
|
27522 |
|
27523 |
|
27524 |
|
27525 |
|
27526 |
|
27527 |
|
27528 |
|
27529 |
|
27530 |
|
27531 |
|
27532 |
|
27533 |
|
27534 |
|
27535 |
|
27536 |
|
27537 |
|
27538 |
|
27539 |
|
27540 |
|
27541 |
|
27542 | var enableSchedulerTracing = true;
|
27543 |
|
27544 |
|
27545 |
|
27546 |
|
27547 |
|
27548 |
|
27549 |
|
27550 |
|
27551 |
|
27552 |
|
27553 |
|
27554 |
|
27555 |
|
27556 |
|
27557 |
|
27558 |
|
27559 |
|
27560 | var DEFAULT_THREAD_ID = 0;
|
27561 |
|
27562 |
|
27563 | var interactionIDCounter = 0;
|
27564 | var threadIDCounter = 0;
|
27565 |
|
27566 |
|
27567 |
|
27568 |
|
27569 |
|
27570 | exports.__interactionsRef = null;
|
27571 |
|
27572 |
|
27573 | exports.__subscriberRef = null;
|
27574 |
|
27575 | if (enableSchedulerTracing) {
|
27576 | exports.__interactionsRef = {
|
27577 | current: new Set()
|
27578 | };
|
27579 | exports.__subscriberRef = {
|
27580 | current: null
|
27581 | };
|
27582 | }
|
27583 |
|
27584 | function unstable_clear(callback) {
|
27585 | if (!enableSchedulerTracing) {
|
27586 | return callback();
|
27587 | }
|
27588 |
|
27589 | var prevInteractions = exports.__interactionsRef.current;
|
27590 | exports.__interactionsRef.current = new Set();
|
27591 |
|
27592 | try {
|
27593 | return callback();
|
27594 | } finally {
|
27595 | exports.__interactionsRef.current = prevInteractions;
|
27596 | }
|
27597 | }
|
27598 |
|
27599 | function unstable_getCurrent() {
|
27600 | if (!enableSchedulerTracing) {
|
27601 | return null;
|
27602 | } else {
|
27603 | return exports.__interactionsRef.current;
|
27604 | }
|
27605 | }
|
27606 |
|
27607 | function unstable_getThreadID() {
|
27608 | return ++threadIDCounter;
|
27609 | }
|
27610 |
|
27611 | function unstable_trace(name, timestamp, callback) {
|
27612 | var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;
|
27613 |
|
27614 | if (!enableSchedulerTracing) {
|
27615 | return callback();
|
27616 | }
|
27617 |
|
27618 | var interaction = {
|
27619 | __count: 1,
|
27620 | id: interactionIDCounter++,
|
27621 | name: name,
|
27622 | timestamp: timestamp
|
27623 | };
|
27624 |
|
27625 | var prevInteractions = exports.__interactionsRef.current;
|
27626 |
|
27627 |
|
27628 |
|
27629 |
|
27630 | var interactions = new Set(prevInteractions);
|
27631 | interactions.add(interaction);
|
27632 | exports.__interactionsRef.current = interactions;
|
27633 |
|
27634 | var subscriber = exports.__subscriberRef.current;
|
27635 | var returnValue = void 0;
|
27636 |
|
27637 | try {
|
27638 | if (subscriber !== null) {
|
27639 | subscriber.onInteractionTraced(interaction);
|
27640 | }
|
27641 | } finally {
|
27642 | try {
|
27643 | if (subscriber !== null) {
|
27644 | subscriber.onWorkStarted(interactions, threadID);
|
27645 | }
|
27646 | } finally {
|
27647 | try {
|
27648 | returnValue = callback();
|
27649 | } finally {
|
27650 | exports.__interactionsRef.current = prevInteractions;
|
27651 |
|
27652 | try {
|
27653 | if (subscriber !== null) {
|
27654 | subscriber.onWorkStopped(interactions, threadID);
|
27655 | }
|
27656 | } finally {
|
27657 | interaction.__count--;
|
27658 |
|
27659 |
|
27660 |
|
27661 | if (subscriber !== null && interaction.__count === 0) {
|
27662 | subscriber.onInteractionScheduledWorkCompleted(interaction);
|
27663 | }
|
27664 | }
|
27665 | }
|
27666 | }
|
27667 | }
|
27668 |
|
27669 | return returnValue;
|
27670 | }
|
27671 |
|
27672 | function unstable_wrap(callback) {
|
27673 | var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;
|
27674 |
|
27675 | if (!enableSchedulerTracing) {
|
27676 | return callback;
|
27677 | }
|
27678 |
|
27679 | var wrappedInteractions = exports.__interactionsRef.current;
|
27680 |
|
27681 | var subscriber = exports.__subscriberRef.current;
|
27682 | if (subscriber !== null) {
|
27683 | subscriber.onWorkScheduled(wrappedInteractions, threadID);
|
27684 | }
|
27685 |
|
27686 |
|
27687 |
|
27688 | wrappedInteractions.forEach(function (interaction) {
|
27689 | interaction.__count++;
|
27690 | });
|
27691 |
|
27692 | var hasRun = false;
|
27693 |
|
27694 | function wrapped() {
|
27695 | var prevInteractions = exports.__interactionsRef.current;
|
27696 | exports.__interactionsRef.current = wrappedInteractions;
|
27697 |
|
27698 | subscriber = exports.__subscriberRef.current;
|
27699 |
|
27700 | try {
|
27701 | var returnValue = void 0;
|
27702 |
|
27703 | try {
|
27704 | if (subscriber !== null) {
|
27705 | subscriber.onWorkStarted(wrappedInteractions, threadID);
|
27706 | }
|
27707 | } finally {
|
27708 | try {
|
27709 | returnValue = callback.apply(undefined, arguments);
|
27710 | } finally {
|
27711 | exports.__interactionsRef.current = prevInteractions;
|
27712 |
|
27713 | if (subscriber !== null) {
|
27714 | subscriber.onWorkStopped(wrappedInteractions, threadID);
|
27715 | }
|
27716 | }
|
27717 | }
|
27718 |
|
27719 | return returnValue;
|
27720 | } finally {
|
27721 | if (!hasRun) {
|
27722 |
|
27723 |
|
27724 |
|
27725 | hasRun = true;
|
27726 |
|
27727 |
|
27728 |
|
27729 |
|
27730 | wrappedInteractions.forEach(function (interaction) {
|
27731 | interaction.__count--;
|
27732 |
|
27733 | if (subscriber !== null && interaction.__count === 0) {
|
27734 | subscriber.onInteractionScheduledWorkCompleted(interaction);
|
27735 | }
|
27736 | });
|
27737 | }
|
27738 | }
|
27739 | }
|
27740 |
|
27741 | wrapped.cancel = function cancel() {
|
27742 | subscriber = exports.__subscriberRef.current;
|
27743 |
|
27744 | try {
|
27745 | if (subscriber !== null) {
|
27746 | subscriber.onWorkCanceled(wrappedInteractions, threadID);
|
27747 | }
|
27748 | } finally {
|
27749 |
|
27750 |
|
27751 |
|
27752 | wrappedInteractions.forEach(function (interaction) {
|
27753 | interaction.__count--;
|
27754 |
|
27755 | if (subscriber && interaction.__count === 0) {
|
27756 | subscriber.onInteractionScheduledWorkCompleted(interaction);
|
27757 | }
|
27758 | });
|
27759 | }
|
27760 | };
|
27761 |
|
27762 | return wrapped;
|
27763 | }
|
27764 |
|
27765 | var subscribers = null;
|
27766 | if (enableSchedulerTracing) {
|
27767 | subscribers = new Set();
|
27768 | }
|
27769 |
|
27770 | function unstable_subscribe(subscriber) {
|
27771 | if (enableSchedulerTracing) {
|
27772 | subscribers.add(subscriber);
|
27773 |
|
27774 | if (subscribers.size === 1) {
|
27775 | exports.__subscriberRef.current = {
|
27776 | onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted,
|
27777 | onInteractionTraced: onInteractionTraced,
|
27778 | onWorkCanceled: onWorkCanceled,
|
27779 | onWorkScheduled: onWorkScheduled,
|
27780 | onWorkStarted: onWorkStarted,
|
27781 | onWorkStopped: onWorkStopped
|
27782 | };
|
27783 | }
|
27784 | }
|
27785 | }
|
27786 |
|
27787 | function unstable_unsubscribe(subscriber) {
|
27788 | if (enableSchedulerTracing) {
|
27789 | subscribers.delete(subscriber);
|
27790 |
|
27791 | if (subscribers.size === 0) {
|
27792 | exports.__subscriberRef.current = null;
|
27793 | }
|
27794 | }
|
27795 | }
|
27796 |
|
27797 | function onInteractionTraced(interaction) {
|
27798 | var didCatchError = false;
|
27799 | var caughtError = null;
|
27800 |
|
27801 | subscribers.forEach(function (subscriber) {
|
27802 | try {
|
27803 | subscriber.onInteractionTraced(interaction);
|
27804 | } catch (error) {
|
27805 | if (!didCatchError) {
|
27806 | didCatchError = true;
|
27807 | caughtError = error;
|
27808 | }
|
27809 | }
|
27810 | });
|
27811 |
|
27812 | if (didCatchError) {
|
27813 | throw caughtError;
|
27814 | }
|
27815 | }
|
27816 |
|
27817 | function onInteractionScheduledWorkCompleted(interaction) {
|
27818 | var didCatchError = false;
|
27819 | var caughtError = null;
|
27820 |
|
27821 | subscribers.forEach(function (subscriber) {
|
27822 | try {
|
27823 | subscriber.onInteractionScheduledWorkCompleted(interaction);
|
27824 | } catch (error) {
|
27825 | if (!didCatchError) {
|
27826 | didCatchError = true;
|
27827 | caughtError = error;
|
27828 | }
|
27829 | }
|
27830 | });
|
27831 |
|
27832 | if (didCatchError) {
|
27833 | throw caughtError;
|
27834 | }
|
27835 | }
|
27836 |
|
27837 | function onWorkScheduled(interactions, threadID) {
|
27838 | var didCatchError = false;
|
27839 | var caughtError = null;
|
27840 |
|
27841 | subscribers.forEach(function (subscriber) {
|
27842 | try {
|
27843 | subscriber.onWorkScheduled(interactions, threadID);
|
27844 | } catch (error) {
|
27845 | if (!didCatchError) {
|
27846 | didCatchError = true;
|
27847 | caughtError = error;
|
27848 | }
|
27849 | }
|
27850 | });
|
27851 |
|
27852 | if (didCatchError) {
|
27853 | throw caughtError;
|
27854 | }
|
27855 | }
|
27856 |
|
27857 | function onWorkStarted(interactions, threadID) {
|
27858 | var didCatchError = false;
|
27859 | var caughtError = null;
|
27860 |
|
27861 | subscribers.forEach(function (subscriber) {
|
27862 | try {
|
27863 | subscriber.onWorkStarted(interactions, threadID);
|
27864 | } catch (error) {
|
27865 | if (!didCatchError) {
|
27866 | didCatchError = true;
|
27867 | caughtError = error;
|
27868 | }
|
27869 | }
|
27870 | });
|
27871 |
|
27872 | if (didCatchError) {
|
27873 | throw caughtError;
|
27874 | }
|
27875 | }
|
27876 |
|
27877 | function onWorkStopped(interactions, threadID) {
|
27878 | var didCatchError = false;
|
27879 | var caughtError = null;
|
27880 |
|
27881 | subscribers.forEach(function (subscriber) {
|
27882 | try {
|
27883 | subscriber.onWorkStopped(interactions, threadID);
|
27884 | } catch (error) {
|
27885 | if (!didCatchError) {
|
27886 | didCatchError = true;
|
27887 | caughtError = error;
|
27888 | }
|
27889 | }
|
27890 | });
|
27891 |
|
27892 | if (didCatchError) {
|
27893 | throw caughtError;
|
27894 | }
|
27895 | }
|
27896 |
|
27897 | function onWorkCanceled(interactions, threadID) {
|
27898 | var didCatchError = false;
|
27899 | var caughtError = null;
|
27900 |
|
27901 | subscribers.forEach(function (subscriber) {
|
27902 | try {
|
27903 | subscriber.onWorkCanceled(interactions, threadID);
|
27904 | } catch (error) {
|
27905 | if (!didCatchError) {
|
27906 | didCatchError = true;
|
27907 | caughtError = error;
|
27908 | }
|
27909 | }
|
27910 | });
|
27911 |
|
27912 | if (didCatchError) {
|
27913 | throw caughtError;
|
27914 | }
|
27915 | }
|
27916 |
|
27917 | exports.unstable_clear = unstable_clear;
|
27918 | exports.unstable_getCurrent = unstable_getCurrent;
|
27919 | exports.unstable_getThreadID = unstable_getThreadID;
|
27920 | exports.unstable_trace = unstable_trace;
|
27921 | exports.unstable_wrap = unstable_wrap;
|
27922 | exports.unstable_subscribe = unstable_subscribe;
|
27923 | exports.unstable_unsubscribe = unstable_unsubscribe;
|
27924 | })();
|
27925 | }
|
27926 |
|
27927 | },{}],68:[function(require,module,exports){
|
27928 |
|
27929 |
|
27930 |
|
27931 |
|
27932 |
|
27933 |
|
27934 |
|
27935 |
|
27936 |
|
27937 | 'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var b=0;exports.__interactionsRef=null;exports.__subscriberRef=null;exports.unstable_clear=function(a){return a()};exports.unstable_getCurrent=function(){return null};exports.unstable_getThreadID=function(){return++b};exports.unstable_trace=function(a,d,c){return c()};exports.unstable_wrap=function(a){return a};exports.unstable_subscribe=function(){};exports.unstable_unsubscribe=function(){};
|
27938 |
|
27939 | },{}],69:[function(require,module,exports){
|
27940 | (function (global){
|
27941 |
|
27942 |
|
27943 |
|
27944 |
|
27945 |
|
27946 |
|
27947 |
|
27948 |
|
27949 |
|
27950 | 'use strict';
|
27951 |
|
27952 |
|
27953 |
|
27954 | if ("development" !== "production") {
|
27955 | (function() {
|
27956 | 'use strict';
|
27957 |
|
27958 | Object.defineProperty(exports, '__esModule', { value: true });
|
27959 |
|
27960 |
|
27961 |
|
27962 |
|
27963 |
|
27964 |
|
27965 |
|
27966 |
|
27967 |
|
27968 |
|
27969 |
|
27970 |
|
27971 |
|
27972 |
|
27973 |
|
27974 |
|
27975 |
|
27976 |
|
27977 |
|
27978 |
|
27979 |
|
27980 |
|
27981 |
|
27982 |
|
27983 |
|
27984 |
|
27985 |
|
27986 | var enableSchedulerDebugging = true;
|
27987 |
|
27988 |
|
27989 |
|
27990 |
|
27991 |
|
27992 |
|
27993 |
|
27994 |
|
27995 |
|
27996 |
|
27997 |
|
27998 |
|
27999 |
|
28000 |
|
28001 | var ImmediatePriority = 1;
|
28002 | var UserBlockingPriority = 2;
|
28003 | var NormalPriority = 3;
|
28004 | var LowPriority = 4;
|
28005 | var IdlePriority = 5;
|
28006 |
|
28007 |
|
28008 |
|
28009 |
|
28010 | var maxSigned31BitInt = 1073741823;
|
28011 |
|
28012 |
|
28013 | var IMMEDIATE_PRIORITY_TIMEOUT = -1;
|
28014 |
|
28015 | var USER_BLOCKING_PRIORITY = 250;
|
28016 | var NORMAL_PRIORITY_TIMEOUT = 5000;
|
28017 | var LOW_PRIORITY_TIMEOUT = 10000;
|
28018 |
|
28019 | var IDLE_PRIORITY = maxSigned31BitInt;
|
28020 |
|
28021 |
|
28022 | var firstCallbackNode = null;
|
28023 |
|
28024 | var currentDidTimeout = false;
|
28025 |
|
28026 | var isSchedulerPaused = false;
|
28027 |
|
28028 | var currentPriorityLevel = NormalPriority;
|
28029 | var currentEventStartTime = -1;
|
28030 | var currentExpirationTime = -1;
|
28031 |
|
28032 |
|
28033 | var isExecutingCallback = false;
|
28034 |
|
28035 | var isHostCallbackScheduled = false;
|
28036 |
|
28037 | var hasNativePerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';
|
28038 |
|
28039 | function ensureHostCallbackIsScheduled() {
|
28040 | if (isExecutingCallback) {
|
28041 |
|
28042 | return;
|
28043 | }
|
28044 |
|
28045 | var expirationTime = firstCallbackNode.expirationTime;
|
28046 | if (!isHostCallbackScheduled) {
|
28047 | isHostCallbackScheduled = true;
|
28048 | } else {
|
28049 |
|
28050 | cancelHostCallback();
|
28051 | }
|
28052 | requestHostCallback(flushWork, expirationTime);
|
28053 | }
|
28054 |
|
28055 | function flushFirstCallback() {
|
28056 | var flushedNode = firstCallbackNode;
|
28057 |
|
28058 |
|
28059 |
|
28060 | var next = firstCallbackNode.next;
|
28061 | if (firstCallbackNode === next) {
|
28062 |
|
28063 | firstCallbackNode = null;
|
28064 | next = null;
|
28065 | } else {
|
28066 | var lastCallbackNode = firstCallbackNode.previous;
|
28067 | firstCallbackNode = lastCallbackNode.next = next;
|
28068 | next.previous = lastCallbackNode;
|
28069 | }
|
28070 |
|
28071 | flushedNode.next = flushedNode.previous = null;
|
28072 |
|
28073 |
|
28074 | var callback = flushedNode.callback;
|
28075 | var expirationTime = flushedNode.expirationTime;
|
28076 | var priorityLevel = flushedNode.priorityLevel;
|
28077 | var previousPriorityLevel = currentPriorityLevel;
|
28078 | var previousExpirationTime = currentExpirationTime;
|
28079 | currentPriorityLevel = priorityLevel;
|
28080 | currentExpirationTime = expirationTime;
|
28081 | var continuationCallback;
|
28082 | try {
|
28083 | continuationCallback = callback();
|
28084 | } finally {
|
28085 | currentPriorityLevel = previousPriorityLevel;
|
28086 | currentExpirationTime = previousExpirationTime;
|
28087 | }
|
28088 |
|
28089 |
|
28090 |
|
28091 | if (typeof continuationCallback === 'function') {
|
28092 | var continuationNode = {
|
28093 | callback: continuationCallback,
|
28094 | priorityLevel: priorityLevel,
|
28095 | expirationTime: expirationTime,
|
28096 | next: null,
|
28097 | previous: null
|
28098 | };
|
28099 |
|
28100 |
|
28101 |
|
28102 |
|
28103 |
|
28104 | if (firstCallbackNode === null) {
|
28105 |
|
28106 | firstCallbackNode = continuationNode.next = continuationNode.previous = continuationNode;
|
28107 | } else {
|
28108 | var nextAfterContinuation = null;
|
28109 | var node = firstCallbackNode;
|
28110 | do {
|
28111 | if (node.expirationTime >= expirationTime) {
|
28112 |
|
28113 |
|
28114 | nextAfterContinuation = node;
|
28115 | break;
|
28116 | }
|
28117 | node = node.next;
|
28118 | } while (node !== firstCallbackNode);
|
28119 |
|
28120 | if (nextAfterContinuation === null) {
|
28121 |
|
28122 |
|
28123 | nextAfterContinuation = firstCallbackNode;
|
28124 | } else if (nextAfterContinuation === firstCallbackNode) {
|
28125 |
|
28126 | firstCallbackNode = continuationNode;
|
28127 | ensureHostCallbackIsScheduled();
|
28128 | }
|
28129 |
|
28130 | var previous = nextAfterContinuation.previous;
|
28131 | previous.next = nextAfterContinuation.previous = continuationNode;
|
28132 | continuationNode.next = nextAfterContinuation;
|
28133 | continuationNode.previous = previous;
|
28134 | }
|
28135 | }
|
28136 | }
|
28137 |
|
28138 | function flushImmediateWork() {
|
28139 | if (
|
28140 |
|
28141 | currentEventStartTime === -1 && firstCallbackNode !== null && firstCallbackNode.priorityLevel === ImmediatePriority) {
|
28142 | isExecutingCallback = true;
|
28143 | try {
|
28144 | do {
|
28145 | flushFirstCallback();
|
28146 | } while (
|
28147 |
|
28148 | firstCallbackNode !== null && firstCallbackNode.priorityLevel === ImmediatePriority);
|
28149 | } finally {
|
28150 | isExecutingCallback = false;
|
28151 | if (firstCallbackNode !== null) {
|
28152 |
|
28153 | ensureHostCallbackIsScheduled();
|
28154 | } else {
|
28155 | isHostCallbackScheduled = false;
|
28156 | }
|
28157 | }
|
28158 | }
|
28159 | }
|
28160 |
|
28161 | function flushWork(didTimeout) {
|
28162 |
|
28163 |
|
28164 | if (enableSchedulerDebugging && isSchedulerPaused) {
|
28165 | return;
|
28166 | }
|
28167 |
|
28168 | isExecutingCallback = true;
|
28169 | var previousDidTimeout = currentDidTimeout;
|
28170 | currentDidTimeout = didTimeout;
|
28171 | try {
|
28172 | if (didTimeout) {
|
28173 |
|
28174 | while (firstCallbackNode !== null && !(enableSchedulerDebugging && isSchedulerPaused)) {
|
28175 |
|
28176 |
|
28177 |
|
28178 |
|
28179 | var currentTime = exports.unstable_now();
|
28180 | if (firstCallbackNode.expirationTime <= currentTime) {
|
28181 | do {
|
28182 | flushFirstCallback();
|
28183 | } while (firstCallbackNode !== null && firstCallbackNode.expirationTime <= currentTime && !(enableSchedulerDebugging && isSchedulerPaused));
|
28184 | continue;
|
28185 | }
|
28186 | break;
|
28187 | }
|
28188 | } else {
|
28189 |
|
28190 | if (firstCallbackNode !== null) {
|
28191 | do {
|
28192 | if (enableSchedulerDebugging && isSchedulerPaused) {
|
28193 | break;
|
28194 | }
|
28195 | flushFirstCallback();
|
28196 | } while (firstCallbackNode !== null && !shouldYieldToHost());
|
28197 | }
|
28198 | }
|
28199 | } finally {
|
28200 | isExecutingCallback = false;
|
28201 | currentDidTimeout = previousDidTimeout;
|
28202 | if (firstCallbackNode !== null) {
|
28203 |
|
28204 | ensureHostCallbackIsScheduled();
|
28205 | } else {
|
28206 | isHostCallbackScheduled = false;
|
28207 | }
|
28208 |
|
28209 | flushImmediateWork();
|
28210 | }
|
28211 | }
|
28212 |
|
28213 | function unstable_runWithPriority(priorityLevel, eventHandler) {
|
28214 | switch (priorityLevel) {
|
28215 | case ImmediatePriority:
|
28216 | case UserBlockingPriority:
|
28217 | case NormalPriority:
|
28218 | case LowPriority:
|
28219 | case IdlePriority:
|
28220 | break;
|
28221 | default:
|
28222 | priorityLevel = NormalPriority;
|
28223 | }
|
28224 |
|
28225 | var previousPriorityLevel = currentPriorityLevel;
|
28226 | var previousEventStartTime = currentEventStartTime;
|
28227 | currentPriorityLevel = priorityLevel;
|
28228 | currentEventStartTime = exports.unstable_now();
|
28229 |
|
28230 | try {
|
28231 | return eventHandler();
|
28232 | } finally {
|
28233 | currentPriorityLevel = previousPriorityLevel;
|
28234 | currentEventStartTime = previousEventStartTime;
|
28235 |
|
28236 |
|
28237 | flushImmediateWork();
|
28238 | }
|
28239 | }
|
28240 |
|
28241 | function unstable_wrapCallback(callback) {
|
28242 | var parentPriorityLevel = currentPriorityLevel;
|
28243 | return function () {
|
28244 |
|
28245 | var previousPriorityLevel = currentPriorityLevel;
|
28246 | var previousEventStartTime = currentEventStartTime;
|
28247 | currentPriorityLevel = parentPriorityLevel;
|
28248 | currentEventStartTime = exports.unstable_now();
|
28249 |
|
28250 | try {
|
28251 | return callback.apply(this, arguments);
|
28252 | } finally {
|
28253 | currentPriorityLevel = previousPriorityLevel;
|
28254 | currentEventStartTime = previousEventStartTime;
|
28255 | flushImmediateWork();
|
28256 | }
|
28257 | };
|
28258 | }
|
28259 |
|
28260 | function unstable_scheduleCallback(callback, deprecated_options) {
|
28261 | var startTime = currentEventStartTime !== -1 ? currentEventStartTime : exports.unstable_now();
|
28262 |
|
28263 | var expirationTime;
|
28264 | if (typeof deprecated_options === 'object' && deprecated_options !== null && typeof deprecated_options.timeout === 'number') {
|
28265 |
|
28266 | expirationTime = startTime + deprecated_options.timeout;
|
28267 | } else {
|
28268 | switch (currentPriorityLevel) {
|
28269 | case ImmediatePriority:
|
28270 | expirationTime = startTime + IMMEDIATE_PRIORITY_TIMEOUT;
|
28271 | break;
|
28272 | case UserBlockingPriority:
|
28273 | expirationTime = startTime + USER_BLOCKING_PRIORITY;
|
28274 | break;
|
28275 | case IdlePriority:
|
28276 | expirationTime = startTime + IDLE_PRIORITY;
|
28277 | break;
|
28278 | case LowPriority:
|
28279 | expirationTime = startTime + LOW_PRIORITY_TIMEOUT;
|
28280 | break;
|
28281 | case NormalPriority:
|
28282 | default:
|
28283 | expirationTime = startTime + NORMAL_PRIORITY_TIMEOUT;
|
28284 | }
|
28285 | }
|
28286 |
|
28287 | var newNode = {
|
28288 | callback: callback,
|
28289 | priorityLevel: currentPriorityLevel,
|
28290 | expirationTime: expirationTime,
|
28291 | next: null,
|
28292 | previous: null
|
28293 | };
|
28294 |
|
28295 |
|
28296 |
|
28297 |
|
28298 | if (firstCallbackNode === null) {
|
28299 |
|
28300 | firstCallbackNode = newNode.next = newNode.previous = newNode;
|
28301 | ensureHostCallbackIsScheduled();
|
28302 | } else {
|
28303 | var next = null;
|
28304 | var node = firstCallbackNode;
|
28305 | do {
|
28306 | if (node.expirationTime > expirationTime) {
|
28307 |
|
28308 | next = node;
|
28309 | break;
|
28310 | }
|
28311 | node = node.next;
|
28312 | } while (node !== firstCallbackNode);
|
28313 |
|
28314 | if (next === null) {
|
28315 |
|
28316 |
|
28317 | next = firstCallbackNode;
|
28318 | } else if (next === firstCallbackNode) {
|
28319 |
|
28320 | firstCallbackNode = newNode;
|
28321 | ensureHostCallbackIsScheduled();
|
28322 | }
|
28323 |
|
28324 | var previous = next.previous;
|
28325 | previous.next = next.previous = newNode;
|
28326 | newNode.next = next;
|
28327 | newNode.previous = previous;
|
28328 | }
|
28329 |
|
28330 | return newNode;
|
28331 | }
|
28332 |
|
28333 | function unstable_pauseExecution() {
|
28334 | isSchedulerPaused = true;
|
28335 | }
|
28336 |
|
28337 | function unstable_continueExecution() {
|
28338 | isSchedulerPaused = false;
|
28339 | if (firstCallbackNode !== null) {
|
28340 | ensureHostCallbackIsScheduled();
|
28341 | }
|
28342 | }
|
28343 |
|
28344 | function unstable_getFirstCallbackNode() {
|
28345 | return firstCallbackNode;
|
28346 | }
|
28347 |
|
28348 | function unstable_cancelCallback(callbackNode) {
|
28349 | var next = callbackNode.next;
|
28350 | if (next === null) {
|
28351 |
|
28352 | return;
|
28353 | }
|
28354 |
|
28355 | if (next === callbackNode) {
|
28356 |
|
28357 | firstCallbackNode = null;
|
28358 | } else {
|
28359 |
|
28360 | if (callbackNode === firstCallbackNode) {
|
28361 | firstCallbackNode = next;
|
28362 | }
|
28363 | var previous = callbackNode.previous;
|
28364 | previous.next = next;
|
28365 | next.previous = previous;
|
28366 | }
|
28367 |
|
28368 | callbackNode.next = callbackNode.previous = null;
|
28369 | }
|
28370 |
|
28371 | function unstable_getCurrentPriorityLevel() {
|
28372 | return currentPriorityLevel;
|
28373 | }
|
28374 |
|
28375 | function unstable_shouldYield() {
|
28376 | return !currentDidTimeout && (firstCallbackNode !== null && firstCallbackNode.expirationTime < currentExpirationTime || shouldYieldToHost());
|
28377 | }
|
28378 |
|
28379 |
|
28380 |
|
28381 |
|
28382 |
|
28383 |
|
28384 |
|
28385 |
|
28386 |
|
28387 |
|
28388 |
|
28389 |
|
28390 | var localDate = Date;
|
28391 |
|
28392 |
|
28393 |
|
28394 |
|
28395 |
|
28396 | var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;
|
28397 | var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;
|
28398 |
|
28399 |
|
28400 |
|
28401 | var localRequestAnimationFrame = typeof requestAnimationFrame === 'function' ? requestAnimationFrame : undefined;
|
28402 | var localCancelAnimationFrame = typeof cancelAnimationFrame === 'function' ? cancelAnimationFrame : undefined;
|
28403 |
|
28404 |
|
28405 |
|
28406 |
|
28407 |
|
28408 |
|
28409 | var ANIMATION_FRAME_TIMEOUT = 100;
|
28410 | var rAFID;
|
28411 | var rAFTimeoutID;
|
28412 | var requestAnimationFrameWithTimeout = function (callback) {
|
28413 |
|
28414 | rAFID = localRequestAnimationFrame(function (timestamp) {
|
28415 |
|
28416 | localClearTimeout(rAFTimeoutID);
|
28417 | callback(timestamp);
|
28418 | });
|
28419 | rAFTimeoutID = localSetTimeout(function () {
|
28420 |
|
28421 | localCancelAnimationFrame(rAFID);
|
28422 | callback(exports.unstable_now());
|
28423 | }, ANIMATION_FRAME_TIMEOUT);
|
28424 | };
|
28425 |
|
28426 | if (hasNativePerformanceNow) {
|
28427 | var Performance = performance;
|
28428 | exports.unstable_now = function () {
|
28429 | return Performance.now();
|
28430 | };
|
28431 | } else {
|
28432 | exports.unstable_now = function () {
|
28433 | return localDate.now();
|
28434 | };
|
28435 | }
|
28436 |
|
28437 | var requestHostCallback;
|
28438 | var cancelHostCallback;
|
28439 | var shouldYieldToHost;
|
28440 |
|
28441 | var globalValue = null;
|
28442 | if (typeof window !== 'undefined') {
|
28443 | globalValue = window;
|
28444 | } else if (typeof global !== 'undefined') {
|
28445 | globalValue = global;
|
28446 | }
|
28447 |
|
28448 | if (globalValue && globalValue._schedMock) {
|
28449 |
|
28450 | var globalImpl = globalValue._schedMock;
|
28451 | requestHostCallback = globalImpl[0];
|
28452 | cancelHostCallback = globalImpl[1];
|
28453 | shouldYieldToHost = globalImpl[2];
|
28454 | exports.unstable_now = globalImpl[3];
|
28455 | } else if (
|
28456 |
|
28457 |
|
28458 | typeof window === 'undefined' ||
|
28459 |
|
28460 | typeof MessageChannel !== 'function') {
|
28461 |
|
28462 |
|
28463 | var _callback = null;
|
28464 | var _flushCallback = function (didTimeout) {
|
28465 | if (_callback !== null) {
|
28466 | try {
|
28467 | _callback(didTimeout);
|
28468 | } finally {
|
28469 | _callback = null;
|
28470 | }
|
28471 | }
|
28472 | };
|
28473 | requestHostCallback = function (cb, ms) {
|
28474 | if (_callback !== null) {
|
28475 |
|
28476 | setTimeout(requestHostCallback, 0, cb);
|
28477 | } else {
|
28478 | _callback = cb;
|
28479 | setTimeout(_flushCallback, 0, false);
|
28480 | }
|
28481 | };
|
28482 | cancelHostCallback = function () {
|
28483 | _callback = null;
|
28484 | };
|
28485 | shouldYieldToHost = function () {
|
28486 | return false;
|
28487 | };
|
28488 | } else {
|
28489 | if (typeof console !== 'undefined') {
|
28490 |
|
28491 | if (typeof localRequestAnimationFrame !== 'function') {
|
28492 | console.error("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
|
28493 | }
|
28494 | if (typeof localCancelAnimationFrame !== 'function') {
|
28495 | console.error("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
|
28496 | }
|
28497 | }
|
28498 |
|
28499 | var scheduledHostCallback = null;
|
28500 | var isMessageEventScheduled = false;
|
28501 | var timeoutTime = -1;
|
28502 |
|
28503 | var isAnimationFrameScheduled = false;
|
28504 |
|
28505 | var isFlushingHostCallback = false;
|
28506 |
|
28507 | var frameDeadline = 0;
|
28508 |
|
28509 |
|
28510 |
|
28511 | var previousFrameTime = 33;
|
28512 | var activeFrameTime = 33;
|
28513 |
|
28514 | shouldYieldToHost = function () {
|
28515 | return frameDeadline <= exports.unstable_now();
|
28516 | };
|
28517 |
|
28518 |
|
28519 | var channel = new MessageChannel();
|
28520 | var port = channel.port2;
|
28521 | channel.port1.onmessage = function (event) {
|
28522 | isMessageEventScheduled = false;
|
28523 |
|
28524 | var prevScheduledCallback = scheduledHostCallback;
|
28525 | var prevTimeoutTime = timeoutTime;
|
28526 | scheduledHostCallback = null;
|
28527 | timeoutTime = -1;
|
28528 |
|
28529 | var currentTime = exports.unstable_now();
|
28530 |
|
28531 | var didTimeout = false;
|
28532 | if (frameDeadline - currentTime <= 0) {
|
28533 |
|
28534 |
|
28535 | if (prevTimeoutTime !== -1 && prevTimeoutTime <= currentTime) {
|
28536 |
|
28537 |
|
28538 | didTimeout = true;
|
28539 | } else {
|
28540 |
|
28541 | if (!isAnimationFrameScheduled) {
|
28542 |
|
28543 | isAnimationFrameScheduled = true;
|
28544 | requestAnimationFrameWithTimeout(animationTick);
|
28545 | }
|
28546 |
|
28547 | scheduledHostCallback = prevScheduledCallback;
|
28548 | timeoutTime = prevTimeoutTime;
|
28549 | return;
|
28550 | }
|
28551 | }
|
28552 |
|
28553 | if (prevScheduledCallback !== null) {
|
28554 | isFlushingHostCallback = true;
|
28555 | try {
|
28556 | prevScheduledCallback(didTimeout);
|
28557 | } finally {
|
28558 | isFlushingHostCallback = false;
|
28559 | }
|
28560 | }
|
28561 | };
|
28562 |
|
28563 | var animationTick = function (rafTime) {
|
28564 | if (scheduledHostCallback !== null) {
|
28565 |
|
28566 |
|
28567 |
|
28568 |
|
28569 |
|
28570 |
|
28571 |
|
28572 |
|
28573 | requestAnimationFrameWithTimeout(animationTick);
|
28574 | } else {
|
28575 |
|
28576 | isAnimationFrameScheduled = false;
|
28577 | return;
|
28578 | }
|
28579 |
|
28580 | var nextFrameTime = rafTime - frameDeadline + activeFrameTime;
|
28581 | if (nextFrameTime < activeFrameTime && previousFrameTime < activeFrameTime) {
|
28582 | if (nextFrameTime < 8) {
|
28583 |
|
28584 |
|
28585 | nextFrameTime = 8;
|
28586 | }
|
28587 |
|
28588 |
|
28589 |
|
28590 |
|
28591 |
|
28592 |
|
28593 |
|
28594 | activeFrameTime = nextFrameTime < previousFrameTime ? previousFrameTime : nextFrameTime;
|
28595 | } else {
|
28596 | previousFrameTime = nextFrameTime;
|
28597 | }
|
28598 | frameDeadline = rafTime + activeFrameTime;
|
28599 | if (!isMessageEventScheduled) {
|
28600 | isMessageEventScheduled = true;
|
28601 | port.postMessage(undefined);
|
28602 | }
|
28603 | };
|
28604 |
|
28605 | requestHostCallback = function (callback, absoluteTimeout) {
|
28606 | scheduledHostCallback = callback;
|
28607 | timeoutTime = absoluteTimeout;
|
28608 | if (isFlushingHostCallback || absoluteTimeout < 0) {
|
28609 |
|
28610 | port.postMessage(undefined);
|
28611 | } else if (!isAnimationFrameScheduled) {
|
28612 |
|
28613 |
|
28614 |
|
28615 |
|
28616 | isAnimationFrameScheduled = true;
|
28617 | requestAnimationFrameWithTimeout(animationTick);
|
28618 | }
|
28619 | };
|
28620 |
|
28621 | cancelHostCallback = function () {
|
28622 | scheduledHostCallback = null;
|
28623 | isMessageEventScheduled = false;
|
28624 | timeoutTime = -1;
|
28625 | };
|
28626 | }
|
28627 |
|
28628 | exports.unstable_ImmediatePriority = ImmediatePriority;
|
28629 | exports.unstable_UserBlockingPriority = UserBlockingPriority;
|
28630 | exports.unstable_NormalPriority = NormalPriority;
|
28631 | exports.unstable_IdlePriority = IdlePriority;
|
28632 | exports.unstable_LowPriority = LowPriority;
|
28633 | exports.unstable_runWithPriority = unstable_runWithPriority;
|
28634 | exports.unstable_scheduleCallback = unstable_scheduleCallback;
|
28635 | exports.unstable_cancelCallback = unstable_cancelCallback;
|
28636 | exports.unstable_wrapCallback = unstable_wrapCallback;
|
28637 | exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
|
28638 | exports.unstable_shouldYield = unstable_shouldYield;
|
28639 | exports.unstable_continueExecution = unstable_continueExecution;
|
28640 | exports.unstable_pauseExecution = unstable_pauseExecution;
|
28641 | exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
|
28642 | })();
|
28643 | }
|
28644 |
|
28645 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
28646 |
|
28647 | },{}],70:[function(require,module,exports){
|
28648 | (function (global){
|
28649 |
|
28650 |
|
28651 |
|
28652 |
|
28653 |
|
28654 |
|
28655 |
|
28656 |
|
28657 |
|
28658 | 'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var c=null,f=!1,h=3,k=-1,l=-1,m=!1,n=!1;function p(){if(!m){var a=c.expirationTime;n?q():n=!0;r(t,a)}}
|
28659 | function u(){var a=c,b=c.next;if(c===b)c=null;else{var d=c.previous;c=d.next=b;b.previous=d}a.next=a.previous=null;d=a.callback;b=a.expirationTime;a=a.priorityLevel;var e=h,Q=l;h=a;l=b;try{var g=d()}finally{h=e,l=Q}if("function"===typeof g)if(g={callback:g,priorityLevel:a,expirationTime:b,next:null,previous:null},null===c)c=g.next=g.previous=g;else{d=null;a=c;do{if(a.expirationTime>=b){d=a;break}a=a.next}while(a!==c);null===d?d=c:d===c&&(c=g,p());b=d.previous;b.next=d.previous=g;g.next=d;g.previous=
|
28660 | b}}function v(){if(-1===k&&null!==c&&1===c.priorityLevel){m=!0;try{do u();while(null!==c&&1===c.priorityLevel)}finally{m=!1,null!==c?p():n=!1}}}function t(a){m=!0;var b=f;f=a;try{if(a)for(;null!==c;){var d=exports.unstable_now();if(c.expirationTime<=d){do u();while(null!==c&&c.expirationTime<=d)}else break}else if(null!==c){do u();while(null!==c&&!w())}}finally{m=!1,f=b,null!==c?p():n=!1,v()}}
|
28661 | var x=Date,y="function"===typeof setTimeout?setTimeout:void 0,z="function"===typeof clearTimeout?clearTimeout:void 0,A="function"===typeof requestAnimationFrame?requestAnimationFrame:void 0,B="function"===typeof cancelAnimationFrame?cancelAnimationFrame:void 0,C,D;function E(a){C=A(function(b){z(D);a(b)});D=y(function(){B(C);a(exports.unstable_now())},100)}
|
28662 | if("object"===typeof performance&&"function"===typeof performance.now){var F=performance;exports.unstable_now=function(){return F.now()}}else exports.unstable_now=function(){return x.now()};var r,q,w,G=null;"undefined"!==typeof window?G=window:"undefined"!==typeof global&&(G=global);
|
28663 | if(G&&G._schedMock){var H=G._schedMock;r=H[0];q=H[1];w=H[2];exports.unstable_now=H[3]}else if("undefined"===typeof window||"function"!==typeof MessageChannel){var I=null,J=function(a){if(null!==I)try{I(a)}finally{I=null}};r=function(a){null!==I?setTimeout(r,0,a):(I=a,setTimeout(J,0,!1))};q=function(){I=null};w=function(){return!1}}else{"undefined"!==typeof console&&("function"!==typeof A&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),
|
28664 | "function"!==typeof B&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"));var K=null,L=!1,M=-1,N=!1,O=!1,P=0,R=33,S=33;w=function(){return P<=exports.unstable_now()};var T=new MessageChannel,U=T.port2;T.port1.onmessage=function(){L=!1;var a=K,b=M;K=null;M=-1;var d=exports.unstable_now(),e=!1;if(0>=P-d)if(-1!==b&&b<=d)e=!0;else{N||(N=!0,E(V));K=a;M=b;return}if(null!==a){O=!0;try{a(e)}finally{O=!1}}};
|
28665 | var V=function(a){if(null!==K){E(V);var b=a-P+S;b<S&&R<S?(8>b&&(b=8),S=b<R?R:b):R=b;P=a+S;L||(L=!0,U.postMessage(void 0))}else N=!1};r=function(a,b){K=a;M=b;O||0>b?U.postMessage(void 0):N||(N=!0,E(V))};q=function(){K=null;L=!1;M=-1}}exports.unstable_ImmediatePriority=1;exports.unstable_UserBlockingPriority=2;exports.unstable_NormalPriority=3;exports.unstable_IdlePriority=5;exports.unstable_LowPriority=4;
|
28666 | exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var d=h,e=k;h=a;k=exports.unstable_now();try{return b()}finally{h=d,k=e,v()}};
|
28667 | exports.unstable_scheduleCallback=function(a,b){var d=-1!==k?k:exports.unstable_now();if("object"===typeof b&&null!==b&&"number"===typeof b.timeout)b=d+b.timeout;else switch(h){case 1:b=d+-1;break;case 2:b=d+250;break;case 5:b=d+1073741823;break;case 4:b=d+1E4;break;default:b=d+5E3}a={callback:a,priorityLevel:h,expirationTime:b,next:null,previous:null};if(null===c)c=a.next=a.previous=a,p();else{d=null;var e=c;do{if(e.expirationTime>b){d=e;break}e=e.next}while(e!==c);null===d?d=c:d===c&&(c=a,p());
|
28668 | b=d.previous;b.next=d.previous=a;a.next=d;a.previous=b}return a};exports.unstable_cancelCallback=function(a){var b=a.next;if(null!==b){if(b===a)c=null;else{a===c&&(c=b);var d=a.previous;d.next=b;b.previous=d}a.next=a.previous=null}};exports.unstable_wrapCallback=function(a){var b=h;return function(){var d=h,e=k;h=b;k=exports.unstable_now();try{return a.apply(this,arguments)}finally{h=d,k=e,v()}}};exports.unstable_getCurrentPriorityLevel=function(){return h};
|
28669 | exports.unstable_shouldYield=function(){return!f&&(null!==c&&c.expirationTime<l||w())};exports.unstable_continueExecution=function(){null!==c&&p()};exports.unstable_pauseExecution=function(){};exports.unstable_getFirstCallbackNode=function(){return c};
|
28670 |
|
28671 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
28672 |
|
28673 | },{}],71:[function(require,module,exports){
|
28674 | 'use strict';
|
28675 |
|
28676 | if ("development" === 'production') {
|
28677 | module.exports = require('./cjs/scheduler.production.min.js');
|
28678 | } else {
|
28679 | module.exports = require('./cjs/scheduler.development.js');
|
28680 | }
|
28681 |
|
28682 | },{"./cjs/scheduler.development.js":69,"./cjs/scheduler.production.min.js":70}],72:[function(require,module,exports){
|
28683 | 'use strict';
|
28684 |
|
28685 | if ("development" === 'production') {
|
28686 | module.exports = require('./cjs/scheduler-tracing.production.min.js');
|
28687 | } else {
|
28688 | module.exports = require('./cjs/scheduler-tracing.development.js');
|
28689 | }
|
28690 |
|
28691 | },{"./cjs/scheduler-tracing.development.js":67,"./cjs/scheduler-tracing.production.min.js":68}],73:[function(require,module,exports){
|
28692 | 'use strict';
|
28693 |
|
28694 | function _interopDefault (ex) { return 'default' in ex ? ex['default'] : ex; }
|
28695 |
|
28696 | var toSlugCase = _interopDefault(require('to-slug-case'));
|
28697 |
|
28698 |
|
28699 |
|
28700 |
|
28701 |
|
28702 |
|
28703 |
|
28704 |
|
28705 |
|
28706 |
|
28707 |
|
28708 |
|
28709 |
|
28710 |
|
28711 |
|
28712 |
|
28713 |
|
28714 | var isUnitlessNumber = {
|
28715 | animationIterationCount: true,
|
28716 | boxFlex: true,
|
28717 | boxFlexGroup: true,
|
28718 | boxOrdinalGroup: true,
|
28719 | columnCount: true,
|
28720 | flex: true,
|
28721 | flexGrow: true,
|
28722 | flexPositive: true,
|
28723 | flexShrink: true,
|
28724 | flexNegative: true,
|
28725 | flexOrder: true,
|
28726 | gridRow: true,
|
28727 | gridColumn: true,
|
28728 | fontWeight: true,
|
28729 | lineClamp: true,
|
28730 | lineHeight: true,
|
28731 | opacity: true,
|
28732 | order: true,
|
28733 | orphans: true,
|
28734 | tabSize: true,
|
28735 | widows: true,
|
28736 | zIndex: true,
|
28737 | zoom: true,
|
28738 |
|
28739 |
|
28740 | fillOpacity: true,
|
28741 | stopOpacity: true,
|
28742 | strokeDashoffset: true,
|
28743 | strokeOpacity: true,
|
28744 | strokeWidth: true
|
28745 | };
|
28746 |
|
28747 |
|
28748 |
|
28749 |
|
28750 |
|
28751 |
|
28752 |
|
28753 | function prefixKey(prefix, key) {
|
28754 | return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
28755 | }
|
28756 |
|
28757 |
|
28758 |
|
28759 |
|
28760 |
|
28761 | var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
|
28762 |
|
28763 |
|
28764 |
|
28765 | Object.keys(isUnitlessNumber).forEach(function (prop) {
|
28766 | prefixes.forEach(function (prefix) {
|
28767 | isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
|
28768 | });
|
28769 | });
|
28770 |
|
28771 | var isTouch = 'ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch;
|
28772 | var important = isTouch ? '' : '!important';
|
28773 |
|
28774 | function toCSS(obj) {
|
28775 | return Object.keys(obj).map(function (rawKey) {
|
28776 | var key = toSlugCase(rawKey);
|
28777 | if (/^webkit/.test(key) || /^moz/.test(key) || /^ms/.test(key)) {
|
28778 | key = '-' + key;
|
28779 | }
|
28780 |
|
28781 | var value = obj[rawKey];
|
28782 | if (typeof value === 'number' && !(isUnitlessNumber.hasOwnProperty(key) && isUnitlessNumber[key])) {
|
28783 | value = value + 'px';
|
28784 | }
|
28785 |
|
28786 | return key + ':' + value + ' ' + important + ';';
|
28787 | }).join('');
|
28788 | }
|
28789 |
|
28790 | module.exports = toCSS;
|
28791 | },{"to-slug-case":77}],74:[function(require,module,exports){
|
28792 | (function (global){
|
28793 | 'use strict';
|
28794 |
|
28795 | Object.defineProperty(exports, "__esModule", {
|
28796 | value: true
|
28797 | });
|
28798 |
|
28799 | var _ponyfill = require('./ponyfill.js');
|
28800 |
|
28801 | var _ponyfill2 = _interopRequireDefault(_ponyfill);
|
28802 |
|
28803 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
28804 |
|
28805 | var root;
|
28806 |
|
28807 |
|
28808 | if (typeof self !== 'undefined') {
|
28809 | root = self;
|
28810 | } else if (typeof window !== 'undefined') {
|
28811 | root = window;
|
28812 | } else if (typeof global !== 'undefined') {
|
28813 | root = global;
|
28814 | } else if (typeof module !== 'undefined') {
|
28815 | root = module;
|
28816 | } else {
|
28817 | root = Function('return this')();
|
28818 | }
|
28819 |
|
28820 | var result = (0, _ponyfill2['default'])(root);
|
28821 | exports['default'] = result;
|
28822 | }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
28823 |
|
28824 | },{"./ponyfill.js":75}],75:[function(require,module,exports){
|
28825 | 'use strict';
|
28826 |
|
28827 | Object.defineProperty(exports, "__esModule", {
|
28828 | value: true
|
28829 | });
|
28830 | exports['default'] = symbolObservablePonyfill;
|
28831 | function symbolObservablePonyfill(root) {
|
28832 | var result;
|
28833 | var _Symbol = root.Symbol;
|
28834 |
|
28835 | if (typeof _Symbol === 'function') {
|
28836 | if (_Symbol.observable) {
|
28837 | result = _Symbol.observable;
|
28838 | } else {
|
28839 | result = _Symbol('observable');
|
28840 | _Symbol.observable = result;
|
28841 | }
|
28842 | } else {
|
28843 | result = '@@observable';
|
28844 | }
|
28845 |
|
28846 | return result;
|
28847 | };
|
28848 | },{}],76:[function(require,module,exports){
|
28849 |
|
28850 |
|
28851 |
|
28852 |
|
28853 |
|
28854 | module.exports = toNoCase
|
28855 |
|
28856 |
|
28857 |
|
28858 |
|
28859 |
|
28860 | var hasSpace = /\s/
|
28861 | var hasSeparator = /(_|-|\.|:)/
|
28862 | var hasCamel = /([a-z][A-Z]|[A-Z][a-z])/
|
28863 |
|
28864 |
|
28865 |
|
28866 |
|
28867 |
|
28868 |
|
28869 |
|
28870 |
|
28871 |
|
28872 | function toNoCase(string) {
|
28873 | if (hasSpace.test(string)) return string.toLowerCase()
|
28874 | if (hasSeparator.test(string)) return (unseparate(string) || string).toLowerCase()
|
28875 | if (hasCamel.test(string)) return uncamelize(string).toLowerCase()
|
28876 | return string.toLowerCase()
|
28877 | }
|
28878 |
|
28879 |
|
28880 |
|
28881 |
|
28882 |
|
28883 | var separatorSplitter = /[\W_]+(.|$)/g
|
28884 |
|
28885 |
|
28886 |
|
28887 |
|
28888 |
|
28889 |
|
28890 |
|
28891 |
|
28892 | function unseparate(string) {
|
28893 | return string.replace(separatorSplitter, function (m, next) {
|
28894 | return next ? ' ' + next : ''
|
28895 | })
|
28896 | }
|
28897 |
|
28898 |
|
28899 |
|
28900 |
|
28901 |
|
28902 | var camelSplitter = /(.)([A-Z]+)/g
|
28903 |
|
28904 |
|
28905 |
|
28906 |
|
28907 |
|
28908 |
|
28909 |
|
28910 |
|
28911 | function uncamelize(string) {
|
28912 | return string.replace(camelSplitter, function (m, previous, uppers) {
|
28913 | return previous + ' ' + uppers.toLowerCase().split('').join(' ')
|
28914 | })
|
28915 | }
|
28916 |
|
28917 | },{}],77:[function(require,module,exports){
|
28918 |
|
28919 | var toSpace = require('to-space-case')
|
28920 |
|
28921 |
|
28922 |
|
28923 |
|
28924 |
|
28925 | module.exports = toSlugCase
|
28926 |
|
28927 |
|
28928 |
|
28929 |
|
28930 |
|
28931 |
|
28932 |
|
28933 |
|
28934 | function toSlugCase(string) {
|
28935 | return toSpace(string).replace(/\s/g, '-')
|
28936 | }
|
28937 |
|
28938 | },{"to-space-case":78}],78:[function(require,module,exports){
|
28939 |
|
28940 | var clean = require('to-no-case')
|
28941 |
|
28942 |
|
28943 |
|
28944 |
|
28945 |
|
28946 | module.exports = toSpaceCase
|
28947 |
|
28948 |
|
28949 |
|
28950 |
|
28951 |
|
28952 |
|
28953 |
|
28954 |
|
28955 | function toSpaceCase(string) {
|
28956 | return clean(string).replace(/[\W_]+(.|$)/g, function (matches, match) {
|
28957 | return match ? ' ' + match : ''
|
28958 | }).trim()
|
28959 | }
|
28960 |
|
28961 | },{"to-no-case":76}],79:[function(require,module,exports){
|
28962 | (function(){function aa(a,b,c){return a.call.apply(a.bind,arguments)}function ba(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function p(a,b,c){p=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?aa:ba;return p.apply(null,arguments)}var q=Date.now||function(){return+new Date};function ca(a,b){this.a=a;this.o=b||a;this.c=this.o.document}var da=!!window.FontFace;function t(a,b,c,d){b=a.c.createElement(b);if(c)for(var e in c)c.hasOwnProperty(e)&&("style"==e?b.style.cssText=c[e]:b.setAttribute(e,c[e]));d&&b.appendChild(a.c.createTextNode(d));return b}function u(a,b,c){a=a.c.getElementsByTagName(b)[0];a||(a=document.documentElement);a.insertBefore(c,a.lastChild)}function v(a){a.parentNode&&a.parentNode.removeChild(a)}
|
28963 | function w(a,b,c){b=b||[];c=c||[];for(var d=a.className.split(/\s+/),e=0;e<b.length;e+=1){for(var f=!1,g=0;g<d.length;g+=1)if(b[e]===d[g]){f=!0;break}f||d.push(b[e])}b=[];for(e=0;e<d.length;e+=1){f=!1;for(g=0;g<c.length;g+=1)if(d[e]===c[g]){f=!0;break}f||b.push(d[e])}a.className=b.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function y(a,b){for(var c=a.className.split(/\s+/),d=0,e=c.length;d<e;d++)if(c[d]==b)return!0;return!1}
|
28964 | function ea(a){return a.o.location.hostname||a.a.location.hostname}function z(a,b,c){function d(){m&&e&&f&&(m(g),m=null)}b=t(a,"link",{rel:"stylesheet",href:b,media:"all"});var e=!1,f=!0,g=null,m=c||null;da?(b.onload=function(){e=!0;d()},b.onerror=function(){e=!0;g=Error("Stylesheet failed to load");d()}):setTimeout(function(){e=!0;d()},0);u(a,"head",b)}
|
28965 | function A(a,b,c,d){var e=a.c.getElementsByTagName("head")[0];if(e){var f=t(a,"script",{src:b}),g=!1;f.onload=f.onreadystatechange=function(){g||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(g=!0,c&&c(null),f.onload=f.onreadystatechange=null,"HEAD"==f.parentNode.tagName&&e.removeChild(f))};e.appendChild(f);setTimeout(function(){g||(g=!0,c&&c(Error("Script load timeout")))},d||5E3);return f}return null};function B(){this.a=0;this.c=null}function C(a){a.a++;return function(){a.a--;D(a)}}function E(a,b){a.c=b;D(a)}function D(a){0==a.a&&a.c&&(a.c(),a.c=null)};function F(a){this.a=a||"-"}F.prototype.c=function(a){for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c].replace(/[\W_]+/g,"").toLowerCase());return b.join(this.a)};function G(a,b){this.c=a;this.f=4;this.a="n";var c=(b||"n4").match(/^([nio])([1-9])$/i);c&&(this.a=c[1],this.f=parseInt(c[2],10))}function fa(a){return H(a)+" "+(a.f+"00")+" 300px "+I(a.c)}function I(a){var b=[];a=a.split(/,\s*/);for(var c=0;c<a.length;c++){var d=a[c].replace(/['"]/g,"");-1!=d.indexOf(" ")||/^\d/.test(d)?b.push("'"+d+"'"):b.push(d)}return b.join(",")}function J(a){return a.a+a.f}function H(a){var b="normal";"o"===a.a?b="oblique":"i"===a.a&&(b="italic");return b}
|
28966 | function ga(a){var b=4,c="n",d=null;a&&((d=a.match(/(normal|oblique|italic)/i))&&d[1]&&(c=d[1].substr(0,1).toLowerCase()),(d=a.match(/([1-9]00|normal|bold)/i))&&d[1]&&(/bold/i.test(d[1])?b=7:/[1-9]00/.test(d[1])&&(b=parseInt(d[1].substr(0,1),10))));return c+b};function ha(a,b){this.c=a;this.f=a.o.document.documentElement;this.h=b;this.a=new F("-");this.j=!1!==b.events;this.g=!1!==b.classes}function ia(a){a.g&&w(a.f,[a.a.c("wf","loading")]);K(a,"loading")}function L(a){if(a.g){var b=y(a.f,a.a.c("wf","active")),c=[],d=[a.a.c("wf","loading")];b||c.push(a.a.c("wf","inactive"));w(a.f,c,d)}K(a,"inactive")}function K(a,b,c){if(a.j&&a.h[b])if(c)a.h[b](c.c,J(c));else a.h[b]()};function ja(){this.c={}}function ka(a,b,c){var d=[],e;for(e in b)if(b.hasOwnProperty(e)){var f=a.c[e];f&&d.push(f(b[e],c))}return d};function M(a,b){this.c=a;this.f=b;this.a=t(this.c,"span",{"aria-hidden":"true"},this.f)}function N(a){u(a.c,"body",a.a)}function O(a){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+I(a.c)+";"+("font-style:"+H(a)+";font-weight:"+(a.f+"00")+";")};function P(a,b,c,d,e,f){this.g=a;this.j=b;this.a=d;this.c=c;this.f=e||3E3;this.h=f||void 0}P.prototype.start=function(){var a=this.c.o.document,b=this,c=q(),d=new Promise(function(d,e){function f(){q()-c>=b.f?e():a.fonts.load(fa(b.a),b.h).then(function(a){1<=a.length?d():setTimeout(f,25)},function(){e()})}f()}),e=null,f=new Promise(function(a,d){e=setTimeout(d,b.f)});Promise.race([f,d]).then(function(){e&&(clearTimeout(e),e=null);b.g(b.a)},function(){b.j(b.a)})};function Q(a,b,c,d,e,f,g){this.v=a;this.B=b;this.c=c;this.a=d;this.s=g||"BESbswy";this.f={};this.w=e||3E3;this.u=f||null;this.m=this.j=this.h=this.g=null;this.g=new M(this.c,this.s);this.h=new M(this.c,this.s);this.j=new M(this.c,this.s);this.m=new M(this.c,this.s);a=new G(this.a.c+",serif",J(this.a));a=O(a);this.g.a.style.cssText=a;a=new G(this.a.c+",sans-serif",J(this.a));a=O(a);this.h.a.style.cssText=a;a=new G("serif",J(this.a));a=O(a);this.j.a.style.cssText=a;a=new G("sans-serif",J(this.a));a=
|
28967 | O(a);this.m.a.style.cssText=a;N(this.g);N(this.h);N(this.j);N(this.m)}var R={D:"serif",C:"sans-serif"},S=null;function T(){if(null===S){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);S=!!a&&(536>parseInt(a[1],10)||536===parseInt(a[1],10)&&11>=parseInt(a[2],10))}return S}Q.prototype.start=function(){this.f.serif=this.j.a.offsetWidth;this.f["sans-serif"]=this.m.a.offsetWidth;this.A=q();U(this)};
|
28968 | function la(a,b,c){for(var d in R)if(R.hasOwnProperty(d)&&b===a.f[R[d]]&&c===a.f[R[d]])return!0;return!1}function U(a){var b=a.g.a.offsetWidth,c=a.h.a.offsetWidth,d;(d=b===a.f.serif&&c===a.f["sans-serif"])||(d=T()&&la(a,b,c));d?q()-a.A>=a.w?T()&&la(a,b,c)&&(null===a.u||a.u.hasOwnProperty(a.a.c))?V(a,a.v):V(a,a.B):ma(a):V(a,a.v)}function ma(a){setTimeout(p(function(){U(this)},a),50)}function V(a,b){setTimeout(p(function(){v(this.g.a);v(this.h.a);v(this.j.a);v(this.m.a);b(this.a)},a),0)};function W(a,b,c){this.c=a;this.a=b;this.f=0;this.m=this.j=!1;this.s=c}var X=null;W.prototype.g=function(a){var b=this.a;b.g&&w(b.f,[b.a.c("wf",a.c,J(a).toString(),"active")],[b.a.c("wf",a.c,J(a).toString(),"loading"),b.a.c("wf",a.c,J(a).toString(),"inactive")]);K(b,"fontactive",a);this.m=!0;na(this)};
|
28969 | W.prototype.h=function(a){var b=this.a;if(b.g){var c=y(b.f,b.a.c("wf",a.c,J(a).toString(),"active")),d=[],e=[b.a.c("wf",a.c,J(a).toString(),"loading")];c||d.push(b.a.c("wf",a.c,J(a).toString(),"inactive"));w(b.f,d,e)}K(b,"fontinactive",a);na(this)};function na(a){0==--a.f&&a.j&&(a.m?(a=a.a,a.g&&w(a.f,[a.a.c("wf","active")],[a.a.c("wf","loading"),a.a.c("wf","inactive")]),K(a,"active")):L(a.a))};function oa(a){this.j=a;this.a=new ja;this.h=0;this.f=this.g=!0}oa.prototype.load=function(a){this.c=new ca(this.j,a.context||this.j);this.g=!1!==a.events;this.f=!1!==a.classes;pa(this,new ha(this.c,a),a)};
|
28970 | function qa(a,b,c,d,e){var f=0==--a.h;(a.f||a.g)&&setTimeout(function(){var a=e||null,m=d||null||{};if(0===c.length&&f)L(b.a);else{b.f+=c.length;f&&(b.j=f);var h,l=[];for(h=0;h<c.length;h++){var k=c[h],n=m[k.c],r=b.a,x=k;r.g&&w(r.f,[r.a.c("wf",x.c,J(x).toString(),"loading")]);K(r,"fontloading",x);r=null;if(null===X)if(window.FontFace){var x=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),xa=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor);
|
28971 | X=x?42<parseInt(x[1],10):xa?!1:!0}else X=!1;X?r=new P(p(b.g,b),p(b.h,b),b.c,k,b.s,n):r=new Q(p(b.g,b),p(b.h,b),b.c,k,b.s,a,n);l.push(r)}for(h=0;h<l.length;h++)l[h].start()}},0)}function pa(a,b,c){var d=[],e=c.timeout;ia(b);var d=ka(a.a,c,a.c),f=new W(a.c,b,e);a.h=d.length;b=0;for(c=d.length;b<c;b++)d[b].load(function(b,d,c){qa(a,f,b,d,c)})};function ra(a,b){this.c=a;this.a=b}
|
28972 | ra.prototype.load=function(a){function b(){if(f["__mti_fntLst"+d]){var c=f["__mti_fntLst"+d](),e=[],h;if(c)for(var l=0;l<c.length;l++){var k=c[l].fontfamily;void 0!=c[l].fontStyle&&void 0!=c[l].fontWeight?(h=c[l].fontStyle+c[l].fontWeight,e.push(new G(k,h))):e.push(new G(k))}a(e)}else setTimeout(function(){b()},50)}var c=this,d=c.a.projectId,e=c.a.version;if(d){var f=c.c.o;A(this.c,(c.a.api||"https://fast.fonts.net/jsapi")+"/"+d+".js"+(e?"?v="+e:""),function(e){e?a([]):(f["__MonotypeConfiguration__"+
|
28973 | d]=function(){return c.a},b())}).id="__MonotypeAPIScript__"+d}else a([])};function sa(a,b){this.c=a;this.a=b}sa.prototype.load=function(a){var b,c,d=this.a.urls||[],e=this.a.families||[],f=this.a.testStrings||{},g=new B;b=0;for(c=d.length;b<c;b++)z(this.c,d[b],C(g));var m=[];b=0;for(c=e.length;b<c;b++)if(d=e[b].split(":"),d[1])for(var h=d[1].split(","),l=0;l<h.length;l+=1)m.push(new G(d[0],h[l]));else m.push(new G(d[0]));E(g,function(){a(m,f)})};function ta(a,b){a?this.c=a:this.c=ua;this.a=[];this.f=[];this.g=b||""}var ua="https://fonts.googleapis.com/css";function va(a,b){for(var c=b.length,d=0;d<c;d++){var e=b[d].split(":");3==e.length&&a.f.push(e.pop());var f="";2==e.length&&""!=e[1]&&(f=":");a.a.push(e.join(f))}}
|
28974 | function wa(a){if(0==a.a.length)throw Error("No fonts to load!");if(-1!=a.c.indexOf("kit="))return a.c;for(var b=a.a.length,c=[],d=0;d<b;d++)c.push(a.a[d].replace(/ /g,"+"));b=a.c+"?family="+c.join("%7C");0<a.f.length&&(b+="&subset="+a.f.join(","));0<a.g.length&&(b+="&text="+encodeURIComponent(a.g));return b};function ya(a){this.f=a;this.a=[];this.c={}}
|
28975 | var za={latin:"BESbswy","latin-ext":"\u00e7\u00f6\u00fc\u011f\u015f",cyrillic:"\u0439\u044f\u0416",greek:"\u03b1\u03b2\u03a3",khmer:"\u1780\u1781\u1782",Hanuman:"\u1780\u1781\u1782"},Aa={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},Ba={i:"i",italic:"i",n:"n",normal:"n"},
|
28976 | Ca=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;
|
28977 | function Da(a){for(var b=a.f.length,c=0;c<b;c++){var d=a.f[c].split(":"),e=d[0].replace(/\+/g," "),f=["n4"];if(2<=d.length){var g;var m=d[1];g=[];if(m)for(var m=m.split(","),h=m.length,l=0;l<h;l++){var k;k=m[l];if(k.match(/^[\w-]+$/)){var n=Ca.exec(k.toLowerCase());if(null==n)k="";else{k=n[2];k=null==k||""==k?"n":Ba[k];n=n[1];if(null==n||""==n)n="4";else var r=Aa[n],n=r?r:isNaN(n)?"4":n.substr(0,1);k=[k,n].join("")}}else k="";k&&g.push(k)}0<g.length&&(f=g);3==d.length&&(d=d[2],g=[],d=d?d.split(","):
|
28978 | g,0<d.length&&(d=za[d[0]])&&(a.c[e]=d))}a.c[e]||(d=za[e])&&(a.c[e]=d);for(d=0;d<f.length;d+=1)a.a.push(new G(e,f[d]))}};function Ea(a,b){this.c=a;this.a=b}var Fa={Arimo:!0,Cousine:!0,Tinos:!0};Ea.prototype.load=function(a){var b=new B,c=this.c,d=new ta(this.a.api,this.a.text),e=this.a.families;va(d,e);var f=new ya(e);Da(f);z(c,wa(d),C(b));E(b,function(){a(f.a,f.c,Fa)})};function Ga(a,b){this.c=a;this.a=b}Ga.prototype.load=function(a){var b=this.a.id,c=this.c.o;b?A(this.c,(this.a.api||"https://use.typekit.net")+"/"+b+".js",function(b){if(b)a([]);else if(c.Typekit&&c.Typekit.config&&c.Typekit.config.fn){b=c.Typekit.config.fn;for(var e=[],f=0;f<b.length;f+=2)for(var g=b[f],m=b[f+1],h=0;h<m.length;h++)e.push(new G(g,m[h]));try{c.Typekit.load({events:!1,classes:!1,async:!0})}catch(l){}a(e)}},2E3):a([])};function Ha(a,b){this.c=a;this.f=b;this.a=[]}Ha.prototype.load=function(a){var b=this.f.id,c=this.c.o,d=this;b?(c.__webfontfontdeckmodule__||(c.__webfontfontdeckmodule__={}),c.__webfontfontdeckmodule__[b]=function(b,c){for(var g=0,m=c.fonts.length;g<m;++g){var h=c.fonts[g];d.a.push(new G(h.name,ga("font-weight:"+h.weight+";font-style:"+h.style)))}a(d.a)},A(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+ea(this.c)+"/"+b+".js",function(b){b&&a([])})):a([])};var Y=new oa(window);Y.a.c.custom=function(a,b){return new sa(b,a)};Y.a.c.fontdeck=function(a,b){return new Ha(b,a)};Y.a.c.monotype=function(a,b){return new ra(b,a)};Y.a.c.typekit=function(a,b){return new Ga(b,a)};Y.a.c.google=function(a,b){return new Ea(b,a)};var Z={load:p(Y.load,Y)};"function"===typeof define&&define.amd?define(function(){return Z}):"undefined"!==typeof module&&module.exports?module.exports=Z:(window.WebFont=Z,window.WebFontConfig&&Y.load(window.WebFontConfig));}());
|
28979 |
|
28980 | },{}],"panels-ui":[function(require,module,exports){
|
28981 | 'use strict';
|
28982 |
|
28983 | Object.defineProperty(exports, '__esModule', { value: true });
|
28984 |
|
28985 | function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
28986 |
|
28987 | var React = _interopDefault(require('react'));
|
28988 |
|
28989 | function easeOutCubic(currentIteration, startValue, changeInValue, totalIterations) {
|
28990 | return changeInValue * (Math.pow(currentIteration / totalIterations - 1, 3) + 1) + startValue;
|
28991 | }
|
28992 |
|
28993 | var FUNCTIONS = Object.freeze({
|
28994 | easeOutCubic: easeOutCubic
|
28995 | });
|
28996 |
|
28997 | function snap($el, to, scroll, _ref) {
|
28998 | var _ref$delay = _ref.delay,
|
28999 | delay = _ref$delay === undefined ? 10 : _ref$delay,
|
29000 | _ref$duration = _ref.duration,
|
29001 | duration = _ref$duration === undefined ? 75 : _ref$duration,
|
29002 | _ref$fn = _ref.fn,
|
29003 | fn = _ref$fn === undefined ? 'easeOutCubic' : _ref$fn,
|
29004 | _ref$step = _ref.step,
|
29005 | step = _ref$step === undefined ? 5 : _ref$step;
|
29006 |
|
29007 | var currentTime = 0;
|
29008 | var next = FUNCTIONS[fn] || easeOutCubic;
|
29009 | var start = $el[scroll];
|
29010 | var change = to - start;
|
29011 |
|
29012 | var animate = function animate() {
|
29013 | currentTime += step;
|
29014 |
|
29015 | $el[scroll] = next(currentTime, start, change, duration);
|
29016 |
|
29017 | if (currentTime < duration) {
|
29018 | requestAnimationFrame(animate);
|
29019 | }
|
29020 | };
|
29021 |
|
29022 | setTimeout(animate, delay);
|
29023 | }
|
29024 |
|
29025 | function snapY($el, to) {
|
29026 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
29027 |
|
29028 | snap($el, to, 'scrollTop', options);
|
29029 | }
|
29030 |
|
29031 | function snapX($el, to) {
|
29032 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
29033 |
|
29034 | snap($el, to, 'scrollLeft', options);
|
29035 | }
|
29036 |
|
29037 | var asyncGenerator = function () {
|
29038 | function AwaitValue(value) {
|
29039 | this.value = value;
|
29040 | }
|
29041 |
|
29042 | function AsyncGenerator(gen) {
|
29043 | var front, back;
|
29044 |
|
29045 | function send(key, arg) {
|
29046 | return new Promise(function (resolve, reject) {
|
29047 | var request = {
|
29048 | key: key,
|
29049 | arg: arg,
|
29050 | resolve: resolve,
|
29051 | reject: reject,
|
29052 | next: null
|
29053 | };
|
29054 |
|
29055 | if (back) {
|
29056 | back = back.next = request;
|
29057 | } else {
|
29058 | front = back = request;
|
29059 | resume(key, arg);
|
29060 | }
|
29061 | });
|
29062 | }
|
29063 |
|
29064 | function resume(key, arg) {
|
29065 | try {
|
29066 | var result = gen[key](arg);
|
29067 | var value = result.value;
|
29068 |
|
29069 | if (value instanceof AwaitValue) {
|
29070 | Promise.resolve(value.value).then(function (arg) {
|
29071 | resume("next", arg);
|
29072 | }, function (arg) {
|
29073 | resume("throw", arg);
|
29074 | });
|
29075 | } else {
|
29076 | settle(result.done ? "return" : "normal", result.value);
|
29077 | }
|
29078 | } catch (err) {
|
29079 | settle("throw", err);
|
29080 | }
|
29081 | }
|
29082 |
|
29083 | function settle(type, value) {
|
29084 | switch (type) {
|
29085 | case "return":
|
29086 | front.resolve({
|
29087 | value: value,
|
29088 | done: true
|
29089 | });
|
29090 | break;
|
29091 |
|
29092 | case "throw":
|
29093 | front.reject(value);
|
29094 | break;
|
29095 |
|
29096 | default:
|
29097 | front.resolve({
|
29098 | value: value,
|
29099 | done: false
|
29100 | });
|
29101 | break;
|
29102 | }
|
29103 |
|
29104 | front = front.next;
|
29105 |
|
29106 | if (front) {
|
29107 | resume(front.key, front.arg);
|
29108 | } else {
|
29109 | back = null;
|
29110 | }
|
29111 | }
|
29112 |
|
29113 | this._invoke = send;
|
29114 |
|
29115 | if (typeof gen.return !== "function") {
|
29116 | this.return = undefined;
|
29117 | }
|
29118 | }
|
29119 |
|
29120 | if (typeof Symbol === "function" && Symbol.asyncIterator) {
|
29121 | AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
|
29122 | return this;
|
29123 | };
|
29124 | }
|
29125 |
|
29126 | AsyncGenerator.prototype.next = function (arg) {
|
29127 | return this._invoke("next", arg);
|
29128 | };
|
29129 |
|
29130 | AsyncGenerator.prototype.throw = function (arg) {
|
29131 | return this._invoke("throw", arg);
|
29132 | };
|
29133 |
|
29134 | AsyncGenerator.prototype.return = function (arg) {
|
29135 | return this._invoke("return", arg);
|
29136 | };
|
29137 |
|
29138 | return {
|
29139 | wrap: function (fn) {
|
29140 | return function () {
|
29141 | return new AsyncGenerator(fn.apply(this, arguments));
|
29142 | };
|
29143 | },
|
29144 | await: function (value) {
|
29145 | return new AwaitValue(value);
|
29146 | }
|
29147 | };
|
29148 | }();
|
29149 |
|
29150 | var classCallCheck = function (instance, Constructor) {
|
29151 | if (!(instance instanceof Constructor)) {
|
29152 | throw new TypeError("Cannot call a class as a function");
|
29153 | }
|
29154 | };
|
29155 |
|
29156 | var createClass = function () {
|
29157 | function defineProperties(target, props) {
|
29158 | for (var i = 0; i < props.length; i++) {
|
29159 | var descriptor = props[i];
|
29160 | descriptor.enumerable = descriptor.enumerable || false;
|
29161 | descriptor.configurable = true;
|
29162 | if ("value" in descriptor) descriptor.writable = true;
|
29163 | Object.defineProperty(target, descriptor.key, descriptor);
|
29164 | }
|
29165 | }
|
29166 |
|
29167 | return function (Constructor, protoProps, staticProps) {
|
29168 | if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
29169 | if (staticProps) defineProperties(Constructor, staticProps);
|
29170 | return Constructor;
|
29171 | };
|
29172 | }();
|
29173 |
|
29174 | var _extends = Object.assign || function (target) {
|
29175 | for (var i = 1; i < arguments.length; i++) {
|
29176 | var source = arguments[i];
|
29177 |
|
29178 | for (var key in source) {
|
29179 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
29180 | target[key] = source[key];
|
29181 | }
|
29182 | }
|
29183 | }
|
29184 |
|
29185 | return target;
|
29186 | };
|
29187 |
|
29188 | var inherits = function (subClass, superClass) {
|
29189 | if (typeof superClass !== "function" && superClass !== null) {
|
29190 | throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
29191 | }
|
29192 |
|
29193 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
29194 | constructor: {
|
29195 | value: subClass,
|
29196 | enumerable: false,
|
29197 | writable: true,
|
29198 | configurable: true
|
29199 | }
|
29200 | });
|
29201 | if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
29202 | };
|
29203 |
|
29204 | var possibleConstructorReturn = function (self, call) {
|
29205 | if (!self) {
|
29206 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
29207 | }
|
29208 |
|
29209 | return call && (typeof call === "object" || typeof call === "function") ? call : self;
|
29210 | };
|
29211 |
|
29212 | var _jsxFileName = '/Users/dario/opensource/panels/panels-ui-compat.js.tmp';
|
29213 | var Panel = function (_React$Component) {
|
29214 | inherits(Panel, _React$Component);
|
29215 |
|
29216 | function Panel() {
|
29217 | classCallCheck(this, Panel);
|
29218 | return possibleConstructorReturn(this, (Panel.__proto__ || Object.getPrototypeOf(Panel)).apply(this, arguments));
|
29219 | }
|
29220 |
|
29221 | createClass(Panel, [{
|
29222 | key: 'render',
|
29223 | value: function render() {
|
29224 | var props = this.props;
|
29225 |
|
29226 |
|
29227 | return React.createElement(
|
29228 | 'div',
|
29229 | {
|
29230 | 'aria-labelledby': props['aria-labelledby'],
|
29231 | role: props.role,
|
29232 | ref: props._ref,
|
29233 | style: _extends({
|
29234 | height: '100%',
|
29235 | overflowY: 'auto'
|
29236 | }, props.style),
|
29237 | __source: {
|
29238 | fileName: _jsxFileName,
|
29239 | lineNumber: 8
|
29240 | },
|
29241 | __self: this
|
29242 | },
|
29243 | props.children
|
29244 | );
|
29245 | }
|
29246 | }]);
|
29247 | return Panel;
|
29248 | }(React.Component);
|
29249 |
|
29250 | var wrap = function wrap(i) {
|
29251 | return i;
|
29252 | };
|
29253 |
|
29254 | exports.Panel = Panel;
|
29255 | exports.wrap = wrap;
|
29256 | exports.snapX = snapX;
|
29257 | exports.snapY = snapY;
|
29258 | },{"react":"react"}],"panels/blocks":[function(require,module,exports){
|
29259 | 'use strict';
|
29260 |
|
29261 | Object.defineProperty(exports, '__esModule', { value: true });
|
29262 |
|
29263 | function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
29264 |
|
29265 | var React = require('react');
|
29266 | var React__default = _interopDefault(React);
|
29267 | var webfontloader = require('webfontloader');
|
29268 | var PropTypes = _interopDefault(require('prop-types'));
|
29269 | var toCSS = _interopDefault(require('style-to-css'));
|
29270 | var uniqueId = _interopDefault(require('mini-unique-id'));
|
29271 |
|
29272 | var _jsxFileName = '/Users/dario/opensource/panels/blocks/dangerously-set-inner-html.js';
|
29273 | var _this = undefined;
|
29274 | var DangerouslySetInnerHTML = function DangerouslySetInnerHTML(props) {
|
29275 | return React__default.createElement('div', {
|
29276 | dangerouslySetInnerHTML: {
|
29277 | __html: props.html
|
29278 | },
|
29279 | 'data-block': props['data-block'],
|
29280 | ref: props._ref,
|
29281 | style: props.style,
|
29282 | __source: {
|
29283 | fileName: _jsxFileName,
|
29284 | lineNumber: 4
|
29285 | },
|
29286 | __self: _this
|
29287 | });
|
29288 | };
|
29289 |
|
29290 | var asyncGenerator = function () {
|
29291 | function AwaitValue(value) {
|
29292 | this.value = value;
|
29293 | }
|
29294 |
|
29295 | function AsyncGenerator(gen) {
|
29296 | var front, back;
|
29297 |
|
29298 | function send(key, arg) {
|
29299 | return new Promise(function (resolve, reject) {
|
29300 | var request = {
|
29301 | key: key,
|
29302 | arg: arg,
|
29303 | resolve: resolve,
|
29304 | reject: reject,
|
29305 | next: null
|
29306 | };
|
29307 |
|
29308 | if (back) {
|
29309 | back = back.next = request;
|
29310 | } else {
|
29311 | front = back = request;
|
29312 | resume(key, arg);
|
29313 | }
|
29314 | });
|
29315 | }
|
29316 |
|
29317 | function resume(key, arg) {
|
29318 | try {
|
29319 | var result = gen[key](arg);
|
29320 | var value = result.value;
|
29321 |
|
29322 | if (value instanceof AwaitValue) {
|
29323 | Promise.resolve(value.value).then(function (arg) {
|
29324 | resume("next", arg);
|
29325 | }, function (arg) {
|
29326 | resume("throw", arg);
|
29327 | });
|
29328 | } else {
|
29329 | settle(result.done ? "return" : "normal", result.value);
|
29330 | }
|
29331 | } catch (err) {
|
29332 | settle("throw", err);
|
29333 | }
|
29334 | }
|
29335 |
|
29336 | function settle(type, value) {
|
29337 | switch (type) {
|
29338 | case "return":
|
29339 | front.resolve({
|
29340 | value: value,
|
29341 | done: true
|
29342 | });
|
29343 | break;
|
29344 |
|
29345 | case "throw":
|
29346 | front.reject(value);
|
29347 | break;
|
29348 |
|
29349 | default:
|
29350 | front.resolve({
|
29351 | value: value,
|
29352 | done: false
|
29353 | });
|
29354 | break;
|
29355 | }
|
29356 |
|
29357 | front = front.next;
|
29358 |
|
29359 | if (front) {
|
29360 | resume(front.key, front.arg);
|
29361 | } else {
|
29362 | back = null;
|
29363 | }
|
29364 | }
|
29365 |
|
29366 | this._invoke = send;
|
29367 |
|
29368 | if (typeof gen.return !== "function") {
|
29369 | this.return = undefined;
|
29370 | }
|
29371 | }
|
29372 |
|
29373 | if (typeof Symbol === "function" && Symbol.asyncIterator) {
|
29374 | AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
|
29375 | return this;
|
29376 | };
|
29377 | }
|
29378 |
|
29379 | AsyncGenerator.prototype.next = function (arg) {
|
29380 | return this._invoke("next", arg);
|
29381 | };
|
29382 |
|
29383 | AsyncGenerator.prototype.throw = function (arg) {
|
29384 | return this._invoke("throw", arg);
|
29385 | };
|
29386 |
|
29387 | AsyncGenerator.prototype.return = function (arg) {
|
29388 | return this._invoke("return", arg);
|
29389 | };
|
29390 |
|
29391 | return {
|
29392 | wrap: function (fn) {
|
29393 | return function () {
|
29394 | return new AsyncGenerator(fn.apply(this, arguments));
|
29395 | };
|
29396 | },
|
29397 | await: function (value) {
|
29398 | return new AwaitValue(value);
|
29399 | }
|
29400 | };
|
29401 | }();
|
29402 |
|
29403 | var classCallCheck = function (instance, Constructor) {
|
29404 | if (!(instance instanceof Constructor)) {
|
29405 | throw new TypeError("Cannot call a class as a function");
|
29406 | }
|
29407 | };
|
29408 |
|
29409 | var createClass = function () {
|
29410 | function defineProperties(target, props) {
|
29411 | for (var i = 0; i < props.length; i++) {
|
29412 | var descriptor = props[i];
|
29413 | descriptor.enumerable = descriptor.enumerable || false;
|
29414 | descriptor.configurable = true;
|
29415 | if ("value" in descriptor) descriptor.writable = true;
|
29416 | Object.defineProperty(target, descriptor.key, descriptor);
|
29417 | }
|
29418 | }
|
29419 |
|
29420 | return function (Constructor, protoProps, staticProps) {
|
29421 | if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
29422 | if (staticProps) defineProperties(Constructor, staticProps);
|
29423 | return Constructor;
|
29424 | };
|
29425 | }();
|
29426 |
|
29427 | var defineProperty = function (obj, key, value) {
|
29428 | if (key in obj) {
|
29429 | Object.defineProperty(obj, key, {
|
29430 | value: value,
|
29431 | enumerable: true,
|
29432 | configurable: true,
|
29433 | writable: true
|
29434 | });
|
29435 | } else {
|
29436 | obj[key] = value;
|
29437 | }
|
29438 |
|
29439 | return obj;
|
29440 | };
|
29441 |
|
29442 | var _extends = Object.assign || function (target) {
|
29443 | for (var i = 1; i < arguments.length; i++) {
|
29444 | var source = arguments[i];
|
29445 |
|
29446 | for (var key in source) {
|
29447 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
29448 | target[key] = source[key];
|
29449 | }
|
29450 | }
|
29451 | }
|
29452 |
|
29453 | return target;
|
29454 | };
|
29455 |
|
29456 | var inherits = function (subClass, superClass) {
|
29457 | if (typeof superClass !== "function" && superClass !== null) {
|
29458 | throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
29459 | }
|
29460 |
|
29461 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
29462 | constructor: {
|
29463 | value: subClass,
|
29464 | enumerable: false,
|
29465 | writable: true,
|
29466 | configurable: true
|
29467 | }
|
29468 | });
|
29469 | if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
29470 | };
|
29471 |
|
29472 | var objectWithoutProperties = function (obj, keys) {
|
29473 | var target = {};
|
29474 |
|
29475 | for (var i in obj) {
|
29476 | if (keys.indexOf(i) >= 0) continue;
|
29477 | if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
|
29478 | target[i] = obj[i];
|
29479 | }
|
29480 |
|
29481 | return target;
|
29482 | };
|
29483 |
|
29484 | var possibleConstructorReturn = function (self, call) {
|
29485 | if (!self) {
|
29486 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
29487 | }
|
29488 |
|
29489 | return call && (typeof call === "object" || typeof call === "function") ? call : self;
|
29490 | };
|
29491 |
|
29492 | var loaded = [];
|
29493 |
|
29494 | var Font = function (_React$Component) {
|
29495 | inherits(Font, _React$Component);
|
29496 |
|
29497 | function Font() {
|
29498 | classCallCheck(this, Font);
|
29499 | return possibleConstructorReturn(this, (Font.__proto__ || Object.getPrototypeOf(Font)).apply(this, arguments));
|
29500 | }
|
29501 |
|
29502 | createClass(Font, [{
|
29503 | key: 'componentDidMount',
|
29504 | value: function componentDidMount() {
|
29505 | this.load();
|
29506 | }
|
29507 | }, {
|
29508 | key: 'componentDidUpdate',
|
29509 | value: function componentDidUpdate() {
|
29510 | this.load();
|
29511 | }
|
29512 | }, {
|
29513 | key: 'load',
|
29514 | value: function load() {
|
29515 | var props = this.props;
|
29516 |
|
29517 |
|
29518 | var family = props.family;
|
29519 | var source = props.source;
|
29520 |
|
29521 | var urls = void 0;
|
29522 | if (props.family === 'FontAwesome') {
|
29523 | source = 'custom';
|
29524 | urls = ['https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css'];
|
29525 | } else if (typeof props.weight === 'string') {
|
29526 | family = family + ':' + props.weight;
|
29527 | }
|
29528 |
|
29529 | if (loaded.includes(family)) return;
|
29530 | loaded.push(family);
|
29531 |
|
29532 | webfontloader.load(defineProperty({}, source, {
|
29533 | families: [family],
|
29534 | urls: urls
|
29535 | }));
|
29536 | }
|
29537 | }, {
|
29538 | key: 'render',
|
29539 | value: function render() {
|
29540 | return null;
|
29541 | }
|
29542 | }]);
|
29543 | return Font;
|
29544 | }(React__default.Component);
|
29545 |
|
29546 | Font.defaultProps = {
|
29547 | source: 'google'
|
29548 | };
|
29549 |
|
29550 |
|
29551 | function normaliseArray(parts, allowAboveRoot) {
|
29552 |
|
29553 | var up = 0;
|
29554 | for (var i = parts.length - 1; i >= 0; i--) {
|
29555 | var last = parts[i];
|
29556 | if (last === '.') {
|
29557 | parts.splice(i, 1);
|
29558 | } else if (last === '..') {
|
29559 | parts.splice(i, 1);
|
29560 | up++;
|
29561 | } else if (up) {
|
29562 | parts.splice(i, 1);
|
29563 | up--;
|
29564 | }
|
29565 | }
|
29566 |
|
29567 |
|
29568 | if (allowAboveRoot) {
|
29569 | for (; up--; up) {
|
29570 | parts.unshift('..');
|
29571 | }
|
29572 | }
|
29573 |
|
29574 | return parts;
|
29575 | }
|
29576 |
|
29577 |
|
29578 | function normalisePath(rawPath) {
|
29579 | var isAbsolute = rawPath.charAt(0) === '/';
|
29580 | var trailingSlash = rawPath.substr(-1) === '/';
|
29581 |
|
29582 |
|
29583 | var path = normaliseArray(rawPath.split('/').filter(function (p) {
|
29584 | return !!p;
|
29585 | }), !isAbsolute).join('/');
|
29586 |
|
29587 | if (!path && !isAbsolute) {
|
29588 | path = '.';
|
29589 | }
|
29590 | if (path && trailingSlash) {
|
29591 | path += '/';
|
29592 | }
|
29593 |
|
29594 | return (isAbsolute ? '/' : '') + path;
|
29595 | }
|
29596 |
|
29597 | var TRAILING_SLASH_REGEX = /\/$/;
|
29598 |
|
29599 | function withTrailingSlash(uri) {
|
29600 | return TRAILING_SLASH_REGEX.test(uri) ? uri : uri + "/";
|
29601 | }
|
29602 |
|
29603 | var decodeSchema = function decodeSchema(s) {
|
29604 | return s.replace(/<<HTTP>>/g, 'http://').replace(/<<HTTPS>>/g, 'https://');
|
29605 | };
|
29606 | var encodeSchema = function encodeSchema(s) {
|
29607 | return s.replace(/http:\/\//g, '<<HTTP>>').replace(/https:\/\//g, '<<HTTPS>>');
|
29608 | };
|
29609 |
|
29610 | var normaliseUri = (function (uri) {
|
29611 | return decodeSchema(normalisePath(withTrailingSlash(encodeSchema(uri))));
|
29612 | });
|
29613 |
|
29614 | var _jsxFileName$2 = '/Users/dario/opensource/panels/blocks/teleport.js';
|
29615 | var Teleport = function (_React$Component) {
|
29616 | inherits(Teleport, _React$Component);
|
29617 |
|
29618 | function Teleport(props, context) {
|
29619 | classCallCheck(this, Teleport);
|
29620 |
|
29621 | var _this = possibleConstructorReturn(this, (Teleport.__proto__ || Object.getPrototypeOf(Teleport)).call(this, props, context));
|
29622 |
|
29623 | _this.className = 'Teleport-' + uniqueId();
|
29624 | return _this;
|
29625 | }
|
29626 |
|
29627 | createClass(Teleport, [{
|
29628 | key: 'render',
|
29629 | value: function render() {
|
29630 | var className = this.className;
|
29631 | var _props = this.props,
|
29632 | context = _props.context,
|
29633 | children = _props.children,
|
29634 | focus = _props.focus,
|
29635 | loose = _props.loose,
|
29636 | onClick = _props.onClick,
|
29637 | _ref = _props._ref,
|
29638 | style = _props.style,
|
29639 | styleActive = _props.styleActive,
|
29640 | styleActiveHover = _props.styleActiveHover,
|
29641 | styleHover = _props.styleHover,
|
29642 | title = _props.title,
|
29643 | to = _props.to,
|
29644 | rest = objectWithoutProperties(_props, ['context', 'children', 'focus', 'loose', 'onClick', '_ref', 'style', 'styleActive', 'styleActiveHover', 'styleHover', 'title', 'to']);
|
29645 | var _context = this.context,
|
29646 | isActive = _context.isActive,
|
29647 | navigate = _context.navigate,
|
29648 | route = _context.route;
|
29649 |
|
29650 | var active = isActive(to, loose);
|
29651 | var href = normaliseUri('' + route.context + to);
|
29652 |
|
29653 | var inlineStyle = '';
|
29654 | if (!active && styleHover) {
|
29655 | inlineStyle = '.' + className + ':hover {' + toCSS(styleHover) + '}';
|
29656 | }
|
29657 | if (active && styleActiveHover) {
|
29658 | inlineStyle = '.' + className + ':hover {' + toCSS(styleActiveHover) + '}';
|
29659 | }
|
29660 | var finalStyle = active ? _extends({}, style, styleActive) : style;
|
29661 |
|
29662 | var finalOnClick = function finalOnClick(event) {
|
29663 | event.preventDefault();
|
29664 | var preventNavigate = false;
|
29665 |
|
29666 | if (typeof onClick === 'function') {
|
29667 | preventNavigate = onClick(event);
|
29668 | }
|
29669 |
|
29670 | if (preventNavigate !== true) {
|
29671 | navigate(to, focus, context);
|
29672 | }
|
29673 | };
|
29674 |
|
29675 | if (_ref) {
|
29676 | rest.ref = _ref;
|
29677 | }
|
29678 |
|
29679 | return React__default.createElement(
|
29680 | 'a',
|
29681 | _extends({}, rest, {
|
29682 | className: className,
|
29683 | href: href,
|
29684 | onClick: finalOnClick,
|
29685 | style: finalStyle,
|
29686 | title: title,
|
29687 | __source: {
|
29688 | fileName: _jsxFileName$2,
|
29689 | lineNumber: 61
|
29690 | },
|
29691 | __self: this
|
29692 | }),
|
29693 | React__default.createElement(
|
29694 | 'style',
|
29695 | {
|
29696 | __source: {
|
29697 | fileName: _jsxFileName$2,
|
29698 | lineNumber: 69
|
29699 | },
|
29700 | __self: this
|
29701 | },
|
29702 | inlineStyle
|
29703 | ),
|
29704 | children
|
29705 | );
|
29706 | }
|
29707 | }]);
|
29708 | return Teleport;
|
29709 | }(React__default.Component);
|
29710 |
|
29711 | Teleport.contextTypes = {
|
29712 | isActive: PropTypes.func.isRequired,
|
29713 | navigate: PropTypes.func.isRequired,
|
29714 | route: PropTypes.shape({
|
29715 | context: PropTypes.string.isRequired
|
29716 | }).isRequired
|
29717 | };
|
29718 |
|
29719 | var _jsxFileName$3 = '/Users/dario/opensource/panels/blocks/go-to.js';
|
29720 | var GoTo = function (_React$Component) {
|
29721 | inherits(GoTo, _React$Component);
|
29722 |
|
29723 | function GoTo() {
|
29724 | classCallCheck(this, GoTo);
|
29725 | return possibleConstructorReturn(this, (GoTo.__proto__ || Object.getPrototypeOf(GoTo)).apply(this, arguments));
|
29726 | }
|
29727 |
|
29728 | createClass(GoTo, [{
|
29729 | key: 'render',
|
29730 | value: function render() {
|
29731 | var _props = this.props,
|
29732 | children = _props.children,
|
29733 | className = _props.className,
|
29734 | _ref = _props._ref,
|
29735 | styleActive = _props.styleActive,
|
29736 | styleHover = _props.styleHover,
|
29737 | props = objectWithoutProperties(_props, ['children', 'className', '_ref', 'styleActive', 'styleHover']);
|
29738 |
|
29739 |
|
29740 | var inlineStyle = null;
|
29741 | if (Object.keys(styleHover).length) {
|
29742 | inlineStyle = React__default.createElement(
|
29743 | 'style',
|
29744 | {
|
29745 | __source: {
|
29746 | fileName: _jsxFileName$3,
|
29747 | lineNumber: 19
|
29748 | },
|
29749 | __self: this
|
29750 | },
|
29751 | '.' + className + ':hover {' + toCSS(styleHover) + '}'
|
29752 | );
|
29753 | }
|
29754 |
|
29755 | if (_ref) {
|
29756 | props.ref = _ref;
|
29757 | }
|
29758 |
|
29759 | return React__default.createElement(
|
29760 | 'a',
|
29761 | _extends({}, props, { className: className, target: '_blank', __source: {
|
29762 | fileName: _jsxFileName$3,
|
29763 | lineNumber: 28
|
29764 | },
|
29765 | __self: this
|
29766 | }),
|
29767 | inlineStyle,
|
29768 | children
|
29769 | );
|
29770 | }
|
29771 | }]);
|
29772 | return GoTo;
|
29773 | }(React__default.Component);
|
29774 |
|
29775 | var _jsxFileName$4 = '/Users/dario/opensource/panels/blocks/on-click.js';
|
29776 | var OnClick = function (_React$Component) {
|
29777 | inherits(OnClick, _React$Component);
|
29778 |
|
29779 | function OnClick() {
|
29780 | var _ref2;
|
29781 |
|
29782 | var _temp, _this, _ret;
|
29783 |
|
29784 | classCallCheck(this, OnClick);
|
29785 |
|
29786 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
29787 | args[_key] = arguments[_key];
|
29788 | }
|
29789 |
|
29790 | return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref2 = OnClick.__proto__ || Object.getPrototypeOf(OnClick)).call.apply(_ref2, [this].concat(args))), _this), _this.state = {}, _temp), possibleConstructorReturn(_this, _ret);
|
29791 | }
|
29792 |
|
29793 | createClass(OnClick, [{
|
29794 | key: 'componentWillMount',
|
29795 | value: function componentWillMount() {
|
29796 | var props = this.props;
|
29797 |
|
29798 |
|
29799 | var manualActive = typeof props.isActive === 'boolean';
|
29800 | this.setState({
|
29801 | isActive: manualActive ? props.isActive : false,
|
29802 | manualActive: manualActive
|
29803 | });
|
29804 |
|
29805 | this.bindOnClick(props.onClick);
|
29806 | }
|
29807 | }, {
|
29808 | key: 'componentWillReceiveProps',
|
29809 | value: function componentWillReceiveProps(nextProps) {
|
29810 | this.bindOnClick(nextProps.onClick);
|
29811 |
|
29812 | var manualActive = typeof nextProps.isActive === 'boolean';
|
29813 |
|
29814 | if (manualActive) {
|
29815 | this.setState({
|
29816 | isActive: nextProps.isActive,
|
29817 | manualActive: manualActive
|
29818 | });
|
29819 | }
|
29820 | }
|
29821 | }, {
|
29822 | key: 'componentWillUnmount',
|
29823 | value: function componentWillUnmount() {
|
29824 | if (this.onClickTimeout) {
|
29825 | clearTimeout(this.onClickTimeout);
|
29826 | }
|
29827 | }
|
29828 | }, {
|
29829 | key: 'bindOnClick',
|
29830 | value: function bindOnClick(onClick) {
|
29831 | var _this2 = this;
|
29832 |
|
29833 | var context = this.context;
|
29834 |
|
29835 |
|
29836 |
|
29837 | var finalOnClick = void 0;
|
29838 | if (typeof onClick === 'function') {
|
29839 | finalOnClick = function finalOnClick() {
|
29840 | try {
|
29841 | onClick();
|
29842 | } catch (err) {
|
29843 | var match = err.message.match(/props\.(.+) is not a function/);
|
29844 | if (match) {
|
29845 | context.transitionTo(match[1].trim(), true);
|
29846 | }
|
29847 | }
|
29848 | };
|
29849 | } else {
|
29850 | var match = void 0;
|
29851 | if (typeof onClick === 'string') {
|
29852 | match = onClick.match(/transitionTo\((.+)\)/);
|
29853 | }
|
29854 | if (match && typeof context.transitionTo === 'function') {
|
29855 | finalOnClick = function finalOnClick() {
|
29856 | return context.transitionTo(match[1].trim());
|
29857 | };
|
29858 | } else {
|
29859 | finalOnClick = function finalOnClick() {
|
29860 | return console.log(onClick);
|
29861 | };
|
29862 | }
|
29863 | }
|
29864 |
|
29865 | this.onClick = function (event) {
|
29866 | finalOnClick(event);
|
29867 |
|
29868 | event.stopPropagation();
|
29869 |
|
29870 | if (!_this2.state.manualActive) {
|
29871 | _this2.setState({
|
29872 | isActive: true
|
29873 | });
|
29874 |
|
29875 | _this2.onClickTimeout = setTimeout(function () {
|
29876 | _this2.setState({
|
29877 | isActive: false
|
29878 | });
|
29879 | _this2.onClickTimeout = null;
|
29880 | }, _this2.props.styleActiveTimeout);
|
29881 | }
|
29882 | };
|
29883 | }
|
29884 | }, {
|
29885 | key: 'render',
|
29886 | value: function render() {
|
29887 | var context = this.context;
|
29888 | var isActive = this.state.isActive;
|
29889 |
|
29890 |
|
29891 | var _props = this.props,
|
29892 | ariaLabel = _props['aria-label'],
|
29893 | children = _props.children,
|
29894 | className = _props.className,
|
29895 | _isActive = _props.isActive,
|
29896 | isDisabled = _props.isDisabled,
|
29897 | _ref = _props._ref,
|
29898 | style = _props.style,
|
29899 | styleActive = _props.styleActive,
|
29900 | styleActiveHover = _props.styleActiveHover,
|
29901 | styleActiveTimeout = _props.styleActiveTimeout,
|
29902 | styleDisabled = _props.styleDisabled,
|
29903 | styleHover = _props.styleHover,
|
29904 | rest = objectWithoutProperties(_props, ['aria-label', 'children', 'className', 'isActive', 'isDisabled', '_ref', 'style', 'styleActive', 'styleActiveHover', 'styleActiveTimeout', 'styleDisabled', 'styleHover']);
|
29905 |
|
29906 |
|
29907 | var inlineStyle = null;
|
29908 | if (!isDisabled) {
|
29909 | rest.onClick = this.onClick;
|
29910 |
|
29911 | var fClass = className.split(' ')[0];
|
29912 | if (!isActive && styleHover) {
|
29913 | inlineStyle = React__default.createElement(
|
29914 | 'style',
|
29915 | {
|
29916 | __source: {
|
29917 | fileName: _jsxFileName$4,
|
29918 | lineNumber: 114
|
29919 | },
|
29920 | __self: this
|
29921 | },
|
29922 | '.' + fClass + ':hover {' + toCSS(styleHover) + '}'
|
29923 | );
|
29924 | }
|
29925 | if (isActive && styleActiveHover) {
|
29926 | inlineStyle = React__default.createElement(
|
29927 | 'style',
|
29928 | {
|
29929 | __source: {
|
29930 | fileName: _jsxFileName$4,
|
29931 | lineNumber: 119
|
29932 | },
|
29933 | __self: this
|
29934 | },
|
29935 | '.' + fClass + ':hover {' + toCSS(styleActiveHover) + '}'
|
29936 | );
|
29937 | }
|
29938 | }
|
29939 |
|
29940 | var finalStyle = _extends({
|
29941 | cursor: 'pointer'
|
29942 | }, style);
|
29943 | if (isDisabled) {
|
29944 | finalStyle = _extends({}, finalStyle, {
|
29945 | cursor: 'default'
|
29946 | }, styleDisabled);
|
29947 | } else if (isActive) {
|
29948 | finalStyle = _extends({}, finalStyle, styleActive);
|
29949 | }
|
29950 |
|
29951 | if (_ref) {
|
29952 | rest.ref = _ref;
|
29953 | }
|
29954 |
|
29955 | return React__default.createElement(
|
29956 | 'button',
|
29957 | _extends({}, rest, {
|
29958 | 'aria-label': ariaLabel ? context.i18n ? context.i18n.t(ariaLabel) : ariaLabel : undefined,
|
29959 | className: className,
|
29960 | style: finalStyle, __source: {
|
29961 | fileName: _jsxFileName$4,
|
29962 | lineNumber: 146
|
29963 | },
|
29964 | __self: this
|
29965 | }),
|
29966 | inlineStyle,
|
29967 | children
|
29968 | );
|
29969 | }
|
29970 | }]);
|
29971 | return OnClick;
|
29972 | }(React__default.Component);
|
29973 |
|
29974 | OnClick.contextTypes = {
|
29975 | i18n: PropTypes.shape({
|
29976 | t: PropTypes.func.isRequired
|
29977 | }),
|
29978 | transitionTo: PropTypes.func
|
29979 | };
|
29980 | OnClick.defaultProps = {
|
29981 | styleActiveTimeout: 1000
|
29982 | };
|
29983 |
|
29984 | var _jsxFileName$1 = '/Users/dario/opensource/panels/blocks/create-group.js';
|
29985 | function createGroup(name, groupStyle) {
|
29986 | var Group = function (_React$Component) {
|
29987 | inherits(Group, _React$Component);
|
29988 |
|
29989 | function Group(props, context) {
|
29990 | classCallCheck(this, Group);
|
29991 |
|
29992 | var _this = possibleConstructorReturn(this, (Group.__proto__ || Object.getPrototypeOf(Group)).call(this, props, context));
|
29993 |
|
29994 | _this.localClassName = name + '-' + uniqueId();
|
29995 | return _this;
|
29996 | }
|
29997 |
|
29998 | createClass(Group, [{
|
29999 | key: 'render',
|
30000 | value: function render() {
|
30001 | var _props = this.props,
|
30002 | children = _props.children,
|
30003 | moreClassName = _props.className,
|
30004 | goTo = _props.goTo,
|
30005 | style = _props.style,
|
30006 | teleportTo = _props.teleportTo,
|
30007 | props = objectWithoutProperties(_props, ['children', 'className', 'goTo', 'style', 'teleportTo']);
|
30008 | var localClassName = this.localClassName;
|
30009 | var pages = this.context.pages;
|
30010 |
|
30011 |
|
30012 | var finalStyle = _extends({}, groupStyle, style);
|
30013 |
|
30014 | var className = localClassName;
|
30015 | if (typeof moreClassName === 'string') {
|
30016 | className += ' ' + moreClassName;
|
30017 | }
|
30018 |
|
30019 | var Base = void 0;
|
30020 | if (teleportTo) {
|
30021 | Base = Teleport;
|
30022 | props.to = teleportTo;
|
30023 | } else if (goTo) {
|
30024 | Base = GoTo;
|
30025 | props.href = goTo;
|
30026 | } else if ((props.onClick || props.onMouseDown || props.onMouseUp) && !props.noButton) {
|
30027 | Base = OnClick;
|
30028 | } else {
|
30029 | var isDisabled = props.isDisabled,
|
30030 | noButton = props.noButton,
|
30031 | _ref = props._ref,
|
30032 | styleDisabled = props.styleDisabled,
|
30033 | styleActive = props.styleActive,
|
30034 | styleActiveHover = props.styleActiveHover,
|
30035 | styleActiveTimeout = props.styleActiveTimeout,
|
30036 | styleHover = props.styleHover,
|
30037 | rest = objectWithoutProperties(props, ['isDisabled', 'noButton', '_ref', 'styleDisabled', 'styleActive', 'styleActiveHover', 'styleActiveTimeout', 'styleHover']);
|
30038 |
|
30039 |
|
30040 | var inlineStyle = null;
|
30041 | if (isDisabled) {
|
30042 | if (styleDisabled) {
|
30043 | finalStyle = _extends({}, finalStyle, styleDisabled);
|
30044 | }
|
30045 | } else {
|
30046 | if (Object.keys(styleHover).length) {
|
30047 | inlineStyle = React__default.createElement(
|
30048 | 'style',
|
30049 | {
|
30050 | __source: {
|
30051 | fileName: _jsxFileName$1,
|
30052 | lineNumber: 75
|
30053 | },
|
30054 | __self: this
|
30055 | },
|
30056 | '.' + localClassName + ':hover {' + toCSS(styleHover) + '}'
|
30057 | );
|
30058 | }
|
30059 | }
|
30060 |
|
30061 | return React__default.createElement(
|
30062 | 'div',
|
30063 | _extends({}, rest, { className: className, ref: _ref, style: finalStyle, __source: {
|
30064 | fileName: _jsxFileName$1,
|
30065 | lineNumber: 81
|
30066 | },
|
30067 | __self: this
|
30068 | }),
|
30069 | inlineStyle,
|
30070 | children
|
30071 | );
|
30072 | }
|
30073 |
|
30074 | if (pages && pages.isSelecting) {
|
30075 | props.onClick = function (event) {
|
30076 | if (event) {
|
30077 | event.preventDefault();
|
30078 | }
|
30079 | return true;
|
30080 | };
|
30081 | }
|
30082 |
|
30083 | return React__default.createElement(
|
30084 | Base,
|
30085 | _extends({}, props, { className: className, style: finalStyle, __source: {
|
30086 | fileName: _jsxFileName$1,
|
30087 | lineNumber: 98
|
30088 | },
|
30089 | __self: this
|
30090 | }),
|
30091 | children
|
30092 | );
|
30093 | }
|
30094 | }]);
|
30095 | return Group;
|
30096 | }(React__default.Component);
|
30097 |
|
30098 | Group.contextTypes = {
|
30099 | pages: PropTypes.shape({
|
30100 | isSelecting: PropTypes.bool
|
30101 | })
|
30102 | };
|
30103 |
|
30104 | Group.defaultProps = {
|
30105 | className: '',
|
30106 | style: {},
|
30107 | styleActive: {},
|
30108 | styleHover: {}
|
30109 | };
|
30110 |
|
30111 | Group.displayName = name;
|
30112 |
|
30113 | return Group;
|
30114 | }
|
30115 |
|
30116 | var Horizontal = createGroup('Horizontal', { flexDirection: 'row' });
|
30117 |
|
30118 | var _jsxFileName$6 = '/Users/dario/opensource/panels/blocks/knocking.js';
|
30119 | var _this$1 = undefined;
|
30120 | var animation = '@keyframes scaleout {\n 0% {\n transform: scale(0.0);\n -webkit-transform: scale(0.0);\n } 100% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n opacity: 0;\n }\n}';
|
30121 |
|
30122 | var Knocking = function Knocking(_ref) {
|
30123 | var dataBlock = _ref['data-block'],
|
30124 | size = _ref.size,
|
30125 | _ref$style = _ref.style,
|
30126 | style = _ref$style === undefined ? {} : _ref$style;
|
30127 |
|
30128 | var finalStyle = _extends({
|
30129 | animation: 'scaleout 1.0s infinite linear',
|
30130 | backgroundColor: style.color,
|
30131 | borderRadius: size,
|
30132 | height: size,
|
30133 | WebkitAnimation: 'scaleout 1.0s infinite linear',
|
30134 | width: size
|
30135 | }, style);
|
30136 |
|
30137 | return React__default.createElement(
|
30138 | Horizontal,
|
30139 | { 'data-block': dataBlock, style: finalStyle, __source: {
|
30140 | fileName: _jsxFileName$6,
|
30141 | lineNumber: 27
|
30142 | },
|
30143 | __self: _this$1
|
30144 | },
|
30145 | React__default.createElement(
|
30146 | 'style',
|
30147 | {
|
30148 | __source: {
|
30149 | fileName: _jsxFileName$6,
|
30150 | lineNumber: 28
|
30151 | },
|
30152 | __self: _this$1
|
30153 | },
|
30154 | animation
|
30155 | )
|
30156 | );
|
30157 | };
|
30158 |
|
30159 | Knocking.defaultProps = {
|
30160 | style: {
|
30161 | color: '#323232'
|
30162 | },
|
30163 | size: 32
|
30164 | };
|
30165 |
|
30166 | var _jsxFileName$5 = '/Users/dario/opensource/panels/blocks/image.js';
|
30167 | var Image = function (_React$Component) {
|
30168 | inherits(Image, _React$Component);
|
30169 |
|
30170 | function Image(props) {
|
30171 | classCallCheck(this, Image);
|
30172 |
|
30173 | var _this = possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).call(this, props));
|
30174 |
|
30175 | _this.onLoad = _this.onLoad.bind(_this);
|
30176 | _this.state = {
|
30177 | isLoading: true
|
30178 | };
|
30179 | return _this;
|
30180 | }
|
30181 |
|
30182 | createClass(Image, [{
|
30183 | key: 'componentWillReceiveProps',
|
30184 | value: function componentWillReceiveProps(nextProps) {
|
30185 | if (this.props.src !== nextProps.src) {
|
30186 | this.setState({
|
30187 | isLoading: true
|
30188 | });
|
30189 | }
|
30190 | }
|
30191 | }, {
|
30192 | key: 'onLoad',
|
30193 | value: function onLoad() {
|
30194 | this.setState({
|
30195 | isLoading: false
|
30196 | });
|
30197 | }
|
30198 | }, {
|
30199 | key: 'render',
|
30200 | value: function render() {
|
30201 | var isLoading = this.state.isLoading;
|
30202 | var _props = this.props,
|
30203 | text = _props.text,
|
30204 | src = _props.src,
|
30205 | style = _props.style,
|
30206 | styleLoading = _props.styleLoading,
|
30207 | styleWrapper = _props.styleWrapper;
|
30208 |
|
30209 |
|
30210 | return React__default.createElement(
|
30211 | 'div',
|
30212 | { style: styleWrapper, __source: {
|
30213 | fileName: _jsxFileName$5,
|
30214 | lineNumber: 32
|
30215 | },
|
30216 | __self: this
|
30217 | },
|
30218 | isLoading && React__default.createElement(Knocking, { style: styleLoading, __source: {
|
30219 | fileName: _jsxFileName$5,
|
30220 | lineNumber: 33
|
30221 | },
|
30222 | __self: this
|
30223 | }),
|
30224 | React__default.createElement('img', {
|
30225 | alt: text,
|
30226 | onLoad: this.onLoad,
|
30227 | src: src,
|
30228 | style: style,
|
30229 | title: text,
|
30230 | __source: {
|
30231 | fileName: _jsxFileName$5,
|
30232 | lineNumber: 34
|
30233 | },
|
30234 | __self: this
|
30235 | })
|
30236 | );
|
30237 | }
|
30238 | }]);
|
30239 | return Image;
|
30240 | }(React__default.Component);
|
30241 |
|
30242 | Image.defaultProps = {
|
30243 | src: 'https://files.usepages.today/usepages.today/image-placeholder.svg',
|
30244 | style: {},
|
30245 | styleLoading: {
|
30246 | position: 'absolute'
|
30247 | },
|
30248 | styleWrapper: {},
|
30249 | text: 'Alternative text'
|
30250 | };
|
30251 |
|
30252 | var _jsxFileName$7 = '/Users/dario/opensource/panels/blocks/input.js';
|
30253 | var PLACEHOLDER_PREFIXES = ['::-webkit-input-placeholder', '::-moz-placeholder', ':-ms-input-placeholder', ':placeholder-shown'];
|
30254 |
|
30255 | var Input = function (_React$Component) {
|
30256 | inherits(Input, _React$Component);
|
30257 |
|
30258 | function Input(props) {
|
30259 | classCallCheck(this, Input);
|
30260 |
|
30261 | var _this = possibleConstructorReturn(this, (Input.__proto__ || Object.getPrototypeOf(Input)).call(this, props));
|
30262 |
|
30263 | _this.id = 'Input-' + uniqueId();
|
30264 | return _this;
|
30265 | }
|
30266 |
|
30267 | createClass(Input, [{
|
30268 | key: 'render',
|
30269 | value: function render() {
|
30270 | var context = this.context,
|
30271 | id = this.id;
|
30272 | var _props = this.props,
|
30273 | disabled = _props.disabled,
|
30274 | onEnter = _props.onEnter,
|
30275 | placeholder = _props.placeholder,
|
30276 | _ref = _props._ref,
|
30277 | style = _props.style,
|
30278 | styleDisabled = _props.styleDisabled,
|
30279 | styleFocus = _props.styleFocus,
|
30280 | styleHover = _props.styleHover,
|
30281 | stylePlaceholder = _props.stylePlaceholder,
|
30282 | styleWrapper = _props.styleWrapper,
|
30283 | rest = objectWithoutProperties(_props, ['disabled', 'onEnter', 'placeholder', '_ref', 'style', 'styleDisabled', 'styleFocus', 'styleHover', 'stylePlaceholder', 'styleWrapper']);
|
30284 |
|
30285 |
|
30286 | var finalStyle = style;
|
30287 |
|
30288 | var backgroundColor = style && style.backgroundColor || 'transparent';
|
30289 | var color = style && style.color || 'black';
|
30290 | var inlineStyle = ['#' + id + ':-webkit-autofill {\n background-color: ' + backgroundColor + ' !important;\n box-shadow: 0 0 0px 1000px ' + backgroundColor + ' inset;\n color: ' + color + ' !important;\n }'];
|
30291 |
|
30292 | if (stylePlaceholder) {
|
30293 | PLACEHOLDER_PREFIXES.forEach(function (prefix) {
|
30294 | inlineStyle.push('#' + id + prefix + ' {' + toCSS(stylePlaceholder) + '}');
|
30295 | });
|
30296 | }
|
30297 |
|
30298 | if (styleDisabled && disabled) {
|
30299 | finalStyle = _extends({}, style, styleDisabled);
|
30300 | } else {
|
30301 | if (styleHover) {
|
30302 | inlineStyle.push(inlineStyle + ' #' + id + ':hover {' + toCSS(styleHover) + '}');
|
30303 | }
|
30304 | if (styleFocus) {
|
30305 | inlineStyle.push('#' + id + ':focus {' + toCSS(styleFocus) + '}');
|
30306 | }
|
30307 | }
|
30308 |
|
30309 | var onKeyUp = void 0;
|
30310 | if (typeof onEnter !== 'undefined') {
|
30311 |
|
30312 | var finalOnEnter = typeof onEnter === 'function' ? onEnter : function () {
|
30313 | return console.log(onEnter);
|
30314 | };
|
30315 | onKeyUp = function onKeyUp(event) {
|
30316 | return event.key === 'Enter' && finalOnEnter(event);
|
30317 | };
|
30318 | }
|
30319 |
|
30320 | return React__default.createElement(
|
30321 | 'div',
|
30322 | { style: styleWrapper, __source: {
|
30323 | fileName: _jsxFileName$7,
|
30324 | lineNumber: 76
|
30325 | },
|
30326 | __self: this
|
30327 | },
|
30328 | React__default.createElement(
|
30329 | 'style',
|
30330 | {
|
30331 | __source: {
|
30332 | fileName: _jsxFileName$7,
|
30333 | lineNumber: 77
|
30334 | },
|
30335 | __self: this
|
30336 | },
|
30337 | inlineStyle.join('\n')
|
30338 | ),
|
30339 | React__default.createElement('input', _extends({}, rest, {
|
30340 | autoComplete: 'off',
|
30341 | id: id,
|
30342 | onKeyUp: onKeyUp,
|
30343 | ref: _ref,
|
30344 | placeholder: placeholder ? context.i18n ? context.i18n.t(placeholder) : placeholder : undefined,
|
30345 | style: finalStyle,
|
30346 | __source: {
|
30347 | fileName: _jsxFileName$7,
|
30348 | lineNumber: 78
|
30349 | },
|
30350 | __self: this
|
30351 | }))
|
30352 | );
|
30353 | }
|
30354 | }]);
|
30355 | return Input;
|
30356 | }(React__default.Component);
|
30357 |
|
30358 | Input.defaultProps = {
|
30359 | placeholder: '',
|
30360 | style: {},
|
30361 | styleHover: {},
|
30362 | styleWrapper: {},
|
30363 | type: 'text'
|
30364 | };
|
30365 |
|
30366 | Input.contextTypes = {
|
30367 | i18n: PropTypes.shape({
|
30368 | t: PropTypes.func.isRequired
|
30369 | })
|
30370 | };
|
30371 |
|
30372 | var List = function List() {
|
30373 | return null;
|
30374 | };
|
30375 |
|
30376 | var _jsxFileName$8 = '/Users/dario/opensource/panels/blocks/style.js';
|
30377 | var _this$2 = undefined;
|
30378 | var Style = function Style(props) {
|
30379 | return React__default.createElement(
|
30380 | 'style',
|
30381 | {
|
30382 | __source: {
|
30383 | fileName: _jsxFileName$8,
|
30384 | lineNumber: 4
|
30385 | },
|
30386 | __self: _this$2
|
30387 | },
|
30388 | props.css
|
30389 | );
|
30390 | };
|
30391 |
|
30392 | var _jsxFileName$9 = '/Users/dario/opensource/panels/blocks/text.js';
|
30393 | var _this$3 = undefined;
|
30394 | var Text = function Text(_ref, context) {
|
30395 | var style = _ref.style,
|
30396 | text = _ref.text,
|
30397 | props = objectWithoutProperties(_ref, ['style', 'text']);
|
30398 |
|
30399 | var finalStyle = _extends({
|
30400 | whiteSpace: 'pre-line'
|
30401 | }, style);
|
30402 | return React__default.createElement(
|
30403 | 'div',
|
30404 | _extends({}, props, { style: finalStyle, __source: {
|
30405 | fileName: _jsxFileName$9,
|
30406 | lineNumber: 10
|
30407 | },
|
30408 | __self: _this$3
|
30409 | }),
|
30410 | context.i18n ? context.i18n.t(text) : text
|
30411 | );
|
30412 | };
|
30413 | Text.contextTypes = {
|
30414 | i18n: PropTypes.shape({
|
30415 | t: PropTypes.func.isRequired
|
30416 | })
|
30417 | };
|
30418 |
|
30419 | Text.defaultProps = {
|
30420 | style: {},
|
30421 | text: ''
|
30422 | };
|
30423 |
|
30424 | var _jsxFileName$10 = '/Users/dario/opensource/panels/blocks/textarea.js';
|
30425 | var PLACEHOLDER_PREFIXES$1 = ['::-webkit-input-placeholder', '::-moz-placeholder', ':-ms-input-placeholder', ':placeholder-shown'];
|
30426 |
|
30427 | var Textarea = function (_Component) {
|
30428 | inherits(Textarea, _Component);
|
30429 |
|
30430 | function Textarea() {
|
30431 | var _ref2;
|
30432 |
|
30433 | classCallCheck(this, Textarea);
|
30434 |
|
30435 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
30436 | args[_key] = arguments[_key];
|
30437 | }
|
30438 |
|
30439 | var _this = possibleConstructorReturn(this, (_ref2 = Textarea.__proto__ || Object.getPrototypeOf(Textarea)).call.apply(_ref2, [this].concat(args)));
|
30440 |
|
30441 | _this.id = 'Textarea-' + uniqueId();
|
30442 | return _this;
|
30443 | }
|
30444 |
|
30445 | createClass(Textarea, [{
|
30446 | key: 'render',
|
30447 | value: function render() {
|
30448 | var context = this.context,
|
30449 | id = this.id;
|
30450 | var _props = this.props,
|
30451 | _ref = _props._ref,
|
30452 | placeholder = _props.placeholder,
|
30453 | stylePlaceholder = _props.stylePlaceholder,
|
30454 | styleHover = _props.styleHover,
|
30455 | styleFocus = _props.styleFocus,
|
30456 | styleDisabled = _props.styleDisabled,
|
30457 | text = _props.text,
|
30458 | rest = objectWithoutProperties(_props, ['_ref', 'placeholder', 'stylePlaceholder', 'styleHover', 'styleFocus', 'styleDisabled', 'text']);
|
30459 |
|
30460 |
|
30461 | var inlineStyle = [];
|
30462 | if (stylePlaceholder) {
|
30463 | PLACEHOLDER_PREFIXES$1.forEach(function (prefix) {
|
30464 | inlineStyle.push('#' + id + prefix + ' {' + toCSS(stylePlaceholder) + '}');
|
30465 | });
|
30466 | }
|
30467 | if (styleHover) {
|
30468 | inlineStyle.push(inlineStyle + ' #' + id + ':hover {' + toCSS(styleHover) + '}');
|
30469 | }
|
30470 | if (styleFocus) {
|
30471 | inlineStyle.push('#' + id + ':focus {' + toCSS(styleFocus) + '}');
|
30472 | }
|
30473 | if (styleDisabled) {
|
30474 | inlineStyle.push('#' + id + ':disabled {' + toCSS(styleDisabled) + '}');
|
30475 | }
|
30476 |
|
30477 | if (!rest.value) {
|
30478 | rest.defaultValue = text;
|
30479 | }
|
30480 |
|
30481 | return React__default.createElement(
|
30482 | 'div',
|
30483 | {
|
30484 | __source: {
|
30485 | fileName: _jsxFileName$10,
|
30486 | lineNumber: 54
|
30487 | },
|
30488 | __self: this
|
30489 | },
|
30490 | React__default.createElement(
|
30491 | 'style',
|
30492 | {
|
30493 | __source: {
|
30494 | fileName: _jsxFileName$10,
|
30495 | lineNumber: 55
|
30496 | },
|
30497 | __self: this
|
30498 | },
|
30499 | inlineStyle.join('\n')
|
30500 | ),
|
30501 | React__default.createElement('textarea', _extends({}, rest, {
|
30502 | id: id,
|
30503 | ref: _ref,
|
30504 | placeholder: placeholder ? context.i18n ? context.i18n.t(placeholder) : placeholder : undefined,
|
30505 | __source: {
|
30506 | fileName: _jsxFileName$10,
|
30507 | lineNumber: 57
|
30508 | },
|
30509 | __self: this
|
30510 | }))
|
30511 | );
|
30512 | }
|
30513 | }]);
|
30514 | return Textarea;
|
30515 | }(React.Component);
|
30516 |
|
30517 | Textarea.defaultProps = {
|
30518 | style: {},
|
30519 | styleDisabled: {},
|
30520 | styleFocus: {},
|
30521 | stylePlaceholder: {},
|
30522 | text: ''
|
30523 | };
|
30524 |
|
30525 | Textarea.contextTypes = {
|
30526 | i18n: PropTypes.shape({
|
30527 | t: PropTypes.func.isRequired
|
30528 | })
|
30529 | };
|
30530 |
|
30531 | var _Vertical = createGroup('Vertical', { flexDirection: 'column' });
|
30532 |
|
30533 | var _jsxFileName$11 = '/Users/dario/opensource/panels/blocks/circle.js';
|
30534 | var _this$4 = undefined;
|
30535 | var Circle = function Circle(props) {
|
30536 | return React__default.createElement('circle', _extends({}, props, {
|
30537 | __source: {
|
30538 | fileName: _jsxFileName$11,
|
30539 | lineNumber: 3
|
30540 | },
|
30541 | __self: _this$4
|
30542 | }));
|
30543 | };
|
30544 |
|
30545 | var _jsxFileName$12 = '/Users/dario/opensource/panels/blocks/clip-path.js';
|
30546 | var _this$5 = undefined;
|
30547 | var ClipPath = function ClipPath(props) {
|
30548 | return React__default.createElement('clip-path', _extends({}, props, {
|
30549 | __source: {
|
30550 | fileName: _jsxFileName$12,
|
30551 | lineNumber: 3
|
30552 | },
|
30553 | __self: _this$5
|
30554 | }));
|
30555 | };
|
30556 |
|
30557 | var _jsxFileName$13 = '/Users/dario/opensource/panels/blocks/ellipse.js';
|
30558 | var _this$6 = undefined;
|
30559 | var Ellipse = function Ellipse(props) {
|
30560 | return React__default.createElement('ellipse', _extends({}, props, {
|
30561 | __source: {
|
30562 | fileName: _jsxFileName$13,
|
30563 | lineNumber: 3
|
30564 | },
|
30565 | __self: _this$6
|
30566 | }));
|
30567 | };
|
30568 |
|
30569 | var _jsxFileName$14 = '/Users/dario/opensource/panels/blocks/g.js';
|
30570 | var _this$7 = undefined;
|
30571 | var G = function G(_ref) {
|
30572 | var children = _ref.children,
|
30573 | props = objectWithoutProperties(_ref, ['children']);
|
30574 | return React__default.createElement(
|
30575 | 'g',
|
30576 | _extends({}, props, {
|
30577 | __source: {
|
30578 | fileName: _jsxFileName$14,
|
30579 | lineNumber: 4
|
30580 | },
|
30581 | __self: _this$7
|
30582 | }),
|
30583 | children
|
30584 | );
|
30585 | };
|
30586 |
|
30587 | var _jsxFileName$15 = '/Users/dario/opensource/panels/blocks/line.js';
|
30588 | var _this$8 = undefined;
|
30589 | var Line = function Line(props) {
|
30590 | return React__default.createElement('line', _extends({}, props, {
|
30591 | __source: {
|
30592 | fileName: _jsxFileName$15,
|
30593 | lineNumber: 3
|
30594 | },
|
30595 | __self: _this$8
|
30596 | }));
|
30597 | };
|
30598 |
|
30599 | var _jsxFileName$16 = '/Users/dario/opensource/panels/blocks/rect.js';
|
30600 | var _this$9 = undefined;
|
30601 | var Rect = function Rect(props) {
|
30602 | return React__default.createElement('rect', _extends({}, props, {
|
30603 | __source: {
|
30604 | fileName: _jsxFileName$16,
|
30605 | lineNumber: 3
|
30606 | },
|
30607 | __self: _this$9
|
30608 | }));
|
30609 | };
|
30610 |
|
30611 | var _jsxFileName$17 = '/Users/dario/opensource/panels/blocks/svg.js';
|
30612 | var _this$10 = undefined;
|
30613 | var Svg = function Svg(_ref) {
|
30614 | var children = _ref.children,
|
30615 | props = objectWithoutProperties(_ref, ['children']);
|
30616 | return React__default.createElement(
|
30617 | 'svg',
|
30618 | _extends({}, props, {
|
30619 | __source: {
|
30620 | fileName: _jsxFileName$17,
|
30621 | lineNumber: 4
|
30622 | },
|
30623 | __self: _this$10
|
30624 | }),
|
30625 | children
|
30626 | );
|
30627 | };
|
30628 |
|
30629 | var _jsxFileName$18 = '/Users/dario/opensource/panels/blocks/path.js';
|
30630 | var _this$11 = undefined;
|
30631 | var Path = function Path(props) {
|
30632 | return React__default.createElement('path', _extends({}, props, {
|
30633 | __source: {
|
30634 | fileName: _jsxFileName$18,
|
30635 | lineNumber: 3
|
30636 | },
|
30637 | __self: _this$11
|
30638 | }));
|
30639 | };
|
30640 |
|
30641 | var _jsxFileName$19 = '/Users/dario/opensource/panels/blocks/polygon.js';
|
30642 | var _this$12 = undefined;
|
30643 | var Polygon = function Polygon(props) {
|
30644 | return React__default.createElement('polygon', _extends({}, props, {
|
30645 | __source: {
|
30646 | fileName: _jsxFileName$19,
|
30647 | lineNumber: 3
|
30648 | },
|
30649 | __self: _this$12
|
30650 | }));
|
30651 | };
|
30652 |
|
30653 | var _jsxFileName$20 = '/Users/dario/opensource/panels/blocks/polyline.js';
|
30654 | var _this$13 = undefined;
|
30655 | var Polyline = function Polyline(props) {
|
30656 | return React__default.createElement('polyline', _extends({}, props, {
|
30657 | __source: {
|
30658 | fileName: _jsxFileName$20,
|
30659 | lineNumber: 3
|
30660 | },
|
30661 | __self: _this$13
|
30662 | }));
|
30663 | };
|
30664 |
|
30665 | exports.DangerouslySetInnerHTML = DangerouslySetInnerHTML;
|
30666 | exports.Font = Font;
|
30667 | exports.Horizontal = Horizontal;
|
30668 | exports.Image = Image;
|
30669 | exports.Input = Input;
|
30670 | exports.Knocking = Knocking;
|
30671 | exports.List = List;
|
30672 | exports.Style = Style;
|
30673 | exports.Text = Text;
|
30674 | exports.Textarea = Textarea;
|
30675 | exports.Vertical = _Vertical;
|
30676 | exports.Circle = Circle;
|
30677 | exports.ClipPath = ClipPath;
|
30678 | exports.Ellipse = Ellipse;
|
30679 | exports.G = G;
|
30680 | exports.Line = Line;
|
30681 | exports.Rect = Rect;
|
30682 | exports.Svg = Svg;
|
30683 | exports.Path = Path;
|
30684 | exports.Polygon = Polygon;
|
30685 | exports.Polyline = Polyline;
|
30686 | },{"mini-unique-id":22,"prop-types":"prop-types","react":"react","style-to-css":73,"webfontloader":79}],"panels/normalise-uri":[function(require,module,exports){
|
30687 | 'use strict';
|
30688 |
|
30689 |
|
30690 | function normaliseArray(parts, allowAboveRoot) {
|
30691 |
|
30692 | var up = 0;
|
30693 | for (var i = parts.length - 1; i >= 0; i--) {
|
30694 | var last = parts[i];
|
30695 | if (last === '.') {
|
30696 | parts.splice(i, 1);
|
30697 | } else if (last === '..') {
|
30698 | parts.splice(i, 1);
|
30699 | up++;
|
30700 | } else if (up) {
|
30701 | parts.splice(i, 1);
|
30702 | up--;
|
30703 | }
|
30704 | }
|
30705 |
|
30706 |
|
30707 | if (allowAboveRoot) {
|
30708 | for (; up--; up) {
|
30709 | parts.unshift('..');
|
30710 | }
|
30711 | }
|
30712 |
|
30713 | return parts;
|
30714 | }
|
30715 |
|
30716 |
|
30717 | function normalisePath(rawPath) {
|
30718 | var isAbsolute = rawPath.charAt(0) === '/';
|
30719 | var trailingSlash = rawPath.substr(-1) === '/';
|
30720 |
|
30721 |
|
30722 | var path = normaliseArray(rawPath.split('/').filter(function (p) {
|
30723 | return !!p;
|
30724 | }), !isAbsolute).join('/');
|
30725 |
|
30726 | if (!path && !isAbsolute) {
|
30727 | path = '.';
|
30728 | }
|
30729 | if (path && trailingSlash) {
|
30730 | path += '/';
|
30731 | }
|
30732 |
|
30733 | return (isAbsolute ? '/' : '') + path;
|
30734 | }
|
30735 |
|
30736 | var TRAILING_SLASH_REGEX = /\/$/;
|
30737 |
|
30738 | function withTrailingSlash(uri) {
|
30739 | return TRAILING_SLASH_REGEX.test(uri) ? uri : uri + "/";
|
30740 | }
|
30741 |
|
30742 | var decodeSchema = function decodeSchema(s) {
|
30743 | return s.replace(/<<HTTP>>/g, 'http://').replace(/<<HTTPS>>/g, 'https://');
|
30744 | };
|
30745 | var encodeSchema = function encodeSchema(s) {
|
30746 | return s.replace(/http:\/\//g, '<<HTTP>>').replace(/https:\/\//g, '<<HTTPS>>');
|
30747 | };
|
30748 |
|
30749 | var index_js = (function (uri) {
|
30750 | return decodeSchema(normalisePath(withTrailingSlash(encodeSchema(uri))));
|
30751 | });
|
30752 |
|
30753 | module.exports = index_js;
|
30754 | },{}],"panels/snap":[function(require,module,exports){
|
30755 | 'use strict';
|
30756 |
|
30757 | Object.defineProperty(exports, '__esModule', { value: true });
|
30758 |
|
30759 | function easeOutCubic(currentIteration, startValue, changeInValue, totalIterations) {
|
30760 | return changeInValue * (Math.pow(currentIteration / totalIterations - 1, 3) + 1) + startValue;
|
30761 | }
|
30762 |
|
30763 | var FUNCTIONS = Object.freeze({
|
30764 | easeOutCubic: easeOutCubic
|
30765 | });
|
30766 |
|
30767 | function snap($el, to, scroll, _ref) {
|
30768 | var _ref$delay = _ref.delay,
|
30769 | delay = _ref$delay === undefined ? 10 : _ref$delay,
|
30770 | _ref$duration = _ref.duration,
|
30771 | duration = _ref$duration === undefined ? 75 : _ref$duration,
|
30772 | _ref$fn = _ref.fn,
|
30773 | fn = _ref$fn === undefined ? 'easeOutCubic' : _ref$fn,
|
30774 | _ref$step = _ref.step,
|
30775 | step = _ref$step === undefined ? 5 : _ref$step;
|
30776 |
|
30777 | var currentTime = 0;
|
30778 | var next = FUNCTIONS[fn] || easeOutCubic;
|
30779 | var start = $el[scroll];
|
30780 | var change = to - start;
|
30781 |
|
30782 | var animate = function animate() {
|
30783 | currentTime += step;
|
30784 |
|
30785 | $el[scroll] = next(currentTime, start, change, duration);
|
30786 |
|
30787 | if (currentTime < duration) {
|
30788 | requestAnimationFrame(animate);
|
30789 | }
|
30790 | };
|
30791 |
|
30792 | setTimeout(animate, delay);
|
30793 | }
|
30794 |
|
30795 | function snapY($el, to) {
|
30796 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
30797 |
|
30798 | snap($el, to, 'scrollTop', options);
|
30799 | }
|
30800 |
|
30801 | function snapX($el, to) {
|
30802 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
30803 |
|
30804 | snap($el, to, 'scrollLeft', options);
|
30805 | }
|
30806 |
|
30807 | exports.snapY = snapY;
|
30808 | exports.snapX = snapX;
|
30809 | },{}],"panels":[function(require,module,exports){
|
30810 | 'use strict';
|
30811 |
|
30812 | Object.defineProperty(exports, '__esModule', { value: true });
|
30813 |
|
30814 | function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
30815 |
|
30816 | var redux = require('redux');
|
30817 | var createLogger = _interopDefault(require('redux-logger'));
|
30818 | var _regeneratorRuntime = _interopDefault(require('regenerator-runtime'));
|
30819 | var Route = _interopDefault(require('houkou'));
|
30820 | var uniqueId = _interopDefault(require('mini-unique-id'));
|
30821 | var thunkMiddleware = _interopDefault(require('redux-thunk'));
|
30822 | var reactDom = require('react-dom');
|
30823 | var reactRedux = require('react-redux');
|
30824 | var React = require('react');
|
30825 | var React__default = _interopDefault(React);
|
30826 | var debounce = _interopDefault(require('debounce'));
|
30827 | var PropTypes = _interopDefault(require('prop-types'));
|
30828 | var toCSS = _interopDefault(require('style-to-css'));
|
30829 |
|
30830 | var asyncGenerator = function () {
|
30831 | function AwaitValue(value) {
|
30832 | this.value = value;
|
30833 | }
|
30834 |
|
30835 | function AsyncGenerator(gen) {
|
30836 | var front, back;
|
30837 |
|
30838 | function send(key, arg) {
|
30839 | return new Promise(function (resolve, reject) {
|
30840 | var request = {
|
30841 | key: key,
|
30842 | arg: arg,
|
30843 | resolve: resolve,
|
30844 | reject: reject,
|
30845 | next: null
|
30846 | };
|
30847 |
|
30848 | if (back) {
|
30849 | back = back.next = request;
|
30850 | } else {
|
30851 | front = back = request;
|
30852 | resume(key, arg);
|
30853 | }
|
30854 | });
|
30855 | }
|
30856 |
|
30857 | function resume(key, arg) {
|
30858 | try {
|
30859 | var result = gen[key](arg);
|
30860 | var value = result.value;
|
30861 |
|
30862 | if (value instanceof AwaitValue) {
|
30863 | Promise.resolve(value.value).then(function (arg) {
|
30864 | resume("next", arg);
|
30865 | }, function (arg) {
|
30866 | resume("throw", arg);
|
30867 | });
|
30868 | } else {
|
30869 | settle(result.done ? "return" : "normal", result.value);
|
30870 | }
|
30871 | } catch (err) {
|
30872 | settle("throw", err);
|
30873 | }
|
30874 | }
|
30875 |
|
30876 | function settle(type, value) {
|
30877 | switch (type) {
|
30878 | case "return":
|
30879 | front.resolve({
|
30880 | value: value,
|
30881 | done: true
|
30882 | });
|
30883 | break;
|
30884 |
|
30885 | case "throw":
|
30886 | front.reject(value);
|
30887 | break;
|
30888 |
|
30889 | default:
|
30890 | front.resolve({
|
30891 | value: value,
|
30892 | done: false
|
30893 | });
|
30894 | break;
|
30895 | }
|
30896 |
|
30897 | front = front.next;
|
30898 |
|
30899 | if (front) {
|
30900 | resume(front.key, front.arg);
|
30901 | } else {
|
30902 | back = null;
|
30903 | }
|
30904 | }
|
30905 |
|
30906 | this._invoke = send;
|
30907 |
|
30908 | if (typeof gen.return !== "function") {
|
30909 | this.return = undefined;
|
30910 | }
|
30911 | }
|
30912 |
|
30913 | if (typeof Symbol === "function" && Symbol.asyncIterator) {
|
30914 | AsyncGenerator.prototype[Symbol.asyncIterator] = function () {
|
30915 | return this;
|
30916 | };
|
30917 | }
|
30918 |
|
30919 | AsyncGenerator.prototype.next = function (arg) {
|
30920 | return this._invoke("next", arg);
|
30921 | };
|
30922 |
|
30923 | AsyncGenerator.prototype.throw = function (arg) {
|
30924 | return this._invoke("throw", arg);
|
30925 | };
|
30926 |
|
30927 | AsyncGenerator.prototype.return = function (arg) {
|
30928 | return this._invoke("return", arg);
|
30929 | };
|
30930 |
|
30931 | return {
|
30932 | wrap: function (fn) {
|
30933 | return function () {
|
30934 | return new AsyncGenerator(fn.apply(this, arguments));
|
30935 | };
|
30936 | },
|
30937 | await: function (value) {
|
30938 | return new AwaitValue(value);
|
30939 | }
|
30940 | };
|
30941 | }();
|
30942 |
|
30943 | var asyncToGenerator = function (fn) {
|
30944 | return function () {
|
30945 | var gen = fn.apply(this, arguments);
|
30946 | return new Promise(function (resolve, reject) {
|
30947 | function step(key, arg) {
|
30948 | try {
|
30949 | var info = gen[key](arg);
|
30950 | var value = info.value;
|
30951 | } catch (error) {
|
30952 | reject(error);
|
30953 | return;
|
30954 | }
|
30955 |
|
30956 | if (info.done) {
|
30957 | resolve(value);
|
30958 | } else {
|
30959 | return Promise.resolve(value).then(function (value) {
|
30960 | step("next", value);
|
30961 | }, function (err) {
|
30962 | step("throw", err);
|
30963 | });
|
30964 | }
|
30965 | }
|
30966 |
|
30967 | return step("next");
|
30968 | });
|
30969 | };
|
30970 | };
|
30971 |
|
30972 | var classCallCheck = function (instance, Constructor) {
|
30973 | if (!(instance instanceof Constructor)) {
|
30974 | throw new TypeError("Cannot call a class as a function");
|
30975 | }
|
30976 | };
|
30977 |
|
30978 | var createClass = function () {
|
30979 | function defineProperties(target, props) {
|
30980 | for (var i = 0; i < props.length; i++) {
|
30981 | var descriptor = props[i];
|
30982 | descriptor.enumerable = descriptor.enumerable || false;
|
30983 | descriptor.configurable = true;
|
30984 | if ("value" in descriptor) descriptor.writable = true;
|
30985 | Object.defineProperty(target, descriptor.key, descriptor);
|
30986 | }
|
30987 | }
|
30988 |
|
30989 | return function (Constructor, protoProps, staticProps) {
|
30990 | if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
30991 | if (staticProps) defineProperties(Constructor, staticProps);
|
30992 | return Constructor;
|
30993 | };
|
30994 | }();
|
30995 |
|
30996 | var defineProperty = function (obj, key, value) {
|
30997 | if (key in obj) {
|
30998 | Object.defineProperty(obj, key, {
|
30999 | value: value,
|
31000 | enumerable: true,
|
31001 | configurable: true,
|
31002 | writable: true
|
31003 | });
|
31004 | } else {
|
31005 | obj[key] = value;
|
31006 | }
|
31007 |
|
31008 | return obj;
|
31009 | };
|
31010 |
|
31011 | var _extends = Object.assign || function (target) {
|
31012 | for (var i = 1; i < arguments.length; i++) {
|
31013 | var source = arguments[i];
|
31014 |
|
31015 | for (var key in source) {
|
31016 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
31017 | target[key] = source[key];
|
31018 | }
|
31019 | }
|
31020 | }
|
31021 |
|
31022 | return target;
|
31023 | };
|
31024 |
|
31025 | var inherits = function (subClass, superClass) {
|
31026 | if (typeof superClass !== "function" && superClass !== null) {
|
31027 | throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
31028 | }
|
31029 |
|
31030 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
31031 | constructor: {
|
31032 | value: subClass,
|
31033 | enumerable: false,
|
31034 | writable: true,
|
31035 | configurable: true
|
31036 | }
|
31037 | });
|
31038 | if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
31039 | };
|
31040 |
|
31041 | var objectWithoutProperties = function (obj, keys) {
|
31042 | var target = {};
|
31043 |
|
31044 | for (var i in obj) {
|
31045 | if (keys.indexOf(i) >= 0) continue;
|
31046 | if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
|
31047 | target[i] = obj[i];
|
31048 | }
|
31049 |
|
31050 | return target;
|
31051 | };
|
31052 |
|
31053 | var possibleConstructorReturn = function (self, call) {
|
31054 | if (!self) {
|
31055 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
31056 | }
|
31057 |
|
31058 | return call && (typeof call === "object" || typeof call === "function") ? call : self;
|
31059 | };
|
31060 |
|
31061 | var slicedToArray = function () {
|
31062 | function sliceIterator(arr, i) {
|
31063 | var _arr = [];
|
31064 | var _n = true;
|
31065 | var _d = false;
|
31066 | var _e = undefined;
|
31067 |
|
31068 | try {
|
31069 | for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
31070 | _arr.push(_s.value);
|
31071 |
|
31072 | if (i && _arr.length === i) break;
|
31073 | }
|
31074 | } catch (err) {
|
31075 | _d = true;
|
31076 | _e = err;
|
31077 | } finally {
|
31078 | try {
|
31079 | if (!_n && _i["return"]) _i["return"]();
|
31080 | } finally {
|
31081 | if (_d) throw _e;
|
31082 | }
|
31083 | }
|
31084 |
|
31085 | return _arr;
|
31086 | }
|
31087 |
|
31088 | return function (arr, i) {
|
31089 | if (Array.isArray(arr)) {
|
31090 | return arr;
|
31091 | } else if (Symbol.iterator in Object(arr)) {
|
31092 | return sliceIterator(arr, i);
|
31093 | } else {
|
31094 | throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
31095 | }
|
31096 | };
|
31097 | }();
|
31098 |
|
31099 | var toConsumableArray = function (arr) {
|
31100 | if (Array.isArray(arr)) {
|
31101 | for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
31102 |
|
31103 | return arr2;
|
31104 | } else {
|
31105 | return Array.from(arr);
|
31106 | }
|
31107 | };
|
31108 |
|
31109 |
|
31110 | var FORWARD_SLASHES_REGEX = /\//g;
|
31111 | var complexity = function complexity(pattern) {
|
31112 | return pattern.match(FORWARD_SLASHES_REGEX).length;
|
31113 | };
|
31114 | function compare(a, b) {
|
31115 | return complexity(b.pattern) - complexity(a.pattern);
|
31116 | }
|
31117 |
|
31118 |
|
31119 | var getPatterns = function getPatterns(lookup) {
|
31120 | return lookup.map(function (def) {
|
31121 | var _ref = typeof def === 'string' ? { pattern: def } : def,
|
31122 | pattern = _ref.pattern,
|
31123 | config = objectWithoutProperties(_ref, ['pattern']);
|
31124 |
|
31125 | return {
|
31126 | pattern: pattern,
|
31127 | route: new Route(pattern, config)
|
31128 | };
|
31129 | });
|
31130 | };
|
31131 |
|
31132 |
|
31133 | var match = function match(path, lookup) {
|
31134 | return getPatterns(lookup).map(function (_ref2) {
|
31135 | var pattern = _ref2.pattern,
|
31136 | route = _ref2.route;
|
31137 |
|
31138 | var params = route.match(path);
|
31139 |
|
31140 | if (params) {
|
31141 | return {
|
31142 | params: params,
|
31143 | pattern: pattern
|
31144 | };
|
31145 | } else {
|
31146 | return false;
|
31147 | }
|
31148 | }).filter(Boolean).sort(compare)[0];
|
31149 | };
|
31150 |
|
31151 | function createFindPanel(panels) {
|
31152 | var lookup = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
31153 |
|
31154 |
|
31155 | return function findPanel(path) {
|
31156 |
|
31157 | var panel = panels[path];
|
31158 | var props = void 0;
|
31159 |
|
31160 |
|
31161 |
|
31162 | if (typeof panel === 'undefined') {
|
31163 |
|
31164 | var matchedPath = match(path, lookup);
|
31165 |
|
31166 | if (matchedPath) {
|
31167 | panel = panels[matchedPath.pattern];
|
31168 | props = matchedPath.params;
|
31169 | }
|
31170 | } else {
|
31171 | props = panel.props || {};
|
31172 | }
|
31173 |
|
31174 | return {
|
31175 | panel: panel,
|
31176 | props: props
|
31177 | };
|
31178 | };
|
31179 | }
|
31180 |
|
31181 | function isRequireable(dep) {
|
31182 | var is = false;
|
31183 |
|
31184 | try {
|
31185 | require(dep);
|
31186 | is = true;
|
31187 | } catch (err) {}
|
31188 |
|
31189 | return is;
|
31190 | }
|
31191 |
|
31192 |
|
31193 | function load(file) {
|
31194 | var _this = this;
|
31195 |
|
31196 | return new Promise(function (resolve, reject) {
|
31197 | if (typeof file === 'undefined') {
|
31198 | return resolve();
|
31199 | }
|
31200 |
|
31201 | var resource = document.createElement('script');
|
31202 | var done = false;
|
31203 |
|
31204 | function ready(err) {
|
31205 | done = true;
|
31206 | resource.onload = resource.onerror = resource.onreadystatechange = null;
|
31207 | clearTimeout(timer);
|
31208 | err ? reject(err) : resolve();
|
31209 | }
|
31210 |
|
31211 | resource.onload = resource.onreadystatechange = function (e) {
|
31212 | if (!(done && (!_this.readyState || _this.readyState === 'complete' || _this.readyState === 'loaded'))) {
|
31213 | ready(null);
|
31214 | }
|
31215 | };
|
31216 |
|
31217 | resource.onerror = function (error) {
|
31218 | if (!done) {
|
31219 | ready(error || new Error('Could not load file'));
|
31220 | }
|
31221 | };
|
31222 |
|
31223 | var timer = setTimeout(function () {
|
31224 | ready(new Error('Resource ' + file + ' loading timed-out'));
|
31225 | }, 3e4);
|
31226 |
|
31227 | resource.src = file;
|
31228 | document.getElementsByTagName('head')[0].appendChild(resource);
|
31229 | });
|
31230 | }
|
31231 |
|
31232 | var loadModule = function () {
|
31233 | var _ref = asyncToGenerator(_regeneratorRuntime.mark(function _callee(app) {
|
31234 | var module, response, data;
|
31235 | return _regeneratorRuntime.wrap(function _callee$(_context) {
|
31236 | while (1) {
|
31237 | switch (_context.prev = _context.next) {
|
31238 | case 0:
|
31239 | module = {};
|
31240 | _context.prev = 1;
|
31241 | _context.next = 4;
|
31242 | return fetch('//' + app + '/panels.json');
|
31243 |
|
31244 | case 4:
|
31245 | response = _context.sent;
|
31246 | _context.next = 7;
|
31247 | return response.json();
|
31248 |
|
31249 | case 7:
|
31250 | data = _context.sent;
|
31251 |
|
31252 |
|
31253 | if (data.module) {
|
31254 | module = data.module;
|
31255 | }
|
31256 |
|
31257 | _context.next = 11;
|
31258 | return load(data.logic);
|
31259 |
|
31260 | case 11:
|
31261 | _context.next = 18;
|
31262 | break;
|
31263 |
|
31264 | case 13:
|
31265 | _context.prev = 13;
|
31266 | _context.t0 = _context['catch'](1);
|
31267 |
|
31268 | console.error(_context.t0);
|
31269 |
|
31270 | if (!(_context.t0 instanceof SyntaxError)) {
|
31271 | _context.next = 18;
|
31272 | break;
|
31273 | }
|
31274 |
|
31275 | throw new Error('We can\'t load ' + app + '.\n We can\'t find your app\'s logic source.\n\n If you\'re inlining your app with Panels, make sure the script tag is inserted after panels\n and that the required export matches ' + app + '.\n\n If your app is expected to be fetched from a remote source, make sure that\n \'//' + app + '/panels.json\' in place and that it at least includes the logic key pointing to\n your application\'s JS logic URI.\n\n {\n "logic": "https://panels.com/my-application-logic.js"\n }');
|
31276 |
|
31277 | case 18:
|
31278 | return _context.abrupt('return', module);
|
31279 |
|
31280 | case 19:
|
31281 | case 'end':
|
31282 | return _context.stop();
|
31283 | }
|
31284 | }
|
31285 | }, _callee, this, [[1, 13]]);
|
31286 | }));
|
31287 |
|
31288 | return function loadModule(_x) {
|
31289 | return _ref.apply(this, arguments);
|
31290 | };
|
31291 | }();
|
31292 |
|
31293 | var DENY = function DENY() {
|
31294 | return false;
|
31295 | };
|
31296 |
|
31297 | var getApp = (function () {
|
31298 | var _ref2 = asyncToGenerator(_regeneratorRuntime.mark(function _callee2(app, createContext) {
|
31299 | var data, name, props, inline, _require, _require$access, access, notify, lookup, panels, setup, types, context;
|
31300 |
|
31301 | return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
31302 | while (1) {
|
31303 | switch (_context2.prev = _context2.next) {
|
31304 | case 0:
|
31305 | data = void 0;
|
31306 | name = app;
|
31307 | props = {};
|
31308 |
|
31309 | if (isRequireable(name)) {
|
31310 | _context2.next = 12;
|
31311 | break;
|
31312 | }
|
31313 |
|
31314 | inline = window.panelsJson && window.panelsJson[name];
|
31315 |
|
31316 | if (inline) {
|
31317 | data = inline.module;
|
31318 |
|
31319 | if (!isRequireable(data.name)) {
|
31320 | console.error('You should embed your app\'s panels bundle script tag');
|
31321 | }
|
31322 | }
|
31323 |
|
31324 | if (data) {
|
31325 | _context2.next = 10;
|
31326 | break;
|
31327 | }
|
31328 |
|
31329 | _context2.next = 9;
|
31330 | return loadModule(app);
|
31331 |
|
31332 | case 9:
|
31333 | data = _context2.sent;
|
31334 |
|
31335 | case 10:
|
31336 |
|
31337 | if (data.name) {
|
31338 | name = data.name;
|
31339 | }
|
31340 | if (data.props) {
|
31341 | props = data.props;
|
31342 | }
|
31343 |
|
31344 | case 12:
|
31345 |
|
31346 |
|
31347 | _require = require(name), _require$access = _require.access, access = _require$access === undefined ? DENY : _require$access, notify = _require.notify, lookup = _require.lookup, panels = _require.panels, setup = _require.setup, types = _require.types;
|
31348 | context = createContext(app, name);
|
31349 | _context2.t0 = access;
|
31350 | _context2.t1 = createFindPanel(panels, lookup);
|
31351 | _context2.t2 = name;
|
31352 | _context2.t3 = notify;
|
31353 | _context2.t4 = typeof setup === 'function';
|
31354 |
|
31355 | if (!_context2.t4) {
|
31356 | _context2.next = 23;
|
31357 | break;
|
31358 | }
|
31359 |
|
31360 | _context2.next = 22;
|
31361 | return setup(app, props, context);
|
31362 |
|
31363 | case 22:
|
31364 | _context2.t4 = _context2.sent;
|
31365 |
|
31366 | case 23:
|
31367 | _context2.t5 = _context2.t4;
|
31368 | _context2.t6 = types;
|
31369 | return _context2.abrupt('return', {
|
31370 | access: _context2.t0,
|
31371 | findPanel: _context2.t1,
|
31372 | name: _context2.t2,
|
31373 | notify: _context2.t3,
|
31374 | store: _context2.t5,
|
31375 | types: _context2.t6
|
31376 | });
|
31377 |
|
31378 | case 26:
|
31379 | case 'end':
|
31380 | return _context2.stop();
|
31381 | }
|
31382 | }
|
31383 | }, _callee2, this);
|
31384 | }));
|
31385 |
|
31386 | function get(_x2, _x3) {
|
31387 | return _ref2.apply(this, arguments);
|
31388 | }
|
31389 |
|
31390 | return get;
|
31391 | })();
|
31392 |
|
31393 | function getContextAndFocus(_ref) {
|
31394 | var currentFocus = _ref.currentFocus,
|
31395 | next = _ref.next,
|
31396 | last = _ref.last;
|
31397 |
|
31398 |
|
31399 | var focus = currentFocus + next.focus;
|
31400 | if (focus < 0 || focus > last) {
|
31401 |
|
31402 | focus = last;
|
31403 | }
|
31404 |
|
31405 |
|
31406 |
|
31407 |
|
31408 |
|
31409 | var context = 0;
|
31410 | if (typeof next.context === 'number') {
|
31411 | context = focus - next.context;
|
31412 |
|
31413 | if (context < 0 || context > focus) {
|
31414 |
|
31415 | context = 0;
|
31416 | }
|
31417 | }
|
31418 |
|
31419 | return {
|
31420 | context: context,
|
31421 | focus: focus
|
31422 | };
|
31423 | }
|
31424 |
|
31425 | function getIndexOfPanelToShow(at, regions) {
|
31426 | var index = regions.findIndex(function (region) {
|
31427 | return at < region;
|
31428 | });
|
31429 | return index === -1 ? regions.length - 1 : index;
|
31430 | }
|
31431 |
|
31432 | function getNextPosition(_ref) {
|
31433 | var context = _ref.context,
|
31434 | focus = _ref.focus,
|
31435 | maxFullPanelWidth = _ref.maxFullPanelWidth,
|
31436 | routes = _ref.routes,
|
31437 | panels = _ref.panels,
|
31438 | shouldGoMobile = _ref.shouldGoMobile,
|
31439 | viewportWidth = _ref.viewportWidth;
|
31440 |
|
31441 | var nextRoutesByContext = routes.byContext;
|
31442 |
|
31443 | var widths = routes.items.map(function (routeContext) {
|
31444 | var route = routes.byContext[routeContext];
|
31445 | var panel = panels.byId[route.panelId];
|
31446 |
|
31447 | var width = void 0;
|
31448 | if (route.isVisible) {
|
31449 | if (shouldGoMobile) {
|
31450 | width = viewportWidth;
|
31451 | } else {
|
31452 | width = route.isExpanded ? panel.maxWidth : panel.width;
|
31453 |
|
31454 | var percentageMatch = typeof width === 'string' && width.match(/([0-9]+)%/);
|
31455 | if (percentageMatch) {
|
31456 | width = maxFullPanelWidth * parseInt(percentageMatch, 10) / 100;
|
31457 | }
|
31458 | }
|
31459 | } else {
|
31460 | width = 0;
|
31461 | }
|
31462 |
|
31463 | if (width !== route.width) {
|
31464 | nextRoutesByContext = _extends({}, nextRoutesByContext, defineProperty({}, routeContext, _extends({}, route, {
|
31465 | width: width
|
31466 | })));
|
31467 | }
|
31468 |
|
31469 | return width;
|
31470 | });
|
31471 |
|
31472 |
|
31473 | var focusWidth = widths[focus];
|
31474 |
|
31475 | var x = widths.slice(0, focus).reduce(function (a, b) {
|
31476 | return a + b;
|
31477 | }, 0);
|
31478 |
|
31479 | var leftForContext = maxFullPanelWidth - focusWidth;
|
31480 |
|
31481 | var contextsLeft = focus - context - 1;
|
31482 |
|
31483 |
|
31484 | while (contextsLeft >= 0 && leftForContext >= widths[contextsLeft]) {
|
31485 |
|
31486 | var contextWidth = widths[contextsLeft];
|
31487 |
|
31488 | leftForContext -= contextWidth;
|
31489 |
|
31490 | x -= contextWidth;
|
31491 |
|
31492 | contextsLeft--;
|
31493 | }
|
31494 |
|
31495 | return {
|
31496 | routesByContext: nextRoutesByContext,
|
31497 | x: x,
|
31498 | width: maxFullPanelWidth + widths.reduce(function (a, b) {
|
31499 | return a + b;
|
31500 | }, 0),
|
31501 | widths: widths
|
31502 | };
|
31503 | }
|
31504 |
|
31505 | function getHalves(widths) {
|
31506 | var halves = [];
|
31507 |
|
31508 | widths.forEach(function (width) {
|
31509 | var half = width / 2;
|
31510 |
|
31511 | halves.push(half);
|
31512 | halves.push(half);
|
31513 | });
|
31514 |
|
31515 | return halves;
|
31516 | }
|
31517 |
|
31518 | var sum = (function (a, b) {
|
31519 | return a + b;
|
31520 | });
|
31521 |
|
31522 | function getRegions(widths) {
|
31523 | var halves = getHalves(widths);
|
31524 |
|
31525 | return widths.map(function (_, i) {
|
31526 | var to = i * 2 + 1;
|
31527 | return halves.slice(0, to).reduce(sum, 0);
|
31528 | });
|
31529 | }
|
31530 |
|
31531 |
|
31532 | function normaliseArray(parts, allowAboveRoot) {
|
31533 |
|
31534 | var up = 0;
|
31535 | for (var i = parts.length - 1; i >= 0; i--) {
|
31536 | var last = parts[i];
|
31537 | if (last === '.') {
|
31538 | parts.splice(i, 1);
|
31539 | } else if (last === '..') {
|
31540 | parts.splice(i, 1);
|
31541 | up++;
|
31542 | } else if (up) {
|
31543 | parts.splice(i, 1);
|
31544 | up--;
|
31545 | }
|
31546 | }
|
31547 |
|
31548 |
|
31549 | if (allowAboveRoot) {
|
31550 | for (; up--; up) {
|
31551 | parts.unshift('..');
|
31552 | }
|
31553 | }
|
31554 |
|
31555 | return parts;
|
31556 | }
|
31557 |
|
31558 |
|
31559 | function normalisePath(rawPath) {
|
31560 | var isAbsolute = rawPath.charAt(0) === '/';
|
31561 | var trailingSlash = rawPath.substr(-1) === '/';
|
31562 |
|
31563 |
|
31564 | var path = normaliseArray(rawPath.split('/').filter(function (p) {
|
31565 | return !!p;
|
31566 | }), !isAbsolute).join('/');
|
31567 |
|
31568 | if (!path && !isAbsolute) {
|
31569 | path = '.';
|
31570 | }
|
31571 | if (path && trailingSlash) {
|
31572 | path += '/';
|
31573 | }
|
31574 |
|
31575 | return (isAbsolute ? '/' : '') + path;
|
31576 | }
|
31577 |
|
31578 | var TRAILING_SLASH_REGEX = /\/$/;
|
31579 |
|
31580 | function withTrailingSlash(uri) {
|
31581 | return TRAILING_SLASH_REGEX.test(uri) ? uri : uri + "/";
|
31582 | }
|
31583 |
|
31584 | var decodeSchema = function decodeSchema(s) {
|
31585 | return s.replace(/<<HTTP>>/g, 'http://').replace(/<<HTTPS>>/g, 'https://');
|
31586 | };
|
31587 | var encodeSchema = function encodeSchema(s) {
|
31588 | return s.replace(/http:\/\//g, '<<HTTP>>').replace(/https:\/\//g, '<<HTTPS>>');
|
31589 | };
|
31590 |
|
31591 | var normaliseUri = (function (uri) {
|
31592 | return decodeSchema(normalisePath(withTrailingSlash(encodeSchema(uri))));
|
31593 | });
|
31594 |
|
31595 | var TRAILING_SLASH_REGEX$1 = /\/$/;
|
31596 |
|
31597 | var withTrailingSlash$1 = (function (uri) {
|
31598 | return TRAILING_SLASH_REGEX$1.test(uri) ? uri : uri + "/";
|
31599 | });
|
31600 |
|
31601 | var DEFAULT_PARSER = /^https?:\/\/([a-zA-Z0-9\-_.]+)()(\/.*)/;
|
31602 | var PROTOCOL = /(https?):\/\//;
|
31603 | var SLICE_END = ')';
|
31604 | var SLICE_START = '(';
|
31605 | var SLICE_MARKERS = new RegExp('[' + SLICE_START + SLICE_END + ']', 'g');
|
31606 |
|
31607 |
|
31608 |
|
31609 | var withoutQueryString = function withoutQueryString(s) {
|
31610 | return (/\?/.test(s) ? s.match(/(.*?)\?/)[1] : s
|
31611 | );
|
31612 | };
|
31613 |
|
31614 | var MANY_APPS = /^(https?:\/\/.+?\/)(https?:\/\/.+)/;
|
31615 |
|
31616 | var appSplit = function appSplit(s) {
|
31617 | var currentUri = s;
|
31618 | var nextUri = false;
|
31619 |
|
31620 | var manyAppsMatch = s.match(MANY_APPS);
|
31621 | if (manyAppsMatch) {
|
31622 | currentUri = manyAppsMatch[1];
|
31623 | nextUri = manyAppsMatch[2];
|
31624 | }
|
31625 |
|
31626 | return {
|
31627 | currentUri: currentUri,
|
31628 | nextUri: nextUri
|
31629 | };
|
31630 | };
|
31631 |
|
31632 | function parse(uri) {
|
31633 | var parsers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
31634 |
|
31635 | var apps = {
|
31636 | byName: {},
|
31637 | items: []
|
31638 | };
|
31639 | var routes = {
|
31640 | byContext: {},
|
31641 | items: []
|
31642 |
|
31643 |
|
31644 | };var protocol = uri.match(PROTOCOL)[1];
|
31645 | var nextUri = withoutQueryString(withTrailingSlash$1(uri));
|
31646 |
|
31647 | var _loop = function _loop() {
|
31648 | var split = appSplit(nextUri);
|
31649 | var currentUri = split.currentUri;
|
31650 | nextUri = split.nextUri;
|
31651 |
|
31652 | var parser = parsers.find(function (p) {
|
31653 | return p.test(currentUri);
|
31654 | }) || DEFAULT_PARSER;
|
31655 |
|
31656 | var _currentUri$match = currentUri.match(parser),
|
31657 | _currentUri$match2 = slicedToArray(_currentUri$match, 4),
|
31658 | _0 = _currentUri$match2[0],
|
31659 | app = _currentUri$match2[1],
|
31660 | _1 = _currentUri$match2[2],
|
31661 | path = _currentUri$match2[3];
|
31662 |
|
31663 | var base = protocol + '://' + app;
|
31664 | var context = routes.items.length > 0 ? routes.items[routes.items.length - 1] : '';
|
31665 |
|
31666 |
|
31667 | var pathRoute = [];
|
31668 | var isVisible = true;
|
31669 | do {
|
31670 | path = path.split('/');
|
31671 | var lastBit = path.length > 1 ? path[path.length - 2] : '';
|
31672 | path = path.slice(0, path.length - 1).join('/');
|
31673 | var hasSliceEndMarkerForRoot = lastBit.indexOf(SLICE_END) === 0;
|
31674 | var hasSliceEndMarker = !hasSliceEndMarkerForRoot && lastBit.indexOf(SLICE_END) > -1;
|
31675 | var hasSliceStartMarker = lastBit.indexOf(SLICE_START) > -1;
|
31676 |
|
31677 | if (hasSliceEndMarker || hasSliceStartMarker) {
|
31678 | isVisible = false;
|
31679 | }
|
31680 |
|
31681 | var panelPath = path.replace(SLICE_MARKERS, '') || '/';
|
31682 |
|
31683 | var panelId = '' + app + panelPath;
|
31684 |
|
31685 | pathRoute.push({
|
31686 | app: app,
|
31687 | context: '' + context + base + withTrailingSlash$1(path),
|
31688 | isVisible: isVisible,
|
31689 | panelId: panelId,
|
31690 | path: panelPath
|
31691 | });
|
31692 |
|
31693 | isVisible = hasSliceEndMarkerForRoot ? false : hasSliceStartMarker ? true : isVisible;
|
31694 | } while (path.length);
|
31695 |
|
31696 | if (apps.items.indexOf(app) === -1) {
|
31697 | apps.items.push(app);
|
31698 | apps.byName[app] = {
|
31699 | app: app,
|
31700 | panels: []
|
31701 | };
|
31702 | }
|
31703 |
|
31704 | pathRoute.reverse().forEach(function (route) {
|
31705 | routes.byContext[route.context] = route;
|
31706 | routes.items.push(route.context);
|
31707 |
|
31708 | if (apps.byName[app].panels.indexOf(route.path) === -1) {
|
31709 | apps.byName[app].panels.push(route.path);
|
31710 | }
|
31711 | });
|
31712 | };
|
31713 |
|
31714 | do {
|
31715 | _loop();
|
31716 | } while (nextUri);
|
31717 |
|
31718 | return {
|
31719 | apps: apps,
|
31720 | routes: routes
|
31721 | };
|
31722 | }
|
31723 |
|
31724 | function ensurePanelShape(panel) {
|
31725 | if (typeof panel.width === 'undefined') {
|
31726 | panel.width = 360;
|
31727 | }
|
31728 | }
|
31729 |
|
31730 | var NAVIGATE = 'panels/NAVIGATE';
|
31731 | function navigate(rawUri) {
|
31732 | var nextFocus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
31733 | var nextContext = arguments[2];
|
31734 |
|
31735 | return function () {
|
31736 | var _ref = asyncToGenerator(_regeneratorRuntime.mark(function _callee3(dispatch, getState) {
|
31737 | var _this = this;
|
31738 |
|
31739 | var _getState, apps, panels, router, runtime, uri, parsed, routes, createAppContext, nextApps, nextPanels, maxFullPanelWidth, isFirstLoad, last, opts, focusRoute, focusPanel, _getContextAndFocus, context, focus, widths, focusWidth, x, leftForContext, contextsLeft, contextWidth, regions, snappedAt;
|
31740 |
|
31741 | return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
31742 | while (1) {
|
31743 | switch (_context3.prev = _context3.next) {
|
31744 | case 0:
|
31745 | _getState = getState(), apps = _getState.apps, panels = _getState.panels, router = _getState.router, runtime = _getState.runtime;
|
31746 | uri = normaliseUri(rawUri);
|
31747 |
|
31748 | if (!(uri === router.uri)) {
|
31749 | _context3.next = 4;
|
31750 | break;
|
31751 | }
|
31752 |
|
31753 | return _context3.abrupt('return');
|
31754 |
|
31755 | case 4:
|
31756 | parsed = parse(uri, router.parsers);
|
31757 | routes = {
|
31758 | byContext: parsed.routes.byContext,
|
31759 | items: parsed.routes.items
|
31760 | };
|
31761 |
|
31762 | createAppContext = function createAppContext(appName, appModule) {
|
31763 | var access = function () {
|
31764 | var _ref2 = asyncToGenerator(_regeneratorRuntime.mark(function _callee(name) {
|
31765 | var app;
|
31766 | return _regeneratorRuntime.wrap(function _callee$(_context) {
|
31767 | while (1) {
|
31768 | switch (_context.prev = _context.next) {
|
31769 | case 0:
|
31770 | app = getState().apps.byName[name];
|
31771 |
|
31772 | if (!app) {
|
31773 | _context.next = 9;
|
31774 | break;
|
31775 | }
|
31776 |
|
31777 | if (!app.access(appName, appModule)) {
|
31778 | _context.next = 6;
|
31779 | break;
|
31780 | }
|
31781 |
|
31782 | return _context.abrupt('return', app.store);
|
31783 |
|
31784 | case 6:
|
31785 | throw Error('Access to ' + name + ' denied.');
|
31786 |
|
31787 | case 7:
|
31788 | _context.next = 10;
|
31789 | break;
|
31790 |
|
31791 | case 9:
|
31792 | throw Error('App ' + name + ' doesn\'t exist or it doesn\'t have a store.');
|
31793 |
|
31794 | case 10:
|
31795 | case 'end':
|
31796 | return _context.stop();
|
31797 | }
|
31798 | }
|
31799 | }, _callee, _this);
|
31800 | }));
|
31801 |
|
31802 | return function access(_x4) {
|
31803 | return _ref2.apply(this, arguments);
|
31804 | };
|
31805 | }();
|
31806 |
|
31807 | return {
|
31808 | access: access,
|
31809 | navigate: function navigate$$() {
|
31810 | return dispatch(navigate.apply(undefined, arguments));
|
31811 | },
|
31812 | routes: routes
|
31813 | };
|
31814 | };
|
31815 |
|
31816 |
|
31817 |
|
31818 |
|
31819 | nextApps = {
|
31820 | byName: {},
|
31821 | items: parsed.apps.items.filter(function (name) {
|
31822 | return apps.items.indexOf(name) === -1;
|
31823 | })
|
31824 | };
|
31825 |
|
31826 |
|
31827 | if (nextApps.items.length) {
|
31828 | dispatch({
|
31829 | type: NAVIGATE,
|
31830 | sequence: {
|
31831 | type: 'start'
|
31832 | },
|
31833 | meta: {
|
31834 | uri: uri
|
31835 | }
|
31836 | });
|
31837 | }
|
31838 |
|
31839 | _context3.next = 11;
|
31840 | return Promise.all(nextApps.items.map(function () {
|
31841 | var _ref3 = asyncToGenerator(_regeneratorRuntime.mark(function _callee2(name) {
|
31842 | return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
31843 | while (1) {
|
31844 | switch (_context2.prev = _context2.next) {
|
31845 | case 0:
|
31846 | _context2.prev = 0;
|
31847 | _context2.next = 3;
|
31848 | return getApp(name, createAppContext);
|
31849 |
|
31850 | case 3:
|
31851 | nextApps.byName[name] = _context2.sent;
|
31852 | _context2.next = 9;
|
31853 | break;
|
31854 |
|
31855 | case 6:
|
31856 | _context2.prev = 6;
|
31857 | _context2.t0 = _context2['catch'](0);
|
31858 |
|
31859 |
|
31860 | console.error('Can\'t load app ' + name, _context2.t0);
|
31861 |
|
31862 | case 9:
|
31863 | case 'end':
|
31864 | return _context2.stop();
|
31865 | }
|
31866 | }
|
31867 | }, _callee2, _this, [[0, 6]]);
|
31868 | }));
|
31869 |
|
31870 | return function (_x5) {
|
31871 | return _ref3.apply(this, arguments);
|
31872 | };
|
31873 | }()));
|
31874 |
|
31875 | case 11:
|
31876 | nextPanels = {
|
31877 | byId: {},
|
31878 | items: []
|
31879 |
|
31880 |
|
31881 | };
|
31882 | parsed.apps.items.forEach(function (name) {
|
31883 |
|
31884 | var panelsToLoad = parsed.apps.byName[name].panels;
|
31885 |
|
31886 | var app = nextApps.byName[name] || apps.byName[name];
|
31887 |
|
31888 | panelsToLoad.forEach(function (path) {
|
31889 | var panelId = '' + name + path;
|
31890 |
|
31891 | if (panels.byId[panelId]) {
|
31892 | return;
|
31893 | }
|
31894 |
|
31895 | try {
|
31896 |
|
31897 | var _app$findPanel = app.findPanel(path),
|
31898 | panel = _app$findPanel.panel,
|
31899 | props = _app$findPanel.props;
|
31900 |
|
31901 | if (typeof panel === 'function') {
|
31902 | panel = panel(props, app.store);
|
31903 | } else {
|
31904 | panel = _extends({}, panel, {
|
31905 | props: props
|
31906 | });
|
31907 | }
|
31908 |
|
31909 |
|
31910 | ensurePanelShape(panel);
|
31911 |
|
31912 | nextPanels.byId[panelId] = panel;
|
31913 | nextPanels.items.push(panelId);
|
31914 | } catch (error) {
|
31915 |
|
31916 | console.error('Can\'t load panel ' + panelId, error);
|
31917 | }
|
31918 | });
|
31919 | });
|
31920 |
|
31921 | maxFullPanelWidth = runtime.viewportWidth - runtime.snapPoint;
|
31922 | isFirstLoad = typeof router.focus === 'undefined';
|
31923 | last = parsed.routes.items.length - 1;
|
31924 |
|
31925 |
|
31926 | opts = {
|
31927 | currentFocus: router.focus,
|
31928 | next: {
|
31929 | context: nextContext,
|
31930 | focus: nextFocus
|
31931 | },
|
31932 | uri: uri,
|
31933 | last: last
|
31934 | };
|
31935 |
|
31936 | if (isFirstLoad) {
|
31937 | focusRoute = parsed.routes.byContext[parsed.routes.items[last]];
|
31938 | focusPanel = nextPanels.byId[focusRoute.panelId];
|
31939 |
|
31940 | opts.currentFocus = last;
|
31941 | opts.next.focus = 0;
|
31942 | if (typeof focusPanel.context !== 'undefined') {
|
31943 | opts.next.context = focusPanel.context;
|
31944 | }
|
31945 | }
|
31946 | _getContextAndFocus = getContextAndFocus(opts), context = _getContextAndFocus.context, focus = _getContextAndFocus.focus;
|
31947 | widths = routes.items.map(function (routeContext) {
|
31948 |
|
31949 |
|
31950 |
|
31951 |
|
31952 | var route = routes.byContext[routeContext];
|
31953 | var panel = panels.byId[route.panelId] || nextPanels.byId[route.panelId];
|
31954 |
|
31955 | var width = void 0;
|
31956 | if (route.isVisible) {
|
31957 | if (runtime.shouldGoMobile) {
|
31958 | width = runtime.viewportWidth;
|
31959 | } else {
|
31960 | var prevRoute = router.routes.byContext[routeContext];
|
31961 | width = route.isExpanded ? panel.maxWidth : prevRoute && prevRoute.width || panel.width;
|
31962 |
|
31963 | var percentageMatch = typeof width === 'string' && width.match(/([0-9]+)%/);
|
31964 | if (percentageMatch) {
|
31965 | width = maxFullPanelWidth * parseInt(percentageMatch, 10) / 100;
|
31966 | }
|
31967 | }
|
31968 | } else {
|
31969 | width = 0;
|
31970 | }
|
31971 |
|
31972 | route.width = width;
|
31973 | return width;
|
31974 | });
|
31975 |
|
31976 |
|
31977 |
|
31978 | focusWidth = widths[focus];
|
31979 |
|
31980 |
|
31981 | x = widths.slice(0, focus).reduce(function (a, b) {
|
31982 | return a + b;
|
31983 | }, 0);
|
31984 |
|
31985 |
|
31986 | leftForContext = maxFullPanelWidth - focusWidth;
|
31987 |
|
31988 |
|
31989 | contextsLeft = focus - context;
|
31990 |
|
31991 |
|
31992 |
|
31993 | case 24:
|
31994 | if (!(contextsLeft > 0)) {
|
31995 | _context3.next = 33;
|
31996 | break;
|
31997 | }
|
31998 |
|
31999 |
|
32000 | contextsLeft--;
|
32001 |
|
32002 |
|
32003 | contextWidth = widths[contextsLeft];
|
32004 |
|
32005 |
|
32006 |
|
32007 | if (!(leftForContext < contextWidth)) {
|
32008 | _context3.next = 29;
|
32009 | break;
|
32010 | }
|
32011 |
|
32012 | return _context3.abrupt('break', 33);
|
32013 |
|
32014 | case 29:
|
32015 |
|
32016 |
|
32017 | leftForContext -= contextWidth;
|
32018 |
|
32019 | x -= contextWidth;
|
32020 | _context3.next = 24;
|
32021 | break;
|
32022 |
|
32023 | case 33:
|
32024 | regions = getRegions(widths);
|
32025 | snappedAt = getIndexOfPanelToShow(x, regions);
|
32026 |
|
32027 |
|
32028 | dispatch({
|
32029 | type: NAVIGATE,
|
32030 | sequence: {
|
32031 | type: 'next'
|
32032 | },
|
32033 | payload: {
|
32034 | apps: nextApps,
|
32035 | panels: nextPanels,
|
32036 | router: {
|
32037 | context: context,
|
32038 | focus: focus,
|
32039 | routes: routes,
|
32040 | uri: uri
|
32041 | },
|
32042 | runtime: {
|
32043 | maxFullPanelWidth: maxFullPanelWidth,
|
32044 | regions: regions,
|
32045 | snappedAt: snappedAt,
|
32046 | width: maxFullPanelWidth + widths.reduce(function (a, b) {
|
32047 | return a + b;
|
32048 | }, 0),
|
32049 | widths: widths,
|
32050 | x: x
|
32051 | }
|
32052 | },
|
32053 | meta: {
|
32054 | uri: uri
|
32055 | }
|
32056 | });
|
32057 |
|
32058 | case 36:
|
32059 | case 'end':
|
32060 | return _context3.stop();
|
32061 | }
|
32062 | }
|
32063 | }, _callee3, this);
|
32064 | }));
|
32065 |
|
32066 | function navigateThunk(_x2, _x3) {
|
32067 | return _ref.apply(this, arguments);
|
32068 | }
|
32069 |
|
32070 | return navigateThunk;
|
32071 | }();
|
32072 | }
|
32073 |
|
32074 | var TOGGLE_EXPAND = 'panels/panels/TOGGLE_EXPAND';
|
32075 | function toggleExpand(routeContext) {
|
32076 | return function toggleExpandThunk(dispatch, getState) {
|
32077 | var _getState2 = getState(),
|
32078 | panels = _getState2.panels,
|
32079 | router = _getState2.router,
|
32080 | runtime = _getState2.runtime;
|
32081 |
|
32082 | var routes = router.routes;
|
32083 | var route = routes.byContext[routeContext];
|
32084 |
|
32085 | routes.byContext = _extends({}, routes.byContext, defineProperty({}, routeContext, _extends({}, route, {
|
32086 | isExpanded: !route.isExpanded
|
32087 | })));
|
32088 |
|
32089 | var nextPosition = getNextPosition({
|
32090 |
|
32091 | context: router.context,
|
32092 | focus: router.focus,
|
32093 | maxFullPanelWidth: runtime.maxFullPanelWidth,
|
32094 | routes: routes,
|
32095 | panels: panels,
|
32096 | shouldGoMobile: runtime.shouldGoMobile,
|
32097 | viewportWidth: runtime.viewportWidth
|
32098 | });
|
32099 |
|
32100 | dispatch({
|
32101 | type: TOGGLE_EXPAND,
|
32102 | payload: nextPosition
|
32103 | });
|
32104 | };
|
32105 | }
|
32106 |
|
32107 | var UPDATE_SETTINGS = 'panels/panels/UPDATE_SETTINGS';
|
32108 | function updateSettings(routeContext, _ref4) {
|
32109 | var maxWidth = _ref4.maxWidth,
|
32110 | title = _ref4.title,
|
32111 | styleBackground = _ref4.styleBackground,
|
32112 | width = _ref4.width;
|
32113 |
|
32114 | return function updateSettingsThunk(dispatch, getState) {
|
32115 | var _getState3 = getState(),
|
32116 | panels = _getState3.panels,
|
32117 | router = _getState3.router,
|
32118 | runtime = _getState3.runtime;
|
32119 |
|
32120 | var nextPanels = {
|
32121 | byId: panels.byId,
|
32122 | items: panels.items
|
32123 | };
|
32124 |
|
32125 | var route = router.routes.byContext[routeContext];
|
32126 |
|
32127 | if (!route.isVisible) return;
|
32128 |
|
32129 | var panel = _extends({}, nextPanels.byId[route.panelId]);
|
32130 |
|
32131 | if (maxWidth) {
|
32132 | panel.maxWidth = maxWidth;
|
32133 | }
|
32134 | if (title) {
|
32135 | panel.title = title;
|
32136 | }
|
32137 | if (styleBackground) {
|
32138 | panel.styleBackground = styleBackground;
|
32139 | }
|
32140 | if (width) {
|
32141 | panel.width = width;
|
32142 | }
|
32143 |
|
32144 | nextPanels.byId = _extends({}, nextPanels.byId, defineProperty({}, route.panelId, panel));
|
32145 |
|
32146 | var nextPosition = void 0;
|
32147 | if (maxWidth || width) {
|
32148 | nextPosition = getNextPosition({
|
32149 | context: router.context,
|
32150 | focus: router.focus,
|
32151 | maxFullPanelWidth: runtime.maxFullPanelWidth,
|
32152 | routes: router.routes,
|
32153 | panels: nextPanels,
|
32154 | shouldGoMobile: runtime.shouldGoMobile,
|
32155 | viewportWidth: runtime.viewportWidth
|
32156 | });
|
32157 | }
|
32158 |
|
32159 | dispatch({
|
32160 | type: UPDATE_SETTINGS,
|
32161 | payload: {
|
32162 | nextPanelsById: nextPanels.byId,
|
32163 | nextPosition: nextPosition
|
32164 | }
|
32165 | });
|
32166 | };
|
32167 | }
|
32168 |
|
32169 | var notify = (function (store) {
|
32170 | return function (next) {
|
32171 | return function (action) {
|
32172 | if (action.type === NAVIGATE) {
|
32173 | var _store$getState = store.getState(),
|
32174 | apps = _store$getState.apps;
|
32175 |
|
32176 | apps.items.forEach(function (name) {
|
32177 | var app = apps.byName[name];
|
32178 |
|
32179 | if (typeof app.notify === 'function') {
|
32180 | app.notify({
|
32181 | type: 'NAVIGATE',
|
32182 | payload: {
|
32183 | uri: action.meta.uri
|
32184 | }
|
32185 | });
|
32186 | }
|
32187 | });
|
32188 | }
|
32189 |
|
32190 | return next(action);
|
32191 | };
|
32192 | };
|
32193 | });
|
32194 |
|
32195 |
|
32196 |
|
32197 |
|
32198 |
|
32199 | function isPromise(val) {
|
32200 | return val && typeof val.then === 'function';
|
32201 | }
|
32202 |
|
32203 | function promiseMiddleware(_ref) {
|
32204 | var dispatch = _ref.dispatch;
|
32205 |
|
32206 | return function (next) {
|
32207 | return function (action) {
|
32208 | if (isPromise(action.payload)) {
|
32209 | var sequenceId = uniqueId();
|
32210 |
|
32211 | dispatch(_extends({}, action, {
|
32212 | payload: undefined,
|
32213 | sequence: {
|
32214 | type: 'start',
|
32215 | id: sequenceId
|
32216 | }
|
32217 | }));
|
32218 |
|
32219 | return action.payload.then(function (result) {
|
32220 | return dispatch(_extends({}, action, {
|
32221 | payload: result,
|
32222 | sequence: {
|
32223 | type: 'next',
|
32224 | id: sequenceId
|
32225 | }
|
32226 | }));
|
32227 | }, function (error) {
|
32228 | return dispatch(_extends({}, action, {
|
32229 | payload: error,
|
32230 | error: true,
|
32231 | sequence: {
|
32232 | type: 'next',
|
32233 | id: sequenceId
|
32234 | }
|
32235 | }));
|
32236 | });
|
32237 | }
|
32238 |
|
32239 | return next(action);
|
32240 | };
|
32241 | };
|
32242 | }
|
32243 |
|
32244 | var MOVE_LEFT = 'panels/runtime/MOVE_LEFT';
|
32245 | function moveLeft() {
|
32246 | return function moveLeftThunk(dispatch, getState) {
|
32247 | var _getState = getState(),
|
32248 | runtime = _getState.runtime;
|
32249 |
|
32250 | if (runtime.snappedAt > 0) {
|
32251 | var nextSnappedAt = runtime.snappedAt - 1;
|
32252 |
|
32253 | dispatch({
|
32254 | type: MOVE_LEFT,
|
32255 | payload: {
|
32256 | snappedAt: nextSnappedAt,
|
32257 | x: runtime.x - runtime.widths[nextSnappedAt]
|
32258 | }
|
32259 | });
|
32260 | }
|
32261 | };
|
32262 | }
|
32263 |
|
32264 | var MOVE_TO = 'panels/runtime/MOVE_TO';
|
32265 | var MOBILE_THRESHOLD$1 = 720;
|
32266 |
|
32267 | var SET_VIEWPORT_WIDTH = 'panels/runtime/SET_VIEWPORT_WIDTH';
|
32268 | function setViewportWidth(viewportWidth) {
|
32269 | return function setViewportWidthThunk(dispatch, getState) {
|
32270 | var _getState3 = getState(),
|
32271 | panels = _getState3.panels,
|
32272 | router = _getState3.router,
|
32273 | runtime = _getState3.runtime;
|
32274 |
|
32275 | var shouldGoMobile = viewportWidth <= MOBILE_THRESHOLD$1;
|
32276 | var snapPoint = shouldGoMobile ? 0 : runtime.preferredSnapPoint;
|
32277 | var maxFullPanelWidth = viewportWidth - snapPoint;
|
32278 |
|
32279 | var nextPosition = getNextPosition({
|
32280 | context: router.context,
|
32281 | focus: router.focus,
|
32282 | maxFullPanelWidth: maxFullPanelWidth,
|
32283 | routes: router.routes,
|
32284 | panels: panels,
|
32285 | shouldGoMobile: shouldGoMobile,
|
32286 | viewportWidth: viewportWidth
|
32287 | });
|
32288 |
|
32289 | dispatch({
|
32290 | type: SET_VIEWPORT_WIDTH,
|
32291 | payload: _extends({
|
32292 | maxFullPanelWidth: maxFullPanelWidth,
|
32293 | shouldGoMobile: shouldGoMobile,
|
32294 | snapPoint: snapPoint,
|
32295 | viewportWidth: viewportWidth
|
32296 | }, nextPosition)
|
32297 | });
|
32298 | };
|
32299 | }
|
32300 |
|
32301 | var SET_X = 'panels/runtime/SET_X';
|
32302 | function setX(fromX) {
|
32303 | return function setXThunk(dispatch, getState) {
|
32304 | var _getState4 = getState(),
|
32305 | runtime = _getState4.runtime;
|
32306 |
|
32307 | var snappedAt = getIndexOfPanelToShow(fromX, runtime.regions);
|
32308 | var x = runtime.widths.slice(0, snappedAt).reduce(function (a, b) {
|
32309 | return a + b;
|
32310 | }, 0);
|
32311 |
|
32312 | if (x === fromX) {
|
32313 | if (runtime.x !== x) {
|
32314 | dispatch({
|
32315 | type: SET_X,
|
32316 | payload: {
|
32317 | snappedAt: snappedAt,
|
32318 | x: x
|
32319 | }
|
32320 | });
|
32321 | }
|
32322 | } else {
|
32323 |
|
32324 |
|
32325 | dispatch({
|
32326 | type: SET_X,
|
32327 | payload: {
|
32328 | snappedAt: snappedAt,
|
32329 | x: fromX
|
32330 | }
|
32331 | });
|
32332 |
|
32333 | dispatch({
|
32334 | type: SET_X,
|
32335 | payload: {
|
32336 | snappedAt: snappedAt,
|
32337 | x: x
|
32338 | }
|
32339 | });
|
32340 | }
|
32341 | };
|
32342 | }
|
32343 |
|
32344 | function getViewportWidth() {
|
32345 | return Math.max(window.document.documentElement.clientWidth, window.innerWidth || 0);
|
32346 | }
|
32347 |
|
32348 | function apps() {
|
32349 | var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { byName: {}, items: [] };
|
32350 | var action = arguments[1];
|
32351 |
|
32352 | if (action.type === NAVIGATE && action.sequence.type === 'next' && action.payload.apps.items.length) {
|
32353 | return {
|
32354 | byName: _extends({}, state.byName, action.payload.apps.byName),
|
32355 | items: [].concat(toConsumableArray(state.items), toConsumableArray(action.payload.apps.items))
|
32356 | };
|
32357 | } else {
|
32358 | return state;
|
32359 | }
|
32360 | }
|
32361 |
|
32362 | function panels() {
|
32363 | var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { byId: {}, items: [] };
|
32364 | var action = arguments[1];
|
32365 |
|
32366 | if (action.type === NAVIGATE && action.sequence.type === 'next' && action.payload.panels.items.length) {
|
32367 | return {
|
32368 | byId: _extends({}, state.byId, action.payload.panels.byId),
|
32369 | items: [].concat(toConsumableArray(state.items), toConsumableArray(action.payload.panels.items))
|
32370 | };
|
32371 | } else if (action.type === UPDATE_SETTINGS) {
|
32372 | return _extends({}, state, {
|
32373 | byId: action.payload.nextPanelsById
|
32374 | });
|
32375 | } else {
|
32376 | return state;
|
32377 | }
|
32378 | }
|
32379 |
|
32380 | function router() {
|
32381 | var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { isLoading: true, routes: { byContext: {}, items: [] } };
|
32382 | var action = arguments[1];
|
32383 |
|
32384 | switch (action.type) {
|
32385 | case NAVIGATE:
|
32386 | if (action.sequence.type === 'start') {
|
32387 | return _extends({}, state, {
|
32388 | isLoading: true,
|
32389 | uri: action.meta.uri
|
32390 | });
|
32391 | } else if (action.sequence.type === 'next') {
|
32392 | return _extends({}, state, action.payload.router, {
|
32393 | isLoading: false
|
32394 | });
|
32395 | }
|
32396 | break;
|
32397 |
|
32398 | case SET_VIEWPORT_WIDTH:
|
32399 | case TOGGLE_EXPAND:
|
32400 | return _extends({}, state, {
|
32401 | routes: {
|
32402 | items: state.routes.items,
|
32403 | byContext: action.payload.routesByContext
|
32404 | }
|
32405 | });
|
32406 | break;
|
32407 |
|
32408 | case UPDATE_SETTINGS:
|
32409 | if (action.payload.nextPosition) {
|
32410 | return _extends({}, state, {
|
32411 | routes: {
|
32412 | items: state.routes.items,
|
32413 | byContext: action.payload.nextPosition.routesByContext
|
32414 | }
|
32415 | });
|
32416 | } else {
|
32417 | return state;
|
32418 | }
|
32419 | break;
|
32420 |
|
32421 | default:
|
32422 | return state;
|
32423 | }
|
32424 | }
|
32425 |
|
32426 | var MOBILE_THRESHOLD = 720;
|
32427 |
|
32428 |
|
32429 | var preferredSnapPoint = window.panels && typeof window.panels.preferredSnapPoint === 'number' ? window.panels.preferredSnapPoint : 90;
|
32430 | var viewportWidth = getViewportWidth();
|
32431 | var shouldGoMobile = viewportWidth < MOBILE_THRESHOLD;
|
32432 | var snapPoint = shouldGoMobile ? 0 : preferredSnapPoint;
|
32433 |
|
32434 | var RUNTIME_DEFAULT_STATE = {
|
32435 | maxFullPanelWidth: viewportWidth - snapPoint,
|
32436 | preferredSnapPoint: preferredSnapPoint,
|
32437 | snappedAt: 0,
|
32438 | snapPoint: snapPoint,
|
32439 | shouldGoMobile: shouldGoMobile,
|
32440 | x: 0,
|
32441 | viewportWidth: viewportWidth,
|
32442 | width: viewportWidth,
|
32443 | widths: []
|
32444 | };
|
32445 |
|
32446 | function runtime() {
|
32447 | var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : RUNTIME_DEFAULT_STATE;
|
32448 | var action = arguments[1];
|
32449 |
|
32450 | switch (action.type) {
|
32451 |
|
32452 | case MOVE_LEFT:
|
32453 | case MOVE_TO:
|
32454 | case SET_X:
|
32455 | return _extends({}, state, {
|
32456 | snappedAt: action.payload.snappedAt,
|
32457 | x: action.payload.x
|
32458 | });
|
32459 | break;
|
32460 |
|
32461 | case NAVIGATE:
|
32462 | if (action.sequence.type === 'next') {
|
32463 | return _extends({}, state, {
|
32464 | maxFullPanelWidth: action.payload.runtime.maxFullPanelWidth,
|
32465 | regions: action.payload.runtime.regions,
|
32466 | snappedAt: action.payload.runtime.snappedAt,
|
32467 | width: action.payload.runtime.width,
|
32468 | widths: action.payload.runtime.widths,
|
32469 | x: action.payload.runtime.x
|
32470 | });
|
32471 | } else {
|
32472 | return state;
|
32473 | }
|
32474 | break;
|
32475 |
|
32476 | case SET_VIEWPORT_WIDTH:
|
32477 | return _extends({}, state, {
|
32478 | maxFullPanelWidth: action.payload.maxFullPanelWidth,
|
32479 | shouldGoMobile: action.payload.shouldGoMobile,
|
32480 | snapPoint: action.payload.snapPoint,
|
32481 | viewportWidth: action.payload.viewportWidth,
|
32482 | width: action.payload.width,
|
32483 | widths: action.payload.widths,
|
32484 | x: action.payload.x
|
32485 | });
|
32486 | break;
|
32487 |
|
32488 | case TOGGLE_EXPAND:
|
32489 | return _extends({}, state, {
|
32490 | width: action.payload.width,
|
32491 | widths: action.payload.widths,
|
32492 | x: action.payload.x
|
32493 | });
|
32494 | break;
|
32495 |
|
32496 | case UPDATE_SETTINGS:
|
32497 | if (action.payload.nextPosition) {
|
32498 | return _extends({}, state, {
|
32499 | width: action.payload.nextPosition.width,
|
32500 | widths: action.payload.nextPosition.widths,
|
32501 | x: action.payload.nextPosition.x
|
32502 | });
|
32503 | } else {
|
32504 | return state;
|
32505 | }
|
32506 | break;
|
32507 |
|
32508 | default:
|
32509 | return state;
|
32510 | }
|
32511 | }
|
32512 |
|
32513 | var rootReducer = redux.combineReducers({
|
32514 | apps: apps,
|
32515 | panels: panels,
|
32516 | router: router,
|
32517 | runtime: runtime
|
32518 | });
|
32519 |
|
32520 | var loggerMiddleware = createLogger({
|
32521 | collapsed: true,
|
32522 | duration: true
|
32523 | });
|
32524 |
|
32525 | var middleware = redux.applyMiddleware(thunkMiddleware, promiseMiddleware, loggerMiddleware, notify);
|
32526 |
|
32527 | function configureStore(state) {
|
32528 | return redux.createStore(rootReducer, state, middleware);
|
32529 | }
|
32530 |
|
32531 | var _jsxFileName$2 = '/Users/dario/opensource/panels/runtime/base-style.js';
|
32532 | var _this = undefined;
|
32533 | var BaseStyle = (function (props) {
|
32534 | return React__default.createElement(
|
32535 | 'style',
|
32536 | {
|
32537 | __source: {
|
32538 | fileName: _jsxFileName$2,
|
32539 | lineNumber: 4
|
32540 | },
|
32541 | __self: _this
|
32542 | },
|
32543 | '\n * {\n -webkit-overflow-scrolling: touch;\n }\n html,body,#root {\n height:100%;\n margin:0;\n }\n a,button,div,img,input,form,h1,h2,h3,h4,h5,h6,h7,nav,label,li,ol,p,span,svg,ul {\n box-sizing: border-box;\n position: relative;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-align: stretch;\n -ms-flex-align: stretch;\n align-items: stretch;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n margin: 0;\n padding: 0;\n }\n button,a {\n background-color: transparent;\n border: 0;\n margin: 0;\n padding: 0;\n white-space: normal;\n line-height: inherit;\n text-align: left;\n font-family: inherit;\n font-size: inherit;\n }\n button::-moz-focus-inner {\n border: 0;\n margin: 0;\n padding: 0;\n }\n '
|
32544 | );
|
32545 | });
|
32546 |
|
32547 | var _jsxFileName$5 = '/Users/dario/opensource/panels/blocks/teleport.js';
|
32548 | var Teleport = function (_React$Component) {
|
32549 | inherits(Teleport, _React$Component);
|
32550 |
|
32551 | function Teleport(props, context) {
|
32552 | classCallCheck(this, Teleport);
|
32553 |
|
32554 | var _this = possibleConstructorReturn(this, (Teleport.__proto__ || Object.getPrototypeOf(Teleport)).call(this, props, context));
|
32555 |
|
32556 | _this.className = 'Teleport-' + uniqueId();
|
32557 | return _this;
|
32558 | }
|
32559 |
|
32560 | createClass(Teleport, [{
|
32561 | key: 'render',
|
32562 | value: function render() {
|
32563 | var className = this.className;
|
32564 | var _props = this.props,
|
32565 | context = _props.context,
|
32566 | children = _props.children,
|
32567 | focus = _props.focus,
|
32568 | loose = _props.loose,
|
32569 | onClick = _props.onClick,
|
32570 | _ref = _props._ref,
|
32571 | style = _props.style,
|
32572 | styleActive = _props.styleActive,
|
32573 | styleActiveHover = _props.styleActiveHover,
|
32574 | styleHover = _props.styleHover,
|
32575 | title = _props.title,
|
32576 | to = _props.to,
|
32577 | rest = objectWithoutProperties(_props, ['context', 'children', 'focus', 'loose', 'onClick', '_ref', 'style', 'styleActive', 'styleActiveHover', 'styleHover', 'title', 'to']);
|
32578 | var _context = this.context,
|
32579 | isActive = _context.isActive,
|
32580 | navigate = _context.navigate,
|
32581 | route = _context.route;
|
32582 |
|
32583 | var active = isActive(to, loose);
|
32584 | var href = normaliseUri('' + route.context + to);
|
32585 |
|
32586 | var inlineStyle = '';
|
32587 | if (!active && styleHover) {
|
32588 | inlineStyle = '.' + className + ':hover {' + toCSS(styleHover) + '}';
|
32589 | }
|
32590 | if (active && styleActiveHover) {
|
32591 | inlineStyle = '.' + className + ':hover {' + toCSS(styleActiveHover) + '}';
|
32592 | }
|
32593 | var finalStyle = active ? _extends({}, style, styleActive) : style;
|
32594 |
|
32595 | var finalOnClick = function finalOnClick(event) {
|
32596 | event.preventDefault();
|
32597 | var preventNavigate = false;
|
32598 |
|
32599 | if (typeof onClick === 'function') {
|
32600 | preventNavigate = onClick(event);
|
32601 | }
|
32602 |
|
32603 | if (preventNavigate !== true) {
|
32604 | navigate(to, focus, context);
|
32605 | }
|
32606 | };
|
32607 |
|
32608 | if (_ref) {
|
32609 | rest.ref = _ref;
|
32610 | }
|
32611 |
|
32612 | return React__default.createElement(
|
32613 | 'a',
|
32614 | _extends({}, rest, {
|
32615 | className: className,
|
32616 | href: href,
|
32617 | onClick: finalOnClick,
|
32618 | style: finalStyle,
|
32619 | title: title,
|
32620 | __source: {
|
32621 | fileName: _jsxFileName$5,
|
32622 | lineNumber: 61
|
32623 | },
|
32624 | __self: this
|
32625 | }),
|
32626 | React__default.createElement(
|
32627 | 'style',
|
32628 | {
|
32629 | __source: {
|
32630 | fileName: _jsxFileName$5,
|
32631 | lineNumber: 69
|
32632 | },
|
32633 | __self: this
|
32634 | },
|
32635 | inlineStyle
|
32636 | ),
|
32637 | children
|
32638 | );
|
32639 | }
|
32640 | }]);
|
32641 | return Teleport;
|
32642 | }(React__default.Component);
|
32643 |
|
32644 | Teleport.contextTypes = {
|
32645 | isActive: PropTypes.func.isRequired,
|
32646 | navigate: PropTypes.func.isRequired,
|
32647 | route: PropTypes.shape({
|
32648 | context: PropTypes.string.isRequired
|
32649 | }).isRequired
|
32650 | };
|
32651 |
|
32652 | var _jsxFileName$6 = '/Users/dario/opensource/panels/blocks/go-to.js';
|
32653 | var GoTo = function (_React$Component) {
|
32654 | inherits(GoTo, _React$Component);
|
32655 |
|
32656 | function GoTo() {
|
32657 | classCallCheck(this, GoTo);
|
32658 | return possibleConstructorReturn(this, (GoTo.__proto__ || Object.getPrototypeOf(GoTo)).apply(this, arguments));
|
32659 | }
|
32660 |
|
32661 | createClass(GoTo, [{
|
32662 | key: 'render',
|
32663 | value: function render() {
|
32664 | var _props = this.props,
|
32665 | children = _props.children,
|
32666 | className = _props.className,
|
32667 | _ref = _props._ref,
|
32668 | styleActive = _props.styleActive,
|
32669 | styleHover = _props.styleHover,
|
32670 | props = objectWithoutProperties(_props, ['children', 'className', '_ref', 'styleActive', 'styleHover']);
|
32671 |
|
32672 |
|
32673 | var inlineStyle = null;
|
32674 | if (Object.keys(styleHover).length) {
|
32675 | inlineStyle = React__default.createElement(
|
32676 | 'style',
|
32677 | {
|
32678 | __source: {
|
32679 | fileName: _jsxFileName$6,
|
32680 | lineNumber: 19
|
32681 | },
|
32682 | __self: this
|
32683 | },
|
32684 | '.' + className + ':hover {' + toCSS(styleHover) + '}'
|
32685 | );
|
32686 | }
|
32687 |
|
32688 | if (_ref) {
|
32689 | props.ref = _ref;
|
32690 | }
|
32691 |
|
32692 | return React__default.createElement(
|
32693 | 'a',
|
32694 | _extends({}, props, { className: className, target: '_blank', __source: {
|
32695 | fileName: _jsxFileName$6,
|
32696 | lineNumber: 28
|
32697 | },
|
32698 | __self: this
|
32699 | }),
|
32700 | inlineStyle,
|
32701 | children
|
32702 | );
|
32703 | }
|
32704 | }]);
|
32705 | return GoTo;
|
32706 | }(React__default.Component);
|
32707 |
|
32708 | var _jsxFileName$7 = '/Users/dario/opensource/panels/blocks/on-click.js';
|
32709 | var OnClick = function (_React$Component) {
|
32710 | inherits(OnClick, _React$Component);
|
32711 |
|
32712 | function OnClick() {
|
32713 | var _ref2;
|
32714 |
|
32715 | var _temp, _this, _ret;
|
32716 |
|
32717 | classCallCheck(this, OnClick);
|
32718 |
|
32719 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
32720 | args[_key] = arguments[_key];
|
32721 | }
|
32722 |
|
32723 | return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref2 = OnClick.__proto__ || Object.getPrototypeOf(OnClick)).call.apply(_ref2, [this].concat(args))), _this), _this.state = {}, _temp), possibleConstructorReturn(_this, _ret);
|
32724 | }
|
32725 |
|
32726 | createClass(OnClick, [{
|
32727 | key: 'componentWillMount',
|
32728 | value: function componentWillMount() {
|
32729 | var props = this.props;
|
32730 |
|
32731 |
|
32732 | var manualActive = typeof props.isActive === 'boolean';
|
32733 | this.setState({
|
32734 | isActive: manualActive ? props.isActive : false,
|
32735 | manualActive: manualActive
|
32736 | });
|
32737 |
|
32738 | this.bindOnClick(props.onClick);
|
32739 | }
|
32740 | }, {
|
32741 | key: 'componentWillReceiveProps',
|
32742 | value: function componentWillReceiveProps(nextProps) {
|
32743 | this.bindOnClick(nextProps.onClick);
|
32744 |
|
32745 | var manualActive = typeof nextProps.isActive === 'boolean';
|
32746 |
|
32747 | if (manualActive) {
|
32748 | this.setState({
|
32749 | isActive: nextProps.isActive,
|
32750 | manualActive: manualActive
|
32751 | });
|
32752 | }
|
32753 | }
|
32754 | }, {
|
32755 | key: 'componentWillUnmount',
|
32756 | value: function componentWillUnmount() {
|
32757 | if (this.onClickTimeout) {
|
32758 | clearTimeout(this.onClickTimeout);
|
32759 | }
|
32760 | }
|
32761 | }, {
|
32762 | key: 'bindOnClick',
|
32763 | value: function bindOnClick(onClick) {
|
32764 | var _this2 = this;
|
32765 |
|
32766 | var context = this.context;
|
32767 |
|
32768 |
|
32769 |
|
32770 | var finalOnClick = void 0;
|
32771 | if (typeof onClick === 'function') {
|
32772 | finalOnClick = function finalOnClick() {
|
32773 | try {
|
32774 | onClick();
|
32775 | } catch (err) {
|
32776 | var match = err.message.match(/props\.(.+) is not a function/);
|
32777 | if (match) {
|
32778 | context.transitionTo(match[1].trim(), true);
|
32779 | }
|
32780 | }
|
32781 | };
|
32782 | } else {
|
32783 | var match = void 0;
|
32784 | if (typeof onClick === 'string') {
|
32785 | match = onClick.match(/transitionTo\((.+)\)/);
|
32786 | }
|
32787 | if (match && typeof context.transitionTo === 'function') {
|
32788 | finalOnClick = function finalOnClick() {
|
32789 | return context.transitionTo(match[1].trim());
|
32790 | };
|
32791 | } else {
|
32792 | finalOnClick = function finalOnClick() {
|
32793 | return console.log(onClick);
|
32794 | };
|
32795 | }
|
32796 | }
|
32797 |
|
32798 | this.onClick = function (event) {
|
32799 | finalOnClick(event);
|
32800 |
|
32801 | event.stopPropagation();
|
32802 |
|
32803 | if (!_this2.state.manualActive) {
|
32804 | _this2.setState({
|
32805 | isActive: true
|
32806 | });
|
32807 |
|
32808 | _this2.onClickTimeout = setTimeout(function () {
|
32809 | _this2.setState({
|
32810 | isActive: false
|
32811 | });
|
32812 | _this2.onClickTimeout = null;
|
32813 | }, _this2.props.styleActiveTimeout);
|
32814 | }
|
32815 | };
|
32816 | }
|
32817 | }, {
|
32818 | key: 'render',
|
32819 | value: function render() {
|
32820 | var context = this.context;
|
32821 | var isActive = this.state.isActive;
|
32822 |
|
32823 |
|
32824 | var _props = this.props,
|
32825 | ariaLabel = _props['aria-label'],
|
32826 | children = _props.children,
|
32827 | className = _props.className,
|
32828 | _isActive = _props.isActive,
|
32829 | isDisabled = _props.isDisabled,
|
32830 | _ref = _props._ref,
|
32831 | style = _props.style,
|
32832 | styleActive = _props.styleActive,
|
32833 | styleActiveHover = _props.styleActiveHover,
|
32834 | styleActiveTimeout = _props.styleActiveTimeout,
|
32835 | styleDisabled = _props.styleDisabled,
|
32836 | styleHover = _props.styleHover,
|
32837 | rest = objectWithoutProperties(_props, ['aria-label', 'children', 'className', 'isActive', 'isDisabled', '_ref', 'style', 'styleActive', 'styleActiveHover', 'styleActiveTimeout', 'styleDisabled', 'styleHover']);
|
32838 |
|
32839 |
|
32840 | var inlineStyle = null;
|
32841 | if (!isDisabled) {
|
32842 | rest.onClick = this.onClick;
|
32843 |
|
32844 | var fClass = className.split(' ')[0];
|
32845 | if (!isActive && styleHover) {
|
32846 | inlineStyle = React__default.createElement(
|
32847 | 'style',
|
32848 | {
|
32849 | __source: {
|
32850 | fileName: _jsxFileName$7,
|
32851 | lineNumber: 114
|
32852 | },
|
32853 | __self: this
|
32854 | },
|
32855 | '.' + fClass + ':hover {' + toCSS(styleHover) + '}'
|
32856 | );
|
32857 | }
|
32858 | if (isActive && styleActiveHover) {
|
32859 | inlineStyle = React__default.createElement(
|
32860 | 'style',
|
32861 | {
|
32862 | __source: {
|
32863 | fileName: _jsxFileName$7,
|
32864 | lineNumber: 119
|
32865 | },
|
32866 | __self: this
|
32867 | },
|
32868 | '.' + fClass + ':hover {' + toCSS(styleActiveHover) + '}'
|
32869 | );
|
32870 | }
|
32871 | }
|
32872 |
|
32873 | var finalStyle = _extends({
|
32874 | cursor: 'pointer'
|
32875 | }, style);
|
32876 | if (isDisabled) {
|
32877 | finalStyle = _extends({}, finalStyle, {
|
32878 | cursor: 'default'
|
32879 | }, styleDisabled);
|
32880 | } else if (isActive) {
|
32881 | finalStyle = _extends({}, finalStyle, styleActive);
|
32882 | }
|
32883 |
|
32884 | if (_ref) {
|
32885 | rest.ref = _ref;
|
32886 | }
|
32887 |
|
32888 | return React__default.createElement(
|
32889 | 'button',
|
32890 | _extends({}, rest, {
|
32891 | 'aria-label': ariaLabel ? context.i18n ? context.i18n.t(ariaLabel) : ariaLabel : undefined,
|
32892 | className: className,
|
32893 | style: finalStyle, __source: {
|
32894 | fileName: _jsxFileName$7,
|
32895 | lineNumber: 146
|
32896 | },
|
32897 | __self: this
|
32898 | }),
|
32899 | inlineStyle,
|
32900 | children
|
32901 | );
|
32902 | }
|
32903 | }]);
|
32904 | return OnClick;
|
32905 | }(React__default.Component);
|
32906 |
|
32907 | OnClick.contextTypes = {
|
32908 | i18n: PropTypes.shape({
|
32909 | t: PropTypes.func.isRequired
|
32910 | }),
|
32911 | transitionTo: PropTypes.func
|
32912 | };
|
32913 | OnClick.defaultProps = {
|
32914 | styleActiveTimeout: 1000
|
32915 | };
|
32916 |
|
32917 | var _jsxFileName$4 = '/Users/dario/opensource/panels/blocks/create-group.js';
|
32918 | function createGroup(name, groupStyle) {
|
32919 | var Group = function (_React$Component) {
|
32920 | inherits(Group, _React$Component);
|
32921 |
|
32922 | function Group(props, context) {
|
32923 | classCallCheck(this, Group);
|
32924 |
|
32925 | var _this = possibleConstructorReturn(this, (Group.__proto__ || Object.getPrototypeOf(Group)).call(this, props, context));
|
32926 |
|
32927 | _this.localClassName = name + '-' + uniqueId();
|
32928 | return _this;
|
32929 | }
|
32930 |
|
32931 | createClass(Group, [{
|
32932 | key: 'render',
|
32933 | value: function render() {
|
32934 | var _props = this.props,
|
32935 | children = _props.children,
|
32936 | moreClassName = _props.className,
|
32937 | goTo = _props.goTo,
|
32938 | style = _props.style,
|
32939 | teleportTo = _props.teleportTo,
|
32940 | props = objectWithoutProperties(_props, ['children', 'className', 'goTo', 'style', 'teleportTo']);
|
32941 | var localClassName = this.localClassName;
|
32942 | var pages = this.context.pages;
|
32943 |
|
32944 |
|
32945 | var finalStyle = _extends({}, groupStyle, style);
|
32946 |
|
32947 | var className = localClassName;
|
32948 | if (typeof moreClassName === 'string') {
|
32949 | className += ' ' + moreClassName;
|
32950 | }
|
32951 |
|
32952 | var Base = void 0;
|
32953 | if (teleportTo) {
|
32954 | Base = Teleport;
|
32955 | props.to = teleportTo;
|
32956 | } else if (goTo) {
|
32957 | Base = GoTo;
|
32958 | props.href = goTo;
|
32959 | } else if ((props.onClick || props.onMouseDown || props.onMouseUp) && !props.noButton) {
|
32960 | Base = OnClick;
|
32961 | } else {
|
32962 | var isDisabled = props.isDisabled,
|
32963 | noButton = props.noButton,
|
32964 | _ref = props._ref,
|
32965 | styleDisabled = props.styleDisabled,
|
32966 | styleActive = props.styleActive,
|
32967 | styleActiveHover = props.styleActiveHover,
|
32968 | styleActiveTimeout = props.styleActiveTimeout,
|
32969 | styleHover = props.styleHover,
|
32970 | rest = objectWithoutProperties(props, ['isDisabled', 'noButton', '_ref', 'styleDisabled', 'styleActive', 'styleActiveHover', 'styleActiveTimeout', 'styleHover']);
|
32971 |
|
32972 |
|
32973 | var inlineStyle = null;
|
32974 | if (isDisabled) {
|
32975 | if (styleDisabled) {
|
32976 | finalStyle = _extends({}, finalStyle, styleDisabled);
|
32977 | }
|
32978 | } else {
|
32979 | if (Object.keys(styleHover).length) {
|
32980 | inlineStyle = React__default.createElement(
|
32981 | 'style',
|
32982 | {
|
32983 | __source: {
|
32984 | fileName: _jsxFileName$4,
|
32985 | lineNumber: 75
|
32986 | },
|
32987 | __self: this
|
32988 | },
|
32989 | '.' + localClassName + ':hover {' + toCSS(styleHover) + '}'
|
32990 | );
|
32991 | }
|
32992 | }
|
32993 |
|
32994 | return React__default.createElement(
|
32995 | 'div',
|
32996 | _extends({}, rest, { className: className, ref: _ref, style: finalStyle, __source: {
|
32997 | fileName: _jsxFileName$4,
|
32998 | lineNumber: 81
|
32999 | },
|
33000 | __self: this
|
33001 | }),
|
33002 | inlineStyle,
|
33003 | children
|
33004 | );
|
33005 | }
|
33006 |
|
33007 | if (pages && pages.isSelecting) {
|
33008 | props.onClick = function (event) {
|
33009 | if (event) {
|
33010 | event.preventDefault();
|
33011 | }
|
33012 | return true;
|
33013 | };
|
33014 | }
|
33015 |
|
33016 | return React__default.createElement(
|
33017 | Base,
|
33018 | _extends({}, props, { className: className, style: finalStyle, __source: {
|
33019 | fileName: _jsxFileName$4,
|
33020 | lineNumber: 98
|
33021 | },
|
33022 | __self: this
|
33023 | }),
|
33024 | children
|
33025 | );
|
33026 | }
|
33027 | }]);
|
33028 | return Group;
|
33029 | }(React__default.Component);
|
33030 |
|
33031 | Group.contextTypes = {
|
33032 | pages: PropTypes.shape({
|
33033 | isSelecting: PropTypes.bool
|
33034 | })
|
33035 | };
|
33036 |
|
33037 | Group.defaultProps = {
|
33038 | className: '',
|
33039 | style: {},
|
33040 | styleActive: {},
|
33041 | styleHover: {}
|
33042 | };
|
33043 |
|
33044 | Group.displayName = name;
|
33045 |
|
33046 | return Group;
|
33047 | }
|
33048 |
|
33049 | var Horizontal = createGroup('Horizontal', { flexDirection: 'row' });
|
33050 |
|
33051 | var _jsxFileName$3 = '/Users/dario/opensource/panels/blocks/knocking.js';
|
33052 | var _this$1 = undefined;
|
33053 | var animation = '@keyframes scaleout {\n 0% {\n transform: scale(0.0);\n -webkit-transform: scale(0.0);\n } 100% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n opacity: 0;\n }\n}';
|
33054 |
|
33055 | var Knocking = function Knocking(_ref) {
|
33056 | var dataBlock = _ref['data-block'],
|
33057 | size = _ref.size,
|
33058 | _ref$style = _ref.style,
|
33059 | style = _ref$style === undefined ? {} : _ref$style;
|
33060 |
|
33061 | var finalStyle = _extends({
|
33062 | animation: 'scaleout 1.0s infinite linear',
|
33063 | backgroundColor: style.color,
|
33064 | borderRadius: size,
|
33065 | height: size,
|
33066 | WebkitAnimation: 'scaleout 1.0s infinite linear',
|
33067 | width: size
|
33068 | }, style);
|
33069 |
|
33070 | return React__default.createElement(
|
33071 | Horizontal,
|
33072 | { 'data-block': dataBlock, style: finalStyle, __source: {
|
33073 | fileName: _jsxFileName$3,
|
33074 | lineNumber: 27
|
33075 | },
|
33076 | __self: _this$1
|
33077 | },
|
33078 | React__default.createElement(
|
33079 | 'style',
|
33080 | {
|
33081 | __source: {
|
33082 | fileName: _jsxFileName$3,
|
33083 | lineNumber: 28
|
33084 | },
|
33085 | __self: _this$1
|
33086 | },
|
33087 | animation
|
33088 | )
|
33089 | );
|
33090 | };
|
33091 |
|
33092 | Knocking.defaultProps = {
|
33093 | style: {
|
33094 | color: '#323232'
|
33095 | },
|
33096 | size: 32
|
33097 | };
|
33098 |
|
33099 | var _jsxFileName$9 = '/Users/dario/opensource/panels/error-boundary.js';
|
33100 | var ErrorBoundary = function (_React$Component) {
|
33101 | inherits(ErrorBoundary, _React$Component);
|
33102 |
|
33103 | function ErrorBoundary() {
|
33104 | var _ref;
|
33105 |
|
33106 | var _temp, _this, _ret;
|
33107 |
|
33108 | classCallCheck(this, ErrorBoundary);
|
33109 |
|
33110 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
33111 | args[_key] = arguments[_key];
|
33112 | }
|
33113 |
|
33114 | return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = ErrorBoundary.__proto__ || Object.getPrototypeOf(ErrorBoundary)).call.apply(_ref, [this].concat(args))), _this), _this.state = { hasError: false }, _temp), possibleConstructorReturn(_this, _ret);
|
33115 | }
|
33116 |
|
33117 | createClass(ErrorBoundary, [{
|
33118 | key: 'componentDidCatch',
|
33119 | value: function componentDidCatch(error, info) {
|
33120 |
|
33121 | this.setState({ hasError: true });
|
33122 | }
|
33123 | }, {
|
33124 | key: 'render',
|
33125 | value: function render() {
|
33126 | if (this.state.hasError) {
|
33127 | return React__default.createElement(
|
33128 | 'div',
|
33129 | {
|
33130 | __source: {
|
33131 | fileName: _jsxFileName$9,
|
33132 | lineNumber: 13
|
33133 | },
|
33134 | __self: this
|
33135 | },
|
33136 | ':/'
|
33137 | );
|
33138 | }
|
33139 |
|
33140 | return this.props.children;
|
33141 | }
|
33142 | }]);
|
33143 | return ErrorBoundary;
|
33144 | }(React__default.Component);
|
33145 |
|
33146 | var _jsxFileName$8 = '/Users/dario/opensource/panels/route.js';
|
33147 | var Route$1 = function (_React$Component) {
|
33148 | inherits(Route, _React$Component);
|
33149 |
|
33150 | function Route() {
|
33151 | var _ref;
|
33152 |
|
33153 | var _temp, _this, _ret;
|
33154 |
|
33155 | classCallCheck(this, Route);
|
33156 |
|
33157 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
33158 | args[_key] = arguments[_key];
|
33159 | }
|
33160 |
|
33161 | return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = Route.__proto__ || Object.getPrototypeOf(Route)).call.apply(_ref, [this].concat(args))), _this), _this.isActive = function (path) {
|
33162 | var _this$props = _this.props,
|
33163 | route = _this$props.route,
|
33164 | router = _this$props.router,
|
33165 | routeIndex = _this$props.routeIndex;
|
33166 |
|
33167 |
|
33168 | var routeAfterContext = router.routes.items[routeIndex + 1];
|
33169 | return routeAfterContext && normaliseUri('' + route.context + path) === routeAfterContext;
|
33170 | }, _this.navigate = function (toUri, focus, context) {
|
33171 | var raw = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
33172 | return _this.props.navigate(raw ? toUri : '' + _this.props.route.context + toUri, focus, context);
|
33173 | }, _this.toggleExpand = function () {
|
33174 | return _this.props.toggleExpand(_this.props.route.context);
|
33175 | }, _this.updateSettings = function (settings) {
|
33176 | return _this.props.updateSettings(_this.props.route.context, settings);
|
33177 | }, _temp), possibleConstructorReturn(_this, _ret);
|
33178 | }
|
33179 |
|
33180 | createClass(Route, [{
|
33181 | key: 'getChildContext',
|
33182 | value: function getChildContext() {
|
33183 | var isActive = this.isActive,
|
33184 | navigate = this.navigate,
|
33185 | toggleExpand = this.toggleExpand,
|
33186 | updateSettings = this.updateSettings;
|
33187 | var _props = this.props,
|
33188 | isContext = _props.isContext,
|
33189 | isFocus = _props.isFocus,
|
33190 | panel = _props.panel,
|
33191 | route = _props.route,
|
33192 | routeIndex = _props.routeIndex,
|
33193 | router = _props.router;
|
33194 |
|
33195 |
|
33196 | return {
|
33197 | isActive: isActive,
|
33198 | isContext: isContext,
|
33199 | isFocus: isFocus,
|
33200 | navigate: navigate,
|
33201 | panel: panel,
|
33202 | route: route,
|
33203 | routeIndex: routeIndex,
|
33204 | router: router,
|
33205 | toggleExpand: toggleExpand,
|
33206 | updateSettings: updateSettings
|
33207 | };
|
33208 | }
|
33209 | }, {
|
33210 | key: 'render',
|
33211 | value: function render() {
|
33212 | var isActive = this.isActive,
|
33213 | navigate = this.navigate,
|
33214 | props = this.props,
|
33215 | toggleExpand = this.toggleExpand,
|
33216 | updateSettings = this.updateSettings;
|
33217 |
|
33218 |
|
33219 | var res = void 0;
|
33220 |
|
33221 | if (props.panel.isCustom) {
|
33222 | res = React__default.createElement(CustomRoute, _extends({}, props, {
|
33223 | __source: {
|
33224 | fileName: _jsxFileName$8,
|
33225 | lineNumber: 53
|
33226 | },
|
33227 | __self: this
|
33228 | }));
|
33229 | } else {
|
33230 | var Type = props.Type,
|
33231 | width = props.width,
|
33232 | rest = objectWithoutProperties(props, ['Type', 'width']);
|
33233 |
|
33234 |
|
33235 |
|
33236 | res = React__default.createElement(Type, _extends({
|
33237 | width: width
|
33238 | }, props.panel.props, {
|
33239 | panels: _extends({}, rest, {
|
33240 | isActive: isActive,
|
33241 | navigate: navigate,
|
33242 | toggleExpand: toggleExpand,
|
33243 | updateSettings: updateSettings
|
33244 | }),
|
33245 | __source: {
|
33246 | fileName: _jsxFileName$8,
|
33247 | lineNumber: 59
|
33248 | },
|
33249 | __self: this
|
33250 | }));
|
33251 | }
|
33252 |
|
33253 | return React__default.createElement(
|
33254 | ErrorBoundary,
|
33255 | {
|
33256 | __source: {
|
33257 | fileName: _jsxFileName$8,
|
33258 | lineNumber: 73
|
33259 | },
|
33260 | __self: this
|
33261 | },
|
33262 | res
|
33263 | );
|
33264 | }
|
33265 | }]);
|
33266 | return Route;
|
33267 | }(React__default.Component);
|
33268 |
|
33269 | var routeShape = PropTypes.shape({
|
33270 | app: PropTypes.string.isRequired,
|
33271 | context: PropTypes.string.isRequired,
|
33272 | panelId: PropTypes.string.isRequired,
|
33273 | path: PropTypes.string.isRequired,
|
33274 | isVisible: PropTypes.bool.isRequired,
|
33275 | width: PropTypes.number.isRequired
|
33276 | });
|
33277 |
|
33278 | Route$1.childContextTypes = {
|
33279 | isActive: PropTypes.func.isRequired,
|
33280 | isContext: PropTypes.bool,
|
33281 | isFocus: PropTypes.bool,
|
33282 | navigate: PropTypes.func.isRequired,
|
33283 | panel: PropTypes.object.isRequired,
|
33284 | route: routeShape.isRequired,
|
33285 | routeIndex: PropTypes.number.isRequired,
|
33286 | router: PropTypes.shape({
|
33287 | routes: PropTypes.shape({
|
33288 | byContext: PropTypes.objectOf(routeShape),
|
33289 | items: PropTypes.arrayOf(PropTypes.string)
|
33290 | }),
|
33291 | uri: PropTypes.string.isRequired
|
33292 | }),
|
33293 | toggleExpand: PropTypes.func.isRequired,
|
33294 | updateSettings: PropTypes.func.isRequired
|
33295 | };
|
33296 |
|
33297 | var CustomRoute = function (_React$Component2) {
|
33298 | inherits(CustomRoute, _React$Component2);
|
33299 |
|
33300 | function CustomRoute() {
|
33301 | var _ref2;
|
33302 |
|
33303 | var _temp2, _this2, _ret2;
|
33304 |
|
33305 | classCallCheck(this, CustomRoute);
|
33306 |
|
33307 | for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
33308 | args[_key2] = arguments[_key2];
|
33309 | }
|
33310 |
|
33311 | return _ret2 = (_temp2 = (_this2 = possibleConstructorReturn(this, (_ref2 = CustomRoute.__proto__ || Object.getPrototypeOf(CustomRoute)).call.apply(_ref2, [this].concat(args))), _this2), _this2.state = {}, _this2.subscribe = function (onChange) {
|
33312 | return _this2.onChange = onChange;
|
33313 | }, _temp2), possibleConstructorReturn(_this2, _ret2);
|
33314 | }
|
33315 |
|
33316 | createClass(CustomRoute, [{
|
33317 | key: 'componentDidMount',
|
33318 | value: function componentDidMount() {
|
33319 | var isActive = this.isActive,
|
33320 | navigate = this.navigate,
|
33321 | toggleExpand = this.toggleExpand,
|
33322 | updateSettings = this.updateSettings;
|
33323 | var _props2 = this.props,
|
33324 | isContext = _props2.isContext,
|
33325 | isFocus = _props2.isFocus,
|
33326 | panel = _props2.panel,
|
33327 | route = _props2.route,
|
33328 | routeIndex = _props2.routeIndex,
|
33329 | router = _props2.router,
|
33330 | store = _props2.store,
|
33331 | Type = _props2.Type;
|
33332 |
|
33333 |
|
33334 | var typeProps = {
|
33335 | isActive: isActive,
|
33336 | isContext: isContext,
|
33337 | isFocus: isFocus,
|
33338 | navigate: navigate,
|
33339 | panel: panel,
|
33340 | route: route,
|
33341 | routeIndex: routeIndex,
|
33342 | router: router,
|
33343 | store: store,
|
33344 | toggleExpand: toggleExpand,
|
33345 | updateSettings: updateSettings
|
33346 | };
|
33347 |
|
33348 | try {
|
33349 | this.onDestroy = Type(this.$el, typeProps, this.subscribe);
|
33350 | } catch (error) {
|
33351 | console.error('panels:route', error);
|
33352 | }
|
33353 | }
|
33354 | }, {
|
33355 | key: 'componentDidUpdate',
|
33356 | value: function componentDidUpdate(prevProps) {
|
33357 | var _props3 = this.props,
|
33358 | panel = _props3.panel,
|
33359 | route = _props3.route,
|
33360 | routeIndex = _props3.routeIndex,
|
33361 | router = _props3.router,
|
33362 | type = _props3.type;
|
33363 |
|
33364 |
|
33365 | if (prevProps.type !== type) {
|
33366 | this.componentWillUnmount();
|
33367 | this.componentDidMount();
|
33368 | } else if (typeof this.onChange === 'function' && (prevProps.panel !== panel || prevProps.route !== route || prevProps.routeIndex !== routeIndex || prevProps.router !== router)) {
|
33369 | this.onChange({
|
33370 | panel: panel,
|
33371 | route: route,
|
33372 | routeIndex: routeIndex,
|
33373 | router: router
|
33374 | });
|
33375 | }
|
33376 | }
|
33377 | }, {
|
33378 | key: 'componentWillUnmount',
|
33379 | value: function componentWillUnmount() {
|
33380 | if (typeof this.onDestroy === 'function') {
|
33381 | this.onDestroy();
|
33382 | }
|
33383 | }
|
33384 | }, {
|
33385 | key: 'render',
|
33386 | value: function render() {
|
33387 | var _this3 = this;
|
33388 |
|
33389 | var props = this.props,
|
33390 | state = this.state;
|
33391 |
|
33392 |
|
33393 | return React__default.createElement(
|
33394 | 'div',
|
33395 | {
|
33396 | ref: function ref($el) {
|
33397 | _this3.$el = $el;
|
33398 | },
|
33399 | style: _extends({
|
33400 | backgroundColor: state.error && '#ff5959',
|
33401 | height: '100%',
|
33402 | overflowY: 'auto',
|
33403 | width: props.width,
|
33404 | zIndex: props.zIndex
|
33405 | }, props.style),
|
33406 | __source: {
|
33407 | fileName: _jsxFileName$8,
|
33408 | lineNumber: 176
|
33409 | },
|
33410 | __self: this
|
33411 | },
|
33412 | state.error && React__default.createElement(
|
33413 | 'pre',
|
33414 | { style: { color: '#ffffff', overflowX: 'scroll', padding: 10 }, __source: {
|
33415 | fileName: _jsxFileName$8,
|
33416 | lineNumber: 190
|
33417 | },
|
33418 | __self: this
|
33419 | },
|
33420 | state.error.stack
|
33421 | )
|
33422 | );
|
33423 | }
|
33424 | }]);
|
33425 | return CustomRoute;
|
33426 | }(React__default.Component);
|
33427 |
|
33428 | var _jsxFileName$1 = '/Users/dario/opensource/panels/runtime/launchpad/index.js';
|
33429 | var DEBOUNCE = 250;
|
33430 | var LOADING_SIZE = 100;
|
33431 | var LOADING_OFFSET = LOADING_SIZE / -2;
|
33432 | var REBOUND = 500;
|
33433 |
|
33434 | var LaunchpadRuntime = function (_Component) {
|
33435 | inherits(LaunchpadRuntime, _Component);
|
33436 |
|
33437 | function LaunchpadRuntime() {
|
33438 | var _ref;
|
33439 |
|
33440 | var _temp, _this, _ret;
|
33441 |
|
33442 | classCallCheck(this, LaunchpadRuntime);
|
33443 |
|
33444 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
33445 | args[_key] = arguments[_key];
|
33446 | }
|
33447 |
|
33448 | return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = LaunchpadRuntime.__proto__ || Object.getPrototypeOf(LaunchpadRuntime)).call.apply(_ref, [this].concat(args))), _this), _this.onVisibilityChange = function () {
|
33449 | if (document.visibilityState === 'hidden') {
|
33450 | window.removeEventListener('resize', _this.setViewportWidth);
|
33451 | window.removeEventListener('orientationchange', _this.setViewportWidth);
|
33452 | } else {
|
33453 | setTimeout(function () {
|
33454 | _this.setViewportWidth();
|
33455 | window.addEventListener('resize', _this.setViewportWidth, false);
|
33456 | window.addEventListener('orientationchange', _this.setViewportWidth, false);
|
33457 | }, REBOUND);
|
33458 | }
|
33459 | }, _this.setViewportWidth = debounce(function () {
|
33460 | return _this.props.setViewportWidth(getViewportWidth());
|
33461 | }, DEBOUNCE), _temp), possibleConstructorReturn(_this, _ret);
|
33462 | }
|
33463 |
|
33464 | createClass(LaunchpadRuntime, [{
|
33465 | key: 'componentDidMount',
|
33466 | value: function componentDidMount() {
|
33467 | window.addEventListener('resize', this.setViewportWidth, false);
|
33468 | window.addEventListener('orientationchange', this.setViewportWidth, false);
|
33469 | document.addEventListener('visibilitychange', this.onVisibilityChange);
|
33470 |
|
33471 | this.ensureDefault();
|
33472 | }
|
33473 | }, {
|
33474 | key: 'componentDidUpdate',
|
33475 | value: function componentDidUpdate(prevProps) {
|
33476 | var props = this.props;
|
33477 |
|
33478 |
|
33479 | if (props.mainPanel && props.mainPanel.title) {
|
33480 | window.document.title = props.mainPanel.title;
|
33481 | }
|
33482 |
|
33483 | this.ensureDefault();
|
33484 | }
|
33485 | }, {
|
33486 | key: 'componentWillUnmount',
|
33487 | value: function componentWillUnmount() {
|
33488 | window.removeEventListener('resize', this.setViewportWidth);
|
33489 | window.removeEventListener('orientationchange', this.setViewportWidth);
|
33490 | }
|
33491 | }, {
|
33492 | key: 'ensureDefault',
|
33493 | value: function ensureDefault() {
|
33494 | var props = this.props;
|
33495 |
|
33496 | if (props.launchpadPanel && !props.mainPanel) {
|
33497 | props.navigate(props.launchpadRoute.context + '/' + props.launchpadPanel.default);
|
33498 | }
|
33499 | }
|
33500 | }, {
|
33501 | key: 'render',
|
33502 | value: function render() {
|
33503 | var _this2 = this;
|
33504 |
|
33505 | var _props = this.props,
|
33506 | dockedApp = _props.dockedApp,
|
33507 | dockedPanel = _props.dockedPanel,
|
33508 | dockedRoute = _props.dockedRoute,
|
33509 | dockedRouteIndex = _props.dockedRouteIndex,
|
33510 | mainApp = _props.mainApp,
|
33511 | mainPanel = _props.mainPanel,
|
33512 | mainRoute = _props.mainRoute,
|
33513 | launchpadApp = _props.launchpadApp,
|
33514 | launchpadPanel = _props.launchpadPanel,
|
33515 | launchpadRoute = _props.launchpadRoute,
|
33516 | navigate = _props.navigate,
|
33517 | router = _props.router,
|
33518 | runtime = _props.runtime,
|
33519 | updateSettings = _props.updateSettings;
|
33520 |
|
33521 |
|
33522 | var docked = dockedPanel && React__default.createElement(Route$1, {
|
33523 | key: 'docked-' + (dockedPanel.dockLeft ? 'left' : 'right'),
|
33524 | navigate: navigate,
|
33525 | panel: dockedPanel,
|
33526 | route: dockedRoute,
|
33527 | routeIndex: dockedRouteIndex,
|
33528 | router: router,
|
33529 | store: dockedApp.store,
|
33530 | Type: dockedApp.types[dockedPanel.type],
|
33531 | updateSettings: updateSettings,
|
33532 | width: dockedRoute.width,
|
33533 | __source: {
|
33534 | fileName: _jsxFileName$1,
|
33535 | lineNumber: 86
|
33536 | },
|
33537 | __self: this
|
33538 | });
|
33539 |
|
33540 | var mainWidth = runtime.viewportWidth - (dockedRoute && dockedRoute.width || 0);
|
33541 |
|
33542 | return React__default.createElement(
|
33543 | 'div',
|
33544 | {
|
33545 | ref: function ref($e) {
|
33546 | return _this2.$runtime = $e;
|
33547 | },
|
33548 | style: {
|
33549 | flexDirection: 'column',
|
33550 | height: '100%',
|
33551 | overflow: 'hidden',
|
33552 | width: '100%'
|
33553 | },
|
33554 | __source: {
|
33555 | fileName: _jsxFileName$1,
|
33556 | lineNumber: 103
|
33557 | },
|
33558 | __self: this
|
33559 | },
|
33560 | React__default.createElement(BaseStyle, {
|
33561 | __source: {
|
33562 | fileName: _jsxFileName$1,
|
33563 | lineNumber: 112
|
33564 | },
|
33565 | __self: this
|
33566 | }),
|
33567 | launchpadPanel && React__default.createElement(Route$1, {
|
33568 | navigate: navigate,
|
33569 | panel: launchpadPanel,
|
33570 | route: launchpadRoute,
|
33571 | routeIndex: 0,
|
33572 | router: router,
|
33573 | store: launchpadApp.store,
|
33574 | style: _extends({
|
33575 | height: launchpadPanel.height || 0
|
33576 | }, launchpadPanel.style),
|
33577 | Type: launchpadApp.types[launchpadPanel.type],
|
33578 | updateSettings: updateSettings,
|
33579 | width: runtime.viewportWidth,
|
33580 | __source: {
|
33581 | fileName: _jsxFileName$1,
|
33582 | lineNumber: 115
|
33583 | },
|
33584 | __self: this
|
33585 | }),
|
33586 | React__default.createElement(
|
33587 | 'div',
|
33588 | {
|
33589 | style: {
|
33590 | flexDirection: 'row',
|
33591 | height: 'calc(100% - ' + (launchpadPanel && launchpadPanel.height || 0) + 'px)',
|
33592 | overflow: 'hidden',
|
33593 | width: '100vw'
|
33594 | },
|
33595 | __source: {
|
33596 | fileName: _jsxFileName$1,
|
33597 | lineNumber: 131
|
33598 | },
|
33599 | __self: this
|
33600 | },
|
33601 | dockedPanel && dockedPanel.dockLeft && docked,
|
33602 | mainPanel && React__default.createElement(Route$1, {
|
33603 | key: 'main',
|
33604 | navigate: navigate,
|
33605 | panel: mainPanel,
|
33606 | route: mainRoute,
|
33607 | routeIndex: 1,
|
33608 | router: router,
|
33609 | store: mainApp.store,
|
33610 | Type: mainApp.types[mainPanel.type],
|
33611 | updateSettings: updateSettings,
|
33612 | width: mainWidth,
|
33613 | __source: {
|
33614 | fileName: _jsxFileName$1,
|
33615 | lineNumber: 143
|
33616 | },
|
33617 | __self: this
|
33618 | }),
|
33619 | dockedPanel && !dockedPanel.dockLeft && docked
|
33620 | ),
|
33621 | router.isLoading ? React__default.createElement(
|
33622 | 'div',
|
33623 | {
|
33624 | style: {
|
33625 | flexDirection: 'column',
|
33626 | justifyContent: 'center',
|
33627 | position: 'absolute',
|
33628 | left: LOADING_OFFSET,
|
33629 | top: LOADING_OFFSET
|
33630 | },
|
33631 | __source: {
|
33632 | fileName: _jsxFileName$1,
|
33633 | lineNumber: 160
|
33634 | },
|
33635 | __self: this
|
33636 | },
|
33637 | React__default.createElement(Knocking, { size: LOADING_SIZE, __source: {
|
33638 | fileName: _jsxFileName$1,
|
33639 | lineNumber: 169
|
33640 | },
|
33641 | __self: this
|
33642 | })
|
33643 | ) : null
|
33644 | );
|
33645 | }
|
33646 | }]);
|
33647 | return LaunchpadRuntime;
|
33648 | }(React.Component);
|
33649 |
|
33650 | function mapStateToProps(_ref2, props) {
|
33651 | var apps = _ref2.apps,
|
33652 | panels = _ref2.panels,
|
33653 | runtime = _ref2.runtime,
|
33654 | router = _ref2.router;
|
33655 |
|
33656 | var launchpadRoute = router.routes.byContext[router.routes.items[0]];
|
33657 | var mainRoute = router.routes.byContext[router.routes.items[1]];
|
33658 | var dockedRoute = void 0;
|
33659 | var dockedRouteIndex = void 0;
|
33660 | if (router.routes.items.length > 2) {
|
33661 | dockedRouteIndex = router.routes.items.length - 1;
|
33662 | dockedRoute = router.routes.byContext[router.routes.items[dockedRouteIndex]];
|
33663 | }
|
33664 |
|
33665 | var dockedPanel = dockedRoute && panels.byId[dockedRoute.panelId];
|
33666 | var mainPanel = mainRoute && panels.byId[mainRoute.panelId];
|
33667 |
|
33668 | return {
|
33669 | dockedApp: dockedRoute && apps.byName[dockedRoute.app],
|
33670 | dockedPanel: dockedPanel,
|
33671 | dockedRoute: dockedRoute,
|
33672 | dockedRouteIndex: dockedRouteIndex,
|
33673 |
|
33674 | focusPanel: dockedPanel || mainPanel,
|
33675 |
|
33676 | mainApp: mainRoute && apps.byName[mainRoute.app],
|
33677 | mainPanel: mainPanel,
|
33678 | mainRoute: mainRoute,
|
33679 |
|
33680 | launchpadApp: launchpadRoute && apps.byName[launchpadRoute.app],
|
33681 | launchpadPanel: launchpadRoute && panels.byId[launchpadRoute.panelId],
|
33682 | launchpadRoute: launchpadRoute,
|
33683 |
|
33684 | router: router,
|
33685 | runtime: runtime
|
33686 | };
|
33687 | }
|
33688 |
|
33689 | var mapDispatchToProps = {
|
33690 | navigate: navigate,
|
33691 | setViewportWidth: setViewportWidth,
|
33692 | updateSettings: updateSettings
|
33693 | };
|
33694 | var Launchpad = reactRedux.connect(mapStateToProps, mapDispatchToProps)(LaunchpadRuntime);
|
33695 |
|
33696 | function easeOutCubic(currentIteration, startValue, changeInValue, totalIterations) {
|
33697 | return changeInValue * (Math.pow(currentIteration / totalIterations - 1, 3) + 1) + startValue;
|
33698 | }
|
33699 |
|
33700 | var FUNCTIONS = Object.freeze({
|
33701 | easeOutCubic: easeOutCubic
|
33702 | });
|
33703 |
|
33704 | function snap($el, to, scroll, _ref) {
|
33705 | var _ref$delay = _ref.delay,
|
33706 | delay = _ref$delay === undefined ? 10 : _ref$delay,
|
33707 | _ref$duration = _ref.duration,
|
33708 | duration = _ref$duration === undefined ? 75 : _ref$duration,
|
33709 | _ref$fn = _ref.fn,
|
33710 | fn = _ref$fn === undefined ? 'easeOutCubic' : _ref$fn,
|
33711 | _ref$step = _ref.step,
|
33712 | step = _ref$step === undefined ? 5 : _ref$step;
|
33713 |
|
33714 | var currentTime = 0;
|
33715 | var next = FUNCTIONS[fn] || easeOutCubic;
|
33716 | var start = $el[scroll];
|
33717 | var change = to - start;
|
33718 |
|
33719 | var animate = function animate() {
|
33720 | currentTime += step;
|
33721 |
|
33722 | $el[scroll] = next(currentTime, start, change, duration);
|
33723 |
|
33724 | if (currentTime < duration) {
|
33725 | requestAnimationFrame(animate);
|
33726 | }
|
33727 | };
|
33728 |
|
33729 | setTimeout(animate, delay);
|
33730 | }
|
33731 |
|
33732 | function snapX($el, to) {
|
33733 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
33734 |
|
33735 | snap($el, to, 'scrollLeft', options);
|
33736 | }
|
33737 |
|
33738 | var _jsxFileName$12 = "/Users/dario/opensource/panels/playground/arrow-left.js";
|
33739 | var _this$3 = undefined;
|
33740 | var ArrowLeft = function ArrowLeft(props) {
|
33741 | return React__default.createElement(
|
33742 | "svg",
|
33743 | { height: "10px", viewBox: "0 0 10 10", width: "10px", __source: {
|
33744 | fileName: _jsxFileName$12,
|
33745 | lineNumber: 4
|
33746 | },
|
33747 | __self: _this$3
|
33748 | },
|
33749 | React__default.createElement("path", { fill: props.fill, d: "M6.826,10.011c0.236,0,0.473-0.083,0.664-0.252C7.903,9.392,7.941,8.76,7.574,8.347L4.603,5l2.971-3.347 C7.94,1.24,7.903,0.608,7.49,0.241C7.076-0.125,6.444-0.087,6.078,0.325L2.517,4.336c-0.336,0.379-0.336,0.949,0,1.328 l3.561,4.011C6.276,9.897,6.55,10.011,6.826,10.011z", __source: {
|
33750 | fileName: _jsxFileName$12,
|
33751 | lineNumber: 5
|
33752 | },
|
33753 | __self: _this$3
|
33754 | })
|
33755 | );
|
33756 | };
|
33757 | ArrowLeft.defaultProps = {
|
33758 | fill: '#FFFFFF'
|
33759 | };
|
33760 |
|
33761 | var _jsxFileName$11 = '/Users/dario/opensource/panels/runtime/trails/move-left.js';
|
33762 | var _this$2 = undefined;
|
33763 | var DIAMETER = 40;
|
33764 |
|
33765 | var MoveLeft = function MoveLeft(_ref) {
|
33766 | var onClick = _ref.onClick,
|
33767 | snapPoint = _ref.snapPoint;
|
33768 | return React__default.createElement(
|
33769 | 'div',
|
33770 | {
|
33771 | onClick: onClick,
|
33772 | style: {
|
33773 | alignItems: 'center',
|
33774 | backgroundColor: '#00ADEE',
|
33775 | borderRadius: DIAMETER,
|
33776 | bottom: 32,
|
33777 | cursor: 'pointer',
|
33778 | height: DIAMETER,
|
33779 | justifyContent: 'center',
|
33780 | left: snapPoint - DIAMETER / 2,
|
33781 | position: 'fixed',
|
33782 | width: DIAMETER,
|
33783 | zIndex: 100000
|
33784 | },
|
33785 | __source: {
|
33786 | fileName: _jsxFileName$11,
|
33787 | lineNumber: 7
|
33788 | },
|
33789 | __self: _this$2
|
33790 | },
|
33791 | React__default.createElement(ArrowLeft, {
|
33792 | __source: {
|
33793 | fileName: _jsxFileName$11,
|
33794 | lineNumber: 23
|
33795 | },
|
33796 | __self: _this$2
|
33797 | })
|
33798 | );
|
33799 | };
|
33800 |
|
33801 | var supports = false;
|
33802 | try {
|
33803 | var opts = Object.defineProperty({}, 'passive', {
|
33804 | get: function get() {
|
33805 | supports = true;
|
33806 | }
|
33807 | });
|
33808 | window.addEventListener('test', null, opts);
|
33809 | } catch (e) {}
|
33810 |
|
33811 | var supportsPassiveEvents = supports;
|
33812 |
|
33813 | var _jsxFileName$10 = '/Users/dario/opensource/panels/runtime/trails/index.js';
|
33814 | var DEBOUNCE$1 = 250;
|
33815 | var LOADING_SIZE$1 = 100;
|
33816 | var LOADING_OFFSET$1 = LOADING_SIZE$1 / -2;
|
33817 | var REBOUND$1 = 500;
|
33818 |
|
33819 | var scrollEventOptions = supportsPassiveEvents ? { passive: true } : false;
|
33820 |
|
33821 | var style = {
|
33822 | height: '100%',
|
33823 | overflowX: 'auto',
|
33824 | overflowY: 'hidden',
|
33825 | width: '100vw'
|
33826 | };
|
33827 |
|
33828 | var Runtime = function (_React$Component) {
|
33829 | inherits(Runtime, _React$Component);
|
33830 |
|
33831 | function Runtime() {
|
33832 | var _ref;
|
33833 |
|
33834 | var _temp, _this, _ret;
|
33835 |
|
33836 | classCallCheck(this, Runtime);
|
33837 |
|
33838 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
33839 | args[_key] = arguments[_key];
|
33840 | }
|
33841 |
|
33842 | return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = Runtime.__proto__ || Object.getPrototypeOf(Runtime)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
33843 | autoScroll: null
|
33844 | }, _this.onVisibilityChange = function () {
|
33845 | if (document.visibilityState === 'hidden') {
|
33846 | if (_this.props.snap) {
|
33847 | _this.$runtime.removeEventListener('scroll', _this.setX);
|
33848 | }
|
33849 | window.removeEventListener('resize', _this.setViewportWidth);
|
33850 | window.removeEventListener('orientationchange', _this.setViewportWidth);
|
33851 | } else {
|
33852 | setTimeout(function () {
|
33853 | if (_this.props.snap) {
|
33854 | _this.$runtime.addEventListener('scroll', _this.setX, scrollEventOptions);
|
33855 | }
|
33856 | window.addEventListener('resize', _this.setViewportWidth, false);
|
33857 | window.addEventListener('orientationchange', _this.setViewportWidth, false);
|
33858 | }, REBOUND$1);
|
33859 | }
|
33860 | }, _this.scrollRuntime = function (_ref2) {
|
33861 | var x = _ref2.x;
|
33862 | var autoScroll = _this.state.autoScroll;
|
33863 |
|
33864 |
|
33865 | if (_this.$runtime && autoScroll) {
|
33866 | _this.$runtime.scrollLeft = autoScroll.from + x;
|
33867 | }
|
33868 | return null;
|
33869 | }, _this.setViewportWidth = debounce(function () {
|
33870 | _this.props.setViewportWidth(getViewportWidth());
|
33871 | }, DEBOUNCE$1), _this.setX = debounce(function (event) {
|
33872 | if (!_this.props.snap) return;
|
33873 |
|
33874 | if (_this.state.autoScroll) {
|
33875 | _this.setState({
|
33876 | autoScroll: null
|
33877 | });
|
33878 | }
|
33879 |
|
33880 | var nextX = _this.$runtime.scrollLeft;
|
33881 | if (Math.abs(_this.props.runtime.x - nextX) > 5) {
|
33882 | _this.props.setX(nextX);
|
33883 | }
|
33884 | }, DEBOUNCE$1), _temp), possibleConstructorReturn(_this, _ret);
|
33885 | }
|
33886 |
|
33887 | createClass(Runtime, [{
|
33888 | key: 'componentDidMount',
|
33889 | value: function componentDidMount() {
|
33890 | if (this.props.snap) {
|
33891 | this.$runtime.addEventListener('scroll', this.setX, scrollEventOptions);
|
33892 | }
|
33893 | window.addEventListener('resize', this.setViewportWidth, false);
|
33894 | window.addEventListener('orientationchange', this.setViewportWidth, false);
|
33895 | document.addEventListener('visibilitychange', this.onVisibilityChange);
|
33896 | }
|
33897 | }, {
|
33898 | key: 'componentDidUpdate',
|
33899 | value: function componentDidUpdate(prevProps) {
|
33900 | var props = this.props;
|
33901 |
|
33902 |
|
33903 | if (props.focusPanel) {
|
33904 | window.document.title = props.focusPanel.title || props.focusPanel.type;
|
33905 | }
|
33906 |
|
33907 | if (props.snap && prevProps.runtime.x !== props.runtime.x) {
|
33908 | snapX(this.$runtime, props.runtime.x);
|
33909 | }
|
33910 | }
|
33911 | }, {
|
33912 | key: 'componentWillUnmount',
|
33913 | value: function componentWillUnmount() {
|
33914 | if (this.props.snap) {
|
33915 | this.$runtime.removeEventListener('scroll', this.setX);
|
33916 | }
|
33917 | window.removeEventListener('resize', this.setViewportWidth);
|
33918 | window.removeEventListener('orientationchange', this.setViewportWidth);
|
33919 | }
|
33920 | }, {
|
33921 | key: 'render',
|
33922 | value: function render() {
|
33923 | var _this2 = this;
|
33924 |
|
33925 | var _props = this.props,
|
33926 | apps = _props.apps,
|
33927 | canMoveLeft = _props.canMoveLeft,
|
33928 | focusPanel = _props.focusPanel,
|
33929 | moveLeft = _props.moveLeft,
|
33930 | navigate = _props.navigate,
|
33931 | panels = _props.panels,
|
33932 | router = _props.router,
|
33933 | runtime = _props.runtime,
|
33934 | snap = _props.snap,
|
33935 | toggleExpand = _props.toggleExpand,
|
33936 | updateSettings = _props.updateSettings,
|
33937 | visibleRoutes = _props.visibleRoutes;
|
33938 |
|
33939 |
|
33940 | var runtimeStyle = focusPanel ? _extends({}, style, focusPanel.styleBackground) : style;
|
33941 |
|
33942 | return React__default.createElement(
|
33943 | Horizontal,
|
33944 | { _ref: function _ref($e) {
|
33945 | return _this2.$runtime = $e;
|
33946 | }, style: runtimeStyle, __source: {
|
33947 | fileName: _jsxFileName$10,
|
33948 | lineNumber: 113
|
33949 | },
|
33950 | __self: this
|
33951 | },
|
33952 | React__default.createElement(BaseStyle, {
|
33953 | __source: {
|
33954 | fileName: _jsxFileName$10,
|
33955 | lineNumber: 114
|
33956 | },
|
33957 | __self: this
|
33958 | }),
|
33959 | canMoveLeft && snap && React__default.createElement(MoveLeft, { onClick: moveLeft, snapPoint: runtime.snapPoint, __source: {
|
33960 | fileName: _jsxFileName$10,
|
33961 | lineNumber: 118
|
33962 | },
|
33963 | __self: this
|
33964 | }),
|
33965 | React__default.createElement(
|
33966 | Horizontal,
|
33967 | {
|
33968 | style: {
|
33969 | flexDirection: 'row',
|
33970 | height: '100%',
|
33971 | overflowY: 'hidden',
|
33972 | paddingLeft: runtime.snapPoint,
|
33973 | width: runtime.width,
|
33974 | willChange: 'scroll-position'
|
33975 | },
|
33976 | __source: {
|
33977 | fileName: _jsxFileName$10,
|
33978 | lineNumber: 120
|
33979 | },
|
33980 | __self: this
|
33981 | },
|
33982 | visibleRoutes.map(function (context, i) {
|
33983 | var route = router.routes.byContext[context];
|
33984 | var app = apps[route.app];
|
33985 | var panel = panels[route.panelId];
|
33986 |
|
33987 | return React__default.createElement(Route$1, {
|
33988 | isContext: i >= router.context,
|
33989 | isFocus: i === router.focus,
|
33990 | key: i + '-' + app.name + '-' + panel.type,
|
33991 | navigate: navigate,
|
33992 | panel: panel,
|
33993 | route: route,
|
33994 | routeIndex: i,
|
33995 | router: router,
|
33996 | store: app.store,
|
33997 | toggleExpand: toggleExpand,
|
33998 | Type: app.types[panel.type],
|
33999 | updateSettings: updateSettings,
|
34000 | width: route.width,
|
34001 | zIndex: router.routes.items.length - i,
|
34002 | __source: {
|
34003 | fileName: _jsxFileName$10,
|
34004 | lineNumber: 136
|
34005 | },
|
34006 | __self: _this2
|
34007 | });
|
34008 | })
|
34009 | ),
|
34010 | router.isLoading ? React__default.createElement(
|
34011 | Horizontal,
|
34012 | {
|
34013 | style: {
|
34014 | justifyContent: 'center',
|
34015 | left: router.routes.items.length ? LOADING_OFFSET$1 : LOADING_OFFSET$1 - runtime.snapPoint,
|
34016 | marginTop: LOADING_OFFSET$1
|
34017 | },
|
34018 | __source: {
|
34019 | fileName: _jsxFileName$10,
|
34020 | lineNumber: 157
|
34021 | },
|
34022 | __self: this
|
34023 | },
|
34024 | React__default.createElement(Knocking, { size: LOADING_SIZE$1, __source: {
|
34025 | fileName: _jsxFileName$10,
|
34026 | lineNumber: 166
|
34027 | },
|
34028 | __self: this
|
34029 | })
|
34030 | ) : null
|
34031 | );
|
34032 | }
|
34033 | }]);
|
34034 | return Runtime;
|
34035 | }(React__default.Component);
|
34036 |
|
34037 | var getFocusPanel = function getFocusPanel(_ref3) {
|
34038 | var panels = _ref3.panels,
|
34039 | router = _ref3.router;
|
34040 |
|
34041 | var focusRoute = router.routes.byContext[router.routes.items[router.focus]];
|
34042 | return focusRoute && panels.byId[focusRoute.panelId];
|
34043 | };
|
34044 |
|
34045 | var getCanMoveLeft = function getCanMoveLeft(_ref4) {
|
34046 | var runtime = _ref4.runtime;
|
34047 | return !runtime.shouldGoMobile && runtime.x > 0;
|
34048 | };
|
34049 |
|
34050 | function mapStateToProps$1(state, props) {
|
34051 | return {
|
34052 | apps: state.apps.byName,
|
34053 | canMoveLeft: getCanMoveLeft(state),
|
34054 | focusPanel: getFocusPanel(state),
|
34055 | panels: state.panels.byId,
|
34056 | router: state.router,
|
34057 | runtime: state.runtime,
|
34058 | visibleRoutes: state.router.routes.items.filter(function (r) {
|
34059 | return state.router.routes.byContext[r].isVisible;
|
34060 | })
|
34061 | };
|
34062 | }
|
34063 |
|
34064 | var mapDispatchToProps$1 = {
|
34065 | moveLeft: moveLeft,
|
34066 | navigate: navigate,
|
34067 | setViewportWidth: setViewportWidth,
|
34068 | setX: setX,
|
34069 | toggleExpand: toggleExpand,
|
34070 | updateSettings: updateSettings
|
34071 | };
|
34072 | var Trails = reactRedux.connect(mapStateToProps$1, mapDispatchToProps$1)(Runtime);
|
34073 |
|
34074 |
|
34075 |
|
34076 | var runtimes = Object.freeze({
|
34077 | Launchpad: Launchpad,
|
34078 | Trails: Trails
|
34079 | });
|
34080 |
|
34081 | function history(store) {
|
34082 | var navigateHandler = function navigateHandler() {
|
34083 | return store.dispatch(navigate(location.href));
|
34084 | };
|
34085 |
|
34086 | window.addEventListener('popstate', navigateHandler);
|
34087 |
|
34088 | var unsubscribe = store.subscribe(function () {
|
34089 | var uri = store.getState().router.uri;
|
34090 |
|
34091 |
|
34092 | if (uri !== location.href) {
|
34093 | window.history.pushState(null, null, uri);
|
34094 | }
|
34095 | });
|
34096 |
|
34097 | return function historyOff() {
|
34098 | window.removeEventListener('popstate', navigateHandler);
|
34099 | unsubscribe();
|
34100 | };
|
34101 | }
|
34102 |
|
34103 | var _jsxFileName = '/Users/dario/opensource/panels/render.js';
|
34104 | function runtimeRender(configureStore) {
|
34105 | var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
34106 | _ref$snap = _ref.snap,
|
34107 | snap = _ref$snap === undefined ? true : _ref$snap,
|
34108 | _ref$runtime = _ref.runtime,
|
34109 | runtime = _ref$runtime === undefined ? 'Trails' : _ref$runtime,
|
34110 | initialState = objectWithoutProperties(_ref, ['snap', 'runtime']);
|
34111 |
|
34112 | var store = configureStore({
|
34113 | router: {
|
34114 | routes: {
|
34115 | byContext: {},
|
34116 | items: []
|
34117 | },
|
34118 | parsers: initialState.router && initialState.router.parsers
|
34119 | }
|
34120 | });
|
34121 | store.dispatch(navigate(location.href));
|
34122 |
|
34123 | history(store);
|
34124 |
|
34125 | var Runtime = runtimes[runtime];
|
34126 |
|
34127 | reactDom.render(React__default.createElement(
|
34128 | reactRedux.Provider,
|
34129 | { store: store, __source: {
|
34130 | fileName: _jsxFileName,
|
34131 | lineNumber: 33
|
34132 | },
|
34133 | __self: this
|
34134 | },
|
34135 | React__default.createElement(Runtime, { snap: snap, __source: {
|
34136 | fileName: _jsxFileName,
|
34137 | lineNumber: 34
|
34138 | },
|
34139 | __self: this
|
34140 | })
|
34141 | ), document.getElementById('root'));
|
34142 |
|
34143 | return store;
|
34144 | }
|
34145 |
|
34146 | var render$1 = function render(props) {
|
34147 | return runtimeRender(configureStore, props);
|
34148 | };
|
34149 |
|
34150 | if (!window.panelsDontAutoLoad) {
|
34151 | window.addEventListener('load', function () {
|
34152 | window._store = render$1(window.panels);
|
34153 | });
|
34154 | }
|
34155 |
|
34156 | exports.render = render$1;
|
34157 | },{"debounce":7,"houkou":10,"mini-unique-id":22,"prop-types":"prop-types","react":"react","react-dom":"react-dom","react-redux":43,"redux":63,"redux-logger":56,"redux-thunk":57,"regenerator-runtime":65,"style-to-css":73}],"prop-types":[function(require,module,exports){
|
34158 |
|
34159 |
|
34160 |
|
34161 |
|
34162 |
|
34163 |
|
34164 |
|
34165 | if ("development" !== 'production') {
|
34166 | var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
|
34167 | Symbol.for &&
|
34168 | Symbol.for('react.element')) ||
|
34169 | 0xeac7;
|
34170 |
|
34171 | var isValidElement = function(object) {
|
34172 | return typeof object === 'object' &&
|
34173 | object !== null &&
|
34174 | object.$$typeof === REACT_ELEMENT_TYPE;
|
34175 | };
|
34176 |
|
34177 |
|
34178 |
|
34179 | var throwOnDirectAccess = true;
|
34180 | module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);
|
34181 | } else {
|
34182 |
|
34183 |
|
34184 | module.exports = require('./factoryWithThrowingShims')();
|
34185 | }
|
34186 |
|
34187 | },{"./factoryWithThrowingShims":26,"./factoryWithTypeCheckers":27}],"react-dom":[function(require,module,exports){
|
34188 | 'use strict';
|
34189 |
|
34190 | function checkDCE() {
|
34191 |
|
34192 | if (
|
34193 | typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
|
34194 | typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
|
34195 | ) {
|
34196 | return;
|
34197 | }
|
34198 | if ("development" !== 'production') {
|
34199 |
|
34200 |
|
34201 |
|
34202 |
|
34203 |
|
34204 |
|
34205 |
|
34206 | throw new Error('^_^');
|
34207 | }
|
34208 | try {
|
34209 |
|
34210 | __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
|
34211 | } catch (err) {
|
34212 |
|
34213 |
|
34214 | console.error(err);
|
34215 | }
|
34216 | }
|
34217 |
|
34218 | if ("development" === 'production') {
|
34219 |
|
34220 |
|
34221 | checkDCE();
|
34222 | module.exports = require('./cjs/react-dom.production.min.js');
|
34223 | } else {
|
34224 | module.exports = require('./cjs/react-dom.development.js');
|
34225 | }
|
34226 |
|
34227 | },{"./cjs/react-dom.development.js":29,"./cjs/react-dom.production.min.js":30}],"react":[function(require,module,exports){
|
34228 | 'use strict';
|
34229 |
|
34230 | if ("development" === 'production') {
|
34231 | module.exports = require('./cjs/react.production.min.js');
|
34232 | } else {
|
34233 | module.exports = require('./cjs/react.development.js');
|
34234 | }
|
34235 |
|
34236 | },{"./cjs/react.development.js":50,"./cjs/react.production.min.js":51}]},{},["panels"])
|
34237 |
|