@jxrstudios/jxr 1.0.4 → 1.0.6

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.
Files changed (41) hide show
  1. package/README.md +6 -2
  2. package/bin/jxr.js +114 -76
  3. package/dist/deployer.d.ts +8 -12
  4. package/dist/deployer.d.ts.map +1 -1
  5. package/dist/deployer.js +69 -106
  6. package/dist/deployer.js.map +1 -1
  7. package/dist/enhanced-transpiler.d.ts +36 -0
  8. package/dist/enhanced-transpiler.d.ts.map +1 -0
  9. package/dist/enhanced-transpiler.js +272 -0
  10. package/dist/enhanced-transpiler.js.map +1 -0
  11. package/dist/entry-point-detection.d.ts +22 -0
  12. package/dist/entry-point-detection.d.ts.map +1 -0
  13. package/dist/entry-point-detection.js +415 -0
  14. package/dist/entry-point-detection.js.map +1 -0
  15. package/dist/index.d.ts +19 -12
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +1025 -126
  18. package/dist/index.js.map +1 -1
  19. package/dist/jxr-server-manager.d.ts +32 -0
  20. package/dist/jxr-server-manager.d.ts.map +1 -0
  21. package/dist/jxr-server-manager.js +353 -0
  22. package/dist/jxr-server-manager.js.map +1 -0
  23. package/dist/runtime.d.ts +9 -9
  24. package/dist/runtime.d.ts.map +1 -1
  25. package/dist/runtime.js +3 -3
  26. package/package.json +9 -2
  27. package/src/deployer.ts +231 -0
  28. package/src/enhanced-transpiler.ts +331 -0
  29. package/src/entry-point-detection.ts +470 -0
  30. package/src/index.ts +63 -0
  31. package/src/jxr-server-manager.ts +419 -0
  32. package/src/module-resolver.ts +520 -0
  33. package/src/moq-transport.ts +267 -0
  34. package/src/runtime.ts +188 -0
  35. package/src/web-crypto.ts +279 -0
  36. package/src/worker-pool.ts +321 -0
  37. package/zzz_react_template/App.tsx +160 -0
  38. package/zzz_react_template/index.css +16 -0
  39. package/zzz_react_template/index.html +12 -0
  40. package/zzz_react_template/main.tsx +10 -0
  41. package/zzz_react_template/package.json +25 -0
@@ -0,0 +1,415 @@
1
+ /**
2
+ * Entry point detection utility for the preview system
3
+ * Automatically finds or creates appropriate entry points for preview rendering
4
+ */
5
+ function generateId() {
6
+ return Date.now().toString(36) + Math.random().toString(36).substr(2);
7
+ }
8
+ // Ordered: prefer component files over bootstrap files.
9
+ // The preview engine already handles React mounting — it needs a *component* entry,
10
+ // not a bootstrap file that calls createRoot() itself.
11
+ const COMMON_ENTRY_POINTS = [
12
+ 'src/App.tsx',
13
+ 'src/App.ts',
14
+ 'App.tsx',
15
+ 'App.ts',
16
+ 'app/page.tsx', // Next.js
17
+ 'app/page.ts',
18
+ 'src/main.tsx',
19
+ 'src/main.ts',
20
+ 'main.tsx',
21
+ 'main.ts',
22
+ 'index.tsx',
23
+ 'index.ts',
24
+ 'src/index.tsx',
25
+ 'src/index.ts'
26
+ ];
27
+ const COMPONENT_INDICATORS = [
28
+ 'App',
29
+ 'Main',
30
+ 'Page',
31
+ 'Index',
32
+ 'Home'
33
+ ];
34
+ /**
35
+ * Finds or creates an entry point for preview rendering
36
+ */
37
+ export function findOrCreateEntryPoint(files) {
38
+ console.log('🔍 Entry point detection: Starting with', files.length, 'files');
39
+ console.log('📁 Available files:', files.map(f => f.path));
40
+ // Try to find existing entry point
41
+ const existingEntry = findExistingEntryPoint(files);
42
+ if (existingEntry) {
43
+ console.log('🎯 Found existing entry point:', existingEntry);
44
+ return {
45
+ entryPoint: existingEntry,
46
+ files,
47
+ createdEntry: false
48
+ };
49
+ }
50
+ // Try to find a component that could serve as entry point
51
+ const componentEntry = findComponentEntryPoint(files);
52
+ if (componentEntry) {
53
+ console.log('🔧 Found component that could be entry point:', componentEntry);
54
+ // Create an app wrapper for the component
55
+ const componentFile = files.find(f => f.path === componentEntry);
56
+ if (componentFile) {
57
+ console.log('📝 Creating app wrapper for component:', componentEntry);
58
+ const appWrapperFile = createAppWrapperForComponent(componentFile);
59
+ const updatedFiles = [...files, appWrapperFile];
60
+ return {
61
+ entryPoint: appWrapperFile.path,
62
+ files: updatedFiles,
63
+ createdEntry: true
64
+ };
65
+ }
66
+ }
67
+ // Create a default entry point
68
+ console.log('📝 Creating default entry point');
69
+ const entryPointFile = createDefaultEntryPoint(files);
70
+ const updatedFiles = [...files, entryPointFile];
71
+ return {
72
+ entryPoint: entryPointFile.path,
73
+ files: updatedFiles,
74
+ createdEntry: true
75
+ };
76
+ }
77
+ /**
78
+ * Detects whether a file is a bootstrap/mount file (calls createRoot, render, hydrateRoot)
79
+ * rather than a renderable component. The preview engine handles mounting itself,
80
+ * so these files should be skipped as entry points.
81
+ */
82
+ function isBootstrapFile(file) {
83
+ const c = file.content;
84
+ return (/\bcreateRoot\s*\(/.test(c) ||
85
+ /ReactDOM\.render\s*\(/.test(c) ||
86
+ /\bhydrateRoot\s*\(/.test(c));
87
+ }
88
+ /**
89
+ * Given a bootstrap file like `src/main.tsx`, extract the component it imports.
90
+ * e.g. `import App from './App'` → resolve to `src/App.tsx`.
91
+ * Returns null if no component import is found.
92
+ */
93
+ function extractComponentFromBootstrap(bootstrapFile, allFiles) {
94
+ // Match default imports: import Foo from './path'
95
+ const importRe = /import\s+(\w+)\s+from\s+['"]([^'"]+)['"]/g;
96
+ let match;
97
+ while ((match = importRe.exec(bootstrapFile.content)) !== null) {
98
+ const importPath = match[2];
99
+ // Skip external packages
100
+ if (!importPath.startsWith('.') && !importPath.startsWith('@/'))
101
+ continue;
102
+ // Resolve relative to the bootstrap file's directory
103
+ const bootstrapDir = bootstrapFile.path.replace(/\/[^/]+$/, '');
104
+ let resolvedBase;
105
+ if (importPath.startsWith('@/')) {
106
+ resolvedBase = 'src/' + importPath.slice(2);
107
+ }
108
+ else {
109
+ // Resolve relative import
110
+ const parts = bootstrapDir.split('/').filter(Boolean);
111
+ for (const seg of importPath.split('/')) {
112
+ if (seg === '..')
113
+ parts.pop();
114
+ else if (seg !== '.')
115
+ parts.push(seg);
116
+ }
117
+ resolvedBase = parts.join('/');
118
+ }
119
+ // Try to find the file with extensions
120
+ const extensions = ['.tsx', '.ts', '.jsx', '.js', ''];
121
+ for (const ext of extensions) {
122
+ const candidate = resolvedBase + ext;
123
+ const found = allFiles.find(f => f.path === candidate ||
124
+ f.path === '/' + candidate ||
125
+ f.path.replace(/^\//, '') === candidate);
126
+ if (found) {
127
+ console.log(`🔗 Bootstrap ${bootstrapFile.path} imports component from ${found.path}`);
128
+ return found.path;
129
+ }
130
+ }
131
+ }
132
+ return null;
133
+ }
134
+ /**
135
+ * Searches for existing entry points in the file list.
136
+ * Skips bootstrap files and resolves to the component they import instead.
137
+ */
138
+ function findExistingEntryPoint(files) {
139
+ for (const entryPath of COMMON_ENTRY_POINTS) {
140
+ const found = files.find(f => f.path === entryPath ||
141
+ f.path.endsWith(entryPath) ||
142
+ f.path.replace(/^\//, '') === entryPath.replace(/^\//, ''));
143
+ if (found) {
144
+ // If this is a bootstrap file (calls createRoot/render), skip it
145
+ // and try to resolve the component it imports instead
146
+ if (isBootstrapFile(found)) {
147
+ console.log(`⚡ Skipping bootstrap file as entry point: ${found.path}`);
148
+ const componentPath = extractComponentFromBootstrap(found, files);
149
+ if (componentPath) {
150
+ return componentPath;
151
+ }
152
+ // If we can't extract a component, continue searching
153
+ continue;
154
+ }
155
+ return found.path;
156
+ }
157
+ }
158
+ return null;
159
+ }
160
+ /**
161
+ * Finds a component that could serve as entry point
162
+ */
163
+ function findComponentEntryPoint(files) {
164
+ // Look for files with component indicators
165
+ for (const file of files) {
166
+ const fileName = file.path.split('/').pop()?.replace(/\.(tsx?|jsx?)$/, '');
167
+ if (fileName && COMPONENT_INDICATORS.includes(fileName)) {
168
+ return file.path;
169
+ }
170
+ }
171
+ // Look for the first React component (contains JSX/TSX)
172
+ const jsxFiles = files.filter(f => f.path.endsWith('.tsx') || f.path.endsWith('.jsx'));
173
+ if (jsxFiles.length > 0) {
174
+ // Prefer files with "export default" or component patterns
175
+ for (const file of jsxFiles) {
176
+ if (file.content.includes('export default') ||
177
+ file.content.includes('function') ||
178
+ file.content.includes('const')) {
179
+ return file.path;
180
+ }
181
+ }
182
+ // Fallback to first JSX file
183
+ return jsxFiles[0].path;
184
+ }
185
+ // Look for TypeScript files
186
+ const tsFiles = files.filter(f => f.path.endsWith('.ts'));
187
+ if (tsFiles.length > 0) {
188
+ return tsFiles[0].path;
189
+ }
190
+ return null;
191
+ }
192
+ /**
193
+ * Converts a string to a valid PascalCase JavaScript identifier
194
+ * e.g., "html-landing" → "HtmlLanding", "my-component" → "MyComponent"
195
+ */
196
+ function toValidIdentifier(name) {
197
+ // Replace hyphens and underscores with spaces, then convert to PascalCase
198
+ return name
199
+ .replace(/[-_]/g, ' ')
200
+ .replace(/\s+/g, ' ')
201
+ .split(' ')
202
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
203
+ .join('')
204
+ // Remove any remaining invalid characters
205
+ .replace(/[^a-zA-Z0-9_$]/g, '')
206
+ // Ensure it starts with a letter or underscore (prepend underscore if it starts with a number)
207
+ .replace(/^[0-9]/, '_$&')
208
+ || 'Component'; // fallback if empty
209
+ }
210
+ /**
211
+ * Creates an app wrapper for a component file
212
+ */
213
+ function createAppWrapperForComponent(componentFile) {
214
+ const rawComponentName = componentFile.path.split('/').pop()?.replace(/\.(tsx?|jsx?)$/, '') || 'Component';
215
+ const componentName = toValidIdentifier(rawComponentName);
216
+ const componentPath = componentFile.path.replace(/\.(tsx?|jsx?)$/, '');
217
+ const content = `import React from 'react'
218
+ import ${componentName} from '${componentPath}'
219
+
220
+ // App wrapper created by preview system for component: ${componentName}
221
+ export default function App() {
222
+ return (
223
+ <div style={{
224
+ padding: '20px',
225
+ fontFamily: 'system-ui, sans-serif',
226
+ minHeight: '100vh',
227
+ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)'
228
+ }}>
229
+ <div style={{
230
+ maxWidth: '800px',
231
+ margin: '0 auto',
232
+ background: 'white',
233
+ borderRadius: '12px',
234
+ padding: '30px',
235
+ boxShadow: '0 10px 30px rgba(0,0,0,0.1)'
236
+ }}>
237
+ <h1 style={{
238
+ color: '#333',
239
+ marginBottom: '10px',
240
+ fontSize: '28px',
241
+ fontWeight: '700'
242
+ }}>
243
+ DamascusAI Preview
244
+ </h1>
245
+ <p style={{
246
+ color: '#666',
247
+ marginBottom: '30px',
248
+ fontSize: '16px'
249
+ }}>
250
+ Sovereign generation system active - Component: ${componentName}
251
+ </p>
252
+
253
+ <div style={{
254
+ border: '2px dashed #e2e8f0',
255
+ borderRadius: '8px',
256
+ padding: '20px',
257
+ background: '#f8fafc'
258
+ }}>
259
+ <h2 style={{
260
+ color: '#4a5568',
261
+ marginBottom: '15px',
262
+ fontSize: '18px'
263
+ }}>
264
+ Component: <code>${componentName}</code>
265
+ </h2>
266
+ <${componentName} />
267
+ </div>
268
+
269
+ <div style={{
270
+ marginTop: '20px',
271
+ padding: '15px',
272
+ background: '#edf2f7',
273
+ borderRadius: '6px',
274
+ fontSize: '14px',
275
+ color: '#4a5568'
276
+ }}>
277
+ <strong>Generated by:</strong> DamascusAI Sovereign Stack
278
+ </div>
279
+ </div>
280
+ </div>
281
+ )
282
+ }
283
+ `;
284
+ const now = Date.now();
285
+ return {
286
+ id: generateId(),
287
+ path: '/App.tsx',
288
+ content,
289
+ language: 'typescript',
290
+ createdAt: now,
291
+ updatedAt: now
292
+ };
293
+ }
294
+ /**
295
+ * Creates a default entry point that imports and renders available components
296
+ */
297
+ function createDefaultEntryPoint(files) {
298
+ console.log('📝 Creating default App.tsx entry point');
299
+ // Find components to import
300
+ const components = findAvailableComponents(files);
301
+ // Sanitize component names to be valid JavaScript identifiers
302
+ const sanitizedComponents = components.map(comp => ({
303
+ ...comp,
304
+ name: toValidIdentifier(comp.name)
305
+ }));
306
+ const imports = sanitizedComponents.map(comp => `import ${comp.name} from '${comp.path.replace(/\.(tsx?|jsx?)$/, '')}'`).join('\n');
307
+ const componentUsage = sanitizedComponents.map(comp => ` <${comp.name} />`).join('\n');
308
+ const content = `${imports}
309
+ import React from 'react'
310
+
311
+ // Default entry point created by preview system
312
+ export default function App() {
313
+ return (
314
+ <div style={{
315
+ padding: '20px',
316
+ fontFamily: 'system-ui, sans-serif',
317
+ minHeight: '100vh',
318
+ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)'
319
+ }}>
320
+ <div style={{
321
+ maxWidth: '800px',
322
+ margin: '0 auto',
323
+ background: 'white',
324
+ borderRadius: '12px',
325
+ padding: '30px',
326
+ boxShadow: '0 10px 30px rgba(0,0,0,0.1)'
327
+ }}>
328
+ <h1 style={{
329
+ color: '#333',
330
+ marginBottom: '10px',
331
+ fontSize: '28px',
332
+ fontWeight: '700'
333
+ }}>
334
+ 🚀 Damascus AI Preview
335
+ </h1>
336
+ <p style={{
337
+ color: '#666',
338
+ marginBottom: '30px',
339
+ fontSize: '16px'
340
+ }}>
341
+ Sovereign generation system active
342
+ </p>
343
+
344
+ <div style={{
345
+ border: '2px dashed #e2e8f0',
346
+ borderRadius: '8px',
347
+ padding: '20px',
348
+ background: '#f8fafc'
349
+ }}>
350
+ <h2 style={{
351
+ color: '#4a5568',
352
+ marginBottom: '15px',
353
+ fontSize: '18px'
354
+ }}>
355
+ Generated Components:
356
+ </h2>
357
+ <div style={{ marginTop: '20px' }}>
358
+ ${componentUsage}
359
+ </div>
360
+ </div>
361
+
362
+ <div style={{
363
+ marginTop: '20px',
364
+ padding: '15px',
365
+ background: '#edf2f7',
366
+ borderRadius: '6px',
367
+ fontSize: '14px',
368
+ color: '#4a5568'
369
+ }}>
370
+ <strong>Generated by:</strong> DamascusAI Sovereign Stack
371
+ </div>
372
+ </div>
373
+ </div>
374
+ )
375
+ }
376
+ `;
377
+ const now = Date.now();
378
+ return {
379
+ id: generateId(),
380
+ path: '/App.tsx',
381
+ content,
382
+ language: 'typescript',
383
+ createdAt: now,
384
+ updatedAt: now
385
+ };
386
+ }
387
+ /**
388
+ * Finds available components in the file list
389
+ */
390
+ function findAvailableComponents(files) {
391
+ const components = [];
392
+ for (const file of files) {
393
+ if (file.path.endsWith('.tsx') || file.path.endsWith('.jsx')) {
394
+ const fileName = file.path.split('/').pop()?.replace(/\.(tsx?|jsx?)$/, '');
395
+ if (fileName && fileName !== 'App' && fileName !== 'index') {
396
+ // Check if it's likely a component (has JSX or export)
397
+ if (file.content.includes('export') || file.content.includes('return')) {
398
+ components.push({
399
+ name: fileName,
400
+ path: file.path
401
+ });
402
+ }
403
+ }
404
+ }
405
+ }
406
+ // If no components found, create a simple placeholder
407
+ if (components.length === 0) {
408
+ components.push({
409
+ name: 'GeneratedContent',
410
+ path: '/placeholder'
411
+ });
412
+ }
413
+ return components.slice(0, 3); // Limit to first 3 components
414
+ }
415
+ //# sourceMappingURL=entry-point-detection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-point-detection.js","sourceRoot":"","sources":["../src/entry-point-detection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,SAAS,UAAU;IACjB,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AACvE,CAAC;AAED,wDAAwD;AACxD,oFAAoF;AACpF,uDAAuD;AACvD,MAAM,mBAAmB,GAAG;IAC1B,aAAa;IACb,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,cAAc,EAAE,UAAU;IAC1B,aAAa;IACb,cAAc;IACd,aAAa;IACb,UAAU;IACV,SAAS;IACT,WAAW;IACX,UAAU;IACV,eAAe;IACf,cAAc;CACf,CAAA;AAED,MAAM,oBAAoB,GAAG;IAC3B,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;CACP,CAAA;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAoB;IACzD,OAAO,CAAC,GAAG,CAAC,yCAAyC,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7E,OAAO,CAAC,GAAG,CAAC,qBAA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,EAAE,CAAC;oBACvE,UAAU,CAAC,IAAI,CAAC;wBACd,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,IAAI,CAAC,IAAI;qBAChB,CAAC,CAAA;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,sDAAsD;IACtD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,UAAU,CAAC,IAAI,CAAC;YACd,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,CAAC,8BAA8B;AAC9D,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,17 +6,24 @@
6
6
  * - Worker Pool orchestration
7
7
  * - MoQ Transport streaming
8
8
  * - Web Crypto module integrity
9
+ * - Server with HMR
9
10
  */
10
- export { WorkerPool } from './worker-pool.js';
11
- export type { WorkerMetrics, PoolMetrics, WorkerStatus, TaskPriority, } from './worker-pool.js';
12
- export { MoQTransport } from './moq-transport.js';
13
- export type { MoQStreamMetrics, MoQConnectionState, MoQObject, MoQTrackNamespace, } from './moq-transport.js';
14
- export { JXRCrypto, jxrCrypto } from './web-crypto.js';
15
- export type { ModuleHash, SignedManifest } from './web-crypto.js';
16
- export { VirtualFS, JSXTransformer, ImportMapBuilder, ModuleCache, DEFAULT_PROJECT_FILES, } from './module-resolver.js';
17
- export type { VirtualFile, VirtualDirectory, ResolvedModule, ImportMap, } from './module-resolver.js';
18
- export { JXRRuntime, jxrRuntime } from './runtime.js';
19
- export type { JXRRuntimeConfig, JXRRuntimeMetrics } from './runtime.js';
20
- export { JXRDeployer, jxrDeployer } from './deployer.js';
21
- export type { DeployConfig, DeployResult, DeploymentStatus } from './deployer.js';
11
+ export { WorkerPool } from './worker-pool.ts';
12
+ export type { WorkerMetrics, PoolMetrics, WorkerStatus, TaskPriority, } from './worker-pool.ts';
13
+ export { MoQTransport } from './moq-transport.ts';
14
+ export type { MoQStreamMetrics, MoQConnectionState, MoQObject, MoQTrackNamespace, } from './moq-transport.ts';
15
+ export { JXRCrypto, jxrCrypto } from './web-crypto.ts';
16
+ export type { ModuleHash, SignedManifest } from './web-crypto.ts';
17
+ export { VirtualFS, JSXTransformer, ImportMapBuilder, ModuleCache, DEFAULT_PROJECT_FILES, } from './module-resolver.ts';
18
+ export type { VirtualFile, VirtualDirectory, ResolvedModule, ImportMap, } from './module-resolver.ts';
19
+ export { JXRRuntime, jxrRuntime } from './runtime.ts';
20
+ export type { JXRRuntimeConfig, JXRRuntimeMetrics } from './runtime.ts';
21
+ export { EnhancedTranspiler } from './enhanced-transpiler.ts';
22
+ export type { TranspilerOptions, TranspilationResult } from './enhanced-transpiler.ts';
23
+ export { findOrCreateEntryPoint } from './entry-point-detection.ts';
24
+ export type { EntryPointDetection, ProjectFile } from './entry-point-detection.ts';
25
+ export { JXRServerManager } from './jxr-server-manager.ts';
26
+ export type { JXRServerConfig } from './jxr-server-manager.ts';
27
+ export { JXRDeployer, jxrDeployer } from './deployer.ts';
28
+ export type { DeployConfig, DeployResult, DeploymentStatus } from './deployer.ts';
22
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EACV,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,GACb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,YAAY,EAAE,UAAU,EAAE,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