1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4  value: true
5});
6exports.default = void 0;
7
8function _configPlugins() {
9  const data = require("@expo/config-plugins");
10
11  _configPlugins = function () {
12    return data;
13  };
14
15  return data;
16}
17
18function _resolveFrom() {
19  const data = _interopRequireDefault(require("resolve-from"));
20
21  _resolveFrom = function () {
22    return data;
23  };
24
25  return data;
26}
27
28function _createLegacyPlugin() {
29  const data = require("./createLegacyPlugin");
30
31  _createLegacyPlugin = function () {
32    return data;
33  };
34
35  return data;
36}
37
38function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
39
40const LOCATION_USAGE = 'Allow $(PRODUCT_NAME) to access your location'; // Copied from expo-location package, this gets used when the
41// user has react-native-maps installed but not expo-location.
42
43const withDefaultLocationPermissions = config => {
44  var _config$_internal, _config$_internal2;
45
46  const isLinked = !((_config$_internal = config._internal) !== null && _config$_internal !== void 0 && _config$_internal.autolinkedModules) || config._internal.autolinkedModules.includes('react-native-maps'); // Only add location permissions if react-native-maps is installed.
47
48
49  if ((_config$_internal2 = config._internal) !== null && _config$_internal2 !== void 0 && _config$_internal2.projectRoot && _resolveFrom().default.silent(config._internal.projectRoot, 'react-native-maps') && isLinked) {
50    config = (0, _configPlugins().withInfoPlist)(config, config => {
51      config.modResults.NSLocationWhenInUseUsageDescription = config.modResults.NSLocationWhenInUseUsageDescription || LOCATION_USAGE;
52      return config;
53    });
54    return _configPlugins().AndroidConfig.Permissions.withPermissions(config, ['android.permission.ACCESS_COARSE_LOCATION', 'android.permission.ACCESS_FINE_LOCATION']);
55  }
56
57  return config;
58};
59
60var _default = (0, _createLegacyPlugin().createLegacyPlugin)({
61  packageName: 'react-native-maps',
62  fallback: [_configPlugins().AndroidConfig.GoogleMapsApiKey.withGoogleMapsApiKey, _configPlugins().IOSConfig.Maps.withMaps, withDefaultLocationPermissions]
63});
64
65exports.default = _default;
66//# sourceMappingURL=react-native-maps.js.map