{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _extends from \"@babel/runtime/helpers/extends\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport Animated from \"react-native-web/dist/exports/Animated\";\nimport Easing from \"react-native-web/dist/exports/Easing\";\nimport wrapStyleTransforms from \"./wrapStyleTransforms\";\nimport getStyleValues from \"./getStyleValues\";\nimport flattenStyle from \"./flattenStyle\";\nimport createAnimation from \"./createAnimation\";\nimport { getAnimationByName, getAnimationNames } from \"./registry\";\nimport EASING_FUNCTIONS from \"./easing\";\nvar INTERPOLATION_STYLE_PROPERTIES = ['rotate', 'rotateX', 'rotateY', 'rotateZ', 'skewX', 'skewY', 'transformMatrix', 'backgroundColor', 'borderColor', 'borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor', 'shadowColor', 'color', 'textDecorationColor', 'tintColor'];\nvar ZERO_CLAMPED_STYLE_PROPERTIES = ['width', 'height'];\n\nfunction omit(keys, source) {\n  var filtered = {};\n  Object.keys(source).forEach(function (key) {\n    if (keys.indexOf(key) === -1) {\n      filtered[key] = source[key];\n    }\n  });\n  return filtered;\n}\n\nfunction deepEquals(a, b) {\n  return a === b || JSON.stringify(a) === JSON.stringify(b);\n}\n\nfunction getAnimationTarget(iteration, direction) {\n  switch (direction) {\n    case 'reverse':\n      return 0;\n\n    case 'alternate':\n      return iteration % 2 ? 0 : 1;\n\n    case 'alternate-reverse':\n      return iteration % 2 ? 1 : 0;\n\n    case 'normal':\n    default:\n      return 1;\n  }\n}\n\nfunction getAnimationOrigin(iteration, direction) {\n  return getAnimationTarget(iteration, direction) ? 0 : 1;\n}\n\nfunction getCompiledAnimation(animation) {\n  if (typeof animation === 'string') {\n    var compiledAnimation = getAnimationByName(animation);\n\n    if (!compiledAnimation) {\n      throw new Error(\"No animation registred by the name of \" + animation);\n    }\n\n    return compiledAnimation;\n  }\n\n  return createAnimation(animation);\n}\n\nfunction makeInterpolatedStyle(compiledAnimation, animationValue) {\n  var style = {};\n  Object.keys(compiledAnimation).forEach(function (key) {\n    if (key === 'style') {\n      _extends(style, compiledAnimation.style);\n    } else if (key !== 'easing') {\n      style[key] = animationValue.interpolate(compiledAnimation[key]);\n    }\n  });\n  return wrapStyleTransforms(style);\n}\n\nfunction transitionToValue(property, transitionValue, toValue, duration, easing) {\n  var useNativeDriver = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;\n  var delay = arguments.length > 6 ? arguments[6] : undefined;\n  var onTransitionBegin = arguments.length > 7 ? arguments[7] : undefined;\n  var onTransitionEnd = arguments.length > 8 ? arguments[8] : undefined;\n  var animation = duration || easing || delay ? Animated.timing(transitionValue, {\n    toValue: toValue,\n    delay: delay,\n    duration: duration || 1000,\n    easing: typeof easing === 'function' ? easing : EASING_FUNCTIONS[easing || 'ease'],\n    useNativeDriver: useNativeDriver\n  }) : Animated.spring(transitionValue, {\n    toValue: toValue,\n    useNativeDriver: useNativeDriver\n  });\n  setTimeout(function () {\n    return onTransitionBegin(property);\n  }, delay);\n  animation.start(function () {\n    return onTransitionEnd(property);\n  });\n}\n\nexport default function createAnimatableComponent(WrappedComponent) {\n  var _class, _temp;\n\n  var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n  var Animatable = Animated.createAnimatedComponent(WrappedComponent);\n  return _temp = _class = function (_Component) {\n    _inherits(AnimatableComponent, _Component);\n\n    var _super = _createSuper(AnimatableComponent);\n\n    function AnimatableComponent(props) {\n      var _this;\n\n      _classCallCheck(this, AnimatableComponent);\n\n      _this = _super.call(this, props);\n      _this.ref = null;\n\n      _this.handleRef = function (ref) {\n        _this.ref = ref;\n      };\n\n      var animationValue = new Animated.Value(getAnimationOrigin(0, _this.props.direction));\n      var animationStyle = {};\n      var compiledAnimation = {};\n\n      if (props.animation) {\n        compiledAnimation = getCompiledAnimation(props.animation);\n        animationStyle = makeInterpolatedStyle(compiledAnimation, animationValue);\n      }\n\n      _this.state = {\n        animationValue: animationValue,\n        animationStyle: animationStyle,\n        compiledAnimation: compiledAnimation,\n        transitionStyle: {},\n        transitionValues: {},\n        currentTransitionValues: {}\n      };\n\n      if (props.transition) {\n        _this.state = _objectSpread(_objectSpread({}, _this.state), _this.initializeTransitionState(props.transition));\n      }\n\n      _this.delayTimer = null;\n      getAnimationNames().forEach(function (animationName) {\n        if (!(animationName in _assertThisInitialized(_this))) {\n          _this[animationName] = _this.animate.bind(_assertThisInitialized(_this), animationName);\n        }\n      });\n      return _this;\n    }\n\n    _createClass(AnimatableComponent, [{\n      key: \"initializeTransitionState\",\n      value: function initializeTransitionState(transitionKeys) {\n        var transitionValues = {};\n        var styleValues = {};\n        var currentTransitionValues = getStyleValues(transitionKeys, this.props.style);\n        Object.keys(currentTransitionValues).forEach(function (key) {\n          var value = currentTransitionValues[key];\n\n          if (INTERPOLATION_STYLE_PROPERTIES.indexOf(key) !== -1 || typeof value !== 'number') {\n            transitionValues[key] = new Animated.Value(0);\n            styleValues[key] = value;\n          } else {\n            var animationValue = new Animated.Value(value);\n            transitionValues[key] = animationValue;\n            styleValues[key] = animationValue;\n          }\n        });\n        return {\n          currentTransitionValues: currentTransitionValues,\n          transitionStyle: styleValues,\n          transitionValues: transitionValues\n        };\n      }\n    }, {\n      key: \"getTransitionState\",\n      value: function getTransitionState(keys) {\n        var _this2 = this;\n\n        var transitionKeys = typeof keys === 'string' ? [keys] : keys;\n        var _this$state = this.state,\n            transitionValues = _this$state.transitionValues,\n            currentTransitionValues = _this$state.currentTransitionValues,\n            transitionStyle = _this$state.transitionStyle;\n        var missingKeys = transitionKeys.filter(function (key) {\n          return !_this2.state.transitionValues[key];\n        });\n\n        if (missingKeys.length) {\n          var transitionState = this.initializeTransitionState(missingKeys);\n          transitionValues = _objectSpread(_objectSpread({}, transitionValues), transitionState.transitionValues);\n          currentTransitionValues = _objectSpread(_objectSpread({}, currentTransitionValues), transitionState.currentTransitionValues);\n          transitionStyle = _objectSpread(_objectSpread({}, transitionStyle), transitionState.transitionStyle);\n        }\n\n        return {\n          transitionValues: transitionValues,\n          currentTransitionValues: currentTransitionValues,\n          transitionStyle: transitionStyle\n        };\n      }\n    }, {\n      key: \"setNativeProps\",\n      value: function setNativeProps(nativeProps) {\n        if (this.ref) {\n          this.ref.setNativeProps(nativeProps);\n        }\n      }\n    }, {\n      key: \"componentDidMount\",\n      value: function componentDidMount() {\n        var _this3 = this;\n\n        var _this$props = this.props,\n            animation = _this$props.animation,\n            duration = _this$props.duration,\n            delay = _this$props.delay,\n            onAnimationBegin = _this$props.onAnimationBegin,\n            iterationDelay = _this$props.iterationDelay;\n\n        if (animation) {\n          var startAnimation = function startAnimation() {\n            onAnimationBegin();\n\n            _this3.startAnimation(duration, 0, iterationDelay, function (endState) {\n              return _this3.props.onAnimationEnd(endState);\n            });\n\n            _this3.delayTimer = null;\n          };\n\n          if (delay) {\n            this.delayTimer = setTimeout(startAnimation, delay);\n          } else {\n            startAnimation();\n          }\n        }\n      }\n    }, {\n      key: \"UNSAFE_componentWillReceiveProps\",\n      value: function UNSAFE_componentWillReceiveProps(props) {\n        var _this4 = this;\n\n        var animation = props.animation,\n            delay = props.delay,\n            duration = props.duration,\n            easing = props.easing,\n            iterationDelay = props.iterationDelay,\n            transition = props.transition,\n            onAnimationBegin = props.onAnimationBegin;\n\n        if (transition) {\n          var values = getStyleValues(transition, props.style);\n          this.transitionTo(values, duration, easing, delay);\n        } else if (!deepEquals(animation, this.props.animation)) {\n          if (animation) {\n            if (this.delayTimer) {\n              this.setAnimation(animation);\n            } else {\n              onAnimationBegin();\n              this.animate(animation, duration, iterationDelay).then(function (endState) {\n                return _this4.props.onAnimationEnd(endState);\n              });\n            }\n          } else {\n            this.stopAnimation();\n          }\n        }\n      }\n    }, {\n      key: \"componentWillUnmount\",\n      value: function componentWillUnmount() {\n        if (this.delayTimer) {\n          clearTimeout(this.delayTimer);\n        }\n      }\n    }, {\n      key: \"setAnimation\",\n      value: function setAnimation(animation, callback) {\n        var compiledAnimation = getCompiledAnimation(animation);\n        this.setState(function (state) {\n          return {\n            animationStyle: makeInterpolatedStyle(compiledAnimation, state.animationValue),\n            compiledAnimation: compiledAnimation\n          };\n        }, callback);\n      }\n    }, {\n      key: \"animate\",\n      value: function animate(animation, duration, iterationDelay) {\n        var _this5 = this;\n\n        return new Promise(function (resolve) {\n          _this5.setAnimation(animation, function () {\n            _this5.startAnimation(duration, 0, iterationDelay, resolve);\n          });\n        });\n      }\n    }, {\n      key: \"stopAnimation\",\n      value: function stopAnimation() {\n        this.setState({\n          scheduledAnimation: false,\n          animationStyle: {}\n        });\n        this.state.animationValue.stopAnimation();\n\n        if (this.delayTimer) {\n          clearTimeout(this.delayTimer);\n          this.delayTimer = null;\n        }\n      }\n    }, {\n      key: \"startAnimation\",\n      value: function startAnimation(duration, iteration, iterationDelay, callback) {\n        var _this6 = this;\n\n        var _this$state2 = this.state,\n            animationValue = _this$state2.animationValue,\n            compiledAnimation = _this$state2.compiledAnimation;\n        var _this$props2 = this.props,\n            direction = _this$props2.direction,\n            iterationCount = _this$props2.iterationCount,\n            useNativeDriver = _this$props2.useNativeDriver;\n        var easing = this.props.easing || compiledAnimation.easing || 'ease';\n        var currentIteration = iteration || 0;\n        var fromValue = getAnimationOrigin(currentIteration, direction);\n        var toValue = getAnimationTarget(currentIteration, direction);\n        animationValue.setValue(fromValue);\n\n        if (typeof easing === 'string') {\n          easing = EASING_FUNCTIONS[easing];\n        }\n\n        var reversed = direction === 'reverse' || direction === 'alternate' && !toValue || direction === 'alternate-reverse' && !toValue;\n\n        if (reversed) {\n          easing = Easing.out(easing);\n        }\n\n        var config = {\n          toValue: toValue,\n          easing: easing,\n          isInteraction: iterationCount <= 1,\n          duration: duration || this.props.duration || 1000,\n          useNativeDriver: useNativeDriver,\n          delay: iterationDelay || 0\n        };\n        Animated.timing(animationValue, config).start(function (endState) {\n          currentIteration += 1;\n\n          if (endState.finished && _this6.props.animation && (iterationCount === 'infinite' || currentIteration < iterationCount)) {\n            _this6.startAnimation(duration, currentIteration, iterationDelay, callback);\n          } else if (callback) {\n            callback(endState);\n          }\n        });\n      }\n    }, {\n      key: \"transition\",\n      value: function transition(fromValues, toValues, duration, easing) {\n        var _this7 = this;\n\n        var fromValuesFlat = flattenStyle(fromValues);\n        var toValuesFlat = flattenStyle(toValues);\n        var transitionKeys = Object.keys(toValuesFlat);\n\n        var _this$getTransitionSt = this.getTransitionState(transitionKeys),\n            transitionValues = _this$getTransitionSt.transitionValues,\n            currentTransitionValues = _this$getTransitionSt.currentTransitionValues,\n            transitionStyle = _this$getTransitionSt.transitionStyle;\n\n        transitionKeys.forEach(function (property) {\n          var fromValue = fromValuesFlat[property];\n          var toValue = toValuesFlat[property];\n          var transitionValue = transitionValues[property];\n\n          if (!transitionValue) {\n            transitionValue = new Animated.Value(0);\n          }\n\n          var needsInterpolation = INTERPOLATION_STYLE_PROPERTIES.indexOf(property) !== -1 || typeof value !== 'number';\n          var needsZeroClamping = ZERO_CLAMPED_STYLE_PROPERTIES.indexOf(property) !== -1;\n\n          if (needsInterpolation) {\n            transitionValue.setValue(0);\n            transitionStyle[property] = transitionValue.interpolate({\n              inputRange: [0, 1],\n              outputRange: [fromValue, toValue]\n            });\n            currentTransitionValues[property] = toValue;\n            toValuesFlat[property] = 1;\n          } else {\n            if (needsZeroClamping) {\n              transitionStyle[property] = transitionValue.interpolate({\n                inputRange: [0, 1],\n                outputRange: [0, 1],\n                extrapolateLeft: 'clamp'\n              });\n              currentTransitionValues[property] = toValue;\n            } else {\n              transitionStyle[property] = transitionValue;\n            }\n\n            transitionValue.setValue(fromValue);\n          }\n        });\n        this.setState({\n          transitionValues: transitionValues,\n          transitionStyle: transitionStyle,\n          currentTransitionValues: currentTransitionValues\n        }, function () {\n          _this7.transitionToValues(toValuesFlat, duration || _this7.props.duration, easing, _this7.props.delay);\n        });\n      }\n    }, {\n      key: \"transitionTo\",\n      value: function transitionTo(toValues, duration, easing, delay) {\n        var _this8 = this;\n\n        var currentTransitionValues = this.state.currentTransitionValues;\n        var toValuesFlat = flattenStyle(toValues);\n        var transitions = {\n          from: {},\n          to: {}\n        };\n        Object.keys(toValuesFlat).forEach(function (property) {\n          var toValue = toValuesFlat[property];\n          var needsInterpolation = INTERPOLATION_STYLE_PROPERTIES.indexOf(property) !== -1 || typeof value !== 'number';\n          var needsZeroClamping = ZERO_CLAMPED_STYLE_PROPERTIES.indexOf(property) !== -1;\n          var transitionStyle = _this8.state.transitionStyle[property];\n          var transitionValue = _this8.state.transitionValues[property];\n\n          if (!needsInterpolation && !needsZeroClamping && transitionStyle && transitionStyle === transitionValue) {\n            transitionToValue(property, transitionValue, toValue, duration, easing, _this8.props.useNativeDriver, delay, function (prop) {\n              return _this8.props.onTransitionBegin(prop);\n            }, function (prop) {\n              return _this8.props.onTransitionEnd(prop);\n            });\n          } else {\n            var currentTransitionValue = currentTransitionValues[property];\n\n            if (typeof currentTransitionValue === 'undefined' && _this8.props.style) {\n              var style = getStyleValues(property, _this8.props.style);\n              currentTransitionValue = style[property];\n            }\n\n            transitions.from[property] = currentTransitionValue;\n            transitions.to[property] = toValue;\n          }\n        });\n\n        if (Object.keys(transitions.from).length) {\n          this.transition(transitions.from, transitions.to, duration, easing);\n        }\n      }\n    }, {\n      key: \"transitionToValues\",\n      value: function transitionToValues(toValues, duration, easing, delay) {\n        var _this9 = this;\n\n        Object.keys(toValues).forEach(function (property) {\n          var transitionValue = _this9.state.transitionValues[property];\n          var toValue = toValues[property];\n          transitionToValue(property, transitionValue, toValue, duration, easing, _this9.props.useNativeDriver, delay, function (prop) {\n            return _this9.props.onTransitionBegin(prop);\n          }, function (prop) {\n            return _this9.props.onTransitionEnd(prop);\n          });\n        });\n      }\n    }, {\n      key: \"render\",\n      value: function render() {\n        var _this$props3 = this.props,\n            style = _this$props3.style,\n            animation = _this$props3.animation,\n            transition = _this$props3.transition;\n\n        if (animation && transition) {\n          throw new Error('You cannot combine animation and transition props');\n        }\n\n        var restProps = omit(['animation', 'duration', 'direction', 'delay', 'easing', 'iterationCount', 'iterationDelay', 'onAnimationBegin', 'onAnimationEnd', 'onTransitionBegin', 'onTransitionEnd', 'style', 'transition', 'useNativeDriver'], this.props);\n        return React.createElement(Animatable, _extends({\n          ref: this.handleRef,\n          style: [style, this.state.animationStyle, wrapStyleTransforms(this.state.transitionStyle)]\n        }, restProps));\n      }\n    }]);\n\n    return AnimatableComponent;\n  }(Component), _class.displayName = \"withAnimatable(\" + wrappedComponentName + \")\", _class.propTypes = {\n    animation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n    duration: PropTypes.number,\n    direction: PropTypes.oneOf(['normal', 'reverse', 'alternate', 'alternate-reverse']),\n    delay: PropTypes.number,\n    easing: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(EASING_FUNCTIONS)), PropTypes.func]),\n    iterationCount: function iterationCount(props, propName) {\n      var val = props[propName];\n\n      if (val !== 'infinite' && !(typeof val === 'number' && val >= 1)) {\n        return new Error('iterationCount must be a positive number or \"infinite\"');\n      }\n\n      return null;\n    },\n    iterationDelay: PropTypes.number,\n    onAnimationBegin: PropTypes.func,\n    onAnimationEnd: PropTypes.func,\n    onTransitionBegin: PropTypes.func,\n    onTransitionEnd: PropTypes.func,\n    style: PropTypes.oneOfType([PropTypes.number, PropTypes.array, PropTypes.object]),\n    transition: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n    useNativeDriver: PropTypes.bool\n  }, _class.defaultProps = {\n    animation: undefined,\n    delay: 0,\n    direction: 'normal',\n    duration: undefined,\n    easing: undefined,\n    iterationCount: 1,\n    iterationDelay: 0,\n    onAnimationBegin: function onAnimationBegin() {},\n    onAnimationEnd: function onAnimationEnd() {},\n    onTransitionBegin: function onTransitionBegin() {},\n    onTransitionEnd: function onTransitionEnd() {},\n    style: undefined,\n    transition: undefined,\n    useNativeDriver: false\n  }, _temp;\n}","map":{"version":3,"sources":["/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/example/node_modules/react-native-animatable/createAnimatableComponent.js"],"names":["React","Component","PropTypes","wrapStyleTransforms","getStyleValues","flattenStyle","createAnimation","getAnimationByName","getAnimationNames","EASING_FUNCTIONS","INTERPOLATION_STYLE_PROPERTIES","ZERO_CLAMPED_STYLE_PROPERTIES","omit","keys","source","filtered","Object","forEach","key","indexOf","deepEquals","a","b","JSON","stringify","getAnimationTarget","iteration","direction","getAnimationOrigin","getCompiledAnimation","animation","compiledAnimation","Error","makeInterpolatedStyle","animationValue","style","interpolate","transitionToValue","property","transitionValue","toValue","duration","easing","useNativeDriver","delay","onTransitionBegin","onTransitionEnd","Animated","timing","spring","setTimeout","start","createAnimatableComponent","WrappedComponent","wrappedComponentName","displayName","name","Animatable","createAnimatedComponent","props","ref","handleRef","Value","animationStyle","state","transitionStyle","transitionValues","currentTransitionValues","transition","initializeTransitionState","delayTimer","animationName","animate","bind","transitionKeys","styleValues","value","missingKeys","filter","length","transitionState","nativeProps","setNativeProps","onAnimationBegin","iterationDelay","startAnimation","endState","onAnimationEnd","values","transitionTo","setAnimation","then","stopAnimation","clearTimeout","callback","setState","Promise","resolve","scheduledAnimation","iterationCount","currentIteration","fromValue","setValue","reversed","Easing","out","config","isInteraction","finished","fromValues","toValues","fromValuesFlat","toValuesFlat","getTransitionState","needsInterpolation","needsZeroClamping","inputRange","outputRange","extrapolateLeft","transitionToValues","transitions","from","to","prop","currentTransitionValue","restProps","propTypes","oneOfType","string","object","number","oneOf","func","propName","val","array","arrayOf","bool","defaultProps","undefined"],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;;;AAEA,OAAOC,mBAAP;AACA,OAAOC,cAAP;AACA,OAAOC,YAAP;AACA,OAAOC,eAAP;AACA,SAASC,kBAAT,EAA6BC,iBAA7B;AACA,OAAOC,gBAAP;AAGA,IAAMC,8BAA8B,GAAG,CAErC,QAFqC,EAGrC,SAHqC,EAIrC,SAJqC,EAKrC,SALqC,EAMrC,OANqC,EAOrC,OAPqC,EAQrC,iBARqC,EAUrC,iBAVqC,EAWrC,aAXqC,EAYrC,gBAZqC,EAarC,kBAbqC,EAcrC,mBAdqC,EAerC,iBAfqC,EAgBrC,aAhBqC,EAkBrC,OA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AAA,cAAc,EAAE,CANI;AAOpBf,IAAAA,cAAc,EAAE,CAPI;AAQpBD,IAAAA,gBARoB,8BAQD,CAAE,CARD;AASpBI,IAAAA,cAToB,4BASH,CAAE,CATC;AAUpB1C,IAAAA,iBAVoB,+BAUA,CAAE,CAVF;AAWpBC,IAAAA,eAXoB,6BAWF,CAAE,CAXA;AAYpBX,IAAAA,KAAK,EAAEwG,SAZa;AAapBvE,IAAAA,UAAU,EAAEuE,SAbQ;AAcpBhG,IAAAA,eAAe,EAAE;AAdG,GA3CxB;AA+dD","sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Animated, Easing } from 'react-native';\nimport wrapStyleTransforms from './wrapStyleTransforms';\nimport getStyleValues from './getStyleValues';\nimport flattenStyle from './flattenStyle';\nimport createAnimation from './createAnimation';\nimport { getAnimationByName, getAnimationNames } from './registry';\nimport EASING_FUNCTIONS from './easing';\n\n// These styles are not number based and thus needs to be interpolated\nconst INTERPOLATION_STYLE_PROPERTIES = [\n  // Transform styles\n  'rotate',\n  'rotateX',\n  'rotateY',\n  'rotateZ',\n  'skewX',\n  'skewY',\n  'transformMatrix',\n  // View styles\n  'backgroundColor',\n  'borderColor',\n  'borderTopColor',\n  'borderRightColor',\n  'borderBottomColor',\n  'borderLeftColor',\n  'shadowColor',\n  // Text styles\n  'color',\n  'textDecorationColor',\n  // Image styles\n  'tintColor',\n];\n\nconst ZERO_CLAMPED_STYLE_PROPERTIES = ['width', 'height'];\n\n// Create a copy of `source` without `keys`\nfunction omit(keys, source) {\n  const filtered = {};\n  Object.keys(source).forEach(key => {\n    if (keys.indexOf(key) === -1) {\n      filtered[key] = source[key];\n    }\n  });\n  return filtered;\n}\n\n// Yes it's absurd, but actually fast\nfunction deepEquals(a, b) {\n  return a === b || JSON.stringify(a) === JSON.stringify(b);\n}\n\n// Determine to what value the animation should tween to\nfunction getAnimationTarget(iteration, direction) {\n  switch (direction) {\n    case 'reverse':\n      return 0;\n    case 'alternate':\n      return iteration % 2 ? 0 : 1;\n    case 'alternate-reverse':\n      return iteration % 2 ? 1 : 0;\n    case 'normal':\n    default:\n      return 1;\n  }\n}\n\n// Like getAnimationTarget but opposite\nfunction getAnimationOrigin(iteration, direction) {\n  return getAnimationTarget(iteration, direction) ? 0 : 1;\n}\n\nfunction getCompiledAnimation(animation) {\n  if (typeof animation === 'string') {\n    const compiledAnimation = getAnimationByName(animation);\n    if (!compiledAnimation) {\n      throw new Error(`No animation registred by the name of ${animation}`);\n    }\n    return compiledAnimation;\n  }\n  return createAnimation(animation);\n}\n\nfunction makeInterpolatedStyle(compiledAnimation, animationValue) {\n  const style = {};\n  Object.keys(compiledAnimation).forEach(key => {\n    if (key === 'style') {\n      Object.assign(style, compiledAnimation.style);\n    } else if (key !== 'easing') {\n      style[key] = animationValue.interpolate(compiledAnimation[key]);\n    }\n  });\n  return wrapStyleTransforms(style);\n}\n\nfunction transitionToValue(\n  property,\n  transitionValue,\n  toValue,\n  duration,\n  easing,\n  useNativeDriver = false,\n  delay,\n  onTransitionBegin,\n  onTransitionEnd,\n) {\n  const animation =\n    duration || easing || delay\n      ? Animated.timing(transitionValue, {\n          toValue,\n          delay,\n          duration: duration || 1000,\n          easing:\n            typeof easing === 'function'\n              ? easing\n              : EASING_FUNCTIONS[easing || 'ease'],\n          useNativeDriver,\n        })\n      : Animated.spring(transitionValue, { toValue, useNativeDriver });\n  setTimeout(() => onTransitionBegin(property), delay);\n  animation.start(() => onTransitionEnd(property));\n}\n\n// Make (almost) any component animatable, similar to Animated.createAnimatedComponent\nexport default function createAnimatableComponent(WrappedComponent) {\n  const wrappedComponentName =\n    WrappedComponent.displayName || WrappedComponent.name || 'Component';\n\n  const Animatable = Animated.createAnimatedComponent(WrappedComponent);\n\n  return class AnimatableComponent extends Component {\n    static displayName = `withAnimatable(${wrappedComponentName})`;\n\n    static propTypes = {\n      animation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n      duration: PropTypes.number,\n      direction: PropTypes.oneOf([\n        'normal',\n        'reverse',\n        'alternate',\n        'alternate-reverse',\n      ]),\n      delay: PropTypes.number,\n      easing: PropTypes.oneOfType([\n        PropTypes.oneOf(Object.keys(EASING_FUNCTIONS)),\n        PropTypes.func,\n      ]),\n      iterationCount(props, propName) {\n        const val = props[propName];\n        if (val !== 'infinite' && !(typeof val === 'number' && val >= 1)) {\n          return new Error(\n            'iterationCount must be a positive number or \"infinite\"',\n          );\n        }\n        return null;\n      },\n      iterationDelay: PropTypes.number,\n      onAnimationBegin: PropTypes.func,\n      onAnimationEnd: PropTypes.func,\n      onTransitionBegin: PropTypes.func,\n      onTransitionEnd: PropTypes.func,\n      style: PropTypes.oneOfType([\n        PropTypes.number,\n        PropTypes.array,\n        PropTypes.object,\n      ]),\n      transition: PropTypes.oneOfType([\n        PropTypes.string,\n        PropTypes.arrayOf(PropTypes.string),\n      ]),\n      useNativeDriver: PropTypes.bool,\n    };\n\n    static defaultProps = {\n      animation: undefined,\n      delay: 0,\n      direction: 'normal',\n      duration: undefined,\n      easing: undefined,\n      iterationCount: 1,\n      iterationDelay: 0,\n      onAnimationBegin() {},\n      onAnimationEnd() {},\n      onTransitionBegin() {},\n      onTransitionEnd() {},\n      style: undefined,\n      transition: undefined,\n      useNativeDriver: false,\n    };\n\n    constructor(props) {\n      super(props);\n\n      const animationValue = new Animated.Value(\n        getAnimationOrigin(0, this.props.direction),\n      );\n      let animationStyle = {};\n      let compiledAnimation = {};\n      if (props.animation) {\n        compiledAnimation = getCompiledAnimation(props.animation);\n        animationStyle = makeInterpolatedStyle(\n          compiledAnimation,\n          animationValue,\n        );\n      }\n      this.state = {\n        animationValue,\n        animationStyle,\n        compiledAnimation,\n        transitionStyle: {},\n        transitionValues: {},\n        currentTransitionValues: {},\n      };\n\n      if (props.transition) {\n        this.state = {\n          ...this.state,\n          ...this.initializeTransitionState(props.transition),\n        };\n      }\n      this.delayTimer = null;\n\n      // Alias registered animations for backwards compatibility\n      getAnimationNames().forEach(animationName => {\n        if (!(animationName in this)) {\n          this[animationName] = this.animate.bind(this, animationName);\n        }\n      });\n    }\n\n    initializeTransitionState(transitionKeys) {\n      const transitionValues = {};\n      const styleValues = {};\n\n      const currentTransitionValues = getStyleValues(\n        transitionKeys,\n        this.props.style,\n      );\n      Object.keys(currentTransitionValues).forEach(key => {\n        const value = currentTransitionValues[key];\n        if (\n          INTERPOLATION_STYLE_PROPERTIES.indexOf(key) !== -1 ||\n          typeof value !== 'number'\n        ) {\n          transitionValues[key] = new Animated.Value(0);\n          styleValues[key] = value;\n        } else {\n          const animationValue = new Animated.Value(value);\n          transitionValues[key] = animationValue;\n          styleValues[key] = animationValue;\n        }\n      });\n\n      return {\n        currentTransitionValues,\n        transitionStyle: styleValues,\n        transitionValues,\n      };\n    }\n\n    getTransitionState(keys) {\n      const transitionKeys = typeof keys === 'string' ? [keys] : keys;\n      let {\n        transitionValues,\n        currentTransitionValues,\n        transitionStyle,\n      } = this.state;\n      const missingKeys = transitionKeys.filter(\n        key => !this.state.transitionValues[key],\n      );\n      if (missingKeys.length) {\n        const transitionState = this.initializeTransitionState(missingKeys);\n        transitionValues = {\n          ...transitionValues,\n          ...transitionState.transitionValues,\n        };\n        currentTransitionValues = {\n          ...currentTransitionValues,\n          ...transitionState.currentTransitionValues,\n        };\n        transitionStyle = {\n          ...transitionStyle,\n          ...transitionState.transitionStyle,\n        };\n      }\n      return { transitionValues, currentTransitionValues, transitionStyle };\n    }\n\n    ref = null;\n\n    handleRef = ref => {\n      this.ref = ref;\n    };\n\n    setNativeProps(nativeProps) {\n      if (this.ref) {\n        this.ref.setNativeProps(nativeProps);\n      }\n    }\n\n    componentDidMount() {\n      const {\n        animation,\n        duration,\n        delay,\n        onAnimationBegin,\n        iterationDelay,\n      } = this.props;\n      if (animation) {\n        const startAnimation = () => {\n          onAnimationBegin();\n          this.startAnimation(duration, 0, iterationDelay, endState =>\n            this.props.onAnimationEnd(endState),\n          );\n          this.delayTimer = null;\n        };\n        if (delay) {\n          this.delayTimer = setTimeout(startAnimation, delay);\n        } else {\n          startAnimation();\n        }\n      }\n    }\n\n    // eslint-disable-next-line camelcase\n    UNSAFE_componentWillReceiveProps(props) {\n      const {\n        animation,\n        delay,\n        duration,\n        easing,\n        iterationDelay,\n        transition,\n        onAnimationBegin,\n      } = props;\n\n      if (transition) {\n        const values = getStyleValues(transition, props.style);\n        this.transitionTo(values, duration, easing, delay);\n      } else if (!deepEquals(animation, this.props.animation)) {\n        if (animation) {\n          if (this.delayTimer) {\n            this.setAnimation(animation);\n          } else {\n            onAnimationBegin();\n            this.animate(animation, duration, iterationDelay).then(endState =>\n              this.props.onAnimationEnd(endState),\n            );\n          }\n        } else {\n          this.stopAnimation();\n        }\n      }\n    }\n\n    componentWillUnmount() {\n      if (this.delayTimer) {\n        clearTimeout(this.delayTimer);\n      }\n    }\n\n    setAnimation(animation, callback) {\n      const compiledAnimation = getCompiledAnimation(animation);\n      this.setState(\n        state => ({\n          animationStyle: makeInterpolatedStyle(\n            compiledAnimation,\n            state.animationValue,\n          ),\n          compiledAnimation,\n        }),\n        callback,\n      );\n    }\n\n    animate(animation, duration, iterationDelay) {\n      return new Promise(resolve => {\n        this.setAnimation(animation, () => {\n          this.startAnimation(duration, 0, iterationDelay, resolve);\n        });\n      });\n    }\n\n    stopAnimation() {\n      this.setState({\n        scheduledAnimation: false,\n        animationStyle: {},\n      });\n      this.state.animationValue.stopAnimation();\n      if (this.delayTimer) {\n        clearTimeout(this.delayTimer);\n        this.delayTimer = null;\n      }\n    }\n\n    startAnimation(duration, iteration, iterationDelay, callback) {\n      const { animationValue, compiledAnimation } = this.state;\n      const { direction, iterationCount, useNativeDriver } = this.props;\n      let easing = this.props.easing || compiledAnimation.easing || 'ease';\n      let currentIteration = iteration || 0;\n      const fromValue = getAnimationOrigin(currentIteration, direction);\n      const toValue = getAnimationTarget(currentIteration, direction);\n      animationValue.setValue(fromValue);\n\n      if (typeof easing === 'string') {\n        easing = EASING_FUNCTIONS[easing];\n      }\n      // Reverse easing if on the way back\n      const reversed =\n        direction === 'reverse' ||\n        (direction === 'alternate' && !toValue) ||\n        (direction === 'alternate-reverse' && !toValue);\n      if (reversed) {\n        easing = Easing.out(easing);\n      }\n      const config = {\n        toValue,\n        easing,\n        isInteraction: iterationCount <= 1,\n        duration: duration || this.props.duration || 1000,\n        useNativeDriver,\n        delay: iterationDelay || 0,\n      };\n\n      Animated.timing(animationValue, config).start(endState => {\n        currentIteration += 1;\n        if (\n          endState.finished &&\n          this.props.animation &&\n          (iterationCount === 'infinite' || currentIteration < iterationCount)\n        ) {\n          this.startAnimation(\n            duration,\n            currentIteration,\n            iterationDelay,\n            callback,\n          );\n        } else if (callback) {\n          callback(endState);\n        }\n      });\n    }\n\n    transition(fromValues, toValues, duration, easing) {\n      const fromValuesFlat = flattenStyle(fromValues);\n      const toValuesFlat = flattenStyle(toValues);\n      const transitionKeys = Object.keys(toValuesFlat);\n      const {\n        transitionValues,\n        currentTransitionValues,\n        transitionStyle,\n      } = this.getTransitionState(transitionKeys);\n\n      transitionKeys.forEach(property => {\n        const fromValue = fromValuesFlat[property];\n        const toValue = toValuesFlat[property];\n        let transitionValue = transitionValues[property];\n        if (!transitionValue) {\n          transitionValue = new Animated.Value(0);\n        }\n        const needsInterpolation =\n          INTERPOLATION_STYLE_PROPERTIES.indexOf(property) !== -1 ||\n          typeof value !== 'number';\n        const needsZeroClamping =\n          ZERO_CLAMPED_STYLE_PROPERTIES.indexOf(property) !== -1;\n        if (needsInterpolation) {\n          transitionValue.setValue(0);\n          transitionStyle[property] = transitionValue.interpolate({\n            inputRange: [0, 1],\n            outputRange: [fromValue, toValue],\n          });\n          currentTransitionValues[property] = toValue;\n          toValuesFlat[property] = 1;\n        } else {\n          if (needsZeroClamping) {\n            transitionStyle[property] = transitionValue.interpolate({\n              inputRange: [0, 1],\n              outputRange: [0, 1],\n              extrapolateLeft: 'clamp',\n            });\n            currentTransitionValues[property] = toValue;\n          } else {\n            transitionStyle[property] = transitionValue;\n          }\n          transitionValue.setValue(fromValue);\n        }\n      });\n      this.setState(\n        { transitionValues, transitionStyle, currentTransitionValues },\n        () => {\n          this.transitionToValues(\n            toValuesFlat,\n            duration || this.props.duration,\n            easing,\n            this.props.delay,\n          );\n        },\n      );\n    }\n\n    transitionTo(toValues, duration, easing, delay) {\n      const { currentTransitionValues } = this.state;\n      const toValuesFlat = flattenStyle(toValues);\n      const transitions = {\n        from: {},\n        to: {},\n      };\n\n      Object.keys(toValuesFlat).forEach(property => {\n        const toValue = toValuesFlat[property];\n        const needsInterpolation =\n          INTERPOLATION_STYLE_PROPERTIES.indexOf(property) !== -1 ||\n          typeof value !== 'number';\n        const needsZeroClamping =\n          ZERO_CLAMPED_STYLE_PROPERTIES.indexOf(property) !== -1;\n        const transitionStyle = this.state.transitionStyle[property];\n        const transitionValue = this.state.transitionValues[property];\n        if (\n          !needsInterpolation &&\n          !needsZeroClamping &&\n          transitionStyle &&\n          transitionStyle === transitionValue\n        ) {\n          transitionToValue(\n            property,\n            transitionValue,\n            toValue,\n            duration,\n            easing,\n            this.props.useNativeDriver,\n            delay,\n            prop => this.props.onTransitionBegin(prop),\n            prop => this.props.onTransitionEnd(prop),\n          );\n        } else {\n          let currentTransitionValue = currentTransitionValues[property];\n          if (\n            typeof currentTransitionValue === 'undefined' &&\n            this.props.style\n          ) {\n            const style = getStyleValues(property, this.props.style);\n            currentTransitionValue = style[property];\n          }\n          transitions.from[property] = currentTransitionValue;\n          transitions.to[property] = toValue;\n        }\n      });\n\n      if (Object.keys(transitions.from).length) {\n        this.transition(transitions.from, transitions.to, duration, easing);\n      }\n    }\n\n    transitionToValues(toValues, duration, easing, delay) {\n      Object.keys(toValues).forEach(property => {\n        const transitionValue = this.state.transitionValues[property];\n        const toValue = toValues[property];\n        transitionToValue(\n          property,\n          transitionValue,\n          toValue,\n          duration,\n          easing,\n          this.props.useNativeDriver,\n          delay,\n          prop => this.props.onTransitionBegin(prop),\n          prop => this.props.onTransitionEnd(prop),\n        );\n      });\n    }\n\n    render() {\n      const { style, animation, transition } = this.props;\n      if (animation && transition) {\n        throw new Error('You cannot combine animation and transition props');\n      }\n      const restProps = omit(\n        [\n          'animation',\n          'duration',\n          'direction',\n          'delay',\n          'easing',\n          'iterationCount',\n          'iterationDelay',\n          'onAnimationBegin',\n          'onAnimationEnd',\n          'onTransitionBegin',\n          'onTransitionEnd',\n          'style',\n          'transition',\n          'useNativeDriver',\n        ],\n        this.props,\n      );\n\n      return (\n        <Animatable\n          ref={this.handleRef}\n          style={[\n            style,\n            this.state.animationStyle,\n            wrapStyleTransforms(this.state.transitionStyle),\n          ]}\n          {...restProps}\n        />\n      );\n    }\n  };\n}\n"]},"metadata":{},"sourceType":"module"}