react 16.0.0-alpha.9 → 16.0.0-alpha.10

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 e&&"object"==typeof 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/factory"),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)},V=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)},I=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:V,fourArgumentPooler:I},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.isValidElement,me=x(ye),be="16.0.0-alpha.9",ve=w,ge=q,Pe=$.Component,ke=X.isValidElement,_e=C(Pe,ke,T),Ee=X.createElement,we=X.createFactory,Se=X.cloneElement,Ae=function(e){return e},je={Children:{map:pe.map,forEach:pe.forEach,count:pe.count,toArray:pe.toArray,only:ve},Component:$.Component,PureComponent:$.PureComponent,createElement:Ee,cloneElement:Se,isValidElement:X.isValidElement,PropTypes:me,checkPropTypes:ge,createClass:_e,createFactory:we,createMixin:Ae,DOM:he,version:be,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:W}},xe=je;module.exports=xe;
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 e&&"object"==typeof 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/factory"),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)},V=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)},I=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:V,fourArgumentPooler:I},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.isValidElement,me=x(ye),be="16.0.0-alpha.10",ve=w,ge=$.Component,Pe=X.isValidElement,ke=C(ge,Pe,T),_e=X.createElement,Ee=X.createFactory,we=X.cloneElement,Se=function(e){return e},Ae={Children:{map:pe.map,forEach:pe.forEach,count:pe.count,toArray:pe.toArray,only:ve},Component:$.Component,PureComponent:$.PureComponent,createElement:_e,cloneElement:we,isValidElement:X.isValidElement,PropTypes:me,checkPropTypes:q,createClass:ke,createFactory:Ee,createMixin:Se,DOM:he,version:be,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:W}},je=Ae;module.exports=je;
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.9",
4
+ "version": "16.0.0-alpha.10",
5
5
  "keywords": [
6
6
  "react"
7
7
  ],
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react.development.js v16.0.0-alpha.9
2
+ * react.development.js v16.0.0-alpha.10
3
3
  */
4
4
 
5
5
  (function (global, factory) {
@@ -1053,827 +1053,822 @@ var KeyEscapeUtils = {
1053
1053
 
1054
1054
  var KeyEscapeUtils_1 = KeyEscapeUtils;
1055
1055
 
1056
- var SEPARATOR = '.';
1057
- var SUBSEPARATOR = ':';
1058
-
1059
1056
  /**
1060
- * This is inlined from ReactElement since this file is shared between
1061
- * isomorphic and renderers. We could extract this to a
1057
+ * Copyright 2013-present, Facebook, Inc.
1058
+ * All rights reserved.
1062
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
+ *
1063
1066
  */
1064
1067
 
1065
- /**
1066
- * TODO: Test that a single child and an array with one item have the same key
1067
- * pattern.
1068
- */
1069
-
1070
- var didWarnAboutMaps = false;
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
+ };
1071
1081
 
1072
1082
  /**
1073
- * Generate a key string that identifies a component within a set.
1083
+ * Copyright 2013-present, Facebook, Inc.
1084
+ * All rights reserved.
1074
1085
  *
1075
- * @param {*} component A component that could contain a manual key.
1076
- * @param {number} index Index that is used if a manual key is not provided.
1077
- * @return {string}
1078
- */
1079
- function getComponentKey(component, index) {
1080
- // Do some typechecking here since we call this blindly. We want to ensure
1081
- // that we don't block potential future ES APIs.
1082
- if (component && typeof component === 'object' && component.key != null) {
1083
- // Explicit key
1084
- return KeyEscapeUtils_1.escape(component.key);
1085
- }
1086
- // Implicit key determined by the index in the set
1087
- return index.toString(36);
1088
- }
1089
-
1090
- /**
1091
- * @param {?*} children Children tree container.
1092
- * @param {!string} nameSoFar Name of the key path so far.
1093
- * @param {!function} callback Callback to invoke with each child found.
1094
- * @param {?*} traverseContext Used to pass information throughout the traversal
1095
- * process.
1096
- * @return {!number} The number of children in this subtree.
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
+ *
1097
1092
  */
1098
- function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
1099
- var type = typeof children;
1100
1093
 
1101
- if (type === 'undefined' || type === 'boolean') {
1102
- // All of the above are perceived as null.
1103
- children = null;
1094
+ function getComponentName(instanceOrFiber) {
1095
+ if (typeof instanceOrFiber.getName === 'function') {
1096
+ // Stack reconciler
1097
+ var instance = instanceOrFiber;
1098
+ return instance.getName();
1104
1099
  }
1100
+ if (typeof instanceOrFiber.tag === 'number') {
1101
+ // Fiber reconciler
1102
+ var fiber = instanceOrFiber;
1103
+ var type = fiber.type;
1105
1104
 
1106
- if (children === null || type === 'string' || type === 'number' ||
1107
- // The following is inlined from ReactElement. This means we can optimize
1108
- // some checks. React Fiber also inlines this logic for similar purposes.
1109
- type === 'object' && children.$$typeof === ReactElementSymbol) {
1110
- callback(traverseContext, children,
1111
- // If it's the only child, treat the name as if it was wrapped in an array
1112
- // so that it's consistent if the number of children grows.
1113
- nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
1114
- return 1;
1105
+ if (typeof type === 'string') {
1106
+ return type;
1107
+ }
1108
+ if (typeof type === 'function') {
1109
+ return type.displayName || type.name;
1110
+ }
1115
1111
  }
1112
+ return null;
1113
+ }
1116
1114
 
1117
- var child;
1118
- var nextName;
1119
- var subtreeCount = 0; // Count of children found in the current subtree.
1120
- var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1115
+ var getComponentName_1 = getComponentName;
1121
1116
 
1122
- if (Array.isArray(children)) {
1123
- for (var i = 0; i < children.length; i++) {
1124
- child = children[i];
1125
- nextName = nextNamePrefix + getComponentKey(child, i);
1126
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
1127
- }
1128
- } else {
1129
- var iteratorFn = getIteratorFn_1(children);
1130
- if (iteratorFn) {
1131
- {
1132
- // Warn about using Maps as children
1133
- if (iteratorFn === children.entries) {
1134
- var mapsAsChildrenAddendum = '';
1135
- if (ReactCurrentOwner_1.current) {
1136
- var mapsAsChildrenOwnerName = ReactCurrentOwner_1.current.getName();
1137
- if (mapsAsChildrenOwnerName) {
1138
- mapsAsChildrenAddendum = '\n\nCheck the render method of `' + mapsAsChildrenOwnerName + '`.';
1139
- }
1140
- }
1141
- 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', mapsAsChildrenAddendum);
1142
- didWarnAboutMaps = true;
1143
- }
1144
- }
1117
+ var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent;
1118
+ var FunctionalComponent = ReactTypeOfWork.FunctionalComponent;
1119
+ var ClassComponent = ReactTypeOfWork.ClassComponent;
1120
+ var HostComponent = ReactTypeOfWork.HostComponent;
1145
1121
 
1146
- var iterator = iteratorFn.call(children);
1147
- var step;
1148
- var ii = 0;
1149
- while (!(step = iterator.next()).done) {
1150
- child = step.value;
1151
- nextName = nextNamePrefix + getComponentKey(child, ii++);
1152
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
1153
- }
1154
- } else if (type === 'object') {
1155
- var addendum = '';
1156
- {
1157
- addendum = ' If you meant to render a collection of children, use an array ' + 'instead.';
1158
- if (ReactCurrentOwner_1.current) {
1159
- var name = ReactCurrentOwner_1.current.getName();
1160
- if (name) {
1161
- addendum += '\n\nCheck the render method of `' + name + '`.';
1162
- }
1163
- }
1164
- }
1165
- var childrenString = '' + children;
1166
- 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);
1167
- }
1168
- }
1169
1122
 
1170
- return subtreeCount;
1123
+
1124
+ function describeComponentFrame$1(name, source, ownerName) {
1125
+ return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
1171
1126
  }
1172
1127
 
1173
- /**
1174
- * Traverses children that are typically specified as `props.children`, but
1175
- * might also be specified through attributes:
1176
- *
1177
- * - `traverseAllChildren(this.props.children, ...)`
1178
- * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
1179
- *
1180
- * The `traverseContext` is an optional argument that is passed through the
1181
- * entire traversal. It can be used to store accumulations or anything else that
1182
- * the callback might find relevant.
1183
- *
1184
- * @param {?*} children Children tree object.
1185
- * @param {!function} callback To invoke upon traversing each child.
1186
- * @param {?*} traverseContext Context for traversal.
1187
- * @return {!number} The number of children in this subtree.
1188
- */
1189
- function traverseAllChildren(children, callback, traverseContext) {
1190
- if (children == null) {
1191
- return 0;
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 '';
1192
1144
  }
1145
+ }
1193
1146
 
1194
- return traverseAllChildrenImpl(children, '', callback, traverseContext);
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;
1195
1159
  }
1196
1160
 
1197
- var traverseAllChildren_1 = traverseAllChildren;
1161
+ var ReactFiberComponentTreeHook = {
1162
+ getStackAddendumByWorkInProgressFiber: getStackAddendumByWorkInProgressFiber$1,
1163
+ describeComponentFrame: describeComponentFrame$1
1164
+ };
1198
1165
 
1199
- var twoArgumentPooler = PooledClass_1.twoArgumentPooler;
1200
- var fourArgumentPooler = PooledClass_1.fourArgumentPooler;
1166
+ var getStackAddendumByWorkInProgressFiber = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber;
1167
+ var describeComponentFrame = ReactFiberComponentTreeHook.describeComponentFrame;
1201
1168
 
1202
- var userProvidedKeyEscapeRegex = /\/+/g;
1203
- function escapeUserProvidedKey(text) {
1204
- return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
1205
- }
1206
1169
 
1207
- /**
1208
- * PooledClass representing the bookkeeping associated with performing a child
1209
- * traversal. Allows avoiding binding callbacks.
1210
- *
1211
- * @constructor ForEachBookKeeping
1212
- * @param {!function} forEachFunction Function to perform traversal with.
1213
- * @param {?*} forEachContext Context to perform context with.
1214
- */
1215
- function ForEachBookKeeping(forEachFunction, forEachContext) {
1216
- this.func = forEachFunction;
1217
- this.context = forEachContext;
1218
- this.count = 0;
1219
- }
1220
- ForEachBookKeeping.prototype.destructor = function () {
1221
- this.func = null;
1222
- this.context = null;
1223
- this.count = 0;
1224
- };
1225
- PooledClass_1.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
1226
1170
 
1227
- function forEachSingleChild(bookKeeping, child, name) {
1228
- var func = bookKeeping.func,
1229
- context = bookKeeping.context;
1230
1171
 
1231
- func.call(context, child, bookKeeping.count++);
1232
- }
1233
1172
 
1234
- /**
1235
- * Iterates through children that are typically specified as `props.children`.
1236
- *
1237
- * See https://facebook.github.io/react/docs/react-api.html#react.children.foreach
1238
- *
1239
- * The provided forEachFunc(child, index) will be called for each
1240
- * leaf child.
1241
- *
1242
- * @param {?*} children Children tree container.
1243
- * @param {function(*, int)} forEachFunc
1244
- * @param {*} forEachContext Context for forEachContext.
1245
- */
1246
- function forEachChildren(children, forEachFunc, forEachContext) {
1247
- if (children == null) {
1248
- return children;
1173
+ function isNative(fn) {
1174
+ // Based on isNative() from Lodash
1175
+ var funcToString = Function.prototype.toString;
1176
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1177
+ var reIsNative = RegExp('^' + funcToString
1178
+ // Take an example native function source for comparison
1179
+ .call(hasOwnProperty)
1180
+ // Strip regex characters so we can use it for regex
1181
+ .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
1182
+ // Remove hasOwnProperty from the template to make it generic
1183
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
1184
+ try {
1185
+ var source = funcToString.call(fn);
1186
+ return reIsNative.test(source);
1187
+ } catch (err) {
1188
+ return false;
1249
1189
  }
1250
- var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
1251
- traverseAllChildren_1(children, forEachSingleChild, traverseContext);
1252
- ForEachBookKeeping.release(traverseContext);
1253
1190
  }
1254
1191
 
1255
- /**
1256
- * PooledClass representing the bookkeeping associated with performing a child
1257
- * mapping. Allows avoiding binding callbacks.
1258
- *
1259
- * @constructor MapBookKeeping
1260
- * @param {!*} mapResult Object containing the ordered map of results.
1261
- * @param {!function} mapFunction Function to perform mapping with.
1262
- * @param {?*} mapContext Context to perform mapping with.
1263
- */
1264
- function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
1265
- this.result = mapResult;
1266
- this.keyPrefix = keyPrefix;
1267
- this.func = mapFunction;
1268
- this.context = mapContext;
1269
- this.count = 0;
1192
+ var canUseCollections =
1193
+ // Array.from
1194
+ typeof Array.from === 'function' &&
1195
+ // Map
1196
+ typeof Map === 'function' && isNative(Map) &&
1197
+ // Map.prototype.keys
1198
+ Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
1199
+ // Set
1200
+ typeof Set === 'function' && isNative(Set) &&
1201
+ // Set.prototype.keys
1202
+ Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
1203
+
1204
+ var setItem;
1205
+ var getItem;
1206
+ var removeItem;
1207
+ var getItemIDs;
1208
+ var addRoot;
1209
+ var removeRoot;
1210
+ var getRootIDs;
1211
+
1212
+ if (canUseCollections) {
1213
+ var itemMap = new Map();
1214
+ var rootIDSet = new Set();
1215
+
1216
+ setItem = function (id, item) {
1217
+ itemMap.set(id, item);
1218
+ };
1219
+ getItem = function (id) {
1220
+ return itemMap.get(id);
1221
+ };
1222
+ removeItem = function (id) {
1223
+ itemMap['delete'](id);
1224
+ };
1225
+ getItemIDs = function () {
1226
+ return Array.from(itemMap.keys());
1227
+ };
1228
+
1229
+ addRoot = function (id) {
1230
+ rootIDSet.add(id);
1231
+ };
1232
+ removeRoot = function (id) {
1233
+ rootIDSet['delete'](id);
1234
+ };
1235
+ getRootIDs = function () {
1236
+ return Array.from(rootIDSet.keys());
1237
+ };
1238
+ } else {
1239
+ var itemByKey = {};
1240
+ var rootByKey = {};
1241
+
1242
+ // Use non-numeric keys to prevent V8 performance issues:
1243
+ // https://github.com/facebook/react/pull/7232
1244
+ var getKeyFromID = function (id) {
1245
+ return '.' + id;
1246
+ };
1247
+ var getIDFromKey = function (key) {
1248
+ return parseInt(key.substr(1), 10);
1249
+ };
1250
+
1251
+ setItem = function (id, item) {
1252
+ var key = getKeyFromID(id);
1253
+ itemByKey[key] = item;
1254
+ };
1255
+ getItem = function (id) {
1256
+ var key = getKeyFromID(id);
1257
+ return itemByKey[key];
1258
+ };
1259
+ removeItem = function (id) {
1260
+ var key = getKeyFromID(id);
1261
+ delete itemByKey[key];
1262
+ };
1263
+ getItemIDs = function () {
1264
+ return Object.keys(itemByKey).map(getIDFromKey);
1265
+ };
1266
+
1267
+ addRoot = function (id) {
1268
+ var key = getKeyFromID(id);
1269
+ rootByKey[key] = true;
1270
+ };
1271
+ removeRoot = function (id) {
1272
+ var key = getKeyFromID(id);
1273
+ delete rootByKey[key];
1274
+ };
1275
+ getRootIDs = function () {
1276
+ return Object.keys(rootByKey).map(getIDFromKey);
1277
+ };
1270
1278
  }
1271
- MapBookKeeping.prototype.destructor = function () {
1272
- this.result = null;
1273
- this.keyPrefix = null;
1274
- this.func = null;
1275
- this.context = null;
1276
- this.count = 0;
1277
- };
1278
- PooledClass_1.addPoolingTo(MapBookKeeping, fourArgumentPooler);
1279
1279
 
1280
- function mapSingleChildIntoContext(bookKeeping, child, childKey) {
1281
- var result = bookKeeping.result,
1282
- keyPrefix = bookKeeping.keyPrefix,
1283
- func = bookKeeping.func,
1284
- context = bookKeeping.context;
1280
+ var unmountedIDs = [];
1285
1281
 
1282
+ function purgeDeep(id) {
1283
+ var item = getItem(id);
1284
+ if (item) {
1285
+ var childIDs = item.childIDs;
1286
1286
 
1287
- var mappedChild = func.call(context, child, bookKeeping.count++);
1288
- if (Array.isArray(mappedChild)) {
1289
- mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction_1.thatReturnsArgument);
1290
- } else if (mappedChild != null) {
1291
- if (ReactElement_1.isValidElement(mappedChild)) {
1292
- mappedChild = ReactElement_1.cloneAndReplaceKey(mappedChild,
1293
- // Keep both the (mapped) and old keys if they differ, just as
1294
- // traverseAllChildren used to do for objects as children
1295
- keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
1296
- }
1297
- result.push(mappedChild);
1287
+ removeItem(id);
1288
+ childIDs.forEach(purgeDeep);
1298
1289
  }
1299
1290
  }
1300
1291
 
1301
- function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
1302
- var escapedPrefix = '';
1303
- if (prefix != null) {
1304
- escapedPrefix = escapeUserProvidedKey(prefix) + '/';
1292
+ function getDisplayName(element) {
1293
+ if (element == null) {
1294
+ return '#empty';
1295
+ } else if (typeof element === 'string' || typeof element === 'number') {
1296
+ return '#text';
1297
+ } else if (typeof element.type === 'string') {
1298
+ return element.type;
1299
+ } else {
1300
+ return element.type.displayName || element.type.name || 'Unknown';
1305
1301
  }
1306
- var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
1307
- traverseAllChildren_1(children, mapSingleChildIntoContext, traverseContext);
1308
- MapBookKeeping.release(traverseContext);
1309
1302
  }
1310
1303
 
1311
- /**
1312
- * Maps children that are typically specified as `props.children`.
1313
- *
1314
- * See https://facebook.github.io/react/docs/react-api.html#react.children.map
1315
- *
1316
- * The provided mapFunction(child, key, index) will be called for each
1317
- * leaf child.
1318
- *
1319
- * @param {?*} children Children tree container.
1320
- * @param {function(*, int)} func The map function.
1321
- * @param {*} context Context for mapFunction.
1322
- * @return {object} Object containing the ordered map of results.
1323
- */
1324
- function mapChildren(children, func, context) {
1325
- if (children == null) {
1326
- return children;
1304
+ function describeID(id) {
1305
+ var name = ReactComponentTreeHook.getDisplayName(id);
1306
+ var element = ReactComponentTreeHook.getElement(id);
1307
+ var ownerID = ReactComponentTreeHook.getOwnerID(id);
1308
+ var ownerName = void 0;
1309
+
1310
+ if (ownerID) {
1311
+ ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
1327
1312
  }
1328
- var result = [];
1329
- mapIntoWithKeyPrefixInternal(children, result, null, func, context);
1330
- return result;
1313
+ warning_1(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id);
1314
+ return describeComponentFrame(name || '', element && element._source, ownerName || '');
1331
1315
  }
1332
1316
 
1333
- function forEachSingleChildDummy(traverseContext, child, name) {
1334
- return null;
1317
+ var ReactComponentTreeHook = {
1318
+ onSetChildren: function (id, nextChildIDs) {
1319
+ var item = getItem(id);
1320
+ invariant_1(item, 'Item must have been set');
1321
+ item.childIDs = nextChildIDs;
1322
+
1323
+ for (var i = 0; i < nextChildIDs.length; i++) {
1324
+ var nextChildID = nextChildIDs[i];
1325
+ var nextChild = getItem(nextChildID);
1326
+ !nextChild ? invariant_1(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : void 0;
1327
+ !(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;
1328
+ !nextChild.isMounted ? invariant_1(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : void 0;
1329
+ if (nextChild.parentID == null) {
1330
+ nextChild.parentID = id;
1331
+ // TODO: This shouldn't be necessary but mounting a new root during in
1332
+ // componentWillMount currently causes not-yet-mounted components to
1333
+ // be purged from our tree data so their parent id is missing.
1334
+ }
1335
+ !(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;
1336
+ }
1337
+ },
1338
+ onBeforeMountComponent: function (id, element, parentID) {
1339
+ var item = {
1340
+ element: element,
1341
+ parentID: parentID,
1342
+ text: null,
1343
+ childIDs: [],
1344
+ isMounted: false,
1345
+ updateCount: 0
1346
+ };
1347
+ setItem(id, item);
1348
+ },
1349
+ onBeforeUpdateComponent: function (id, element) {
1350
+ var item = getItem(id);
1351
+ if (!item || !item.isMounted) {
1352
+ // We may end up here as a result of setState() in componentWillUnmount().
1353
+ // In this case, ignore the element.
1354
+ return;
1355
+ }
1356
+ item.element = element;
1357
+ },
1358
+ onMountComponent: function (id) {
1359
+ var item = getItem(id);
1360
+ invariant_1(item, 'Item must have been set');
1361
+ item.isMounted = true;
1362
+ var isRoot = item.parentID === 0;
1363
+ if (isRoot) {
1364
+ addRoot(id);
1365
+ }
1366
+ },
1367
+ onUpdateComponent: function (id) {
1368
+ var item = getItem(id);
1369
+ if (!item || !item.isMounted) {
1370
+ // We may end up here as a result of setState() in componentWillUnmount().
1371
+ // In this case, ignore the element.
1372
+ return;
1373
+ }
1374
+ item.updateCount++;
1375
+ },
1376
+ onUnmountComponent: function (id) {
1377
+ var item = getItem(id);
1378
+ if (item) {
1379
+ // We need to check if it exists.
1380
+ // `item` might not exist if it is inside an error boundary, and a sibling
1381
+ // error boundary child threw while mounting. Then this instance never
1382
+ // got a chance to mount, but it still gets an unmounting event during
1383
+ // the error boundary cleanup.
1384
+ item.isMounted = false;
1385
+ var isRoot = item.parentID === 0;
1386
+ if (isRoot) {
1387
+ removeRoot(id);
1388
+ }
1389
+ }
1390
+ unmountedIDs.push(id);
1391
+ },
1392
+ purgeUnmountedComponents: function () {
1393
+ if (ReactComponentTreeHook._preventPurging) {
1394
+ // Should only be used for testing.
1395
+ return;
1396
+ }
1397
+
1398
+ for (var i = 0; i < unmountedIDs.length; i++) {
1399
+ var id = unmountedIDs[i];
1400
+ purgeDeep(id);
1401
+ }
1402
+ unmountedIDs.length = 0;
1403
+ },
1404
+ isMounted: function (id) {
1405
+ var item = getItem(id);
1406
+ return item ? item.isMounted : false;
1407
+ },
1408
+ getCurrentStackAddendum: function (topElement) {
1409
+ var info = '';
1410
+ if (topElement) {
1411
+ var name = getDisplayName(topElement);
1412
+ var owner = topElement._owner;
1413
+ info += describeComponentFrame(name, topElement._source, owner && getComponentName_1(owner));
1414
+ }
1415
+
1416
+ var currentOwner = ReactCurrentOwner_1.current;
1417
+ if (currentOwner) {
1418
+ if (typeof currentOwner.tag === 'number') {
1419
+ var workInProgress = currentOwner;
1420
+ // Safe because if current owner exists, we are reconciling,
1421
+ // and it is guaranteed to be the work-in-progress version.
1422
+ info += getStackAddendumByWorkInProgressFiber(workInProgress);
1423
+ } else if (typeof currentOwner._debugID === 'number') {
1424
+ info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
1425
+ }
1426
+ }
1427
+ return info;
1428
+ },
1429
+ getStackAddendumByID: function (id) {
1430
+ var info = '';
1431
+ while (id) {
1432
+ info += describeID(id);
1433
+ id = ReactComponentTreeHook.getParentID(id);
1434
+ }
1435
+ return info;
1436
+ },
1437
+ getChildIDs: function (id) {
1438
+ var item = getItem(id);
1439
+ return item ? item.childIDs : [];
1440
+ },
1441
+ getDisplayName: function (id) {
1442
+ var element = ReactComponentTreeHook.getElement(id);
1443
+ if (!element) {
1444
+ return null;
1445
+ }
1446
+ return getDisplayName(element);
1447
+ },
1448
+ getElement: function (id) {
1449
+ var item = getItem(id);
1450
+ return item ? item.element : null;
1451
+ },
1452
+ getOwnerID: function (id) {
1453
+ var element = ReactComponentTreeHook.getElement(id);
1454
+ if (!element || !element._owner) {
1455
+ return null;
1456
+ }
1457
+ return element._owner._debugID;
1458
+ },
1459
+ getParentID: function (id) {
1460
+ var item = getItem(id);
1461
+ return item ? item.parentID : null;
1462
+ },
1463
+ getSource: function (id) {
1464
+ var item = getItem(id);
1465
+ var element = item ? item.element : null;
1466
+ var source = element != null ? element._source : null;
1467
+ return source;
1468
+ },
1469
+ getText: function (id) {
1470
+ var element = ReactComponentTreeHook.getElement(id);
1471
+ if (typeof element === 'string') {
1472
+ return element;
1473
+ } else if (typeof element === 'number') {
1474
+ return '' + element;
1475
+ } else {
1476
+ return null;
1477
+ }
1478
+ },
1479
+ getUpdateCount: function (id) {
1480
+ var item = getItem(id);
1481
+ return item ? item.updateCount : 0;
1482
+ },
1483
+
1484
+
1485
+ getRootIDs: getRootIDs,
1486
+ getRegisteredIDs: getItemIDs
1487
+ };
1488
+
1489
+ var ReactComponentTreeHook_1 = ReactComponentTreeHook;
1490
+
1491
+ {
1492
+ var _require = ReactComponentTreeHook_1,
1493
+ getCurrentStackAddendum = _require.getCurrentStackAddendum;
1335
1494
  }
1336
1495
 
1496
+ var SEPARATOR = '.';
1497
+ var SUBSEPARATOR = ':';
1498
+
1337
1499
  /**
1338
- * Count the number of children that are typically specified as
1339
- * `props.children`.
1340
- *
1341
- * See https://facebook.github.io/react/docs/react-api.html#react.children.count
1500
+ * This is inlined from ReactElement since this file is shared between
1501
+ * isomorphic and renderers. We could extract this to a
1342
1502
  *
1343
- * @param {?*} children Children tree container.
1344
- * @return {number} The number of children.
1345
1503
  */
1346
- function countChildren(children, context) {
1347
- return traverseAllChildren_1(children, forEachSingleChildDummy, null);
1348
- }
1349
1504
 
1350
1505
  /**
1351
- * Flatten a children object (typically specified as `props.children`) and
1352
- * return an array with appropriately re-keyed children.
1353
- *
1354
- * See https://facebook.github.io/react/docs/react-api.html#react.children.toarray
1506
+ * TODO: Test that a single child and an array with one item have the same key
1507
+ * pattern.
1355
1508
  */
1356
- function toArray(children) {
1357
- var result = [];
1358
- mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction_1.thatReturnsArgument);
1359
- return result;
1360
- }
1361
-
1362
- var ReactChildren = {
1363
- forEach: forEachChildren,
1364
- map: mapChildren,
1365
- mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
1366
- count: countChildren,
1367
- toArray: toArray
1368
- };
1369
1509
 
1370
- var ReactChildren_1 = ReactChildren;
1510
+ var didWarnAboutMaps = false;
1371
1511
 
1372
1512
  /**
1373
- * Copyright 2013-present, Facebook, Inc.
1374
- * All rights reserved.
1375
- *
1376
- * This source code is licensed under the BSD-style license found in the
1377
- * LICENSE file in the root directory of this source tree. An additional grant
1378
- * of patent rights can be found in the PATENTS file in the same directory.
1513
+ * Generate a key string that identifies a component within a set.
1379
1514
  *
1380
- * @providesModule getComponentName
1381
- *
1515
+ * @param {*} component A component that could contain a manual key.
1516
+ * @param {number} index Index that is used if a manual key is not provided.
1517
+ * @return {string}
1382
1518
  */
1383
-
1384
- function getComponentName(instanceOrFiber) {
1385
- if (typeof instanceOrFiber.getName === 'function') {
1386
- // Stack reconciler
1387
- var instance = instanceOrFiber;
1388
- return instance.getName();
1389
- }
1390
- if (typeof instanceOrFiber.tag === 'number') {
1391
- // Fiber reconciler
1392
- var fiber = instanceOrFiber;
1393
- var type = fiber.type;
1394
-
1395
- if (typeof type === 'string') {
1396
- return type;
1397
- }
1398
- if (typeof type === 'function') {
1399
- return type.displayName || type.name;
1400
- }
1519
+ function getComponentKey(component, index) {
1520
+ // Do some typechecking here since we call this blindly. We want to ensure
1521
+ // that we don't block potential future ES APIs.
1522
+ if (component && typeof component === 'object' && component.key != null) {
1523
+ // Explicit key
1524
+ return KeyEscapeUtils_1.escape(component.key);
1401
1525
  }
1402
- return null;
1526
+ // Implicit key determined by the index in the set
1527
+ return index.toString(36);
1403
1528
  }
1404
1529
 
1405
- var getComponentName_1 = getComponentName;
1406
-
1407
1530
  /**
1408
- * Copyright 2013-present, Facebook, Inc.
1409
- * All rights reserved.
1410
- *
1411
- * This source code is licensed under the BSD-style license found in the
1412
- * LICENSE file in the root directory of this source tree. An additional grant
1413
- * of patent rights can be found in the PATENTS file in the same directory.
1531
+ * @param {?*} children Children tree container.
1532
+ * @param {!string} nameSoFar Name of the key path so far.
1533
+ * @param {!function} callback Callback to invoke with each child found.
1534
+ * @param {?*} traverseContext Used to pass information throughout the traversal
1535
+ * process.
1536
+ * @return {!number} The number of children in this subtree.
1414
1537
  */
1538
+ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
1539
+ var type = typeof children;
1415
1540
 
1416
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1541
+ if (type === 'undefined' || type === 'boolean') {
1542
+ // All of the above are perceived as null.
1543
+ children = null;
1544
+ }
1417
1545
 
1418
- var ReactPropTypesSecret_1 = ReactPropTypesSecret;
1546
+ if (children === null || type === 'string' || type === 'number' ||
1547
+ // The following is inlined from ReactElement. This means we can optimize
1548
+ // some checks. React Fiber also inlines this logic for similar purposes.
1549
+ type === 'object' && children.$$typeof === ReactElementSymbol) {
1550
+ callback(traverseContext, children,
1551
+ // If it's the only child, treat the name as if it was wrapped in an array
1552
+ // so that it's consistent if the number of children grows.
1553
+ nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
1554
+ return 1;
1555
+ }
1419
1556
 
1420
- var loggedTypeFailures = {};
1557
+ var child;
1558
+ var nextName;
1559
+ var subtreeCount = 0; // Count of children found in the current subtree.
1560
+ var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1421
1561
 
1422
- /**
1423
- * Assert that the values match with the type specs.
1424
- * Error messages are memorized and will only be shown once.
1425
- *
1426
- * @param {object} typeSpecs Map of name to a ReactPropType
1427
- * @param {object} values Runtime values that need to be type-checked
1428
- * @param {string} location e.g. "prop", "context", "child context"
1429
- * @param {string} componentName Name of the component for error messages.
1430
- * @param {?Function} getStack Returns the component stack.
1431
- * @private
1432
- */
1433
- function checkPropTypes$3(typeSpecs, values, location, componentName, getStack) {
1434
- {
1435
- for (var typeSpecName in typeSpecs) {
1436
- if (typeSpecs.hasOwnProperty(typeSpecName)) {
1437
- var error;
1438
- // Prop type validation may throw. In case they do, we don't want to
1439
- // fail the render phase where it didn't fail before. So we log it.
1440
- // After these have been cleaned up, we'll let them throw.
1441
- try {
1442
- // This is intentionally an invariant that gets caught. It's the same
1443
- // behavior as without this statement except with a better message.
1444
- 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);
1445
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret_1);
1446
- } catch (ex) {
1447
- error = ex;
1562
+ if (Array.isArray(children)) {
1563
+ for (var i = 0; i < children.length; i++) {
1564
+ child = children[i];
1565
+ nextName = nextNamePrefix + getComponentKey(child, i);
1566
+ subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
1567
+ }
1568
+ } else {
1569
+ var iteratorFn = getIteratorFn_1(children);
1570
+ if (iteratorFn) {
1571
+ {
1572
+ // Warn about using Maps as children
1573
+ if (iteratorFn === children.entries) {
1574
+ 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());
1575
+ didWarnAboutMaps = true;
1448
1576
  }
1449
- warning_1(!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);
1450
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1451
- // Only monitor this failure once because there tends to be a lot of the
1452
- // same error.
1453
- loggedTypeFailures[error.message] = true;
1454
-
1455
- var stack = getStack ? getStack() : '';
1577
+ }
1456
1578
 
1457
- warning_1(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
1458
- }
1579
+ var iterator = iteratorFn.call(children);
1580
+ var step;
1581
+ var ii = 0;
1582
+ while (!(step = iterator.next()).done) {
1583
+ child = step.value;
1584
+ nextName = nextNamePrefix + getComponentKey(child, ii++);
1585
+ subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
1586
+ }
1587
+ } else if (type === 'object') {
1588
+ var addendum = '';
1589
+ {
1590
+ addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentStackAddendum();
1459
1591
  }
1592
+ var childrenString = '' + children;
1593
+ 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);
1460
1594
  }
1461
1595
  }
1462
- }
1463
-
1464
- var checkPropTypes_1 = checkPropTypes$3;
1465
1596
 
1466
- var checkPropTypes$1 = checkPropTypes_1;
1597
+ return subtreeCount;
1598
+ }
1467
1599
 
1468
1600
  /**
1469
- * Copyright 2013-present, Facebook, Inc.
1470
- * All rights reserved.
1601
+ * Traverses children that are typically specified as `props.children`, but
1602
+ * might also be specified through attributes:
1471
1603
  *
1472
- * This source code is licensed under the BSD-style license found in the
1473
- * LICENSE file in the root directory of this source tree. An additional grant
1474
- * of patent rights can be found in the PATENTS file in the same directory.
1604
+ * - `traverseAllChildren(this.props.children, ...)`
1605
+ * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
1475
1606
  *
1476
- * @providesModule ReactTypeOfWork
1477
- *
1607
+ * The `traverseContext` is an optional argument that is passed through the
1608
+ * entire traversal. It can be used to store accumulations or anything else that
1609
+ * the callback might find relevant.
1610
+ *
1611
+ * @param {?*} children Children tree object.
1612
+ * @param {!function} callback To invoke upon traversing each child.
1613
+ * @param {?*} traverseContext Context for traversal.
1614
+ * @return {!number} The number of children in this subtree.
1478
1615
  */
1479
-
1480
- var ReactTypeOfWork = {
1481
- IndeterminateComponent: 0, // Before we know whether it is functional or class
1482
- FunctionalComponent: 1,
1483
- ClassComponent: 2,
1484
- HostRoot: 3, // Root of a host tree. Could be nested inside another node.
1485
- HostPortal: 4, // A subtree. Could be an entry point to a different renderer.
1486
- HostComponent: 5,
1487
- HostText: 6,
1488
- CoroutineComponent: 7,
1489
- CoroutineHandlerPhase: 8,
1490
- YieldComponent: 9,
1491
- Fragment: 10
1492
- };
1493
-
1494
- var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent;
1495
- var FunctionalComponent = ReactTypeOfWork.FunctionalComponent;
1496
- var ClassComponent = ReactTypeOfWork.ClassComponent;
1497
- var HostComponent = ReactTypeOfWork.HostComponent;
1498
-
1499
-
1500
-
1501
- function describeComponentFrame$1(name, source, ownerName) {
1502
- return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
1503
- }
1504
-
1505
- function describeFiber(fiber) {
1506
- switch (fiber.tag) {
1507
- case IndeterminateComponent:
1508
- case FunctionalComponent:
1509
- case ClassComponent:
1510
- case HostComponent:
1511
- var owner = fiber._debugOwner;
1512
- var source = fiber._debugSource;
1513
- var name = getComponentName_1(fiber);
1514
- var ownerName = null;
1515
- if (owner) {
1516
- ownerName = getComponentName_1(owner);
1517
- }
1518
- return describeComponentFrame$1(name, source, ownerName);
1519
- default:
1520
- return '';
1616
+ function traverseAllChildren(children, callback, traverseContext) {
1617
+ if (children == null) {
1618
+ return 0;
1521
1619
  }
1522
- }
1523
1620
 
1524
- // This function can only be called with a work-in-progress fiber and
1525
- // only during begin or complete phase. Do not call it under any other
1526
- // circumstances.
1527
- function getStackAddendumByWorkInProgressFiber$2(workInProgress) {
1528
- var info = '';
1529
- var node = workInProgress;
1530
- do {
1531
- info += describeFiber(node);
1532
- // Otherwise this return pointer might point to the wrong tree:
1533
- node = node['return'];
1534
- } while (node);
1535
- return info;
1621
+ return traverseAllChildrenImpl(children, '', callback, traverseContext);
1536
1622
  }
1537
1623
 
1538
- var ReactFiberComponentTreeHook = {
1539
- getStackAddendumByWorkInProgressFiber: getStackAddendumByWorkInProgressFiber$2,
1540
- describeComponentFrame: describeComponentFrame$1
1541
- };
1624
+ var traverseAllChildren_1 = traverseAllChildren;
1542
1625
 
1543
- var getStackAddendumByWorkInProgressFiber$1 = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber;
1544
- var describeComponentFrame = ReactFiberComponentTreeHook.describeComponentFrame;
1626
+ var twoArgumentPooler = PooledClass_1.twoArgumentPooler;
1627
+ var fourArgumentPooler = PooledClass_1.fourArgumentPooler;
1545
1628
 
1629
+ var userProvidedKeyEscapeRegex = /\/+/g;
1630
+ function escapeUserProvidedKey(text) {
1631
+ return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
1632
+ }
1546
1633
 
1634
+ /**
1635
+ * PooledClass representing the bookkeeping associated with performing a child
1636
+ * traversal. Allows avoiding binding callbacks.
1637
+ *
1638
+ * @constructor ForEachBookKeeping
1639
+ * @param {!function} forEachFunction Function to perform traversal with.
1640
+ * @param {?*} forEachContext Context to perform context with.
1641
+ */
1642
+ function ForEachBookKeeping(forEachFunction, forEachContext) {
1643
+ this.func = forEachFunction;
1644
+ this.context = forEachContext;
1645
+ this.count = 0;
1646
+ }
1647
+ ForEachBookKeeping.prototype.destructor = function () {
1648
+ this.func = null;
1649
+ this.context = null;
1650
+ this.count = 0;
1651
+ };
1652
+ PooledClass_1.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
1547
1653
 
1654
+ function forEachSingleChild(bookKeeping, child, name) {
1655
+ var func = bookKeeping.func,
1656
+ context = bookKeeping.context;
1548
1657
 
1658
+ func.call(context, child, bookKeeping.count++);
1659
+ }
1549
1660
 
1550
- function isNative(fn) {
1551
- // Based on isNative() from Lodash
1552
- var funcToString = Function.prototype.toString;
1553
- var hasOwnProperty = Object.prototype.hasOwnProperty;
1554
- var reIsNative = RegExp('^' + funcToString
1555
- // Take an example native function source for comparison
1556
- .call(hasOwnProperty)
1557
- // Strip regex characters so we can use it for regex
1558
- .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
1559
- // Remove hasOwnProperty from the template to make it generic
1560
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
1561
- try {
1562
- var source = funcToString.call(fn);
1563
- return reIsNative.test(source);
1564
- } catch (err) {
1565
- return false;
1661
+ /**
1662
+ * Iterates through children that are typically specified as `props.children`.
1663
+ *
1664
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.foreach
1665
+ *
1666
+ * The provided forEachFunc(child, index) will be called for each
1667
+ * leaf child.
1668
+ *
1669
+ * @param {?*} children Children tree container.
1670
+ * @param {function(*, int)} forEachFunc
1671
+ * @param {*} forEachContext Context for forEachContext.
1672
+ */
1673
+ function forEachChildren(children, forEachFunc, forEachContext) {
1674
+ if (children == null) {
1675
+ return children;
1566
1676
  }
1677
+ var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
1678
+ traverseAllChildren_1(children, forEachSingleChild, traverseContext);
1679
+ ForEachBookKeeping.release(traverseContext);
1567
1680
  }
1568
1681
 
1569
- var canUseCollections =
1570
- // Array.from
1571
- typeof Array.from === 'function' &&
1572
- // Map
1573
- typeof Map === 'function' && isNative(Map) &&
1574
- // Map.prototype.keys
1575
- Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
1576
- // Set
1577
- typeof Set === 'function' && isNative(Set) &&
1578
- // Set.prototype.keys
1579
- Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
1682
+ /**
1683
+ * PooledClass representing the bookkeeping associated with performing a child
1684
+ * mapping. Allows avoiding binding callbacks.
1685
+ *
1686
+ * @constructor MapBookKeeping
1687
+ * @param {!*} mapResult Object containing the ordered map of results.
1688
+ * @param {!function} mapFunction Function to perform mapping with.
1689
+ * @param {?*} mapContext Context to perform mapping with.
1690
+ */
1691
+ function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
1692
+ this.result = mapResult;
1693
+ this.keyPrefix = keyPrefix;
1694
+ this.func = mapFunction;
1695
+ this.context = mapContext;
1696
+ this.count = 0;
1697
+ }
1698
+ MapBookKeeping.prototype.destructor = function () {
1699
+ this.result = null;
1700
+ this.keyPrefix = null;
1701
+ this.func = null;
1702
+ this.context = null;
1703
+ this.count = 0;
1704
+ };
1705
+ PooledClass_1.addPoolingTo(MapBookKeeping, fourArgumentPooler);
1580
1706
 
1581
- var setItem;
1582
- var getItem;
1583
- var removeItem;
1584
- var getItemIDs;
1585
- var addRoot;
1586
- var removeRoot;
1587
- var getRootIDs;
1707
+ function mapSingleChildIntoContext(bookKeeping, child, childKey) {
1708
+ var result = bookKeeping.result,
1709
+ keyPrefix = bookKeeping.keyPrefix,
1710
+ func = bookKeeping.func,
1711
+ context = bookKeeping.context;
1588
1712
 
1589
- if (canUseCollections) {
1590
- var itemMap = new Map();
1591
- var rootIDSet = new Set();
1592
1713
 
1593
- setItem = function (id, item) {
1594
- itemMap.set(id, item);
1595
- };
1596
- getItem = function (id) {
1597
- return itemMap.get(id);
1598
- };
1599
- removeItem = function (id) {
1600
- itemMap['delete'](id);
1601
- };
1602
- getItemIDs = function () {
1603
- return Array.from(itemMap.keys());
1604
- };
1714
+ var mappedChild = func.call(context, child, bookKeeping.count++);
1715
+ if (Array.isArray(mappedChild)) {
1716
+ mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction_1.thatReturnsArgument);
1717
+ } else if (mappedChild != null) {
1718
+ if (ReactElement_1.isValidElement(mappedChild)) {
1719
+ mappedChild = ReactElement_1.cloneAndReplaceKey(mappedChild,
1720
+ // Keep both the (mapped) and old keys if they differ, just as
1721
+ // traverseAllChildren used to do for objects as children
1722
+ keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
1723
+ }
1724
+ result.push(mappedChild);
1725
+ }
1726
+ }
1605
1727
 
1606
- addRoot = function (id) {
1607
- rootIDSet.add(id);
1608
- };
1609
- removeRoot = function (id) {
1610
- rootIDSet['delete'](id);
1611
- };
1612
- getRootIDs = function () {
1613
- return Array.from(rootIDSet.keys());
1614
- };
1615
- } else {
1616
- var itemByKey = {};
1617
- var rootByKey = {};
1728
+ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
1729
+ var escapedPrefix = '';
1730
+ if (prefix != null) {
1731
+ escapedPrefix = escapeUserProvidedKey(prefix) + '/';
1732
+ }
1733
+ var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
1734
+ traverseAllChildren_1(children, mapSingleChildIntoContext, traverseContext);
1735
+ MapBookKeeping.release(traverseContext);
1736
+ }
1618
1737
 
1619
- // Use non-numeric keys to prevent V8 performance issues:
1620
- // https://github.com/facebook/react/pull/7232
1621
- var getKeyFromID = function (id) {
1622
- return '.' + id;
1623
- };
1624
- var getIDFromKey = function (key) {
1625
- return parseInt(key.substr(1), 10);
1626
- };
1738
+ /**
1739
+ * Maps children that are typically specified as `props.children`.
1740
+ *
1741
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.map
1742
+ *
1743
+ * The provided mapFunction(child, key, index) will be called for each
1744
+ * leaf child.
1745
+ *
1746
+ * @param {?*} children Children tree container.
1747
+ * @param {function(*, int)} func The map function.
1748
+ * @param {*} context Context for mapFunction.
1749
+ * @return {object} Object containing the ordered map of results.
1750
+ */
1751
+ function mapChildren(children, func, context) {
1752
+ if (children == null) {
1753
+ return children;
1754
+ }
1755
+ var result = [];
1756
+ mapIntoWithKeyPrefixInternal(children, result, null, func, context);
1757
+ return result;
1758
+ }
1627
1759
 
1628
- setItem = function (id, item) {
1629
- var key = getKeyFromID(id);
1630
- itemByKey[key] = item;
1631
- };
1632
- getItem = function (id) {
1633
- var key = getKeyFromID(id);
1634
- return itemByKey[key];
1635
- };
1636
- removeItem = function (id) {
1637
- var key = getKeyFromID(id);
1638
- delete itemByKey[key];
1639
- };
1640
- getItemIDs = function () {
1641
- return Object.keys(itemByKey).map(getIDFromKey);
1642
- };
1760
+ function forEachSingleChildDummy(traverseContext, child, name) {
1761
+ return null;
1762
+ }
1643
1763
 
1644
- addRoot = function (id) {
1645
- var key = getKeyFromID(id);
1646
- rootByKey[key] = true;
1647
- };
1648
- removeRoot = function (id) {
1649
- var key = getKeyFromID(id);
1650
- delete rootByKey[key];
1651
- };
1652
- getRootIDs = function () {
1653
- return Object.keys(rootByKey).map(getIDFromKey);
1654
- };
1764
+ /**
1765
+ * Count the number of children that are typically specified as
1766
+ * `props.children`.
1767
+ *
1768
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.count
1769
+ *
1770
+ * @param {?*} children Children tree container.
1771
+ * @return {number} The number of children.
1772
+ */
1773
+ function countChildren(children, context) {
1774
+ return traverseAllChildren_1(children, forEachSingleChildDummy, null);
1655
1775
  }
1656
1776
 
1657
- var unmountedIDs = [];
1777
+ /**
1778
+ * Flatten a children object (typically specified as `props.children`) and
1779
+ * return an array with appropriately re-keyed children.
1780
+ *
1781
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.toarray
1782
+ */
1783
+ function toArray(children) {
1784
+ var result = [];
1785
+ mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction_1.thatReturnsArgument);
1786
+ return result;
1787
+ }
1658
1788
 
1659
- function purgeDeep(id) {
1660
- var item = getItem(id);
1661
- if (item) {
1662
- var childIDs = item.childIDs;
1789
+ var ReactChildren = {
1790
+ forEach: forEachChildren,
1791
+ map: mapChildren,
1792
+ mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
1793
+ count: countChildren,
1794
+ toArray: toArray
1795
+ };
1663
1796
 
1664
- removeItem(id);
1665
- childIDs.forEach(purgeDeep);
1666
- }
1667
- }
1797
+ var ReactChildren_1 = ReactChildren;
1668
1798
 
1669
- function getDisplayName(element) {
1670
- if (element == null) {
1671
- return '#empty';
1672
- } else if (typeof element === 'string' || typeof element === 'number') {
1673
- return '#text';
1674
- } else if (typeof element.type === 'string') {
1675
- return element.type;
1676
- } else {
1677
- return element.type.displayName || element.type.name || 'Unknown';
1678
- }
1679
- }
1799
+ /**
1800
+ * Copyright 2013-present, Facebook, Inc.
1801
+ * All rights reserved.
1802
+ *
1803
+ * This source code is licensed under the BSD-style license found in the
1804
+ * LICENSE file in the root directory of this source tree. An additional grant
1805
+ * of patent rights can be found in the PATENTS file in the same directory.
1806
+ */
1680
1807
 
1681
- function describeID(id) {
1682
- var name = ReactComponentTreeHook.getDisplayName(id);
1683
- var element = ReactComponentTreeHook.getElement(id);
1684
- var ownerID = ReactComponentTreeHook.getOwnerID(id);
1685
- var ownerName = void 0;
1808
+ var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1686
1809
 
1687
- if (ownerID) {
1688
- ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
1689
- }
1690
- warning_1(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id);
1691
- return describeComponentFrame(name || '', element && element._source, ownerName || '');
1692
- }
1810
+ var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
1693
1811
 
1694
- var ReactComponentTreeHook = {
1695
- onSetChildren: function (id, nextChildIDs) {
1696
- var item = getItem(id);
1697
- invariant_1(item, 'Item must have been set');
1698
- item.childIDs = nextChildIDs;
1812
+ {
1813
+ var invariant$1 = invariant_1;
1814
+ var warning$3 = warning_1;
1815
+ var ReactPropTypesSecret = ReactPropTypesSecret_1;
1816
+ var loggedTypeFailures = {};
1817
+ }
1699
1818
 
1700
- for (var i = 0; i < nextChildIDs.length; i++) {
1701
- var nextChildID = nextChildIDs[i];
1702
- var nextChild = getItem(nextChildID);
1703
- !nextChild ? invariant_1(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : void 0;
1704
- !(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;
1705
- !nextChild.isMounted ? invariant_1(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : void 0;
1706
- if (nextChild.parentID == null) {
1707
- nextChild.parentID = id;
1708
- // TODO: This shouldn't be necessary but mounting a new root during in
1709
- // componentWillMount currently causes not-yet-mounted components to
1710
- // be purged from our tree data so their parent id is missing.
1711
- }
1712
- !(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;
1713
- }
1714
- },
1715
- onBeforeMountComponent: function (id, element, parentID) {
1716
- var item = {
1717
- element: element,
1718
- parentID: parentID,
1719
- text: null,
1720
- childIDs: [],
1721
- isMounted: false,
1722
- updateCount: 0
1723
- };
1724
- setItem(id, item);
1725
- },
1726
- onBeforeUpdateComponent: function (id, element) {
1727
- var item = getItem(id);
1728
- if (!item || !item.isMounted) {
1729
- // We may end up here as a result of setState() in componentWillUnmount().
1730
- // In this case, ignore the element.
1731
- return;
1732
- }
1733
- item.element = element;
1734
- },
1735
- onMountComponent: function (id) {
1736
- var item = getItem(id);
1737
- invariant_1(item, 'Item must have been set');
1738
- item.isMounted = true;
1739
- var isRoot = item.parentID === 0;
1740
- if (isRoot) {
1741
- addRoot(id);
1742
- }
1743
- },
1744
- onUpdateComponent: function (id) {
1745
- var item = getItem(id);
1746
- if (!item || !item.isMounted) {
1747
- // We may end up here as a result of setState() in componentWillUnmount().
1748
- // In this case, ignore the element.
1749
- return;
1750
- }
1751
- item.updateCount++;
1752
- },
1753
- onUnmountComponent: function (id) {
1754
- var item = getItem(id);
1755
- if (item) {
1756
- // We need to check if it exists.
1757
- // `item` might not exist if it is inside an error boundary, and a sibling
1758
- // error boundary child threw while mounting. Then this instance never
1759
- // got a chance to mount, but it still gets an unmounting event during
1760
- // the error boundary cleanup.
1761
- item.isMounted = false;
1762
- var isRoot = item.parentID === 0;
1763
- if (isRoot) {
1764
- removeRoot(id);
1765
- }
1766
- }
1767
- unmountedIDs.push(id);
1768
- },
1769
- purgeUnmountedComponents: function () {
1770
- if (ReactComponentTreeHook._preventPurging) {
1771
- // Should only be used for testing.
1772
- return;
1773
- }
1819
+ /**
1820
+ * Assert that the values match with the type specs.
1821
+ * Error messages are memorized and will only be shown once.
1822
+ *
1823
+ * @param {object} typeSpecs Map of name to a ReactPropType
1824
+ * @param {object} values Runtime values that need to be type-checked
1825
+ * @param {string} location e.g. "prop", "context", "child context"
1826
+ * @param {string} componentName Name of the component for error messages.
1827
+ * @param {?Function} getStack Returns the component stack.
1828
+ * @private
1829
+ */
1830
+ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
1831
+ {
1832
+ for (var typeSpecName in typeSpecs) {
1833
+ if (typeSpecs.hasOwnProperty(typeSpecName)) {
1834
+ var error;
1835
+ // Prop type validation may throw. In case they do, we don't want to
1836
+ // fail the render phase where it didn't fail before. So we log it.
1837
+ // After these have been cleaned up, we'll let them throw.
1838
+ try {
1839
+ // This is intentionally an invariant that gets caught. It's the same
1840
+ // behavior as without this statement except with a better message.
1841
+ 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);
1842
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
1843
+ } catch (ex) {
1844
+ error = ex;
1845
+ }
1846
+ 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);
1847
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1848
+ // Only monitor this failure once because there tends to be a lot of the
1849
+ // same error.
1850
+ loggedTypeFailures[error.message] = true;
1774
1851
 
1775
- for (var i = 0; i < unmountedIDs.length; i++) {
1776
- var id = unmountedIDs[i];
1777
- purgeDeep(id);
1778
- }
1779
- unmountedIDs.length = 0;
1780
- },
1781
- isMounted: function (id) {
1782
- var item = getItem(id);
1783
- return item ? item.isMounted : false;
1784
- },
1785
- getCurrentStackAddendum: function (topElement) {
1786
- var info = '';
1787
- if (topElement) {
1788
- var name = getDisplayName(topElement);
1789
- var owner = topElement._owner;
1790
- info += describeComponentFrame(name, topElement._source, owner && getComponentName_1(owner));
1791
- }
1852
+ var stack = getStack ? getStack() : '';
1792
1853
 
1793
- var currentOwner = ReactCurrentOwner_1.current;
1794
- if (currentOwner) {
1795
- if (typeof currentOwner.tag === 'number') {
1796
- var workInProgress = currentOwner;
1797
- // Safe because if current owner exists, we are reconciling,
1798
- // and it is guaranteed to be the work-in-progress version.
1799
- info += getStackAddendumByWorkInProgressFiber$1(workInProgress);
1800
- } else if (typeof currentOwner._debugID === 'number') {
1801
- info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
1854
+ warning$3(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
1855
+ }
1802
1856
  }
1803
1857
  }
1804
- return info;
1805
- },
1806
- getStackAddendumByID: function (id) {
1807
- var info = '';
1808
- while (id) {
1809
- info += describeID(id);
1810
- id = ReactComponentTreeHook.getParentID(id);
1811
- }
1812
- return info;
1813
- },
1814
- getChildIDs: function (id) {
1815
- var item = getItem(id);
1816
- return item ? item.childIDs : [];
1817
- },
1818
- getDisplayName: function (id) {
1819
- var element = ReactComponentTreeHook.getElement(id);
1820
- if (!element) {
1821
- return null;
1822
- }
1823
- return getDisplayName(element);
1824
- },
1825
- getElement: function (id) {
1826
- var item = getItem(id);
1827
- return item ? item.element : null;
1828
- },
1829
- getOwnerID: function (id) {
1830
- var element = ReactComponentTreeHook.getElement(id);
1831
- if (!element || !element._owner) {
1832
- return null;
1833
- }
1834
- return element._owner._debugID;
1835
- },
1836
- getParentID: function (id) {
1837
- var item = getItem(id);
1838
- return item ? item.parentID : null;
1839
- },
1840
- getSource: function (id) {
1841
- var item = getItem(id);
1842
- var element = item ? item.element : null;
1843
- var source = element != null ? element._source : null;
1844
- return source;
1845
- },
1846
- getText: function (id) {
1847
- var element = ReactComponentTreeHook.getElement(id);
1848
- if (typeof element === 'string') {
1849
- return element;
1850
- } else if (typeof element === 'number') {
1851
- return '' + element;
1852
- } else {
1853
- return null;
1854
- }
1855
- },
1856
- getUpdateCount: function (id) {
1857
- var item = getItem(id);
1858
- return item ? item.updateCount : 0;
1859
- },
1860
-
1861
-
1862
- getRootIDs: getRootIDs,
1863
- getRegisteredIDs: getItemIDs
1864
- };
1858
+ }
1859
+ }
1865
1860
 
1866
- var ReactComponentTreeHook_1 = ReactComponentTreeHook;
1861
+ var checkPropTypes_1 = checkPropTypes$1;
1867
1862
 
1868
1863
  var ReactDebugCurrentFrame$1 = {};
1869
1864
 
1870
1865
  {
1871
- var _require$1 = ReactComponentTreeHook_1,
1872
- getStackAddendumByID = _require$1.getStackAddendumByID,
1873
- getCurrentStackAddendum$1 = _require$1.getCurrentStackAddendum;
1866
+ var _require$2 = ReactComponentTreeHook_1,
1867
+ getStackAddendumByID = _require$2.getStackAddendumByID,
1868
+ getCurrentStackAddendum$2 = _require$2.getCurrentStackAddendum;
1874
1869
 
1875
1870
  var _require2$1 = ReactFiberComponentTreeHook,
1876
- getStackAddendumByWorkInProgressFiber = _require2$1.getStackAddendumByWorkInProgressFiber;
1871
+ getStackAddendumByWorkInProgressFiber$2 = _require2$1.getStackAddendumByWorkInProgressFiber;
1877
1872
 
1878
1873
  // Component that is being worked on
1879
1874
 
@@ -1897,10 +1892,10 @@ var ReactDebugCurrentFrame$1 = {};
1897
1892
  // The stack will only be correct if this is a work in progress
1898
1893
  // version and we're calling it during reconciliation.
1899
1894
  var workInProgress = current;
1900
- stack = getStackAddendumByWorkInProgressFiber(workInProgress);
1895
+ stack = getStackAddendumByWorkInProgressFiber$2(workInProgress);
1901
1896
  }
1902
1897
  } else if (element !== null) {
1903
- stack = getCurrentStackAddendum$1(element);
1898
+ stack = getCurrentStackAddendum$2(element);
1904
1899
  }
1905
1900
  return stack;
1906
1901
  };
@@ -1909,12 +1904,12 @@ var ReactDebugCurrentFrame$1 = {};
1909
1904
  var ReactDebugCurrentFrame_1 = ReactDebugCurrentFrame$1;
1910
1905
 
1911
1906
  {
1912
- var checkPropTypes = checkPropTypes$1;
1907
+ var checkPropTypes = checkPropTypes_1;
1913
1908
  var warning$2 = warning_1;
1914
1909
  var ReactDebugCurrentFrame = ReactDebugCurrentFrame_1;
1915
1910
 
1916
- var _require = ReactComponentTreeHook_1,
1917
- getCurrentStackAddendum = _require.getCurrentStackAddendum;
1911
+ var _require$1 = ReactComponentTreeHook_1,
1912
+ getCurrentStackAddendum$1 = _require$1.getCurrentStackAddendum;
1918
1913
  }
1919
1914
 
1920
1915
  function getDeclarationErrorAddendum() {
@@ -1973,13 +1968,11 @@ function validateExplicitKey(element, parentType) {
1973
1968
  }
1974
1969
  element._store.validated = true;
1975
1970
 
1976
- var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
1977
-
1978
1971
  var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1979
- if (memoizer[currentComponentErrorInfo]) {
1972
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1980
1973
  return;
1981
1974
  }
1982
- memoizer[currentComponentErrorInfo] = true;
1975
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
1983
1976
 
1984
1977
  // Usually the current owner is the offender, but if it accepts children as a
1985
1978
  // property, it may be the creator of the child that's responsible for
@@ -1990,7 +1983,7 @@ function validateExplicitKey(element, parentType) {
1990
1983
  childOwner = ' It was passed a child from ' + getComponentName_1(element._owner) + '.';
1991
1984
  }
1992
1985
 
1993
- 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(element));
1986
+ 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));
1994
1987
  }
1995
1988
 
1996
1989
  /**
@@ -2081,7 +2074,7 @@ var ReactElementValidator$2 = {
2081
2074
  info += getDeclarationErrorAddendum();
2082
2075
  }
2083
2076
 
2084
- info += getCurrentStackAddendum();
2077
+ info += getCurrentStackAddendum$1();
2085
2078
 
2086
2079
  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);
2087
2080
  }
@@ -2315,7 +2308,7 @@ var ReactDOMFactories = {
2315
2308
 
2316
2309
  var ReactDOMFactories_1 = ReactDOMFactories;
2317
2310
 
2318
- var factory = function (isValidElement) {
2311
+ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
2319
2312
  /* global Symbol */
2320
2313
  var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
2321
2314
  var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
@@ -2390,30 +2383,27 @@ var factory = function (isValidElement) {
2390
2383
 
2391
2384
  var ANONYMOUS = '<<anonymous>>';
2392
2385
 
2393
- var ReactPropTypes;
2394
-
2395
- {
2396
- // Keep in sync with production version below
2397
- ReactPropTypes = {
2398
- array: createPrimitiveTypeChecker('array'),
2399
- bool: createPrimitiveTypeChecker('boolean'),
2400
- func: createPrimitiveTypeChecker('function'),
2401
- number: createPrimitiveTypeChecker('number'),
2402
- object: createPrimitiveTypeChecker('object'),
2403
- string: createPrimitiveTypeChecker('string'),
2404
- symbol: createPrimitiveTypeChecker('symbol'),
2405
-
2406
- any: createAnyTypeChecker(),
2407
- arrayOf: createArrayOfTypeChecker,
2408
- element: createElementTypeChecker(),
2409
- instanceOf: createInstanceTypeChecker,
2410
- node: createNodeChecker(),
2411
- objectOf: createObjectOfTypeChecker,
2412
- oneOf: createEnumTypeChecker,
2413
- oneOfType: createUnionTypeChecker,
2414
- shape: createShapeTypeChecker
2415
- };
2416
- }
2386
+ // Important!
2387
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
2388
+ var ReactPropTypes = {
2389
+ array: createPrimitiveTypeChecker('array'),
2390
+ bool: createPrimitiveTypeChecker('boolean'),
2391
+ func: createPrimitiveTypeChecker('function'),
2392
+ number: createPrimitiveTypeChecker('number'),
2393
+ object: createPrimitiveTypeChecker('object'),
2394
+ string: createPrimitiveTypeChecker('string'),
2395
+ symbol: createPrimitiveTypeChecker('symbol'),
2396
+
2397
+ any: createAnyTypeChecker(),
2398
+ arrayOf: createArrayOfTypeChecker,
2399
+ element: createElementTypeChecker(),
2400
+ instanceOf: createInstanceTypeChecker,
2401
+ node: createNodeChecker(),
2402
+ objectOf: createObjectOfTypeChecker,
2403
+ oneOf: createEnumTypeChecker,
2404
+ oneOfType: createUnionTypeChecker,
2405
+ shape: createShapeTypeChecker
2406
+ };
2417
2407
 
2418
2408
  /**
2419
2409
  * inlined Object.is polyfill to avoid requiring consumers ship their own
@@ -2450,16 +2440,41 @@ var factory = function (isValidElement) {
2450
2440
  function createChainableTypeChecker(validate) {
2451
2441
  {
2452
2442
  var manualPropTypeCallCache = {};
2443
+ var manualPropTypeWarningCount = 0;
2453
2444
  }
2454
2445
  function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
2455
2446
  componentName = componentName || ANONYMOUS;
2456
2447
  propFullName = propFullName || propName;
2457
- {
2458
- if (secret !== ReactPropTypesSecret_1 && typeof console !== 'undefined') {
2448
+
2449
+ if (secret !== ReactPropTypesSecret_1) {
2450
+ if (throwOnDirectAccess) {
2451
+ // New behavior only for users of `prop-types` package
2452
+ invariant_1(
2453
+ false,
2454
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
2455
+ 'Use `PropTypes.checkPropTypes()` to call them. ' +
2456
+ 'Read more at http://fb.me/use-check-prop-types'
2457
+ );
2458
+ } else if ('development' !== 'production' && typeof console !== 'undefined') {
2459
+ // Old behavior for people using React.PropTypes
2459
2460
  var cacheKey = componentName + ':' + propName;
2460
- if (!manualPropTypeCallCache[cacheKey]) {
2461
- warning_1(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName);
2461
+ if (
2462
+ !manualPropTypeCallCache[cacheKey] &&
2463
+ // Avoid spamming the console because they are often not actionable except for lib authors
2464
+ manualPropTypeWarningCount < 3
2465
+ ) {
2466
+ warning_1(
2467
+ false,
2468
+ 'You are manually calling a React.PropTypes validation ' +
2469
+ 'function for the `%s` prop on `%s`. This is deprecated ' +
2470
+ 'and will throw in the standalone `prop-types` package. ' +
2471
+ 'You may be seeing this warning due to a third-party PropTypes ' +
2472
+ 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
2473
+ propFullName,
2474
+ componentName
2475
+ );
2462
2476
  manualPropTypeCallCache[cacheKey] = true;
2477
+ manualPropTypeWarningCount++;
2463
2478
  }
2464
2479
  }
2465
2480
  }
@@ -2754,11 +2769,22 @@ var factory = function (isValidElement) {
2754
2769
  return ReactPropTypes;
2755
2770
  };
2756
2771
 
2772
+ // React 15.5 references this module, and assumes PropTypes are still callable in production.
2773
+ // Therefore we re-export development-only version with all the PropTypes checks here.
2774
+ // However if one is migrating to the `prop-types` npm library, they will go through the
2775
+ // `index.js` entry point, and it will branch depending on the environment.
2776
+
2777
+ var factory_1 = function(isValidElement) {
2778
+ // It is still allowed in 15.5.
2779
+ var throwOnDirectAccess = false;
2780
+ return factoryWithTypeCheckers(isValidElement, throwOnDirectAccess);
2781
+ };
2782
+
2757
2783
  var isValidElement = ReactElement_1.isValidElement;
2758
2784
 
2759
2785
 
2760
2786
 
2761
- var ReactPropTypes = factory(isValidElement);
2787
+ var ReactPropTypes = factory_1(isValidElement);
2762
2788
 
2763
2789
  /**
2764
2790
  * Copyright 2013-present, Facebook, Inc.
@@ -2771,7 +2797,7 @@ var ReactPropTypes = factory(isValidElement);
2771
2797
  * @providesModule ReactVersion
2772
2798
  */
2773
2799
 
2774
- var ReactVersion = '16.0.0-alpha.9';
2800
+ var ReactVersion = '16.0.0-alpha.10';
2775
2801
 
2776
2802
  /**
2777
2803
  * Returns the first child in a collection of children and verifies that there
@@ -2795,7 +2821,7 @@ function onlyChild(children) {
2795
2821
  var onlyChild_1 = onlyChild;
2796
2822
 
2797
2823
  {
2798
- var warning$3 = warning_1;
2824
+ var warning$4 = warning_1;
2799
2825
  }
2800
2826
 
2801
2827
  var MIXINS_KEY = 'mixins';
@@ -2815,7 +2841,7 @@ var ReactPropTypeLocationNames;
2815
2841
  };
2816
2842
  }
2817
2843
 
2818
- function factory$3(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
2844
+ function factory$2(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
2819
2845
  /**
2820
2846
  * Policies that describe methods in `ReactClassInterface`.
2821
2847
  */
@@ -3127,7 +3153,7 @@ function factory$3(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
3127
3153
  if (typeDef.hasOwnProperty(propName)) {
3128
3154
  // use a warning instead of an _invariant so components
3129
3155
  // don't show up in prod but only in true
3130
- warning$3(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);
3156
+ 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);
3131
3157
  }
3132
3158
  }
3133
3159
  }
@@ -3156,7 +3182,7 @@ function factory$3(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
3156
3182
  var typeofSpec = typeof spec;
3157
3183
  var isMixinValid = typeofSpec === 'object' && spec !== null;
3158
3184
 
3159
- warning$3(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);
3185
+ 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);
3160
3186
  }
3161
3187
 
3162
3188
  return;
@@ -3333,9 +3359,9 @@ function factory$3(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
3333
3359
  // ignore the value of "this" that the user is trying to use, so
3334
3360
  // let's warn.
3335
3361
  if (newThis !== component && newThis !== null) {
3336
- warning$3(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName);
3362
+ warning$4(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName);
3337
3363
  } else if (!args.length) {
3338
- warning$3(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);
3364
+ 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);
3339
3365
  return boundMethod;
3340
3366
  }
3341
3367
  var reboundMethod = _bind.apply(boundMethod, arguments);
@@ -3393,7 +3419,7 @@ function factory$3(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
3393
3419
  */
3394
3420
  isMounted: function () {
3395
3421
  {
3396
- warning$3(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');
3422
+ 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');
3397
3423
  this.__didWarnIsMounted = true;
3398
3424
  }
3399
3425
  return !!this.__isMounted;
@@ -3420,7 +3446,7 @@ function factory$3(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
3420
3446
  // by mocks to assert on what gets mounted.
3421
3447
 
3422
3448
  {
3423
- warning$3(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory');
3449
+ warning$4(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory');
3424
3450
  }
3425
3451
 
3426
3452
  // Wire up auto-binding
@@ -3481,8 +3507,8 @@ function factory$3(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
3481
3507
  invariant_1(Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.');
3482
3508
 
3483
3509
  {
3484
- warning$3(!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');
3485
- warning$3(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component');
3510
+ 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');
3511
+ warning$4(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component');
3486
3512
  }
3487
3513
 
3488
3514
  // Reduce time spent doing lookups by setting these on the prototype.
@@ -3498,7 +3524,7 @@ function factory$3(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
3498
3524
  return createClass;
3499
3525
  }
3500
3526
 
3501
- var factory_1 = factory$3;
3527
+ var factory_1$2 = factory$2;
3502
3528
 
3503
3529
  var Component = ReactBaseClasses.Component;
3504
3530
 
@@ -3507,7 +3533,7 @@ var isValidElement$1 = ReactElement_1.isValidElement;
3507
3533
 
3508
3534
 
3509
3535
 
3510
- var createClass = factory_1(Component, isValidElement$1, ReactNoopUpdateQueue_1);
3536
+ var createClass = factory_1$2(Component, isValidElement$1, ReactNoopUpdateQueue_1);
3511
3537
 
3512
3538
  var createElement = ReactElement_1.createElement;
3513
3539
  var createFactory = ReactElement_1.createFactory;
@@ -3544,9 +3570,9 @@ var React = {
3544
3570
  cloneElement: cloneElement,
3545
3571
  isValidElement: ReactElement_1.isValidElement,
3546
3572
 
3547
- // TODO (bvaughn) Remove these getters in 16.0.0-alpha.10
3573
+ // TODO (bvaughn) Remove these getters before 16.0.0
3548
3574
  PropTypes: ReactPropTypes,
3549
- checkPropTypes: checkPropTypes$1,
3575
+ checkPropTypes: checkPropTypes_1,
3550
3576
  createClass: createClass,
3551
3577
 
3552
3578
  // Classic
@@ -3583,7 +3609,7 @@ var React = {
3583
3609
  return mixin;
3584
3610
  };
3585
3611
 
3586
- // TODO (bvaughn) Remove both of these deprecation warnings in 16.0.0-alpha.10
3612
+ // TODO (bvaughn) Remove both of these deprecation warnings before 16.0.0
3587
3613
  if (canDefineProperty) {
3588
3614
  Object.defineProperty(React, 'checkPropTypes', {
3589
3615
  get: function () {