!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactChatView=e(require("react")):t.ReactChatView=e(t.React)}(this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,r){(function(t,r){function n(t,e){return t.set(e[0],e[1]),t}function o(t,e){return t.add(e),t}function i(t,e){for(var r=-1,n=t?t.length:0;++r-1}function S(t,e){var r=this.__data__,n=C(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}function x(t){var e=-1,r=t?t.length:0;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=Rt}function Ot(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Tt(t){return!!t&&"object"==typeof t}function St(t){return gt(t)?D(t):Y(t)}function xt(){return[]}function Pt(){return!1}var At=200,Et="__lodash_hash_undefined__",Rt=9007199254740991,It="[object Arguments]",Lt="[object Boolean]",kt="[object Date]",Ht="[object Function]",Ft="[object GeneratorFunction]",Mt="[object Map]",qt="[object Number]",Dt="[object Object]",Ut="[object RegExp]",Ct="[object Set]",$t="[object String]",Nt="[object Symbol]",Wt="[object ArrayBuffer]",Bt="[object DataView]",Vt="[object Float32Array]",zt="[object Float64Array]",Yt="[object Int8Array]",Gt="[object Int16Array]",Xt="[object Int32Array]",Jt="[object Uint8Array]",Kt="[object Uint8ClampedArray]",Qt="[object Uint16Array]",Zt="[object Uint32Array]",te=/[\\^$.*+?()[\]{}|]/g,ee=/\w*$/,re=/^\[object .+?Constructor\]$/,ne=/^(?:0|[1-9]\d*)$/,oe={};oe[It]=oe["[object Array]"]=oe[Wt]=oe[Bt]=oe[Lt]=oe[kt]=oe[Vt]=oe[zt]=oe[Yt]=oe[Gt]=oe[Xt]=oe[Mt]=oe[qt]=oe[Dt]=oe[Ut]=oe[Ct]=oe[$t]=oe[Nt]=oe[Jt]=oe[Kt]=oe[Qt]=oe[Zt]=!0,oe["[object Error]"]=oe[Ht]=oe["[object WeakMap]"]=!1;var ie="object"==typeof t&&t&&t.Object===Object&&t,ce="object"==typeof self&&self&&self.Object===Object&&self,ue=ie||ce||Function("return this")(),ae="object"==typeof e&&e&&!e.nodeType&&e,le=ae&&"object"==typeof r&&r&&!r.nodeType&&r,se=le&&le.exports===ae,fe=Array.prototype,pe=Function.prototype,he=Object.prototype,de=ue["__core-js_shared__"],be=function(){var t=/[^.]+$/.exec(de&&de.keys&&de.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ye=pe.toString,ve=he.hasOwnProperty,_e=he.toString,ge=RegExp("^"+ye.call(ve).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),je=se?ue.Buffer:void 0,me=ue.Symbol,we=ue.Uint8Array,Oe=p(Object.getPrototypeOf,Object),Te=Object.create,Se=he.propertyIsEnumerable,xe=fe.splice,Pe=Object.getOwnPropertySymbols,Ae=je?je.isBuffer:void 0,Ee=p(Object.keys,Object),Re=ut(ue,"DataView"),Ie=ut(ue,"Map"),Le=ut(ue,"Promise"),ke=ut(ue,"Set"),He=ut(ue,"WeakMap"),Fe=ut(Object,"create"),Me=bt(Re),qe=bt(Ie),De=bt(Le),Ue=bt(ke),Ce=bt(He),$e=me?me.prototype:void 0,Ne=$e?$e.valueOf:void 0;d.prototype.clear=b,d.prototype.delete=y,d.prototype.get=v,d.prototype.has=_,d.prototype.set=g,j.prototype.clear=m,j.prototype.delete=w,j.prototype.get=O,j.prototype.has=T,j.prototype.set=S,x.prototype.clear=P,x.prototype.delete=A,x.prototype.get=E,x.prototype.has=R,x.prototype.set=I,L.prototype.clear=k,L.prototype.delete=H,L.prototype.get=F,L.prototype.has=M,L.prototype.set=q;var We=Pe?p(Pe,Object):xt,Be=V;(Re&&Be(new Re(new ArrayBuffer(1)))!=Bt||Ie&&Be(new Ie)!=Mt||Le&&"[object Promise]"!=Be(Le.resolve())||ke&&Be(new ke)!=Ct||He&&"[object WeakMap]"!=Be(new He))&&(Be=function(t){var e=_e.call(t),r=e==Dt?t.constructor:void 0,n=r?bt(r):void 0;if(n)switch(n){case Me:return Bt;case qe:return Mt;case De:return"[object Promise]";case Ue:return Ct;case Ce:return"[object WeakMap]"}return e});var Ve=Array.isArray,ze=Ae||Pt;r.exports=yt}).call(e,r(8),r(9)(t))},function(t,e,r){t.exports=r(6)()},function(e,r){e.exports=t},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var r=0;r=n-o-e},r.rafRequestId=null,r.scrollTop=0,r.scrollHeight=void 0,r.state={isInfiniteLoading:!1},r}return c(e,t),u(e,[{key:"componentDidMount",value:function(){var t=this.props.flipped?this.scrollable.scrollHeight-this.scrollable.clientHeight:0;this.scrollable.scrollTop=t,this.scrollTop=t,d?this.scrollable.addEventListener("scroll",this.onScroll,{passive:!0}):this.rafRequestId=window.requestAnimationFrame(this.pollScroll),"function"==typeof this.props.returnScrollable&&this.props.returnScrollable(this.scrollable)}},{key:"componentDidUpdate",value:function(){this.updateScrollTop()}},{key:"componentWillUnmount",value:function(){this.scrollable.removeEventListener("scroll",this.onScroll,{passive:!0}),window.cancelAnimationFrame(this.rafRequestId)}},{key:"shouldTriggerLoad",value:function(){return this.isPassedThreshold(this.props.flipped,this.props.scrollLoadThreshold,this.scrollable.scrollTop,this.scrollable.scrollHeight,this.scrollable.clientHeight)&&!this.state.isInfiniteLoading&&this.props.shouldTriggerLoad()}},{key:"updateScrollTop",value:function(){var t=this.scrollable.scrollTop+(this.props.flipped?this.scrollable.scrollHeight-(this.scrollHeight||0):0),e=this.scrollHeight?this.scrollHeight-this.scrollable.scrollHeight:0;this.props.flipped&&e>0&&(t+=e),t!==this.scrollable.scrollTop&&(this.scrollable.scrollTop=t),this.scrollTop=this.scrollable.scrollTop,this.scrollHeight=this.scrollable.scrollHeight}},{key:"render",value:function(){var t=this,e=(0,h.default)(this.props.children);this.props.flipped&&!this.props.reversed&&e.reverse();var r=l.default.createElement("div",{ref:function(e){t.loadingSpinner=e}},this.state.isInfiniteLoading?this.props.loadingSpinnerDelegate:null);return l.default.createElement("div",{className:this.props.className,ref:function(e){t.scrollable=e},style:{overflowX:"hidden",overflowY:"auto"}},l.default.createElement("div",{ref:function(e){t.smoothScrollingWrapper=e}},this.props.flipped?r:null,e,this.props.flipped?null:r))}}]),e}(a.Component);y.propTypes={flipped:f.default.bool,reversed:f.default.bool,scrollLoadThreshold:f.default.number,shouldTriggerLoad:f.default.func,onInfiniteLoad:f.default.func.isRequired,loadingSpinnerDelegate:f.default.element,className:f.default.string,children:f.default.node,returnScrollable:f.default.func},e.default=y,y.defaultProps={flipped:!1,scrollLoadThreshold:10,shouldTriggerLoad:function(){return!0},loadingSpinnerDelegate:l.default.createElement("div",null),className:""},t.exports=e.default},function(t,e,r){"use strict";function n(t){return function(){return t}}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(t){return t},t.exports=o},function(t,e,r){"use strict";function n(t,e,r,n,i,c,u,a){if(o(e),!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,i,c,u,a],f=0;l=new Error(e.replace(/%s/g,function(){return s[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var o=function(t){};t.exports=n},function(t,e,r){"use strict";var n=r(4),o=r(5),i=r(7);t.exports=function(){function t(t,e,r,n,c,u){u!==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 e(){return t}t.isRequired=t;var r={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return r.checkPropTypes=n,r.PropTypes=r,r}},function(t,e,r){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}}])});