{"version":3,"sources":["node_modules\\animated\\lib\\DecayAnimation.js"],"names":["_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","Constructor","protoProps","staticProps","prototype","_classCallCheck","instance","TypeError","_possibleConstructorReturn","self","call","ReferenceError","_inherits","subClass","superClass","create","constructor","value","setPrototypeOf","__proto__","Animation","require","RequestAnimationFrame","CancelAnimationFrame","DecayAnimation","_Animation","config","_this","getPrototypeOf","_deceleration","deceleration","undefined","_velocity","velocity","__isInteraction","isInteraction","start","fromValue","onUpdate","onEnd","__active","_lastValue","_fromValue","_onUpdate","__onEnd","_startTime","Date","now","_animationFrame","current","bind","Math","exp","abs","__debouncedOnEnd","finished","stop","module","exports"],"mappings":";;;;;;;;;;AAUA,aAAa,GAAIA,cAAa,UAAU,CAAC,QAASC,iBAAT,CAA0BC,MAA1B,CAAiCC,KAAjC,CAAuC,CAAC,IAAI,GAAIC,GAAE,CAAV,CAAYA,EAAED,MAAME,MAApB,CAA2BD,GAA3B,CAA+B,CAAC,GAAIE,YAAWH,MAAMC,CAAN,CAAf,CAAwBE,WAAWC,UAAX,CAAsBD,WAAWC,UAAX,EAAuB,KAA7C,CAAmDD,WAAWE,YAAX,CAAwB,IAAxB,CAA6B,GAAG,SAAUF,WAAb,CAAwBA,WAAWG,QAAX,CAAoB,IAApB,CAAyBC,OAAOC,cAAP,CAAsBT,MAAtB,CAA6BI,WAAWM,GAAxC,CAA4CN,UAA5C,EAAyD,CAAC,OAAO,UAASO,WAAT,CAAqBC,UAArB,CAAgCC,WAAhC,CAA4C,CAAC,GAAGD,UAAH,CAAcb,iBAAiBY,YAAYG,SAA7B,CAAuCF,UAAvC,EAAmD,GAAGC,WAAH,CAAed,iBAAiBY,WAAjB,CAA6BE,WAA7B,EAA0C,MAAOF,YAAP,CAAoB,CAAlM,CAAoM,CAA1e,EAAjB,CAA8f,QAASI,gBAAT,CAAyBC,QAAzB,CAAkCL,WAAlC,CAA8C,CAAC,GAAG,EAAEK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BAAL,CAAsB,CAACC,SAAS,IAAV,CAAtB;AACA;AACC;;AAED,KAAKd,UAAL,CAAgBxB,KAAhB;AACA,GAAG,KAAKuB,QAAR,CAAiB;AACjB,KAAKQ,eAAL,CAAqB1B,sBAAsB2B,OAAtB,CAA8B,KAAKX,QAAL,CAAcY,IAAd,CAAmB,IAAnB,CAA9B,CAArB;AACC;AACA,CApBE,CAd0B,CAkC1B,CAAClD,IAAI,MAAL,CAAYiB,MAAM,QAASuC,KAAT;;AAErB;AACA,KAAKhB,QAAL,CAAc,KAAd;AACAjB,qBAAqB0B,OAArB,CAA6B,KAAKD,eAAlC;AACA,KAAKM,gBAAL,CAAsB,CAACC,SAAS,KAAV,CAAtB;AACC,CANE,CAlC0B,CAA5B,EAwCI,MAAO/B,eAAP,CAAuB,CAxDb,CAwDcJ,SAxDd,CATuD;;;AAoEtEqC,OAAOC,OAAP,CAAelC,cAAf","file":"DecayAnimation.js","sourceRoot":"d:/Work/Office/react-native-on-web/cli/tmpl/project","sourcesContent":["\n\n\n\n\n\n\n\n\n\n'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if(\"value\"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError(\"Cannot call a class as a function\");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");}return call&&(typeof call===\"object\"||typeof call===\"function\")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!==\"function\"&&superClass!==null){throw new TypeError(\"Super expression must either be null or a function, not \"+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}\n\nvar Animation=require('./Animation');\nvar RequestAnimationFrame=require('./injectable/RequestAnimationFrame');\nvar CancelAnimationFrame=require('./injectable/CancelAnimationFrame');var\n\n\n\n\n\n\n\n\nDecayAnimation=function(_Animation){_inherits(DecayAnimation,_Animation);\n\n\n\n\n\n\n\n\nfunction DecayAnimation(\nconfig)\n{_classCallCheck(this,DecayAnimation);var _this=_possibleConstructorReturn(this,(DecayAnimation.__proto__||Object.getPrototypeOf(DecayAnimation)).call(this));\n\n_this._deceleration=config.deceleration!==undefined?config.deceleration:0.998;\n_this._velocity=config.velocity;\n_this.__isInteraction=config.isInteraction!==undefined?config.isInteraction:true;return _this;\n}_createClass(DecayAnimation,[{key:'start',value:function start(\n\n\nfromValue,\nonUpdate,\nonEnd)\n{\nthis.__active=true;\nthis._lastValue=fromValue;\nthis._fromValue=fromValue;\nthis._onUpdate=onUpdate;\nthis.__onEnd=onEnd;\nthis._startTime=Date.now();\nthis._animationFrame=RequestAnimationFrame.current(this.onUpdate.bind(this));\n}},{key:'onUpdate',value:function onUpdate()\n\n{\nvar now=Date.now();\n\nvar value=this._fromValue+\nthis._velocity/(1-this._deceleration)*(\n1-Math.exp(-(1-this._deceleration)*(now-this._startTime)));\n\nthis._onUpdate(value);\n\nif(Math.abs(this._lastValue-value)<0.1){\nthis.__debouncedOnEnd({finished:true});\nreturn;\n}\n\nthis._lastValue=value;\nif(this.__active){\nthis._animationFrame=RequestAnimationFrame.current(this.onUpdate.bind(this));\n}\n}},{key:'stop',value:function stop()\n\n{\nthis.__active=false;\nCancelAnimationFrame.current(this._animationFrame);\nthis.__debouncedOnEnd({finished:false});\n}}]);return DecayAnimation;}(Animation);\n\n\nmodule.exports=DecayAnimation;"]}