1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4  value: true
5});
6exports.getAndroidDarkSplashConfig = getAndroidDarkSplashConfig;
7exports.getAndroidSplashConfig = getAndroidSplashConfig;
8const defaultResizeMode = 'contain';
9function getAndroidSplashConfig(config) {
10  var _config$android;
11  // Respect the splash screen object, don't mix and match across different splash screen objects
12  // in case the user wants the top level splash to apply to every platform except android.
13  if ((_config$android = config.android) !== null && _config$android !== void 0 && _config$android.splash) {
14    var _config$android2, _ref, _splash$xxxhdpi, _ref2, _splash$xxhdpi, _ref3, _splash$xhdpi, _ref4, _splash$hdpi, _ref5, _splash$mdpi, _splash$backgroundCol, _splash$resizeMode;
15    const splash = (_config$android2 = config.android) === null || _config$android2 === void 0 ? void 0 : _config$android2.splash;
16    return {
17      xxxhdpi: (_ref = (_splash$xxxhdpi = splash.xxxhdpi) !== null && _splash$xxxhdpi !== void 0 ? _splash$xxxhdpi : splash.image) !== null && _ref !== void 0 ? _ref : null,
18      xxhdpi: (_ref2 = (_splash$xxhdpi = splash.xxhdpi) !== null && _splash$xxhdpi !== void 0 ? _splash$xxhdpi : splash.image) !== null && _ref2 !== void 0 ? _ref2 : null,
19      xhdpi: (_ref3 = (_splash$xhdpi = splash.xhdpi) !== null && _splash$xhdpi !== void 0 ? _splash$xhdpi : splash.image) !== null && _ref3 !== void 0 ? _ref3 : null,
20      hdpi: (_ref4 = (_splash$hdpi = splash.hdpi) !== null && _splash$hdpi !== void 0 ? _splash$hdpi : splash.image) !== null && _ref4 !== void 0 ? _ref4 : null,
21      mdpi: (_ref5 = (_splash$mdpi = splash.mdpi) !== null && _splash$mdpi !== void 0 ? _splash$mdpi : splash.image) !== null && _ref5 !== void 0 ? _ref5 : null,
22      backgroundColor: (_splash$backgroundCol = splash.backgroundColor) !== null && _splash$backgroundCol !== void 0 ? _splash$backgroundCol : null,
23      resizeMode: (_splash$resizeMode = splash.resizeMode) !== null && _splash$resizeMode !== void 0 ? _splash$resizeMode : defaultResizeMode
24    };
25  }
26  if (config.splash) {
27    var _splash$image, _splash$image2, _splash$image3, _splash$image4, _splash$image5, _splash$backgroundCol2, _splash$resizeMode2;
28    const splash = config.splash;
29    return {
30      xxxhdpi: (_splash$image = splash.image) !== null && _splash$image !== void 0 ? _splash$image : null,
31      xxhdpi: (_splash$image2 = splash.image) !== null && _splash$image2 !== void 0 ? _splash$image2 : null,
32      xhdpi: (_splash$image3 = splash.image) !== null && _splash$image3 !== void 0 ? _splash$image3 : null,
33      hdpi: (_splash$image4 = splash.image) !== null && _splash$image4 !== void 0 ? _splash$image4 : null,
34      mdpi: (_splash$image5 = splash.image) !== null && _splash$image5 !== void 0 ? _splash$image5 : null,
35      backgroundColor: (_splash$backgroundCol2 = splash.backgroundColor) !== null && _splash$backgroundCol2 !== void 0 ? _splash$backgroundCol2 : null,
36      resizeMode: (_splash$resizeMode2 = splash.resizeMode) !== null && _splash$resizeMode2 !== void 0 ? _splash$resizeMode2 : defaultResizeMode
37    };
38  }
39  return null;
40}
41function getAndroidDarkSplashConfig(config) {
42  var _config$android3, _config$android3$spla;
43  // Respect the splash screen object, don't mix and match across different splash screen objects
44  // in case the user wants the top level splash to apply to every platform except android.
45  if ((_config$android3 = config.android) !== null && _config$android3 !== void 0 && (_config$android3$spla = _config$android3.splash) !== null && _config$android3$spla !== void 0 && _config$android3$spla.dark) {
46    var _config$android4, _config$android4$spla, _ref6, _splash$xxxhdpi2, _ref7, _splash$xxhdpi2, _ref8, _splash$xhdpi2, _ref9, _splash$hdpi2, _ref10, _splash$mdpi2, _splash$backgroundCol3, _lightTheme$resizeMod;
47    const splash = (_config$android4 = config.android) === null || _config$android4 === void 0 ? void 0 : (_config$android4$spla = _config$android4.splash) === null || _config$android4$spla === void 0 ? void 0 : _config$android4$spla.dark;
48    const lightTheme = getAndroidSplashConfig(config);
49    return {
50      xxxhdpi: (_ref6 = (_splash$xxxhdpi2 = splash.xxxhdpi) !== null && _splash$xxxhdpi2 !== void 0 ? _splash$xxxhdpi2 : splash.image) !== null && _ref6 !== void 0 ? _ref6 : null,
51      xxhdpi: (_ref7 = (_splash$xxhdpi2 = splash.xxhdpi) !== null && _splash$xxhdpi2 !== void 0 ? _splash$xxhdpi2 : splash.image) !== null && _ref7 !== void 0 ? _ref7 : null,
52      xhdpi: (_ref8 = (_splash$xhdpi2 = splash.xhdpi) !== null && _splash$xhdpi2 !== void 0 ? _splash$xhdpi2 : splash.image) !== null && _ref8 !== void 0 ? _ref8 : null,
53      hdpi: (_ref9 = (_splash$hdpi2 = splash.hdpi) !== null && _splash$hdpi2 !== void 0 ? _splash$hdpi2 : splash.image) !== null && _ref9 !== void 0 ? _ref9 : null,
54      mdpi: (_ref10 = (_splash$mdpi2 = splash.mdpi) !== null && _splash$mdpi2 !== void 0 ? _splash$mdpi2 : splash.image) !== null && _ref10 !== void 0 ? _ref10 : null,
55      backgroundColor: (_splash$backgroundCol3 = splash.backgroundColor) !== null && _splash$backgroundCol3 !== void 0 ? _splash$backgroundCol3 : null,
56      // Can't support dark resizeMode because the resize mode is hardcoded into the MainActivity.java
57      resizeMode: (_lightTheme$resizeMod = lightTheme === null || lightTheme === void 0 ? void 0 : lightTheme.resizeMode) !== null && _lightTheme$resizeMod !== void 0 ? _lightTheme$resizeMod : defaultResizeMode
58    };
59  }
60  return null;
61}
62//# sourceMappingURL=getAndroidSplashConfig.js.map