UNPKG

react-sentinel

Version:

React Component that abstracts away requestAnimationFrame and requestIdleCallback.

2 lines (1 loc) 30.9 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e["react-sentinel"]=t()}(this,function(){"use strict";function e(e,t){return e(t={exports:{}},t.exports),t.exports}var c=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;var me=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,n,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;a<arguments.length;a++){for(var i in r=Object(arguments[a]))l.call(r,i)&&(o[i]=r[i]);if(c){n=c(r);for(var u=0;u<n.length;u++)s.call(r,n[u])&&(o[n[u]]=r[n[u]])}}return o},f=function(e){};"production"!==process.env.NODE_ENV&&(f=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")});var be=function(e,t,r,n,o,a,i,u){if(f(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[r,n,o,a,i,u],s=0;(c=new Error(t.replace(/%s/g,function(){return l[s++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}},t={};"production"!==process.env.NODE_ENV&&Object.freeze(t);var ge=t;function r(e){return function(){return e}}var n=function(){};n.thatReturns=r,n.thatReturnsFalse=r(!1),n.thatReturnsTrue=r(!0),n.thatReturnsNull=r(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e};var we=n,o="function"==typeof Symbol&&Symbol.for,p=o?Symbol.for("react.element"):60103,y=o?Symbol.for("react.portal"):60106,a=o?Symbol.for("react.fragment"):60107,i=o?Symbol.for("react.strict_mode"):60108,u=o?Symbol.for("react.profiler"):60114,d=o?Symbol.for("react.provider"):60109,v=o?Symbol.for("react.context"):60110,h=o?Symbol.for("react.async_mode"):60111,m=o?Symbol.for("react.forward_ref"):60112,b="function"==typeof Symbol&&Symbol.iterator;function g(e){for(var t=arguments.length-1,r="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=0;n<t;n++)r+="&args[]="+encodeURIComponent(arguments[n+1]);be(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",r)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function _(e,t,r){this.props=e,this.context=t,this.refs=ge,this.updater=r||w}function O(){}function k(e,t,r){this.props=e,this.context=t,this.refs=ge,this.updater=r||w}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&g("85"),this.updater.enqueueSetState(this,e,t,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},O.prototype=_.prototype;var j=k.prototype=new O;j.constructor=k,me(j,_.prototype),j.isPureReactComponent=!0;var P={current:null},S=Object.prototype.hasOwnProperty,R={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,r){var n=void 0,o={},a=null,i=null;if(null!=t)for(n in void 0!==t.ref&&(i=t.ref),void 0!==t.key&&(a=""+t.key),t)S.call(t,n)&&!R.hasOwnProperty(n)&&(o[n]=t[n]);var u=arguments.length-2;if(1===u)o.children=r;else if(1<u){for(var c=Array(u),l=0;l<u;l++)c[l]=arguments[l+2];o.children=c}if(e&&e.defaultProps)for(n in u=e.defaultProps)void 0===o[n]&&(o[n]=u[n]);return{$$typeof:p,type:e,key:a,ref:i,props:o,_owner:P.current}}function x(e){return"object"==typeof e&&null!==e&&e.$$typeof===p}var N=/\/+/g,T=[];function C(e,t,r,n){if(T.length){var o=T.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function A(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,T.length<10&&T.push(e)}function $(e,t,r,n){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var a=!1;if(null===e)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case p:case y:a=!0}}if(a)return r(n,e,""===t?"."+I(e,0):t),1;if(a=0,t=""===t?".":t+":",Array.isArray(e))for(var i=0;i<e.length;i++){var u=t+I(o=e[i],i);a+=$(o,u,r,n)}else if(null==e?u=null:u="function"==typeof(u=b&&e[b]||e["@@iterator"])?u:null,"function"==typeof u)for(e=u.call(e),i=0;!(o=e.next()).done;)a+=$(o=o.value,u=t+I(o,i++),r,n);else"object"===o&&g("31","[object Object]"===(r=""+e)?"object with keys {"+Object.keys(e).join(", ")+"}":r,"");return a}function I(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(r=e.key,n={"=":"=0",":":"=2"},"$"+(""+r).replace(/[=:]/g,function(e){return n[e]})):t.toString(36);var r,n}function D(e,t){e.func.call(e.context,t,e.count++)}function F(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?U(e,n,r,we.thatReturnsArgument):null!=e&&(x(e)&&(t=o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(N,"$&/")+"/")+r,e={$$typeof:p,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}),n.push(e))}function U(e,t,r,n,o){var a="";null!=r&&(a=(""+r).replace(N,"$&/")+"/"),t=C(t,a,n,o),null==e||$(e,"",F,t),A(t)}var q={Children:{map:function(e,t,r){if(null==e)return e;var n=[];return U(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;t=C(null,null,t,r),null==e||$(e,"",D,t),A(t)},count:function(e){return null==e?0:$(e,"",we.thatReturnsNull,null)},toArray:function(e){var t=[];return U(e,t,null,we.thatReturnsArgument),t},only:function(e){return x(e)||g("143"),e}},createRef:function(){return{current:null}},Component:_,PureComponent:k,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:v,_calculateChangedBits:t,_defaultValue:e,_currentValue:e,_currentValue2:e,_changedBits:0,_changedBits2:0,Provider:null,Consumer:null}).Provider={$$typeof:d,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:m,render:e}},Fragment:a,StrictMode:i,unstable_AsyncMode:h,unstable_Profiler:u,createElement:E,cloneElement:function(e,t,r){null==e&&g("267",e);var n=void 0,o=me({},e.props),a=e.key,i=e.ref,u=e._owner;if(null!=t){void 0!==t.ref&&(i=t.ref,u=P.current),void 0!==t.key&&(a=""+t.key);var c=void 0;for(n in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)S.call(t,n)&&!R.hasOwnProperty(n)&&(o[n]=void 0===t[n]&&void 0!==c?c[n]:t[n])}if(1===(n=arguments.length-2))o.children=r;else if(1<n){c=Array(n);for(var l=0;l<n;l++)c[l]=arguments[l+2];o.children=c}return{$$typeof:p,type:e.type,key:a,ref:i,props:o,_owner:u}},createFactory:function(e){var t=E.bind(null,e);return t.type=e,t},isValidElement:x,version:"16.4.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:P,assign:me}},V=q.default?q.default:q,L=we;if("production"!==process.env.NODE_ENV){L=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var r=arguments.length,n=Array(2<r?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];(function(e){for(var t=arguments.length,r=Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=0,a="Warning: "+e.replace(/%s/g,function(){return r[o++]});"undefined"!=typeof console&&console.error(a);try{throw new Error(a)}catch(e){}}).apply(void 0,[t].concat(n))}}}var _e=L,M="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";if("production"!==process.env.NODE_ENV)var B=be,W=_e,Y=M,z={};var Oe=function(e,t,r,n,o){if("production"!==process.env.NODE_ENV)for(var a in e)if(e.hasOwnProperty(a)){var i;try{B("function"==typeof e[a],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",n||"React class",r,a,typeof e[a]),i=e[a](t,a,n,r,null,Y)}catch(e){i=e}if(W(!i||i 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).",n||"React class",r,a,typeof i),i instanceof Error&&!(i.message in z)){z[i.message]=!0;var u=o?o():"";W(!1,"Failed %s type: %s%s",r,i.message,null!=u?u:"")}}},J=e(function(he){"production"!==process.env.NODE_ENV&&function(){var d=me,m=be,n=ge,w=_e,s=we,o=Oe,e="function"==typeof Symbol&&Symbol.for,_=e?Symbol.for("react.element"):60103,b=e?Symbol.for("react.portal"):60106,f=e?Symbol.for("react.fragment"):60107,p=e?Symbol.for("react.strict_mode"):60108,y=e?Symbol.for("react.profiler"):60114,v=e?Symbol.for("react.provider"):60109,h=e?Symbol.for("react.context"):60110,g=e?Symbol.for("react.async_mode"):60111,O=e?Symbol.for("react.forward_ref"):60112,k=e?Symbol.for("react.timeout"):60113,r="function"==typeof Symbol&&Symbol.iterator,a="@@iterator";function j(e){if(null==e)return null;var t=r&&e[r]||e[a];return"function"==typeof t?t:null}var i=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(!e){for(var r=arguments.length,n=Array(2<r?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];(function(e){for(var t=arguments.length,r=Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var o=0,a="Warning: "+e.replace(/%s/g,function(){return r[o++]});"undefined"!=typeof console&&console.warn(a);try{throw new Error(a)}catch(e){}}).apply(void 0,[t].concat(n))}},u={};function c(e,t){var r=e.constructor,n=r&&(r.displayName||r.name)||"ReactClass",o=n+"."+t;u[o]||(w(!1,"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,n),u[o]=!0)}var l={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){c(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){c(e,"replaceState")},enqueueSetState:function(e,t,r,n){c(e,"setState")}};function P(e,t,r){this.props=e,this.context=t,this.refs=n,this.updater=r||l}P.prototype.isReactComponent={},P.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&m(!1,"setState(...): takes an object of state variables to update or a function which returns an object of state variables."),this.updater.enqueueSetState(this,e,t,"setState")},P.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var t={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},S=function(e,t){Object.defineProperty(P.prototype,e,{get:function(){i(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var R in t)t.hasOwnProperty(R)&&S(R,t[R]);function E(){}function x(e,t,r){this.props=e,this.context=t,this.refs=n,this.updater=r||l}E.prototype=P.prototype;var N=x.prototype=new E;N.constructor=x,d(N,P.prototype),N.isPureReactComponent=!0;var T={current:null},C=Object.prototype.hasOwnProperty,A={key:!0,ref:!0,__self:!0,__source:!0},$=void 0,I=void 0;function D(e){if(C.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}function F(e){if(C.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}var U=function(e,t,r,n,o,a,i){var u={$$typeof:_,type:e,key:t,ref:r,props:i,_owner:a,_store:{}};return Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function q(e,t,r){var n=void 0,o={},a=null,i=null,u=null,c=null;if(null!=t)for(n in D(t)&&(i=t.ref),F(t)&&(a=""+t.key),u=void 0===t.__self?null:t.__self,c=void 0===t.__source?null:t.__source,t)C.call(t,n)&&!A.hasOwnProperty(n)&&(o[n]=t[n]);var l,s,f,p,y,d,v=arguments.length-2;if(1===v)o.children=r;else if(1<v){for(var h=Array(v),m=0;m<v;m++)h[m]=arguments[m+2];Object.freeze&&Object.freeze(h),o.children=h}if(e&&e.defaultProps){var b=e.defaultProps;for(n in b)void 0===o[n]&&(o[n]=b[n])}if((a||i)&&(void 0===o.$$typeof||o.$$typeof!==_)){var g="function"==typeof e?e.displayName||e.name||"Unknown":e;a&&(p=o,y=g,(d=function(){$||w(!($=!0),"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",y)}).isReactWarning=!0,Object.defineProperty(p,"key",{get:d,configurable:!0})),i&&(l=o,s=g,(f=function(){I||w(!(I=!0),"%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",s)}).isReactWarning=!0,Object.defineProperty(l,"ref",{get:f,configurable:!0}))}return U(e,a,i,u,c,T.current,o)}function V(e){return"object"==typeof e&&null!==e&&e.$$typeof===_}var L={getCurrentStack:null,getStackAddendum:function(){var e=L.getCurrentStack;return e?e():null}},M=".",B=":";var W=!1,Y=/\/+/g;function z(e){return(""+e).replace(Y,"$&/")}var J=10,H=[];function G(e,t,r,n){if(H.length){var o=H.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function K(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,H.length<J&&H.push(e)}function Q(e,t,r){return null==e?0:function e(t,r,n,o){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var i=!1;if(null===t)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case _:case b:i=!0}}if(i)return n(o,t,""===r?M+X(t,0):r),1;var u=void 0,c=0,l=""===r?M:r+B;if(Array.isArray(t))for(var s=0;s<t.length;s++)c+=e(u=t[s],l+X(u,s),n,o);else{var f=j(t);if("function"==typeof f){f===t.entries&&(W||w(!1,"Using Maps as children is unsupported and will likely yield unexpected results. Convert it to a sequence/iterable of keyed ReactElements instead.%s",L.getStackAddendum()),W=!0);for(var p=f.call(t),y=void 0,d=0;!(y=p.next()).done;)c+=e(u=y.value,l+X(u,d++),n,o)}else if("object"===a){var v;v=" If you meant to render a collection of children, use an array instead."+L.getStackAddendum();var h=""+t;m(!1,"Objects are not valid as a React child (found: %s).%s","[object Object]"===h?"object with keys {"+Object.keys(t).join(", ")+"}":h,v)}}return c}(e,"",t,r)}function X(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(r=e.key,n={"=":"=0",":":"=2"},"$"+(""+r).replace(/[=:]/g,function(e){return n[e]})):t.toString(36);var r,n}function Z(e,t,r){var n=e.func,o=e.context;n.call(o,t,e.count++)}function ee(e,t,r){var n,o,a=e.result,i=e.keyPrefix,u=e.func,c=e.context,l=u.call(c,t,e.count++);Array.isArray(l)?te(l,a,r,s.thatReturnsArgument):null!=l&&(V(l)&&(o=i+(!(n=l).key||t&&t.key===l.key?"":z(l.key)+"/")+r,l=U(n.type,o,n.ref,n._self,n._source,n._owner,n.props)),a.push(l))}function te(e,t,r,n,o){var a="";null!=r&&(a=z(r)+"/");var i=G(t,a,n,o);Q(e,ee,i),K(i)}function re(e){var t=e.type;if("function"==typeof t)return t.displayName||t.name;if("string"==typeof t)return t;switch(t){case g:return"AsyncMode";case h:return"Context.Consumer";case f:return"ReactFragment";case b:return"ReactPortal";case y:return"Profiler("+e.pendingProps.id+")";case v:return"Context.Provider";case p:return"StrictMode";case k:return"Timeout"}if("object"==typeof t&&null!==t)switch(t.$$typeof){case O:var r=t.render.displayName||t.render.name||"";return""!==r?"ForwardRef("+r+")":"ForwardRef"}return null}var ne,oe=void 0,ae=void 0,ie=function(){};oe=null,ae=!1,ne=function(e){return null==e?"#empty":"string"==typeof e||"number"==typeof e?"#text":"string"==typeof e.type?e.type:e.type===f?"React.Fragment":e.type.displayName||e.type.name||"Unknown"},ie=function(){var e,t,r,n="";if(oe){var o=ne(oe),a=oe._owner;n+=(e=o,t=oe._source,r=a&&re(a),"\n in "+(e||"Unknown")+(t?" (at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+")":r?" (created by "+r+")":""))}return n+=L.getStackAddendum()||""};var ue={};function ce(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var r=function(e){var t="";if(!t){var r="string"==typeof e?e:e.displayName||e.name;r&&(t="\n\nCheck the top-level render call using <"+r+">.")}return t}(t);if(!ue[r]){ue[r]=!0;var n="";e&&e._owner&&e._owner!==T.current&&(n=" It was passed a child from "+re(e._owner)+"."),oe=e,w(!1,'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',r,n,ie()),oe=null}}}function le(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];V(n)&&ce(n,t)}else if(V(e))e._store&&(e._store.validated=!0);else if(e){var o=j(e);if("function"==typeof o&&o!==e.entries)for(var a=o.call(e),i=void 0;!(i=a.next()).done;)V(i.value)&&ce(i.value,t)}}function se(e){var t=e.type;if("function"==typeof t){var r=t.displayName||t.name,n=t.propTypes;n?(o(n,(oe=e).props,"prop",r,ie),oe=null):void 0===t.PropTypes||ae||w(!(ae=!0),"Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",r||"Unknown"),"function"==typeof t.getDefaultProps&&(t.getDefaultProps.isReactClassApproved||w(!1,"getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."))}}function fe(e,t,r){var n,o="string"==typeof(n=e)||"function"==typeof n||n===f||n===g||n===y||n===p||n===k||"object"==typeof n&&null!==n&&(n.$$typeof===v||n.$$typeof===h||n.$$typeof===O);if(!o){var a="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var i=function(e){if(null!=e&&void 0!==e.__source){var t=e.__source;return"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+"."}return""}(t);a+=i||"",a+=ie()||"";var u=void 0;u=null===e?"null":Array.isArray(e)?"array":typeof e,w(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,a)}var c=q.apply(this,arguments);if(null==c)return c;if(o)for(var l=2;l<arguments.length;l++)le(arguments[l],e);return e===f?function(e){oe=e;for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){w(!1,"Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.%s",n,ie());break}}null!==e.ref&&w(!1,"Invalid attribute `ref` supplied to `React.Fragment`.%s",ie()),oe=null}(c):se(c),c}var pe={Children:{map:function(e,t,r){if(null==e)return e;var n=[];return te(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;var n=G(null,null,t,r);Q(e,Z,n),K(n)},count:function(e){return Q(e,s.thatReturnsNull,null)},toArray:function(e){var t=[];return te(e,t,null,s.thatReturnsArgument),t},only:function(e){return V(e)||m(!1,"React.Children.only expected to receive a single React element child."),e}},createRef:function(){var e={current:null};return Object.seal(e),e},Component:P,PureComponent:x,createContext:function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&w(!1,"createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:h,_calculateChangedBits:t,_defaultValue:e,_currentValue:e,_currentValue2:e,_changedBits:0,_changedBits2:0,Provider:null,Consumer:null};return r.Provider={$$typeof:v,_context:r},(r.Consumer=r)._currentRenderer=null,r._currentRenderer2=null,r},forwardRef:function(e){return"function"!=typeof e&&w(!1,"forwardRef requires a render function but was given %s.",null===e?"null":typeof e),null!=e&&(null!=e.defaultProps||null!=e.propTypes)&&w(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:O,render:e}},Fragment:f,StrictMode:p,unstable_AsyncMode:g,unstable_Profiler:y,createElement:fe,cloneElement:function(e,t,r){for(var n=function(e,t,r){null==e&&m(!1,"React.cloneElement(...): The argument must be a React element, but you passed %s.",e);var n=void 0,o=d({},e.props),a=e.key,i=e.ref,u=e._self,c=e._source,l=e._owner;if(null!=t){D(t)&&(i=t.ref,l=T.current),F(t)&&(a=""+t.key);var s=void 0;for(n in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)C.call(t,n)&&!A.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==s?o[n]=s[n]:o[n]=t[n])}var f=arguments.length-2;if(1===f)o.children=r;else if(1<f){for(var p=Array(f),y=0;y<f;y++)p[y]=arguments[y+2];o.children=p}return U(e.type,a,i,u,c,l,o)}.apply(this,arguments),o=2;o<arguments.length;o++)le(arguments[o],n.type);return se(n),n},createFactory:function(e){var t=fe.bind(null,e);return t.type=e,Object.defineProperty(t,"type",{enumerable:!1,get:function(){return i(!1,"Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t},isValidElement:V,version:"16.4.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:T,assign:d}};d(pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,{ReactDebugCurrentFrame:L,ReactComponentTreeHook:{}});var ye=Object.freeze({default:pe}),de=ye&&pe||ye,ve=de.default?de.default:de;he.exports=ve}()}),H=e(function(e){"production"===process.env.NODE_ENV?e.exports=V:e.exports=J}),G=(H.Children,H.PureComponent,H.Component),K=(H.PropTypes,H.createElement,function(u,f){var a="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";var p="<<anonymous>>",e={array:t("array"),bool:t("boolean"),func:t("function"),number:t("number"),object:t("object"),string:t("string"),symbol:t("symbol"),any:r(we.thatReturnsNull),arrayOf:function(l){return r(function(e,t,r,n,o){if("function"!=typeof l)return new y("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=e[t];if(!Array.isArray(a)){var i=d(a);return new y("Invalid "+n+" `"+o+"` of type `"+i+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u<a.length;u++){var c=l(a,u,r,n,o+"["+u+"]",M);if(c instanceof Error)return c}return null})},element:r(function(e,t,r,n,o){var a=e[t];if(!u(a)){var i=d(a);return new y("Invalid "+n+" `"+o+"` of type `"+i+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}),instanceOf:function(u){return r(function(e,t,r,n,o){if(!(e[t]instanceof u)){var a=u.name||p,i=function(e){if(!e.constructor||!e.constructor.name)return p;return e.constructor.name}(e[t]);return new y("Invalid "+n+" `"+o+"` of type `"+i+"` supplied to `"+r+"`, expected instance of `"+a+"`.")}return null})},node:r(function(e,t,r,n,o){return c(e[t])?null:new y("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(l){return r(function(e,t,r,n,o){if("function"!=typeof l)return new y("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=e[t],i=d(a);if("object"!==i)return new y("Invalid "+n+" `"+o+"` of type `"+i+"` supplied to `"+r+"`, expected an object.");for(var u in a)if(a.hasOwnProperty(u)){var c=l(a,u,r,n,o+"."+u,M);if(c instanceof Error)return c}return null})},oneOf:function(c){if(!Array.isArray(c))return"production"!==process.env.NODE_ENV&&_e(!1,"Invalid argument supplied to oneOf, expected an instance of array."),we.thatReturnsNull;return r(function(e,t,r,n,o){for(var a=e[t],i=0;i<c.length;i++)if(l(a,c[i]))return null;var u=JSON.stringify(c);return new y("Invalid "+n+" `"+o+"` of value `"+a+"` supplied to `"+r+"`, expected one of "+u+".")})},oneOfType:function(u){if(!Array.isArray(u))return"production"!==process.env.NODE_ENV&&_e(!1,"Invalid argument supplied to oneOfType, expected an instance of array."),we.thatReturnsNull;for(var e=0;e<u.length;e++){var t=u[e];if("function"!=typeof t)return _e(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",n(t),e),we.thatReturnsNull}return r(function(e,t,r,n,o){for(var a=0;a<u.length;a++){var i=u[a];if(null==i(e,t,r,n,o,M))return null}return new y("Invalid "+n+" `"+o+"` supplied to `"+r+"`.")})},shape:function(s){return r(function(e,t,r,n,o){var a=e[t],i=d(a);if("object"!==i)return new y("Invalid "+n+" `"+o+"` of type `"+i+"` supplied to `"+r+"`, expected `object`.");for(var u in s){var c=s[u];if(c){var l=c(a,u,r,n,o+"."+u,M);if(l)return l}}return null})},exact:function(f){return r(function(e,t,r,n,o){var a=e[t],i=d(a);if("object"!==i)return new y("Invalid "+n+" `"+o+"` of type `"+i+"` supplied to `"+r+"`, expected `object`.");var u=me({},e[t],f);for(var c in u){var l=f[c];if(!l)return new y("Invalid "+n+" `"+o+"` key `"+c+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(e[t],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(f),null," "));var s=l(a,c,r,n,o+"."+c,M);if(s)return s}return null})}};function l(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function y(e){this.message=e,this.stack=""}function r(c){if("production"!==process.env.NODE_ENV)var l={},s=0;function e(e,t,r,n,o,a,i){if(n=n||p,a=a||r,i!==M)if(f)be(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");else if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var u=n+":"+r;!l[u]&&s<3&&(_e(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",a,n),l[u]=!0,s++)}return null==t[r]?e?null===t[r]?new y("The "+o+" `"+a+"` is marked as required in `"+n+"`, but its value is `null`."):new y("The "+o+" `"+a+"` is marked as required in `"+n+"`, but its value is `undefined`."):null:c(t,r,n,o,a)}var t=e.bind(null,!1);return t.isRequired=e.bind(null,!0),t}function t(u){return r(function(e,t,r,n,o,a){var i=e[t];return d(i)!==u?new y("Invalid "+n+" `"+o+"` of type `"+s(i)+"` supplied to `"+r+"`, expected `"+u+"`."):null})}function c(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(c);if(null===e||u(e))return!0;var t=function(e){var t=e&&(a&&e[a]||e[i]);if("function"==typeof t)return t}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!c(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!c(o[1]))return!1}return!0;default:return!1}}function d(e){var t,r=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":(t=e,"symbol"===r||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol?"symbol":r)}function s(e){if(null==e)return""+e;var t=d(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function n(e){var t=s(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return y.prototype=Error.prototype,e.checkPropTypes=Oe,e.PropTypes=e}),Q=e(function(e){if("production"!==process.env.NODE_ENV){var t="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=K(function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},!0)}else e.exports=function(){function e(e,t,r,n,o,a){a!==M&&be(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}var r={array:e.isRequired=e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return r.checkPropTypes=we,r.PropTypes=r}()}),X=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),Z=function(e){function o(e){var t=e.lowPriority,r=e.initial;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return ee.call(n),n.setLoopingFunctions(t),n.state=r,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,G),X(o,[{key:"componentDidMount",value:function(){this.watch()}},{key:"componentDidUpdate",value:function(e){var t=e.lowPriority,r=this.props.lowPriority;r!==t&&(this.stop(),this.setLoopingFunctions(r),this.watch())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"render",value:function(){return this.props.render(this.state)}}]),o}(),ee=function(){var i=this;this.setLoopingFunctions=function(e){var t=e&&window.requestIdleCallback||window.requestAnimationFrame,r=e&&window.cancelIdleCallback||window.cancelAnimationFrame;i.observe=t.bind(window),i.kill=r.bind(window)},this.watch=function(){i.observer=i.observe(i.deriveUpdatesByObserving)},this.stop=function(){i.observer&&(i.kill(i.observer),i.observer=null)},this.deriveUpdatesByObserving=function(){var e=i.props,t=e.observe,r=e.interval,n=t(i.state);if(!n)return r?window.setTimeout(i.watch,r):i.watch();var o=Object.keys(i.state),a=Object.keys(n);return(o.length!==a.length||o.some(function(e){return i.state[e]!==n[e]})||a.some(function(e){return n[e]!==i.state[e]}))&&i.setState(n),r?window.setTimeout(i.watch,r):i.watch()}};return Z.propTypes={observe:Q.func.isRequired,render:Q.func.isRequired,lowPriority:Q.bool,interval:Q.number,initial:Q.object},Z.defaultProps={lowPriority:!1,initial:{},interval:null},Z});