mobx-react 5.3.6 → 5.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserlistrc +6 -6
- package/.editorconfig +6 -6
- package/.prettierrc +4 -4
- package/.travis.yml +9 -9
- package/CHANGELOG.md +518 -505
- package/LICENSE +21 -21
- package/README.md +517 -515
- package/custom.d.ts +140 -140
- package/custom.js +91 -66
- package/custom.module.js +88 -63
- package/empty.js +3 -3
- package/index.d.ts +140 -140
- package/index.js +91 -66
- package/index.min.js +1 -1
- package/index.module.js +88 -63
- package/native.d.ts +140 -140
- package/native.js +88 -63
- package/package.json +7 -5
- package/yarn.lock +5886 -5863
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '
|
|
4
|
-
(factory((global.mobxReact = {}),global.
|
|
5
|
-
}(this, (function (exports,React,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('mobx'), require('react'), require('react-dom')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'mobx', 'react', 'react-dom'], factory) :
|
|
4
|
+
(factory((global.mobxReact = {}),global.mobx,global.React,global.ReactDOM));
|
|
5
|
+
}(this, (function (exports,mobx,React,reactDom) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var React__default = 'default' in React ? React['default'] : React;
|
|
8
8
|
|
|
@@ -116,33 +116,35 @@
|
|
|
116
116
|
|
|
117
117
|
var reactIs_production_min = createCommonjsModule(function (module, exports) {
|
|
118
118
|
Object.defineProperty(exports,"__esModule",{value:!0});
|
|
119
|
-
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.forward_ref"):60112,
|
|
120
|
-
function
|
|
121
|
-
exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===
|
|
122
|
-
exports.isForwardRef=function(a){return
|
|
119
|
+
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,r=b?Symbol.for("react.memo"):
|
|
120
|
+
60115,t=b?Symbol.for("react.lazy"):60116;function u(a){if("object"===typeof a&&null!==a){var q=a.$$typeof;switch(q){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return q}}case d:return q}}}function v(a){return u(a)===m}exports.typeOf=u;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;
|
|
121
|
+
exports.Profiler=g;exports.Portal=d;exports.StrictMode=f;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===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||u(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return u(a)===k};exports.isContextProvider=function(a){return u(a)===h};
|
|
122
|
+
exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return u(a)===n};exports.isFragment=function(a){return u(a)===e};exports.isProfiler=function(a){return u(a)===g};exports.isPortal=function(a){return u(a)===d};exports.isStrictMode=function(a){return u(a)===f};
|
|
123
123
|
});
|
|
124
124
|
|
|
125
125
|
unwrapExports(reactIs_production_min);
|
|
126
126
|
var reactIs_production_min_1 = reactIs_production_min.typeOf;
|
|
127
127
|
var reactIs_production_min_2 = reactIs_production_min.AsyncMode;
|
|
128
|
-
var reactIs_production_min_3 = reactIs_production_min.
|
|
129
|
-
var reactIs_production_min_4 = reactIs_production_min.
|
|
130
|
-
var reactIs_production_min_5 = reactIs_production_min.
|
|
131
|
-
var reactIs_production_min_6 = reactIs_production_min.
|
|
132
|
-
var reactIs_production_min_7 = reactIs_production_min.
|
|
133
|
-
var reactIs_production_min_8 = reactIs_production_min.
|
|
134
|
-
var reactIs_production_min_9 = reactIs_production_min.
|
|
135
|
-
var reactIs_production_min_10 = reactIs_production_min.
|
|
136
|
-
var reactIs_production_min_11 = reactIs_production_min.
|
|
137
|
-
var reactIs_production_min_12 = reactIs_production_min.
|
|
138
|
-
var reactIs_production_min_13 = reactIs_production_min.
|
|
139
|
-
var reactIs_production_min_14 = reactIs_production_min.
|
|
140
|
-
var reactIs_production_min_15 = reactIs_production_min.
|
|
141
|
-
var reactIs_production_min_16 = reactIs_production_min.
|
|
142
|
-
var reactIs_production_min_17 = reactIs_production_min.
|
|
143
|
-
var reactIs_production_min_18 = reactIs_production_min.
|
|
144
|
-
var reactIs_production_min_19 = reactIs_production_min.
|
|
145
|
-
var reactIs_production_min_20 = reactIs_production_min.
|
|
128
|
+
var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode;
|
|
129
|
+
var reactIs_production_min_4 = reactIs_production_min.ContextConsumer;
|
|
130
|
+
var reactIs_production_min_5 = reactIs_production_min.ContextProvider;
|
|
131
|
+
var reactIs_production_min_6 = reactIs_production_min.Element;
|
|
132
|
+
var reactIs_production_min_7 = reactIs_production_min.ForwardRef;
|
|
133
|
+
var reactIs_production_min_8 = reactIs_production_min.Fragment;
|
|
134
|
+
var reactIs_production_min_9 = reactIs_production_min.Profiler;
|
|
135
|
+
var reactIs_production_min_10 = reactIs_production_min.Portal;
|
|
136
|
+
var reactIs_production_min_11 = reactIs_production_min.StrictMode;
|
|
137
|
+
var reactIs_production_min_12 = reactIs_production_min.isValidElementType;
|
|
138
|
+
var reactIs_production_min_13 = reactIs_production_min.isAsyncMode;
|
|
139
|
+
var reactIs_production_min_14 = reactIs_production_min.isConcurrentMode;
|
|
140
|
+
var reactIs_production_min_15 = reactIs_production_min.isContextConsumer;
|
|
141
|
+
var reactIs_production_min_16 = reactIs_production_min.isContextProvider;
|
|
142
|
+
var reactIs_production_min_17 = reactIs_production_min.isElement;
|
|
143
|
+
var reactIs_production_min_18 = reactIs_production_min.isForwardRef;
|
|
144
|
+
var reactIs_production_min_19 = reactIs_production_min.isFragment;
|
|
145
|
+
var reactIs_production_min_20 = reactIs_production_min.isProfiler;
|
|
146
|
+
var reactIs_production_min_21 = reactIs_production_min.isPortal;
|
|
147
|
+
var reactIs_production_min_22 = reactIs_production_min.isStrictMode;
|
|
146
148
|
|
|
147
149
|
var reactIs = createCommonjsModule(function (module) {
|
|
148
150
|
|
|
@@ -151,22 +153,19 @@
|
|
|
151
153
|
}
|
|
152
154
|
});
|
|
153
155
|
|
|
154
|
-
var _ReactIs$ForwardRef;
|
|
155
|
-
|
|
156
|
-
function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
157
|
-
|
|
158
156
|
/**
|
|
159
157
|
* Copyright 2015, Yahoo! Inc.
|
|
160
158
|
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
|
161
159
|
*/
|
|
162
160
|
|
|
163
|
-
|
|
164
161
|
var REACT_STATICS = {
|
|
165
162
|
childContextTypes: true,
|
|
163
|
+
contextType: true,
|
|
166
164
|
contextTypes: true,
|
|
167
165
|
defaultProps: true,
|
|
168
166
|
displayName: true,
|
|
169
167
|
getDefaultProps: true,
|
|
168
|
+
getDerivedStateFromError: true,
|
|
170
169
|
getDerivedStateFromProps: true,
|
|
171
170
|
mixins: true,
|
|
172
171
|
propTypes: true,
|
|
@@ -183,7 +182,16 @@
|
|
|
183
182
|
arity: true
|
|
184
183
|
};
|
|
185
184
|
|
|
186
|
-
var
|
|
185
|
+
var FORWARD_REF_STATICS = {
|
|
186
|
+
'$$typeof': true,
|
|
187
|
+
render: true,
|
|
188
|
+
defaultProps: true,
|
|
189
|
+
displayName: true,
|
|
190
|
+
propTypes: true
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
var TYPE_STATICS = {};
|
|
194
|
+
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
187
195
|
|
|
188
196
|
var defineProperty = Object.defineProperty;
|
|
189
197
|
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
@@ -567,8 +575,8 @@
|
|
|
567
575
|
configurable: true,
|
|
568
576
|
enumerable: true
|
|
569
577
|
}
|
|
570
|
-
/**
|
|
571
|
-
* Store Injection
|
|
578
|
+
/**
|
|
579
|
+
* Store Injection
|
|
572
580
|
*/
|
|
573
581
|
|
|
574
582
|
};
|
|
@@ -652,11 +660,11 @@
|
|
|
652
660
|
return nextProps;
|
|
653
661
|
};
|
|
654
662
|
}
|
|
655
|
-
/**
|
|
656
|
-
* higher order component that injects stores to a child.
|
|
657
|
-
* takes either a varargs list of strings, which are stores read from the context,
|
|
658
|
-
* or a function that manually maps the available stores from the context to props:
|
|
659
|
-
* storesToProps(mobxStores, props, context) => newProps
|
|
663
|
+
/**
|
|
664
|
+
* higher order component that injects stores to a child.
|
|
665
|
+
* takes either a varargs list of strings, which are stores read from the context,
|
|
666
|
+
* or a function that manually maps the available stores from the context to props:
|
|
667
|
+
* storesToProps(mobxStores, props, context) => newProps
|
|
660
668
|
*/
|
|
661
669
|
|
|
662
670
|
|
|
@@ -694,8 +702,8 @@
|
|
|
694
702
|
|
|
695
703
|
var mobxAdminProperty = mobx.$mobx || "$mobx";
|
|
696
704
|
var mobxIsUnmounted = newSymbol("isUnmounted");
|
|
697
|
-
/**
|
|
698
|
-
* dev tool support
|
|
705
|
+
/**
|
|
706
|
+
* dev tool support
|
|
699
707
|
*/
|
|
700
708
|
|
|
701
709
|
var isDevtoolsEnabled = false;
|
|
@@ -705,12 +713,14 @@
|
|
|
705
713
|
var componentByNodeRegistry = typeof WeakMap !== "undefined" ? new WeakMap() : undefined;
|
|
706
714
|
var renderReporter = new EventEmitter();
|
|
707
715
|
var skipRenderKey = newSymbol("skipRender");
|
|
708
|
-
var isForcingUpdateKey = newSymbol("isForcingUpdate");
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
*
|
|
713
|
-
* @param
|
|
716
|
+
var isForcingUpdateKey = newSymbol("isForcingUpdate"); // Using react-is had some issues (and operates on elements, not on types), see #608 / #609
|
|
717
|
+
|
|
718
|
+
var ReactForwardRefSymbol = typeof React.forwardRef === "function" && React.forwardRef(function (_props, _ref) {})["$$typeof"];
|
|
719
|
+
/**
|
|
720
|
+
* Helper to set `prop` to `this` as non-enumerable (hidden prop)
|
|
721
|
+
* @param target
|
|
722
|
+
* @param prop
|
|
723
|
+
* @param value
|
|
714
724
|
*/
|
|
715
725
|
|
|
716
726
|
function setHiddenProp(target, prop, value) {
|
|
@@ -760,13 +770,13 @@
|
|
|
760
770
|
function useStaticRendering(useStaticRendering) {
|
|
761
771
|
isUsingStaticRendering = useStaticRendering;
|
|
762
772
|
}
|
|
763
|
-
/**
|
|
764
|
-
* Errors reporter
|
|
773
|
+
/**
|
|
774
|
+
* Errors reporter
|
|
765
775
|
*/
|
|
766
776
|
|
|
767
777
|
var errorsReporter = new EventEmitter();
|
|
768
|
-
/**
|
|
769
|
-
* Utilities
|
|
778
|
+
/**
|
|
779
|
+
* Utilities
|
|
770
780
|
*/
|
|
771
781
|
|
|
772
782
|
function patch$1(target, funcName) {
|
|
@@ -841,15 +851,15 @@
|
|
|
841
851
|
|
|
842
852
|
var initialName = this.displayName || this.name || this.constructor && (this.constructor.displayName || this.constructor.name) || "<component>";
|
|
843
853
|
var rootNodeID = this._reactInternalInstance && this._reactInternalInstance._rootNodeID || this._reactInternalInstance && this._reactInternalInstance._debugID || this._reactInternalFiber && this._reactInternalFiber._debugID;
|
|
844
|
-
/**
|
|
845
|
-
* If props are shallowly modified, react will render anyway,
|
|
846
|
-
* so atom.reportChanged() should not result in yet another re-render
|
|
854
|
+
/**
|
|
855
|
+
* If props are shallowly modified, react will render anyway,
|
|
856
|
+
* so atom.reportChanged() should not result in yet another re-render
|
|
847
857
|
*/
|
|
848
858
|
|
|
849
859
|
setHiddenProp(this, skipRenderKey, false);
|
|
850
|
-
/**
|
|
851
|
-
* forceUpdate will re-assign this.props. We don't want that to cause a loop,
|
|
852
|
-
* so detect these changes
|
|
860
|
+
/**
|
|
861
|
+
* forceUpdate will re-assign this.props. We don't want that to cause a loop,
|
|
862
|
+
* so detect these changes
|
|
853
863
|
*/
|
|
854
864
|
|
|
855
865
|
setHiddenProp(this, isForcingUpdateKey, false); // wire up reactive render
|
|
@@ -867,7 +877,7 @@
|
|
|
867
877
|
if (_this2[mobxIsUnmounted] !== true) {
|
|
868
878
|
// If we are unmounted at this point, componentWillReact() had a side effect causing the component to unmounted
|
|
869
879
|
// TODO: remove this check? Then react will properly warn about the fact that this should not happen? See #73
|
|
870
|
-
// However, people also claim this
|
|
880
|
+
// However, people also claim this might happen during unit tests..
|
|
871
881
|
var hasError = true;
|
|
872
882
|
|
|
873
883
|
try {
|
|
@@ -886,8 +896,8 @@
|
|
|
886
896
|
this.render = reactiveRender;
|
|
887
897
|
return reactiveRender.call(this);
|
|
888
898
|
}
|
|
889
|
-
/**
|
|
890
|
-
* ReactiveMixin
|
|
899
|
+
/**
|
|
900
|
+
* ReactiveMixin
|
|
891
901
|
*/
|
|
892
902
|
|
|
893
903
|
|
|
@@ -970,8 +980,8 @@
|
|
|
970
980
|
}
|
|
971
981
|
});
|
|
972
982
|
}
|
|
973
|
-
/**
|
|
974
|
-
* Observer function / decorator
|
|
983
|
+
/**
|
|
984
|
+
* Observer function / decorator
|
|
975
985
|
*/
|
|
976
986
|
|
|
977
987
|
|
|
@@ -1006,6 +1016,21 @@
|
|
|
1006
1016
|
|
|
1007
1017
|
if (componentClass.__proto__ === React.PureComponent) {
|
|
1008
1018
|
console.warn("Mobx observer: You are using 'observer' on React.PureComponent. These two achieve two opposite goals and should not be used together");
|
|
1019
|
+
} // Unwrap forward refs into `<Observer>` component
|
|
1020
|
+
// we need to unwrap the render, because it is the inner render that needs to be tracked,
|
|
1021
|
+
// not the ForwardRef HoC
|
|
1022
|
+
|
|
1023
|
+
|
|
1024
|
+
if (ReactForwardRefSymbol && componentClass["$$typeof"] === ReactForwardRefSymbol) {
|
|
1025
|
+
var _baseRender = componentClass.render;
|
|
1026
|
+
if (typeof _baseRender !== "function") throw new Error("render property of ForwardRef was not a function"); // TODO: do we need to hoist statics from baseRender to the forward ref?
|
|
1027
|
+
|
|
1028
|
+
return React.forwardRef(function ObserverForwardRef() {
|
|
1029
|
+
var _arguments = arguments;
|
|
1030
|
+
return React__default.createElement(Observer, null, function () {
|
|
1031
|
+
return _baseRender.apply(undefined, _arguments);
|
|
1032
|
+
});
|
|
1033
|
+
});
|
|
1009
1034
|
} // Stateless function component:
|
|
1010
1035
|
// If it is function but doesn't seem to be a react class constructor,
|
|
1011
1036
|
// wrap it to a react class automatically
|
|
@@ -1071,10 +1096,10 @@
|
|
|
1071
1096
|
}
|
|
1072
1097
|
}
|
|
1073
1098
|
|
|
1074
|
-
var Observer = observer(function (
|
|
1075
|
-
var children =
|
|
1076
|
-
observerInject =
|
|
1077
|
-
render =
|
|
1099
|
+
var Observer = observer(function (_ref2) {
|
|
1100
|
+
var children = _ref2.children,
|
|
1101
|
+
observerInject = _ref2.inject,
|
|
1102
|
+
render = _ref2.render;
|
|
1078
1103
|
var component = children || render;
|
|
1079
1104
|
|
|
1080
1105
|
if (typeof component === "undefined") {
|
package/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("mobx"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","mobx","react-dom"],t):t(e.mobxReact={},e.React,e.mobx,e.ReactDOM)}(this,function(e,u,p,t){"use strict";var a="default"in u?u.default:u;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function o(e,t){return e(t={exports:{}},t.exports),t.exports}var i,c=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.placeholder"):60113;function d(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case l:case i:case s:case a:return e;default:switch(e=e&&e.$$typeof){case u:case p:case c:return e;default:return t}}case o:return t}}}t.typeOf=d,t.AsyncMode=l,t.ContextConsumer=u,t.ContextProvider=c,t.Element=r,t.ForwardRef=p,t.Fragment=i,t.Profiler=s,t.Portal=o,t.StrictMode=a,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===l||e===s||e===a||e===f||"object"==typeof e&&null!==e&&("function"==typeof e.then||e.$$typeof===c||e.$$typeof===u||e.$$typeof===p)},t.isAsyncMode=function(e){return d(e)===l},t.isContextConsumer=function(e){return d(e)===u},t.isContextProvider=function(e){return d(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return d(e)===p},t.isFragment=function(e){return d(e)===i},t.isProfiler=function(e){return d(e)===s},t.isPortal=function(e){return d(e)===o},t.isStrictMode=function(e){return d(e)===a}});(i=c)&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")&&i.default;c.typeOf,c.AsyncMode,c.ContextConsumer,c.ContextProvider,c.Element,c.ForwardRef,c.Fragment,c.Profiler,c.Portal,c.StrictMode,c.isValidElementType,c.isAsyncMode,c.isContextConsumer,c.isContextProvider,c.isElement,c.isForwardRef,c.isFragment,c.isProfiler,c.isPortal,c.isStrictMode;var b,v=o(function(e){e.exports=c});function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},O={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},_=g({},v.ForwardRef,(g(b={},"$$typeof",!0),g(b,"render",!0),b)),x=Object.defineProperty,P=Object.getOwnPropertyNames,S=Object.getOwnPropertySymbols,j=Object.getOwnPropertyDescriptor,C=Object.getPrototypeOf,E=Object.prototype;var U=function e(t,n,r){if("string"==typeof n)return t;if(E){var o=C(n);o&&o!==E&&e(t,o,r)}var i=P(n);S&&(i=i.concat(S(n)));for(var a=_[t.$$typeof]||w,s=_[n.$$typeof]||w,c=0;c<i.length;++c){var u=i[c];if(!(O[u]||r&&r[u]||s&&s[u]||a&&a[u])){var l=j(n,u);try{x(t,u,l)}catch(e){}}}return t},M=function(){function e(){l(this,e),this.listeners=[]}return f(e,[{key:"on",value:function(t){var n=this;return this.listeners.push(t),function(){var e=n.listeners.indexOf(t);-1!==e&&n.listeners.splice(e,1)}}},{key:"emit",value:function(t){this.listeners.forEach(function(e){return e(t)})}}]),e}();function R(u){function e(t,n,r,o,i,a){for(var e=arguments.length,s=new Array(6<e?e-6:0),c=6;c<e;c++)s[c-6]=arguments[c];return p.untracked(function(){if(o=o||"<<anonymous>>",a=a||r,null!=n[r])return u.apply(void 0,[n,r,o,i,a].concat(s));if(t){var e=null===n[r]?"null":"undefined";return new Error("The "+i+" `"+a+"` is marked as required in `"+o+"`, but its value is `"+e+"`.")}return null})}var t=e.bind(null,!1);return t.isRequired=e.bind(null,!0),t}function k(e){var t,n=s(e);return Array.isArray(e)?"array":e instanceof RegExp?"object":(t=e,"symbol"===n||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol?"symbol":n)}function D(c,u){return R(function(o,i,a,e,s){return p.untracked(function(){if(c&&k(o[i])===u.toLowerCase())return null;var e;switch(u){case"Array":e=p.isObservableArray;break;case"Object":e=p.isObservableObject;break;case"Map":e=p.isObservableMap;break;default:throw new Error("Unexpected mobxType: ".concat(u))}var t=o[i];if(e(t))return null;var n=function(e){var t=k(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}(t),r=c?" or javascript `"+u.toLowerCase()+"`":"";return new Error("Invalid prop `"+s+"` of type `"+n+"` supplied to `"+a+"`, expected `mobx.Observable"+u+"`"+r+".")})})}function A(u,l){return R(function(r,o,i,a,s){for(var e=arguments.length,c=new Array(5<e?e-5:0),t=5;t<e;t++)c[t-5]=arguments[t];return p.untracked(function(){if("function"!=typeof l)return new Error("Property `"+s+"` of component `"+i+"` has invalid PropType notation.");var e=D(u,"Array")(r,o,i);if(e instanceof Error)return e;for(var t=r[o],n=0;n<t.length;n++)if((e=l.apply(void 0,[t,n,i,a,s+"["+n+"]"].concat(c)))instanceof Error)return e;return null})})}var T=D(!1,"Array"),I=A.bind(null,!1),F=D(!1,"Map"),W=D(!1,"Object"),$=D(!0,"Array"),N=A.bind(null,!0),B=D(!0,"Object"),L=Object.freeze({observableArray:T,observableArrayOf:I,observableMap:F,observableObject:W,arrayOrObservableArray:$,arrayOrObservableArrayOf:N,objectOrObservableObject:B});var q=0;function X(e){if("function"==typeof Symbol)return Symbol(e);var t="__$mobx-react ".concat(e," (").concat(q,")");return q++,t}var H=X("patchMixins"),V=X("patchedDefinition");function G(e,t){for(var n=this,r=arguments.length,o=new Array(2<r?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];t.locks++;try{var a;return null!=e&&(a=e.apply(this,o)),a}finally{t.locks--,0===t.locks&&t.methods.forEach(function(e){e.apply(n,o)})}}function K(r,o){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];G.call.apply(G,[this,r,o].concat(t))}}function Y(e,t){for(var n,r,o,i,a=(r=t,o=(n=e)[H]=n[H]||{},(i=o[r]=o[r]||{}).locks=i.locks||0,i.methods=i.methods||[],i),s=arguments.length,c=new Array(2<s?s-2:0),u=2;u<s;u++)c[u-2]=arguments[u];for(var l=0;l<c.length;l++){var p=c[l];a.methods.indexOf(p)<0&&a.methods.push(p)}var f=Object.getOwnPropertyDescriptor(e,t);if(!f||!f[V]){var d=e[t],y=function n(r,o,i,a,e){var t;var s=K(e,a);return t={},h(t,V,!0),h(t,"get",function(){return s}),h(t,"set",function(e){if(this===r)s=K(e,a);else{var t=n(this,o,i,a,e);Object.defineProperty(this,o,t)}}),h(t,"configurable",!0),h(t,"enumerable",i),t}(e,t,f?f.enumerable:void 0,a,d);Object.defineProperty(e,t,y)}}var z={mobxStores:B};Object.seal(z);var J={contextTypes:{get:function(){return z},set:function(e){console.warn("Mobx Injector: you are trying to attach `contextTypes` on an component decorated with `inject` (or `observer`) HOC. Please specify the contextTypes on the wrapped component instead. It is accessible through the `wrappedComponent`")},configurable:!0,enumerable:!1},isMobxInjector:{value:!0,writable:!0,configurable:!0,enumerable:!0}};function Q(a,s,e){var t="inject-"+(s.displayName||s.name||s.constructor&&s.constructor.name||"Unknown");e&&(t+="-with-"+e);var n=function(e){function i(){var e,t;l(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=m(this,(e=y(i)).call.apply(e,[this].concat(r)))).storeRef=function(e){t.wrappedInstance=e},t}return d(i,u.Component),f(i,[{key:"render",value:function(){var e={};for(var t in this.props)this.props.hasOwnProperty(t)&&(e[t]=this.props[t]);var n,r=a(this.context.mobxStores||{},e,this.context)||{};for(var o in r)e[o]=r[o];return(n=s).prototype&&n.prototype.render&&(e.ref=this.storeRef),u.createElement(s,e)}}]),i}();return n.displayName=t,U(n,s),n.wrappedComponent=s,Object.defineProperties(n,J),n}function Z(){var n,e;if("function"==typeof arguments[0])return n=arguments[0],function(e){var t=Q(n,e);return t.isMobxInjector=!1,(t=ve(t)).isMobxInjector=!0,t};for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e=t,n=function(t,n){return e.forEach(function(e){if(!(e in n)){if(!(e in t))throw new Error("MobX injector: Store '"+e+"' is not available! Make sure it is provided by some Provider");n[e]=t[e]}}),n},function(e){return Q(n,e,t.join("-"))}}var ee=p.$mobx||"$mobx",te=X("isUnmounted"),ne=!1,re=!1,oe=!1,ie="undefined"!=typeof WeakMap?new WeakMap:void 0,ae=new M,se=X("skipRender"),ce=X("isForcingUpdate");function ue(e,t,n){Object.hasOwnProperty.call(e,t)?e[t]=n:Object.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:n})}function le(e){if(t.findDOMNode)try{return t.findDOMNode(e)}catch(e){return null}return null}function pe(e){var t=le(e);t&&ie&&ie.set(t,e),ae.emit({event:"render",renderTime:e.__$mobRenderEnd-e.__$mobRenderStart,totalTime:Date.now()-e.__$mobRenderStart,component:e,node:t})}function fe(){if("undefined"==typeof WeakMap)throw new Error("[mobx-react] tracking components is not supported in this browser.");ne||(ne=!0)}var de=new M;function ye(e,t){if(he(e,t))return!0;if("object"!==s(e)||null===e||"object"!==s(t)||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!hasOwnProperty.call(t,n[o])||!he(e[n[o]],t[n[o]]))return!1;return!0}function he(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}var me={componentWillUnmount:function(){if(!0!==re&&(this.render[ee]&&this.render[ee].dispose(),this[te]=!0,ne)){var e=le(this);e&&ie&&ie.delete(e),ae.emit({event:"destroy",component:this,node:e})}},componentDidMount:function(){ne&&pe(this)},componentDidUpdate:function(){ne&&pe(this)},shouldComponentUpdate:function(e,t){return re&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==t||!ye(this.props,e)}};function be(e,t){var n=X("reactProp_".concat(t,"_valueHolder")),r=X("reactProp_".concat(t,"_atomHolder"));function o(){return this[r]||ue(this,r,p.createAtom("reactive "+t)),this[r]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return o.call(this).reportObserved(),this[n]},set:function(e){this[ce]||ye(this[n],e)?ue(this,n,e):(ue(this,n,e),ue(this,se,!0),o.call(this).reportChanged(),ue(this,se,!1))}})}function ve(t,e){if("string"==typeof t)throw new Error("Store names should be provided as array");if(Array.isArray(t))return oe||(oe=!0,console.warn('Mobx observer: Using observer to inject stores is deprecated since 4.0. Use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))` instead of `@observer(["store1", "store2"]) ComponentClass`')),e?Z.apply(null,t)(ve(e)):function(e){return ve(t,e)};var n=t;if(!0===n.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),n.__proto__===u.PureComponent&&console.warn("Mobx observer: You are using 'observer' on React.PureComponent. These two achieve two opposite goals and should not be used together"),!("function"!=typeof n||n.prototype&&n.prototype.render||n.isReactClass||u.Component.isPrototypeOf(n))){var r,o,i=ve((o=r=function(e){function t(){return l(this,t),m(this,y(t).apply(this,arguments))}return d(t,u.Component),f(t,[{key:"render",value:function(){return n.call(this,this.props,this.context)}}]),t}(),r.displayName=n.displayName||n.name,r.contextTypes=n.contextTypes,r.propTypes=n.propTypes,r.defaultProps=n.defaultProps,o));return U(i,n),i}if(!n)throw new Error("Please pass a valid component to 'observer'");var a,s=n.prototype||n;a=s,["componentDidMount","componentWillUnmount","componentDidUpdate"].forEach(function(e){var t;Y(a,t=e,me[t])}),a.shouldComponentUpdate?a.shouldComponentUpdate!==me.shouldComponentUpdate&&console.warn("Use `shouldComponentUpdate` in an `observer` based component breaks the behavior of `observer` and might lead to unexpected results. Manually implementing `sCU` should not be needed when using mobx-react."):a.shouldComponentUpdate=me.shouldComponentUpdate,n.isMobXReactObserver=!0,be(s,"props"),be(s,"state");var c=s.render;return s.render=function(){return function(e){var t=this;if(!0===re)return e.call(this);function n(){var e=this;a=!1;var t=void 0,n=void 0;if(s.track(function(){ne&&(e.__$mobRenderStart=Date.now());try{n=p._allowStateChanges(!1,i)}catch(e){t=e}ne&&(e.__$mobRenderEnd=Date.now())}),t)throw de.emit(t),t;return n}var r=this.displayName||this.name||this.constructor&&(this.constructor.displayName||this.constructor.name)||"<component>",o=this._reactInternalInstance&&this._reactInternalInstance._rootNodeID||this._reactInternalInstance&&this._reactInternalInstance._debugID||this._reactInternalFiber&&this._reactInternalFiber._debugID;ue(this,se,!1),ue(this,ce,!1);var i=e.bind(this),a=!1,s=new p.Reaction("".concat(r,"#").concat(o,".render()"),function(){if(!a&&(a=!0,"function"==typeof t.componentWillReact&&t.componentWillReact(),!0!==t[te])){var e=!0;try{ue(t,ce,!0),t[se]||u.Component.prototype.forceUpdate.call(t),e=!1}finally{ue(t,ce,!1),e&&s.dispose()}}});return s.reactComponent=this,n[ee]=s,(this.render=n).call(this)}.call(this,c)},n}var ge=ve(function(e){var t=e.children,n=e.inject,r=e.render,o=t||r;if(void 0===o)return null;if(!n)return o();console.warn("<Observer inject=.../> is no longer supported. Please use inject on the enclosing component instead");var i=Z(n)(o);return a.createElement(i,null)});ge.displayName="Observer";var we=function(e,t,n,r,o){var i="children"===t?"render":"children";return"function"==typeof e[t]&&"function"==typeof e[i]?new Error("Invalid prop,do not use children and render in the same time in`"+n):"function"!=typeof e[t]&&"function"!=typeof e[i]?new Error("Invalid prop `"+o+"` of type `"+s(e[t])+"` supplied to `"+n+"`, expected `function`."):void 0};function Oe(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function _e(n){this.setState(function(e){var t=this.constructor.getDerivedStateFromProps(n,e);return null!=t?t:null}.bind(this))}function xe(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}ge.propTypes={render:we,children:we};var Pe={children:xe.__suppressDeprecationWarning=_e.__suppressDeprecationWarning=Oe.__suppressDeprecationWarning=!0,key:!0,ref:!0},Se=function(e){function r(e,t){var n;return l(this,r),(n=m(this,y(r).call(this,e,t))).state={},je(e,n.state),n}return d(r,u.Component),f(r,[{key:"render",value:function(){return u.Children.only(this.props.children)}},{key:"getChildContext",value:function(){var e={};return je(this.context.mobxStores,e),je(this.props,e),{mobxStores:e}}}],[{key:"getDerivedStateFromProps",value:function(e,t){if(!e)return null;if(!t)return e;if(Object.keys(e).filter(Ce).length!==Object.keys(t).filter(Ce).length&&console.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!e.suppressChangedStoreWarning)for(var n in e)Ce(n)&&t[n]!==e[n]&&console.warn("MobX Provider: Provided store '"+n+"' has changed. Please avoid replacing stores as the change might not propagate to all children");return e}}]),r}();function je(e,t){if(e)for(var n in e)Ce(n)&&(t[n]=e[n])}function Ce(e){return!Pe[e]&&"suppressChangedStoreWarning"!==e}Se.contextTypes={mobxStores:B},Se.childContextTypes={mobxStores:B.isRequired},function(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return;var n=null,r=null,o=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?r="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(r="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?o="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(o="UNSAFE_componentWillUpdate"),null!==n||null!==r||null!==o){var i=e.displayName||e.name,a="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+i+" uses "+a+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==r?"\n "+r:"")+(null!==o?"\n "+o:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=Oe,t.componentWillReceiveProps=_e),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=xe;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}}(Se);var Ee=X("disposeOnUnmount");function Ue(){var n=this;this[Ee]&&(this[Ee].forEach(function(e){var t="string"==typeof e?n[e]:e;if(null!=t){if("function"!=typeof t)throw new Error("[mobx-react] disposeOnUnmount only works on functions such as disposers returned by reactions, autorun, etc.");t()}}),this[Ee]=[])}if(!u.Component)throw new Error("mobx-react requires React to be available");if(!p.spy)throw new Error("mobx-react requires mobx to be available");"function"==typeof t.unstable_batchedUpdates&&p.configure({reactionScheduler:t.unstable_batchedUpdates});if("object"===("undefined"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__?"undefined":s(__MOBX_DEVTOOLS_GLOBAL_HOOK__))){var Me={spy:p.spy,extras:{getDebugName:p.getDebugName}},Re={renderReporter:ae,componentByNodeRegistry:ie,componentByNodeRegistery:ie,trackComponents:fe};__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobxReact(Re,Me)}e.propTypes=L,e.PropTypes=L,e.onError=function(e){return de.on(e)},e.observer=ve,e.Observer=ge,e.renderReporter=ae,e.componentByNodeRegistery=ie,e.componentByNodeRegistry=ie,e.trackComponents=fe,e.useStaticRendering=function(e){re=e},e.Provider=Se,e.inject=Z,e.disposeOnUnmount=function t(n,e){if(Array.isArray(e))return e.map(function(e){return t(n,e)});if(!n instanceof u.Component)throw new Error("[mobx-react] disposeOnUnmount only works on class based React components.");if("string"!=typeof e&&"function"!=typeof e)throw new Error("[mobx-react] disposeOnUnmount only works if the parameter is either a property key or a function.");var r=!!n[Ee];return(n[Ee]||(n[Ee]=[])).push(e),r||Y(n,"componentWillUnmount",Ue),"string"!=typeof e?e:void 0},Object.defineProperty(e,"__esModule",{value:!0})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("mobx"),require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","mobx","react","react-dom"],t):t(e.mobxReact={},e.mobx,e.React,e.ReactDOM)}(this,function(e,l,p,t){"use strict";var f="default"in p?p.default:p;function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function o(e,t){return e(t={exports:{}},t.exports),t.exports}var i,s=o(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,p=n?Symbol.for("react.async_mode"):60111,l=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,y=n?Symbol.for("react.memo"):60115,h=n?Symbol.for("react.lazy"):60116;function m(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case p:case l:case i:case s:case a:return e;default:switch(e=e&&e.$$typeof){case u:case f:case c:return e;default:return t}}case o:return t}}}function b(e){return m(e)===l}t.typeOf=m,t.AsyncMode=p,t.ConcurrentMode=l,t.ContextConsumer=u,t.ContextProvider=c,t.Element=r,t.ForwardRef=f,t.Fragment=i,t.Profiler=s,t.Portal=o,t.StrictMode=a,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===l||e===s||e===a||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===c||e.$$typeof===u||e.$$typeof===f)},t.isAsyncMode=function(e){return b(e)||m(e)===p},t.isConcurrentMode=b,t.isContextConsumer=function(e){return m(e)===u},t.isContextProvider=function(e){return m(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return m(e)===f},t.isFragment=function(e){return m(e)===i},t.isProfiler=function(e){return m(e)===s},t.isPortal=function(e){return m(e)===o},t.isStrictMode=function(e){return m(e)===a}});(i=s)&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")&&i.default;s.typeOf,s.AsyncMode,s.ConcurrentMode,s.ContextConsumer,s.ContextProvider,s.Element,s.ForwardRef,s.Fragment,s.Profiler,s.Portal,s.StrictMode,s.isValidElementType,s.isAsyncMode,s.isConcurrentMode,s.isContextConsumer,s.isContextProvider,s.isElement,s.isForwardRef,s.isFragment,s.isProfiler,s.isPortal,s.isStrictMode;var c=o(function(e){e.exports=s}),g={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},w={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},O={};O[c.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var _=Object.defineProperty,x=Object.getOwnPropertyNames,S=Object.getOwnPropertySymbols,P=Object.getOwnPropertyDescriptor,j=Object.getPrototypeOf,C=Object.prototype;var E=function e(t,n,r){if("string"==typeof n)return t;if(C){var o=j(n);o&&o!==C&&e(t,o,r)}var i=x(n);S&&(i=i.concat(S(n)));for(var a=O[t.$$typeof]||g,s=O[n.$$typeof]||g,c=0;c<i.length;++c){var u=i[c];if(!(w[u]||r&&r[u]||s&&s[u]||a&&a[u])){var p=P(n,u);try{_(t,u,p)}catch(e){}}}return t},u=function(){function e(){d(this,e),this.listeners=[]}return y(e,[{key:"on",value:function(t){var n=this;return this.listeners.push(t),function(){var e=n.listeners.indexOf(t);-1!==e&&n.listeners.splice(e,1)}}},{key:"emit",value:function(t){this.listeners.forEach(function(e){return e(t)})}}]),e}();function M(u){function e(t,n,r,o,i,a){for(var e=arguments.length,s=new Array(6<e?e-6:0),c=6;c<e;c++)s[c-6]=arguments[c];return l.untracked(function(){if(o=o||"<<anonymous>>",a=a||r,null!=n[r])return u.apply(void 0,[n,r,o,i,a].concat(s));if(t){var e=null===n[r]?"null":"undefined";return new Error("The "+i+" `"+a+"` is marked as required in `"+o+"`, but its value is `"+e+"`.")}return null})}var t=e.bind(null,!1);return t.isRequired=e.bind(null,!0),t}function U(e){var t,n=a(e);return Array.isArray(e)?"array":e instanceof RegExp?"object":(t=e,"symbol"===n||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol?"symbol":n)}function R(c,u){return M(function(o,i,a,e,s){return l.untracked(function(){if(c&&U(o[i])===u.toLowerCase())return null;var e;switch(u){case"Array":e=l.isObservableArray;break;case"Object":e=l.isObservableObject;break;case"Map":e=l.isObservableMap;break;default:throw new Error("Unexpected mobxType: ".concat(u))}var t=o[i];if(e(t))return null;var n=function(e){var t=U(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}(t),r=c?" or javascript `"+u.toLowerCase()+"`":"";return new Error("Invalid prop `"+s+"` of type `"+n+"` supplied to `"+a+"`, expected `mobx.Observable"+u+"`"+r+".")})})}function k(u,p){return M(function(r,o,i,a,s){for(var e=arguments.length,c=new Array(5<e?e-5:0),t=5;t<e;t++)c[t-5]=arguments[t];return l.untracked(function(){if("function"!=typeof p)return new Error("Property `"+s+"` of component `"+i+"` has invalid PropType notation.");var e=R(u,"Array")(r,o,i);if(e instanceof Error)return e;for(var t=r[o],n=0;n<t.length;n++)if((e=p.apply(void 0,[t,n,i,a,s+"["+n+"]"].concat(c)))instanceof Error)return e;return null})})}var D=R(!1,"Array"),A=k.bind(null,!1),$=R(!1,"Map"),T=R(!1,"Object"),F=R(!0,"Array"),I=k.bind(null,!0),W=R(!0,"Object"),N=Object.freeze({observableArray:D,observableArrayOf:A,observableMap:$,observableObject:T,arrayOrObservableArray:F,arrayOrObservableArrayOf:I,objectOrObservableObject:W});var B=0;function L(e){if("function"==typeof Symbol)return Symbol(e);var t="__$mobx-react ".concat(e," (").concat(B,")");return B++,t}var q=L("patchMixins"),X=L("patchedDefinition");function H(e,t){for(var n=this,r=arguments.length,o=new Array(2<r?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];t.locks++;try{var a;return null!=e&&(a=e.apply(this,o)),a}finally{t.locks--,0===t.locks&&t.methods.forEach(function(e){e.apply(n,o)})}}function V(r,o){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];H.call.apply(H,[this,r,o].concat(t))}}function G(e,t){for(var n,r,o,i,a=(r=t,o=(n=e)[q]=n[q]||{},(i=o[r]=o[r]||{}).locks=i.locks||0,i.methods=i.methods||[],i),s=arguments.length,c=new Array(2<s?s-2:0),u=2;u<s;u++)c[u-2]=arguments[u];for(var p=0;p<c.length;p++){var l=c[p];a.methods.indexOf(l)<0&&a.methods.push(l)}var f=Object.getOwnPropertyDescriptor(e,t);if(!f||!f[X]){var d=e[t],y=function n(r,o,i,a,e){var t;var s=V(e,a);return t={},h(t,X,!0),h(t,"get",function(){return s}),h(t,"set",function(e){if(this===r)s=V(e,a);else{var t=n(this,o,i,a,e);Object.defineProperty(this,o,t)}}),h(t,"configurable",!0),h(t,"enumerable",i),t}(e,t,f?f.enumerable:void 0,a,d);Object.defineProperty(e,t,y)}}var K={mobxStores:W};Object.seal(K);var z={contextTypes:{get:function(){return K},set:function(e){console.warn("Mobx Injector: you are trying to attach `contextTypes` on an component decorated with `inject` (or `observer`) HOC. Please specify the contextTypes on the wrapped component instead. It is accessible through the `wrappedComponent`")},configurable:!0,enumerable:!1},isMobxInjector:{value:!0,writable:!0,configurable:!0,enumerable:!0}};function Y(a,s,e){var t="inject-"+(s.displayName||s.name||s.constructor&&s.constructor.name||"Unknown");e&&(t+="-with-"+e);var n=function(e){function i(){var e,t;d(this,i);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=v(this,(e=b(i)).call.apply(e,[this].concat(r)))).storeRef=function(e){t.wrappedInstance=e},t}return m(i,p.Component),y(i,[{key:"render",value:function(){var e={};for(var t in this.props)this.props.hasOwnProperty(t)&&(e[t]=this.props[t]);var n,r=a(this.context.mobxStores||{},e,this.context)||{};for(var o in r)e[o]=r[o];return(n=s).prototype&&n.prototype.render&&(e.ref=this.storeRef),p.createElement(s,e)}}]),i}();return n.displayName=t,E(n,s),n.wrappedComponent=s,Object.defineProperties(n,z),n}function J(){var n,e;if("function"==typeof arguments[0])return n=arguments[0],function(e){var t=Y(n,e);return t.isMobxInjector=!1,(t=be(t)).isMobxInjector=!0,t};for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e=t,n=function(t,n){return e.forEach(function(e){if(!(e in n)){if(!(e in t))throw new Error("MobX injector: Store '"+e+"' is not available! Make sure it is provided by some Provider");n[e]=t[e]}}),n},function(e){return Y(n,e,t.join("-"))}}var Q=l.$mobx||"$mobx",Z=L("isUnmounted"),ee=!1,te=!1,ne=!1,re="undefined"!=typeof WeakMap?new WeakMap:void 0,oe=new u,ie=L("skipRender"),ae=L("isForcingUpdate"),se="function"==typeof p.forwardRef&&p.forwardRef(function(e,t){}).$$typeof;function ce(e,t,n){Object.hasOwnProperty.call(e,t)?e[t]=n:Object.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:n})}function ue(e){if(t.findDOMNode)try{return t.findDOMNode(e)}catch(e){return null}return null}function pe(e){var t=ue(e);t&&re&&re.set(t,e),oe.emit({event:"render",renderTime:e.__$mobRenderEnd-e.__$mobRenderStart,totalTime:Date.now()-e.__$mobRenderStart,component:e,node:t})}function le(){if("undefined"==typeof WeakMap)throw new Error("[mobx-react] tracking components is not supported in this browser.");ee||(ee=!0)}var fe=new u;function de(e,t){if(ye(e,t))return!0;if("object"!==a(e)||null===e||"object"!==a(t)||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!hasOwnProperty.call(t,n[o])||!ye(e[n[o]],t[n[o]]))return!1;return!0}function ye(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}var he={componentWillUnmount:function(){if(!0!==te&&(this.render[Q]&&this.render[Q].dispose(),this[Z]=!0,ee)){var e=ue(this);e&&re&&re.delete(e),oe.emit({event:"destroy",component:this,node:e})}},componentDidMount:function(){ee&&pe(this)},componentDidUpdate:function(){ee&&pe(this)},shouldComponentUpdate:function(e,t){return te&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==t||!de(this.props,e)}};function me(e,t){var n=L("reactProp_".concat(t,"_valueHolder")),r=L("reactProp_".concat(t,"_atomHolder"));function o(){return this[r]||ce(this,r,l.createAtom("reactive "+t)),this[r]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return o.call(this).reportObserved(),this[n]},set:function(e){this[ae]||de(this[n],e)?ce(this,n,e):(ce(this,n,e),ce(this,ie,!0),o.call(this).reportChanged(),ce(this,ie,!1))}})}function be(t,e){if("string"==typeof t)throw new Error("Store names should be provided as array");if(Array.isArray(t))return ne||(ne=!0,console.warn('Mobx observer: Using observer to inject stores is deprecated since 4.0. Use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))` instead of `@observer(["store1", "store2"]) ComponentClass`')),e?J.apply(null,t)(be(e)):function(e){return be(t,e)};var n=t;if(!0===n.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),n.__proto__===p.PureComponent&&console.warn("Mobx observer: You are using 'observer' on React.PureComponent. These two achieve two opposite goals and should not be used together"),se&&n.$$typeof===se){var r=n.render;if("function"!=typeof r)throw new Error("render property of ForwardRef was not a function");return p.forwardRef(function(){var e=arguments;return f.createElement(ve,null,function(){return r.apply(void 0,e)})})}if(!("function"!=typeof n||n.prototype&&n.prototype.render||n.isReactClass||p.Component.isPrototypeOf(n))){var o,i,a=be((i=o=function(e){function t(){return d(this,t),v(this,b(t).apply(this,arguments))}return m(t,p.Component),y(t,[{key:"render",value:function(){return n.call(this,this.props,this.context)}}]),t}(),o.displayName=n.displayName||n.name,o.contextTypes=n.contextTypes,o.propTypes=n.propTypes,o.defaultProps=n.defaultProps,i));return E(a,n),a}if(!n)throw new Error("Please pass a valid component to 'observer'");var s,c=n.prototype||n;s=c,["componentDidMount","componentWillUnmount","componentDidUpdate"].forEach(function(e){var t;G(s,t=e,he[t])}),s.shouldComponentUpdate?s.shouldComponentUpdate!==he.shouldComponentUpdate&&console.warn("Use `shouldComponentUpdate` in an `observer` based component breaks the behavior of `observer` and might lead to unexpected results. Manually implementing `sCU` should not be needed when using mobx-react."):s.shouldComponentUpdate=he.shouldComponentUpdate,n.isMobXReactObserver=!0,me(c,"props"),me(c,"state");var u=c.render;return c.render=function(){return function(e){var t=this;if(!0===te)return e.call(this);function n(){var e=this;a=!1;var t=void 0,n=void 0;if(s.track(function(){ee&&(e.__$mobRenderStart=Date.now());try{n=l._allowStateChanges(!1,i)}catch(e){t=e}ee&&(e.__$mobRenderEnd=Date.now())}),t)throw fe.emit(t),t;return n}var r=this.displayName||this.name||this.constructor&&(this.constructor.displayName||this.constructor.name)||"<component>",o=this._reactInternalInstance&&this._reactInternalInstance._rootNodeID||this._reactInternalInstance&&this._reactInternalInstance._debugID||this._reactInternalFiber&&this._reactInternalFiber._debugID;ce(this,ie,!1),ce(this,ae,!1);var i=e.bind(this),a=!1,s=new l.Reaction("".concat(r,"#").concat(o,".render()"),function(){if(!a&&(a=!0,"function"==typeof t.componentWillReact&&t.componentWillReact(),!0!==t[Z])){var e=!0;try{ce(t,ae,!0),t[ie]||p.Component.prototype.forceUpdate.call(t),e=!1}finally{ce(t,ae,!1),e&&s.dispose()}}});return s.reactComponent=this,n[Q]=s,(this.render=n).call(this)}.call(this,u)},n}var ve=be(function(e){var t=e.children,n=e.inject,r=e.render,o=t||r;if(void 0===o)return null;if(!n)return o();console.warn("<Observer inject=.../> is no longer supported. Please use inject on the enclosing component instead");var i=J(n)(o);return f.createElement(i,null)});ve.displayName="Observer";var ge=function(e,t,n,r,o){var i="children"===t?"render":"children";return"function"==typeof e[t]&&"function"==typeof e[i]?new Error("Invalid prop,do not use children and render in the same time in`"+n):"function"!=typeof e[t]&&"function"!=typeof e[i]?new Error("Invalid prop `"+o+"` of type `"+a(e[t])+"` supplied to `"+n+"`, expected `function`."):void 0};function we(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function Oe(n){this.setState(function(e){var t=this.constructor.getDerivedStateFromProps(n,e);return null!=t?t:null}.bind(this))}function _e(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}ve.propTypes={render:ge,children:ge};var xe={children:_e.__suppressDeprecationWarning=Oe.__suppressDeprecationWarning=we.__suppressDeprecationWarning=!0,key:!0,ref:!0},Se=function(e){function r(e,t){var n;return d(this,r),(n=v(this,b(r).call(this,e,t))).state={},Pe(e,n.state),n}return m(r,p.Component),y(r,[{key:"render",value:function(){return p.Children.only(this.props.children)}},{key:"getChildContext",value:function(){var e={};return Pe(this.context.mobxStores,e),Pe(this.props,e),{mobxStores:e}}}],[{key:"getDerivedStateFromProps",value:function(e,t){if(!e)return null;if(!t)return e;if(Object.keys(e).filter(je).length!==Object.keys(t).filter(je).length&&console.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!e.suppressChangedStoreWarning)for(var n in e)je(n)&&t[n]!==e[n]&&console.warn("MobX Provider: Provided store '"+n+"' has changed. Please avoid replacing stores as the change might not propagate to all children");return e}}]),r}();function Pe(e,t){if(e)for(var n in e)je(n)&&(t[n]=e[n])}function je(e){return!xe[e]&&"suppressChangedStoreWarning"!==e}Se.contextTypes={mobxStores:W},Se.childContextTypes={mobxStores:W.isRequired},function(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return;var n=null,r=null,o=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?r="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(r="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?o="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(o="UNSAFE_componentWillUpdate"),null!==n||null!==r||null!==o){var i=e.displayName||e.name,a="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+i+" uses "+a+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==r?"\n "+r:"")+(null!==o?"\n "+o:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=we,t.componentWillReceiveProps=Oe),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=_e;var s=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;s.call(this,e,t,r)}}}(Se);var Ce=L("disposeOnUnmount");function Ee(){var n=this;this[Ce]&&(this[Ce].forEach(function(e){var t="string"==typeof e?n[e]:e;if(null!=t){if("function"!=typeof t)throw new Error("[mobx-react] disposeOnUnmount only works on functions such as disposers returned by reactions, autorun, etc.");t()}}),this[Ce]=[])}if(!p.Component)throw new Error("mobx-react requires React to be available");if(!l.spy)throw new Error("mobx-react requires mobx to be available");"function"==typeof t.unstable_batchedUpdates&&l.configure({reactionScheduler:t.unstable_batchedUpdates});if("object"===("undefined"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__?"undefined":a(__MOBX_DEVTOOLS_GLOBAL_HOOK__))){var Me={spy:l.spy,extras:{getDebugName:l.getDebugName}},Ue={renderReporter:oe,componentByNodeRegistry:re,componentByNodeRegistery:re,trackComponents:le};__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobxReact(Ue,Me)}e.propTypes=N,e.PropTypes=N,e.onError=function(e){return fe.on(e)},e.observer=be,e.Observer=ve,e.renderReporter=oe,e.componentByNodeRegistery=re,e.componentByNodeRegistry=re,e.trackComponents=le,e.useStaticRendering=function(e){te=e},e.Provider=Se,e.inject=J,e.disposeOnUnmount=function t(n,e){if(Array.isArray(e))return e.map(function(e){return t(n,e)});if(!n instanceof p.Component)throw new Error("[mobx-react] disposeOnUnmount only works on class based React components.");if("string"!=typeof e&&"function"!=typeof e)throw new Error("[mobx-react] disposeOnUnmount only works if the parameter is either a property key or a function.");var r=!!n[Ce];return(n[Ce]||(n[Ce]=[])).push(e),r||G(n,"componentWillUnmount",Ee),"string"!=typeof e?e:void 0},Object.defineProperty(e,"__esModule",{value:!0})});
|