{"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 AnimatedValue from \"../nodes/AnimatedValue\";\nimport AnimatedValueXY from \"../nodes/AnimatedValueXY\";\nimport AnimatedInterpolation from \"../nodes/AnimatedInterpolation\";\nimport Animation from \"./Animation\";\nimport { shouldUseNativeDriver } from \"../NativeAnimatedHelper\";\nimport Easing from \"../../../../exports/Easing\";\n\nvar _easeInOut;\n\nfunction easeInOut() {\n  if (!_easeInOut) {\n    _easeInOut = Easing.inOut(Easing.ease);\n  }\n\n  return _easeInOut;\n}\n\nvar TimingAnimation = function (_Animation) {\n  _inheritsLoose(TimingAnimation, _Animation);\n\n  function TimingAnimation(config) {\n    var _config$easing, _config$duration, _config$delay, _config$iterations, _config$isInteraction;\n\n    var _this;\n\n    _this = _Animation.call(this) || this;\n    _this._toValue = config.toValue;\n    _this._easing = (_config$easing = config.easing) !== null && _config$easing !== void 0 ? _config$easing : easeInOut();\n    _this._duration = (_config$duration = config.duration) !== null && _config$duration !== void 0 ? _config$duration : 500;\n    _this._delay = (_config$delay = config.delay) !== null && _config$delay !== void 0 ? _config$delay : 0;\n    _this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;\n    _this._useNativeDriver = shouldUseNativeDriver(config);\n    _this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !_this._useNativeDriver;\n    return _this;\n  }\n\n  var _proto = TimingAnimation.prototype;\n\n  _proto.__getNativeAnimationConfig = function __getNativeAnimationConfig() {\n    var frameDuration = 1000.0 / 60.0;\n    var frames = [];\n    var numFrames = Math.round(this._duration / frameDuration);\n\n    for (var frame = 0; frame < numFrames; frame++) {\n      frames.push(this._easing(frame / numFrames));\n    }\n\n    frames.push(this._easing(1));\n    return {\n      type: 'frames',\n      frames: frames,\n      toValue: this._toValue,\n      iterations: this.__iterations\n    };\n  };\n\n  _proto.start = function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {\n    var _this2 = this;\n\n    this.__active = true;\n    this._fromValue = fromValue;\n    this._onUpdate = onUpdate;\n    this.__onEnd = onEnd;\n\n    var start = function start() {\n      if (_this2._duration === 0 && !_this2._useNativeDriver) {\n        _this2._onUpdate(_this2._toValue);\n\n        _this2.__debouncedOnEnd({\n          finished: true\n        });\n      } else {\n        _this2._startTime = Date.now();\n\n        if (_this2._useNativeDriver) {\n          _this2.__startNativeAnimation(animatedValue);\n        } else {\n          _this2._animationFrame = requestAnimationFrame(_this2.onUpdate.bind(_this2));\n        }\n      }\n    };\n\n    if (this._delay) {\n      this._timeout = setTimeout(start, this._delay);\n    } else {\n      start();\n    }\n  };\n\n  _proto.onUpdate = function onUpdate() {\n    var now = Date.now();\n\n    if (now >= this._startTime + this._duration) {\n      if (this._duration === 0) {\n        this._onUpdate(this._toValue);\n      } else {\n        this._onUpdate(this._fromValue + this._easing(1) * (this._toValue - this._fromValue));\n      }\n\n      this.__debouncedOnEnd({\n        finished: true\n      });\n\n      return;\n    }\n\n    this._onUpdate(this._fromValue + this._easing((now - this._startTime) / this._duration) * (this._toValue - this._fromValue));\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    clearTimeout(this._timeout);\n    global.cancelAnimationFrame(this._animationFrame);\n\n    this.__debouncedOnEnd({\n      finished: false\n    });\n  };\n\n  return TimingAnimation;\n}(Animation);\n\nexport default TimingAnimation;","map":{"version":3,"sources":["/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/example/node_modules/react-native-web/dist/vendor/react-native/Animated/animations/TimingAnimation.js"],"names":["_inheritsLoose","subClass","superClass","prototype","Object","create","constructor","_setPrototypeOf","o","p","setPrototypeOf","__proto__","AnimatedValue","AnimatedValueXY","AnimatedInterpolation","Animation","shouldUseNativeDriver","Easing","_easeInOut","easeInOut","inOut","ease","TimingAnimation","_Animation","config","_config$easing","_config$duration","_config$delay","_config$iterations","_config$isInteraction","_this","call","_toValue","toValue","_easing","easing","_duration","duration","_delay","delay","__iterations","iterations","_useNativeDriver","__isInteraction","isInteraction","_proto","__getNativeAnimationConfig","frameDuration","frames","numFrames","Math","round","frame","push","type","start","fromValue","onUpdate","onEnd","previousAnimation","animatedValue","_this2","__active","_fromValue","_onUpdate","__onEnd","__debouncedOnEnd","finished","_startTime","Date","now","__startNativeAnimation","_animationFrame","requestAnimationFrame","bind","_timeout","setTimeout","stop","clearTimeout","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,CAAyBC,CAAzB,EAA4BC,CAA5B,EAA+B;AAAEF,EAAAA,eAAe,GAAGH,MAAM,CAACM,cAAP,IAAyB,SAASH,eAAT,CAAyBC,CAAzB,EAA4BC,CAA5B,EAA+B;AAAED,IAAAA,CAAC,CAACG,SAAF,GAAcF,CAAd;AAAiB,WAAOD,CAAP;AAAW,GAAxG;;AAA0G,SAAOD,eAAe,CAACC,CAAD,EAAIC,CAAJ,CAAtB;AAA+B;;AAE1K,OAAOG,aAAP;AACA,OAAOC,eAAP;AACA,OAAOC,qBAAP;AACA,OA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,QAAL,GAAgB,KAAK+B,UAAxC,CAAjC;AACD;;AAED,WAAKG,gBAAL,CAAsB;AACpBC,QAAAA,QAAQ,EAAE;AADU,OAAtB;;AAIA;AACD;;AAED,SAAKH,SAAL,CAAe,KAAKD,UAAL,GAAkB,KAAK7B,OAAL,CAAa,CAACoC,GAAG,GAAG,KAAKF,UAAZ,IAA0B,KAAKhC,SAA5C,KAA0D,KAAKJ,QAAL,GAAgB,KAAK+B,UAA/E,CAAjC;;AAEA,QAAI,KAAKD,QAAT,EAAmB;AACjB,WAAKU,eAAL,GAAuBC,qBAAqB,CAAC,KAAKhB,QAAL,CAAciB,IAAd,CAAmB,IAAnB,CAAD,CAA5C;AACD;AACF,GAtBD;;AAwBA7B,EAAAA,MAAM,CAACgC,IAAP,GAAc,SAASA,IAAT,GAAgB;AAC5BtD,IAAAA,UAAU,CAACpB,SAAX,CAAqB0E,IAArB,CAA0B9C,IAA1B,CAA+B,IAA/B;;AAEA,SAAK+B,QAAL,GAAgB,KAAhB;AACAgB,IAAAA,YAAY,CAAC,KAAKH,QAAN,CAAZ;AACAI,IAAAA,MAAM,CAACC,oBAAP,CAA4B,KAAKR,eAAjC;;AAEA,SAAKN,gBAAL,CAAsB;AACpBC,MAAAA,QAAQ,EAAE;AADU,KAAtB;AAGD,GAVD;;AAYA,SAAO7C,eAAP;AACD,CAhHkC,CAgHjCP,SAhHiC,CAAnC;;AAkHA,eAAeO,eAAf","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 AnimatedValue from '../nodes/AnimatedValue';\nimport AnimatedValueXY from '../nodes/AnimatedValueXY';\nimport AnimatedInterpolation from '../nodes/AnimatedInterpolation';\nimport Animation from './Animation';\nimport { shouldUseNativeDriver } from '../NativeAnimatedHelper';\nimport Easing from '../../../../exports/Easing';\n\nvar _easeInOut;\n\nfunction easeInOut() {\n  if (!_easeInOut) {\n    _easeInOut = Easing.inOut(Easing.ease);\n  }\n\n  return _easeInOut;\n}\n\nvar TimingAnimation = /*#__PURE__*/function (_Animation) {\n  _inheritsLoose(TimingAnimation, _Animation);\n\n  function TimingAnimation(config) {\n    var _config$easing, _config$duration, _config$delay, _config$iterations, _config$isInteraction;\n\n    var _this;\n\n    _this = _Animation.call(this) || this;\n    _this._toValue = config.toValue;\n    _this._easing = (_config$easing = config.easing) !== null && _config$easing !== void 0 ? _config$easing : easeInOut();\n    _this._duration = (_config$duration = config.duration) !== null && _config$duration !== void 0 ? _config$duration : 500;\n    _this._delay = (_config$delay = config.delay) !== null && _config$delay !== void 0 ? _config$delay : 0;\n    _this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;\n    _this._useNativeDriver = shouldUseNativeDriver(config);\n    _this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !_this._useNativeDriver;\n    return _this;\n  }\n\n  var _proto = TimingAnimation.prototype;\n\n  _proto.__getNativeAnimationConfig = function __getNativeAnimationConfig() {\n    var frameDuration = 1000.0 / 60.0;\n    var frames = [];\n    var numFrames = Math.round(this._duration / frameDuration);\n\n    for (var frame = 0; frame < numFrames; frame++) {\n      frames.push(this._easing(frame / numFrames));\n    }\n\n    frames.push(this._easing(1));\n    return {\n      type: 'frames',\n      frames: frames,\n      toValue: this._toValue,\n      iterations: this.__iterations\n    };\n  };\n\n  _proto.start = function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {\n    var _this2 = this;\n\n    this.__active = true;\n    this._fromValue = fromValue;\n    this._onUpdate = onUpdate;\n    this.__onEnd = onEnd;\n\n    var start = function start() {\n      // Animations that sometimes have 0 duration and sometimes do not\n      // still need to use the native driver when duration is 0 so as to\n      // not cause intermixed JS and native animations.\n      if (_this2._duration === 0 && !_this2._useNativeDriver) {\n        _this2._onUpdate(_this2._toValue);\n\n        _this2.__debouncedOnEnd({\n          finished: true\n        });\n      } else {\n        _this2._startTime = Date.now();\n\n        if (_this2._useNativeDriver) {\n          _this2.__startNativeAnimation(animatedValue);\n        } else {\n          _this2._animationFrame = requestAnimationFrame(_this2.onUpdate.bind(_this2));\n        }\n      }\n    };\n\n    if (this._delay) {\n      this._timeout = setTimeout(start, this._delay);\n    } else {\n      start();\n    }\n  };\n\n  _proto.onUpdate = function onUpdate() {\n    var now = Date.now();\n\n    if (now >= this._startTime + this._duration) {\n      if (this._duration === 0) {\n        this._onUpdate(this._toValue);\n      } else {\n        this._onUpdate(this._fromValue + this._easing(1) * (this._toValue - this._fromValue));\n      }\n\n      this.__debouncedOnEnd({\n        finished: true\n      });\n\n      return;\n    }\n\n    this._onUpdate(this._fromValue + this._easing((now - this._startTime) / this._duration) * (this._toValue - this._fromValue));\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    clearTimeout(this._timeout);\n    global.cancelAnimationFrame(this._animationFrame);\n\n    this.__debouncedOnEnd({\n      finished: false\n    });\n  };\n\n  return TimingAnimation;\n}(Animation);\n\nexport default TimingAnimation;"]},"metadata":{},"sourceType":"module"}