@dcl/sdk-commands 7.5.8-10967536696.commit-cfc4ce5 → 7.5.8-11020113946.commit-53f6ae5
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.
@@ -20,10 +20,8 @@ export declare const args: {
|
|
20
20
|
'-b': string;
|
21
21
|
'-w': string;
|
22
22
|
'--skip-build': BooleanConstructor;
|
23
|
-
'--
|
23
|
+
'--desktop-client': BooleanConstructor;
|
24
24
|
'--data-layer': BooleanConstructor;
|
25
|
-
'-e': string;
|
26
|
-
'--customEntryPoint': BooleanConstructor;
|
27
25
|
'--explorer-alpha': BooleanConstructor;
|
28
26
|
};
|
29
27
|
export declare function help(options: Options): Promise<void>;
|
@@ -51,7 +51,6 @@ const exit_signal_1 = require("../../components/exit-signal");
|
|
51
51
|
const workspace_validations_1 = require("../../logic/workspace-validations");
|
52
52
|
const beautiful_logs_1 = require("../../logic/beautiful-logs");
|
53
53
|
const project_validations_1 = require("../../logic/project-validations");
|
54
|
-
const dao_explorer_1 = require("../../logic/dao-explorer");
|
55
54
|
const explorer_alpha_1 = require("./explorer-alpha");
|
56
55
|
exports.args = (0, args_1.declareArgs)({
|
57
56
|
'--dir': String,
|
@@ -69,10 +68,8 @@ exports.args = (0, args_1.declareArgs)({
|
|
69
68
|
'-b': '--no-browser',
|
70
69
|
'-w': '--no-watch',
|
71
70
|
'--skip-build': Boolean,
|
72
|
-
'--
|
71
|
+
'--desktop-client': Boolean,
|
73
72
|
'--data-layer': Boolean,
|
74
|
-
'-e': '--no-dao-explorer',
|
75
|
-
'--customEntryPoint': Boolean,
|
76
73
|
'--explorer-alpha': Boolean
|
77
74
|
});
|
78
75
|
async function help(options) {
|
@@ -108,8 +105,7 @@ async function main(options) {
|
|
108
105
|
const workingDirectory = path.resolve(process.cwd(), options.args['--dir'] || '.');
|
109
106
|
const isCi = options.args['--ci'] || process.env.CI || false;
|
110
107
|
const debug = !options.args['--no-debug'] && !isCi;
|
111
|
-
const
|
112
|
-
const openBrowser = (!experimentalDaoExplorer || !options.args['--no-browser']) && !isCi && !experimentalDaoExplorer;
|
108
|
+
const openBrowser = !options.args['--no-browser'] && !isCi;
|
113
109
|
const build = !options.args['--skip-build'];
|
114
110
|
const watch = !options.args['--no-watch'];
|
115
111
|
const withDataLayer = options.args['--data-layer'];
|
@@ -117,9 +113,6 @@ async function main(options) {
|
|
117
113
|
const explorerAlpha = options.args['--explorer-alpha'];
|
118
114
|
let hasSmartWearable = false;
|
119
115
|
const workspace = await (0, workspace_validations_1.getValidWorkspace)(options.components, workingDirectory);
|
120
|
-
if (experimentalDaoExplorer) {
|
121
|
-
await (0, dao_explorer_1.ensureDaoExplorer)(options.components, workspace.rootWorkingDirectory);
|
122
|
-
}
|
123
116
|
/* istanbul ignore if */
|
124
117
|
if (workspace.projects.length > 1)
|
125
118
|
(0, beautiful_logs_1.printWarning)(options.components.logger, 'Support for multiple projects is still experimental.');
|
@@ -131,15 +124,7 @@ async function main(options) {
|
|
131
124
|
// first run `npm run build`, this can be disabled with --skip-build
|
132
125
|
// then start the embedded compiler, this can be disabled with --no-watch
|
133
126
|
if (watch || build) {
|
134
|
-
await (0, build_1.buildScene)({
|
135
|
-
...options,
|
136
|
-
args: {
|
137
|
-
'--dir': project.workingDirectory,
|
138
|
-
'--watch': watch,
|
139
|
-
_: [],
|
140
|
-
'--customEntryPoint': !!options.args['--customEntryPoint']
|
141
|
-
}
|
142
|
-
}, project);
|
127
|
+
await (0, build_1.buildScene)({ ...options, args: { '--dir': project.workingDirectory, '--watch': watch, _: [] } }, project);
|
143
128
|
await (0, project_validations_1.startValidations)(options.components, project.workingDirectory);
|
144
129
|
}
|
145
130
|
// track the event
|
@@ -212,45 +197,46 @@ async function main(options) {
|
|
212
197
|
(networkInterfaces[dev] || []).forEach((details) => {
|
213
198
|
if (details.family === 'IPv4') {
|
214
199
|
const oldBackpack = 'DISABLE_backpack_editor_v2=&ENABLE_backpack_editor_v1';
|
215
|
-
|
216
|
-
let url = `${baseUrl}?position=${baseCoords.x}%2C${baseCoords.y}&${oldBackpack}`;
|
200
|
+
let addr = `http://${details.address}:${port}?position=${baseCoords.x}%2C${baseCoords.y}&${oldBackpack}`;
|
217
201
|
if (debug) {
|
218
|
-
|
202
|
+
addr = `${addr}&SCENE_DEBUG_PANEL`;
|
219
203
|
}
|
220
204
|
if (enableWeb3 || hasSmartWearable) {
|
221
|
-
|
205
|
+
addr = `${addr}&ENABLE_WEB3`;
|
222
206
|
}
|
223
|
-
availableURLs.push(
|
207
|
+
availableURLs.push(addr);
|
224
208
|
}
|
225
209
|
});
|
226
210
|
});
|
227
211
|
// Push localhost and 127.0.0.1 at top
|
228
212
|
const sortedURLs = availableURLs.sort((a, _b) => {
|
229
|
-
return a.
|
230
|
-
? -1
|
231
|
-
: 1;
|
213
|
+
return a.toLowerCase().includes('localhost') || a.includes('127.0.0.1') || a.includes('0.0.0.0') ? -1 : 1;
|
232
214
|
});
|
233
215
|
if (!explorerAlpha) {
|
234
216
|
for (const addr of sortedURLs) {
|
235
217
|
components.logger.log(` ${addr}`);
|
236
218
|
}
|
237
219
|
}
|
220
|
+
if (options.args['--desktop-client']) {
|
221
|
+
components.logger.log('\n Desktop client:\n');
|
222
|
+
for (const addr of sortedURLs) {
|
223
|
+
const searchParams = new URLSearchParams();
|
224
|
+
searchParams.append('PREVIEW-MODE', addr);
|
225
|
+
components.logger.log(` dcl://${searchParams.toString()}&`);
|
226
|
+
}
|
227
|
+
}
|
238
228
|
if (!explorerAlpha) {
|
239
229
|
components.logger.log('\n Details:\n');
|
240
230
|
}
|
241
231
|
components.logger.log('\nPress CTRL+C to exit\n');
|
242
|
-
if (experimentalDaoExplorer && sortedURLs.length) {
|
243
|
-
(0, dao_explorer_1.runDaoExplorer)(components, sortedURLs[0].base, `${baseCoords.x},${baseCoords.y}`, workingDirectory);
|
244
|
-
}
|
245
|
-
// Open preferably localhost/127.0.0.1
|
246
232
|
if (explorerAlpha) {
|
247
|
-
const realm = new URL(sortedURLs[0]
|
233
|
+
const realm = new URL(sortedURLs[0]).origin;
|
248
234
|
await (0, explorer_alpha_1.runExplorerAlpha)(components, { cwd: workingDirectory, realm, baseCoords });
|
249
235
|
}
|
250
236
|
// Open preferably localhost/127.0.0.1
|
251
|
-
if (!explorerAlpha && openBrowser && sortedURLs.length) {
|
237
|
+
if (!explorerAlpha && openBrowser && sortedURLs.length && !options.args['--desktop-client']) {
|
252
238
|
try {
|
253
|
-
await (0, open_1.default)(sortedURLs[0]
|
239
|
+
await (0, open_1.default)(sortedURLs[0]);
|
254
240
|
}
|
255
241
|
catch (_) {
|
256
242
|
components.logger.warn('Unable to open browser automatically.');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,2CAA4B;AAC5B,gDAAuB;AAGvB,oCAAqC;AACrC,2CAA8C;AAC9C,qEAA6D;AAC7D,6DAAmD;AAEnD,4DAA2E;AAC3E,kEAA6D;AAC7D,oFAAwF;AACxF,+DAAwF;AACxF,oEAA0E;AAC1E,0DAAyE;AACzE,8CAAuD;AACvD,8CAA4D;AAC5D,sEAA0E;AAC1E,4CAA4C;AAC5C,oCAA+C;AAC/C,6DAA8D;AAC9D,0CAA6D;AAC7D,8DAAwE;AACxE,6EAAqE;AACrE,+DAAyG;AAEzG,yEAAkE;AAClE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,2CAA4B;AAC5B,gDAAuB;AAGvB,oCAAqC;AACrC,2CAA8C;AAC9C,qEAA6D;AAC7D,6DAAmD;AAEnD,4DAA2E;AAC3E,kEAA6D;AAC7D,oFAAwF;AACxF,+DAAwF;AACxF,oEAA0E;AAC1E,0DAAyE;AACzE,8CAAuD;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ACV,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAA;iBAChE;aACF;QACH,CAAC;KACF,CAAC,CAAA;IAEF,mEAAmE;IACnE,8EAA8E;IAC9E,UAAU;IACV,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAA;AACjD,CAAC;AAtKD,oBAsKC"}
|
package/package.json
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dcl/sdk-commands",
|
3
3
|
"description": "",
|
4
|
-
"version": "7.5.8-
|
4
|
+
"version": "7.5.8-11020113946.commit-53f6ae5",
|
5
5
|
"author": "Decentraland",
|
6
6
|
"bin": {
|
7
7
|
"sdk-commands": "./dist/index.js"
|
8
8
|
},
|
9
9
|
"dependencies": {
|
10
10
|
"@dcl/crypto": "^3.4.4",
|
11
|
-
"@dcl/ecs": "7.5.8-
|
11
|
+
"@dcl/ecs": "7.5.8-11020113946.commit-53f6ae5",
|
12
12
|
"@dcl/hashing": "1.1.3",
|
13
|
-
"@dcl/inspector": "7.5.8-
|
13
|
+
"@dcl/inspector": "7.5.8-11020113946.commit-53f6ae5",
|
14
14
|
"@dcl/linker-dapp": "^0.14.2",
|
15
15
|
"@dcl/mini-comms": "1.0.1-20230216163137.commit-a4c75be",
|
16
|
-
"@dcl/protocol": "1.0.0-
|
16
|
+
"@dcl/protocol": "1.0.0-10955038136.commit-7fe9554",
|
17
17
|
"@dcl/quests-client": "^1.0.3",
|
18
18
|
"@dcl/quests-manager": "^0.1.4",
|
19
19
|
"@dcl/rpc": "^1.1.1",
|
@@ -38,7 +38,6 @@
|
|
38
38
|
"open": "^8.4.0",
|
39
39
|
"portfinder": "^1.0.32",
|
40
40
|
"prompts": "^2.4.2",
|
41
|
-
"tar": "^7.1.0",
|
42
41
|
"typescript": "^5.0.2",
|
43
42
|
"undici": "^5.19.1",
|
44
43
|
"uuid": "^9.0.1"
|
@@ -74,5 +73,5 @@
|
|
74
73
|
"displayName": "SDK",
|
75
74
|
"tsconfig": "./tsconfig.json"
|
76
75
|
},
|
77
|
-
"commit": "
|
76
|
+
"commit": "53f6ae5fc2241d00eb0b1e8251cf611e7e8f2efd"
|
78
77
|
}
|
@@ -1,3 +0,0 @@
|
|
1
|
-
import { CliComponents } from '../components';
|
2
|
-
export declare function ensureDaoExplorer(components: Pick<CliComponents, 'logger' | 'fs' | 'fetch'>, workingDirectory: string): Promise<void>;
|
3
|
-
export declare function runDaoExplorer(components: Pick<CliComponents, 'logger' | 'fs' | 'fetch'>, realmUrl: string, locationCoords: string, workingDirectory: string): void;
|
@@ -1,156 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
-
};
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
exports.runDaoExplorer = exports.ensureDaoExplorer = void 0;
|
30
|
-
const fs_1 = require("./fs");
|
31
|
-
const path_1 = __importDefault(require("path"));
|
32
|
-
const os_1 = require("os");
|
33
|
-
const error_1 = require("./error");
|
34
|
-
const beautiful_logs_1 = require("./beautiful-logs");
|
35
|
-
const tar = __importStar(require("tar"));
|
36
|
-
const child_process_1 = __importDefault(require("child_process"));
|
37
|
-
var SupportedPlatform;
|
38
|
-
(function (SupportedPlatform) {
|
39
|
-
SupportedPlatform[SupportedPlatform["SP_MACOS_ARM64"] = 0] = "SP_MACOS_ARM64";
|
40
|
-
SupportedPlatform[SupportedPlatform["SP_LINUX_X64"] = 1] = "SP_LINUX_X64";
|
41
|
-
SupportedPlatform[SupportedPlatform["SP_WINDOWS_X64"] = 2] = "SP_WINDOWS_X64";
|
42
|
-
SupportedPlatform[SupportedPlatform["SP_UNSUPPORTED"] = 3] = "SP_UNSUPPORTED";
|
43
|
-
})(SupportedPlatform || (SupportedPlatform = {}));
|
44
|
-
const BEVY_BASE_URL = 'https://github.com/decentraland/bevy-explorer/releases/download/alpha-2024-09-20-21-49-32/bevy-explorer-2024-09-20-21-49-32';
|
45
|
-
const BEVY_URL_PLATFORM_SUFFIX = {
|
46
|
-
[SupportedPlatform.SP_LINUX_X64]: 'linux-x86_64.tar.gz',
|
47
|
-
[SupportedPlatform.SP_MACOS_ARM64]: 'macos-m1m2.zip',
|
48
|
-
[SupportedPlatform.SP_WINDOWS_X64]: 'windows-x86_64.zip',
|
49
|
-
[SupportedPlatform.SP_UNSUPPORTED]: 'empty'
|
50
|
-
};
|
51
|
-
function getPlatform() {
|
52
|
-
const os = (0, os_1.platform)();
|
53
|
-
const arch = process.arch;
|
54
|
-
switch (os) {
|
55
|
-
case 'darwin':
|
56
|
-
if (arch === 'arm64') {
|
57
|
-
return SupportedPlatform.SP_MACOS_ARM64;
|
58
|
-
}
|
59
|
-
else {
|
60
|
-
return SupportedPlatform.SP_UNSUPPORTED;
|
61
|
-
}
|
62
|
-
case 'win32':
|
63
|
-
if (arch === 'x64') {
|
64
|
-
return SupportedPlatform.SP_WINDOWS_X64;
|
65
|
-
}
|
66
|
-
else {
|
67
|
-
return SupportedPlatform.SP_UNSUPPORTED;
|
68
|
-
}
|
69
|
-
case 'linux':
|
70
|
-
if (arch === 'x64') {
|
71
|
-
return SupportedPlatform.SP_LINUX_X64;
|
72
|
-
}
|
73
|
-
else {
|
74
|
-
return SupportedPlatform.SP_UNSUPPORTED;
|
75
|
-
}
|
76
|
-
default:
|
77
|
-
return SupportedPlatform.SP_UNSUPPORTED;
|
78
|
-
}
|
79
|
-
}
|
80
|
-
function getDaoExplorerPath(workingDirectory) {
|
81
|
-
// Reliable way to get the path to get the first active node_module folder
|
82
|
-
const sdkPath = require.resolve('@dcl/sdk');
|
83
|
-
if (sdkPath !== null) {
|
84
|
-
// SDK-path is something like /node_modules/@dcl/sdk/index.js
|
85
|
-
return path_1.default.resolve(sdkPath, '..', '..', '..', '.bin', 'dao-explorer');
|
86
|
-
}
|
87
|
-
return path_1.default.resolve(workingDirectory, 'node_modules', '.bin', 'dao-explorer');
|
88
|
-
}
|
89
|
-
function getDaoExplorerExecutablePath(workingDirectory) {
|
90
|
-
const platform = getPlatform();
|
91
|
-
if (platform === SupportedPlatform.SP_UNSUPPORTED) {
|
92
|
-
throw new error_1.CliError('This platform is not supported to run the DAO Explorers.');
|
93
|
-
}
|
94
|
-
if (platform === SupportedPlatform.SP_WINDOWS_X64) {
|
95
|
-
return path_1.default.resolve(getDaoExplorerPath(workingDirectory), 'decentra-bevy.exe');
|
96
|
-
}
|
97
|
-
if (platform === SupportedPlatform.SP_MACOS_ARM64) {
|
98
|
-
return path_1.default.resolve(getDaoExplorerPath(workingDirectory), 'DecentralandBevyExplorer.app/Contents/MacOS/DecentralandBevyExplorer');
|
99
|
-
}
|
100
|
-
return path_1.default.resolve(getDaoExplorerPath(workingDirectory), 'decentra-bevy');
|
101
|
-
}
|
102
|
-
async function ensureDaoExplorer(components, workingDirectory) {
|
103
|
-
const daoExplorerFolderPath = getDaoExplorerPath(workingDirectory);
|
104
|
-
const platform = getPlatform();
|
105
|
-
if (platform === SupportedPlatform.SP_UNSUPPORTED) {
|
106
|
-
throw new error_1.CliError('This platform is not supported to run the DAO Explorers.');
|
107
|
-
}
|
108
|
-
const url = `${BEVY_BASE_URL}-${BEVY_URL_PLATFORM_SUFFIX[platform]}`;
|
109
|
-
const versionFilePath = path_1.default.resolve(daoExplorerFolderPath, 'version');
|
110
|
-
if (await components.fs.fileExists(versionFilePath)) {
|
111
|
-
const versionContent = await components.fs.readFile(versionFilePath, 'utf-8');
|
112
|
-
if (versionContent === url) {
|
113
|
-
return;
|
114
|
-
}
|
115
|
-
}
|
116
|
-
const tempPackagePath = path_1.default.resolve(daoExplorerFolderPath, BEVY_URL_PLATFORM_SUFFIX[platform]);
|
117
|
-
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Downloading DAO Explorer ${BEVY_URL_PLATFORM_SUFFIX[platform]} from ${url}`);
|
118
|
-
if (await components.fs.directoryExists(daoExplorerFolderPath)) {
|
119
|
-
await components.fs.rm(daoExplorerFolderPath, { recursive: true, force: true });
|
120
|
-
}
|
121
|
-
await components.fs.mkdir(daoExplorerFolderPath, { recursive: true });
|
122
|
-
await (0, fs_1.download)(components, url, tempPackagePath);
|
123
|
-
if (tempPackagePath.endsWith('.zip')) {
|
124
|
-
await (0, fs_1.extract)(tempPackagePath, daoExplorerFolderPath);
|
125
|
-
}
|
126
|
-
else if (tempPackagePath.endsWith('.tar.gz') || tempPackagePath.endsWith('.tgz')) {
|
127
|
-
await tar.extract({
|
128
|
-
C: daoExplorerFolderPath,
|
129
|
-
f: tempPackagePath
|
130
|
-
});
|
131
|
-
}
|
132
|
-
await components.fs.writeFile(versionFilePath, url);
|
133
|
-
}
|
134
|
-
exports.ensureDaoExplorer = ensureDaoExplorer;
|
135
|
-
function runDaoExplorer(components, realmUrl, locationCoords, workingDirectory) {
|
136
|
-
const daoExplorerFolderPath = getDaoExplorerPath(workingDirectory);
|
137
|
-
const executablePath = getDaoExplorerExecutablePath(workingDirectory);
|
138
|
-
executablePath;
|
139
|
-
const ts = child_process_1.default.spawn(executablePath, ['--preview', '--server', realmUrl, '--location', locationCoords], {
|
140
|
-
env: process.env,
|
141
|
-
cwd: daoExplorerFolderPath
|
142
|
-
});
|
143
|
-
ts.on('close', (code) => {
|
144
|
-
/* istanbul ignore else */
|
145
|
-
if (code === 0) {
|
146
|
-
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Type checking completed without errors`);
|
147
|
-
}
|
148
|
-
else {
|
149
|
-
return;
|
150
|
-
}
|
151
|
-
});
|
152
|
-
ts.stdout.pipe(process.stdout);
|
153
|
-
ts.stderr.pipe(process.stderr);
|
154
|
-
}
|
155
|
-
exports.runDaoExplorer = runDaoExplorer;
|
156
|
-
//# sourceMappingURL=dao-explorer.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"dao-explorer.js","sourceRoot":"","sources":["../../src/logic/dao-explorer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6BAAwC;AACxC,gDAAuB;AACvB,2BAA6B;AAC7B,mCAAkC;AAClC,qDAAoD;AACpD,yCAA0B;AAC1B,kEAAyC;AAEzC,IAAK,iBAKJ;AALD,WAAK,iBAAiB;IACpB,6EAAc,CAAA;IACd,yEAAY,CAAA;IACZ,6EAAc,CAAA;IACd,6EAAc,CAAA;AAChB,CAAC,EALI,iBAAiB,KAAjB,iBAAiB,QAKrB;AAED,MAAM,aAAa,GACjB,6HAA6H,CAAA;AAC/H,MAAM,wBAAwB,GAAsC;IAClE,CAAC,iBAAiB,CAAC,YAAY,CAAC,EAAE,qBAAqB;IACvD,CAAC,iBAAiB,CAAC,cAAc,CAAC,EAAE,gBAAgB;IACpD,CAAC,iBAAiB,CAAC,cAA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