@memberjunction/ng-core-entity-forms 2.86.0 → 2.88.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.
Files changed (91) hide show
  1. package/dist/lib/custom/AIAgents/FlowAgentType/flow-agent-form-section.component.d.ts.map +1 -1
  2. package/dist/lib/custom/AIAgents/FlowAgentType/flow-agent-form-section.component.js +7 -7
  3. package/dist/lib/custom/AIAgents/FlowAgentType/flow-agent-form-section.component.js.map +1 -1
  4. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/condition-editor/condition-editor.component.d.ts +29 -0
  5. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/condition-editor/condition-editor.component.d.ts.map +1 -0
  6. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/condition-editor/condition-editor.component.js +198 -0
  7. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/condition-editor/condition-editor.component.js.map +1 -0
  8. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/confirmation-dialog/confirmation-dialog.component.d.ts +14 -0
  9. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/confirmation-dialog/confirmation-dialog.component.d.ts.map +1 -0
  10. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/confirmation-dialog/confirmation-dialog.component.js +98 -0
  11. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/confirmation-dialog/confirmation-dialog.component.js.map +1 -0
  12. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/custom-node/custom-node.component.d.ts +44 -0
  13. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/custom-node/custom-node.component.d.ts.map +1 -0
  14. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/custom-node/custom-node.component.js +282 -0
  15. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/custom-node/custom-node.component.js.map +1 -0
  16. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/execution-panel/execution-panel.component.d.ts +35 -0
  17. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/execution-panel/execution-panel.component.d.ts.map +1 -0
  18. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/execution-panel/execution-panel.component.js +287 -0
  19. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/execution-panel/execution-panel.component.js.map +1 -0
  20. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/flow-editor/flow-editor.component.d.ts +106 -0
  21. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/flow-editor/flow-editor.component.d.ts.map +1 -0
  22. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/flow-editor/flow-editor.component.js +951 -0
  23. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/flow-editor/flow-editor.component.js.map +1 -0
  24. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/prompt-editor/prompt-editor.component.d.ts +30 -0
  25. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/prompt-editor/prompt-editor.component.d.ts.map +1 -0
  26. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/prompt-editor/prompt-editor.component.js +450 -0
  27. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/prompt-editor/prompt-editor.component.js.map +1 -0
  28. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/properties-panel/properties-panel.component.d.ts +25 -0
  29. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/properties-panel/properties-panel.component.d.ts.map +1 -0
  30. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/properties-panel/properties-panel.component.js +423 -0
  31. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/properties-panel/properties-panel.component.js.map +1 -0
  32. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/simple-condition-editor/simple-condition-editor.component.d.ts +21 -0
  33. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/simple-condition-editor/simple-condition-editor.component.d.ts.map +1 -0
  34. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/simple-condition-editor/simple-condition-editor.component.js +182 -0
  35. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/simple-condition-editor/simple-condition-editor.component.js.map +1 -0
  36. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/step/step.component.d.ts +34 -0
  37. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/step/step.component.d.ts.map +1 -0
  38. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/step/step.component.js +171 -0
  39. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/step/step.component.js.map +1 -0
  40. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/toolbar/toolbar.component.d.ts +17 -0
  41. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/toolbar/toolbar.component.d.ts.map +1 -0
  42. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/toolbar/toolbar.component.js +78 -0
  43. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/components/toolbar/toolbar.component.js.map +1 -0
  44. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/connection.model.d.ts +17 -0
  45. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/connection.model.d.ts.map +1 -0
  46. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/connection.model.js +11 -0
  47. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/connection.model.js.map +1 -0
  48. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/mj-extended.model.d.ts +21 -0
  49. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/mj-extended.model.d.ts.map +1 -0
  50. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/mj-extended.model.js +2 -0
  51. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/mj-extended.model.js.map +1 -0
  52. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/module.model.d.ts +33 -0
  53. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/module.model.d.ts.map +1 -0
  54. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/module.model.js +2 -0
  55. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/module.model.js.map +1 -0
  56. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/step.model.d.ts +44 -0
  57. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/step.model.d.ts.map +1 -0
  58. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/step.model.js +166 -0
  59. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/models/step.model.js.map +1 -0
  60. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/flow-editor.service.d.ts +14 -0
  61. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/flow-editor.service.d.ts.map +1 -0
  62. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/flow-editor.service.js +31 -0
  63. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/flow-editor.service.js.map +1 -0
  64. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/flow-executor.service.d.ts +63 -0
  65. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/flow-executor.service.d.ts.map +1 -0
  66. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/flow-executor.service.js +294 -0
  67. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/flow-executor.service.js.map +1 -0
  68. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/mj-flow-transformer.service.d.ts +77 -0
  69. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/mj-flow-transformer.service.d.ts.map +1 -0
  70. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/mj-flow-transformer.service.js +408 -0
  71. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/mj-flow-transformer.service.js.map +1 -0
  72. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/module-manager.service.d.ts +19 -0
  73. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/module-manager.service.d.ts.map +1 -0
  74. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/module-manager.service.js +116 -0
  75. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/module-manager.service.js.map +1 -0
  76. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/prompt-manager.service.d.ts +25 -0
  77. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/prompt-manager.service.d.ts.map +1 -0
  78. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/prompt-manager.service.js +90 -0
  79. package/dist/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/prompt-manager.service.js.map +1 -0
  80. package/dist/lib/custom/AIAgents/FlowAgentType/mj-integrated-flow-editor.component.d.ts +52 -0
  81. package/dist/lib/custom/AIAgents/FlowAgentType/mj-integrated-flow-editor.component.d.ts.map +1 -0
  82. package/dist/lib/custom/AIAgents/FlowAgentType/mj-integrated-flow-editor.component.js +500 -0
  83. package/dist/lib/custom/AIAgents/FlowAgentType/mj-integrated-flow-editor.component.js.map +1 -0
  84. package/dist/lib/custom/custom-forms.module.d.ts +2 -1
  85. package/dist/lib/custom/custom-forms.module.d.ts.map +1 -1
  86. package/dist/lib/custom/custom-forms.module.js +10 -4
  87. package/dist/lib/custom/custom-forms.module.js.map +1 -1
  88. package/dist/lib/generated/Entities/Component/sections/details.component.d.ts.map +1 -1
  89. package/dist/lib/generated/Entities/Component/sections/details.component.js +40 -4
  90. package/dist/lib/generated/Entities/Component/sections/details.component.js.map +1 -1
  91. package/package.json +16 -16
@@ -0,0 +1,408 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { STEP_CONFIGS } from '../models/step.model';
3
+ import * as i0 from "@angular/core";
4
+ export class MJFlowTransformerService {
5
+ /**
6
+ * Transform MJ entities to standalone flow editor models
7
+ */
8
+ transformToStandaloneModels(mjSteps, mjPaths) {
9
+ // First, calculate smart positions if needed
10
+ const positionedSteps = this.calculateSmartPositions(mjSteps, mjPaths);
11
+ // Transform steps with calculated positions
12
+ const steps = mjSteps.map(mjStep => {
13
+ const position = positionedSteps.get(mjStep.ID);
14
+ return this.transformStep(mjStep, position);
15
+ });
16
+ const connections = mjPaths.map(mjPath => this.transformPath(mjPath, mjSteps));
17
+ return { steps, connections };
18
+ }
19
+ /**
20
+ * Transform a single MJ step entity to standalone Step model
21
+ */
22
+ transformStep(mjStep, calculatedPosition) {
23
+ // Map MJ step type to standalone step type
24
+ const stepType = this.mapStepType(mjStep.StepType);
25
+ const config = STEP_CONFIGS[stepType];
26
+ // Use calculated position if available, otherwise use stored position
27
+ let position;
28
+ if (calculatedPosition) {
29
+ // Use the smart calculated position
30
+ position = calculatedPosition;
31
+ }
32
+ else if (mjStep.PositionX && mjStep.PositionY && mjStep.PositionX > 0 && mjStep.PositionY > 0) {
33
+ // Fall back to stored position
34
+ position = [mjStep.PositionX, mjStep.PositionY];
35
+ }
36
+ else {
37
+ // Default position as last resort
38
+ position = [100, 100];
39
+ }
40
+ // Create the standalone step
41
+ const step = {
42
+ id: this.generateNumericId(mjStep.ID),
43
+ type: stepType,
44
+ name: mjStep.Name || config.name,
45
+ position: position,
46
+ config: config,
47
+ selectedOption: this.mapSelectedOption(mjStep),
48
+ propertyValues: this.extractPropertyValues(mjStep),
49
+ // Store original MJ entity ID for back-transformation
50
+ mjEntityId: mjStep.ID,
51
+ // Store additional MJ-specific data
52
+ mjData: {
53
+ startingStep: mjStep.StartingStep,
54
+ status: mjStep.Status,
55
+ description: mjStep.Description || undefined
56
+ }
57
+ };
58
+ return step;
59
+ }
60
+ /**
61
+ * Transform a single MJ path entity to standalone Connection model
62
+ */
63
+ transformPath(mjPath, mjSteps) {
64
+ const sourceStep = mjSteps.find(s => s.ID === mjPath.OriginStepID);
65
+ const targetStep = mjSteps.find(s => s.ID === mjPath.DestinationStepID);
66
+ if (!sourceStep || !targetStep) {
67
+ throw new Error(`Invalid path: source or target step not found for path ${mjPath.ID}`);
68
+ }
69
+ const connection = {
70
+ id: mjPath.ID,
71
+ source: this.generateNumericId(sourceStep.ID),
72
+ target: this.generateNumericId(targetStep.ID),
73
+ sourceOutput: 'out', // Default output socket
74
+ targetInput: 'in', // Default input socket
75
+ condition: mjPath.Condition ? {
76
+ expression: mjPath.Condition,
77
+ label: this.extractConditionLabel(mjPath.Condition)
78
+ } : undefined,
79
+ // Store original MJ entity ID
80
+ mjEntityId: mjPath.ID,
81
+ // Store priority for ordering
82
+ mjPriority: mjPath.Priority
83
+ };
84
+ return connection;
85
+ }
86
+ /**
87
+ * Map MJ step type to standalone step type
88
+ */
89
+ mapStepType(mjStepType) {
90
+ if (!mjStepType)
91
+ return 'action';
92
+ const typeMap = {
93
+ 'Prompt': 'prompt',
94
+ 'Sub-Agent': 'agent',
95
+ 'Action': 'action',
96
+ // Add more mappings as needed
97
+ };
98
+ return typeMap[mjStepType] || 'action';
99
+ }
100
+ /**
101
+ * Map MJ step to selected option for the standalone model
102
+ */
103
+ mapSelectedOption(mjStep) {
104
+ // Map based on step type and MJ data
105
+ if (mjStep.StepType === 'Prompt') {
106
+ return mjStep.PromptType || 'user';
107
+ }
108
+ else if (mjStep.StepType === 'Sub-Agent') {
109
+ return mjStep.SubAgentID ? 'subagent' : 'research';
110
+ }
111
+ else if (mjStep.StepType === 'Action') {
112
+ return mjStep.ActionID ? 'api' : 'database';
113
+ }
114
+ return undefined;
115
+ }
116
+ /**
117
+ * Extract property values from MJ step
118
+ */
119
+ extractPropertyValues(mjStep) {
120
+ const values = {};
121
+ // Extract prompt-related properties
122
+ if (mjStep.StepType === 'Prompt') {
123
+ if (mjStep.PromptText) {
124
+ values.promptText = mjStep.PromptText;
125
+ }
126
+ }
127
+ // Extract action-related properties
128
+ if (mjStep.StepType === 'Action') {
129
+ if (mjStep.ActionInputMapping) {
130
+ values.inputMapping = mjStep.ActionInputMapping;
131
+ }
132
+ if (mjStep.ActionOutputMapping) {
133
+ values.outputMapping = mjStep.ActionOutputMapping;
134
+ }
135
+ }
136
+ // Extract sub-agent properties
137
+ if (mjStep.StepType === 'Sub-Agent' && mjStep.SubAgentID) {
138
+ values.subAgentId = mjStep.SubAgentID;
139
+ }
140
+ return values;
141
+ }
142
+ /**
143
+ * Transform standalone models back to MJ entities for saving
144
+ */
145
+ transformToMJEntities(steps, connections, existingMJSteps, existingMJPaths) {
146
+ const stepsToUpdate = [];
147
+ const stepsToCreate = [];
148
+ const pathsToUpdate = [];
149
+ const pathsToCreate = [];
150
+ // Process steps
151
+ for (const step of steps) {
152
+ const mjEntityId = step.mjEntityId;
153
+ const existingStep = existingMJSteps.find(s => s.ID === mjEntityId);
154
+ if (existingStep) {
155
+ // Update existing step
156
+ this.updateMJStep(existingStep, step);
157
+ stepsToUpdate.push(existingStep);
158
+ }
159
+ else {
160
+ // Create new step
161
+ const newStep = this.createMJStep(step);
162
+ stepsToCreate.push(newStep);
163
+ }
164
+ }
165
+ // Process connections
166
+ for (const connection of connections) {
167
+ const mjEntityId = connection.mjEntityId;
168
+ const existingPath = existingMJPaths.find(p => p.ID === mjEntityId);
169
+ if (existingPath) {
170
+ // Update existing path
171
+ this.updateMJPath(existingPath, connection, steps);
172
+ pathsToUpdate.push(existingPath);
173
+ }
174
+ else {
175
+ // Create new path
176
+ const newPath = this.createMJPath(connection, steps);
177
+ pathsToCreate.push(newPath);
178
+ }
179
+ }
180
+ return { stepsToUpdate, pathsToUpdate, stepsToCreate, pathsToCreate };
181
+ }
182
+ /**
183
+ * Update existing MJ step with data from standalone model
184
+ */
185
+ updateMJStep(mjStep, step) {
186
+ mjStep.Name = step.name;
187
+ mjStep.PositionX = Math.round(step.position[0]);
188
+ mjStep.PositionY = Math.round(step.position[1]);
189
+ mjStep.StepType = this.reverseMapStepType(step.type);
190
+ // Update property values
191
+ if (step.propertyValues) {
192
+ if (step.propertyValues.promptText !== undefined) {
193
+ mjStep.PromptText = step.propertyValues.promptText;
194
+ }
195
+ if (step.propertyValues.inputMapping !== undefined) {
196
+ mjStep.ActionInputMapping = step.propertyValues.inputMapping;
197
+ }
198
+ if (step.propertyValues.outputMapping !== undefined) {
199
+ mjStep.ActionOutputMapping = step.propertyValues.outputMapping;
200
+ }
201
+ }
202
+ // Preserve MJ-specific data if it exists
203
+ const mjData = step.mjData;
204
+ if (mjData) {
205
+ if (mjData.startingStep !== undefined) {
206
+ mjStep.StartingStep = mjData.startingStep;
207
+ }
208
+ if (mjData.status !== undefined) {
209
+ mjStep.Status = mjData.status;
210
+ }
211
+ if (mjData.description !== undefined) {
212
+ mjStep.Description = mjData.description;
213
+ }
214
+ }
215
+ }
216
+ /**
217
+ * Create new MJ step from standalone model
218
+ */
219
+ createMJStep(step) {
220
+ const mjData = step.mjData || {};
221
+ return {
222
+ Name: step.name,
223
+ PositionX: Math.round(step.position[0]),
224
+ PositionY: Math.round(step.position[1]),
225
+ StepType: this.reverseMapStepType(step.type),
226
+ StartingStep: mjData.startingStep || false,
227
+ Status: (mjData.status || 'Active'),
228
+ Description: mjData.description || '',
229
+ PromptText: step.propertyValues?.promptText,
230
+ ActionInputMapping: step.propertyValues?.inputMapping,
231
+ ActionOutputMapping: step.propertyValues?.outputMapping
232
+ };
233
+ }
234
+ /**
235
+ * Update existing MJ path with data from standalone model
236
+ */
237
+ updateMJPath(mjPath, connection, steps) {
238
+ // Find the MJ entity IDs for source and target
239
+ const sourceStep = steps.find(s => s.id === connection.source);
240
+ const targetStep = steps.find(s => s.id === connection.target);
241
+ if (sourceStep && targetStep) {
242
+ mjPath.OriginStepID = sourceStep.mjEntityId || '';
243
+ mjPath.DestinationStepID = targetStep.mjEntityId || '';
244
+ }
245
+ if (connection.condition) {
246
+ mjPath.Condition = connection.condition.expression;
247
+ }
248
+ // Preserve priority if it exists
249
+ const mjPriority = connection.mjPriority;
250
+ if (mjPriority !== undefined) {
251
+ mjPath.Priority = mjPriority;
252
+ }
253
+ }
254
+ /**
255
+ * Create new MJ path from standalone model
256
+ */
257
+ createMJPath(connection, steps) {
258
+ const sourceStep = steps.find(s => s.id === connection.source);
259
+ const targetStep = steps.find(s => s.id === connection.target);
260
+ return {
261
+ OriginStepID: sourceStep?.mjEntityId || '',
262
+ DestinationStepID: targetStep?.mjEntityId || '',
263
+ Condition: connection.condition?.expression || '',
264
+ Priority: connection.mjPriority || 0
265
+ };
266
+ }
267
+ /**
268
+ * Reverse map standalone step type to MJ step type
269
+ */
270
+ reverseMapStepType(stepType) {
271
+ const reverseMap = {
272
+ 'prompt': 'Prompt',
273
+ 'agent': 'Sub-Agent',
274
+ 'action': 'Action'
275
+ };
276
+ return reverseMap[stepType];
277
+ }
278
+ /**
279
+ * Generate numeric ID from string UUID
280
+ * This is needed because the standalone editor uses numeric IDs
281
+ */
282
+ generateNumericId(uuid) {
283
+ // Simple hash function to convert UUID to number
284
+ let hash = 0;
285
+ for (let i = 0; i < uuid.length; i++) {
286
+ const char = uuid.charCodeAt(i);
287
+ hash = ((hash << 5) - hash) + char;
288
+ hash = hash & hash; // Convert to 32-bit integer
289
+ }
290
+ return Math.abs(hash);
291
+ }
292
+ /**
293
+ * Extract a readable label from a condition expression
294
+ */
295
+ extractConditionLabel(condition) {
296
+ // Simple extraction - can be enhanced
297
+ if (condition.toLowerCase().includes('success'))
298
+ return 'Success';
299
+ if (condition.toLowerCase().includes('fail'))
300
+ return 'Failure';
301
+ if (condition.toLowerCase().includes('error'))
302
+ return 'Error';
303
+ // Return first 20 chars if no pattern matches
304
+ return condition.length > 20 ? condition.substring(0, 20) + '...' : condition;
305
+ }
306
+ /**
307
+ * Calculate smart positions for steps that don't have valid positions
308
+ */
309
+ calculateSmartPositions(mjSteps, mjPaths) {
310
+ const positions = new Map();
311
+ // Check if all steps already have valid positions
312
+ const allHavePositions = mjSteps.every(step => step.PositionX && step.PositionY && step.PositionX > 0 && step.PositionY > 0);
313
+ // TEMPORARY: Force recalculation for testing
314
+ // Comment out these lines to use saved positions
315
+ const forceRecalculate = true;
316
+ if (allHavePositions && !forceRecalculate) {
317
+ // Return empty map if all positions are valid
318
+ return positions;
319
+ }
320
+ // Build adjacency lists for the flow graph
321
+ const children = new Map();
322
+ const parents = new Map();
323
+ const allStepIds = new Set(mjSteps.map(s => s.ID));
324
+ mjPaths.forEach(path => {
325
+ // Children of a step
326
+ if (!children.has(path.OriginStepID)) {
327
+ children.set(path.OriginStepID, []);
328
+ }
329
+ children.get(path.OriginStepID).push(path.DestinationStepID);
330
+ // Parents of a step
331
+ if (!parents.has(path.DestinationStepID)) {
332
+ parents.set(path.DestinationStepID, []);
333
+ }
334
+ parents.get(path.DestinationStepID).push(path.OriginStepID);
335
+ });
336
+ // Find starting steps (no parents or marked as starting)
337
+ const startingSteps = mjSteps.filter(step => step.StartingStep || !parents.has(step.ID) || parents.get(step.ID).length === 0);
338
+ // If no starting steps found, use the first step
339
+ if (startingSteps.length === 0 && mjSteps.length > 0) {
340
+ startingSteps.push(mjSteps[0]);
341
+ }
342
+ // Calculate levels using BFS
343
+ const levels = new Map();
344
+ const visited = new Set();
345
+ const queue = [];
346
+ // Start with starting steps at level 0
347
+ startingSteps.forEach(step => {
348
+ queue.push({ id: step.ID, level: 0 });
349
+ levels.set(step.ID, 0);
350
+ visited.add(step.ID);
351
+ });
352
+ // BFS to assign levels
353
+ let maxLevel = 0;
354
+ while (queue.length > 0) {
355
+ const { id, level } = queue.shift();
356
+ maxLevel = Math.max(maxLevel, level);
357
+ // Process children
358
+ const stepChildren = children.get(id) || [];
359
+ stepChildren.forEach(childId => {
360
+ if (!visited.has(childId) && allStepIds.has(childId)) {
361
+ visited.add(childId);
362
+ levels.set(childId, level + 1);
363
+ queue.push({ id: childId, level: level + 1 });
364
+ }
365
+ });
366
+ }
367
+ // Handle disconnected steps
368
+ mjSteps.forEach(step => {
369
+ if (!levels.has(step.ID)) {
370
+ levels.set(step.ID, maxLevel + 1);
371
+ }
372
+ });
373
+ // Group steps by level
374
+ const stepsByLevel = new Map();
375
+ mjSteps.forEach(step => {
376
+ const level = levels.get(step.ID) || 0;
377
+ if (!stepsByLevel.has(level)) {
378
+ stepsByLevel.set(level, []);
379
+ }
380
+ stepsByLevel.get(level).push(step);
381
+ });
382
+ // Calculate positions
383
+ const horizontalSpacing = 450; // Increased space between levels for better condition visibility
384
+ const verticalSpacing = 180; // Increased vertical spacing to see conditions clearly
385
+ const startX = 100; // Start closer to left edge
386
+ const startY = 50; // Start much closer to top
387
+ stepsByLevel.forEach((stepsInLevel, level) => {
388
+ const x = startX + (level * horizontalSpacing);
389
+ // Center vertically based on viewport, not total levels
390
+ const totalHeight = (stepsInLevel.length - 1) * verticalSpacing;
391
+ const startYForLevel = startY + Math.max(0, (400 - totalHeight) / 2); // Center around 400px height for better visibility
392
+ stepsInLevel.forEach((step, index) => {
393
+ const y = startYForLevel + (index * verticalSpacing);
394
+ positions.set(step.ID, [x, y]);
395
+ });
396
+ });
397
+ return positions;
398
+ }
399
+ static { this.ɵfac = function MJFlowTransformerService_Factory(t) { return new (t || MJFlowTransformerService)(); }; }
400
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MJFlowTransformerService, factory: MJFlowTransformerService.ɵfac, providedIn: 'root' }); }
401
+ }
402
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MJFlowTransformerService, [{
403
+ type: Injectable,
404
+ args: [{
405
+ providedIn: 'root'
406
+ }]
407
+ }], null, null); })();
408
+ //# sourceMappingURL=mj-flow-transformer.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mj-flow-transformer.service.js","sourceRoot":"","sources":["../../../../../../../src/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/mj-flow-transformer.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAkB,YAAY,EAAE,MAAM,sBAAsB,CAAC;;AAOpE,MAAM,OAAO,wBAAwB;IAEnC;;OAEG;IACH,2BAA2B,CACzB,OAA4B,EAC5B,OAAgC;QAEhC,6CAA6C;QAC7C,MAAM,eAAe,GAAG,IAAI,CAAC,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAEvE,4CAA4C;QAC5C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACjC,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAChD,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAE/E,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACK,aAAa,CAAC,MAAiD,EAAE,kBAAqC;QAC5G,2CAA2C;QAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;QAEtC,sEAAsE;QACtE,IAAI,QAA0B,CAAC;QAC/B,IAAI,kBAAkB,EAAE,CAAC;YACvB,oCAAoC;YACpC,QAAQ,GAAG,kBAAkB,CAAC;QAChC,CA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AsB;QACtB,MAAM,iBAAiB,GAAG,GAAG,CAAC,CAAC,iEAAiE;QAChG,MAAM,eAAe,GAAG,GAAG,CAAC,CAAG,uDAAuD;QACtF,MAAM,MAAM,GAAG,GAAG,CAAC,CAAY,4BAA4B;QAC3D,MAAM,MAAM,GAAG,EAAE,CAAC,CAAa,2BAA2B;QAE1D,YAAY,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE;YAC3C,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,KAAK,GAAG,iBAAiB,CAAC,CAAC;YAC/C,wDAAwD;YACxD,MAAM,WAAW,GAAG,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;YAChE,MAAM,cAAc,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,mDAAmD;YAEzH,YAAY,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBACnC,MAAM,CAAC,GAAG,cAAc,GAAG,CAAC,KAAK,GAAG,eAAe,CAAC,CAAC;gBACrD,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YACjC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC;yFAldU,wBAAwB;uEAAxB,wBAAwB,WAAxB,wBAAwB,mBAFvB,MAAM;;iFAEP,wBAAwB;cAHpC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB"}
@@ -0,0 +1,19 @@
1
+ import { Module, ModuleType } from '../models/module.model';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ModuleManagerService {
4
+ private selectedModule$;
5
+ selectedModule: import("rxjs").Observable<Module | null>;
6
+ private moduleTypes;
7
+ constructor();
8
+ getModuleTypes(): {
9
+ [key: string]: ModuleType;
10
+ };
11
+ getModuleType(type: string): ModuleType | undefined;
12
+ createModule(type: string, id?: string | null): Module | null;
13
+ updateModuleProperty(module: Module, propertyName: string, value: any): void;
14
+ selectModule(module: Module | null): void;
15
+ deleteModule(modules: Module[], moduleId: string): Module[];
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<ModuleManagerService, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<ModuleManagerService>;
18
+ }
19
+ //# sourceMappingURL=module-manager.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-manager.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/module-manager.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;;AAG5D,qBAGa,oBAAoB;IAC/B,OAAO,CAAC,eAAe,CAA4C;IAC5D,cAAc,2CAAuC;IAE5D,OAAO,CAAC,WAAW,CA6DjB;;IAIF,cAAc,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE;IAI/C,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAInD,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAE,MAAM,GAAG,IAAW,GAAG,MAAM,GAAG,IAAI;IAuBnE,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAM5E,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIzC,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE;yCA9GhD,oBAAoB;6CAApB,oBAAoB;CAiHhC"}
@@ -0,0 +1,116 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import * as i0 from "@angular/core";
4
+ export class ModuleManagerService {
5
+ constructor() {
6
+ this.selectedModule$ = new BehaviorSubject(null);
7
+ this.selectedModule = this.selectedModule$.asObservable();
8
+ this.moduleTypes = {
9
+ prompt: {
10
+ name: 'Prompt',
11
+ icon: 'fa-comment',
12
+ color: '#28a745',
13
+ properties: {
14
+ promptText: { type: 'textarea', label: 'Prompt Text', default: '' },
15
+ temperature: { type: 'number', label: 'Temperature', default: 0.7, min: 0, max: 1, step: 0.1 },
16
+ maxTokens: { type: 'number', label: 'Max Tokens', default: 150 }
17
+ }
18
+ },
19
+ 'api-call': {
20
+ name: 'API Call',
21
+ icon: 'fa-cloud',
22
+ color: '#007bff',
23
+ properties: {
24
+ url: { type: 'text', label: 'API URL', default: '' },
25
+ method: { type: 'select', label: 'Method', default: 'GET', options: ['GET', 'POST', 'PUT', 'DELETE'] },
26
+ headers: { type: 'textarea', label: 'Headers (JSON)', default: '{}' },
27
+ body: { type: 'textarea', label: 'Body (JSON)', default: '{}' }
28
+ }
29
+ },
30
+ condition: {
31
+ name: 'Condition',
32
+ icon: 'fa-share-alt',
33
+ color: '#ffc107',
34
+ properties: {
35
+ condition: { type: 'text', label: 'Condition Expression', default: '' },
36
+ trueLabel: { type: 'text', label: 'True Branch Label', default: 'True' },
37
+ falseLabel: { type: 'text', label: 'False Branch Label', default: 'False' }
38
+ }
39
+ },
40
+ variable: {
41
+ name: 'Variable',
42
+ icon: 'fa-tag',
43
+ color: '#6c757d',
44
+ properties: {
45
+ variableName: { type: 'text', label: 'Variable Name', default: '' },
46
+ variableValue: { type: 'text', label: 'Initial Value', default: '' },
47
+ variableType: { type: 'select', label: 'Type', default: 'string', options: ['string', 'number', 'boolean', 'object'] }
48
+ }
49
+ },
50
+ loop: {
51
+ name: 'Loop',
52
+ icon: 'fa-redo',
53
+ color: '#6f42c1',
54
+ properties: {
55
+ loopType: { type: 'select', label: 'Loop Type', default: 'for', options: ['for', 'while', 'forEach'] },
56
+ iterations: { type: 'number', label: 'Iterations', default: 10 },
57
+ collection: { type: 'text', label: 'Collection Variable', default: '' }
58
+ }
59
+ },
60
+ output: {
61
+ name: 'Output',
62
+ icon: 'fa-paper-plane',
63
+ color: '#dc3545',
64
+ properties: {
65
+ outputType: { type: 'select', label: 'Output Type', default: 'text', options: ['text', 'json', 'file'] },
66
+ format: { type: 'text', label: 'Format Template', default: '' }
67
+ }
68
+ }
69
+ };
70
+ }
71
+ getModuleTypes() {
72
+ return this.moduleTypes;
73
+ }
74
+ getModuleType(type) {
75
+ return this.moduleTypes[type];
76
+ }
77
+ createModule(type, id = null) {
78
+ const moduleType = this.moduleTypes[type];
79
+ if (!moduleType)
80
+ return null;
81
+ const moduleId = id || `module-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
82
+ const module = {
83
+ id: moduleId,
84
+ type: type,
85
+ name: moduleType.name,
86
+ icon: moduleType.icon,
87
+ color: moduleType.color,
88
+ properties: {}
89
+ };
90
+ // Initialize properties with default values
91
+ for (const [key, prop] of Object.entries(moduleType.properties)) {
92
+ module.properties[key] = prop.default;
93
+ }
94
+ return module;
95
+ }
96
+ updateModuleProperty(module, propertyName, value) {
97
+ if (module && module.properties) {
98
+ module.properties[propertyName] = value;
99
+ }
100
+ }
101
+ selectModule(module) {
102
+ this.selectedModule$.next(module);
103
+ }
104
+ deleteModule(modules, moduleId) {
105
+ return modules.filter(m => m.id !== moduleId);
106
+ }
107
+ static { this.ɵfac = function ModuleManagerService_Factory(t) { return new (t || ModuleManagerService)(); }; }
108
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ModuleManagerService, factory: ModuleManagerService.ɵfac, providedIn: 'root' }); }
109
+ }
110
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ModuleManagerService, [{
111
+ type: Injectable,
112
+ args: [{
113
+ providedIn: 'root'
114
+ }]
115
+ }], () => [], null); })();
116
+ //# sourceMappingURL=module-manager.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-manager.service.js","sourceRoot":"","sources":["../../../../../../../src/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/module-manager.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;;AAKvC,MAAM,OAAO,oBAAoB;IAmE/B;QAlEQ,oBAAe,GAAG,IAAI,eAAe,CAAgB,IAAI,CAAC,CAAC;QAC5D,mBAAc,GAAG,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC;QAEpD,gBAAW,GAAkC;YACnD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,SAAS;gBAChB,UAAU,EAAE;oBACV,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,EAAE;oBACnE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE;oBAC9F,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE;iBACjE;aACF;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,SAAS;gBAChB,UAAU,EAAE;oBACV,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;oBACpD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAA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CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAEzF,MAAM,MAAM,GAAW;YACrB,EAAE,EAAE,QAAQ;YACZ,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,UAAU,EAAE,EAAE;SACf,CAAC;QAEF,4CAA4C;QAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAChE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QACxC,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,oBAAoB,CAAC,MAAc,EAAE,YAAoB,EAAE,KAAU;QACnE,IAAI,MAAM,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YAChC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,YAAY,CAAC,MAAqB;QAChC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAED,YAAY,CAAC,OAAiB,EAAE,QAAgB;QAC9C,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;IAChD,CAAC;qFAhHU,oBAAoB;uEAApB,oBAAoB,WAApB,oBAAoB,mBAFnB,MAAM;;iFAEP,oBAAoB;cAHhC,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB"}
@@ -0,0 +1,25 @@
1
+ import { Observable } from 'rxjs';
2
+ import { StepOption } from '../models/step.model';
3
+ import * as i0 from "@angular/core";
4
+ export interface CustomPrompt extends StepOption {
5
+ isCustom: boolean;
6
+ createdAt: Date;
7
+ modifiedAt: Date;
8
+ }
9
+ export declare class PromptManagerService {
10
+ private customPrompts$;
11
+ private nextPromptId;
12
+ customPrompts: Observable<CustomPrompt[]>;
13
+ constructor();
14
+ private loadSavedPrompts;
15
+ private savePrompts;
16
+ createPrompt(name: string, properties: any[]): CustomPrompt;
17
+ updatePrompt(promptId: string, updates: Partial<CustomPrompt>): void;
18
+ deletePrompt(promptId: string): void;
19
+ getPrompt(promptId: string): CustomPrompt | undefined;
20
+ duplicatePrompt(promptId: string, newName: string): CustomPrompt | null;
21
+ getAllPromptOptions(builtInPrompts: StepOption[]): StepOption[];
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<PromptManagerService, never>;
23
+ static ɵprov: i0.ɵɵInjectableDeclaration<PromptManagerService>;
24
+ }
25
+ //# sourceMappingURL=prompt-manager.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-manager.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/custom/AIAgents/FlowAgentType/flow-editor-integration/services/prompt-manager.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,UAAU,EAAE,MAAM,MAAM,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;;AAElD,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,IAAI,CAAC;IAChB,UAAU,EAAE,IAAI,CAAC;CAClB;AAED,qBAGa,oBAAoB;IAC/B,OAAO,CAAC,cAAc,CAA2C;IACjE,OAAO,CAAC,YAAY,CAAK;IAElB,aAAa,6BAAsC;;IAO1D,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,WAAW;IAKnB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,YAAY;IAmB3D,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI;IAUpE,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMpC,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAIrD,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAWvE,mBAAmB,CAAC,cAAc,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE;yCAnFpD,oBAAoB;6CAApB,oBAAoB;CA6FhC"}