lwc-convert 1.1.4 → 1.2.1

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 (43) hide show
  1. package/dist/cli/commands/deps.d.ts +20 -0
  2. package/dist/cli/commands/deps.d.ts.map +1 -0
  3. package/dist/cli/commands/deps.js +147 -0
  4. package/dist/cli/commands/deps.js.map +1 -0
  5. package/dist/dependency-graph/analyzer.d.ts +20 -0
  6. package/dist/dependency-graph/analyzer.d.ts.map +1 -0
  7. package/dist/dependency-graph/analyzer.js +147 -0
  8. package/dist/dependency-graph/analyzer.js.map +1 -0
  9. package/dist/dependency-graph/aura-dependency-analyzer.d.ts +18 -0
  10. package/dist/dependency-graph/aura-dependency-analyzer.d.ts.map +1 -0
  11. package/dist/dependency-graph/aura-dependency-analyzer.js +429 -0
  12. package/dist/dependency-graph/aura-dependency-analyzer.js.map +1 -0
  13. package/dist/dependency-graph/conversion-order.d.ts +23 -0
  14. package/dist/dependency-graph/conversion-order.d.ts.map +1 -0
  15. package/dist/dependency-graph/conversion-order.js +202 -0
  16. package/dist/dependency-graph/conversion-order.js.map +1 -0
  17. package/dist/dependency-graph/formatters/console-formatter.d.ts +10 -0
  18. package/dist/dependency-graph/formatters/console-formatter.d.ts.map +1 -0
  19. package/dist/dependency-graph/formatters/console-formatter.js +235 -0
  20. package/dist/dependency-graph/formatters/console-formatter.js.map +1 -0
  21. package/dist/dependency-graph/formatters/json-formatter.d.ts +71 -0
  22. package/dist/dependency-graph/formatters/json-formatter.d.ts.map +1 -0
  23. package/dist/dependency-graph/formatters/json-formatter.js +82 -0
  24. package/dist/dependency-graph/formatters/json-formatter.js.map +1 -0
  25. package/dist/dependency-graph/formatters/mermaid-formatter.d.ts +14 -0
  26. package/dist/dependency-graph/formatters/mermaid-formatter.d.ts.map +1 -0
  27. package/dist/dependency-graph/formatters/mermaid-formatter.js +158 -0
  28. package/dist/dependency-graph/formatters/mermaid-formatter.js.map +1 -0
  29. package/dist/dependency-graph/graph-builder.d.ts +15 -0
  30. package/dist/dependency-graph/graph-builder.d.ts.map +1 -0
  31. package/dist/dependency-graph/graph-builder.js +430 -0
  32. package/dist/dependency-graph/graph-builder.js.map +1 -0
  33. package/dist/dependency-graph/types.d.ts +94 -0
  34. package/dist/dependency-graph/types.d.ts.map +1 -0
  35. package/dist/dependency-graph/types.js +6 -0
  36. package/dist/dependency-graph/types.js.map +1 -0
  37. package/dist/dependency-graph/vf-dependency-analyzer.d.ts +23 -0
  38. package/dist/dependency-graph/vf-dependency-analyzer.d.ts.map +1 -0
  39. package/dist/dependency-graph/vf-dependency-analyzer.js +511 -0
  40. package/dist/dependency-graph/vf-dependency-analyzer.js.map +1 -0
  41. package/dist/index.js +38 -0
  42. package/dist/index.js.map +1 -1
  43. package/package.json +1 -1
@@ -0,0 +1,20 @@
1
+ /**
2
+ * CLI command handler for dependency graph analysis
3
+ */
4
+ export interface DepsCommandOptions {
5
+ type: 'aura' | 'vf' | 'both';
6
+ output?: string;
7
+ format: 'console' | 'json' | 'mermaid' | 'html' | 'dot';
8
+ conversionOrder: boolean;
9
+ focus?: string;
10
+ depth: string;
11
+ includeBase: boolean;
12
+ showOrphans: boolean;
13
+ circularOnly: boolean;
14
+ verbose: boolean;
15
+ }
16
+ /**
17
+ * Execute the deps command
18
+ */
19
+ export declare function analyzeDeps(target: string | undefined, options: DepsCommandOptions): Promise<void>;
20
+ //# sourceMappingURL=deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/deps.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC;IACxD,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAgGf"}
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ /**
3
+ * CLI command handler for dependency graph analysis
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.analyzeDeps = analyzeDeps;
40
+ const fs = __importStar(require("fs-extra"));
41
+ const path = __importStar(require("path"));
42
+ const logger_1 = require("../../utils/logger");
43
+ const analyzer_1 = require("../../dependency-graph/analyzer");
44
+ const conversion_order_1 = require("../../dependency-graph/conversion-order");
45
+ const console_formatter_1 = require("../../dependency-graph/formatters/console-formatter");
46
+ const json_formatter_1 = require("../../dependency-graph/formatters/json-formatter");
47
+ const mermaid_formatter_1 = require("../../dependency-graph/formatters/mermaid-formatter");
48
+ /**
49
+ * Execute the deps command
50
+ */
51
+ async function analyzeDeps(target, options) {
52
+ logger_1.logger.setVerbose(options.verbose);
53
+ const targetPath = target ? path.resolve(target) : process.cwd();
54
+ logger_1.logger.banner();
55
+ logger_1.logger.header('Dependency Graph Analysis');
56
+ logger_1.logger.info(`Analyzing: ${targetPath}`);
57
+ logger_1.logger.blank();
58
+ const analysisOptions = {
59
+ type: options.type,
60
+ scope: 'project',
61
+ targetPath,
62
+ focusComponent: options.focus,
63
+ maxDepth: parseInt(options.depth, 10) || 0,
64
+ includeBaseComponents: options.includeBase,
65
+ showOrphans: options.showOrphans,
66
+ circularOnly: options.circularOnly,
67
+ format: options.format,
68
+ outputPath: options.output,
69
+ showConversionOrder: options.conversionOrder,
70
+ verbose: options.verbose,
71
+ };
72
+ try {
73
+ const analyzer = new analyzer_1.DependencyAnalyzer();
74
+ const graph = await analyzer.analyze(analysisOptions);
75
+ if (graph.stats.totalNodes === 0) {
76
+ logger_1.logger.warn('No components found to analyze.');
77
+ logger_1.logger.info('Make sure you are in a Salesforce project directory or specify a valid path.');
78
+ return;
79
+ }
80
+ // Calculate conversion order if requested
81
+ const conversionOrder = options.conversionOrder
82
+ ? (0, conversion_order_1.calculateConversionOrder)(graph)
83
+ : undefined;
84
+ // Format output based on selected format
85
+ let output;
86
+ switch (options.format) {
87
+ case 'json':
88
+ const jsonOutput = (0, json_formatter_1.formatJsonOutput)(graph, conversionOrder);
89
+ output = (0, json_formatter_1.serializeJson)(jsonOutput);
90
+ if (options.output) {
91
+ await writeOutput(options.output, output);
92
+ logger_1.logger.success(`JSON report written to: ${options.output}`);
93
+ }
94
+ else {
95
+ console.log(output);
96
+ }
97
+ break;
98
+ case 'mermaid':
99
+ // Use simplified output for large graphs
100
+ output = graph.stats.totalNodes > 30
101
+ ? (0, mermaid_formatter_1.formatSimpleMermaidOutput)(graph, 30)
102
+ : (0, mermaid_formatter_1.formatMermaidOutput)(graph);
103
+ if (options.output) {
104
+ await writeOutput(options.output, output);
105
+ logger_1.logger.success(`Mermaid diagram written to: ${options.output}`);
106
+ }
107
+ else {
108
+ console.log(output);
109
+ }
110
+ break;
111
+ case 'html':
112
+ logger_1.logger.warn('HTML format not yet implemented. Using console output.');
113
+ (0, console_formatter_1.formatConsoleOutput)(graph, conversionOrder, options.showOrphans);
114
+ break;
115
+ case 'dot':
116
+ logger_1.logger.warn('DOT format not yet implemented. Using console output.');
117
+ (0, console_formatter_1.formatConsoleOutput)(graph, conversionOrder, options.showOrphans);
118
+ break;
119
+ case 'console':
120
+ default:
121
+ (0, console_formatter_1.formatConsoleOutput)(graph, conversionOrder, options.showOrphans);
122
+ break;
123
+ }
124
+ // Show summary
125
+ if (options.format === 'console') {
126
+ logger_1.logger.blank();
127
+ logger_1.logger.success('Analysis complete!');
128
+ }
129
+ }
130
+ catch (error) {
131
+ logger_1.logger.error(`Analysis failed: ${error.message}`);
132
+ if (options.verbose && error.stack) {
133
+ logger_1.logger.debug(error.stack);
134
+ }
135
+ process.exit(1);
136
+ }
137
+ }
138
+ /**
139
+ * Write output to file
140
+ */
141
+ async function writeOutput(filePath, content) {
142
+ const outputPath = path.resolve(filePath);
143
+ const outputDir = path.dirname(outputPath);
144
+ await fs.ensureDir(outputDir);
145
+ await fs.writeFile(outputPath, content, 'utf-8');
146
+ }
147
+ //# sourceMappingURL=deps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deps.js","sourceRoot":"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,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAE3C,MAAM,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAC9B,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Dependency Graph Analyzer
3
+ * Main orchestrator that coordinates scanning, analysis, and graph building
4
+ */
5
+ import { DependencyGraph, DependencyAnalysisOptions, ComponentAnalysisResult } from './types';
6
+ /**
7
+ * Main analyzer class for dependency graph analysis
8
+ */
9
+ export declare class DependencyAnalyzer {
10
+ /**
11
+ * Analyze dependencies based on provided options
12
+ */
13
+ analyze(options: DependencyAnalysisOptions): Promise<DependencyGraph>;
14
+ /**
15
+ * Analyze a single component
16
+ */
17
+ analyzeComponent(componentPath: string, type: 'aura' | 'vf'): Promise<ComponentAnalysisResult | null>;
18
+ }
19
+ export declare const dependencyAnalyzer: DependencyAnalyzer;
20
+ //# sourceMappingURL=analyzer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/analyzer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAKjB;;GAEG;AACH,qBAAa,kBAAkB;IAC7B;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,eAAe,CAAC;IAsD3E;;OAEG;IACG,gBAAgB,CACpB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GAAG,IAAI,GAClB,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC;CAO3C;AAwFD,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ /**
3
+ * Dependency Graph Analyzer
4
+ * Main orchestrator that coordinates scanning, analysis, and graph building
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.dependencyAnalyzer = exports.DependencyAnalyzer = void 0;
8
+ const logger_1 = require("../utils/logger");
9
+ const aura_dependency_analyzer_1 = require("./aura-dependency-analyzer");
10
+ const vf_dependency_analyzer_1 = require("./vf-dependency-analyzer");
11
+ const graph_builder_1 = require("./graph-builder");
12
+ /**
13
+ * Main analyzer class for dependency graph analysis
14
+ */
15
+ class DependencyAnalyzer {
16
+ /**
17
+ * Analyze dependencies based on provided options
18
+ */
19
+ async analyze(options) {
20
+ const analysisResults = [];
21
+ const targetPath = options.targetPath || process.cwd();
22
+ logger_1.logger.debug(`Analyzing dependencies at: ${targetPath}`);
23
+ logger_1.logger.debug(`Type filter: ${options.type}`);
24
+ logger_1.logger.debug(`Include base components: ${options.includeBaseComponents}`);
25
+ // Scan for components based on type
26
+ if (options.type === 'aura' || options.type === 'both') {
27
+ logger_1.logger.debug('Scanning for Aura components...');
28
+ const auraResults = await (0, aura_dependency_analyzer_1.scanAuraComponents)(targetPath, options.includeBaseComponents);
29
+ logger_1.logger.debug(`Found ${auraResults.length} Aura components`);
30
+ analysisResults.push(...auraResults);
31
+ }
32
+ if (options.type === 'vf' || options.type === 'both') {
33
+ logger_1.logger.debug('Scanning for Visualforce pages...');
34
+ const vfResults = await (0, vf_dependency_analyzer_1.scanVfPages)(targetPath);
35
+ logger_1.logger.debug(`Found ${vfResults.length} VF pages`);
36
+ analysisResults.push(...vfResults);
37
+ }
38
+ if (analysisResults.length === 0) {
39
+ logger_1.logger.debug('No components found to analyze');
40
+ return createEmptyGraph();
41
+ }
42
+ // Build the dependency graph
43
+ logger_1.logger.debug('Building dependency graph...');
44
+ let graph = (0, graph_builder_1.buildGraph)(analysisResults, options.includeBaseComponents);
45
+ // Filter by focus component if specified
46
+ if (options.focusComponent) {
47
+ logger_1.logger.debug(`Filtering graph to focus on: ${options.focusComponent}`);
48
+ graph = (0, graph_builder_1.filterGraphByFocus)(graph, options.focusComponent, options.maxDepth);
49
+ }
50
+ // Filter to show only circular dependencies if requested
51
+ if (options.circularOnly) {
52
+ graph = filterToCircularOnly(graph);
53
+ }
54
+ // Filter out orphans if not requested
55
+ if (!options.showOrphans) {
56
+ graph = filterOutOrphans(graph);
57
+ }
58
+ logger_1.logger.debug(`Graph built: ${graph.stats.totalNodes} nodes, ${graph.stats.totalEdges} edges`);
59
+ return graph;
60
+ }
61
+ /**
62
+ * Analyze a single component
63
+ */
64
+ async analyzeComponent(componentPath, type) {
65
+ if (type === 'aura') {
66
+ return (0, aura_dependency_analyzer_1.analyzeAuraComponent)(componentPath, false);
67
+ }
68
+ else {
69
+ return (0, vf_dependency_analyzer_1.analyzeVfPage)(componentPath);
70
+ }
71
+ }
72
+ }
73
+ exports.DependencyAnalyzer = DependencyAnalyzer;
74
+ /**
75
+ * Create an empty graph structure
76
+ */
77
+ function createEmptyGraph() {
78
+ return {
79
+ nodes: new Map(),
80
+ edges: [],
81
+ roots: [],
82
+ leaves: [],
83
+ orphans: [],
84
+ circularGroups: [],
85
+ stats: {
86
+ totalNodes: 0,
87
+ totalEdges: 0,
88
+ auraComponents: 0,
89
+ vfPages: 0,
90
+ apexControllers: 0,
91
+ maxDepth: 0,
92
+ averageConnections: 0,
93
+ circularDependencies: 0,
94
+ orphanedComponents: 0,
95
+ },
96
+ };
97
+ }
98
+ /**
99
+ * Filter graph to only show components involved in circular dependencies
100
+ */
101
+ function filterToCircularOnly(graph) {
102
+ if (graph.circularGroups.length === 0) {
103
+ return createEmptyGraph();
104
+ }
105
+ const circularNodeIds = new Set();
106
+ for (const group of graph.circularGroups) {
107
+ for (const nodeId of group) {
108
+ circularNodeIds.add(nodeId);
109
+ }
110
+ }
111
+ const filteredNodes = new Map(Array.from(graph.nodes.entries()).filter(([id]) => circularNodeIds.has(id)));
112
+ const filteredEdges = graph.edges.filter((e) => circularNodeIds.has(e.from) && circularNodeIds.has(e.to));
113
+ return {
114
+ ...graph,
115
+ nodes: filteredNodes,
116
+ edges: filteredEdges,
117
+ roots: [],
118
+ leaves: [],
119
+ orphans: [],
120
+ stats: {
121
+ ...graph.stats,
122
+ totalNodes: filteredNodes.size,
123
+ totalEdges: filteredEdges.length,
124
+ orphanedComponents: 0,
125
+ },
126
+ };
127
+ }
128
+ /**
129
+ * Filter out orphaned components from the graph
130
+ */
131
+ function filterOutOrphans(graph) {
132
+ const filteredNodes = new Map(Array.from(graph.nodes.entries()).filter(([_, node]) => !node.isOrphan));
133
+ // Edges shouldn't change since orphans have no connections
134
+ return {
135
+ ...graph,
136
+ nodes: filteredNodes,
137
+ orphans: [],
138
+ stats: {
139
+ ...graph.stats,
140
+ totalNodes: filteredNodes.size,
141
+ orphanedComponents: 0,
142
+ },
143
+ };
144
+ }
145
+ // Export singleton instance for convenience
146
+ exports.dependencyAnalyzer = new DependencyAnalyzer();
147
+ //# sourceMappingURL=analyzer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyzer.js","sourceRoot":"","sources":["../../src/dependency-graph/analyzer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,4CAAyC;AAMzC,yEAAsF;AACtF,qEAAsE;AACtE,mDAAiE;AAEjE;;GAEG;AACH,MAAa,kBAAkB;IAC7B;;OAEG;IACH,KAAK,CAAC,OAAO,CAAC,OAAkC;QAC9C,MAAM,eAAe,GAA8B,EAAE,CAAC;QAEtD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAEvD,eAAM,CAAC,KAAK,CAAC,8BAA8B,UAAU,EAAE,CAAC,CAAC;QACzD,eAAM,CAAC,KAAK,CAAC,gBAAgB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7C,eAAM,CAAC,KAAK,CAAC,4BAA4B,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;QAE1E,oCAA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C,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CACxE,CAAC;IAEF,2DAA2D;IAC3D,OAAO;QACL,GAAG,KAAK;QACR,KAAK,EAAE,aAAa;QACpB,OAAO,EAAE,EAAE;QACX,KAAK,EAAE;YACL,GAAG,KAAK,CAAC,KAAK;YACd,UAAU,EAAE,aAAa,CAAC,IAAI;YAC9B,kBAAkB,EAAE,CAAC;SACtB;KACF,CAAC;AACJ,CAAC;AAED,4CAA4C;AAC/B,QAAA,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Aura component dependency analyzer
3
+ * Extracts dependencies from Aura components including:
4
+ * - Component references (c:*, lightning:*, ui:*, force:*)
5
+ * - Event registrations and handlers
6
+ * - Apex controller bindings
7
+ * - Interface implementations and extensions
8
+ */
9
+ import { ComponentAnalysisResult } from './types';
10
+ /**
11
+ * Analyze a single Aura component bundle
12
+ */
13
+ export declare function analyzeAuraComponent(bundlePath: string, includeBaseComponents?: boolean): Promise<ComponentAnalysisResult | null>;
14
+ /**
15
+ * Scan a directory for Aura components and analyze all of them
16
+ */
17
+ export declare function scanAuraComponents(rootPath: string, includeBaseComponents?: boolean): Promise<ComponentAnalysisResult[]>;
18
+ //# sourceMappingURL=aura-dependency-analyzer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aura-dependency-analyzer.d.ts","sourceRoot":"","sources":["../../src/dependency-graph/aura-dependency-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,EACL,uBAAuB,EAGxB,MAAM,SAAS,CAAC;AA4OjB;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAClB,qBAAqB,GAAE,OAAe,GACrC,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAsEzC;AAwDD;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,qBAAqB,GAAE,OAAe,GACrC,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAgFpC"}