react 16.0.0-alpha.12 → 16.0.0-beta.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.
@@ -1 +1 @@
1
- "use strict";function e(e){for(var t=arguments.length-1,r="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,n=0;n<t;n++)r+="&args[]="+encodeURIComponent(arguments[n+1]);r+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(r);throw o.name="Invariant Violation",o.framesToPop=1,o}function t(e,t){}function r(e,t,r){this.props=e,this.context=t,this.refs=A,this.updater=r||T}function n(e,t,r){this.props=e,this.context=t,this.refs=A,this.updater=r||T}function o(){}function i(e){return void 0!==e.ref}function a(e){return void 0!==e.key}function l(e){var t=e&&(Z&&e[Z]||e[ee]);if("function"==typeof t)return t}function u(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function c(e){var t={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(/(=0|=2)/g,function(e){return t[e]})}function s(e,t){return"object"==typeof e&&null!==e&&null!=e.key?ne.escape(e.key):t.toString(36)}function p(e,t,r,n){var o=typeof e;if("undefined"!==o&&"boolean"!==o||(e=null),null===e||"string"===o||"number"===o||"object"===o&&e.$$typeof===Y)return r(n,e,""===t?oe+s(e,0):t),1;var i,a,l=0,u=""===t?oe:t+ie;if(Array.isArray(e))for(var c=0;c<e.length;c++)i=e[c],a=u+s(i,c),l+=p(i,a,r,n);else{var f=te(e);if(f)for(var d,h=f.call(e),y=0;!(d=h.next()).done;)i=d.value,a=u+s(i,y++),l+=p(i,a,r,n);else if("object"===o){var m=""+e;R("31","[object Object]"===m?"object with keys {"+Object.keys(e).join(", ")+"}":m,"")}}return l}function f(e,t,r){return null==e?0:p(e,"",t,r)}function d(e){return(""+e).replace(ce,"$&/")}function h(e,t){this.func=e,this.context=t,this.count=0}function y(e,t,r){var n=e.func,o=e.context;n.call(o,t,e.count++)}function m(e,t,r){if(null==e)return e;var n=h.getPooled(t,r);ae(e,y,n),h.release(n)}function b(e,t,r,n){this.result=e,this.keyPrefix=t,this.func=r,this.context=n,this.count=0}function v(e,t,r){var n=e.result,o=e.keyPrefix,i=e.func,a=e.context,l=i.call(a,t,e.count++);Array.isArray(l)?g(l,n,r,j.thatReturnsArgument):null!=l&&(X.isValidElement(l)&&(l=X.cloneAndReplaceKey(l,o+(!l.key||t&&t.key===l.key?"":d(l.key)+"/")+r)),n.push(l))}function g(e,t,r,n,o){var i="";null!=r&&(i=d(r)+"/");var a=b.getPooled(t,i,n,o);ae(e,v,a),b.release(a)}function P(e,t,r){if(null==e)return e;var n=[];return g(e,n,null,t,r),n}function k(e,t,r){return null}function _(e,t){return ae(e,k,null)}function E(e){var t=[];return g(e,t,null,j.thatReturnsArgument),t}function w(e){return X.isValidElement(e)||R("143"),e}var S=require("object-assign");require("fbjs/lib/warning");var A=require("fbjs/lib/emptyObject");require("fbjs/lib/invariant");var j=require("fbjs/lib/emptyFunction"),x=require("prop-types"),q=require("prop-types/checkPropTypes"),C=require("create-react-class/factory"),R=e,O={isMounted:function(e){return!1},enqueueForceUpdate:function(e,r,n){t(e,"forceUpdate")},enqueueReplaceState:function(e,r,n,o){t(e,"replaceState")},enqueueSetState:function(e,r,n,o){t(e,"setState")}},T=O;r.prototype.isReactComponent={},r.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&R("85"),this.updater.enqueueSetState(this,e,t,"setState")},r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},o.prototype=r.prototype,n.prototype=new o,n.prototype.constructor=n,S(n.prototype,r.prototype),n.prototype.isPureReactComponent=!0;var $={Component:r,PureComponent:n},F=function(e){var t=this;if(t.instancePool.length){var r=t.instancePool.pop();return t.call(r,e),r}return new t(e)},U=function(e,t){var r=this;if(r.instancePool.length){var n=r.instancePool.pop();return r.call(n,e,t),n}return new r(e,t)},I=function(e,t,r){var n=this;if(n.instancePool.length){var o=n.instancePool.pop();return n.call(o,e,t,r),o}return new n(e,t,r)},V=function(e,t,r,n){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,e,t,r,n),i}return new o(e,t,r,n)},G=function(e){var t=this;e instanceof t||R("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},M=10,z=F,D=function(e,t){var r=e;return r.instancePool=[],r.getPooled=t||z,r.poolSize||(r.poolSize=M),r.release=G,r},K={addPoolingTo:D,oneArgumentPooler:F,twoArgumentPooler:U,threeArgumentPooler:I,fourArgumentPooler:V},L=K,N={current:null},W=N,B="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Y=B,H=Object.prototype.hasOwnProperty,J={key:!0,ref:!0,__self:!0,__source:!0},Q=function(e,t,r,n,o,i,a){return{$$typeof:Y,type:e,key:t,ref:r,props:a,_owner:i}};Q.createElement=function(e,t,r){var n,o={},l=null,u=null,c=null,s=null;if(null!=t){i(t)&&(u=t.ref),a(t)&&(l=""+t.key),c=void 0===t.__self?null:t.__self,s=void 0===t.__source?null:t.__source;for(n in t)H.call(t,n)&&!J.hasOwnProperty(n)&&(o[n]=t[n])}var p=arguments.length-2;if(1===p)o.children=r;else if(p>1){for(var f=Array(p),d=0;d<p;d++)f[d]=arguments[d+2];o.children=f}if(e&&e.defaultProps){var h=e.defaultProps;for(n in h)void 0===o[n]&&(o[n]=h[n])}return Q(e,l,u,c,s,W.current,o)},Q.createFactory=function(e){var t=Q.createElement.bind(null,e);return t.type=e,t},Q.cloneAndReplaceKey=function(e,t){return Q(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},Q.cloneElement=function(e,t,r){var n,o=S({},e.props),l=e.key,u=e.ref,c=e._self,s=e._source,p=e._owner;if(null!=t){i(t)&&(u=t.ref,p=W.current),a(t)&&(l=""+t.key);var f;e.type&&e.type.defaultProps&&(f=e.type.defaultProps);for(n in t)H.call(t,n)&&!J.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==f?o[n]=f[n]:o[n]=t[n])}var d=arguments.length-2;if(1===d)o.children=r;else if(d>1){for(var h=Array(d),y=0;y<d;y++)h[y]=arguments[y+2];o.children=h}return Q(e.type,l,u,c,s,p,o)},Q.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Y};var X=Q,Z="function"==typeof Symbol&&Symbol.iterator,ee="@@iterator",te=l,re={escape:u,unescape:c},ne=re,oe=".",ie=":",ae=f,le=L.twoArgumentPooler,ue=L.fourArgumentPooler,ce=/\/+/g;h.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},L.addPoolingTo(h,le),b.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},L.addPoolingTo(b,ue);var se={forEach:m,map:P,mapIntoWithKeyPrefixInternal:g,count:_,toArray:E},pe=se,fe=X.createFactory,de={a:fe("a"),abbr:fe("abbr"),address:fe("address"),area:fe("area"),article:fe("article"),aside:fe("aside"),audio:fe("audio"),b:fe("b"),base:fe("base"),bdi:fe("bdi"),bdo:fe("bdo"),big:fe("big"),blockquote:fe("blockquote"),body:fe("body"),br:fe("br"),button:fe("button"),canvas:fe("canvas"),caption:fe("caption"),cite:fe("cite"),code:fe("code"),col:fe("col"),colgroup:fe("colgroup"),data:fe("data"),datalist:fe("datalist"),dd:fe("dd"),del:fe("del"),details:fe("details"),dfn:fe("dfn"),dialog:fe("dialog"),div:fe("div"),dl:fe("dl"),dt:fe("dt"),em:fe("em"),embed:fe("embed"),fieldset:fe("fieldset"),figcaption:fe("figcaption"),figure:fe("figure"),footer:fe("footer"),form:fe("form"),h1:fe("h1"),h2:fe("h2"),h3:fe("h3"),h4:fe("h4"),h5:fe("h5"),h6:fe("h6"),head:fe("head"),header:fe("header"),hgroup:fe("hgroup"),hr:fe("hr"),html:fe("html"),i:fe("i"),iframe:fe("iframe"),img:fe("img"),input:fe("input"),ins:fe("ins"),kbd:fe("kbd"),keygen:fe("keygen"),label:fe("label"),legend:fe("legend"),li:fe("li"),link:fe("link"),main:fe("main"),map:fe("map"),mark:fe("mark"),menu:fe("menu"),menuitem:fe("menuitem"),meta:fe("meta"),meter:fe("meter"),nav:fe("nav"),noscript:fe("noscript"),object:fe("object"),ol:fe("ol"),optgroup:fe("optgroup"),option:fe("option"),output:fe("output"),p:fe("p"),param:fe("param"),picture:fe("picture"),pre:fe("pre"),progress:fe("progress"),q:fe("q"),rp:fe("rp"),rt:fe("rt"),ruby:fe("ruby"),s:fe("s"),samp:fe("samp"),script:fe("script"),section:fe("section"),select:fe("select"),small:fe("small"),source:fe("source"),span:fe("span"),strong:fe("strong"),style:fe("style"),sub:fe("sub"),summary:fe("summary"),sup:fe("sup"),table:fe("table"),tbody:fe("tbody"),td:fe("td"),textarea:fe("textarea"),tfoot:fe("tfoot"),th:fe("th"),thead:fe("thead"),time:fe("time"),title:fe("title"),tr:fe("tr"),track:fe("track"),u:fe("u"),ul:fe("ul"),var:fe("var"),video:fe("video"),wbr:fe("wbr"),circle:fe("circle"),clipPath:fe("clipPath"),defs:fe("defs"),ellipse:fe("ellipse"),g:fe("g"),image:fe("image"),line:fe("line"),linearGradient:fe("linearGradient"),mask:fe("mask"),path:fe("path"),pattern:fe("pattern"),polygon:fe("polygon"),polyline:fe("polyline"),radialGradient:fe("radialGradient"),rect:fe("rect"),stop:fe("stop"),svg:fe("svg"),text:fe("text"),tspan:fe("tspan")},he=de,ye=x,me="16.0.0-alpha.12",be=w,ve=$.Component,ge=X.isValidElement,Pe=C(ve,ge,T),ke=X.createElement,_e=X.createFactory,Ee=X.cloneElement,we=function(e){return e},Se={Children:{map:pe.map,forEach:pe.forEach,count:pe.count,toArray:pe.toArray,only:be},Component:$.Component,PureComponent:$.PureComponent,createElement:ke,cloneElement:Ee,isValidElement:X.isValidElement,PropTypes:ye,checkPropTypes:q,createClass:Pe,createFactory:_e,createMixin:we,DOM:he,version:me,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:W}},Ae=Se;module.exports=Ae;
1
+ "use strict";function e(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}function t(e,t){}function n(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||R}function r(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||R}function o(){}function u(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||R}function l(e){return void 0!==e.ref}function i(e){return void 0!==e.key}function c(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function a(e){return(""+e).replace(B,"$&/")}function f(e,t,n,r){if(Y.length){var o=Y.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function p(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,Y.length<W&&Y.push(e)}function s(e,t,n,r){var o=typeof e;if("undefined"!==o&&"boolean"!==o||(e=null),null===e||"string"===o||"number"===o||"object"===o&&e.$$typeof===D)return n(r,e,""===t?K+d(e,0):t),1;var u,l,i=0,c=""===t?K:t+M;if(Array.isArray(e))for(var a=0;a<e.length;a++)u=e[a],l=c+d(u,a),i+=s(u,l,n,r);else{var f=T&&e[T]||e[L];if("function"==typeof f)for(var p,y=f.call(e),m=0;!(p=y.next()).done;)u=p.value,l=c+d(u,m++),i+=s(u,l,n,r);else if("object"===o){var h=""+e;C("31","[object Object]"===h?"object with keys {"+Object.keys(e).join(", ")+"}":h,"")}}return i}function y(e,t,n){return null==e?0:s(e,"",t,n)}function d(e,t){return"object"==typeof e&&null!==e&&null!=e.key?c(e.key):t.toString(36)}function m(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function h(e,t,n){if(null==e)return e;var r=f(null,null,t,n);y(e,m,r),p(r)}function v(e,t,n){var r=e.result,o=e.keyPrefix,u=e.func,l=e.context,i=u.call(l,t,e.count++);Array.isArray(i)?b(i,r,n,j.thatReturnsArgument):null!=i&&(N.isValidElement(i)&&(i=N.cloneAndReplaceKey(i,o+(!i.key||t&&t.key===i.key?"":a(i.key)+"/")+n)),r.push(i))}function b(e,t,n,r,o){var u="";null!=n&&(u=a(n)+"/");var l=f(t,u,r,o);y(e,v,l),p(l)}function _(e,t,n){if(null==e)return e;var r=[];return b(e,r,null,t,n),r}function E(e,t){return y(e,j.thatReturnsNull,null)}function S(e){var t=[];return b(e,t,null,j.thatReturnsArgument),t}function k(e){return N.isValidElement(e)||C("143"),e}var A=require("object-assign"),g=require("fbjs/lib/emptyObject");require("fbjs/lib/invariant");var j=require("fbjs/lib/emptyFunction"),C=e,P={isMounted:function(e){return!1},enqueueForceUpdate:function(e,n,r){t(e,"forceUpdate")},enqueueReplaceState:function(e,n,r,o){t(e,"replaceState")},enqueueSetState:function(e,n,r,o){t(e,"setState")}},R=P;n.prototype.isReactComponent={},n.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&C("85"),this.updater.enqueueSetState(this,e,t,"setState")},n.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},o.prototype=n.prototype;var x=r.prototype=new o;x.constructor=r,A(x,n.prototype),x.isPureReactComponent=!0;var w=u.prototype=new o;w.constructor=u,A(w,n.prototype),w.unstable_isAsyncReactComponent=!0,w.render=function(){return this.props.children};var O={Component:n,PureComponent:r,AsyncComponent:u},q={current:null},U=q,$=Object.prototype.hasOwnProperty,F="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,V={key:!0,ref:!0,__self:!0,__source:!0},I=function(e,t,n,r,o,u,l){return{$$typeof:F,type:e,key:t,ref:n,props:l,_owner:u}};I.createElement=function(e,t,n){var r,o={},u=null,c=null,a=null,f=null;if(null!=t){l(t)&&(c=t.ref),i(t)&&(u=""+t.key),a=void 0===t.__self?null:t.__self,f=void 0===t.__source?null:t.__source;for(r in t)$.call(t,r)&&!V.hasOwnProperty(r)&&(o[r]=t[r])}var p=arguments.length-2;if(1===p)o.children=n;else if(p>1){for(var s=Array(p),y=0;y<p;y++)s[y]=arguments[y+2];o.children=s}if(e&&e.defaultProps){var d=e.defaultProps;for(r in d)void 0===o[r]&&(o[r]=d[r])}return I(e,u,c,a,f,U.current,o)},I.createFactory=function(e){var t=I.createElement.bind(null,e);return t.type=e,t},I.cloneAndReplaceKey=function(e,t){return I(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},I.cloneElement=function(e,t,n){var r,o=A({},e.props),u=e.key,c=e.ref,a=e._self,f=e._source,p=e._owner;if(null!=t){l(t)&&(c=t.ref,p=U.current),i(t)&&(u=""+t.key);var s;e.type&&e.type.defaultProps&&(s=e.type.defaultProps);for(r in t)$.call(t,r)&&!V.hasOwnProperty(r)&&(void 0===t[r]&&void 0!==s?o[r]=s[r]:o[r]=t[r])}var y=arguments.length-2;if(1===y)o.children=n;else if(y>1){for(var d=Array(y),m=0;m<y;m++)d[m]=arguments[m+2];o.children=d}return I(e.type,u,c,a,f,p,o)},I.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===F};var N=I,T="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",D="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,K=".",M=":",B=/\/+/g,W=10,Y=[],z={forEach:h,map:_,count:E,toArray:S},G=z,H="16.0.0-beta.3",J=k,Q=N.createElement,X=N.createFactory,Z=N.cloneElement,ee={Children:{map:G.map,forEach:G.forEach,count:G.count,toArray:G.toArray,only:J},Component:O.Component,PureComponent:O.PureComponent,unstable_AsyncComponent:O.AsyncComponent,createElement:Q,cloneElement:Z,isValidElement:N.isValidElement,createFactory:X,version:H,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:U}},te=ee;module.exports=te;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react",
3
3
  "description": "React is a JavaScript library for building user interfaces.",
4
- "version": "16.0.0-alpha.12",
4
+ "version": "16.0.0-beta.3",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],
@@ -22,7 +22,6 @@
22
22
  "node": ">=0.10.0"
23
23
  },
24
24
  "dependencies": {
25
- "create-react-class": "^15.5.2",
26
25
  "fbjs": "^0.8.9",
27
26
  "loose-envify": "^1.1.0",
28
27
  "object-assign": "^4.1.0",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react.development.js v16.0.0-alpha.12
2
+ * react.development.js v16.0.0-beta.3
3
3
  */
4
4
 
5
5
  (function (global, factory) {
@@ -200,10 +200,14 @@ var warning$1 = emptyFunction_1;
200
200
 
201
201
  var warning_1 = warning$1;
202
202
 
203
+ {
204
+ var warning = warning_1;
205
+ }
206
+
203
207
  function warnNoop(publicInstance, callerName) {
204
208
  {
205
209
  var constructor = publicInstance.constructor;
206
- warning_1(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass');
210
+ warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass');
207
211
  }
208
212
  }
209
213
 
@@ -277,31 +281,6 @@ var ReactNoopUpdateQueue = {
277
281
 
278
282
  var ReactNoopUpdateQueue_1 = ReactNoopUpdateQueue;
279
283
 
280
- /**
281
- * Copyright 2013-present, Facebook, Inc.
282
- * All rights reserved.
283
- *
284
- * This source code is licensed under the BSD-style license found in the
285
- * LICENSE file in the root directory of this source tree. An additional grant
286
- * of patent rights can be found in the PATENTS file in the same directory.
287
- *
288
- *
289
- * @providesModule canDefineProperty
290
- */
291
-
292
- var canDefineProperty$1 = false;
293
- {
294
- try {
295
- // $FlowFixMe https://github.com/facebook/flow/issues/285
296
- Object.defineProperty({}, 'x', { get: function () {} });
297
- canDefineProperty$1 = true;
298
- } catch (x) {
299
- // IE will fail on defineProperty
300
- }
301
- }
302
-
303
- var canDefineProperty_1 = canDefineProperty$1;
304
-
305
284
  /**
306
285
  * Copyright (c) 2013-present, Facebook, Inc.
307
286
  * All rights reserved.
@@ -374,6 +353,70 @@ function invariant(condition, format, a, b, c, d, e, f) {
374
353
 
375
354
  var invariant_1 = invariant;
376
355
 
356
+ /**
357
+ * Copyright 2014-2015, Facebook, Inc.
358
+ * All rights reserved.
359
+ *
360
+ * This source code is licensed under the BSD-style license found in the
361
+ * LICENSE file in the root directory of this source tree. An additional grant
362
+ * of patent rights can be found in the PATENTS file in the same directory.
363
+ *
364
+ * @providesModule lowPriorityWarning
365
+ */
366
+
367
+ /**
368
+ * Forked from fbjs/warning:
369
+ * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
370
+ *
371
+ * Only change is we use console.warn instead of console.error,
372
+ * and do nothing when 'console' is not supported.
373
+ * This really simplifies the code.
374
+ * ---
375
+ * Similar to invariant but only logs a warning if the condition is not met.
376
+ * This can be used to log issues in development environments in critical
377
+ * paths. Removing the logging code for production environments will keep the
378
+ * same logic and follow the same code paths.
379
+ */
380
+
381
+ var lowPriorityWarning = function () {};
382
+
383
+ {
384
+ var printWarning = function (format) {
385
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
386
+ args[_key - 1] = arguments[_key];
387
+ }
388
+
389
+ var argIndex = 0;
390
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
391
+ return args[argIndex++];
392
+ });
393
+ if (typeof console !== 'undefined') {
394
+ console.warn(message);
395
+ }
396
+ try {
397
+ // --- Welcome to debugging React ---
398
+ // This error was thrown as a convenience so that you can use this stack
399
+ // to find the callsite that caused this warning to fire.
400
+ throw new Error(message);
401
+ } catch (x) {}
402
+ };
403
+
404
+ lowPriorityWarning = function (condition, format) {
405
+ if (format === undefined) {
406
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
407
+ }
408
+ if (!condition) {
409
+ for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
410
+ args[_key2 - 2] = arguments[_key2];
411
+ }
412
+
413
+ printWarning.apply(undefined, [format].concat(args));
414
+ }
415
+ };
416
+ }
417
+
418
+ var lowPriorityWarning_1 = lowPriorityWarning;
419
+
377
420
  /**
378
421
  * Base class helpers for the updating state of a component.
379
422
  */
@@ -447,14 +490,12 @@ ReactComponent.prototype.forceUpdate = function (callback) {
447
490
  replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
448
491
  };
449
492
  var defineDeprecationWarning = function (methodName, info) {
450
- if (canDefineProperty_1) {
451
- Object.defineProperty(ReactComponent.prototype, methodName, {
452
- get: function () {
453
- warning_1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
454
- return undefined;
455
- }
456
- });
457
- }
493
+ Object.defineProperty(ReactComponent.prototype, methodName, {
494
+ get: function () {
495
+ lowPriorityWarning_1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
496
+ return undefined;
497
+ }
498
+ });
458
499
  };
459
500
  for (var fnName in deprecatedAPIs) {
460
501
  if (deprecatedAPIs.hasOwnProperty(fnName)) {
@@ -478,112 +519,37 @@ function ReactPureComponent(props, context, updater) {
478
519
 
479
520
  function ComponentDummy() {}
480
521
  ComponentDummy.prototype = ReactComponent.prototype;
481
- ReactPureComponent.prototype = new ComponentDummy();
482
- ReactPureComponent.prototype.constructor = ReactPureComponent;
522
+ var pureComponentPrototype = ReactPureComponent.prototype = new ComponentDummy();
523
+ pureComponentPrototype.constructor = ReactPureComponent;
483
524
  // Avoid an extra prototype jump for these methods.
484
- index(ReactPureComponent.prototype, ReactComponent.prototype);
485
- ReactPureComponent.prototype.isPureReactComponent = true;
486
-
487
- var ReactBaseClasses = {
488
- Component: ReactComponent,
489
- PureComponent: ReactPureComponent
490
- };
491
-
492
- /**
493
- * Static poolers. Several custom versions for each potential number of
494
- * arguments. A completely generic pooler is easy to implement, but would
495
- * require accessing the `arguments` object. In each of these, `this` refers to
496
- * the Class itself, not an instance. If any others are needed, simply add them
497
- * here, or in their own files.
498
- */
499
- var oneArgumentPooler = function (copyFieldsFrom) {
500
- var Klass = this;
501
- if (Klass.instancePool.length) {
502
- var instance = Klass.instancePool.pop();
503
- Klass.call(instance, copyFieldsFrom);
504
- return instance;
505
- } else {
506
- return new Klass(copyFieldsFrom);
507
- }
508
- };
509
-
510
- var twoArgumentPooler$1 = function (a1, a2) {
511
- var Klass = this;
512
- if (Klass.instancePool.length) {
513
- var instance = Klass.instancePool.pop();
514
- Klass.call(instance, a1, a2);
515
- return instance;
516
- } else {
517
- return new Klass(a1, a2);
518
- }
519
- };
520
-
521
- var threeArgumentPooler = function (a1, a2, a3) {
522
- var Klass = this;
523
- if (Klass.instancePool.length) {
524
- var instance = Klass.instancePool.pop();
525
- Klass.call(instance, a1, a2, a3);
526
- return instance;
527
- } else {
528
- return new Klass(a1, a2, a3);
529
- }
530
- };
531
-
532
- var fourArgumentPooler$1 = function (a1, a2, a3, a4) {
533
- var Klass = this;
534
- if (Klass.instancePool.length) {
535
- var instance = Klass.instancePool.pop();
536
- Klass.call(instance, a1, a2, a3, a4);
537
- return instance;
538
- } else {
539
- return new Klass(a1, a2, a3, a4);
540
- }
541
- };
542
-
543
- var standardReleaser = function (instance) {
544
- var Klass = this;
545
- !(instance instanceof Klass) ? invariant_1(false, 'Trying to release an instance into a pool of a different type.') : void 0;
546
- instance.destructor();
547
- if (Klass.instancePool.length < Klass.poolSize) {
548
- Klass.instancePool.push(instance);
549
- }
550
- };
525
+ index(pureComponentPrototype, ReactComponent.prototype);
526
+ pureComponentPrototype.isPureReactComponent = true;
551
527
 
552
- var DEFAULT_POOL_SIZE = 10;
553
- var DEFAULT_POOLER = oneArgumentPooler;
528
+ function ReactAsyncComponent(props, context, updater) {
529
+ // Duplicated from ReactComponent.
530
+ this.props = props;
531
+ this.context = context;
532
+ this.refs = emptyObject_1;
533
+ // We initialize the default updater but the real one gets injected by the
534
+ // renderer.
535
+ this.updater = updater || ReactNoopUpdateQueue_1;
536
+ }
554
537
 
555
- /**
556
- * Augments `CopyConstructor` to be a poolable class, augmenting only the class
557
- * itself (statically) not adding any prototypical fields. Any CopyConstructor
558
- * you give this may have a `poolSize` property, and will look for a
559
- * prototypical `destructor` on instances.
560
- *
561
- * @param {Function} CopyConstructor Constructor that can be used to reset.
562
- * @param {Function} pooler Customizable pooler.
563
- */
564
- var addPoolingTo = function (CopyConstructor, pooler) {
565
- // Casting as any so that flow ignores the actual implementation and trusts
566
- // it to match the type we declared
567
- var NewKlass = CopyConstructor;
568
- NewKlass.instancePool = [];
569
- NewKlass.getPooled = pooler || DEFAULT_POOLER;
570
- if (!NewKlass.poolSize) {
571
- NewKlass.poolSize = DEFAULT_POOL_SIZE;
572
- }
573
- NewKlass.release = standardReleaser;
574
- return NewKlass;
538
+ var asyncComponentPrototype = ReactAsyncComponent.prototype = new ComponentDummy();
539
+ asyncComponentPrototype.constructor = ReactAsyncComponent;
540
+ // Avoid an extra prototype jump for these methods.
541
+ index(asyncComponentPrototype, ReactComponent.prototype);
542
+ asyncComponentPrototype.unstable_isAsyncReactComponent = true;
543
+ asyncComponentPrototype.render = function () {
544
+ return this.props.children;
575
545
  };
576
546
 
577
- var PooledClass = {
578
- addPoolingTo: addPoolingTo,
579
- oneArgumentPooler: oneArgumentPooler,
580
- twoArgumentPooler: twoArgumentPooler$1,
581
- threeArgumentPooler: threeArgumentPooler,
582
- fourArgumentPooler: fourArgumentPooler$1
547
+ var ReactBaseClasses = {
548
+ Component: ReactComponent,
549
+ PureComponent: ReactPureComponent,
550
+ AsyncComponent: ReactAsyncComponent
583
551
  };
584
552
 
585
- var PooledClass_1 = PooledClass;
586
-
587
553
  /**
588
554
  * Copyright 2013-present, Facebook, Inc.
589
555
  * All rights reserved.
@@ -612,28 +578,15 @@ var ReactCurrentOwner = {
612
578
 
613
579
  var ReactCurrentOwner_1 = ReactCurrentOwner;
614
580
 
615
- /**
616
- * Copyright 2014-present, Facebook, Inc.
617
- * All rights reserved.
618
- *
619
- * This source code is licensed under the BSD-style license found in the
620
- * LICENSE file in the root directory of this source tree. An additional grant
621
- * of patent rights can be found in the PATENTS file in the same directory.
622
- *
623
- * @providesModule ReactElementSymbol
624
- *
625
- */
626
-
627
- // The Symbol used to tag the ReactElement type. If there is no native Symbol
628
- // nor polyfill, then a plain number is used for performance.
629
-
630
- var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
631
-
632
- var ReactElementSymbol = REACT_ELEMENT_TYPE;
633
-
634
581
  var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
635
582
 
583
+ {
584
+ var warning$3 = warning_1;
585
+ }
636
586
 
587
+ // The Symbol used to tag the ReactElement type. If there is no native Symbol
588
+ // nor polyfill, then a plain number is used for performance.
589
+ var REACT_ELEMENT_TYPE$1 = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
637
590
 
638
591
  var RESERVED_PROPS = {
639
592
  key: true,
@@ -673,7 +626,7 @@ function defineKeyPropWarningGetter(props, displayName) {
673
626
  var warnAboutAccessingKey = function () {
674
627
  if (!specialPropKeyWarningShown) {
675
628
  specialPropKeyWarningShown = true;
676
- warning_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);
629
+ warning$3(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);
677
630
  }
678
631
  };
679
632
  warnAboutAccessingKey.isReactWarning = true;
@@ -687,7 +640,7 @@ function defineRefPropWarningGetter(props, displayName) {
687
640
  var warnAboutAccessingRef = function () {
688
641
  if (!specialPropRefWarningShown) {
689
642
  specialPropRefWarningShown = true;
690
- warning_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);
643
+ warning$3(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);
691
644
  }
692
645
  };
693
646
  warnAboutAccessingRef.isReactWarning = true;
@@ -720,7 +673,7 @@ function defineRefPropWarningGetter(props, displayName) {
720
673
  var ReactElement = function (type, key, ref, self, source, owner, props) {
721
674
  var element = {
722
675
  // This tag allow us to uniquely identify this as a React Element
723
- $$typeof: ReactElementSymbol,
676
+ $$typeof: REACT_ELEMENT_TYPE$1,
724
677
 
725
678
  // Built-in properties that belong on the element
726
679
  type: type,
@@ -743,33 +696,27 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
743
696
  // the validation flag non-enumerable (where possible, which should
744
697
  // include every environment we run tests in), so the test framework
745
698
  // ignores it.
746
- if (canDefineProperty_1) {
747
- Object.defineProperty(element._store, 'validated', {
748
- configurable: false,
749
- enumerable: false,
750
- writable: true,
751
- value: false
752
- });
753
- // self and source are DEV only properties.
754
- Object.defineProperty(element, '_self', {
755
- configurable: false,
756
- enumerable: false,
757
- writable: false,
758
- value: self
759
- });
760
- // Two elements created in two different places should be considered
761
- // equal for testing purposes and therefore we hide it from enumeration.
762
- Object.defineProperty(element, '_source', {
763
- configurable: false,
764
- enumerable: false,
765
- writable: false,
766
- value: source
767
- });
768
- } else {
769
- element._store.validated = false;
770
- element._self = self;
771
- element._source = source;
772
- }
699
+ Object.defineProperty(element._store, 'validated', {
700
+ configurable: false,
701
+ enumerable: false,
702
+ writable: true,
703
+ value: false
704
+ });
705
+ // self and source are DEV only properties.
706
+ Object.defineProperty(element, '_self', {
707
+ configurable: false,
708
+ enumerable: false,
709
+ writable: false,
710
+ value: self
711
+ });
712
+ // Two elements created in two different places should be considered
713
+ // equal for testing purposes and therefore we hide it from enumeration.
714
+ Object.defineProperty(element, '_source', {
715
+ configurable: false,
716
+ enumerable: false,
717
+ writable: false,
718
+ value: source
719
+ });
773
720
  if (Object.freeze) {
774
721
  Object.freeze(element.props);
775
722
  Object.freeze(element);
@@ -841,7 +788,7 @@ ReactElement.createElement = function (type, config, children) {
841
788
  }
842
789
  {
843
790
  if (key || ref) {
844
- if (typeof props.$$typeof === 'undefined' || props.$$typeof !== ReactElementSymbol) {
791
+ if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE$1) {
845
792
  var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
846
793
  if (key) {
847
794
  defineKeyPropWarningGetter(props, displayName);
@@ -950,7 +897,7 @@ ReactElement.cloneElement = function (element, config, children) {
950
897
  * @final
951
898
  */
952
899
  ReactElement.isValidElement = function (object) {
953
- return typeof object === 'object' && object !== null && object.$$typeof === ReactElementSymbol;
900
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE$1;
954
901
  };
955
902
 
956
903
  var ReactElement_1 = ReactElement;
@@ -963,49 +910,42 @@ var ReactElement_1 = ReactElement;
963
910
  * LICENSE file in the root directory of this source tree. An additional grant
964
911
  * of patent rights can be found in the PATENTS file in the same directory.
965
912
  *
966
- * @providesModule getIteratorFn
913
+ * @providesModule ReactDebugCurrentFrame
967
914
  *
968
915
  */
969
916
 
970
- /* global Symbol */
917
+ var ReactDebugCurrentFrame = {};
971
918
 
972
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
973
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
919
+ {
920
+ // Component that is being worked on
921
+ ReactDebugCurrentFrame.getCurrentStack = null;
974
922
 
975
- /**
976
- * Returns the iterator method function contained on the iterable object.
977
- *
978
- * Be sure to invoke the function with the iterable as context:
979
- *
980
- * var iteratorFn = getIteratorFn(myIterable);
981
- * if (iteratorFn) {
982
- * var iterator = iteratorFn.call(myIterable);
983
- * ...
984
- * }
985
- *
986
- * @param {?object} maybeIterable
987
- * @return {?function}
988
- */
989
- function getIteratorFn(maybeIterable) {
990
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
991
- if (typeof iteratorFn === 'function') {
992
- return iteratorFn;
993
- }
923
+ ReactDebugCurrentFrame.getStackAddendum = function () {
924
+ var impl = ReactDebugCurrentFrame.getCurrentStack;
925
+ if (impl) {
926
+ return impl();
927
+ }
928
+ return null;
929
+ };
994
930
  }
995
931
 
996
- var getIteratorFn_1 = getIteratorFn;
932
+ var ReactDebugCurrentFrame_1 = ReactDebugCurrentFrame;
997
933
 
998
- /**
999
- * Copyright 2013-present, Facebook, Inc.
1000
- * All rights reserved.
1001
- *
1002
- * This source code is licensed under the BSD-style license found in the
1003
- * LICENSE file in the root directory of this source tree. An additional grant
1004
- * of patent rights can be found in the PATENTS file in the same directory.
1005
- *
1006
- * @providesModule KeyEscapeUtils
1007
- *
1008
- */
934
+ {
935
+ var warning$2 = warning_1;
936
+
937
+ var _require = ReactDebugCurrentFrame_1,
938
+ getStackAddendum = _require.getStackAddendum;
939
+ }
940
+
941
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
942
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
943
+ // The Symbol used to tag the ReactElement type. If there is no native Symbol
944
+ // nor polyfill, then a plain number is used for performance.
945
+ var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
946
+
947
+ var SEPARATOR = '.';
948
+ var SUBSEPARATOR = ':';
1009
949
 
1010
950
  /**
1011
951
  * Escape and wrap key so it is safe to use as a reactid
@@ -1013,7 +953,6 @@ var getIteratorFn_1 = getIteratorFn;
1013
953
  * @param {string} key to be escaped.
1014
954
  * @return {string} the escaped key.
1015
955
  */
1016
-
1017
956
  function escape(key) {
1018
957
  var escapeRegex = /[=:]/g;
1019
958
  var escaperLookup = {
@@ -1028,535 +967,81 @@ function escape(key) {
1028
967
  }
1029
968
 
1030
969
  /**
1031
- * Unescape and unwrap key for human-readable display
1032
- *
1033
- * @param {string} key to unescape.
1034
- * @return {string} the unescaped key.
970
+ * TODO: Test that a single child and an array with one item have the same key
971
+ * pattern.
1035
972
  */
1036
- function unescape(key) {
1037
- var unescapeRegex = /(=0|=2)/g;
1038
- var unescaperLookup = {
1039
- '=0': '=',
1040
- '=2': ':'
1041
- };
1042
- var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
1043
-
1044
- return ('' + keySubstring).replace(unescapeRegex, function (match) {
1045
- return unescaperLookup[match];
1046
- });
1047
- }
1048
973
 
1049
- var KeyEscapeUtils = {
1050
- escape: escape,
1051
- unescape: unescape
1052
- };
974
+ var didWarnAboutMaps = false;
1053
975
 
1054
- var KeyEscapeUtils_1 = KeyEscapeUtils;
976
+ var userProvidedKeyEscapeRegex = /\/+/g;
977
+ function escapeUserProvidedKey(text) {
978
+ return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
979
+ }
1055
980
 
1056
- /**
1057
- * Copyright 2013-present, Facebook, Inc.
1058
- * All rights reserved.
1059
- *
1060
- * This source code is licensed under the BSD-style license found in the
1061
- * LICENSE file in the root directory of this source tree. An additional grant
1062
- * of patent rights can be found in the PATENTS file in the same directory.
1063
- *
1064
- * @providesModule ReactTypeOfWork
1065
- *
1066
- */
981
+ var POOL_SIZE = 10;
982
+ var traverseContextPool = [];
983
+ function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
984
+ if (traverseContextPool.length) {
985
+ var traverseContext = traverseContextPool.pop();
986
+ traverseContext.result = mapResult;
987
+ traverseContext.keyPrefix = keyPrefix;
988
+ traverseContext.func = mapFunction;
989
+ traverseContext.context = mapContext;
990
+ traverseContext.count = 0;
991
+ return traverseContext;
992
+ } else {
993
+ return {
994
+ result: mapResult,
995
+ keyPrefix: keyPrefix,
996
+ func: mapFunction,
997
+ context: mapContext,
998
+ count: 0
999
+ };
1000
+ }
1001
+ }
1067
1002
 
1068
- var ReactTypeOfWork = {
1069
- IndeterminateComponent: 0, // Before we know whether it is functional or class
1070
- FunctionalComponent: 1,
1071
- ClassComponent: 2,
1072
- HostRoot: 3, // Root of a host tree. Could be nested inside another node.
1073
- HostPortal: 4, // A subtree. Could be an entry point to a different renderer.
1074
- HostComponent: 5,
1075
- HostText: 6,
1076
- CoroutineComponent: 7,
1077
- CoroutineHandlerPhase: 8,
1078
- YieldComponent: 9,
1079
- Fragment: 10
1080
- };
1003
+ function releaseTraverseContext(traverseContext) {
1004
+ traverseContext.result = null;
1005
+ traverseContext.keyPrefix = null;
1006
+ traverseContext.func = null;
1007
+ traverseContext.context = null;
1008
+ traverseContext.count = 0;
1009
+ if (traverseContextPool.length < POOL_SIZE) {
1010
+ traverseContextPool.push(traverseContext);
1011
+ }
1012
+ }
1081
1013
 
1082
1014
  /**
1083
- * Copyright 2013-present, Facebook, Inc.
1084
- * All rights reserved.
1085
- *
1086
- * This source code is licensed under the BSD-style license found in the
1087
- * LICENSE file in the root directory of this source tree. An additional grant
1088
- * of patent rights can be found in the PATENTS file in the same directory.
1089
- *
1090
- * @providesModule getComponentName
1091
- *
1015
+ * @param {?*} children Children tree container.
1016
+ * @param {!string} nameSoFar Name of the key path so far.
1017
+ * @param {!function} callback Callback to invoke with each child found.
1018
+ * @param {?*} traverseContext Used to pass information throughout the traversal
1019
+ * process.
1020
+ * @return {!number} The number of children in this subtree.
1092
1021
  */
1022
+ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
1023
+ var type = typeof children;
1093
1024
 
1094
- function getComponentName(instanceOrFiber) {
1095
- if (typeof instanceOrFiber.getName === 'function') {
1096
- // Stack reconciler
1097
- var instance = instanceOrFiber;
1098
- return instance.getName();
1025
+ if (type === 'undefined' || type === 'boolean') {
1026
+ // All of the above are perceived as null.
1027
+ children = null;
1099
1028
  }
1100
- if (typeof instanceOrFiber.tag === 'number') {
1101
- // Fiber reconciler
1102
- var fiber = instanceOrFiber;
1103
- var type = fiber.type;
1104
1029
 
1105
- if (typeof type === 'string') {
1106
- return type;
1107
- }
1108
- if (typeof type === 'function') {
1109
- return type.displayName || type.name;
1110
- }
1030
+ if (children === null || type === 'string' || type === 'number' ||
1031
+ // The following is inlined from ReactElement. This means we can optimize
1032
+ // some checks. React Fiber also inlines this logic for similar purposes.
1033
+ type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) {
1034
+ callback(traverseContext, children,
1035
+ // If it's the only child, treat the name as if it was wrapped in an array
1036
+ // so that it's consistent if the number of children grows.
1037
+ nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
1038
+ return 1;
1111
1039
  }
1112
- return null;
1113
- }
1114
-
1115
- var getComponentName_1 = getComponentName;
1116
-
1117
- var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent;
1118
- var FunctionalComponent = ReactTypeOfWork.FunctionalComponent;
1119
- var ClassComponent = ReactTypeOfWork.ClassComponent;
1120
- var HostComponent = ReactTypeOfWork.HostComponent;
1121
-
1122
-
1123
1040
 
1124
- function describeComponentFrame$1(name, source, ownerName) {
1125
- return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
1126
- }
1127
-
1128
- function describeFiber(fiber) {
1129
- switch (fiber.tag) {
1130
- case IndeterminateComponent:
1131
- case FunctionalComponent:
1132
- case ClassComponent:
1133
- case HostComponent:
1134
- var owner = fiber._debugOwner;
1135
- var source = fiber._debugSource;
1136
- var name = getComponentName_1(fiber);
1137
- var ownerName = null;
1138
- if (owner) {
1139
- ownerName = getComponentName_1(owner);
1140
- }
1141
- return describeComponentFrame$1(name, source, ownerName);
1142
- default:
1143
- return '';
1144
- }
1145
- }
1146
-
1147
- // This function can only be called with a work-in-progress fiber and
1148
- // only during begin or complete phase. Do not call it under any other
1149
- // circumstances.
1150
- function getStackAddendumByWorkInProgressFiber$1(workInProgress) {
1151
- var info = '';
1152
- var node = workInProgress;
1153
- do {
1154
- info += describeFiber(node);
1155
- // Otherwise this return pointer might point to the wrong tree:
1156
- node = node['return'];
1157
- } while (node);
1158
- return info;
1159
- }
1160
-
1161
- var ReactFiberComponentTreeHook = {
1162
- getStackAddendumByWorkInProgressFiber: getStackAddendumByWorkInProgressFiber$1,
1163
- describeComponentFrame: describeComponentFrame$1
1164
- };
1165
-
1166
- var getStackAddendumByWorkInProgressFiber = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber;
1167
- var describeComponentFrame = ReactFiberComponentTreeHook.describeComponentFrame;
1168
-
1169
-
1170
-
1171
-
1172
-
1173
- function isNative(fn) {
1174
- // Based on isNative() from Lodash
1175
- var funcToString = Function.prototype.toString;
1176
- var reIsNative = RegExp('^' + funcToString
1177
- // Take an example native function source for comparison
1178
- .call(Object.prototype.hasOwnProperty)
1179
- // Strip regex characters so we can use it for regex
1180
- .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
1181
- // Remove hasOwnProperty from the template to make it generic
1182
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
1183
- try {
1184
- var source = funcToString.call(fn);
1185
- return reIsNative.test(source);
1186
- } catch (err) {
1187
- return false;
1188
- }
1189
- }
1190
-
1191
- var canUseCollections =
1192
- // Array.from
1193
- typeof Array.from === 'function' &&
1194
- // Map
1195
- typeof Map === 'function' && isNative(Map) &&
1196
- // Map.prototype.keys
1197
- Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
1198
- // Set
1199
- typeof Set === 'function' && isNative(Set) &&
1200
- // Set.prototype.keys
1201
- Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
1202
-
1203
- var setItem;
1204
- var getItem;
1205
- var removeItem;
1206
- var getItemIDs;
1207
- var addRoot;
1208
- var removeRoot;
1209
- var getRootIDs;
1210
-
1211
- if (canUseCollections) {
1212
- var itemMap = new Map();
1213
- var rootIDSet = new Set();
1214
-
1215
- setItem = function (id, item) {
1216
- itemMap.set(id, item);
1217
- };
1218
- getItem = function (id) {
1219
- return itemMap.get(id);
1220
- };
1221
- removeItem = function (id) {
1222
- itemMap['delete'](id);
1223
- };
1224
- getItemIDs = function () {
1225
- return Array.from(itemMap.keys());
1226
- };
1227
-
1228
- addRoot = function (id) {
1229
- rootIDSet.add(id);
1230
- };
1231
- removeRoot = function (id) {
1232
- rootIDSet['delete'](id);
1233
- };
1234
- getRootIDs = function () {
1235
- return Array.from(rootIDSet.keys());
1236
- };
1237
- } else {
1238
- var itemByKey = {};
1239
- var rootByKey = {};
1240
-
1241
- // Use non-numeric keys to prevent V8 performance issues:
1242
- // https://github.com/facebook/react/pull/7232
1243
- var getKeyFromID = function (id) {
1244
- return '.' + id;
1245
- };
1246
- var getIDFromKey = function (key) {
1247
- return parseInt(key.substr(1), 10);
1248
- };
1249
-
1250
- setItem = function (id, item) {
1251
- var key = getKeyFromID(id);
1252
- itemByKey[key] = item;
1253
- };
1254
- getItem = function (id) {
1255
- var key = getKeyFromID(id);
1256
- return itemByKey[key];
1257
- };
1258
- removeItem = function (id) {
1259
- var key = getKeyFromID(id);
1260
- delete itemByKey[key];
1261
- };
1262
- getItemIDs = function () {
1263
- return Object.keys(itemByKey).map(getIDFromKey);
1264
- };
1265
-
1266
- addRoot = function (id) {
1267
- var key = getKeyFromID(id);
1268
- rootByKey[key] = true;
1269
- };
1270
- removeRoot = function (id) {
1271
- var key = getKeyFromID(id);
1272
- delete rootByKey[key];
1273
- };
1274
- getRootIDs = function () {
1275
- return Object.keys(rootByKey).map(getIDFromKey);
1276
- };
1277
- }
1278
-
1279
- var unmountedIDs = [];
1280
-
1281
- function purgeDeep(id) {
1282
- var item = getItem(id);
1283
- if (item) {
1284
- var childIDs = item.childIDs;
1285
-
1286
- removeItem(id);
1287
- childIDs.forEach(purgeDeep);
1288
- }
1289
- }
1290
-
1291
- function getDisplayName(element) {
1292
- if (element == null) {
1293
- return '#empty';
1294
- } else if (typeof element === 'string' || typeof element === 'number') {
1295
- return '#text';
1296
- } else if (typeof element.type === 'string') {
1297
- return element.type;
1298
- } else {
1299
- return element.type.displayName || element.type.name || 'Unknown';
1300
- }
1301
- }
1302
-
1303
- function describeID(id) {
1304
- var name = ReactComponentTreeHook.getDisplayName(id);
1305
- var element = ReactComponentTreeHook.getElement(id);
1306
- var ownerID = ReactComponentTreeHook.getOwnerID(id);
1307
- var ownerName = void 0;
1308
-
1309
- if (ownerID) {
1310
- ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
1311
- }
1312
- warning_1(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id);
1313
- return describeComponentFrame(name || '', element && element._source, ownerName || '');
1314
- }
1315
-
1316
- var ReactComponentTreeHook = {
1317
- onSetChildren: function (id, nextChildIDs) {
1318
- var item = getItem(id);
1319
- invariant_1(item, 'Item must have been set');
1320
- item.childIDs = nextChildIDs;
1321
-
1322
- for (var i = 0; i < nextChildIDs.length; i++) {
1323
- var nextChildID = nextChildIDs[i];
1324
- var nextChild = getItem(nextChildID);
1325
- !nextChild ? invariant_1(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : void 0;
1326
- !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? invariant_1(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : void 0;
1327
- !nextChild.isMounted ? invariant_1(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : void 0;
1328
- if (nextChild.parentID == null) {
1329
- nextChild.parentID = id;
1330
- // TODO: This shouldn't be necessary but mounting a new root during in
1331
- // componentWillMount currently causes not-yet-mounted components to
1332
- // be purged from our tree data so their parent id is missing.
1333
- }
1334
- !(nextChild.parentID === id) ? invariant_1(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : void 0;
1335
- }
1336
- },
1337
- onBeforeMountComponent: function (id, element, parentID) {
1338
- var item = {
1339
- element: element,
1340
- parentID: parentID,
1341
- text: null,
1342
- childIDs: [],
1343
- isMounted: false,
1344
- updateCount: 0
1345
- };
1346
- setItem(id, item);
1347
- },
1348
- onBeforeUpdateComponent: function (id, element) {
1349
- var item = getItem(id);
1350
- if (!item || !item.isMounted) {
1351
- // We may end up here as a result of setState() in componentWillUnmount().
1352
- // In this case, ignore the element.
1353
- return;
1354
- }
1355
- item.element = element;
1356
- },
1357
- onMountComponent: function (id) {
1358
- var item = getItem(id);
1359
- invariant_1(item, 'Item must have been set');
1360
- item.isMounted = true;
1361
- var isRoot = item.parentID === 0;
1362
- if (isRoot) {
1363
- addRoot(id);
1364
- }
1365
- },
1366
- onUpdateComponent: function (id) {
1367
- var item = getItem(id);
1368
- if (!item || !item.isMounted) {
1369
- // We may end up here as a result of setState() in componentWillUnmount().
1370
- // In this case, ignore the element.
1371
- return;
1372
- }
1373
- item.updateCount++;
1374
- },
1375
- onUnmountComponent: function (id) {
1376
- var item = getItem(id);
1377
- if (item) {
1378
- // We need to check if it exists.
1379
- // `item` might not exist if it is inside an error boundary, and a sibling
1380
- // error boundary child threw while mounting. Then this instance never
1381
- // got a chance to mount, but it still gets an unmounting event during
1382
- // the error boundary cleanup.
1383
- item.isMounted = false;
1384
- var isRoot = item.parentID === 0;
1385
- if (isRoot) {
1386
- removeRoot(id);
1387
- }
1388
- }
1389
- unmountedIDs.push(id);
1390
- },
1391
- purgeUnmountedComponents: function () {
1392
- if (ReactComponentTreeHook._preventPurging) {
1393
- // Should only be used for testing.
1394
- return;
1395
- }
1396
-
1397
- for (var i = 0; i < unmountedIDs.length; i++) {
1398
- var id = unmountedIDs[i];
1399
- purgeDeep(id);
1400
- }
1401
- unmountedIDs.length = 0;
1402
- },
1403
- isMounted: function (id) {
1404
- var item = getItem(id);
1405
- return item ? item.isMounted : false;
1406
- },
1407
- getCurrentStackAddendum: function (topElement) {
1408
- var info = '';
1409
- if (topElement) {
1410
- var name = getDisplayName(topElement);
1411
- var owner = topElement._owner;
1412
- info += describeComponentFrame(name, topElement._source, owner && getComponentName_1(owner));
1413
- }
1414
-
1415
- var currentOwner = ReactCurrentOwner_1.current;
1416
- if (currentOwner) {
1417
- if (typeof currentOwner.tag === 'number') {
1418
- var workInProgress = currentOwner;
1419
- // Safe because if current owner exists, we are reconciling,
1420
- // and it is guaranteed to be the work-in-progress version.
1421
- info += getStackAddendumByWorkInProgressFiber(workInProgress);
1422
- } else if (typeof currentOwner._debugID === 'number') {
1423
- info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
1424
- }
1425
- }
1426
- return info;
1427
- },
1428
- getStackAddendumByID: function (id) {
1429
- var info = '';
1430
- while (id) {
1431
- info += describeID(id);
1432
- id = ReactComponentTreeHook.getParentID(id);
1433
- }
1434
- return info;
1435
- },
1436
- getChildIDs: function (id) {
1437
- var item = getItem(id);
1438
- return item ? item.childIDs : [];
1439
- },
1440
- getDisplayName: function (id) {
1441
- var element = ReactComponentTreeHook.getElement(id);
1442
- if (!element) {
1443
- return null;
1444
- }
1445
- return getDisplayName(element);
1446
- },
1447
- getElement: function (id) {
1448
- var item = getItem(id);
1449
- return item ? item.element : null;
1450
- },
1451
- getOwnerID: function (id) {
1452
- var element = ReactComponentTreeHook.getElement(id);
1453
- if (!element || !element._owner) {
1454
- return null;
1455
- }
1456
- return element._owner._debugID;
1457
- },
1458
- getParentID: function (id) {
1459
- var item = getItem(id);
1460
- return item ? item.parentID : null;
1461
- },
1462
- getSource: function (id) {
1463
- var item = getItem(id);
1464
- var element = item ? item.element : null;
1465
- var source = element != null ? element._source : null;
1466
- return source;
1467
- },
1468
- getText: function (id) {
1469
- var element = ReactComponentTreeHook.getElement(id);
1470
- if (typeof element === 'string') {
1471
- return element;
1472
- } else if (typeof element === 'number') {
1473
- return '' + element;
1474
- } else {
1475
- return null;
1476
- }
1477
- },
1478
- getUpdateCount: function (id) {
1479
- var item = getItem(id);
1480
- return item ? item.updateCount : 0;
1481
- },
1482
-
1483
-
1484
- getRootIDs: getRootIDs,
1485
- getRegisteredIDs: getItemIDs
1486
- };
1487
-
1488
- var ReactComponentTreeHook_1 = ReactComponentTreeHook;
1489
-
1490
- {
1491
- var _require = ReactComponentTreeHook_1,
1492
- getCurrentStackAddendum = _require.getCurrentStackAddendum;
1493
- }
1494
-
1495
- var SEPARATOR = '.';
1496
- var SUBSEPARATOR = ':';
1497
-
1498
- /**
1499
- * This is inlined from ReactElement since this file is shared between
1500
- * isomorphic and renderers. We could extract this to a
1501
- *
1502
- */
1503
-
1504
- /**
1505
- * TODO: Test that a single child and an array with one item have the same key
1506
- * pattern.
1507
- */
1508
-
1509
- var didWarnAboutMaps = false;
1510
-
1511
- /**
1512
- * Generate a key string that identifies a component within a set.
1513
- *
1514
- * @param {*} component A component that could contain a manual key.
1515
- * @param {number} index Index that is used if a manual key is not provided.
1516
- * @return {string}
1517
- */
1518
- function getComponentKey(component, index) {
1519
- // Do some typechecking here since we call this blindly. We want to ensure
1520
- // that we don't block potential future ES APIs.
1521
- if (typeof component === 'object' && component !== null && component.key != null) {
1522
- // Explicit key
1523
- return KeyEscapeUtils_1.escape(component.key);
1524
- }
1525
- // Implicit key determined by the index in the set
1526
- return index.toString(36);
1527
- }
1528
-
1529
- /**
1530
- * @param {?*} children Children tree container.
1531
- * @param {!string} nameSoFar Name of the key path so far.
1532
- * @param {!function} callback Callback to invoke with each child found.
1533
- * @param {?*} traverseContext Used to pass information throughout the traversal
1534
- * process.
1535
- * @return {!number} The number of children in this subtree.
1536
- */
1537
- function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
1538
- var type = typeof children;
1539
-
1540
- if (type === 'undefined' || type === 'boolean') {
1541
- // All of the above are perceived as null.
1542
- children = null;
1543
- }
1544
-
1545
- if (children === null || type === 'string' || type === 'number' ||
1546
- // The following is inlined from ReactElement. This means we can optimize
1547
- // some checks. React Fiber also inlines this logic for similar purposes.
1548
- type === 'object' && children.$$typeof === ReactElementSymbol) {
1549
- callback(traverseContext, children,
1550
- // If it's the only child, treat the name as if it was wrapped in an array
1551
- // so that it's consistent if the number of children grows.
1552
- nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
1553
- return 1;
1554
- }
1555
-
1556
- var child;
1557
- var nextName;
1558
- var subtreeCount = 0; // Count of children found in the current subtree.
1559
- var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1041
+ var child;
1042
+ var nextName;
1043
+ var subtreeCount = 0; // Count of children found in the current subtree.
1044
+ var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1560
1045
 
1561
1046
  if (Array.isArray(children)) {
1562
1047
  for (var i = 0; i < children.length; i++) {
@@ -1565,12 +1050,12 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
1565
1050
  subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
1566
1051
  }
1567
1052
  } else {
1568
- var iteratorFn = getIteratorFn_1(children);
1569
- if (iteratorFn) {
1053
+ var iteratorFn = ITERATOR_SYMBOL && children[ITERATOR_SYMBOL] || children[FAUX_ITERATOR_SYMBOL];
1054
+ if (typeof iteratorFn === 'function') {
1570
1055
  {
1571
1056
  // Warn about using Maps as children
1572
1057
  if (iteratorFn === children.entries) {
1573
- warning_1(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', getCurrentStackAddendum());
1058
+ warning$2(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', getStackAddendum());
1574
1059
  didWarnAboutMaps = true;
1575
1060
  }
1576
1061
  }
@@ -1586,7 +1071,7 @@ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext)
1586
1071
  } else if (type === 'object') {
1587
1072
  var addendum = '';
1588
1073
  {
1589
- addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentStackAddendum();
1074
+ addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getStackAddendum();
1590
1075
  }
1591
1076
  var childrenString = '' + children;
1592
1077
  invariant_1(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
@@ -1620,35 +1105,23 @@ function traverseAllChildren(children, callback, traverseContext) {
1620
1105
  return traverseAllChildrenImpl(children, '', callback, traverseContext);
1621
1106
  }
1622
1107
 
1623
- var traverseAllChildren_1 = traverseAllChildren;
1624
-
1625
- var twoArgumentPooler = PooledClass_1.twoArgumentPooler;
1626
- var fourArgumentPooler = PooledClass_1.fourArgumentPooler;
1627
-
1628
- var userProvidedKeyEscapeRegex = /\/+/g;
1629
- function escapeUserProvidedKey(text) {
1630
- return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
1631
- }
1632
-
1633
1108
  /**
1634
- * PooledClass representing the bookkeeping associated with performing a child
1635
- * traversal. Allows avoiding binding callbacks.
1109
+ * Generate a key string that identifies a component within a set.
1636
1110
  *
1637
- * @constructor ForEachBookKeeping
1638
- * @param {!function} forEachFunction Function to perform traversal with.
1639
- * @param {?*} forEachContext Context to perform context with.
1111
+ * @param {*} component A component that could contain a manual key.
1112
+ * @param {number} index Index that is used if a manual key is not provided.
1113
+ * @return {string}
1640
1114
  */
1641
- function ForEachBookKeeping(forEachFunction, forEachContext) {
1642
- this.func = forEachFunction;
1643
- this.context = forEachContext;
1644
- this.count = 0;
1115
+ function getComponentKey(component, index) {
1116
+ // Do some typechecking here since we call this blindly. We want to ensure
1117
+ // that we don't block potential future ES APIs.
1118
+ if (typeof component === 'object' && component !== null && component.key != null) {
1119
+ // Explicit key
1120
+ return escape(component.key);
1121
+ }
1122
+ // Implicit key determined by the index in the set
1123
+ return index.toString(36);
1645
1124
  }
1646
- ForEachBookKeeping.prototype.destructor = function () {
1647
- this.func = null;
1648
- this.context = null;
1649
- this.count = 0;
1650
- };
1651
- PooledClass_1.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
1652
1125
 
1653
1126
  function forEachSingleChild(bookKeeping, child, name) {
1654
1127
  var func = bookKeeping.func,
@@ -1673,35 +1146,10 @@ function forEachChildren(children, forEachFunc, forEachContext) {
1673
1146
  if (children == null) {
1674
1147
  return children;
1675
1148
  }
1676
- var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
1677
- traverseAllChildren_1(children, forEachSingleChild, traverseContext);
1678
- ForEachBookKeeping.release(traverseContext);
1679
- }
1680
-
1681
- /**
1682
- * PooledClass representing the bookkeeping associated with performing a child
1683
- * mapping. Allows avoiding binding callbacks.
1684
- *
1685
- * @constructor MapBookKeeping
1686
- * @param {!*} mapResult Object containing the ordered map of results.
1687
- * @param {!function} mapFunction Function to perform mapping with.
1688
- * @param {?*} mapContext Context to perform mapping with.
1689
- */
1690
- function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
1691
- this.result = mapResult;
1692
- this.keyPrefix = keyPrefix;
1693
- this.func = mapFunction;
1694
- this.context = mapContext;
1695
- this.count = 0;
1149
+ var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
1150
+ traverseAllChildren(children, forEachSingleChild, traverseContext);
1151
+ releaseTraverseContext(traverseContext);
1696
1152
  }
1697
- MapBookKeeping.prototype.destructor = function () {
1698
- this.result = null;
1699
- this.keyPrefix = null;
1700
- this.func = null;
1701
- this.context = null;
1702
- this.count = 0;
1703
- };
1704
- PooledClass_1.addPoolingTo(MapBookKeeping, fourArgumentPooler);
1705
1153
 
1706
1154
  function mapSingleChildIntoContext(bookKeeping, child, childKey) {
1707
1155
  var result = bookKeeping.result,
@@ -1729,9 +1177,9 @@ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
1729
1177
  if (prefix != null) {
1730
1178
  escapedPrefix = escapeUserProvidedKey(prefix) + '/';
1731
1179
  }
1732
- var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
1733
- traverseAllChildren_1(children, mapSingleChildIntoContext, traverseContext);
1734
- MapBookKeeping.release(traverseContext);
1180
+ var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
1181
+ traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
1182
+ releaseTraverseContext(traverseContext);
1735
1183
  }
1736
1184
 
1737
1185
  /**
@@ -1756,10 +1204,6 @@ function mapChildren(children, func, context) {
1756
1204
  return result;
1757
1205
  }
1758
1206
 
1759
- function forEachSingleChildDummy(traverseContext, child, name) {
1760
- return null;
1761
- }
1762
-
1763
1207
  /**
1764
1208
  * Count the number of children that are typically specified as
1765
1209
  * `props.children`.
@@ -1770,7 +1214,7 @@ function forEachSingleChildDummy(traverseContext, child, name) {
1770
1214
  * @return {number} The number of children.
1771
1215
  */
1772
1216
  function countChildren(children, context) {
1773
- return traverseAllChildren_1(children, forEachSingleChildDummy, null);
1217
+ return traverseAllChildren(children, emptyFunction_1.thatReturnsNull, null);
1774
1218
  }
1775
1219
 
1776
1220
  /**
@@ -1788,13 +1232,46 @@ function toArray(children) {
1788
1232
  var ReactChildren = {
1789
1233
  forEach: forEachChildren,
1790
1234
  map: mapChildren,
1791
- mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
1792
1235
  count: countChildren,
1793
1236
  toArray: toArray
1794
1237
  };
1795
1238
 
1796
1239
  var ReactChildren_1 = ReactChildren;
1797
1240
 
1241
+ /**
1242
+ * Copyright 2013-present, Facebook, Inc.
1243
+ * All rights reserved.
1244
+ *
1245
+ * This source code is licensed under the BSD-style license found in the
1246
+ * LICENSE file in the root directory of this source tree. An additional grant
1247
+ * of patent rights can be found in the PATENTS file in the same directory.
1248
+ *
1249
+ * @providesModule ReactVersion
1250
+ */
1251
+
1252
+ var ReactVersion = '16.0.0-beta.3';
1253
+
1254
+ /**
1255
+ * Returns the first child in a collection of children and verifies that there
1256
+ * is only one child in the collection.
1257
+ *
1258
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.only
1259
+ *
1260
+ * The current implementation of this function assumes that a single child gets
1261
+ * passed without a wrapper, but the purpose of this helper function is to
1262
+ * abstract away the particular structure of children.
1263
+ *
1264
+ * @param {?object} children Child collection structure.
1265
+ * @return {ReactElement} The first and only `ReactElement` contained in the
1266
+ * structure.
1267
+ */
1268
+ function onlyChild(children) {
1269
+ !ReactElement_1.isValidElement(children) ? invariant_1(false, 'React.Children.only expected to receive a single React element child.') : void 0;
1270
+ return children;
1271
+ }
1272
+
1273
+ var onlyChild_1 = onlyChild;
1274
+
1798
1275
  /**
1799
1276
  * Copyright 2013-present, Facebook, Inc.
1800
1277
  * All rights reserved.
@@ -1809,8 +1286,8 @@ var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1809
1286
  var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
1810
1287
 
1811
1288
  {
1812
- var invariant$1 = invariant_1;
1813
- var warning$3 = warning_1;
1289
+ var invariant$2 = invariant_1;
1290
+ var warning$5 = warning_1;
1814
1291
  var ReactPropTypesSecret = ReactPropTypesSecret_1;
1815
1292
  var loggedTypeFailures = {};
1816
1293
  }
@@ -1826,94 +1303,130 @@ var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
1826
1303
  * @param {?Function} getStack Returns the component stack.
1827
1304
  * @private
1828
1305
  */
1829
- function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
1830
- {
1831
- for (var typeSpecName in typeSpecs) {
1832
- if (typeSpecs.hasOwnProperty(typeSpecName)) {
1833
- var error;
1834
- // Prop type validation may throw. In case they do, we don't want to
1835
- // fail the render phase where it didn't fail before. So we log it.
1836
- // After these have been cleaned up, we'll let them throw.
1837
- try {
1838
- // This is intentionally an invariant that gets caught. It's the same
1839
- // behavior as without this statement except with a better message.
1840
- invariant$1(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
1841
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
1842
- } catch (ex) {
1843
- error = ex;
1844
- }
1845
- warning$3(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
1846
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1847
- // Only monitor this failure once because there tends to be a lot of the
1848
- // same error.
1849
- loggedTypeFailures[error.message] = true;
1306
+ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
1307
+ {
1308
+ for (var typeSpecName in typeSpecs) {
1309
+ if (typeSpecs.hasOwnProperty(typeSpecName)) {
1310
+ var error;
1311
+ // Prop type validation may throw. In case they do, we don't want to
1312
+ // fail the render phase where it didn't fail before. So we log it.
1313
+ // After these have been cleaned up, we'll let them throw.
1314
+ try {
1315
+ // This is intentionally an invariant that gets caught. It's the same
1316
+ // behavior as without this statement except with a better message.
1317
+ invariant$2(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
1318
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
1319
+ } catch (ex) {
1320
+ error = ex;
1321
+ }
1322
+ warning$5(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
1323
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1324
+ // Only monitor this failure once because there tends to be a lot of the
1325
+ // same error.
1326
+ loggedTypeFailures[error.message] = true;
1327
+
1328
+ var stack = getStack ? getStack() : '';
1329
+
1330
+ warning$5(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
1331
+ }
1332
+ }
1333
+ }
1334
+ }
1335
+ }
1336
+
1337
+ var checkPropTypes_1 = checkPropTypes$1;
1338
+
1339
+ /**
1340
+ * Copyright 2016-present, Facebook, Inc.
1341
+ * All rights reserved.
1342
+ *
1343
+ * This source code is licensed under the BSD-style license found in the
1344
+ * LICENSE file in the root directory of this source tree. An additional grant
1345
+ * of patent rights can be found in the PATENTS file in the same directory.
1346
+ *
1347
+ *
1348
+ * @providesModule describeComponentFrame
1349
+ */
1350
+
1351
+ var describeComponentFrame$1 = function (name, source, ownerName) {
1352
+ return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
1353
+ };
1354
+
1355
+ /**
1356
+ * Copyright 2013-present, Facebook, Inc.
1357
+ * All rights reserved.
1358
+ *
1359
+ * This source code is licensed under the BSD-style license found in the
1360
+ * LICENSE file in the root directory of this source tree. An additional grant
1361
+ * of patent rights can be found in the PATENTS file in the same directory.
1362
+ *
1363
+ * @providesModule getComponentName
1364
+ *
1365
+ */
1850
1366
 
1851
- var stack = getStack ? getStack() : '';
1367
+ function getComponentName$1(instanceOrFiber) {
1368
+ if (typeof instanceOrFiber.getName === 'function') {
1369
+ // Stack reconciler
1370
+ var instance = instanceOrFiber;
1371
+ return instance.getName();
1372
+ }
1373
+ if (typeof instanceOrFiber.tag === 'number') {
1374
+ // Fiber reconciler
1375
+ var fiber = instanceOrFiber;
1376
+ var type = fiber.type;
1852
1377
 
1853
- warning$3(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
1854
- }
1855
- }
1378
+ if (typeof type === 'string') {
1379
+ return type;
1380
+ }
1381
+ if (typeof type === 'function') {
1382
+ return type.displayName || type.name;
1856
1383
  }
1857
1384
  }
1385
+ return null;
1858
1386
  }
1859
1387
 
1860
- var checkPropTypes_1 = checkPropTypes$1;
1861
-
1862
- var ReactDebugCurrentFrame$1 = {};
1388
+ var getComponentName_1 = getComponentName$1;
1863
1389
 
1864
1390
  {
1865
- var _require$2 = ReactComponentTreeHook_1,
1866
- getStackAddendumByID = _require$2.getStackAddendumByID,
1867
- getCurrentStackAddendum$2 = _require$2.getCurrentStackAddendum;
1868
-
1869
- var _require2$1 = ReactFiberComponentTreeHook,
1870
- getStackAddendumByWorkInProgressFiber$2 = _require2$1.getStackAddendumByWorkInProgressFiber;
1391
+ var checkPropTypes = checkPropTypes_1;
1392
+ var lowPriorityWarning$1 = lowPriorityWarning_1;
1393
+ var ReactDebugCurrentFrame$1 = ReactDebugCurrentFrame_1;
1394
+ var warning$4 = warning_1;
1395
+ var describeComponentFrame = describeComponentFrame$1;
1396
+ var getComponentName = getComponentName_1;
1871
1397
 
1872
- // Component that is being worked on
1398
+ var currentlyValidatingElement = null;
1873
1399
 
1400
+ var getDisplayName = function (element) {
1401
+ if (element == null) {
1402
+ return '#empty';
1403
+ } else if (typeof element === 'string' || typeof element === 'number') {
1404
+ return '#text';
1405
+ } else if (typeof element.type === 'string') {
1406
+ return element.type;
1407
+ } else {
1408
+ return element.type.displayName || element.type.name || 'Unknown';
1409
+ }
1410
+ };
1874
1411
 
1875
- ReactDebugCurrentFrame$1.current = null;
1876
-
1877
- // Element that is being cloned or created
1878
- ReactDebugCurrentFrame$1.element = null;
1879
-
1880
- ReactDebugCurrentFrame$1.getStackAddendum = function () {
1881
- var stack = null;
1882
- var current = ReactDebugCurrentFrame$1.current;
1883
- var element = ReactDebugCurrentFrame$1.element;
1884
- if (current !== null) {
1885
- if (typeof current === 'number') {
1886
- // DebugID from Stack.
1887
- var debugID = current;
1888
- stack = getStackAddendumByID(debugID);
1889
- } else if (typeof current.tag === 'number') {
1890
- // This is a Fiber.
1891
- // The stack will only be correct if this is a work in progress
1892
- // version and we're calling it during reconciliation.
1893
- var workInProgress = current;
1894
- stack = getStackAddendumByWorkInProgressFiber$2(workInProgress);
1895
- }
1896
- } else if (element !== null) {
1897
- stack = getCurrentStackAddendum$2(element);
1412
+ var getStackAddendum$1 = function () {
1413
+ var stack = '';
1414
+ if (currentlyValidatingElement) {
1415
+ var name = getDisplayName(currentlyValidatingElement);
1416
+ var owner = currentlyValidatingElement._owner;
1417
+ stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner));
1898
1418
  }
1419
+ stack += ReactDebugCurrentFrame$1.getStackAddendum() || '';
1899
1420
  return stack;
1900
1421
  };
1901
1422
  }
1902
1423
 
1903
- var ReactDebugCurrentFrame_1 = ReactDebugCurrentFrame$1;
1904
-
1905
- {
1906
- var checkPropTypes = checkPropTypes_1;
1907
- var warning$2 = warning_1;
1908
- var ReactDebugCurrentFrame = ReactDebugCurrentFrame_1;
1909
-
1910
- var _require$1 = ReactComponentTreeHook_1,
1911
- getCurrentStackAddendum$1 = _require$1.getCurrentStackAddendum;
1912
- }
1424
+ var ITERATOR_SYMBOL$1 = typeof Symbol === 'function' && Symbol.iterator;
1425
+ var FAUX_ITERATOR_SYMBOL$1 = '@@iterator'; // Before Symbol spec.
1913
1426
 
1914
1427
  function getDeclarationErrorAddendum() {
1915
1428
  if (ReactCurrentOwner_1.current) {
1916
- var name = getComponentName_1(ReactCurrentOwner_1.current);
1429
+ var name = getComponentName(ReactCurrentOwner_1.current);
1917
1430
  if (name) {
1918
1431
  return '\n\nCheck the render method of `' + name + '`.';
1919
1432
  }
@@ -1979,10 +1492,12 @@ function validateExplicitKey(element, parentType) {
1979
1492
  var childOwner = '';
1980
1493
  if (element && element._owner && element._owner !== ReactCurrentOwner_1.current) {
1981
1494
  // Give the component that originally created this child.
1982
- childOwner = ' It was passed a child from ' + getComponentName_1(element._owner) + '.';
1495
+ childOwner = ' It was passed a child from ' + getComponentName(element._owner) + '.';
1983
1496
  }
1984
1497
 
1985
- warning$2(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.%s', currentComponentErrorInfo, childOwner, getCurrentStackAddendum$1(element));
1498
+ currentlyValidatingElement = element;
1499
+ warning$4(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.%s', currentComponentErrorInfo, childOwner, getStackAddendum$1());
1500
+ currentlyValidatingElement = null;
1986
1501
  }
1987
1502
 
1988
1503
  /**
@@ -2011,9 +1526,10 @@ function validateChildKeys(node, parentType) {
2011
1526
  node._store.validated = true;
2012
1527
  }
2013
1528
  } else if (node) {
2014
- var iteratorFn = getIteratorFn_1(node);
2015
- // Entry iterators provide implicit keys.
2016
- if (iteratorFn) {
1529
+ var iteratorFn = ITERATOR_SYMBOL$1 && node[ITERATOR_SYMBOL$1] || node[FAUX_ITERATOR_SYMBOL$1];
1530
+ if (typeof iteratorFn === 'function') {
1531
+ // Entry iterators used to provide implicit keys,
1532
+ // but now we print a separate warning for them later.
2017
1533
  if (iteratorFn !== node.entries) {
2018
1534
  var iterator = iteratorFn.call(node);
2019
1535
  var step;
@@ -2048,14 +1564,16 @@ function validatePropTypes(element) {
2048
1564
  var propTypes = typeof componentClass.__propTypesSecretDontUseThesePlease === 'object' ? componentClass.__propTypesSecretDontUseThesePlease : componentClass.propTypes;
2049
1565
 
2050
1566
  if (propTypes) {
2051
- checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
1567
+ currentlyValidatingElement = element;
1568
+ checkPropTypes(propTypes, element.props, 'prop', name, getStackAddendum$1);
1569
+ currentlyValidatingElement = null;
2052
1570
  }
2053
1571
  if (typeof componentClass.getDefaultProps === 'function') {
2054
- warning$2(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1572
+ warning$4(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
2055
1573
  }
2056
1574
  }
2057
1575
 
2058
- var ReactElementValidator$2 = {
1576
+ var ReactElementValidator$1 = {
2059
1577
  createElement: function (type, props, children) {
2060
1578
  var validType = typeof type === 'string' || typeof type === 'function';
2061
1579
  // We warn in this case but don't throw. We expect the element creation to
@@ -2070,1507 +1588,394 @@ var ReactElementValidator$2 = {
2070
1588
  if (sourceInfo) {
2071
1589
  info += sourceInfo;
2072
1590
  } else {
2073
- info += getDeclarationErrorAddendum();
2074
- }
2075
-
2076
- info += getCurrentStackAddendum$1();
2077
-
2078
- warning$2(false, 'React.createElement: 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);
2079
- }
2080
-
2081
- var element = ReactElement_1.createElement.apply(this, arguments);
2082
-
2083
- // The result can be nullish if a mock or a custom function is used.
2084
- // TODO: Drop this when these are no longer allowed as the type argument.
2085
- if (element == null) {
2086
- return element;
2087
- }
2088
-
2089
- {
2090
- ReactDebugCurrentFrame.element = element;
2091
- }
2092
-
2093
- // Skip key warning if the type isn't valid since our key validation logic
2094
- // doesn't expect a non-string/function type and can throw confusing errors.
2095
- // We don't want exception behavior to differ between dev and prod.
2096
- // (Rendering will throw with a helpful message and as soon as the type is
2097
- // fixed, the key warnings will appear.)
2098
- if (validType) {
2099
- for (var i = 2; i < arguments.length; i++) {
2100
- validateChildKeys(arguments[i], type);
2101
- }
2102
- }
2103
-
2104
- validatePropTypes(element);
2105
-
2106
- {
2107
- ReactDebugCurrentFrame.element = null;
2108
- }
2109
-
2110
- return element;
2111
- },
2112
-
2113
- createFactory: function (type) {
2114
- var validatedFactory = ReactElementValidator$2.createElement.bind(null, type);
2115
- // Legacy hook TODO: Warn if this is accessed
2116
- validatedFactory.type = type;
2117
-
2118
- {
2119
- if (canDefineProperty_1) {
2120
- Object.defineProperty(validatedFactory, 'type', {
2121
- enumerable: false,
2122
- get: function () {
2123
- warning$2(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
2124
- Object.defineProperty(this, 'type', {
2125
- value: type
2126
- });
2127
- return type;
2128
- }
2129
- });
2130
- }
2131
- }
2132
-
2133
- return validatedFactory;
2134
- },
2135
-
2136
- cloneElement: function (element, props, children) {
2137
- var newElement = ReactElement_1.cloneElement.apply(this, arguments);
2138
- {
2139
- ReactDebugCurrentFrame.element = newElement;
2140
- }
2141
- for (var i = 2; i < arguments.length; i++) {
2142
- validateChildKeys(arguments[i], newElement.type);
2143
- }
2144
- validatePropTypes(newElement);
2145
- {
2146
- ReactDebugCurrentFrame.element = null;
2147
- }
2148
- return newElement;
2149
- }
2150
- };
2151
-
2152
- var ReactElementValidator_1 = ReactElementValidator$2;
2153
-
2154
- /**
2155
- * Create a factory that creates HTML tag elements.
2156
- *
2157
- * @private
2158
- */
2159
- var createDOMFactory = ReactElement_1.createFactory;
2160
- {
2161
- var ReactElementValidator$1 = ReactElementValidator_1;
2162
- createDOMFactory = ReactElementValidator$1.createFactory;
2163
- }
2164
-
2165
- /**
2166
- * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
2167
- *
2168
- * @public
2169
- */
2170
- var ReactDOMFactories = {
2171
- a: createDOMFactory('a'),
2172
- abbr: createDOMFactory('abbr'),
2173
- address: createDOMFactory('address'),
2174
- area: createDOMFactory('area'),
2175
- article: createDOMFactory('article'),
2176
- aside: createDOMFactory('aside'),
2177
- audio: createDOMFactory('audio'),
2178
- b: createDOMFactory('b'),
2179
- base: createDOMFactory('base'),
2180
- bdi: createDOMFactory('bdi'),
2181
- bdo: createDOMFactory('bdo'),
2182
- big: createDOMFactory('big'),
2183
- blockquote: createDOMFactory('blockquote'),
2184
- body: createDOMFactory('body'),
2185
- br: createDOMFactory('br'),
2186
- button: createDOMFactory('button'),
2187
- canvas: createDOMFactory('canvas'),
2188
- caption: createDOMFactory('caption'),
2189
- cite: createDOMFactory('cite'),
2190
- code: createDOMFactory('code'),
2191
- col: createDOMFactory('col'),
2192
- colgroup: createDOMFactory('colgroup'),
2193
- data: createDOMFactory('data'),
2194
- datalist: createDOMFactory('datalist'),
2195
- dd: createDOMFactory('dd'),
2196
- del: createDOMFactory('del'),
2197
- details: createDOMFactory('details'),
2198
- dfn: createDOMFactory('dfn'),
2199
- dialog: createDOMFactory('dialog'),
2200
- div: createDOMFactory('div'),
2201
- dl: createDOMFactory('dl'),
2202
- dt: createDOMFactory('dt'),
2203
- em: createDOMFactory('em'),
2204
- embed: createDOMFactory('embed'),
2205
- fieldset: createDOMFactory('fieldset'),
2206
- figcaption: createDOMFactory('figcaption'),
2207
- figure: createDOMFactory('figure'),
2208
- footer: createDOMFactory('footer'),
2209
- form: createDOMFactory('form'),
2210
- h1: createDOMFactory('h1'),
2211
- h2: createDOMFactory('h2'),
2212
- h3: createDOMFactory('h3'),
2213
- h4: createDOMFactory('h4'),
2214
- h5: createDOMFactory('h5'),
2215
- h6: createDOMFactory('h6'),
2216
- head: createDOMFactory('head'),
2217
- header: createDOMFactory('header'),
2218
- hgroup: createDOMFactory('hgroup'),
2219
- hr: createDOMFactory('hr'),
2220
- html: createDOMFactory('html'),
2221
- i: createDOMFactory('i'),
2222
- iframe: createDOMFactory('iframe'),
2223
- img: createDOMFactory('img'),
2224
- input: createDOMFactory('input'),
2225
- ins: createDOMFactory('ins'),
2226
- kbd: createDOMFactory('kbd'),
2227
- keygen: createDOMFactory('keygen'),
2228
- label: createDOMFactory('label'),
2229
- legend: createDOMFactory('legend'),
2230
- li: createDOMFactory('li'),
2231
- link: createDOMFactory('link'),
2232
- main: createDOMFactory('main'),
2233
- map: createDOMFactory('map'),
2234
- mark: createDOMFactory('mark'),
2235
- menu: createDOMFactory('menu'),
2236
- menuitem: createDOMFactory('menuitem'),
2237
- meta: createDOMFactory('meta'),
2238
- meter: createDOMFactory('meter'),
2239
- nav: createDOMFactory('nav'),
2240
- noscript: createDOMFactory('noscript'),
2241
- object: createDOMFactory('object'),
2242
- ol: createDOMFactory('ol'),
2243
- optgroup: createDOMFactory('optgroup'),
2244
- option: createDOMFactory('option'),
2245
- output: createDOMFactory('output'),
2246
- p: createDOMFactory('p'),
2247
- param: createDOMFactory('param'),
2248
- picture: createDOMFactory('picture'),
2249
- pre: createDOMFactory('pre'),
2250
- progress: createDOMFactory('progress'),
2251
- q: createDOMFactory('q'),
2252
- rp: createDOMFactory('rp'),
2253
- rt: createDOMFactory('rt'),
2254
- ruby: createDOMFactory('ruby'),
2255
- s: createDOMFactory('s'),
2256
- samp: createDOMFactory('samp'),
2257
- script: createDOMFactory('script'),
2258
- section: createDOMFactory('section'),
2259
- select: createDOMFactory('select'),
2260
- small: createDOMFactory('small'),
2261
- source: createDOMFactory('source'),
2262
- span: createDOMFactory('span'),
2263
- strong: createDOMFactory('strong'),
2264
- style: createDOMFactory('style'),
2265
- sub: createDOMFactory('sub'),
2266
- summary: createDOMFactory('summary'),
2267
- sup: createDOMFactory('sup'),
2268
- table: createDOMFactory('table'),
2269
- tbody: createDOMFactory('tbody'),
2270
- td: createDOMFactory('td'),
2271
- textarea: createDOMFactory('textarea'),
2272
- tfoot: createDOMFactory('tfoot'),
2273
- th: createDOMFactory('th'),
2274
- thead: createDOMFactory('thead'),
2275
- time: createDOMFactory('time'),
2276
- title: createDOMFactory('title'),
2277
- tr: createDOMFactory('tr'),
2278
- track: createDOMFactory('track'),
2279
- u: createDOMFactory('u'),
2280
- ul: createDOMFactory('ul'),
2281
- 'var': createDOMFactory('var'),
2282
- video: createDOMFactory('video'),
2283
- wbr: createDOMFactory('wbr'),
2284
-
2285
- // SVG
2286
- circle: createDOMFactory('circle'),
2287
- clipPath: createDOMFactory('clipPath'),
2288
- defs: createDOMFactory('defs'),
2289
- ellipse: createDOMFactory('ellipse'),
2290
- g: createDOMFactory('g'),
2291
- image: createDOMFactory('image'),
2292
- line: createDOMFactory('line'),
2293
- linearGradient: createDOMFactory('linearGradient'),
2294
- mask: createDOMFactory('mask'),
2295
- path: createDOMFactory('path'),
2296
- pattern: createDOMFactory('pattern'),
2297
- polygon: createDOMFactory('polygon'),
2298
- polyline: createDOMFactory('polyline'),
2299
- radialGradient: createDOMFactory('radialGradient'),
2300
- rect: createDOMFactory('rect'),
2301
- stop: createDOMFactory('stop'),
2302
- svg: createDOMFactory('svg'),
2303
- text: createDOMFactory('text'),
2304
- tspan: createDOMFactory('tspan')
2305
- };
2306
-
2307
- var ReactDOMFactories_1 = ReactDOMFactories;
2308
-
2309
- function createCommonjsModule(fn, module) {
2310
- return module = { exports: {} }, fn(module, module.exports), module.exports;
2311
- }
2312
-
2313
- var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
2314
- /* global Symbol */
2315
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
2316
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
2317
-
2318
- /**
2319
- * Returns the iterator method function contained on the iterable object.
2320
- *
2321
- * Be sure to invoke the function with the iterable as context:
2322
- *
2323
- * var iteratorFn = getIteratorFn(myIterable);
2324
- * if (iteratorFn) {
2325
- * var iterator = iteratorFn.call(myIterable);
2326
- * ...
2327
- * }
2328
- *
2329
- * @param {?object} maybeIterable
2330
- * @return {?function}
2331
- */
2332
- function getIteratorFn(maybeIterable) {
2333
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
2334
- if (typeof iteratorFn === 'function') {
2335
- return iteratorFn;
2336
- }
2337
- }
2338
-
2339
- /**
2340
- * Collection of methods that allow declaration and validation of props that are
2341
- * supplied to React components. Example usage:
2342
- *
2343
- * var Props = require('ReactPropTypes');
2344
- * var MyArticle = React.createClass({
2345
- * propTypes: {
2346
- * // An optional string prop named "description".
2347
- * description: Props.string,
2348
- *
2349
- * // A required enum prop named "category".
2350
- * category: Props.oneOf(['News','Photos']).isRequired,
2351
- *
2352
- * // A prop named "dialog" that requires an instance of Dialog.
2353
- * dialog: Props.instanceOf(Dialog).isRequired
2354
- * },
2355
- * render: function() { ... }
2356
- * });
2357
- *
2358
- * A more formal specification of how these methods are used:
2359
- *
2360
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
2361
- * decl := ReactPropTypes.{type}(.isRequired)?
2362
- *
2363
- * Each and every declaration produces a function with the same signature. This
2364
- * allows the creation of custom validation functions. For example:
2365
- *
2366
- * var MyLink = React.createClass({
2367
- * propTypes: {
2368
- * // An optional string or URI prop named "href".
2369
- * href: function(props, propName, componentName) {
2370
- * var propValue = props[propName];
2371
- * if (propValue != null && typeof propValue !== 'string' &&
2372
- * !(propValue instanceof URI)) {
2373
- * return new Error(
2374
- * 'Expected a string or an URI for ' + propName + ' in ' +
2375
- * componentName
2376
- * );
2377
- * }
2378
- * }
2379
- * },
2380
- * render: function() {...}
2381
- * });
2382
- *
2383
- * @internal
2384
- */
2385
-
2386
- var ANONYMOUS = '<<anonymous>>';
2387
-
2388
- // Important!
2389
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
2390
- var ReactPropTypes = {
2391
- array: createPrimitiveTypeChecker('array'),
2392
- bool: createPrimitiveTypeChecker('boolean'),
2393
- func: createPrimitiveTypeChecker('function'),
2394
- number: createPrimitiveTypeChecker('number'),
2395
- object: createPrimitiveTypeChecker('object'),
2396
- string: createPrimitiveTypeChecker('string'),
2397
- symbol: createPrimitiveTypeChecker('symbol'),
2398
-
2399
- any: createAnyTypeChecker(),
2400
- arrayOf: createArrayOfTypeChecker,
2401
- element: createElementTypeChecker(),
2402
- instanceOf: createInstanceTypeChecker,
2403
- node: createNodeChecker(),
2404
- objectOf: createObjectOfTypeChecker,
2405
- oneOf: createEnumTypeChecker,
2406
- oneOfType: createUnionTypeChecker,
2407
- shape: createShapeTypeChecker
2408
- };
2409
-
2410
- /**
2411
- * inlined Object.is polyfill to avoid requiring consumers ship their own
2412
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
2413
- */
2414
- /*eslint-disable no-self-compare*/
2415
- function is(x, y) {
2416
- // SameValue algorithm
2417
- if (x === y) {
2418
- // Steps 1-5, 7-10
2419
- // Steps 6.b-6.e: +0 != -0
2420
- return x !== 0 || 1 / x === 1 / y;
2421
- } else {
2422
- // Step 6.a: NaN == NaN
2423
- return x !== x && y !== y;
2424
- }
2425
- }
2426
- /*eslint-enable no-self-compare*/
2427
-
2428
- /**
2429
- * We use an Error-like object for backward compatibility as people may call
2430
- * PropTypes directly and inspect their output. However, we don't use real
2431
- * Errors anymore. We don't inspect their stack anyway, and creating them
2432
- * is prohibitively expensive if they are created too often, such as what
2433
- * happens in oneOfType() for any type before the one that matched.
2434
- */
2435
- function PropTypeError(message) {
2436
- this.message = message;
2437
- this.stack = '';
2438
- }
2439
- // Make `instanceof Error` still work for returned errors.
2440
- PropTypeError.prototype = Error.prototype;
2441
-
2442
- function createChainableTypeChecker(validate) {
2443
- {
2444
- var manualPropTypeCallCache = {};
2445
- var manualPropTypeWarningCount = 0;
2446
- }
2447
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
2448
- componentName = componentName || ANONYMOUS;
2449
- propFullName = propFullName || propName;
2450
-
2451
- if (secret !== ReactPropTypesSecret_1) {
2452
- if (throwOnDirectAccess) {
2453
- // New behavior only for users of `prop-types` package
2454
- invariant_1(
2455
- false,
2456
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
2457
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
2458
- 'Read more at http://fb.me/use-check-prop-types'
2459
- );
2460
- } else if ('development' !== 'production' && typeof console !== 'undefined') {
2461
- // Old behavior for people using React.PropTypes
2462
- var cacheKey = componentName + ':' + propName;
2463
- if (
2464
- !manualPropTypeCallCache[cacheKey] &&
2465
- // Avoid spamming the console because they are often not actionable except for lib authors
2466
- manualPropTypeWarningCount < 3
2467
- ) {
2468
- warning_1(
2469
- false,
2470
- 'You are manually calling a React.PropTypes validation ' +
2471
- 'function for the `%s` prop on `%s`. This is deprecated ' +
2472
- 'and will throw in the standalone `prop-types` package. ' +
2473
- 'You may be seeing this warning due to a third-party PropTypes ' +
2474
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
2475
- propFullName,
2476
- componentName
2477
- );
2478
- manualPropTypeCallCache[cacheKey] = true;
2479
- manualPropTypeWarningCount++;
2480
- }
2481
- }
2482
- }
2483
- if (props[propName] == null) {
2484
- if (isRequired) {
2485
- if (props[propName] === null) {
2486
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
2487
- }
2488
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
2489
- }
2490
- return null;
2491
- } else {
2492
- return validate(props, propName, componentName, location, propFullName);
2493
- }
2494
- }
2495
-
2496
- var chainedCheckType = checkType.bind(null, false);
2497
- chainedCheckType.isRequired = checkType.bind(null, true);
2498
-
2499
- return chainedCheckType;
2500
- }
2501
-
2502
- function createPrimitiveTypeChecker(expectedType) {
2503
- function validate(props, propName, componentName, location, propFullName, secret) {
2504
- var propValue = props[propName];
2505
- var propType = getPropType(propValue);
2506
- if (propType !== expectedType) {
2507
- // `propValue` being instance of, say, date/regexp, pass the 'object'
2508
- // check, but we can offer a more precise error message here rather than
2509
- // 'of type `object`'.
2510
- var preciseType = getPreciseType(propValue);
2511
-
2512
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
2513
- }
2514
- return null;
2515
- }
2516
- return createChainableTypeChecker(validate);
2517
- }
2518
-
2519
- function createAnyTypeChecker() {
2520
- return createChainableTypeChecker(emptyFunction_1.thatReturnsNull);
2521
- }
2522
-
2523
- function createArrayOfTypeChecker(typeChecker) {
2524
- function validate(props, propName, componentName, location, propFullName) {
2525
- if (typeof typeChecker !== 'function') {
2526
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
2527
- }
2528
- var propValue = props[propName];
2529
- if (!Array.isArray(propValue)) {
2530
- var propType = getPropType(propValue);
2531
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
2532
- }
2533
- for (var i = 0; i < propValue.length; i++) {
2534
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
2535
- if (error instanceof Error) {
2536
- return error;
2537
- }
2538
- }
2539
- return null;
2540
- }
2541
- return createChainableTypeChecker(validate);
2542
- }
2543
-
2544
- function createElementTypeChecker() {
2545
- function validate(props, propName, componentName, location, propFullName) {
2546
- var propValue = props[propName];
2547
- if (!isValidElement(propValue)) {
2548
- var propType = getPropType(propValue);
2549
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
2550
- }
2551
- return null;
2552
- }
2553
- return createChainableTypeChecker(validate);
2554
- }
2555
-
2556
- function createInstanceTypeChecker(expectedClass) {
2557
- function validate(props, propName, componentName, location, propFullName) {
2558
- if (!(props[propName] instanceof expectedClass)) {
2559
- var expectedClassName = expectedClass.name || ANONYMOUS;
2560
- var actualClassName = getClassName(props[propName]);
2561
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
2562
- }
2563
- return null;
2564
- }
2565
- return createChainableTypeChecker(validate);
2566
- }
2567
-
2568
- function createEnumTypeChecker(expectedValues) {
2569
- if (!Array.isArray(expectedValues)) {
2570
- warning_1(false, 'Invalid argument supplied to oneOf, expected an instance of array.');
2571
- return emptyFunction_1.thatReturnsNull;
2572
- }
2573
-
2574
- function validate(props, propName, componentName, location, propFullName) {
2575
- var propValue = props[propName];
2576
- for (var i = 0; i < expectedValues.length; i++) {
2577
- if (is(propValue, expectedValues[i])) {
2578
- return null;
2579
- }
2580
- }
2581
-
2582
- var valuesString = JSON.stringify(expectedValues);
2583
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
2584
- }
2585
- return createChainableTypeChecker(validate);
2586
- }
2587
-
2588
- function createObjectOfTypeChecker(typeChecker) {
2589
- function validate(props, propName, componentName, location, propFullName) {
2590
- if (typeof typeChecker !== 'function') {
2591
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
2592
- }
2593
- var propValue = props[propName];
2594
- var propType = getPropType(propValue);
2595
- if (propType !== 'object') {
2596
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
2597
- }
2598
- for (var key in propValue) {
2599
- if (propValue.hasOwnProperty(key)) {
2600
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
2601
- if (error instanceof Error) {
2602
- return error;
2603
- }
2604
- }
2605
- }
2606
- return null;
2607
- }
2608
- return createChainableTypeChecker(validate);
2609
- }
2610
-
2611
- function createUnionTypeChecker(arrayOfTypeCheckers) {
2612
- if (!Array.isArray(arrayOfTypeCheckers)) {
2613
- warning_1(false, 'Invalid argument supplied to oneOfType, expected an instance of array.');
2614
- return emptyFunction_1.thatReturnsNull;
2615
- }
2616
-
2617
- function validate(props, propName, componentName, location, propFullName) {
2618
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
2619
- var checker = arrayOfTypeCheckers[i];
2620
- if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1) == null) {
2621
- return null;
2622
- }
2623
- }
2624
-
2625
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
2626
- }
2627
- return createChainableTypeChecker(validate);
2628
- }
2629
-
2630
- function createNodeChecker() {
2631
- function validate(props, propName, componentName, location, propFullName) {
2632
- if (!isNode(props[propName])) {
2633
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
2634
- }
2635
- return null;
2636
- }
2637
- return createChainableTypeChecker(validate);
2638
- }
2639
-
2640
- function createShapeTypeChecker(shapeTypes) {
2641
- function validate(props, propName, componentName, location, propFullName) {
2642
- var propValue = props[propName];
2643
- var propType = getPropType(propValue);
2644
- if (propType !== 'object') {
2645
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
2646
- }
2647
- for (var key in shapeTypes) {
2648
- var checker = shapeTypes[key];
2649
- if (!checker) {
2650
- continue;
2651
- }
2652
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
2653
- if (error) {
2654
- return error;
2655
- }
2656
- }
2657
- return null;
2658
- }
2659
- return createChainableTypeChecker(validate);
2660
- }
2661
-
2662
- function isNode(propValue) {
2663
- switch (typeof propValue) {
2664
- case 'number':
2665
- case 'string':
2666
- case 'undefined':
2667
- return true;
2668
- case 'boolean':
2669
- return !propValue;
2670
- case 'object':
2671
- if (Array.isArray(propValue)) {
2672
- return propValue.every(isNode);
2673
- }
2674
- if (propValue === null || isValidElement(propValue)) {
2675
- return true;
2676
- }
2677
-
2678
- var iteratorFn = getIteratorFn(propValue);
2679
- if (iteratorFn) {
2680
- var iterator = iteratorFn.call(propValue);
2681
- var step;
2682
- if (iteratorFn !== propValue.entries) {
2683
- while (!(step = iterator.next()).done) {
2684
- if (!isNode(step.value)) {
2685
- return false;
2686
- }
2687
- }
2688
- } else {
2689
- // Iterator will provide entry [k,v] tuples rather than values.
2690
- while (!(step = iterator.next()).done) {
2691
- var entry = step.value;
2692
- if (entry) {
2693
- if (!isNode(entry[1])) {
2694
- return false;
2695
- }
2696
- }
2697
- }
2698
- }
2699
- } else {
2700
- return false;
2701
- }
2702
-
2703
- return true;
2704
- default:
2705
- return false;
2706
- }
2707
- }
2708
-
2709
- function isSymbol(propType, propValue) {
2710
- // Native Symbol.
2711
- if (propType === 'symbol') {
2712
- return true;
2713
- }
1591
+ info += getDeclarationErrorAddendum();
1592
+ }
2714
1593
 
2715
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
2716
- if (propValue['@@toStringTag'] === 'Symbol') {
2717
- return true;
2718
- }
1594
+ info += ReactDebugCurrentFrame$1.getStackAddendum() || '';
2719
1595
 
2720
- // Fallback for non-spec compliant Symbols which are polyfilled.
2721
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
2722
- return true;
1596
+ warning$4(false, 'React.createElement: 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);
2723
1597
  }
2724
1598
 
2725
- return false;
2726
- }
1599
+ var element = ReactElement_1.createElement.apply(this, arguments);
2727
1600
 
2728
- // Equivalent of `typeof` but with special handling for array and regexp.
2729
- function getPropType(propValue) {
2730
- var propType = typeof propValue;
2731
- if (Array.isArray(propValue)) {
2732
- return 'array';
2733
- }
2734
- if (propValue instanceof RegExp) {
2735
- // Old webkits (at least until Android 4.0) return 'function' rather than
2736
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
2737
- // passes PropTypes.object.
2738
- return 'object';
2739
- }
2740
- if (isSymbol(propType, propValue)) {
2741
- return 'symbol';
1601
+ // The result can be nullish if a mock or a custom function is used.
1602
+ // TODO: Drop this when these are no longer allowed as the type argument.
1603
+ if (element == null) {
1604
+ return element;
2742
1605
  }
2743
- return propType;
2744
- }
2745
1606
 
2746
- // This handles more types than `getPropType`. Only used for error messages.
2747
- // See `createPrimitiveTypeChecker`.
2748
- function getPreciseType(propValue) {
2749
- var propType = getPropType(propValue);
2750
- if (propType === 'object') {
2751
- if (propValue instanceof Date) {
2752
- return 'date';
2753
- } else if (propValue instanceof RegExp) {
2754
- return 'regexp';
1607
+ // Skip key warning if the type isn't valid since our key validation logic
1608
+ // doesn't expect a non-string/function type and can throw confusing errors.
1609
+ // We don't want exception behavior to differ between dev and prod.
1610
+ // (Rendering will throw with a helpful message and as soon as the type is
1611
+ // fixed, the key warnings will appear.)
1612
+ if (validType) {
1613
+ for (var i = 2; i < arguments.length; i++) {
1614
+ validateChildKeys(arguments[i], type);
2755
1615
  }
2756
1616
  }
2757
- return propType;
2758
- }
2759
1617
 
2760
- // Returns class name of the object, if any.
2761
- function getClassName(propValue) {
2762
- if (!propValue.constructor || !propValue.constructor.name) {
2763
- return ANONYMOUS;
1618
+ validatePropTypes(element);
1619
+
1620
+ return element;
1621
+ },
1622
+
1623
+ createFactory: function (type) {
1624
+ var validatedFactory = ReactElementValidator$1.createElement.bind(null, type);
1625
+ // Legacy hook TODO: Warn if this is accessed
1626
+ validatedFactory.type = type;
1627
+
1628
+ {
1629
+ Object.defineProperty(validatedFactory, 'type', {
1630
+ enumerable: false,
1631
+ get: function () {
1632
+ lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
1633
+ Object.defineProperty(this, 'type', {
1634
+ value: type
1635
+ });
1636
+ return type;
1637
+ }
1638
+ });
2764
1639
  }
2765
- return propValue.constructor.name;
2766
- }
2767
1640
 
2768
- ReactPropTypes.checkPropTypes = checkPropTypes_1;
2769
- ReactPropTypes.PropTypes = ReactPropTypes;
1641
+ return validatedFactory;
1642
+ },
2770
1643
 
2771
- return ReactPropTypes;
1644
+ cloneElement: function (element, props, children) {
1645
+ var newElement = ReactElement_1.cloneElement.apply(this, arguments);
1646
+ for (var i = 2; i < arguments.length; i++) {
1647
+ validateChildKeys(arguments[i], newElement.type);
1648
+ }
1649
+ validatePropTypes(newElement);
1650
+ return newElement;
1651
+ }
2772
1652
  };
2773
1653
 
2774
- var index$2 = createCommonjsModule(function (module) {
2775
- /**
2776
- * Copyright 2013-present, Facebook, Inc.
2777
- * All rights reserved.
2778
- *
2779
- * This source code is licensed under the BSD-style license found in the
2780
- * LICENSE file in the root directory of this source tree. An additional grant
2781
- * of patent rights can be found in the PATENTS file in the same directory.
2782
- */
1654
+ var ReactElementValidator_1 = ReactElementValidator$1;
2783
1655
 
2784
1656
  {
2785
- var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
2786
- Symbol.for &&
2787
- Symbol.for('react.element')) ||
2788
- 0xeac7;
2789
-
2790
- var isValidElement = function(object) {
2791
- return typeof object === 'object' &&
2792
- object !== null &&
2793
- object.$$typeof === REACT_ELEMENT_TYPE;
2794
- };
2795
-
2796
- // By explicitly using `prop-types` you are opting into new development behavior.
2797
- // http://fb.me/prop-types-in-prod
2798
- var throwOnDirectAccess = true;
2799
- module.exports = factoryWithTypeCheckers(isValidElement, throwOnDirectAccess);
1657
+ var warning$6 = warning_1;
2800
1658
  }
2801
- });
2802
-
2803
- var ReactPropTypes = index$2;
2804
-
2805
- /**
2806
- * Copyright 2013-present, Facebook, Inc.
2807
- * All rights reserved.
2808
- *
2809
- * This source code is licensed under the BSD-style license found in the
2810
- * LICENSE file in the root directory of this source tree. An additional grant
2811
- * of patent rights can be found in the PATENTS file in the same directory.
2812
- *
2813
- * @providesModule ReactVersion
2814
- */
2815
-
2816
- var ReactVersion = '16.0.0-alpha.12';
2817
1659
 
2818
- /**
2819
- * Returns the first child in a collection of children and verifies that there
2820
- * is only one child in the collection.
2821
- *
2822
- * See https://facebook.github.io/react/docs/react-api.html#react.children.only
2823
- *
2824
- * The current implementation of this function assumes that a single child gets
2825
- * passed without a wrapper, but the purpose of this helper function is to
2826
- * abstract away the particular structure of children.
2827
- *
2828
- * @param {?object} children Child collection structure.
2829
- * @return {ReactElement} The first and only `ReactElement` contained in the
2830
- * structure.
2831
- */
2832
- function onlyChild(children) {
2833
- !ReactElement_1.isValidElement(children) ? invariant_1(false, 'React.Children.only expected to receive a single React element child.') : void 0;
2834
- return children;
1660
+ function isNative(fn) {
1661
+ // Based on isNative() from Lodash
1662
+ var funcToString = Function.prototype.toString;
1663
+ var reIsNative = RegExp('^' + funcToString
1664
+ // Take an example native function source for comparison
1665
+ .call(Object.prototype.hasOwnProperty)
1666
+ // Strip regex characters so we can use it for regex
1667
+ .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
1668
+ // Remove hasOwnProperty from the template to make it generic
1669
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
1670
+ try {
1671
+ var source = funcToString.call(fn);
1672
+ return reIsNative.test(source);
1673
+ } catch (err) {
1674
+ return false;
1675
+ }
2835
1676
  }
2836
1677
 
2837
- var onlyChild_1 = onlyChild;
2838
-
2839
- {
2840
- var warning$4 = warning_1;
2841
- }
1678
+ var canUseCollections =
1679
+ // Array.from
1680
+ typeof Array.from === 'function' &&
1681
+ // Map
1682
+ typeof Map === 'function' && isNative(Map) &&
1683
+ // Map.prototype.keys
1684
+ Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
1685
+ // Set
1686
+ typeof Set === 'function' && isNative(Set) &&
1687
+ // Set.prototype.keys
1688
+ Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
2842
1689
 
2843
- var MIXINS_KEY = 'mixins';
1690
+ var setItem;
1691
+ var getItem;
1692
+ var removeItem;
1693
+ var getItemIDs;
1694
+ var addRoot;
1695
+ var removeRoot;
1696
+ var getRootIDs;
2844
1697
 
2845
- // Helper function to allow the creation of anonymous functions which do not
2846
- // have .name set to the name of the variable being assigned to.
2847
- function identity(fn) {
2848
- return fn;
2849
- }
1698
+ if (canUseCollections) {
1699
+ var itemMap = new Map();
1700
+ var rootIDSet = new Set();
2850
1701
 
2851
- var ReactPropTypeLocationNames;
2852
- {
2853
- ReactPropTypeLocationNames = {
2854
- prop: 'prop',
2855
- context: 'context',
2856
- childContext: 'child context',
1702
+ setItem = function (id, item) {
1703
+ itemMap.set(id, item);
1704
+ };
1705
+ getItem = function (id) {
1706
+ return itemMap.get(id);
1707
+ };
1708
+ removeItem = function (id) {
1709
+ itemMap['delete'](id);
1710
+ };
1711
+ getItemIDs = function () {
1712
+ return Array.from(itemMap.keys());
2857
1713
  };
2858
- }
2859
-
2860
- function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
2861
- /**
2862
- * Policies that describe methods in `ReactClassInterface`.
2863
- */
2864
-
2865
1714
 
2866
- var injectedMixins = [];
1715
+ addRoot = function (id) {
1716
+ rootIDSet.add(id);
1717
+ };
1718
+ removeRoot = function (id) {
1719
+ rootIDSet['delete'](id);
1720
+ };
1721
+ getRootIDs = function () {
1722
+ return Array.from(rootIDSet.keys());
1723
+ };
1724
+ } else {
1725
+ var itemByKey = {};
1726
+ var rootByKey = {};
2867
1727
 
2868
- /**
2869
- * Composite components are higher-level components that compose other composite
2870
- * or host components.
2871
- *
2872
- * To create a new type of `ReactClass`, pass a specification of
2873
- * your new class to `React.createClass`. The only requirement of your class
2874
- * specification is that you implement a `render` method.
2875
- *
2876
- * var MyComponent = React.createClass({
2877
- * render: function() {
2878
- * return <div>Hello World</div>;
2879
- * }
2880
- * });
2881
- *
2882
- * The class specification supports a specific protocol of methods that have
2883
- * special meaning (e.g. `render`). See `ReactClassInterface` for
2884
- * more the comprehensive protocol. Any other properties and methods in the
2885
- * class specification will be available on the prototype.
2886
- *
2887
- * @interface ReactClassInterface
2888
- * @internal
2889
- */
2890
- var ReactClassInterface = {
2891
-
2892
- /**
2893
- * An array of Mixin objects to include when defining your component.
2894
- *
2895
- * @type {array}
2896
- * @optional
2897
- */
2898
- mixins: 'DEFINE_MANY',
2899
-
2900
- /**
2901
- * An object containing properties and methods that should be defined on
2902
- * the component's constructor instead of its prototype (static methods).
2903
- *
2904
- * @type {object}
2905
- * @optional
2906
- */
2907
- statics: 'DEFINE_MANY',
2908
-
2909
- /**
2910
- * Definition of prop types for this component.
2911
- *
2912
- * @type {object}
2913
- * @optional
2914
- */
2915
- propTypes: 'DEFINE_MANY',
2916
-
2917
- /**
2918
- * Definition of context types for this component.
2919
- *
2920
- * @type {object}
2921
- * @optional
2922
- */
2923
- contextTypes: 'DEFINE_MANY',
2924
-
2925
- /**
2926
- * Definition of context types this component sets for its children.
2927
- *
2928
- * @type {object}
2929
- * @optional
2930
- */
2931
- childContextTypes: 'DEFINE_MANY',
2932
-
2933
- // ==== Definition methods ====
2934
-
2935
- /**
2936
- * Invoked when the component is mounted. Values in the mapping will be set on
2937
- * `this.props` if that prop is not specified (i.e. using an `in` check).
2938
- *
2939
- * This method is invoked before `getInitialState` and therefore cannot rely
2940
- * on `this.state` or use `this.setState`.
2941
- *
2942
- * @return {object}
2943
- * @optional
2944
- */
2945
- getDefaultProps: 'DEFINE_MANY_MERGED',
2946
-
2947
- /**
2948
- * Invoked once before the component is mounted. The return value will be used
2949
- * as the initial value of `this.state`.
2950
- *
2951
- * getInitialState: function() {
2952
- * return {
2953
- * isOn: false,
2954
- * fooBaz: new BazFoo()
2955
- * }
2956
- * }
2957
- *
2958
- * @return {object}
2959
- * @optional
2960
- */
2961
- getInitialState: 'DEFINE_MANY_MERGED',
2962
-
2963
- /**
2964
- * @return {object}
2965
- * @optional
2966
- */
2967
- getChildContext: 'DEFINE_MANY_MERGED',
2968
-
2969
- /**
2970
- * Uses props from `this.props` and state from `this.state` to render the
2971
- * structure of the component.
2972
- *
2973
- * No guarantees are made about when or how often this method is invoked, so
2974
- * it must not have side effects.
2975
- *
2976
- * render: function() {
2977
- * var name = this.props.name;
2978
- * return <div>Hello, {name}!</div>;
2979
- * }
2980
- *
2981
- * @return {ReactComponent}
2982
- * @nosideeffects
2983
- * @required
2984
- */
2985
- render: 'DEFINE_ONCE',
2986
-
2987
- // ==== Delegate methods ====
2988
-
2989
- /**
2990
- * Invoked when the component is initially created and about to be mounted.
2991
- * This may have side effects, but any external subscriptions or data created
2992
- * by this method must be cleaned up in `componentWillUnmount`.
2993
- *
2994
- * @optional
2995
- */
2996
- componentWillMount: 'DEFINE_MANY',
2997
-
2998
- /**
2999
- * Invoked when the component has been mounted and has a DOM representation.
3000
- * However, there is no guarantee that the DOM node is in the document.
3001
- *
3002
- * Use this as an opportunity to operate on the DOM when the component has
3003
- * been mounted (initialized and rendered) for the first time.
3004
- *
3005
- * @param {DOMElement} rootNode DOM element representing the component.
3006
- * @optional
3007
- */
3008
- componentDidMount: 'DEFINE_MANY',
3009
-
3010
- /**
3011
- * Invoked before the component receives new props.
3012
- *
3013
- * Use this as an opportunity to react to a prop transition by updating the
3014
- * state using `this.setState`. Current props are accessed via `this.props`.
3015
- *
3016
- * componentWillReceiveProps: function(nextProps, nextContext) {
3017
- * this.setState({
3018
- * likesIncreasing: nextProps.likeCount > this.props.likeCount
3019
- * });
3020
- * }
3021
- *
3022
- * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
3023
- * transition may cause a state change, but the opposite is not true. If you
3024
- * need it, you are probably looking for `componentWillUpdate`.
3025
- *
3026
- * @param {object} nextProps
3027
- * @optional
3028
- */
3029
- componentWillReceiveProps: 'DEFINE_MANY',
3030
-
3031
- /**
3032
- * Invoked while deciding if the component should be updated as a result of
3033
- * receiving new props, state and/or context.
3034
- *
3035
- * Use this as an opportunity to `return false` when you're certain that the
3036
- * transition to the new props/state/context will not require a component
3037
- * update.
3038
- *
3039
- * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
3040
- * return !equal(nextProps, this.props) ||
3041
- * !equal(nextState, this.state) ||
3042
- * !equal(nextContext, this.context);
3043
- * }
3044
- *
3045
- * @param {object} nextProps
3046
- * @param {?object} nextState
3047
- * @param {?object} nextContext
3048
- * @return {boolean} True if the component should update.
3049
- * @optional
3050
- */
3051
- shouldComponentUpdate: 'DEFINE_ONCE',
3052
-
3053
- /**
3054
- * Invoked when the component is about to update due to a transition from
3055
- * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
3056
- * and `nextContext`.
3057
- *
3058
- * Use this as an opportunity to perform preparation before an update occurs.
3059
- *
3060
- * NOTE: You **cannot** use `this.setState()` in this method.
3061
- *
3062
- * @param {object} nextProps
3063
- * @param {?object} nextState
3064
- * @param {?object} nextContext
3065
- * @param {ReactReconcileTransaction} transaction
3066
- * @optional
3067
- */
3068
- componentWillUpdate: 'DEFINE_MANY',
3069
-
3070
- /**
3071
- * Invoked when the component's DOM representation has been updated.
3072
- *
3073
- * Use this as an opportunity to operate on the DOM when the component has
3074
- * been updated.
3075
- *
3076
- * @param {object} prevProps
3077
- * @param {?object} prevState
3078
- * @param {?object} prevContext
3079
- * @param {DOMElement} rootNode DOM element representing the component.
3080
- * @optional
3081
- */
3082
- componentDidUpdate: 'DEFINE_MANY',
3083
-
3084
- /**
3085
- * Invoked when the component is about to be removed from its parent and have
3086
- * its DOM representation destroyed.
3087
- *
3088
- * Use this as an opportunity to deallocate any external resources.
3089
- *
3090
- * NOTE: There is no `componentDidUnmount` since your component will have been
3091
- * destroyed by that point.
3092
- *
3093
- * @optional
3094
- */
3095
- componentWillUnmount: 'DEFINE_MANY',
3096
-
3097
- // ==== Advanced methods ====
3098
-
3099
- /**
3100
- * Updates the component's currently mounted DOM representation.
3101
- *
3102
- * By default, this implements React's rendering and reconciliation algorithm.
3103
- * Sophisticated clients may wish to override this.
3104
- *
3105
- * @param {ReactReconcileTransaction} transaction
3106
- * @internal
3107
- * @overridable
3108
- */
3109
- updateComponent: 'OVERRIDE_BASE'
1728
+ // Use non-numeric keys to prevent V8 performance issues:
1729
+ // https://github.com/facebook/react/pull/7232
1730
+ var getKeyFromID = function (id) {
1731
+ return '.' + id;
1732
+ };
1733
+ var getIDFromKey = function (key) {
1734
+ return parseInt(key.substr(1), 10);
1735
+ };
3110
1736
 
1737
+ setItem = function (id, item) {
1738
+ var key = getKeyFromID(id);
1739
+ itemByKey[key] = item;
1740
+ };
1741
+ getItem = function (id) {
1742
+ var key = getKeyFromID(id);
1743
+ return itemByKey[key];
1744
+ };
1745
+ removeItem = function (id) {
1746
+ var key = getKeyFromID(id);
1747
+ delete itemByKey[key];
1748
+ };
1749
+ getItemIDs = function () {
1750
+ return Object.keys(itemByKey).map(getIDFromKey);
3111
1751
  };
3112
1752
 
3113
- /**
3114
- * Mapping from class specification keys to special processing functions.
3115
- *
3116
- * Although these are declared like instance properties in the specification
3117
- * when defining classes using `React.createClass`, they are actually static
3118
- * and are accessible on the constructor instead of the prototype. Despite
3119
- * being static, they must be defined outside of the "statics" key under
3120
- * which all other static methods are defined.
3121
- */
3122
- var RESERVED_SPEC_KEYS = {
3123
- displayName: function (Constructor, displayName) {
3124
- Constructor.displayName = displayName;
3125
- },
3126
- mixins: function (Constructor, mixins) {
3127
- if (mixins) {
3128
- for (var i = 0; i < mixins.length; i++) {
3129
- mixSpecIntoComponent(Constructor, mixins[i]);
3130
- }
3131
- }
3132
- },
3133
- childContextTypes: function (Constructor, childContextTypes) {
3134
- {
3135
- validateTypeDef(Constructor, childContextTypes, 'childContext');
3136
- }
3137
- Constructor.childContextTypes = index({}, Constructor.childContextTypes, childContextTypes);
3138
- },
3139
- contextTypes: function (Constructor, contextTypes) {
3140
- {
3141
- validateTypeDef(Constructor, contextTypes, 'context');
3142
- }
3143
- Constructor.contextTypes = index({}, Constructor.contextTypes, contextTypes);
3144
- },
3145
- /**
3146
- * Special case getDefaultProps which should move into statics but requires
3147
- * automatic merging.
3148
- */
3149
- getDefaultProps: function (Constructor, getDefaultProps) {
3150
- if (Constructor.getDefaultProps) {
3151
- Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
3152
- } else {
3153
- Constructor.getDefaultProps = getDefaultProps;
3154
- }
3155
- },
3156
- propTypes: function (Constructor, propTypes) {
3157
- {
3158
- validateTypeDef(Constructor, propTypes, 'prop');
3159
- }
3160
- Constructor.propTypes = index({}, Constructor.propTypes, propTypes);
3161
- },
3162
- statics: function (Constructor, statics) {
3163
- mixStaticSpecIntoComponent(Constructor, statics);
3164
- },
3165
- autobind: function () {} };
3166
-
3167
- function validateTypeDef(Constructor, typeDef, location) {
3168
- for (var propName in typeDef) {
3169
- if (typeDef.hasOwnProperty(propName)) {
3170
- // use a warning instead of an _invariant so components
3171
- // don't show up in prod but only in true
3172
- warning$4(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName);
3173
- }
3174
- }
3175
- }
1753
+ addRoot = function (id) {
1754
+ var key = getKeyFromID(id);
1755
+ rootByKey[key] = true;
1756
+ };
1757
+ removeRoot = function (id) {
1758
+ var key = getKeyFromID(id);
1759
+ delete rootByKey[key];
1760
+ };
1761
+ getRootIDs = function () {
1762
+ return Object.keys(rootByKey).map(getIDFromKey);
1763
+ };
1764
+ }
3176
1765
 
3177
- function validateMethodOverride(isAlreadyDefined, name) {
3178
- var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
1766
+ var unmountedIDs = [];
3179
1767
 
3180
- // Disallow overriding of base class methods unless explicitly allowed.
3181
- if (ReactClassMixin.hasOwnProperty(name)) {
3182
- invariant_1(specPolicy === 'OVERRIDE_BASE', 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name);
3183
- }
1768
+ function purgeDeep(id) {
1769
+ var item = getItem(id);
1770
+ if (item) {
1771
+ var childIDs = item.childIDs;
3184
1772
 
3185
- // Disallow defining methods more than once unless explicitly allowed.
3186
- if (isAlreadyDefined) {
3187
- invariant_1(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name);
3188
- }
1773
+ removeItem(id);
1774
+ childIDs.forEach(purgeDeep);
3189
1775
  }
1776
+ }
3190
1777
 
3191
- /**
3192
- * Mixin helper which handles policy validation and reserved
3193
- * specification keys when building React classes.
3194
- */
3195
- function mixSpecIntoComponent(Constructor, spec) {
3196
- if (!spec) {
3197
- {
3198
- var typeofSpec = typeof spec;
3199
- var isMixinValid = typeofSpec === 'object' && spec !== null;
3200
-
3201
- warning$4(isMixinValid, '%s: You\'re attempting to include a mixin that is either null ' + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec);
3202
- }
3203
-
3204
- return;
3205
- }
3206
-
3207
- invariant_1(typeof spec !== 'function', 'ReactClass: You\'re attempting to ' + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.');
3208
- invariant_1(!isValidElement(spec), 'ReactClass: You\'re attempting to ' + 'use a component as a mixin. Instead, just use a regular object.');
3209
-
3210
- var proto = Constructor.prototype;
3211
- var autoBindPairs = proto.__reactAutoBindPairs;
3212
-
3213
- // By handling mixins before any other properties, we ensure the same
3214
- // chaining order is applied to methods with DEFINE_MANY policy, whether
3215
- // mixins are listed before or after these methods in the spec.
3216
- if (spec.hasOwnProperty(MIXINS_KEY)) {
3217
- RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
3218
- }
3219
-
3220
- for (var name in spec) {
3221
- if (!spec.hasOwnProperty(name)) {
3222
- continue;
3223
- }
3224
-
3225
- if (name === MIXINS_KEY) {
3226
- // We have already handled mixins in a special case above.
3227
- continue;
3228
- }
3229
-
3230
- var property = spec[name];
3231
- var isAlreadyDefined = proto.hasOwnProperty(name);
3232
- validateMethodOverride(isAlreadyDefined, name);
3233
-
3234
- if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
3235
- RESERVED_SPEC_KEYS[name](Constructor, property);
3236
- } else {
3237
- // Setup methods on prototype:
3238
- // The following member methods should not be automatically bound:
3239
- // 1. Expected ReactClass methods (in the "interface").
3240
- // 2. Overridden methods (that were mixed in).
3241
- var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
3242
- var isFunction = typeof property === 'function';
3243
- var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
3244
-
3245
- if (shouldAutoBind) {
3246
- autoBindPairs.push(name, property);
3247
- proto[name] = property;
3248
- } else {
3249
- if (isAlreadyDefined) {
3250
- var specPolicy = ReactClassInterface[name];
3251
-
3252
- // These cases should already be caught by validateMethodOverride.
3253
- invariant_1(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY'), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name);
3254
-
3255
- // For methods which are defined more than once, call the existing
3256
- // methods before calling the new property, merging if appropriate.
3257
- if (specPolicy === 'DEFINE_MANY_MERGED') {
3258
- proto[name] = createMergedResultFunction(proto[name], property);
3259
- } else if (specPolicy === 'DEFINE_MANY') {
3260
- proto[name] = createChainedFunction(proto[name], property);
3261
- }
3262
- } else {
3263
- proto[name] = property;
3264
- {
3265
- // Add verbose displayName to the function, which helps when looking
3266
- // at profiling tools.
3267
- if (typeof property === 'function' && spec.displayName) {
3268
- proto[name].displayName = spec.displayName + '_' + name;
3269
- }
3270
- }
3271
- }
3272
- }
3273
- }
3274
- }
1778
+ function getDisplayName$1(element) {
1779
+ if (element == null) {
1780
+ return '#empty';
1781
+ } else if (typeof element === 'string' || typeof element === 'number') {
1782
+ return '#text';
1783
+ } else if (typeof element.type === 'string') {
1784
+ return element.type;
1785
+ } else {
1786
+ return element.type.displayName || element.type.name || 'Unknown';
3275
1787
  }
1788
+ }
3276
1789
 
3277
- function mixStaticSpecIntoComponent(Constructor, statics) {
3278
- if (!statics) {
3279
- return;
3280
- }
3281
- for (var name in statics) {
3282
- var property = statics[name];
3283
- if (!statics.hasOwnProperty(name)) {
3284
- continue;
3285
- }
3286
-
3287
- var isReserved = name in RESERVED_SPEC_KEYS;
3288
- invariant_1(!isReserved, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name);
1790
+ function describeID(id) {
1791
+ var name = ReactComponentTreeHook.getDisplayName(id);
1792
+ var element = ReactComponentTreeHook.getElement(id);
1793
+ var ownerID = ReactComponentTreeHook.getOwnerID(id);
1794
+ var ownerName = void 0;
3289
1795
 
3290
- var isInherited = name in Constructor;
3291
- invariant_1(!isInherited, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name);
3292
- Constructor[name] = property;
3293
- }
1796
+ if (ownerID) {
1797
+ ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
3294
1798
  }
1799
+ warning$6(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id);
1800
+ return describeComponentFrame$1(name || '', element && element._source, ownerName || '');
1801
+ }
3295
1802
 
3296
- /**
3297
- * Merge two objects, but throw if both contain the same key.
3298
- *
3299
- * @param {object} one The first object, which is mutated.
3300
- * @param {object} two The second object
3301
- * @return {object} one after it has been mutated to contain everything in two.
3302
- */
3303
- function mergeIntoWithNoDuplicateKeys(one, two) {
3304
- invariant_1(one && two && typeof one === 'object' && typeof two === 'object', 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.');
1803
+ var ReactComponentTreeHook = {
1804
+ onSetChildren: function (id, nextChildIDs) {
1805
+ var item = getItem(id);
1806
+ !item ? invariant_1(false, 'Item must have been set') : void 0;
1807
+ item.childIDs = nextChildIDs;
3305
1808
 
3306
- for (var key in two) {
3307
- if (two.hasOwnProperty(key)) {
3308
- invariant_1(one[key] === undefined, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key);
3309
- one[key] = two[key];
1809
+ for (var i = 0; i < nextChildIDs.length; i++) {
1810
+ var nextChildID = nextChildIDs[i];
1811
+ var nextChild = getItem(nextChildID);
1812
+ !nextChild ? invariant_1(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : void 0;
1813
+ !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? invariant_1(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : void 0;
1814
+ !nextChild.isMounted ? invariant_1(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : void 0;
1815
+ if (nextChild.parentID == null) {
1816
+ nextChild.parentID = id;
1817
+ // TODO: This shouldn't be necessary but mounting a new root during in
1818
+ // componentWillMount currently causes not-yet-mounted components to
1819
+ // be purged from our tree data so their parent id is missing.
3310
1820
  }
1821
+ !(nextChild.parentID === id) ? invariant_1(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : void 0;
3311
1822
  }
3312
- return one;
3313
- }
3314
-
3315
- /**
3316
- * Creates a function that invokes two functions and merges their return values.
3317
- *
3318
- * @param {function} one Function to invoke first.
3319
- * @param {function} two Function to invoke second.
3320
- * @return {function} Function that invokes the two argument functions.
3321
- * @private
3322
- */
3323
- function createMergedResultFunction(one, two) {
3324
- return function mergedResult() {
3325
- var a = one.apply(this, arguments);
3326
- var b = two.apply(this, arguments);
3327
- if (a == null) {
3328
- return b;
3329
- } else if (b == null) {
3330
- return a;
3331
- }
3332
- var c = {};
3333
- mergeIntoWithNoDuplicateKeys(c, a);
3334
- mergeIntoWithNoDuplicateKeys(c, b);
3335
- return c;
3336
- };
3337
- }
3338
-
3339
- /**
3340
- * Creates a function that invokes two functions and ignores their return vales.
3341
- *
3342
- * @param {function} one Function to invoke first.
3343
- * @param {function} two Function to invoke second.
3344
- * @return {function} Function that invokes the two argument functions.
3345
- * @private
3346
- */
3347
- function createChainedFunction(one, two) {
3348
- return function chainedFunction() {
3349
- one.apply(this, arguments);
3350
- two.apply(this, arguments);
1823
+ },
1824
+ onBeforeMountComponent: function (id, element, parentID) {
1825
+ var item = {
1826
+ element: element,
1827
+ parentID: parentID,
1828
+ text: null,
1829
+ childIDs: [],
1830
+ isMounted: false,
1831
+ updateCount: 0
3351
1832
  };
3352
- }
3353
-
3354
- /**
3355
- * Binds a method to the component.
3356
- *
3357
- * @param {object} component Component whose method is going to be bound.
3358
- * @param {function} method Method to be bound.
3359
- * @return {function} The bound method.
3360
- */
3361
- function bindAutoBindMethod(component, method) {
3362
- var boundMethod = method.bind(component);
3363
- {
3364
- boundMethod.__reactBoundContext = component;
3365
- boundMethod.__reactBoundMethod = method;
3366
- boundMethod.__reactBoundArguments = null;
3367
- var componentName = component.constructor.displayName;
3368
- var _bind = boundMethod.bind;
3369
- boundMethod.bind = function (newThis) {
3370
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3371
- args[_key - 1] = arguments[_key];
3372
- }
3373
-
3374
- // User is trying to bind() an autobound method; we effectively will
3375
- // ignore the value of "this" that the user is trying to use, so
3376
- // let's warn.
3377
- if (newThis !== component && newThis !== null) {
3378
- warning$4(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName);
3379
- } else if (!args.length) {
3380
- warning$4(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName);
3381
- return boundMethod;
3382
- }
3383
- var reboundMethod = _bind.apply(boundMethod, arguments);
3384
- reboundMethod.__reactBoundContext = component;
3385
- reboundMethod.__reactBoundMethod = method;
3386
- reboundMethod.__reactBoundArguments = args;
3387
- return reboundMethod;
3388
- };
1833
+ setItem(id, item);
1834
+ },
1835
+ onBeforeUpdateComponent: function (id, element) {
1836
+ var item = getItem(id);
1837
+ if (!item || !item.isMounted) {
1838
+ // We may end up here as a result of setState() in componentWillUnmount().
1839
+ // In this case, ignore the element.
1840
+ return;
3389
1841
  }
3390
- return boundMethod;
3391
- }
3392
-
3393
- /**
3394
- * Binds all auto-bound methods in a component.
3395
- *
3396
- * @param {object} component Component whose method is going to be bound.
3397
- */
3398
- function bindAutoBindMethods(component) {
3399
- var pairs = component.__reactAutoBindPairs;
3400
- for (var i = 0; i < pairs.length; i += 2) {
3401
- var autoBindKey = pairs[i];
3402
- var method = pairs[i + 1];
3403
- component[autoBindKey] = bindAutoBindMethod(component, method);
1842
+ item.element = element;
1843
+ },
1844
+ onMountComponent: function (id) {
1845
+ var item = getItem(id);
1846
+ !item ? invariant_1(false, 'Item must have been set') : void 0;
1847
+ item.isMounted = true;
1848
+ var isRoot = item.parentID === 0;
1849
+ if (isRoot) {
1850
+ addRoot(id);
3404
1851
  }
3405
- }
3406
-
3407
- var IsMountedMixin = {
3408
- componentDidMount: function () {
3409
- this.__isMounted = true;
3410
- },
3411
- componentWillUnmount: function () {
3412
- this.__isMounted = false;
1852
+ },
1853
+ onUpdateComponent: function (id) {
1854
+ var item = getItem(id);
1855
+ if (!item || !item.isMounted) {
1856
+ // We may end up here as a result of setState() in componentWillUnmount().
1857
+ // In this case, ignore the element.
1858
+ return;
3413
1859
  }
3414
- };
3415
-
3416
- /**
3417
- * Add more to the ReactClass base class. These are all legacy features and
3418
- * therefore not already part of the modern ReactComponent.
3419
- */
3420
- var ReactClassMixin = {
3421
-
3422
- /**
3423
- * TODO: This will be deprecated because state should always keep a consistent
3424
- * type signature and the only use case for this, is to avoid that.
3425
- */
3426
- replaceState: function (newState, callback) {
3427
- this.updater.enqueueReplaceState(this, newState, callback);
3428
- },
3429
-
3430
- /**
3431
- * Checks whether or not this composite component is mounted.
3432
- * @return {boolean} True if mounted, false otherwise.
3433
- * @protected
3434
- * @final
3435
- */
3436
- isMounted: function () {
3437
- {
3438
- warning$4(this.__didWarnIsMounted, '%s: isMounted is deprecated. Instead, make sure to clean up ' + 'subscriptions and pending requests in componentWillUnmount to ' + 'prevent memory leaks.', this.constructor && this.constructor.displayName || this.name || 'Component');
3439
- this.__didWarnIsMounted = true;
1860
+ item.updateCount++;
1861
+ },
1862
+ onUnmountComponent: function (id) {
1863
+ var item = getItem(id);
1864
+ if (item) {
1865
+ // We need to check if it exists.
1866
+ // `item` might not exist if it is inside an error boundary, and a sibling
1867
+ // error boundary child threw while mounting. Then this instance never
1868
+ // got a chance to mount, but it still gets an unmounting event during
1869
+ // the error boundary cleanup.
1870
+ item.isMounted = false;
1871
+ var isRoot = item.parentID === 0;
1872
+ if (isRoot) {
1873
+ removeRoot(id);
3440
1874
  }
3441
- return !!this.__isMounted;
3442
1875
  }
3443
- };
3444
-
3445
- var ReactClassComponent = function () {};
3446
- index(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin);
3447
-
3448
- /**
3449
- * Creates a composite component class given a class specification.
3450
- * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
3451
- *
3452
- * @param {object} spec Class specification (which must define `render`).
3453
- * @return {function} Component constructor function.
3454
- * @public
3455
- */
3456
- function createClass(spec) {
3457
- // To keep our warnings more understandable, we'll use a little hack here to
3458
- // ensure that Constructor.name !== 'Constructor'. This makes sure we don't
3459
- // unnecessarily identify a class without displayName as 'Constructor'.
3460
- var Constructor = identity(function (props, context, updater) {
3461
- // This constructor gets overridden by mocks. The argument is used
3462
- // by mocks to assert on what gets mounted.
3463
-
3464
- {
3465
- warning$4(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory');
3466
- }
3467
-
3468
- // Wire up auto-binding
3469
- if (this.__reactAutoBindPairs.length) {
3470
- bindAutoBindMethods(this);
3471
- }
3472
-
3473
- this.props = props;
3474
- this.context = context;
3475
- this.refs = emptyObject_1;
3476
- this.updater = updater || ReactNoopUpdateQueue;
3477
-
3478
- this.state = null;
3479
-
3480
- // ReactClasses doesn't have constructors. Instead, they use the
3481
- // getInitialState and componentWillMount methods for initialization.
3482
-
3483
- var initialState = this.getInitialState ? this.getInitialState() : null;
3484
- {
3485
- // We allow auto-mocks to proceed as if they're returning null.
3486
- if (initialState === undefined && this.getInitialState._isMockFunction) {
3487
- // This is probably bad practice. Consider warning here and
3488
- // deprecating this convenience.
3489
- initialState = null;
3490
- }
3491
- }
3492
- invariant_1(typeof initialState === 'object' && !Array.isArray(initialState), '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent');
3493
-
3494
- this.state = initialState;
3495
- });
3496
- Constructor.prototype = new ReactClassComponent();
3497
- Constructor.prototype.constructor = Constructor;
3498
- Constructor.prototype.__reactAutoBindPairs = [];
3499
-
3500
- injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));
3501
-
3502
- mixSpecIntoComponent(Constructor, IsMountedMixin);
3503
- mixSpecIntoComponent(Constructor, spec);
3504
-
3505
- // Initialize the defaultProps property after all mixins have been merged.
3506
- if (Constructor.getDefaultProps) {
3507
- Constructor.defaultProps = Constructor.getDefaultProps();
1876
+ unmountedIDs.push(id);
1877
+ },
1878
+ purgeUnmountedComponents: function () {
1879
+ if (ReactComponentTreeHook._preventPurging) {
1880
+ // Should only be used for testing.
1881
+ return;
3508
1882
  }
3509
1883
 
3510
- {
3511
- // This is a tag to indicate that the use of these method names is ok,
3512
- // since it's used with createClass. If it's not, then it's likely a
3513
- // mistake so we'll warn you to use the static property, property
3514
- // initializer or constructor respectively.
3515
- if (Constructor.getDefaultProps) {
3516
- Constructor.getDefaultProps.isReactClassApproved = {};
3517
- }
3518
- if (Constructor.prototype.getInitialState) {
3519
- Constructor.prototype.getInitialState.isReactClassApproved = {};
1884
+ for (var i = 0; i < unmountedIDs.length; i++) {
1885
+ var id = unmountedIDs[i];
1886
+ purgeDeep(id);
1887
+ }
1888
+ unmountedIDs.length = 0;
1889
+ },
1890
+ isMounted: function (id) {
1891
+ var item = getItem(id);
1892
+ return item ? item.isMounted : false;
1893
+ },
1894
+ getCurrentStackAddendum: function () {
1895
+ var info = '';
1896
+ var currentOwner = ReactCurrentOwner_1.current;
1897
+ if (currentOwner) {
1898
+ invariant_1(typeof currentOwner.tag !== 'number', 'Fiber owners should not show up in Stack stack traces.');
1899
+ if (typeof currentOwner._debugID === 'number') {
1900
+ info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
3520
1901
  }
3521
1902
  }
3522
-
3523
- invariant_1(Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.');
3524
-
3525
- {
3526
- warning$4(!Constructor.prototype.componentShouldUpdate, '%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.', spec.displayName || 'A component');
3527
- warning$4(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component');
1903
+ return info;
1904
+ },
1905
+ getStackAddendumByID: function (id) {
1906
+ var info = '';
1907
+ while (id) {
1908
+ info += describeID(id);
1909
+ id = ReactComponentTreeHook.getParentID(id);
3528
1910
  }
3529
-
3530
- // Reduce time spent doing lookups by setting these on the prototype.
3531
- for (var methodName in ReactClassInterface) {
3532
- if (!Constructor.prototype[methodName]) {
3533
- Constructor.prototype[methodName] = null;
3534
- }
1911
+ return info;
1912
+ },
1913
+ getChildIDs: function (id) {
1914
+ var item = getItem(id);
1915
+ return item ? item.childIDs : [];
1916
+ },
1917
+ getDisplayName: function (id) {
1918
+ var element = ReactComponentTreeHook.getElement(id);
1919
+ if (!element) {
1920
+ return null;
3535
1921
  }
3536
-
3537
- return Constructor;
3538
- }
3539
-
3540
- return createClass;
3541
- }
3542
-
3543
- var factory_1 = factory;
3544
-
3545
- var Component = ReactBaseClasses.Component;
3546
-
3547
- var isValidElement = ReactElement_1.isValidElement;
3548
-
1922
+ return getDisplayName$1(element);
1923
+ },
1924
+ getElement: function (id) {
1925
+ var item = getItem(id);
1926
+ return item ? item.element : null;
1927
+ },
1928
+ getOwnerID: function (id) {
1929
+ var element = ReactComponentTreeHook.getElement(id);
1930
+ if (!element || !element._owner) {
1931
+ return null;
1932
+ }
1933
+ return element._owner._debugID;
1934
+ },
1935
+ getParentID: function (id) {
1936
+ var item = getItem(id);
1937
+ return item ? item.parentID : null;
1938
+ },
1939
+ getSource: function (id) {
1940
+ var item = getItem(id);
1941
+ var element = item ? item.element : null;
1942
+ var source = element != null ? element._source : null;
1943
+ return source;
1944
+ },
1945
+ getText: function (id) {
1946
+ var element = ReactComponentTreeHook.getElement(id);
1947
+ if (typeof element === 'string') {
1948
+ return element;
1949
+ } else if (typeof element === 'number') {
1950
+ return '' + element;
1951
+ } else {
1952
+ return null;
1953
+ }
1954
+ },
1955
+ getUpdateCount: function (id) {
1956
+ var item = getItem(id);
1957
+ return item ? item.updateCount : 0;
1958
+ },
3549
1959
 
3550
1960
 
1961
+ getRootIDs: getRootIDs,
1962
+ getRegisteredIDs: getItemIDs
1963
+ };
3551
1964
 
3552
- var createClass = factory_1(Component, isValidElement, ReactNoopUpdateQueue_1);
1965
+ var ReactComponentTreeHook_1 = ReactComponentTreeHook;
3553
1966
 
3554
1967
  var createElement = ReactElement_1.createElement;
3555
1968
  var createFactory = ReactElement_1.createFactory;
3556
1969
  var cloneElement = ReactElement_1.cloneElement;
3557
1970
 
3558
1971
  {
3559
- var warning = warning_1;
3560
- var canDefineProperty = canDefineProperty_1;
3561
1972
  var ReactElementValidator = ReactElementValidator_1;
3562
1973
  createElement = ReactElementValidator.createElement;
3563
1974
  createFactory = ReactElementValidator.createFactory;
3564
1975
  cloneElement = ReactElementValidator.cloneElement;
3565
1976
  }
3566
1977
 
3567
- var createMixin = function (mixin) {
3568
- return mixin;
3569
- };
3570
-
3571
1978
  var React = {
3572
- // Modern
3573
-
3574
1979
  Children: {
3575
1980
  map: ReactChildren_1.map,
3576
1981
  forEach: ReactChildren_1.forEach,
@@ -3581,24 +1986,13 @@ var React = {
3581
1986
 
3582
1987
  Component: ReactBaseClasses.Component,
3583
1988
  PureComponent: ReactBaseClasses.PureComponent,
1989
+ unstable_AsyncComponent: ReactBaseClasses.AsyncComponent,
3584
1990
 
3585
1991
  createElement: createElement,
3586
1992
  cloneElement: cloneElement,
3587
1993
  isValidElement: ReactElement_1.isValidElement,
3588
1994
 
3589
- // TODO (bvaughn) Remove these getters before 16.0.0
3590
- PropTypes: ReactPropTypes,
3591
- checkPropTypes: checkPropTypes_1,
3592
- createClass: createClass,
3593
-
3594
- // Classic
3595
-
3596
1995
  createFactory: createFactory,
3597
- createMixin: createMixin,
3598
-
3599
- // This looks DOM specific but these are actually isomorphic helpers
3600
- // since they are just generating DOM strings.
3601
- DOM: ReactDOMFactories_1,
3602
1996
 
3603
1997
  version: ReactVersion,
3604
1998
 
@@ -3613,63 +2007,10 @@ var React = {
3613
2007
  ReactComponentTreeHook: ReactComponentTreeHook_1,
3614
2008
  ReactDebugCurrentFrame: ReactDebugCurrentFrame_1
3615
2009
  });
3616
-
3617
- var warnedForCheckPropTypes = false;
3618
- var warnedForCreateMixin = false;
3619
- var warnedForCreateClass = false;
3620
- var warnedForPropTypes = false;
3621
-
3622
- React.createMixin = function (mixin) {
3623
- warning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. You ' + 'can use this mixin directly instead.');
3624
- warnedForCreateMixin = true;
3625
- return mixin;
3626
- };
3627
-
3628
- // TODO (bvaughn) Remove all of these accessors before 16.0.0
3629
- if (canDefineProperty) {
3630
- Object.defineProperty(React, 'checkPropTypes', {
3631
- get: function () {
3632
- warning(warnedForCheckPropTypes, 'checkPropTypes has been moved to a separate package. ' + 'Accessing React.checkPropTypes is no longer supported ' + 'and will be removed completely in React 16. ' + 'Use the prop-types package on npm instead. ' + '(https://fb.me/migrating-from-react-proptypes)');
3633
- warnedForCheckPropTypes = true;
3634
- return checkPropTypes_1;
3635
- }
3636
- });
3637
-
3638
- Object.defineProperty(React, 'createClass', {
3639
- get: function () {
3640
- warning(warnedForCreateClass, 'React.createClass is no longer supported. Use a plain JavaScript ' + "class instead. If you're not yet ready to migrate, " + 'create-react-class is available on npm as a drop-in replacement. ' + '(https://fb.me/migrating-from-react-create-class)');
3641
- warnedForCreateClass = true;
3642
- return createClass;
3643
- }
3644
- });
3645
-
3646
- Object.defineProperty(React, 'PropTypes', {
3647
- get: function () {
3648
- warning(warnedForPropTypes, 'PropTypes has been moved to a separate package. ' + 'Accessing React.PropTypes is no longer supported ' + 'and will be removed completely in React 16. ' + 'Use the prop-types package on npm instead. ' + '(https://fb.me/migrating-from-react-proptypes)');
3649
- warnedForPropTypes = true;
3650
- return ReactPropTypes;
3651
- }
3652
- });
3653
- }
3654
-
3655
- // React.DOM factories are deprecated. Wrap these methods so that
3656
- // invocations of the React.DOM namespace and alert users to switch
3657
- // to the `react-addons-dom-factories` package.
3658
- React.DOM = {};
3659
- var warnedForFactories = false;
3660
- Object.keys(ReactDOMFactories_1).forEach(function (factory) {
3661
- React.DOM[factory] = function () {
3662
- if (!warnedForFactories) {
3663
- warning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in the future. Use the ' + 'react-addons-dom-factories package instead.', factory);
3664
- warnedForFactories = true;
3665
- }
3666
- return ReactDOMFactories_1[factory].apply(ReactDOMFactories_1, arguments);
3667
- };
3668
- });
3669
2010
  }
3670
2011
 
3671
- var React_1 = React;
2012
+ var ReactEntry = React;
3672
2013
 
3673
- return React_1;
2014
+ return ReactEntry;
3674
2015
 
3675
2016
  })));