{"dependencies":[{"name":"@babel/runtime/helpers/interopRequireDefault","data":{"asyncType":null,"isESMImport":false,"locs":[],"key":"kslwqCIsh6ew+I1KeA1rlVRjsAk=","exportNames":["*"]}},{"name":"./Animation","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":13,"column":0,"index":225},"end":{"line":13,"column":36,"index":261}}],"key":"IpfQWRKePvRqyvs8Q+vGFqyieVw=","exportNames":["*"]}},{"name":"../NativeAnimatedHelper","data":{"asyncType":null,"isESMImport":true,"locs":[{"start":{"line":14,"column":0,"index":262},"end":{"line":14,"column":64,"index":326}}],"key":"7+Fs6fvkAbHB0IU2p+AMhuguGZA=","exportNames":["*"]}}],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n /**\n * Copyright (c) Meta Platforms, Inc. and 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\n 'use strict';\n\n var _interopRequireDefault = require(_dependencyMap[0], \"@babel/runtime/helpers/interopRequireDefault\");\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n var _Animation = _interopRequireDefault(require(_dependencyMap[1], \"./Animation\"));\n var _NativeAnimatedHelper = require(_dependencyMap[2], \"../NativeAnimatedHelper\");\n class DecayAnimation extends _Animation.default {\n constructor(config) {\n var _config$deceleration, _config$isInteraction, _config$iterations;\n super();\n this._deceleration = (_config$deceleration = config.deceleration) !== null && _config$deceleration !== void 0 ? _config$deceleration : 0.998;\n this._velocity = config.velocity;\n this._useNativeDriver = (0, _NativeAnimatedHelper.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 }\n __getNativeAnimationConfig() {\n return {\n type: 'decay',\n deceleration: this._deceleration,\n velocity: this._velocity,\n iterations: this.__iterations\n };\n }\n 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 if (this._useNativeDriver) {\n this.__startNativeAnimation(animatedValue);\n } else {\n this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n }\n }\n 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 this._onUpdate(value);\n if (Math.abs(this._lastValue - value) < 0.1) {\n this.__debouncedOnEnd({\n finished: true\n });\n return;\n }\n this._lastValue = value;\n if (this.__active) {\n this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n }\n }\n stop() {\n super.stop();\n this.__active = false;\n global.cancelAnimationFrame(this._animationFrame);\n this.__debouncedOnEnd({\n finished: false\n });\n }\n }\n var _default = exports.default = DecayAnimation;\n});","lineCount":77,"map":[[2,2,1,0],[3,0,2,0],[4,0,3,0],[5,0,4,0],[6,0,5,0],[7,0,6,0],[8,0,7,0],[9,0,8,0],[10,0,9,0],[12,2,11,0],[12,14,11,12],[14,2,11,13],[14,6,11,13,"_interopRequireDefault"],[14,28,11,13],[14,31,11,13,"require"],[14,38,11,13],[14,39,11,13,"_dependencyMap"],[14,53,11,13],[15,2,11,13,"Object"],[15,8,11,13],[15,9,11,13,"defineProperty"],[15,23,11,13],[15,24,11,13,"exports"],[15,31,11,13],[16,4,11,13,"value"],[16,9,11,13],[17,2,11,13],[18,2,11,13,"exports"],[18,9,11,13],[18,10,11,13,"default"],[18,17,11,13],[19,2,13,0],[19,6,13,0,"_Animation"],[19,16,13,0],[19,19,13,0,"_interopRequireDefault"],[19,41,13,0],[19,42,13,0,"require"],[19,49,13,0],[19,50,13,0,"_dependencyMap"],[19,64,13,0],[20,2,14,0],[20,6,14,0,"_NativeAnimatedHelper"],[20,27,14,0],[20,30,14,0,"require"],[20,37,14,0],[20,38,14,0,"_dependencyMap"],[20,52,14,0],[21,2,15,0],[21,8,15,6,"DecayAnimation"],[21,22,15,20],[21,31,15,29,"Animation"],[21,49,15,38],[21,50,15,39],[22,4,16,2,"constructor"],[22,15,16,13,"constructor"],[22,16,16,14,"config"],[22,22,16,20],[22,24,16,22],[23,6,17,4],[23,10,17,8,"_config$deceleration"],[23,30,17,28],[23,32,17,30,"_config$isInteraction"],[23,53,17,51],[23,55,17,53,"_config$iterations"],[23,73,17,71],[24,6,18,4],[24,11,18,9],[24,12,18,10],[24,13,18,11],[25,6,19,4],[25,10,19,8],[25,11,19,9,"_deceleration"],[25,24,19,22],[25,27,19,25],[25,28,19,26,"_config$deceleration"],[25,48,19,46],[25,51,19,49,"config"],[25,57,19,55],[25,58,19,56,"deceleration"],[25,70,19,68],[25,76,19,74],[25,80,19,78],[25,84,19,82,"_config$deceleration"],[25,104,19,102],[25,109,19,107],[25,114,19,112],[25,115,19,113],[25,118,19,116,"_config$deceleration"],[25,138,19,136],[25,141,19,139],[25,146,19,144],[26,6,20,4],[26,10,20,8],[26,11,20,9,"_velocity"],[26,20,20,18],[26,23,20,21,"config"],[26,29,20,27],[26,30,20,28,"velocity"],[26,38,20,36],[27,6,21,4],[27,10,21,8],[27,11,21,9,"_useNativeDriver"],[27,27,21,25],[27,30,21,28],[27,34,21,28,"shouldUseNativeDriver"],[27,77,21,49],[27,79,21,50,"config"],[27,85,21,56],[27,86,21,57],[28,6,22,4],[28,10,22,8],[28,11,22,9,"__isInteraction"],[28,26,22,24],[28,29,22,27],[28,30,22,28,"_config$isInteraction"],[28,51,22,49],[28,54,22,52,"config"],[28,60,22,58],[28,61,22,59,"isInteraction"],[28,74,22,72],[28,80,22,78],[28,84,22,82],[28,88,22,86,"_config$isInteraction"],[28,109,22,107],[28,114,22,112],[28,119,22,117],[28,120,22,118],[28,123,22,121,"_config$isInteraction"],[28,144,22,142],[28,147,22,145],[28,148,22,146],[28,152,22,150],[28,153,22,151,"_useNativeDriver"],[28,169,22,167],[29,6,23,4],[29,10,23,8],[29,11,23,9,"__iterations"],[29,23,23,21],[29,26,23,24],[29,27,23,25,"_config$iterations"],[29,45,23,43],[29,48,23,46,"config"],[29,54,23,52],[29,55,23,53,"iterations"],[29,65,23,63],[29,71,23,69],[29,75,23,73],[29,79,23,77,"_config$iterations"],[29,97,23,95],[29,102,23,100],[29,107,23,105],[29,108,23,106],[29,111,23,109,"_config$iterations"],[29,129,23,127],[29,132,23,130],[29,133,23,131],[30,4,24,2],[31,4,25,2,"__getNativeAnimationConfig"],[31,30,25,28,"__getNativeAnimationConfig"],[31,31,25,28],[31,33,25,31],[32,6,26,4],[32,13,26,11],[33,8,27,6,"type"],[33,12,27,10],[33,14,27,12],[33,21,27,19],[34,8,28,6,"deceleration"],[34,20,28,18],[34,22,28,20],[34,26,28,24],[34,27,28,25,"_deceleration"],[34,40,28,38],[35,8,29,6,"velocity"],[35,16,29,14],[35,18,29,16],[35,22,29,20],[35,23,29,21,"_velocity"],[35,32,29,30],[36,8,30,6,"iterations"],[36,18,30,16],[36,20,30,18],[36,24,30,22],[36,25,30,23,"__iterations"],[37,6,31,4],[37,7,31,5],[38,4,32,2],[39,4,33,2,"start"],[39,9,33,7,"start"],[39,10,33,8,"fromValue"],[39,19,33,17],[39,21,33,19,"onUpdate"],[39,29,33,27],[39,31,33,29,"onEnd"],[39,36,33,34],[39,38,33,36,"previousAnimation"],[39,55,33,53],[39,57,33,55,"animatedValue"],[39,70,33,68],[39,72,33,70],[40,6,34,4],[40,10,34,8],[40,11,34,9,"__active"],[40,19,34,17],[40,22,34,20],[40,26,34,24],[41,6,35,4],[41,10,35,8],[41,11,35,9,"_lastValue"],[41,21,35,19],[41,24,35,22,"fromValue"],[41,33,35,31],[42,6,36,4],[42,10,36,8],[42,11,36,9,"_fromValue"],[42,21,36,19],[42,24,36,22,"fromValue"],[42,33,36,31],[43,6,37,4],[43,10,37,8],[43,11,37,9,"_onUpdate"],[43,20,37,18],[43,23,37,21,"onUpdate"],[43,31,37,29],[44,6,38,4],[44,10,38,8],[44,11,38,9,"__onEnd"],[44,18,38,16],[44,21,38,19,"onEnd"],[44,26,38,24],[45,6,39,4],[45,10,39,8],[45,11,39,9,"_startTime"],[45,21,39,19],[45,24,39,22,"Date"],[45,28,39,26],[45,29,39,27,"now"],[45,32,39,30],[45,33,39,31],[45,34,39,32],[46,6,40,4],[46,10,40,8],[46,14,40,12],[46,15,40,13,"_useNativeDriver"],[46,31,40,29],[46,33,40,31],[47,8,41,6],[47,12,41,10],[47,13,41,11,"__startNativeAnimation"],[47,35,41,33],[47,36,41,34,"animatedValue"],[47,49,41,47],[47,50,41,48],[48,6,42,4],[48,7,42,5],[48,13,42,11],[49,8,43,6],[49,12,43,10],[49,13,43,11,"_animationFrame"],[49,28,43,26],[49,31,43,29,"requestAnimationFrame"],[49,52,43,50],[49,53,43,51],[49,57,43,55],[49,58,43,56,"onUpdate"],[49,66,43,64],[49,67,43,65,"bind"],[49,71,43,69],[49,72,43,70],[49,76,43,74],[49,77,43,75],[49,78,43,76],[50,6,44,4],[51,4,45,2],[52,4,46,2,"onUpdate"],[52,12,46,10,"onUpdate"],[52,13,46,10],[52,15,46,13],[53,6,47,4],[53,10,47,8,"now"],[53,13,47,11],[53,16,47,14,"Date"],[53,20,47,18],[53,21,47,19,"now"],[53,24,47,22],[53,25,47,23],[53,26,47,24],[54,6,48,4],[54,10,48,8,"value"],[54,15,48,13],[54,18,48,16],[54,22,48,20],[54,23,48,21,"_fromValue"],[54,33,48,31],[54,36,48,34],[54,40,48,38],[54,41,48,39,"_velocity"],[54,50,48,48],[54,54,48,52],[54,55,48,53],[54,58,48,56],[54,62,48,60],[54,63,48,61,"_deceleration"],[54,76,48,74],[54,77,48,75],[54,81,48,79],[54,82,48,80],[54,85,48,83,"Math"],[54,89,48,87],[54,90,48,88,"exp"],[54,93,48,91],[54,94,48,92],[54,96,48,94],[54,97,48,95],[54,100,48,98],[54,104,48,102],[54,105,48,103,"_deceleration"],[54,118,48,116],[54,119,48,117],[54,123,48,121,"now"],[54,126,48,124],[54,129,48,127],[54,133,48,131],[54,134,48,132,"_startTime"],[54,144,48,142],[54,145,48,143],[54,146,48,144],[54,147,48,145],[55,6,49,4],[55,10,49,8],[55,11,49,9,"_onUpdate"],[55,20,49,18],[55,21,49,19,"value"],[55,26,49,24],[55,27,49,25],[56,6,50,4],[56,10,50,8,"Math"],[56,14,50,12],[56,15,50,13,"abs"],[56,18,50,16],[56,19,50,17],[56,23,50,21],[56,24,50,22,"_lastValue"],[56,34,50,32],[56,37,50,35,"value"],[56,42,50,40],[56,43,50,41],[56,46,50,44],[56,49,50,47],[56,51,50,49],[57,8,51,6],[57,12,51,10],[57,13,51,11,"__debouncedOnEnd"],[57,29,51,27],[57,30,51,28],[58,10,52,8,"finished"],[58,18,52,16],[58,20,52,18],[59,8,53,6],[59,9,53,7],[59,10,53,8],[60,8,54,6],[61,6,55,4],[62,6,56,4],[62,10,56,8],[62,11,56,9,"_lastValue"],[62,21,56,19],[62,24,56,22,"value"],[62,29,56,27],[63,6,57,4],[63,10,57,8],[63,14,57,12],[63,15,57,13,"__active"],[63,23,57,21],[63,25,57,23],[64,8,58,6],[64,12,58,10],[64,13,58,11,"_animationFrame"],[64,28,58,26],[64,31,58,29,"requestAnimationFrame"],[64,52,58,50],[64,53,58,51],[64,57,58,55],[64,58,58,56,"onUpdate"],[64,66,58,64],[64,67,58,65,"bind"],[64,71,58,69],[64,72,58,70],[64,76,58,74],[64,77,58,75],[64,78,58,76],[65,6,59,4],[66,4,60,2],[67,4,61,2,"stop"],[67,8,61,6,"stop"],[67,9,61,6],[67,11,61,9],[68,6,62,4],[68,11,62,9],[68,12,62,10,"stop"],[68,16,62,14],[68,17,62,15],[68,18,62,16],[69,6,63,4],[69,10,63,8],[69,11,63,9,"__active"],[69,19,63,17],[69,22,63,20],[69,27,63,25],[70,6,64,4,"global"],[70,12,64,10],[70,13,64,11,"cancelAnimationFrame"],[70,33,64,31],[70,34,64,32],[70,38,64,36],[70,39,64,37,"_animationFrame"],[70,54,64,52],[70,55,64,53],[71,6,65,4],[71,10,65,8],[71,11,65,9,"__debouncedOnEnd"],[71,27,65,25],[71,28,65,26],[72,8,66,6,"finished"],[72,16,66,14],[72,18,66,16],[73,6,67,4],[73,7,67,5],[73,8,67,6],[74,4,68,2],[75,2,69,0],[76,2,69,1],[76,6,69,1,"_default"],[76,14,69,1],[76,17,69,1,"exports"],[76,24,69,1],[76,25,69,1,"default"],[76,32,69,1],[76,35,70,15,"DecayAnimation"],[76,49,70,29],[77,0,70,29],[77,3]],"functionMap":{"names":["","DecayAnimation","constructor","__getNativeAnimationConfig","start","onUpdate","stop"],"mappings":"AAA;ACc;ECC;GDQ;EEC;GFO;EGC;GHY;EIC;GJc;EKC;GLO;CDC"}},"type":"js/module"}]}