@expo/prebuild-config 5.0.7 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/getAutolinkedPackages.js +3 -13
- package/build/getAutolinkedPackages.js.map +1 -1
- package/build/getPrebuildConfig.js +9 -24
- package/build/getPrebuildConfig.js.map +1 -1
- package/build/importExpoModulesAutolinking.d.ts +3 -3
- package/build/importExpoModulesAutolinking.js +0 -5
- package/build/importExpoModulesAutolinking.js.map +1 -1
- package/build/index.js +0 -5
- package/build/index.js.map +1 -1
- package/build/plugins/icons/AssetContents.d.ts +3 -3
- package/build/plugins/icons/AssetContents.js +1 -10
- package/build/plugins/icons/AssetContents.js.map +1 -1
- package/build/plugins/icons/withAndroidIcons.d.ts +7 -5
- package/build/plugins/icons/withAndroidIcons.js +52 -71
- package/build/plugins/icons/withAndroidIcons.js.map +1 -1
- package/build/plugins/icons/withAndroidManifestIcons.js +0 -10
- package/build/plugins/icons/withAndroidManifestIcons.js.map +1 -1
- package/build/plugins/icons/withIosIcons.js +24 -48
- package/build/plugins/icons/withIosIcons.js.map +1 -1
- package/build/plugins/unversioned/createLegacyPlugin.js +0 -11
- package/build/plugins/unversioned/createLegacyPlugin.js.map +1 -1
- package/build/plugins/unversioned/expo-ads-admob/expo-ads-admob.js +0 -11
- package/build/plugins/unversioned/expo-ads-admob/expo-ads-admob.js.map +1 -1
- package/build/plugins/unversioned/expo-ads-admob/withAndroidAdMob.js +0 -14
- package/build/plugins/unversioned/expo-ads-admob/withAndroidAdMob.js.map +1 -1
- package/build/plugins/unversioned/expo-ads-admob/withIosAdMob.js +5 -14
- package/build/plugins/unversioned/expo-ads-admob/withIosAdMob.js.map +1 -1
- package/build/plugins/unversioned/expo-apple-authentication.js +0 -11
- package/build/plugins/unversioned/expo-apple-authentication.js.map +1 -1
- package/build/plugins/unversioned/expo-branch/expo-branch.js +4 -13
- package/build/plugins/unversioned/expo-branch/expo-branch.js.map +1 -1
- package/build/plugins/unversioned/expo-branch/withAndroidBranch.js +0 -12
- package/build/plugins/unversioned/expo-branch/withAndroidBranch.js.map +1 -1
- package/build/plugins/unversioned/expo-branch/withIosBranch.js +2 -11
- package/build/plugins/unversioned/expo-branch/withIosBranch.js.map +1 -1
- package/build/plugins/unversioned/expo-contacts.js +2 -13
- package/build/plugins/unversioned/expo-contacts.js.map +1 -1
- package/build/plugins/unversioned/expo-document-picker.js +2 -12
- package/build/plugins/unversioned/expo-document-picker.js.map +1 -1
- package/build/plugins/unversioned/expo-navigation-bar/expo-navigation-bar.js +2 -9
- package/build/plugins/unversioned/expo-navigation-bar/expo-navigation-bar.js.map +1 -1
- package/build/plugins/unversioned/expo-navigation-bar/withAndroidNavigationBar.js +0 -20
- package/build/plugins/unversioned/expo-navigation-bar/withAndroidNavigationBar.js.map +1 -1
- package/build/plugins/unversioned/expo-notifications/expo-notifications.js +4 -14
- package/build/plugins/unversioned/expo-notifications/expo-notifications.js.map +1 -1
- package/build/plugins/unversioned/expo-notifications/withAndroidNotifications.d.ts +1 -1
- package/build/plugins/unversioned/expo-notifications/withAndroidNotifications.js +1 -44
- package/build/plugins/unversioned/expo-notifications/withAndroidNotifications.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.d.ts +20 -20
- package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js +14 -33
- package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/expo-splash-screen.js +0 -11
- package/build/plugins/unversioned/expo-splash-screen/expo-splash-screen.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.d.ts +1 -1
- package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js +2 -11
- package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.d.ts +1 -2
- package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.js +0 -26
- package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js +4 -9
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js +9 -36
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js +13 -34
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js +4 -46
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js +0 -13
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js +2 -23
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js +16 -54
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.js +6 -22
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js +7 -35
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.js +9 -33
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.js +1 -18
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.js +2 -15
- package/build/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/expo-system-ui.js +0 -17
- package/build/plugins/unversioned/expo-system-ui/expo-system-ui.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.js +0 -14
- package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.js +2 -9
- package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.js +2 -27
- package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.js +2 -14
- package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.js.map +1 -1
- package/build/plugins/unversioned/expo-updates.js +1 -8
- package/build/plugins/unversioned/expo-updates.js.map +1 -1
- package/build/plugins/unversioned/react-native-maps.js +4 -19
- package/build/plugins/unversioned/react-native-maps.js.map +1 -1
- package/build/plugins/withDefaultPlugins.d.ts +2 -2
- package/build/plugins/withDefaultPlugins.js +41 -94
- package/build/plugins/withDefaultPlugins.js.map +1 -1
- package/package.json +6 -6
- package/build/plugins/unversioned/expo-facebook/expo-facebook.d.ts +0 -2
- package/build/plugins/unversioned/expo-facebook/expo-facebook.js +0 -57
- package/build/plugins/unversioned/expo-facebook/expo-facebook.js.map +0 -1
- package/build/plugins/unversioned/expo-facebook/withAndroidFacebook.d.ts +0 -13
- package/build/plugins/unversioned/expo-facebook/withAndroidFacebook.js +0 -235
- package/build/plugins/unversioned/expo-facebook/withAndroidFacebook.js.map +0 -1
- package/build/plugins/unversioned/expo-facebook/withIosFacebook.d.ts +0 -26
- package/build/plugins/unversioned/expo-facebook/withIosFacebook.js +0 -233
- package/build/plugins/unversioned/expo-facebook/withIosFacebook.js.map +0 -1
- package/build/plugins/unversioned/expo-facebook/withSKAdNetworkIdentifiers.d.ts +0 -9
- package/build/plugins/unversioned/expo-facebook/withSKAdNetworkIdentifiers.js +0 -69
- package/build/plugins/unversioned/expo-facebook/withSKAdNetworkIdentifiers.js.map +0 -1
|
@@ -7,76 +7,57 @@ exports.ICON_CONTENTS = void 0;
|
|
|
7
7
|
exports.getIcons = getIcons;
|
|
8
8
|
exports.setIconsAsync = setIconsAsync;
|
|
9
9
|
exports.withIosIcons = void 0;
|
|
10
|
-
|
|
11
10
|
function _configPlugins() {
|
|
12
11
|
const data = require("@expo/config-plugins");
|
|
13
|
-
|
|
14
12
|
_configPlugins = function () {
|
|
15
13
|
return data;
|
|
16
14
|
};
|
|
17
|
-
|
|
18
15
|
return data;
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
function _imageUtils() {
|
|
22
18
|
const data = require("@expo/image-utils");
|
|
23
|
-
|
|
24
19
|
_imageUtils = function () {
|
|
25
20
|
return data;
|
|
26
21
|
};
|
|
27
|
-
|
|
28
22
|
return data;
|
|
29
23
|
}
|
|
30
|
-
|
|
31
24
|
function fs() {
|
|
32
25
|
const data = _interopRequireWildcard(require("fs-extra"));
|
|
33
|
-
|
|
34
26
|
fs = function () {
|
|
35
27
|
return data;
|
|
36
28
|
};
|
|
37
|
-
|
|
38
29
|
return data;
|
|
39
30
|
}
|
|
40
|
-
|
|
41
31
|
function _path() {
|
|
42
32
|
const data = require("path");
|
|
43
|
-
|
|
44
33
|
_path = function () {
|
|
45
34
|
return data;
|
|
46
35
|
};
|
|
47
|
-
|
|
48
36
|
return data;
|
|
49
37
|
}
|
|
50
|
-
|
|
51
38
|
function _AssetContents() {
|
|
52
39
|
const data = require("./AssetContents");
|
|
53
|
-
|
|
54
40
|
_AssetContents = function () {
|
|
55
41
|
return data;
|
|
56
42
|
};
|
|
57
|
-
|
|
58
43
|
return data;
|
|
59
44
|
}
|
|
60
|
-
|
|
61
45
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
62
|
-
|
|
63
46
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
64
|
-
|
|
65
47
|
const {
|
|
66
48
|
getProjectName
|
|
67
49
|
} = _configPlugins().IOSConfig.XcodeUtils;
|
|
68
|
-
|
|
69
50
|
const withIosIcons = config => {
|
|
70
51
|
return (0, _configPlugins().withDangerousMod)(config, ['ios', async config => {
|
|
71
52
|
await setIconsAsync(config, config.modRequest.projectRoot);
|
|
72
53
|
return config;
|
|
73
54
|
}]);
|
|
74
55
|
};
|
|
75
|
-
|
|
76
56
|
exports.withIosIcons = withIosIcons;
|
|
77
57
|
const IMAGE_CACHE_NAME = 'icons';
|
|
78
|
-
const IMAGESET_PATH = 'Images.xcassets/AppIcon.appiconset';
|
|
58
|
+
const IMAGESET_PATH = 'Images.xcassets/AppIcon.appiconset';
|
|
79
59
|
|
|
60
|
+
// Hard-coding seemed like the clearest and safest way to implement the sizes.
|
|
80
61
|
const ICON_CONTENTS = [{
|
|
81
62
|
idiom: 'iphone',
|
|
82
63
|
sizes: [{
|
|
@@ -91,7 +72,8 @@ const ICON_CONTENTS = [{
|
|
|
91
72
|
}, {
|
|
92
73
|
size: 60,
|
|
93
74
|
scales: [2, 3]
|
|
94
|
-
}
|
|
75
|
+
}
|
|
76
|
+
// TODO: 76x76@2x seems unused now
|
|
95
77
|
// {
|
|
96
78
|
// size: 76,
|
|
97
79
|
// scales: [2],
|
|
@@ -123,47 +105,44 @@ const ICON_CONTENTS = [{
|
|
|
123
105
|
}]
|
|
124
106
|
}];
|
|
125
107
|
exports.ICON_CONTENTS = ICON_CONTENTS;
|
|
126
|
-
|
|
127
108
|
function getIcons(config) {
|
|
128
109
|
var _config$ios;
|
|
129
|
-
|
|
130
110
|
// No support for empty strings.
|
|
131
111
|
return ((_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.icon) || config.icon || null;
|
|
132
112
|
}
|
|
133
|
-
|
|
134
113
|
async function setIconsAsync(config, projectRoot) {
|
|
135
114
|
const icon = getIcons(config);
|
|
136
|
-
|
|
137
115
|
if (!icon) {
|
|
138
116
|
_configPlugins().WarningAggregator.addWarningIOS('icon', 'This is the image that your app uses on your home screen, you will need to configure it manually.');
|
|
139
|
-
|
|
140
117
|
return;
|
|
141
|
-
}
|
|
118
|
+
}
|
|
142
119
|
|
|
120
|
+
// Something like projectRoot/ios/MyApp/
|
|
121
|
+
const iosNamedProjectRoot = getIosNamedProjectPath(projectRoot);
|
|
143
122
|
|
|
144
|
-
|
|
123
|
+
// Ensure the Images.xcassets/AppIcon.appiconset path exists
|
|
124
|
+
await fs().ensureDir((0, _path().join)(iosNamedProjectRoot, IMAGESET_PATH));
|
|
145
125
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const imagesJson = []; // keep track of icons that have been generated so we can reuse them in the Contents.json
|
|
126
|
+
// Store the image JSON data for assigning via the Contents.json
|
|
127
|
+
const imagesJson = [];
|
|
149
128
|
|
|
129
|
+
// keep track of icons that have been generated so we can reuse them in the Contents.json
|
|
150
130
|
const generatedIcons = {};
|
|
151
|
-
|
|
152
131
|
for (const platform of ICON_CONTENTS) {
|
|
153
132
|
const isMarketing = platform.idiom === 'ios-marketing';
|
|
154
|
-
|
|
155
133
|
for (const {
|
|
156
134
|
size,
|
|
157
135
|
scales
|
|
158
136
|
} of platform.sizes) {
|
|
159
137
|
for (const scale of scales) {
|
|
160
138
|
// The marketing icon is special because it makes no sense.
|
|
161
|
-
const filename = isMarketing ? 'ItunesArtwork@2x.png' : getAppleIconName(size, scale);
|
|
162
|
-
|
|
139
|
+
const filename = isMarketing ? 'ItunesArtwork@2x.png' : getAppleIconName(size, scale);
|
|
140
|
+
// Only create an image that hasn't already been generated.
|
|
163
141
|
if (!(filename in generatedIcons)) {
|
|
164
|
-
const iconSizePx = size * scale;
|
|
165
|
-
// this method also supports remote URLs and using the global sharp instance.
|
|
142
|
+
const iconSizePx = size * scale;
|
|
166
143
|
|
|
144
|
+
// Using this method will cache the images in `.expo` based on the properties used to generate them.
|
|
145
|
+
// this method also supports remote URLs and using the global sharp instance.
|
|
167
146
|
const {
|
|
168
147
|
source
|
|
169
148
|
} = await (0, _imageUtils().generateImageAsync)({
|
|
@@ -180,14 +159,13 @@ async function setIconsAsync(config, projectRoot) {
|
|
|
180
159
|
// Force the background color to solid white to prevent any transparency.
|
|
181
160
|
// TODO: Maybe use a more adaptive option based on the icon color?
|
|
182
161
|
backgroundColor: '#ffffff'
|
|
183
|
-
});
|
|
184
|
-
|
|
162
|
+
});
|
|
163
|
+
// Write image buffer to the file system.
|
|
185
164
|
const assetPath = (0, _path().join)(iosNamedProjectRoot, IMAGESET_PATH, filename);
|
|
186
|
-
await fs().writeFile(assetPath, source);
|
|
187
|
-
|
|
165
|
+
await fs().writeFile(assetPath, source);
|
|
166
|
+
// Save a reference to the generated image so we don't create a duplicate.
|
|
188
167
|
generatedIcons[filename] = true;
|
|
189
168
|
}
|
|
190
|
-
|
|
191
169
|
imagesJson.push({
|
|
192
170
|
idiom: platform.idiom,
|
|
193
171
|
size: `${size}x${size}`,
|
|
@@ -197,25 +175,23 @@ async function setIconsAsync(config, projectRoot) {
|
|
|
197
175
|
});
|
|
198
176
|
}
|
|
199
177
|
}
|
|
200
|
-
}
|
|
201
|
-
|
|
178
|
+
}
|
|
202
179
|
|
|
180
|
+
// Finally, write the Config.json
|
|
203
181
|
await (0, _AssetContents().writeContentsJsonAsync)((0, _path().join)(iosNamedProjectRoot, IMAGESET_PATH), {
|
|
204
182
|
images: imagesJson
|
|
205
183
|
});
|
|
206
184
|
}
|
|
185
|
+
|
|
207
186
|
/**
|
|
208
187
|
* Return the project's named iOS path: ios/MyProject/
|
|
209
188
|
*
|
|
210
189
|
* @param projectRoot Expo project root path.
|
|
211
190
|
*/
|
|
212
|
-
|
|
213
|
-
|
|
214
191
|
function getIosNamedProjectPath(projectRoot) {
|
|
215
192
|
const projectName = getProjectName(projectRoot);
|
|
216
193
|
return (0, _path().join)(projectRoot, 'ios', projectName);
|
|
217
194
|
}
|
|
218
|
-
|
|
219
195
|
function getAppleIconName(size, scale) {
|
|
220
196
|
return `App-Icon-${size}x${size}@${scale}x.png`;
|
|
221
197
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosIcons.js","names":["getProjectName","IOSConfig","XcodeUtils","withIosIcons","config","withDangerousMod","setIconsAsync","modRequest","projectRoot","IMAGE_CACHE_NAME","IMAGESET_PATH","ICON_CONTENTS","idiom","sizes","size","scales","getIcons","ios","icon","WarningAggregator","addWarningIOS","iosNamedProjectRoot","getIosNamedProjectPath","fs","ensureDir","join","imagesJson","generatedIcons","platform","isMarketing","scale","filename","getAppleIconName","iconSizePx","source","generateImageAsync","cacheType","src","name","width","height","removeTransparency","resizeMode","backgroundColor","assetPath","writeFile","push","writeContentsJsonAsync","images","projectName"],"sources":["../../../src/plugins/icons/withIosIcons.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, WarningAggregator, withDangerousMod } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport { generateImageAsync } from '@expo/image-utils';\nimport * as fs from 'fs-extra';\nimport { join } from 'path';\n\nimport { ContentsJson, ContentsJsonImageIdiom, writeContentsJsonAsync } from './AssetContents';\n\nconst { getProjectName } = IOSConfig.XcodeUtils;\n\nexport const withIosIcons: ConfigPlugin = (config) => {\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n await setIconsAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\nconst IMAGE_CACHE_NAME = 'icons';\nconst IMAGESET_PATH = 'Images.xcassets/AppIcon.appiconset';\n\n// Hard-coding seemed like the clearest and safest way to implement the sizes.\nexport const ICON_CONTENTS: {\n idiom: ContentsJsonImageIdiom;\n sizes: { size: number; scales: (1 | 2 | 3)[] }[];\n}[] = [\n {\n idiom: 'iphone',\n sizes: [\n {\n size: 20,\n scales: [2, 3],\n },\n {\n size: 29,\n scales: [1, 2, 3],\n },\n {\n size: 40,\n scales: [2, 3],\n },\n {\n size: 60,\n scales: [2, 3],\n },\n // TODO: 76x76@2x seems unused now\n // {\n // size: 76,\n // scales: [2],\n // },\n ],\n },\n {\n idiom: 'ipad',\n sizes: [\n {\n size: 20,\n scales: [1, 2],\n },\n {\n size: 29,\n scales: [1, 2],\n },\n {\n size: 40,\n scales: [1, 2],\n },\n {\n size: 76,\n scales: [1, 2],\n },\n {\n size: 83.5,\n scales: [2],\n },\n ],\n },\n {\n idiom: 'ios-marketing',\n sizes: [\n {\n size: 1024,\n scales: [1],\n },\n ],\n },\n];\n\nexport function getIcons(config: Pick<ExpoConfig, 'icon' | 'ios'>): string | null {\n // No support for empty strings.\n return config.ios?.icon || config.icon || null;\n}\n\nexport async function setIconsAsync(config: ExpoConfig, projectRoot: string) {\n const icon = getIcons(config);\n if (!icon) {\n WarningAggregator.addWarningIOS(\n 'icon',\n 'This is the image that your app uses on your home screen, you will need to configure it manually.'\n );\n return;\n }\n\n // Something like projectRoot/ios/MyApp/\n const iosNamedProjectRoot = getIosNamedProjectPath(projectRoot);\n\n // Ensure the Images.xcassets/AppIcon.appiconset path exists\n await fs.ensureDir(join(iosNamedProjectRoot, IMAGESET_PATH));\n\n // Store the image JSON data for assigning via the Contents.json\n const imagesJson: ContentsJson['images'] = [];\n\n // keep track of icons that have been generated so we can reuse them in the Contents.json\n const generatedIcons: Record<string, boolean> = {};\n\n for (const platform of ICON_CONTENTS) {\n const isMarketing = platform.idiom === 'ios-marketing';\n for (const { size, scales } of platform.sizes) {\n for (const scale of scales) {\n // The marketing icon is special because it makes no sense.\n const filename = isMarketing ? 'ItunesArtwork@2x.png' : getAppleIconName(size, scale);\n // Only create an image that hasn't already been generated.\n if (!(filename in generatedIcons)) {\n const iconSizePx = size * scale;\n\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync(\n { projectRoot, cacheType: IMAGE_CACHE_NAME },\n {\n src: icon,\n name: filename,\n width: iconSizePx,\n height: iconSizePx,\n removeTransparency: true,\n // The icon should be square, but if it's not then it will be cropped.\n resizeMode: 'cover',\n // Force the background color to solid white to prevent any transparency.\n // TODO: Maybe use a more adaptive option based on the icon color?\n backgroundColor: '#ffffff',\n }\n );\n // Write image buffer to the file system.\n const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(assetPath, source);\n // Save a reference to the generated image so we don't create a duplicate.\n generatedIcons[filename] = true;\n }\n imagesJson.push({\n idiom: platform.idiom,\n size: `${size}x${size}`,\n // @ts-ignore: template types not supported in TS yet\n scale: `${scale}x`,\n filename,\n });\n }\n }\n }\n\n // Finally, write the Config.json\n await writeContentsJsonAsync(join(iosNamedProjectRoot, IMAGESET_PATH), { images: imagesJson });\n}\n\n/**\n * Return the project's named iOS path: ios/MyProject/\n *\n * @param projectRoot Expo project root path.\n */\nfunction getIosNamedProjectPath(projectRoot: string): string {\n const projectName = getProjectName(projectRoot);\n return join(projectRoot, 'ios', projectName);\n}\n\nfunction getAppleIconName(size: number, scale: number): string {\n return `App-Icon-${size}x${size}@${scale}x.png`;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"withIosIcons.js","names":["getProjectName","IOSConfig","XcodeUtils","withIosIcons","config","withDangerousMod","setIconsAsync","modRequest","projectRoot","IMAGE_CACHE_NAME","IMAGESET_PATH","ICON_CONTENTS","idiom","sizes","size","scales","getIcons","ios","icon","WarningAggregator","addWarningIOS","iosNamedProjectRoot","getIosNamedProjectPath","fs","ensureDir","join","imagesJson","generatedIcons","platform","isMarketing","scale","filename","getAppleIconName","iconSizePx","source","generateImageAsync","cacheType","src","name","width","height","removeTransparency","resizeMode","backgroundColor","assetPath","writeFile","push","writeContentsJsonAsync","images","projectName"],"sources":["../../../src/plugins/icons/withIosIcons.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, WarningAggregator, withDangerousMod } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport { generateImageAsync } from '@expo/image-utils';\nimport * as fs from 'fs-extra';\nimport { join } from 'path';\n\nimport { ContentsJson, ContentsJsonImageIdiom, writeContentsJsonAsync } from './AssetContents';\n\nconst { getProjectName } = IOSConfig.XcodeUtils;\n\nexport const withIosIcons: ConfigPlugin = (config) => {\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n await setIconsAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\nconst IMAGE_CACHE_NAME = 'icons';\nconst IMAGESET_PATH = 'Images.xcassets/AppIcon.appiconset';\n\n// Hard-coding seemed like the clearest and safest way to implement the sizes.\nexport const ICON_CONTENTS: {\n idiom: ContentsJsonImageIdiom;\n sizes: { size: number; scales: (1 | 2 | 3)[] }[];\n}[] = [\n {\n idiom: 'iphone',\n sizes: [\n {\n size: 20,\n scales: [2, 3],\n },\n {\n size: 29,\n scales: [1, 2, 3],\n },\n {\n size: 40,\n scales: [2, 3],\n },\n {\n size: 60,\n scales: [2, 3],\n },\n // TODO: 76x76@2x seems unused now\n // {\n // size: 76,\n // scales: [2],\n // },\n ],\n },\n {\n idiom: 'ipad',\n sizes: [\n {\n size: 20,\n scales: [1, 2],\n },\n {\n size: 29,\n scales: [1, 2],\n },\n {\n size: 40,\n scales: [1, 2],\n },\n {\n size: 76,\n scales: [1, 2],\n },\n {\n size: 83.5,\n scales: [2],\n },\n ],\n },\n {\n idiom: 'ios-marketing',\n sizes: [\n {\n size: 1024,\n scales: [1],\n },\n ],\n },\n];\n\nexport function getIcons(config: Pick<ExpoConfig, 'icon' | 'ios'>): string | null {\n // No support for empty strings.\n return config.ios?.icon || config.icon || null;\n}\n\nexport async function setIconsAsync(config: ExpoConfig, projectRoot: string) {\n const icon = getIcons(config);\n if (!icon) {\n WarningAggregator.addWarningIOS(\n 'icon',\n 'This is the image that your app uses on your home screen, you will need to configure it manually.'\n );\n return;\n }\n\n // Something like projectRoot/ios/MyApp/\n const iosNamedProjectRoot = getIosNamedProjectPath(projectRoot);\n\n // Ensure the Images.xcassets/AppIcon.appiconset path exists\n await fs.ensureDir(join(iosNamedProjectRoot, IMAGESET_PATH));\n\n // Store the image JSON data for assigning via the Contents.json\n const imagesJson: ContentsJson['images'] = [];\n\n // keep track of icons that have been generated so we can reuse them in the Contents.json\n const generatedIcons: Record<string, boolean> = {};\n\n for (const platform of ICON_CONTENTS) {\n const isMarketing = platform.idiom === 'ios-marketing';\n for (const { size, scales } of platform.sizes) {\n for (const scale of scales) {\n // The marketing icon is special because it makes no sense.\n const filename = isMarketing ? 'ItunesArtwork@2x.png' : getAppleIconName(size, scale);\n // Only create an image that hasn't already been generated.\n if (!(filename in generatedIcons)) {\n const iconSizePx = size * scale;\n\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync(\n { projectRoot, cacheType: IMAGE_CACHE_NAME },\n {\n src: icon,\n name: filename,\n width: iconSizePx,\n height: iconSizePx,\n removeTransparency: true,\n // The icon should be square, but if it's not then it will be cropped.\n resizeMode: 'cover',\n // Force the background color to solid white to prevent any transparency.\n // TODO: Maybe use a more adaptive option based on the icon color?\n backgroundColor: '#ffffff',\n }\n );\n // Write image buffer to the file system.\n const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(assetPath, source);\n // Save a reference to the generated image so we don't create a duplicate.\n generatedIcons[filename] = true;\n }\n imagesJson.push({\n idiom: platform.idiom,\n size: `${size}x${size}`,\n // @ts-ignore: template types not supported in TS yet\n scale: `${scale}x`,\n filename,\n });\n }\n }\n }\n\n // Finally, write the Config.json\n await writeContentsJsonAsync(join(iosNamedProjectRoot, IMAGESET_PATH), { images: imagesJson });\n}\n\n/**\n * Return the project's named iOS path: ios/MyProject/\n *\n * @param projectRoot Expo project root path.\n */\nfunction getIosNamedProjectPath(projectRoot: string): string {\n const projectName = getProjectName(projectRoot);\n return join(projectRoot, 'ios', projectName);\n}\n\nfunction getAppleIconName(size: number, scale: number): string {\n return `App-Icon-${size}x${size}@${scale}x.png`;\n}\n"],"mappings":"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"}
|
|
@@ -4,46 +4,36 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createLegacyPlugin = createLegacyPlugin;
|
|
7
|
-
|
|
8
7
|
function _configPlugins() {
|
|
9
8
|
const data = require("@expo/config-plugins");
|
|
10
|
-
|
|
11
9
|
_configPlugins = function () {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
const toCamelCase = s => s.replace(/-./g, x => x.toUpperCase()[1]);
|
|
19
|
-
|
|
20
15
|
function isModuleExcluded(config, packageName) {
|
|
21
16
|
var _config$_internal;
|
|
22
|
-
|
|
23
17
|
// Skip using the versioned plugin when autolinking is enabled
|
|
24
18
|
// and doesn't link the native module.
|
|
25
19
|
return ((_config$_internal = config._internal) === null || _config$_internal === void 0 ? void 0 : _config$_internal.autolinkedModules) && !config._internal.autolinkedModules.includes(packageName);
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function createLegacyPlugin({
|
|
29
22
|
packageName,
|
|
30
23
|
fallback
|
|
31
24
|
}) {
|
|
32
25
|
let withFallback;
|
|
33
|
-
|
|
34
26
|
if (Array.isArray(fallback)) {
|
|
35
27
|
withFallback = config => (0, _configPlugins().withPlugins)(config, fallback);
|
|
36
28
|
} else {
|
|
37
29
|
withFallback = fallback;
|
|
38
30
|
}
|
|
39
|
-
|
|
40
31
|
const withUnknown = config => {
|
|
41
32
|
// Skip using the versioned plugin when autolinking is enabled
|
|
42
33
|
// and doesn't link the native module.
|
|
43
34
|
if (isModuleExcluded(config, packageName)) {
|
|
44
35
|
return (0, _configPlugins().createRunOncePlugin)(withFallback, packageName)(config);
|
|
45
36
|
}
|
|
46
|
-
|
|
47
37
|
return (0, _configPlugins().withStaticPlugin)(config, {
|
|
48
38
|
_isLegacyPlugin: true,
|
|
49
39
|
plugin: packageName,
|
|
@@ -51,7 +41,6 @@ function createLegacyPlugin({
|
|
|
51
41
|
fallback: (0, _configPlugins().createRunOncePlugin)(withFallback, packageName)
|
|
52
42
|
});
|
|
53
43
|
};
|
|
54
|
-
|
|
55
44
|
const methodName = toCamelCase(`with-${packageName}`);
|
|
56
45
|
Object.defineProperty(withUnknown, 'name', {
|
|
57
46
|
value: methodName
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createLegacyPlugin.js","names":["toCamelCase","s","replace","x","toUpperCase","isModuleExcluded","config","packageName","_internal","autolinkedModules","includes","createLegacyPlugin","fallback","withFallback","Array","isArray","withPlugins","withUnknown","createRunOncePlugin","withStaticPlugin","_isLegacyPlugin","plugin","methodName","Object","defineProperty","value"],"sources":["../../../src/plugins/unversioned/createLegacyPlugin.ts"],"sourcesContent":["import {\n ConfigPlugin,\n createRunOncePlugin,\n PluginParameters,\n withPlugins,\n withStaticPlugin,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst toCamelCase = (s: string) => s.replace(/-./g, (x) => x.toUpperCase()[1]);\n\nfunction isModuleExcluded(config: Pick<ExpoConfig, '_internal'>, packageName: string): boolean {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n return (\n config._internal?.autolinkedModules && !config._internal.autolinkedModules.includes(packageName)\n );\n}\n\nexport function createLegacyPlugin({\n packageName,\n fallback,\n}: {\n packageName: string;\n fallback: ConfigPlugin | PluginParameters<typeof withPlugins>;\n}): ConfigPlugin {\n let withFallback: ConfigPlugin;\n\n if (Array.isArray(fallback)) {\n withFallback = (config) => withPlugins(config, fallback);\n } else {\n withFallback = fallback;\n }\n\n const withUnknown: ConfigPlugin = (config) => {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n if (isModuleExcluded(config, packageName)) {\n return createRunOncePlugin(withFallback, packageName)(config);\n }\n\n return withStaticPlugin(config, {\n _isLegacyPlugin: true,\n plugin: packageName,\n // If the static plugin isn't found, use the unversioned one.\n fallback: createRunOncePlugin(withFallback, packageName),\n });\n };\n\n const methodName = toCamelCase(`with-${packageName}`);\n Object.defineProperty(withUnknown, 'name', {\n value: methodName,\n });\n\n return withUnknown;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createLegacyPlugin.js","names":["toCamelCase","s","replace","x","toUpperCase","isModuleExcluded","config","packageName","_internal","autolinkedModules","includes","createLegacyPlugin","fallback","withFallback","Array","isArray","withPlugins","withUnknown","createRunOncePlugin","withStaticPlugin","_isLegacyPlugin","plugin","methodName","Object","defineProperty","value"],"sources":["../../../src/plugins/unversioned/createLegacyPlugin.ts"],"sourcesContent":["import {\n ConfigPlugin,\n createRunOncePlugin,\n PluginParameters,\n withPlugins,\n withStaticPlugin,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst toCamelCase = (s: string) => s.replace(/-./g, (x) => x.toUpperCase()[1]);\n\nfunction isModuleExcluded(config: Pick<ExpoConfig, '_internal'>, packageName: string): boolean {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n return (\n config._internal?.autolinkedModules && !config._internal.autolinkedModules.includes(packageName)\n );\n}\n\nexport function createLegacyPlugin({\n packageName,\n fallback,\n}: {\n packageName: string;\n fallback: ConfigPlugin | PluginParameters<typeof withPlugins>;\n}): ConfigPlugin {\n let withFallback: ConfigPlugin;\n\n if (Array.isArray(fallback)) {\n withFallback = (config) => withPlugins(config, fallback);\n } else {\n withFallback = fallback;\n }\n\n const withUnknown: ConfigPlugin = (config) => {\n // Skip using the versioned plugin when autolinking is enabled\n // and doesn't link the native module.\n if (isModuleExcluded(config, packageName)) {\n return createRunOncePlugin(withFallback, packageName)(config);\n }\n\n return withStaticPlugin(config, {\n _isLegacyPlugin: true,\n plugin: packageName,\n // If the static plugin isn't found, use the unversioned one.\n fallback: createRunOncePlugin(withFallback, packageName),\n });\n };\n\n const methodName = toCamelCase(`with-${packageName}`);\n Object.defineProperty(withUnknown, 'name', {\n value: methodName,\n });\n\n return withUnknown;\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AASA,MAAMA,WAAW,GAAIC,CAAS,IAAKA,CAAC,CAACC,OAAO,CAAC,KAAK,EAAGC,CAAC,IAAKA,CAAC,CAACC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;AAE9E,SAASC,gBAAgB,CAACC,MAAqC,EAAEC,WAAmB,EAAW;EAAA;EAC7F;EACA;EACA,OACE,sBAAAD,MAAM,CAACE,SAAS,sDAAhB,kBAAkBC,iBAAiB,KAAI,CAACH,MAAM,CAACE,SAAS,CAACC,iBAAiB,CAACC,QAAQ,CAACH,WAAW,CAAC;AAEpG;AAEO,SAASI,kBAAkB,CAAC;EACjCJ,WAAW;EACXK;AAIF,CAAC,EAAgB;EACf,IAAIC,YAA0B;EAE9B,IAAIC,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,EAAE;IAC3BC,YAAY,GAAIP,MAAM,IAAK,IAAAU,4BAAW,EAACV,MAAM,EAAEM,QAAQ,CAAC;EAC1D,CAAC,MAAM;IACLC,YAAY,GAAGD,QAAQ;EACzB;EAEA,MAAMK,WAAyB,GAAIX,MAAM,IAAK;IAC5C;IACA;IACA,IAAID,gBAAgB,CAACC,MAAM,EAAEC,WAAW,CAAC,EAAE;MACzC,OAAO,IAAAW,oCAAmB,EAACL,YAAY,EAAEN,WAAW,CAAC,CAACD,MAAM,CAAC;IAC/D;IAEA,OAAO,IAAAa,iCAAgB,EAACb,MAAM,EAAE;MAC9Bc,eAAe,EAAE,IAAI;MACrBC,MAAM,EAAEd,WAAW;MACnB;MACAK,QAAQ,EAAE,IAAAM,oCAAmB,EAACL,YAAY,EAAEN,WAAW;IACzD,CAAC,CAAC;EACJ,CAAC;EAED,MAAMe,UAAU,GAAGtB,WAAW,CAAE,QAAOO,WAAY,EAAC,CAAC;EACrDgB,MAAM,CAACC,cAAc,CAACP,WAAW,EAAE,MAAM,EAAE;IACzCQ,KAAK,EAAEH;EACT,CAAC,CAAC;EAEF,OAAOL,WAAW;AACpB"}
|
|
@@ -4,41 +4,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
function _createLegacyPlugin() {
|
|
9
8
|
const data = require("../createLegacyPlugin");
|
|
10
|
-
|
|
11
9
|
_createLegacyPlugin = function () {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _withAndroidAdMob() {
|
|
19
15
|
const data = require("./withAndroidAdMob");
|
|
20
|
-
|
|
21
16
|
_withAndroidAdMob = function () {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _withIosAdMob() {
|
|
29
22
|
const data = require("./withIosAdMob");
|
|
30
|
-
|
|
31
23
|
_withIosAdMob = function () {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
var _default = (0, _createLegacyPlugin().createLegacyPlugin)({
|
|
39
29
|
packageName: 'expo-ads-admob',
|
|
40
30
|
fallback: [_withAndroidAdMob().withAndroidAdMob, _withIosAdMob().withIosAdMob]
|
|
41
31
|
});
|
|
42
|
-
|
|
43
32
|
exports.default = _default;
|
|
44
33
|
//# sourceMappingURL=expo-ads-admob.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expo-ads-admob.js","names":["createLegacyPlugin","packageName","fallback","withAndroidAdMob","withIosAdMob"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/expo-ads-admob.ts"],"sourcesContent":["import { createLegacyPlugin } from '../createLegacyPlugin';\nimport { withAndroidAdMob } from './withAndroidAdMob';\nimport { withIosAdMob } from './withIosAdMob';\n\nexport default createLegacyPlugin({\n packageName: 'expo-ads-admob',\n fallback: [withAndroidAdMob, withIosAdMob],\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"expo-ads-admob.js","names":["createLegacyPlugin","packageName","fallback","withAndroidAdMob","withIosAdMob"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/expo-ads-admob.ts"],"sourcesContent":["import { createLegacyPlugin } from '../createLegacyPlugin';\nimport { withAndroidAdMob } from './withAndroidAdMob';\nimport { withIosAdMob } from './withIosAdMob';\n\nexport default createLegacyPlugin({\n packageName: 'expo-ads-admob',\n fallback: [withAndroidAdMob, withIosAdMob],\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA8C,eAE/B,IAAAA,wCAAkB,EAAC;EAChCC,WAAW,EAAE,gBAAgB;EAC7BC,QAAQ,EAAE,CAACC,oCAAgB,EAAEC,4BAAY;AAC3C,CAAC,CAAC;AAAA"}
|
|
@@ -7,52 +7,39 @@ exports.getGoogleMobileAdsAppId = getGoogleMobileAdsAppId;
|
|
|
7
7
|
exports.getGoogleMobileAdsAutoInit = getGoogleMobileAdsAutoInit;
|
|
8
8
|
exports.setAdMobConfig = setAdMobConfig;
|
|
9
9
|
exports.withAndroidAdMob = void 0;
|
|
10
|
-
|
|
11
10
|
function _configPlugins() {
|
|
12
11
|
const data = require("@expo/config-plugins");
|
|
13
|
-
|
|
14
12
|
_configPlugins = function () {
|
|
15
13
|
return data;
|
|
16
14
|
};
|
|
17
|
-
|
|
18
15
|
return data;
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
const {
|
|
22
18
|
addMetaDataItemToMainApplication,
|
|
23
19
|
getMainApplicationOrThrow,
|
|
24
20
|
removeMetaDataItemFromMainApplication
|
|
25
21
|
} = _configPlugins().AndroidConfig.Manifest;
|
|
26
|
-
|
|
27
22
|
const META_APPLICATION_ID = 'com.google.android.gms.ads.APPLICATION_ID';
|
|
28
23
|
const META_DELAY_APP_MEASUREMENT_INIT = 'com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT';
|
|
29
|
-
|
|
30
24
|
const withAndroidAdMob = config => {
|
|
31
25
|
return (0, _configPlugins().withAndroidManifest)(config, config => {
|
|
32
26
|
config.modResults = setAdMobConfig(config, config.modResults);
|
|
33
27
|
return config;
|
|
34
28
|
});
|
|
35
29
|
};
|
|
36
|
-
|
|
37
30
|
exports.withAndroidAdMob = withAndroidAdMob;
|
|
38
|
-
|
|
39
31
|
function getGoogleMobileAdsAppId(config) {
|
|
40
32
|
var _config$android$confi, _config$android, _config$android$confi2;
|
|
41
|
-
|
|
42
33
|
return (_config$android$confi = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : (_config$android$confi2 = _config$android.config) === null || _config$android$confi2 === void 0 ? void 0 : _config$android$confi2.googleMobileAdsAppId) !== null && _config$android$confi !== void 0 ? _config$android$confi : null;
|
|
43
34
|
}
|
|
44
|
-
|
|
45
35
|
function getGoogleMobileAdsAutoInit(config) {
|
|
46
36
|
var _config$android$confi3, _config$android2, _config$android2$conf;
|
|
47
|
-
|
|
48
37
|
return (_config$android$confi3 = (_config$android2 = config.android) === null || _config$android2 === void 0 ? void 0 : (_config$android2$conf = _config$android2.config) === null || _config$android2$conf === void 0 ? void 0 : _config$android2$conf.googleMobileAdsAutoInit) !== null && _config$android$confi3 !== void 0 ? _config$android$confi3 : false;
|
|
49
38
|
}
|
|
50
|
-
|
|
51
39
|
function setAdMobConfig(config, androidManifest) {
|
|
52
40
|
const appId = getGoogleMobileAdsAppId(config);
|
|
53
41
|
const autoInit = getGoogleMobileAdsAutoInit(config);
|
|
54
42
|
const mainApplication = getMainApplicationOrThrow(androidManifest);
|
|
55
|
-
|
|
56
43
|
if (appId) {
|
|
57
44
|
addMetaDataItemToMainApplication(mainApplication, META_APPLICATION_ID, appId);
|
|
58
45
|
addMetaDataItemToMainApplication(mainApplication, META_DELAY_APP_MEASUREMENT_INIT, String(!autoInit));
|
|
@@ -60,7 +47,6 @@ function setAdMobConfig(config, androidManifest) {
|
|
|
60
47
|
removeMetaDataItemFromMainApplication(mainApplication, META_APPLICATION_ID);
|
|
61
48
|
removeMetaDataItemFromMainApplication(mainApplication, META_DELAY_APP_MEASUREMENT_INIT);
|
|
62
49
|
}
|
|
63
|
-
|
|
64
50
|
return androidManifest;
|
|
65
51
|
}
|
|
66
52
|
//# sourceMappingURL=withAndroidAdMob.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withAndroidAdMob.js","names":["addMetaDataItemToMainApplication","getMainApplicationOrThrow","removeMetaDataItemFromMainApplication","AndroidConfig","Manifest","META_APPLICATION_ID","META_DELAY_APP_MEASUREMENT_INIT","withAndroidAdMob","config","withAndroidManifest","modResults","setAdMobConfig","getGoogleMobileAdsAppId","android","googleMobileAdsAppId","getGoogleMobileAdsAutoInit","googleMobileAdsAutoInit","androidManifest","appId","autoInit","mainApplication","String"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/withAndroidAdMob.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withAndroidManifest } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst {\n addMetaDataItemToMainApplication,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n} = AndroidConfig.Manifest;\n\nconst META_APPLICATION_ID = 'com.google.android.gms.ads.APPLICATION_ID';\nconst META_DELAY_APP_MEASUREMENT_INIT = 'com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT';\n\nexport const withAndroidAdMob: ConfigPlugin = (config) => {\n return withAndroidManifest(config, (config) => {\n config.modResults = setAdMobConfig(config, config.modResults);\n return config;\n });\n};\n\nexport function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAppId ?? null;\n}\n\nexport function getGoogleMobileAdsAutoInit(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAutoInit ?? false;\n}\n\nexport function setAdMobConfig(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidConfig.Manifest.AndroidManifest\n) {\n const appId = getGoogleMobileAdsAppId(config);\n const autoInit = getGoogleMobileAdsAutoInit(config);\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n if (appId) {\n addMetaDataItemToMainApplication(mainApplication, META_APPLICATION_ID, appId);\n addMetaDataItemToMainApplication(\n mainApplication,\n META_DELAY_APP_MEASUREMENT_INIT,\n String(!autoInit)\n );\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, META_APPLICATION_ID);\n removeMetaDataItemFromMainApplication(mainApplication, META_DELAY_APP_MEASUREMENT_INIT);\n }\n\n return androidManifest;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"withAndroidAdMob.js","names":["addMetaDataItemToMainApplication","getMainApplicationOrThrow","removeMetaDataItemFromMainApplication","AndroidConfig","Manifest","META_APPLICATION_ID","META_DELAY_APP_MEASUREMENT_INIT","withAndroidAdMob","config","withAndroidManifest","modResults","setAdMobConfig","getGoogleMobileAdsAppId","android","googleMobileAdsAppId","getGoogleMobileAdsAutoInit","googleMobileAdsAutoInit","androidManifest","appId","autoInit","mainApplication","String"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/withAndroidAdMob.ts"],"sourcesContent":["import { AndroidConfig, ConfigPlugin, withAndroidManifest } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst {\n addMetaDataItemToMainApplication,\n getMainApplicationOrThrow,\n removeMetaDataItemFromMainApplication,\n} = AndroidConfig.Manifest;\n\nconst META_APPLICATION_ID = 'com.google.android.gms.ads.APPLICATION_ID';\nconst META_DELAY_APP_MEASUREMENT_INIT = 'com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT';\n\nexport const withAndroidAdMob: ConfigPlugin = (config) => {\n return withAndroidManifest(config, (config) => {\n config.modResults = setAdMobConfig(config, config.modResults);\n return config;\n });\n};\n\nexport function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAppId ?? null;\n}\n\nexport function getGoogleMobileAdsAutoInit(config: Pick<ExpoConfig, 'android'>) {\n return config.android?.config?.googleMobileAdsAutoInit ?? false;\n}\n\nexport function setAdMobConfig(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidConfig.Manifest.AndroidManifest\n) {\n const appId = getGoogleMobileAdsAppId(config);\n const autoInit = getGoogleMobileAdsAutoInit(config);\n const mainApplication = getMainApplicationOrThrow(androidManifest);\n\n if (appId) {\n addMetaDataItemToMainApplication(mainApplication, META_APPLICATION_ID, appId);\n addMetaDataItemToMainApplication(\n mainApplication,\n META_DELAY_APP_MEASUREMENT_INIT,\n String(!autoInit)\n );\n } else {\n removeMetaDataItemFromMainApplication(mainApplication, META_APPLICATION_ID);\n removeMetaDataItemFromMainApplication(mainApplication, META_DELAY_APP_MEASUREMENT_INIT);\n }\n\n return androidManifest;\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA,MAAM;EACJA,gCAAgC;EAChCC,yBAAyB;EACzBC;AACF,CAAC,GAAGC,8BAAa,CAACC,QAAQ;AAE1B,MAAMC,mBAAmB,GAAG,2CAA2C;AACvE,MAAMC,+BAA+B,GAAG,uDAAuD;AAExF,MAAMC,gBAA8B,GAAIC,MAAM,IAAK;EACxD,OAAO,IAAAC,oCAAmB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAC7CA,MAAM,CAACE,UAAU,GAAGC,cAAc,CAACH,MAAM,EAAEA,MAAM,CAACE,UAAU,CAAC;IAC7D,OAAOF,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAAC;AAEK,SAASI,uBAAuB,CAACJ,MAAmC,EAAE;EAAA;EAC3E,mDAAOA,MAAM,CAACK,OAAO,8EAAd,gBAAgBL,MAAM,2DAAtB,uBAAwBM,oBAAoB,yEAAI,IAAI;AAC7D;AAEO,SAASC,0BAA0B,CAACP,MAAmC,EAAE;EAAA;EAC9E,qDAAOA,MAAM,CAACK,OAAO,8EAAd,iBAAgBL,MAAM,0DAAtB,sBAAwBQ,uBAAuB,2EAAI,KAAK;AACjE;AAEO,SAASL,cAAc,CAC5BH,MAAmC,EACnCS,eAAuD,EACvD;EACA,MAAMC,KAAK,GAAGN,uBAAuB,CAACJ,MAAM,CAAC;EAC7C,MAAMW,QAAQ,GAAGJ,0BAA0B,CAACP,MAAM,CAAC;EACnD,MAAMY,eAAe,GAAGnB,yBAAyB,CAACgB,eAAe,CAAC;EAElE,IAAIC,KAAK,EAAE;IACTlB,gCAAgC,CAACoB,eAAe,EAAEf,mBAAmB,EAAEa,KAAK,CAAC;IAC7ElB,gCAAgC,CAC9BoB,eAAe,EACfd,+BAA+B,EAC/Be,MAAM,CAAC,CAACF,QAAQ,CAAC,CAClB;EACH,CAAC,MAAM;IACLjB,qCAAqC,CAACkB,eAAe,EAAEf,mBAAmB,CAAC;IAC3EH,qCAAqC,CAACkB,eAAe,EAAEd,+BAA+B,CAAC;EACzF;EAEA,OAAOW,eAAe;AACxB"}
|
|
@@ -6,54 +6,45 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getGoogleMobileAdsAppId = getGoogleMobileAdsAppId;
|
|
7
7
|
exports.setGoogleMobileAdsAppId = setGoogleMobileAdsAppId;
|
|
8
8
|
exports.withIosAdMob = void 0;
|
|
9
|
-
|
|
10
9
|
function _configPlugins() {
|
|
11
10
|
const data = require("@expo/config-plugins");
|
|
12
|
-
|
|
13
11
|
_configPlugins = function () {
|
|
14
12
|
return data;
|
|
15
13
|
};
|
|
16
|
-
|
|
17
14
|
return data;
|
|
18
15
|
}
|
|
19
|
-
|
|
20
16
|
const withIosAdMob = config => {
|
|
21
17
|
return (0, _configPlugins().withInfoPlist)(config, config => {
|
|
22
18
|
config.modResults = setAdMobConfig(config, config.modResults);
|
|
23
19
|
return config;
|
|
24
20
|
});
|
|
25
|
-
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// NOTE(brentvatne): if the developer has installed the google ads sdk and does
|
|
26
24
|
// not provide an app id their app will crash. Standalone apps get around this by
|
|
27
25
|
// providing some default value, we will instead here assume that the user can
|
|
28
26
|
// do the right thing if they have installed the package. This is a slight discrepancy
|
|
29
27
|
// that arises in ejecting because it's possible for the package to be installed and
|
|
30
28
|
// not crashing in the managed workflow, then you eject and the app crashes because
|
|
31
29
|
// you don't have an id to fall back to.
|
|
32
|
-
|
|
33
|
-
|
|
34
30
|
exports.withIosAdMob = withIosAdMob;
|
|
35
|
-
|
|
36
31
|
function getGoogleMobileAdsAppId(config) {
|
|
37
32
|
var _config$ios$config$go, _config$ios, _config$ios$config;
|
|
38
|
-
|
|
39
33
|
return (_config$ios$config$go = (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : (_config$ios$config = _config$ios.config) === null || _config$ios$config === void 0 ? void 0 : _config$ios$config.googleMobileAdsAppId) !== null && _config$ios$config$go !== void 0 ? _config$ios$config$go : null;
|
|
40
34
|
}
|
|
41
|
-
|
|
42
35
|
function setGoogleMobileAdsAppId(config, {
|
|
43
36
|
GADApplicationIdentifier,
|
|
44
37
|
...infoPlist
|
|
45
38
|
}) {
|
|
46
39
|
const appId = getGoogleMobileAdsAppId(config);
|
|
47
|
-
|
|
48
40
|
if (appId === null) {
|
|
49
41
|
return infoPlist;
|
|
50
42
|
}
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
return {
|
|
44
|
+
...infoPlist,
|
|
53
45
|
GADApplicationIdentifier: appId
|
|
54
46
|
};
|
|
55
47
|
}
|
|
56
|
-
|
|
57
48
|
function setAdMobConfig(config, infoPlist) {
|
|
58
49
|
infoPlist = setGoogleMobileAdsAppId(config, infoPlist);
|
|
59
50
|
return infoPlist;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withIosAdMob.js","names":["withIosAdMob","config","withInfoPlist","modResults","setAdMobConfig","getGoogleMobileAdsAppId","ios","googleMobileAdsAppId","setGoogleMobileAdsAppId","GADApplicationIdentifier","infoPlist","appId"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/withIosAdMob.ts"],"sourcesContent":["import { ConfigPlugin, InfoPlist, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nexport const withIosAdMob: ConfigPlugin = (config) => {\n return withInfoPlist(config, (config) => {\n config.modResults = setAdMobConfig(config, config.modResults);\n return config;\n });\n};\n\n// NOTE(brentvatne): if the developer has installed the google ads sdk and does\n// not provide an app id their app will crash. Standalone apps get around this by\n// providing some default value, we will instead here assume that the user can\n// do the right thing if they have installed the package. This is a slight discrepancy\n// that arises in ejecting because it's possible for the package to be installed and\n// not crashing in the managed workflow, then you eject and the app crashes because\n// you don't have an id to fall back to.\nexport function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.config?.googleMobileAdsAppId ?? null;\n}\n\nexport function setGoogleMobileAdsAppId(\n config: Pick<ExpoConfig, 'ios'>,\n { GADApplicationIdentifier, ...infoPlist }: InfoPlist\n): InfoPlist {\n const appId = getGoogleMobileAdsAppId(config);\n\n if (appId === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n GADApplicationIdentifier: appId,\n };\n}\n\nfunction setAdMobConfig(config: Pick<ExpoConfig, 'ios'>, infoPlist: InfoPlist): InfoPlist {\n infoPlist = setGoogleMobileAdsAppId(config, infoPlist);\n return infoPlist;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"withIosAdMob.js","names":["withIosAdMob","config","withInfoPlist","modResults","setAdMobConfig","getGoogleMobileAdsAppId","ios","googleMobileAdsAppId","setGoogleMobileAdsAppId","GADApplicationIdentifier","infoPlist","appId"],"sources":["../../../../src/plugins/unversioned/expo-ads-admob/withIosAdMob.ts"],"sourcesContent":["import { ConfigPlugin, InfoPlist, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nexport const withIosAdMob: ConfigPlugin = (config) => {\n return withInfoPlist(config, (config) => {\n config.modResults = setAdMobConfig(config, config.modResults);\n return config;\n });\n};\n\n// NOTE(brentvatne): if the developer has installed the google ads sdk and does\n// not provide an app id their app will crash. Standalone apps get around this by\n// providing some default value, we will instead here assume that the user can\n// do the right thing if they have installed the package. This is a slight discrepancy\n// that arises in ejecting because it's possible for the package to be installed and\n// not crashing in the managed workflow, then you eject and the app crashes because\n// you don't have an id to fall back to.\nexport function getGoogleMobileAdsAppId(config: Pick<ExpoConfig, 'ios'>) {\n return config.ios?.config?.googleMobileAdsAppId ?? null;\n}\n\nexport function setGoogleMobileAdsAppId(\n config: Pick<ExpoConfig, 'ios'>,\n { GADApplicationIdentifier, ...infoPlist }: InfoPlist\n): InfoPlist {\n const appId = getGoogleMobileAdsAppId(config);\n\n if (appId === null) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n GADApplicationIdentifier: appId,\n };\n}\n\nfunction setAdMobConfig(config: Pick<ExpoConfig, 'ios'>, infoPlist: InfoPlist): InfoPlist {\n infoPlist = setGoogleMobileAdsAppId(config, infoPlist);\n return infoPlist;\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,YAA0B,GAAIC,MAAM,IAAK;EACpD,OAAO,IAAAC,8BAAa,EAACD,MAAM,EAAGA,MAAM,IAAK;IACvCA,MAAM,CAACE,UAAU,GAAGC,cAAc,CAACH,MAAM,EAAEA,MAAM,CAACE,UAAU,CAAC;IAC7D,OAAOF,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACO,SAASI,uBAAuB,CAACJ,MAA+B,EAAE;EAAA;EACvE,+CAAOA,MAAM,CAACK,GAAG,sEAAV,YAAYL,MAAM,uDAAlB,mBAAoBM,oBAAoB,yEAAI,IAAI;AACzD;AAEO,SAASC,uBAAuB,CACrCP,MAA+B,EAC/B;EAAEQ,wBAAwB;EAAE,GAAGC;AAAqB,CAAC,EAC1C;EACX,MAAMC,KAAK,GAAGN,uBAAuB,CAACJ,MAAM,CAAC;EAE7C,IAAIU,KAAK,KAAK,IAAI,EAAE;IAClB,OAAOD,SAAS;EAClB;EAEA,OAAO;IACL,GAAGA,SAAS;IACZD,wBAAwB,EAAEE;EAC5B,CAAC;AACH;AAEA,SAASP,cAAc,CAACH,MAA+B,EAAES,SAAoB,EAAa;EACxFA,SAAS,GAAGF,uBAAuB,CAACP,MAAM,EAAES,SAAS,CAAC;EACtD,OAAOA,SAAS;AAClB"}
|
|
@@ -4,43 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
function _configPlugins() {
|
|
9
8
|
const data = require("@expo/config-plugins");
|
|
10
|
-
|
|
11
9
|
_configPlugins = function () {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _createLegacyPlugin() {
|
|
19
15
|
const data = require("./createLegacyPlugin");
|
|
20
|
-
|
|
21
16
|
_createLegacyPlugin = function () {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
const withAppleSignInWarning = config => {
|
|
29
22
|
return (0, _configPlugins().withEntitlementsPlist)(config, config => {
|
|
30
23
|
var _config$ios;
|
|
31
|
-
|
|
32
24
|
if ((_config$ios = config.ios) !== null && _config$ios !== void 0 && _config$ios.usesAppleSignIn) {
|
|
33
25
|
_configPlugins().WarningAggregator.addWarningIOS('ios.usesAppleSignIn', 'Install expo-apple-authentication to enable this feature', 'https://docs.expo.dev/versions/latest/sdk/apple-authentication/#eas-build');
|
|
34
26
|
}
|
|
35
|
-
|
|
36
27
|
return config;
|
|
37
28
|
});
|
|
38
29
|
};
|
|
39
|
-
|
|
40
30
|
var _default = (0, _createLegacyPlugin().createLegacyPlugin)({
|
|
41
31
|
packageName: 'expo-apple-authentication',
|
|
42
32
|
fallback: withAppleSignInWarning
|
|
43
33
|
});
|
|
44
|
-
|
|
45
34
|
exports.default = _default;
|
|
46
35
|
//# sourceMappingURL=expo-apple-authentication.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expo-apple-authentication.js","names":["withAppleSignInWarning","config","withEntitlementsPlist","ios","usesAppleSignIn","WarningAggregator","addWarningIOS","createLegacyPlugin","packageName","fallback"],"sources":["../../../src/plugins/unversioned/expo-apple-authentication.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withEntitlementsPlist } from '@expo/config-plugins';\n\nimport { createLegacyPlugin } from './createLegacyPlugin';\n\nconst withAppleSignInWarning: ConfigPlugin = (config) => {\n return withEntitlementsPlist(config, (config) => {\n if (config.ios?.usesAppleSignIn) {\n WarningAggregator.addWarningIOS(\n 'ios.usesAppleSignIn',\n 'Install expo-apple-authentication to enable this feature',\n 'https://docs.expo.dev/versions/latest/sdk/apple-authentication/#eas-build'\n );\n }\n\n return config;\n });\n};\n\nexport default createLegacyPlugin({\n packageName: 'expo-apple-authentication',\n fallback: withAppleSignInWarning,\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"expo-apple-authentication.js","names":["withAppleSignInWarning","config","withEntitlementsPlist","ios","usesAppleSignIn","WarningAggregator","addWarningIOS","createLegacyPlugin","packageName","fallback"],"sources":["../../../src/plugins/unversioned/expo-apple-authentication.ts"],"sourcesContent":["import { ConfigPlugin, WarningAggregator, withEntitlementsPlist } from '@expo/config-plugins';\n\nimport { createLegacyPlugin } from './createLegacyPlugin';\n\nconst withAppleSignInWarning: ConfigPlugin = (config) => {\n return withEntitlementsPlist(config, (config) => {\n if (config.ios?.usesAppleSignIn) {\n WarningAggregator.addWarningIOS(\n 'ios.usesAppleSignIn',\n 'Install expo-apple-authentication to enable this feature',\n 'https://docs.expo.dev/versions/latest/sdk/apple-authentication/#eas-build'\n );\n }\n\n return config;\n });\n};\n\nexport default createLegacyPlugin({\n packageName: 'expo-apple-authentication',\n fallback: withAppleSignInWarning,\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA,MAAMA,sBAAoC,GAAIC,MAAM,IAAK;EACvD,OAAO,IAAAC,sCAAqB,EAACD,MAAM,EAAGA,MAAM,IAAK;IAAA;IAC/C,mBAAIA,MAAM,CAACE,GAAG,wCAAV,YAAYC,eAAe,EAAE;MAC/BC,kCAAiB,CAACC,aAAa,CAC7B,qBAAqB,EACrB,0DAA0D,EAC1D,2EAA2E,CAC5E;IACH;IAEA,OAAOL,MAAM;EACf,CAAC,CAAC;AACJ,CAAC;AAAC,eAEa,IAAAM,wCAAkB,EAAC;EAChCC,WAAW,EAAE,2BAA2B;EACxCC,QAAQ,EAAET;AACZ,CAAC,CAAC;AAAA"}
|