{"ast":null,"code":"'use strict';\n\nfunction _inheritsLoose(subClass, superClass) {\n  subClass.prototype = Object.create(superClass.prototype);\n  subClass.prototype.constructor = subClass;\n\n  _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n  _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n    o.__proto__ = p;\n    return o;\n  };\n\n  return _setPrototypeOf(o, p);\n}\n\nimport Animation from \"./Animation\";\nimport { shouldUseNativeDriver } from \"../NativeAnimatedHelper\";\n\nvar DecayAnimation = function (_Animation) {\n  _inheritsLoose(DecayAnimation, _Animation);\n\n  function DecayAnimation(config) {\n    var _config$deceleration, _config$isInteraction, _config$iterations;\n\n    var _this;\n\n    _this = _Animation.call(this) || this;\n    _this._deceleration = (_config$deceleration = config.deceleration) !== null && _config$deceleration !== void 0 ? _config$deceleration : 0.998;\n    _this._velocity = config.velocity;\n    _this._useNativeDriver = shouldUseNativeDriver(config);\n    _this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !_this._useNativeDriver;\n    _this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;\n    return _this;\n  }\n\n  var _proto = DecayAnimation.prototype;\n\n  _proto.__getNativeAnimationConfig = function __getNativeAnimationConfig() {\n    return {\n      type: 'decay',\n      deceleration: this._deceleration,\n      velocity: this._velocity,\n      iterations: this.__iterations\n    };\n  };\n\n  _proto.start = function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {\n    this.__active = true;\n    this._lastValue = fromValue;\n    this._fromValue = fromValue;\n    this._onUpdate = onUpdate;\n    this.__onEnd = onEnd;\n    this._startTime = Date.now();\n\n    if (this._useNativeDriver) {\n      this.__startNativeAnimation(animatedValue);\n    } else {\n      this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n    }\n  };\n\n  _proto.onUpdate = function onUpdate() {\n    var now = Date.now();\n    var value = this._fromValue + this._velocity / (1 - this._deceleration) * (1 - Math.exp(-(1 - this._deceleration) * (now - this._startTime)));\n\n    this._onUpdate(value);\n\n    if (Math.abs(this._lastValue - value) < 0.1) {\n      this.__debouncedOnEnd({\n        finished: true\n      });\n\n      return;\n    }\n\n    this._lastValue = value;\n\n    if (this.__active) {\n      this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n    }\n  };\n\n  _proto.stop = function stop() {\n    _Animation.prototype.stop.call(this);\n\n    this.__active = false;\n    global.cancelAnimationFrame(this._animationFrame);\n\n    this.__debouncedOnEnd({\n      finished: false\n    });\n  };\n\n  return DecayAnimation;\n}(Animation);\n\nexport default DecayAnimation;","map":{"version":3,"sources":["/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/example/node_modules/react-native-web/dist/vendor/react-native/Animated/animations/DecayAnimation.js"],"names":["_inheritsLoose","subClass","superClass","prototype","Object","create","constructor","_setPrototypeOf","o","p","setPrototypeOf","__proto__","Animation","shouldUseNativeDriver","DecayAnimation","_Animation","config","_config$deceleration","_config$isInteraction","_config$iterations","_this","call","_deceleration","deceleration","_velocity","velocity","_useNativeDriver","__isInteraction","isInteraction","__iterations","iterations","_proto","__getNativeAnimationConfig","type","start","fromValue","onUpdate","onEnd","previousAnimation","animatedValue","__active","_lastValue","_fromValue","_onUpdate","__onEnd","_startTime","Date","now","__startNativeAnimation","_animationFrame","requestAnimationFrame","bind","value","Math","exp","abs","__debouncedOnEnd","finished","stop","global","cancelAnimationFrame"],"mappings":"AASA;;AAEA,SAASA,cAAT,CAAwBC,QAAxB,EAAkCC,UAAlC,EAA8C;AAAED,EAAAA,QAAQ,CAACE,SAAT,GAAqBC,MAAM,CAACC,MAAP,CAAcH,UAAU,CAACC,SAAzB,CAArB;AAA0DF,EAAAA,QAAQ,CAACE,SAAT,CAAmBG,WAAnB,GAAiCL,QAAjC;;AAA2CM,EAAAA,eAAe,CAACN,QAAD,EAAWC,UAAX,CAAf;AAAwC;;AAE7L,SAASK,eAAT,CAAyB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f;;AAEA,QAAIC,IAAI,CAACE,GAAL,CAAS,KAAKd,UAAL,GAAkBW,KAA3B,IAAoC,GAAxC,EAA6C;AAC3C,WAAKI,gBAAL,CAAsB;AACpBC,QAAAA,QAAQ,EAAE;AADU,OAAtB;;AAIA;AACD;;AAED,SAAKhB,UAAL,GAAkBW,KAAlB;;AAEA,QAAI,KAAKZ,QAAT,EAAmB;AACjB,WAAKS,eAAL,GAAuBC,qBAAqB,CAAC,KAAKd,QAAL,CAAce,IAAd,CAAmB,IAAnB,CAAD,CAA5C;AACD;AACF,GAnBD;;AAqBApB,EAAAA,MAAM,CAAC2B,IAAP,GAAc,SAASA,IAAT,GAAgB;AAC5B3C,IAAAA,UAAU,CAACZ,SAAX,CAAqBuD,IAArB,CAA0BrC,IAA1B,CAA+B,IAA/B;;AAEA,SAAKmB,QAAL,GAAgB,KAAhB;AACAmB,IAAAA,MAAM,CAACC,oBAAP,CAA4B,KAAKX,eAAjC;;AAEA,SAAKO,gBAAL,CAAsB;AACpBC,MAAAA,QAAQ,EAAE;AADU,KAAtB;AAGD,GATD;;AAWA,SAAO3C,cAAP;AACD,CA5EiC,CA4EhCF,SA5EgC,CAAlC;;AA8EA,eAAeE,cAAf","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nimport Animation from './Animation';\nimport { shouldUseNativeDriver } from '../NativeAnimatedHelper';\n\nvar DecayAnimation = /*#__PURE__*/function (_Animation) {\n  _inheritsLoose(DecayAnimation, _Animation);\n\n  function DecayAnimation(config) {\n    var _config$deceleration, _config$isInteraction, _config$iterations;\n\n    var _this;\n\n    _this = _Animation.call(this) || this;\n    _this._deceleration = (_config$deceleration = config.deceleration) !== null && _config$deceleration !== void 0 ? _config$deceleration : 0.998;\n    _this._velocity = config.velocity;\n    _this._useNativeDriver = shouldUseNativeDriver(config);\n    _this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !_this._useNativeDriver;\n    _this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;\n    return _this;\n  }\n\n  var _proto = DecayAnimation.prototype;\n\n  _proto.__getNativeAnimationConfig = function __getNativeAnimationConfig() {\n    return {\n      type: 'decay',\n      deceleration: this._deceleration,\n      velocity: this._velocity,\n      iterations: this.__iterations\n    };\n  };\n\n  _proto.start = function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {\n    this.__active = true;\n    this._lastValue = fromValue;\n    this._fromValue = fromValue;\n    this._onUpdate = onUpdate;\n    this.__onEnd = onEnd;\n    this._startTime = Date.now();\n\n    if (this._useNativeDriver) {\n      this.__startNativeAnimation(animatedValue);\n    } else {\n      this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n    }\n  };\n\n  _proto.onUpdate = function onUpdate() {\n    var now = Date.now();\n    var value = this._fromValue + this._velocity / (1 - this._deceleration) * (1 - Math.exp(-(1 - this._deceleration) * (now - this._startTime)));\n\n    this._onUpdate(value);\n\n    if (Math.abs(this._lastValue - value) < 0.1) {\n      this.__debouncedOnEnd({\n        finished: true\n      });\n\n      return;\n    }\n\n    this._lastValue = value;\n\n    if (this.__active) {\n      this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n    }\n  };\n\n  _proto.stop = function stop() {\n    _Animation.prototype.stop.call(this);\n\n    this.__active = false;\n    global.cancelAnimationFrame(this._animationFrame);\n\n    this.__debouncedOnEnd({\n      finished: false\n    });\n  };\n\n  return DecayAnimation;\n}(Animation);\n\nexport default DecayAnimation;"]},"metadata":{},"sourceType":"module"}