text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React")):"function"==typeof define&&define.amd?define(["React"],t):"object"==typeof exports?exports.ReactImageMulti=t(require("React")):e.ReactImageMulti=t(e.React)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";function n(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function s(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)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u=function(){function e(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(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(1),d=function(e){return e&&e.__esModule?e:{default:e}}(c),f=r(2),l={},p=function(e){function t(e){o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.srcToArray=function(e){return(Array.isArray(e)?e:[e]).filter(function(e){return e})},r.onLoad=function(){l[r.sourceList[r.state.currentIndex]]=!0,r.i&&r.setState({isLoaded:!0})},r.onError=function(){if(l[r.sourceList[r.state.currentIndex]]=!1,!r.i)return!1;for(var e=r.state.currentIndex+1;e<r.sourceList.length;e++){var t=r.sourceList[e];if(!(t in l)){r.setState({currentIndex:e});break}if(!0===l[t])return r.setState({currentIndex:e,isLoading:!1,isLoaded:!0}),!0;l[t]}if(e===r.sourceList.length)return r.setState({isLoading:!1});r.loadImg()},r.loadImg=function(){r.i=new Image,r.i.src=r.sourceList[r.state.currentIndex],r.props.decode&&r.i.decode?r.i.decode().then(r.onLoad).catch(r.onError):r.i.onload=r.onLoad,r.i.onerror=r.onError},r.unloadImg=function(){delete r.i.onerror,delete r.i.onload,delete r.i.src,delete r.i},r.sourceList=r.srcToArray(r.props.src);for(var n=0;n<r.sourceList.length&&r.sourceList[n]in l;n++)if(!0===l[r.sourceList[n]]){var s;return r.state={currentIndex:n,isLoading:!1,isLoaded:!0},s=!0,i(r,s)}return r.state=r.sourceList.length?{currentIndex:0,isLoading:!0,isLoaded:!1}:{isLoading:!1,isLoaded:!1},r}return s(t,e),u(t,[{key:"componentDidMount",value:function(){this.state.isLoading&&this.loadImg()}},{key:"componentWillUnmount",value:function(){this.i&&this.unloadImg()}},{key:"componentWillReceiveProps",value:function(e){var t=this,r=this.srcToArray(e.src),n=r.filter(function(e){return-1===t.sourceList.indexOf(e)}),o=this.sourceList.filter(function(e){return-1===r.indexOf(e)});if(n.length||o.length){if(this.sourceList=r,!r.length)return this.setState({isLoading:!1,isLoaded:!1});this.setState({currentIndex:0,isLoading:!0,isLoaded:!1},this.loadImg)}}},{key:"render",value:function(){if(this.state.isLoaded){var e=this.props,t=(e.src,e.loader,e.unloader,e.decode,n(e,["src","loader","unloader","decode"]));return d.default.createElement("img",a({src:this.sourceList[this.state.currentIndex]},t))}return!this.state.isLoaded&&this.state.isLoading?this.props.loader?this.props.loader:null:this.state.isLoaded||this.state.isLoading?void 0:this.props.unloader?this.props.unloader:null}}]),t}(c.Component);p.propTypes={loader:f.node,unloader:f.node,decode:f.bool,src:(0,f.oneOfType)([f.string,f.array])},p.defaultProps={loader:!1,unloader:!1,decode:!0,src:[]},t.default=p},function(t,r){t.exports=e},function(e,t,r){e.exports=r(3)()},function(e,t,r){"use strict";var n=r(4),o=r(5),i=r(6);e.exports=function(){function e(e,t,r,n,s,a){a!==i&&o(!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}e.isRequired=e;var r={array: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=n,r.PropTypes=r,r}},function(e,t,r){"use strict";function n(e){return function(){return e}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,r){"use strict";function n(e,t,r,n,i,s,a,u){if(o(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 d=[r,n,i,s,a,u],f=0;c=new Error(t.replace(/%s/g,function(){return d[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(e){};e.exports=n},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}])});