{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport Dimensions from \"react-native-web/dist/exports/Dimensions\";\nimport * as animatable from 'react-native-animatable';\n\nvar _Dimensions$get = Dimensions.get('window'),\n    height = _Dimensions$get.height,\n    width = _Dimensions$get.width;\n\nexport var initializeAnimations = function initializeAnimations() {\n  var animationDefinitions = {\n    slideInDown: makeSlideTranslation('translateY', -height, 0),\n    slideInUp: makeSlideTranslation('translateY', height, 0),\n    slideInLeft: makeSlideTranslation('translateX', -width, 0),\n    slideInRight: makeSlideTranslation('translateX', width, 0),\n    slideOutDown: makeSlideTranslation('translateY', 0, height),\n    slideOutUp: makeSlideTranslation('translateY', 0, -height),\n    slideOutLeft: makeSlideTranslation('translateX', 0, -width),\n    slideOutRight: makeSlideTranslation('translateX', 0, width)\n  };\n  animatable.initializeRegistryWithDefinitions(animationDefinitions);\n};\nexport var makeSlideTranslation = function makeSlideTranslation(translationType, fromValue, toValue) {\n  return {\n    from: _defineProperty({}, translationType, fromValue),\n    to: _defineProperty({}, translationType, toValue)\n  };\n};\nexport var buildAnimations = function buildAnimations(_ref) {\n  var animationIn = _ref.animationIn,\n      animationOut = _ref.animationOut;\n  var updatedAnimationIn;\n  var updatedAnimationOut;\n\n  if (isObject(animationIn)) {\n    var animationName = JSON.stringify(animationIn);\n    makeAnimation(animationName, animationIn);\n    updatedAnimationIn = animationName;\n  } else {\n    updatedAnimationIn = animationIn;\n  }\n\n  if (isObject(animationOut)) {\n    var _animationName = JSON.stringify(animationOut);\n\n    makeAnimation(_animationName, animationOut);\n    updatedAnimationOut = _animationName;\n  } else {\n    updatedAnimationOut = animationOut;\n  }\n\n  return {\n    animationIn: updatedAnimationIn,\n    animationOut: updatedAnimationOut\n  };\n};\nexport var reversePercentage = function reversePercentage(x) {\n  return -(x - 1);\n};\n\nvar makeAnimation = function makeAnimation(name, obj) {\n  animatable.registerAnimation(name, animatable.createAnimation(obj));\n};\n\nvar isObject = function isObject(obj) {\n  return obj !== null && typeof obj === 'object';\n};","map":{"version":3,"sources":["/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/example/node_modules/react-native-modal/dist/utils.js"],"names":["animatable","Dimensions","get","height","width","initializeAnimations","animationDefinitions","slideInDown","makeSlideTranslation","slideInUp","slideInLeft","slideInRight","slideOutDown","slideOutUp","slideOutLeft","slideOutRight","initializeRegistryWithDefinitions","translationType","fromValue","toValue","from","to","buildAnimations","animationIn","animationOut","updatedAnimationIn","updatedAnimationOut","isObject","animationName","JSON","stringify","makeAnimation","reversePercentage","x","name","obj","registerAnimation","createAnimation"],"mappings":";;AACA,OAAO,KAAKA,UAAZ,MAA4B,yBAA5B;;sBAC0BC,UAAU,CAACC,GAAX,CAAe,QAAf,C;IAAlBC,M,mBAAAA,M;IAAQC,K,mBAAAA,K;;AAChB,OAAO,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAuB,GAAM;AAGtC,MAAMC,oBAAoB,GAAG;AACzBC,IAAAA,WAAW,EAAEC,oBAAoB,CAAC,YAAD,EAAe,CAACL,MAAhB,EAAwB,CAAxB,CADR;AAEzBM,IAAAA,SAAS,EAAED,oBAAoB,CAAC,YAAD,EAAeL,MAAf,EAAuB,CAAvB,CAFN;AAGzBO,IAAAA,WAAW,EAAEF,oBAAoB,CAAC,YAAD,EAAe,CAACJ,KAAhB,EAAuB,CAAvB,CAHR;AAIzBO,IAAAA,YAAY,EAAEH,oBAAoB,CAAC,YAAD,EAAeJ,KAAf,EAAsB,CAAtB,CAJT;AAKzBQ,IAAAA,YAAY,EAAEJ,oBAAoB,CAAC,YAAD,EAAe,CAAf,EAAkBL,MAAlB,CALT;AAMzBU,IAAAA,UAAU,EAAEL,oBAAoB,CAAC,YAAD,EAAe,CAAf,EAAkB,CAACL,MAAnB,CANP;AAOzBW,IAAAA,YAAY,EAAEN,oBAAoB,CAAC,YAAD,EAAe,CAAf,EAAkB,CAACJ,KAAnB,CAPT;AAQzBW,IAAAA,aAAa,EAAEP,oBAAoB,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AAN,CAAP;AAAA,CAA1B;;AACP,IAAMF,aAAa,GAAG,SAAhBA,aAAgB,CAACG,IAAD,EAAOC,GAAP,EAAe;AACjCnC,EAAAA,UAAU,CAACoC,iBAAX,CAA6BF,IAA7B,EAAmClC,UAAU,CAACqC,eAAX,CAA2BF,GAA3B,CAAnC;AACH,CAFD;;AAGA,IAAMR,QAAQ,GAAG,SAAXA,QAAW,CAACQ,GAAD,EAAS;AACtB,SAAOA,GAAG,KAAK,IAAR,IAAgB,OAAOA,GAAP,KAAe,QAAtC;AACH,CAFD","sourcesContent":["import { Dimensions } from 'react-native';\nimport * as animatable from 'react-native-animatable';\nconst { height, width } = Dimensions.get('window');\nexport const initializeAnimations = () => {\n    // Since react-native-animatable applies by default a margin of 100 to its\n    // sliding animation, we reset them here overriding the margin to 0.\n    const animationDefinitions = {\n        slideInDown: makeSlideTranslation('translateY', -height, 0),\n        slideInUp: makeSlideTranslation('translateY', height, 0),\n        slideInLeft: makeSlideTranslation('translateX', -width, 0),\n        slideInRight: makeSlideTranslation('translateX', width, 0),\n        slideOutDown: makeSlideTranslation('translateY', 0, height),\n        slideOutUp: makeSlideTranslation('translateY', 0, -height),\n        slideOutLeft: makeSlideTranslation('translateX', 0, -width),\n        slideOutRight: makeSlideTranslation('translateX', 0, width),\n    };\n    animatable.initializeRegistryWithDefinitions(animationDefinitions);\n};\nexport const makeSlideTranslation = (translationType, fromValue, toValue) => ({\n    from: {\n        [translationType]: fromValue,\n    },\n    to: {\n        [translationType]: toValue,\n    },\n});\n// User can define custom react-native-animatable animations, see PR #72\n// Utility for creating our own custom react-native-animatable animations\nexport const buildAnimations = ({ animationIn, animationOut, }) => {\n    let updatedAnimationIn;\n    let updatedAnimationOut;\n    if (isObject(animationIn)) {\n        const animationName = JSON.stringify(animationIn);\n        makeAnimation(animationName, animationIn);\n        updatedAnimationIn = animationName;\n    }\n    else {\n        updatedAnimationIn = animationIn;\n    }\n    if (isObject(animationOut)) {\n        const animationName = JSON.stringify(animationOut);\n        makeAnimation(animationName, animationOut);\n        updatedAnimationOut = animationName;\n    }\n    else {\n        updatedAnimationOut = animationOut;\n    }\n    return {\n        animationIn: updatedAnimationIn,\n        animationOut: updatedAnimationOut,\n    };\n};\nexport const reversePercentage = (x) => -(x - 1);\nconst makeAnimation = (name, obj) => {\n    animatable.registerAnimation(name, animatable.createAnimation(obj));\n};\nconst isObject = (obj) => {\n    return obj !== null && typeof obj === 'object';\n};\n"]},"metadata":{},"sourceType":"module"}