@memberjunction/ng-dashboards 2.42.0 → 2.42.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.
@@ -0,0 +1,1205 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { Component, Input, Output, EventEmitter } from '@angular/core';
11
+ import { Metadata, CompositeKey, LogError, LogStatus } from '@memberjunction/core';
12
+ import { Subject, BehaviorSubject } from 'rxjs';
13
+ import * as i0 from "@angular/core";
14
+ import * as i1 from "@memberjunction/ng-notifications";
15
+ import * as i2 from "@angular/forms";
16
+ import * as i3 from "@angular/common";
17
+ const _forTrack0 = ($index, $item) => $item.ID;
18
+ const _forTrack1 = ($index, $item) => $item.id;
19
+ const _forTrack2 = ($index, $item) => $item.fieldName;
20
+ function PromptVersionControlComponent_Conditional_1_Conditional_13_Template(rf, ctx) { if (rf & 1) {
21
+ i0.ɵɵelementStart(0, "div", 12);
22
+ i0.ɵɵelement(1, "i", 13);
23
+ i0.ɵɵelementStart(2, "p", 14);
24
+ i0.ɵɵtext(3, "No prompts available");
25
+ i0.ɵɵelementEnd()();
26
+ } }
27
+ function PromptVersionControlComponent_Conditional_1_Conditional_14_For_1_Conditional_4_Template(rf, ctx) { if (rf & 1) {
28
+ i0.ɵɵelementStart(0, "p", 19);
29
+ i0.ɵɵtext(1);
30
+ i0.ɵɵelementEnd();
31
+ } if (rf & 2) {
32
+ const promptItem_r4 = i0.ɵɵnextContext().$implicit;
33
+ i0.ɵɵadvance();
34
+ i0.ɵɵtextInterpolate(promptItem_r4.Description);
35
+ } }
36
+ function PromptVersionControlComponent_Conditional_1_Conditional_14_For_1_Template(rf, ctx) { if (rf & 1) {
37
+ const _r3 = i0.ɵɵgetCurrentView();
38
+ i0.ɵɵelementStart(0, "div", 16);
39
+ i0.ɵɵlistener("click", function PromptVersionControlComponent_Conditional_1_Conditional_14_For_1_Template_div_click_0_listener() { const promptItem_r4 = i0.ɵɵrestoreView(_r3).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.selectPromptForHistory(promptItem_r4)); });
40
+ i0.ɵɵelementStart(1, "div", 17)(2, "h6", 18);
41
+ i0.ɵɵtext(3);
42
+ i0.ɵɵelementEnd();
43
+ i0.ɵɵtemplate(4, PromptVersionControlComponent_Conditional_1_Conditional_14_For_1_Conditional_4_Template, 2, 1, "p", 19);
44
+ i0.ɵɵelementEnd();
45
+ i0.ɵɵelementStart(5, "div", 20);
46
+ i0.ɵɵelement(6, "i", 21);
47
+ i0.ɵɵelementEnd()();
48
+ } if (rf & 2) {
49
+ const promptItem_r4 = ctx.$implicit;
50
+ i0.ɵɵadvance(3);
51
+ i0.ɵɵtextInterpolate(promptItem_r4.Name);
52
+ i0.ɵɵadvance();
53
+ i0.ɵɵconditional(promptItem_r4.Description ? 4 : -1);
54
+ } }
55
+ function PromptVersionControlComponent_Conditional_1_Conditional_14_Template(rf, ctx) { if (rf & 1) {
56
+ i0.ɵɵrepeaterCreate(0, PromptVersionControlComponent_Conditional_1_Conditional_14_For_1_Template, 7, 2, "div", 15, _forTrack0);
57
+ } if (rf & 2) {
58
+ const ctx_r1 = i0.ɵɵnextContext(2);
59
+ i0.ɵɵrepeater(ctx_r1.filteredAvailablePrompts);
60
+ } }
61
+ function PromptVersionControlComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
62
+ const _r1 = i0.ɵɵgetCurrentView();
63
+ i0.ɵɵelementStart(0, "div", 1)(1, "h5", 2);
64
+ i0.ɵɵelement(2, "i", 3);
65
+ i0.ɵɵtext(3, " Version History ");
66
+ i0.ɵɵelementEnd();
67
+ i0.ɵɵelementStart(4, "p", 4);
68
+ i0.ɵɵtext(5, "Select a prompt to view its version history");
69
+ i0.ɵɵelementEnd();
70
+ i0.ɵɵelementStart(6, "div", 5)(7, "div", 6)(8, "div", 7)(9, "span", 8);
71
+ i0.ɵɵelement(10, "i", 9);
72
+ i0.ɵɵelementEnd();
73
+ i0.ɵɵelementStart(11, "input", 10);
74
+ i0.ɵɵlistener("ngModelChange", function PromptVersionControlComponent_Conditional_1_Template_input_ngModelChange_11_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onPromptSearchChange($event)); });
75
+ i0.ɵɵelementEnd()()();
76
+ i0.ɵɵelementStart(12, "div", 11);
77
+ i0.ɵɵtemplate(13, PromptVersionControlComponent_Conditional_1_Conditional_13_Template, 4, 0, "div", 12)(14, PromptVersionControlComponent_Conditional_1_Conditional_14_Template, 2, 0);
78
+ i0.ɵɵelementEnd()()();
79
+ } if (rf & 2) {
80
+ const ctx_r1 = i0.ɵɵnextContext();
81
+ i0.ɵɵadvance(11);
82
+ i0.ɵɵproperty("ngModel", ctx_r1.promptSearchTerm$.value);
83
+ i0.ɵɵadvance(2);
84
+ i0.ɵɵconditional(ctx_r1.availablePrompts.length === 0 ? 13 : 14);
85
+ } }
86
+ function PromptVersionControlComponent_Conditional_2_Conditional_5_Template(rf, ctx) { if (rf & 1) {
87
+ i0.ɵɵelementStart(0, "span", 25);
88
+ i0.ɵɵtext(1);
89
+ i0.ɵɵelementEnd();
90
+ } if (rf & 2) {
91
+ const ctx_r1 = i0.ɵɵnextContext(2);
92
+ i0.ɵɵadvance();
93
+ i0.ɵɵtextInterpolate1("- ", ctx_r1.prompt.Name, "");
94
+ } }
95
+ function PromptVersionControlComponent_Conditional_2_Conditional_50_Template(rf, ctx) { if (rf & 1) {
96
+ i0.ɵɵelementStart(0, "div", 56)(1, "div", 58)(2, "div", 59)(3, "span", 60);
97
+ i0.ɵɵtext(4, "Loading...");
98
+ i0.ɵɵelementEnd()();
99
+ i0.ɵɵelementStart(5, "p", 61);
100
+ i0.ɵɵtext(6);
101
+ i0.ɵɵelementEnd()()();
102
+ } if (rf & 2) {
103
+ const ctx_r1 = i0.ɵɵnextContext(2);
104
+ i0.ɵɵadvance(6);
105
+ i0.ɵɵtextInterpolate(ctx_r1.loadingMessage);
106
+ } }
107
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_4_Template(rf, ctx) { if (rf & 1) {
108
+ i0.ɵɵelement(0, "div", 71);
109
+ } }
110
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_19_Template(rf, ctx) { if (rf & 1) {
111
+ const _r8 = i0.ɵɵgetCurrentView();
112
+ i0.ɵɵelementStart(0, "button", 85);
113
+ i0.ɵɵlistener("click", function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_19_Template_button_click_0_listener($event) { i0.ɵɵrestoreView(_r8); const version_r7 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(5); $event.stopPropagation(); return i0.ɵɵresetView(ctx_r1.startComparison(version_r7)); });
114
+ i0.ɵɵelement(1, "i", 33);
115
+ i0.ɵɵelementEnd();
116
+ } }
117
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_20_Template(rf, ctx) { if (rf & 1) {
118
+ const _r9 = i0.ɵɵgetCurrentView();
119
+ i0.ɵɵelementStart(0, "button", 86);
120
+ i0.ɵɵlistener("click", function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_20_Template_button_click_0_listener($event) { i0.ɵɵrestoreView(_r9); const version_r7 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(5); $event.stopPropagation(); return i0.ɵɵresetView(ctx_r1.onVersionRestore(version_r7)); });
121
+ i0.ɵɵelement(1, "i", 87);
122
+ i0.ɵɵelementEnd();
123
+ } }
124
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_23_For_3_Conditional_3_Template(rf, ctx) { if (rf & 1) {
125
+ i0.ɵɵelementStart(0, "span", 91)(1, "span", 93);
126
+ i0.ɵɵtext(2);
127
+ i0.ɵɵelementEnd();
128
+ i0.ɵɵelement(3, "i", 21);
129
+ i0.ɵɵelementStart(4, "span", 92);
130
+ i0.ɵɵtext(5);
131
+ i0.ɵɵelementEnd()();
132
+ } if (rf & 2) {
133
+ const field_r10 = i0.ɵɵnextContext().$implicit;
134
+ const version_r7 = i0.ɵɵnextContext(2).$implicit;
135
+ const ctx_r1 = i0.ɵɵnextContext(5);
136
+ i0.ɵɵadvance(2);
137
+ i0.ɵɵtextInterpolate(ctx_r1.formatChangeValue(version_r7.changesJSON[field_r10].oldValue));
138
+ i0.ɵɵadvance(3);
139
+ i0.ɵɵtextInterpolate(ctx_r1.formatChangeValue(version_r7.changesJSON[field_r10].newValue));
140
+ } }
141
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_23_For_3_Conditional_4_Template(rf, ctx) { if (rf & 1) {
142
+ i0.ɵɵelementStart(0, "span", 92);
143
+ i0.ɵɵtext(1);
144
+ i0.ɵɵelementEnd();
145
+ } if (rf & 2) {
146
+ const field_r10 = i0.ɵɵnextContext().$implicit;
147
+ const version_r7 = i0.ɵɵnextContext(2).$implicit;
148
+ const ctx_r1 = i0.ɵɵnextContext(5);
149
+ i0.ɵɵadvance();
150
+ i0.ɵɵtextInterpolate(ctx_r1.formatChangeValue(version_r7.changesJSON[field_r10].newValue));
151
+ } }
152
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_23_For_3_Template(rf, ctx) { if (rf & 1) {
153
+ i0.ɵɵelementStart(0, "div", 89)(1, "span", 90);
154
+ i0.ɵɵtext(2);
155
+ i0.ɵɵelementEnd();
156
+ i0.ɵɵtemplate(3, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_23_For_3_Conditional_3_Template, 6, 2, "span", 91)(4, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_23_For_3_Conditional_4_Template, 2, 1, "span", 92);
157
+ i0.ɵɵelementEnd();
158
+ } if (rf & 2) {
159
+ const field_r10 = ctx.$implicit;
160
+ const version_r7 = i0.ɵɵnextContext(2).$implicit;
161
+ const ctx_r1 = i0.ɵɵnextContext(5);
162
+ i0.ɵɵadvance(2);
163
+ i0.ɵɵtextInterpolate(ctx_r1.getFieldDisplayNamePublic(field_r10));
164
+ i0.ɵɵadvance();
165
+ i0.ɵɵconditional(version_r7.changesJSON[field_r10].oldValue !== undefined ? 3 : 4);
166
+ } }
167
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_23_Template(rf, ctx) { if (rf & 1) {
168
+ i0.ɵɵelementStart(0, "div", 84)(1, "div", 88);
169
+ i0.ɵɵrepeaterCreate(2, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_23_For_3_Template, 5, 2, "div", 89, i0.ɵɵrepeaterTrackByIdentity);
170
+ i0.ɵɵelementEnd()();
171
+ } if (rf & 2) {
172
+ const version_r7 = i0.ɵɵnextContext().$implicit;
173
+ const ctx_r1 = i0.ɵɵnextContext(5);
174
+ i0.ɵɵadvance(2);
175
+ i0.ɵɵrepeater(ctx_r1.getObjectKeys(version_r7.changesJSON));
176
+ } }
177
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Template(rf, ctx) { if (rf & 1) {
178
+ const _r6 = i0.ɵɵgetCurrentView();
179
+ i0.ɵɵelementStart(0, "div", 68);
180
+ i0.ɵɵlistener("click", function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Template_div_click_0_listener() { const version_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.onVersionSelect(version_r7)); });
181
+ i0.ɵɵelementStart(1, "div", 69)(2, "div", 70);
182
+ i0.ɵɵelement(3, "i", 51);
183
+ i0.ɵɵelementEnd();
184
+ i0.ɵɵtemplate(4, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_4_Template, 1, 0, "div", 71);
185
+ i0.ɵɵelementEnd();
186
+ i0.ɵɵelementStart(5, "div", 72)(6, "div", 73)(7, "div", 74)(8, "h6", 75);
187
+ i0.ɵɵtext(9);
188
+ i0.ɵɵelementEnd();
189
+ i0.ɵɵelementStart(10, "div", 76)(11, "span", 77);
190
+ i0.ɵɵtext(12);
191
+ i0.ɵɵpipe(13, "date");
192
+ i0.ɵɵelementEnd();
193
+ i0.ɵɵelementStart(14, "span", 78);
194
+ i0.ɵɵtext(15);
195
+ i0.ɵɵelementEnd();
196
+ i0.ɵɵelementStart(16, "span", 79);
197
+ i0.ɵɵtext(17);
198
+ i0.ɵɵelementEnd()()();
199
+ i0.ɵɵelementStart(18, "div", 80);
200
+ i0.ɵɵtemplate(19, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_19_Template, 2, 0, "button", 81)(20, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_20_Template, 2, 0, "button", 82);
201
+ i0.ɵɵelementEnd()();
202
+ i0.ɵɵelementStart(21, "div", 83);
203
+ i0.ɵɵtext(22);
204
+ i0.ɵɵelementEnd();
205
+ i0.ɵɵtemplate(23, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Conditional_23_Template, 4, 0, "div", 84);
206
+ i0.ɵɵelementEnd()();
207
+ } if (rf & 2) {
208
+ const version_r7 = ctx.$implicit;
209
+ const ɵ$index_163_r11 = ctx.$index;
210
+ const ctx_r1 = i0.ɵɵnextContext(5);
211
+ i0.ɵɵclassProp("selected", (ctx_r1.selectedVersion == null ? null : ctx_r1.selectedVersion.id) === version_r7.id)("active", version_r7.isActive);
212
+ i0.ɵɵadvance(2);
213
+ i0.ɵɵclassMap(ctx_r1.getChangeTypeClass(version_r7.changeType));
214
+ i0.ɵɵadvance();
215
+ i0.ɵɵclassMap(ctx_r1.getChangeTypeIcon(version_r7.changeType));
216
+ i0.ɵɵadvance();
217
+ i0.ɵɵconditional(ɵ$index_163_r11 < ctx_r1.versions.length - 1 ? 4 : -1);
218
+ i0.ɵɵadvance(5);
219
+ i0.ɵɵtextInterpolate(ctx_r1.getVersionLabel(version_r7));
220
+ i0.ɵɵadvance(3);
221
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(13, 21, version_r7.changedAt, "medium"));
222
+ i0.ɵɵadvance(3);
223
+ i0.ɵɵtextInterpolate1("by ", version_r7.changedBy, "");
224
+ i0.ɵɵadvance();
225
+ i0.ɵɵclassProp("badge-primary", version_r7.changeSource === "Internal")("badge-secondary", version_r7.changeSource === "External");
226
+ i0.ɵɵadvance();
227
+ i0.ɵɵtextInterpolate1(" ", version_r7.changeSource, " ");
228
+ i0.ɵɵadvance(2);
229
+ i0.ɵɵconditional(ctx_r1.showComparison && ɵ$index_163_r11 < ctx_r1.versions.length - 1 ? 19 : -1);
230
+ i0.ɵɵadvance();
231
+ i0.ɵɵconditional(ctx_r1.showRestoreActions && version_r7.canRestore ? 20 : -1);
232
+ i0.ɵɵadvance(2);
233
+ i0.ɵɵtextInterpolate1(" ", version_r7.changesDescription, " ");
234
+ i0.ɵɵadvance();
235
+ i0.ɵɵconditional(version_r7.changesJSON && ctx_r1.timelineConfig.showDiffs ? 23 : -1);
236
+ } }
237
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_Template(rf, ctx) { if (rf & 1) {
238
+ i0.ɵɵelementStart(0, "div", 65);
239
+ i0.ɵɵrepeaterCreate(1, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_For_2_Template, 24, 24, "div", 67, _forTrack1);
240
+ i0.ɵɵelementEnd();
241
+ } if (rf & 2) {
242
+ const ctx_r1 = i0.ɵɵnextContext(4);
243
+ i0.ɵɵadvance();
244
+ i0.ɵɵrepeater(ctx_r1.versions);
245
+ } }
246
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_2_Conditional_4_Template(rf, ctx) { if (rf & 1) {
247
+ i0.ɵɵelementStart(0, "p", 14)(1, "small");
248
+ i0.ɵɵtext(2, "Record changes tracking may not be enabled for prompts.");
249
+ i0.ɵɵelementEnd()();
250
+ } }
251
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_2_Template(rf, ctx) { if (rf & 1) {
252
+ i0.ɵɵelementStart(0, "div", 66);
253
+ i0.ɵɵelement(1, "i", 94);
254
+ i0.ɵɵelementStart(2, "p", 14);
255
+ i0.ɵɵtext(3, "No version history available for this prompt.");
256
+ i0.ɵɵelementEnd();
257
+ i0.ɵɵtemplate(4, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_2_Conditional_4_Template, 3, 0, "p", 14);
258
+ i0.ɵɵelementEnd();
259
+ } if (rf & 2) {
260
+ const ctx_r1 = i0.ɵɵnextContext(4);
261
+ i0.ɵɵadvance(4);
262
+ i0.ɵɵconditional(ctx_r1.prompt && !ctx_r1.prompt.EntityInfo.TrackRecordChanges ? 4 : -1);
263
+ } }
264
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Template(rf, ctx) { if (rf & 1) {
265
+ i0.ɵɵelementStart(0, "div", 62);
266
+ i0.ɵɵtemplate(1, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_1_Template, 3, 0, "div", 65)(2, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Conditional_2_Template, 5, 1, "div", 66);
267
+ i0.ɵɵelementEnd();
268
+ } if (rf & 2) {
269
+ const ctx_r1 = i0.ɵɵnextContext(3);
270
+ i0.ɵɵadvance();
271
+ i0.ɵɵconditional(ctx_r1.versions.length > 0 ? 1 : 2);
272
+ } }
273
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_For_7_Template(rf, ctx) { if (rf & 1) {
274
+ i0.ɵɵelementStart(0, "option", 98);
275
+ i0.ɵɵtext(1);
276
+ i0.ɵɵpipe(2, "date");
277
+ i0.ɵɵelementEnd();
278
+ } if (rf & 2) {
279
+ const version_r13 = ctx.$implicit;
280
+ const ctx_r1 = i0.ɵɵnextContext(4);
281
+ i0.ɵɵproperty("ngValue", version_r13);
282
+ i0.ɵɵadvance();
283
+ i0.ɵɵtextInterpolate2("", ctx_r1.getVersionLabel(version_r13), " - ", i0.ɵɵpipeBind2(2, 3, version_r13.changedAt, "short"), "");
284
+ } }
285
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_For_15_Template(rf, ctx) { if (rf & 1) {
286
+ i0.ɵɵelementStart(0, "option", 98);
287
+ i0.ɵɵtext(1);
288
+ i0.ɵɵpipe(2, "date");
289
+ i0.ɵɵelementEnd();
290
+ } if (rf & 2) {
291
+ const version_r14 = ctx.$implicit;
292
+ const ctx_r1 = i0.ɵɵnextContext(4);
293
+ i0.ɵɵproperty("ngValue", version_r14);
294
+ i0.ɵɵadvance();
295
+ i0.ɵɵtextInterpolate2("", ctx_r1.getVersionLabel(version_r14), " - ", i0.ɵɵpipeBind2(2, 3, version_r14.changedAt, "short"), "");
296
+ } }
297
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_7_Template(rf, ctx) { if (rf & 1) {
298
+ i0.ɵɵelementStart(0, "span", 111);
299
+ i0.ɵɵtext(1, "Template");
300
+ i0.ɵɵelementEnd();
301
+ } }
302
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_9_Conditional_5_Template(rf, ctx) { if (rf & 1) {
303
+ i0.ɵɵelementStart(0, "pre", 119);
304
+ i0.ɵɵtext(1);
305
+ i0.ɵɵelementEnd();
306
+ } if (rf & 2) {
307
+ const diff_r15 = i0.ɵɵnextContext(2).$implicit;
308
+ i0.ɵɵadvance();
309
+ i0.ɵɵtextInterpolate(diff_r15.oldValue);
310
+ } }
311
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_9_Conditional_6_Template(rf, ctx) { if (rf & 1) {
312
+ i0.ɵɵtext(0);
313
+ } if (rf & 2) {
314
+ const diff_r15 = i0.ɵɵnextContext(2).$implicit;
315
+ const ctx_r1 = i0.ɵɵnextContext(6);
316
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.formatChangeValue(diff_r15.oldValue), " ");
317
+ } }
318
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_9_Conditional_11_Template(rf, ctx) { if (rf & 1) {
319
+ i0.ɵɵelementStart(0, "pre", 119);
320
+ i0.ɵɵtext(1);
321
+ i0.ɵɵelementEnd();
322
+ } if (rf & 2) {
323
+ const diff_r15 = i0.ɵɵnextContext(2).$implicit;
324
+ i0.ɵɵadvance();
325
+ i0.ɵɵtextInterpolate(diff_r15.newValue);
326
+ } }
327
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_9_Conditional_12_Template(rf, ctx) { if (rf & 1) {
328
+ i0.ɵɵtext(0);
329
+ } if (rf & 2) {
330
+ const diff_r15 = i0.ɵɵnextContext(2).$implicit;
331
+ const ctx_r1 = i0.ɵɵnextContext(6);
332
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.formatChangeValue(diff_r15.newValue), " ");
333
+ } }
334
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_9_Template(rf, ctx) { if (rf & 1) {
335
+ i0.ɵɵelementStart(0, "div", 113)(1, "div", 116)(2, "h6", 117);
336
+ i0.ɵɵtext(3, "Before:");
337
+ i0.ɵɵelementEnd();
338
+ i0.ɵɵelementStart(4, "div", 118);
339
+ i0.ɵɵtemplate(5, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_9_Conditional_5_Template, 2, 1, "pre", 119)(6, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_9_Conditional_6_Template, 1, 1);
340
+ i0.ɵɵelementEnd()();
341
+ i0.ɵɵelementStart(7, "div", 120)(8, "h6", 117);
342
+ i0.ɵɵtext(9, "After:");
343
+ i0.ɵɵelementEnd();
344
+ i0.ɵɵelementStart(10, "div", 121);
345
+ i0.ɵɵtemplate(11, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_9_Conditional_11_Template, 2, 1, "pre", 119)(12, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_9_Conditional_12_Template, 1, 1);
346
+ i0.ɵɵelementEnd()()();
347
+ } if (rf & 2) {
348
+ const diff_r15 = i0.ɵɵnextContext().$implicit;
349
+ i0.ɵɵadvance(5);
350
+ i0.ɵɵconditional(diff_r15.isTemplate && diff_r15.fieldName === "TemplateText" ? 5 : 6);
351
+ i0.ɵɵadvance(6);
352
+ i0.ɵɵconditional(diff_r15.isTemplate && diff_r15.fieldName === "TemplateText" ? 11 : 12);
353
+ } }
354
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_10_Template(rf, ctx) { if (rf & 1) {
355
+ i0.ɵɵelementStart(0, "div", 114)(1, "h6", 117);
356
+ i0.ɵɵtext(2, "Added:");
357
+ i0.ɵɵelementEnd();
358
+ i0.ɵɵelementStart(3, "div", 121);
359
+ i0.ɵɵtext(4);
360
+ i0.ɵɵelementEnd()();
361
+ } if (rf & 2) {
362
+ const diff_r15 = i0.ɵɵnextContext().$implicit;
363
+ const ctx_r1 = i0.ɵɵnextContext(6);
364
+ i0.ɵɵadvance(4);
365
+ i0.ɵɵtextInterpolate(ctx_r1.formatChangeValue(diff_r15.newValue));
366
+ } }
367
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_11_Template(rf, ctx) { if (rf & 1) {
368
+ i0.ɵɵelementStart(0, "div", 115)(1, "h6", 117);
369
+ i0.ɵɵtext(2, "Removed:");
370
+ i0.ɵɵelementEnd();
371
+ i0.ɵɵelementStart(3, "div", 118);
372
+ i0.ɵɵtext(4);
373
+ i0.ɵɵelementEnd()();
374
+ } if (rf & 2) {
375
+ const diff_r15 = i0.ɵɵnextContext().$implicit;
376
+ const ctx_r1 = i0.ɵɵnextContext(6);
377
+ i0.ɵɵadvance(4);
378
+ i0.ɵɵtextInterpolate(ctx_r1.formatChangeValue(diff_r15.oldValue));
379
+ } }
380
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Template(rf, ctx) { if (rf & 1) {
381
+ i0.ɵɵelementStart(0, "div", 107)(1, "div", 108)(2, "div", 109)(3, "strong", 90);
382
+ i0.ɵɵtext(4);
383
+ i0.ɵɵelementEnd();
384
+ i0.ɵɵelementStart(5, "span", 110);
385
+ i0.ɵɵtext(6);
386
+ i0.ɵɵelementEnd();
387
+ i0.ɵɵtemplate(7, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_7_Template, 2, 0, "span", 111);
388
+ i0.ɵɵelementEnd()();
389
+ i0.ɵɵelementStart(8, "div", 112);
390
+ i0.ɵɵtemplate(9, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_9_Template, 13, 2, "div", 113)(10, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_10_Template, 5, 1, "div", 114)(11, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Conditional_11_Template, 5, 1, "div", 115);
391
+ i0.ɵɵelementEnd()();
392
+ } if (rf & 2) {
393
+ const diff_r15 = ctx.$implicit;
394
+ i0.ɵɵclassMap("diff-" + diff_r15.changeType);
395
+ i0.ɵɵadvance(4);
396
+ i0.ɵɵtextInterpolate(diff_r15.displayName);
397
+ i0.ɵɵadvance();
398
+ i0.ɵɵclassProp("badge-success", diff_r15.changeType === "added")("badge-warning", diff_r15.changeType === "modified")("badge-danger", diff_r15.changeType === "removed");
399
+ i0.ɵɵadvance();
400
+ i0.ɵɵtextInterpolate1(" ", diff_r15.changeType, " ");
401
+ i0.ɵɵadvance();
402
+ i0.ɵɵconditional(diff_r15.isTemplate ? 7 : -1);
403
+ i0.ɵɵadvance(2);
404
+ i0.ɵɵconditional(diff_r15.changeType === "modified" ? 9 : diff_r15.changeType === "added" ? 10 : diff_r15.changeType === "removed" ? 11 : -1);
405
+ } }
406
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_Template(rf, ctx) { if (rf & 1) {
407
+ i0.ɵɵelementStart(0, "div", 104);
408
+ i0.ɵɵrepeaterCreate(1, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_For_2_Template, 12, 12, "div", 106, _forTrack2);
409
+ i0.ɵɵelementEnd();
410
+ } if (rf & 2) {
411
+ const ctx_r1 = i0.ɵɵnextContext(5);
412
+ i0.ɵɵadvance();
413
+ i0.ɵɵrepeater(ctx_r1.comparisonResult.differences);
414
+ } }
415
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_8_Template(rf, ctx) { if (rf & 1) {
416
+ i0.ɵɵelementStart(0, "div", 105);
417
+ i0.ɵɵelement(1, "i", 122);
418
+ i0.ɵɵelementStart(2, "p", 14);
419
+ i0.ɵɵtext(3, "No differences found between the selected versions.");
420
+ i0.ɵɵelementEnd()();
421
+ } }
422
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Template(rf, ctx) { if (rf & 1) {
423
+ i0.ɵɵelementStart(0, "div", 100)(1, "div", 101)(2, "h6", 102);
424
+ i0.ɵɵelement(3, "i", 33);
425
+ i0.ɵɵtext(4);
426
+ i0.ɵɵelementEnd();
427
+ i0.ɵɵelementStart(5, "div", 103);
428
+ i0.ɵɵtext(6);
429
+ i0.ɵɵelementEnd()();
430
+ i0.ɵɵtemplate(7, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_7_Template, 3, 0, "div", 104)(8, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Conditional_8_Template, 4, 0, "div", 105);
431
+ i0.ɵɵelementEnd();
432
+ } if (rf & 2) {
433
+ const ctx_r1 = i0.ɵɵnextContext(4);
434
+ i0.ɵɵadvance(4);
435
+ i0.ɵɵtextInterpolate2(" Changes between ", ctx_r1.getVersionLabel(ctx_r1.comparisonResult.fromVersion), " and ", ctx_r1.getVersionLabel(ctx_r1.comparisonResult.toVersion), " ");
436
+ i0.ɵɵadvance(2);
437
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.comparisonResult.differences.length, " change(s) found ");
438
+ i0.ɵɵadvance();
439
+ i0.ɵɵconditional(ctx_r1.comparisonResult.differences.length > 0 ? 7 : 8);
440
+ } }
441
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Template(rf, ctx) { if (rf & 1) {
442
+ const _r12 = i0.ɵɵgetCurrentView();
443
+ i0.ɵɵelementStart(0, "div", 63)(1, "div", 95)(2, "div", 96)(3, "label", 38);
444
+ i0.ɵɵtext(4, "Compare from:");
445
+ i0.ɵɵelementEnd();
446
+ i0.ɵɵelementStart(5, "select", 97);
447
+ i0.ɵɵtwoWayListener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Template_select_ngModelChange_5_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r1.compareFromVersion, $event) || (ctx_r1.compareFromVersion = $event); return i0.ɵɵresetView($event); });
448
+ i0.ɵɵlistener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Template_select_ngModelChange_5_listener() { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.generateComparisonPublic()); });
449
+ i0.ɵɵrepeaterCreate(6, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_For_7_Template, 3, 6, "option", 98, _forTrack1);
450
+ i0.ɵɵelementEnd()();
451
+ i0.ɵɵelementStart(8, "div", 99);
452
+ i0.ɵɵelement(9, "i", 21);
453
+ i0.ɵɵelementEnd();
454
+ i0.ɵɵelementStart(10, "div", 96)(11, "label", 38);
455
+ i0.ɵɵtext(12, "Compare to:");
456
+ i0.ɵɵelementEnd();
457
+ i0.ɵɵelementStart(13, "select", 97);
458
+ i0.ɵɵtwoWayListener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Template_select_ngModelChange_13_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r1.compareToVersion, $event) || (ctx_r1.compareToVersion = $event); return i0.ɵɵresetView($event); });
459
+ i0.ɵɵlistener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Template_select_ngModelChange_13_listener() { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.generateComparisonPublic()); });
460
+ i0.ɵɵrepeaterCreate(14, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_For_15_Template, 3, 6, "option", 98, _forTrack1);
461
+ i0.ɵɵelementEnd()()();
462
+ i0.ɵɵtemplate(16, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Conditional_16_Template, 9, 4, "div", 100);
463
+ i0.ɵɵelementEnd();
464
+ } if (rf & 2) {
465
+ const ctx_r1 = i0.ɵɵnextContext(3);
466
+ i0.ɵɵadvance(5);
467
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r1.compareFromVersion);
468
+ i0.ɵɵadvance();
469
+ i0.ɵɵrepeater(ctx_r1.versions);
470
+ i0.ɵɵadvance(7);
471
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r1.compareToVersion);
472
+ i0.ɵɵadvance();
473
+ i0.ɵɵrepeater(ctx_r1.versions);
474
+ i0.ɵɵadvance(2);
475
+ i0.ɵɵconditional(ctx_r1.comparisonResult ? 16 : -1);
476
+ } }
477
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_2_Conditional_1_Conditional_31_Template(rf, ctx) { if (rf & 1) {
478
+ i0.ɵɵelementStart(0, "div", 129)(1, "h6", 2);
479
+ i0.ɵɵtext(2, "Record State");
480
+ i0.ɵɵelementEnd();
481
+ i0.ɵɵelementStart(3, "div", 134)(4, "pre", 135);
482
+ i0.ɵɵtext(5);
483
+ i0.ɵɵpipe(6, "json");
484
+ i0.ɵɵelementEnd()()();
485
+ } if (rf & 2) {
486
+ const ctx_r1 = i0.ɵɵnextContext(5);
487
+ i0.ɵɵadvance(5);
488
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 1, ctx_r1.selectedVersion.fullRecordJSON));
489
+ } }
490
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_2_Conditional_1_Conditional_32_Template(rf, ctx) { if (rf & 1) {
491
+ i0.ɵɵelementStart(0, "div", 129)(1, "h6", 2);
492
+ i0.ɵɵtext(2, "Template Content");
493
+ i0.ɵɵelementEnd();
494
+ i0.ɵɵelementStart(3, "div", 136)(4, "pre", 119);
495
+ i0.ɵɵtext(5);
496
+ i0.ɵɵelementEnd()()();
497
+ } if (rf & 2) {
498
+ const ctx_r1 = i0.ɵɵnextContext(5);
499
+ i0.ɵɵadvance(5);
500
+ i0.ɵɵtextInterpolate(ctx_r1.selectedVersion.templateContent.TemplateText);
501
+ } }
502
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_2_Conditional_1_Template(rf, ctx) { if (rf & 1) {
503
+ i0.ɵɵelementStart(0, "div", 123)(1, "div", 125)(2, "h6", 126);
504
+ i0.ɵɵtext(3);
505
+ i0.ɵɵelementEnd();
506
+ i0.ɵɵelementStart(4, "div", 127)(5, "span", 77);
507
+ i0.ɵɵtext(6);
508
+ i0.ɵɵpipe(7, "date");
509
+ i0.ɵɵelementEnd();
510
+ i0.ɵɵelementStart(8, "span", 78);
511
+ i0.ɵɵtext(9);
512
+ i0.ɵɵelementEnd()()();
513
+ i0.ɵɵelementStart(10, "div", 128)(11, "div", 129)(12, "h6", 2);
514
+ i0.ɵɵtext(13, "Change Information");
515
+ i0.ɵɵelementEnd();
516
+ i0.ɵɵelementStart(14, "div", 130)(15, "div", 131)(16, "span", 132);
517
+ i0.ɵɵtext(17, "Type:");
518
+ i0.ɵɵelementEnd();
519
+ i0.ɵɵelementStart(18, "span", 133);
520
+ i0.ɵɵelement(19, "i", 51);
521
+ i0.ɵɵtext(20);
522
+ i0.ɵɵelementEnd()();
523
+ i0.ɵɵelementStart(21, "div", 131)(22, "span", 132);
524
+ i0.ɵɵtext(23, "Source:");
525
+ i0.ɵɵelementEnd();
526
+ i0.ɵɵelementStart(24, "span", 133);
527
+ i0.ɵɵtext(25);
528
+ i0.ɵɵelementEnd()();
529
+ i0.ɵɵelementStart(26, "div", 131)(27, "span", 132);
530
+ i0.ɵɵtext(28, "Description:");
531
+ i0.ɵɵelementEnd();
532
+ i0.ɵɵelementStart(29, "span", 133);
533
+ i0.ɵɵtext(30);
534
+ i0.ɵɵelementEnd()()()();
535
+ i0.ɵɵtemplate(31, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_2_Conditional_1_Conditional_31_Template, 7, 3, "div", 129)(32, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_2_Conditional_1_Conditional_32_Template, 6, 1, "div", 129);
536
+ i0.ɵɵelementEnd()();
537
+ } if (rf & 2) {
538
+ const ctx_r1 = i0.ɵɵnextContext(4);
539
+ i0.ɵɵadvance(3);
540
+ i0.ɵɵtextInterpolate(ctx_r1.getVersionLabel(ctx_r1.selectedVersion));
541
+ i0.ɵɵadvance(3);
542
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(7, 10, ctx_r1.selectedVersion.changedAt, "full"));
543
+ i0.ɵɵadvance(3);
544
+ i0.ɵɵtextInterpolate1("Changed by ", ctx_r1.selectedVersion.changedBy, "");
545
+ i0.ɵɵadvance(10);
546
+ i0.ɵɵclassMap(ctx_r1.getChangeTypeIcon(ctx_r1.selectedVersion.changeType));
547
+ i0.ɵɵadvance();
548
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.selectedVersion.changeType, " ");
549
+ i0.ɵɵadvance(5);
550
+ i0.ɵɵtextInterpolate(ctx_r1.selectedVersion.changeSource);
551
+ i0.ɵɵadvance(5);
552
+ i0.ɵɵtextInterpolate(ctx_r1.selectedVersion.changesDescription);
553
+ i0.ɵɵadvance();
554
+ i0.ɵɵconditional(ctx_r1.selectedVersion.fullRecordJSON ? 31 : -1);
555
+ i0.ɵɵadvance();
556
+ i0.ɵɵconditional(ctx_r1.selectedVersion.templateContent ? 32 : -1);
557
+ } }
558
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_2_Conditional_2_Template(rf, ctx) { if (rf & 1) {
559
+ i0.ɵɵelementStart(0, "div", 124);
560
+ i0.ɵɵelement(1, "i", 137);
561
+ i0.ɵɵelementStart(2, "p", 14);
562
+ i0.ɵɵtext(3, "Select a version from the timeline to view details.");
563
+ i0.ɵɵelementEnd()();
564
+ } }
565
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_2_Template(rf, ctx) { if (rf & 1) {
566
+ i0.ɵɵelementStart(0, "div", 64);
567
+ i0.ɵɵtemplate(1, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_2_Conditional_1_Template, 33, 13, "div", 123)(2, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_2_Conditional_2_Template, 4, 0, "div", 124);
568
+ i0.ɵɵelementEnd();
569
+ } if (rf & 2) {
570
+ const ctx_r1 = i0.ɵɵnextContext(3);
571
+ i0.ɵɵadvance();
572
+ i0.ɵɵconditional(ctx_r1.selectedVersion ? 1 : 2);
573
+ } }
574
+ function PromptVersionControlComponent_Conditional_2_Conditional_51_Template(rf, ctx) { if (rf & 1) {
575
+ i0.ɵɵtemplate(0, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_0_Template, 3, 1, "div", 62)(1, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_1_Template, 17, 3, "div", 63)(2, PromptVersionControlComponent_Conditional_2_Conditional_51_Conditional_2_Template, 3, 1, "div", 64);
576
+ } if (rf & 2) {
577
+ const ctx_r1 = i0.ɵɵnextContext(2);
578
+ i0.ɵɵconditional(ctx_r1.currentView === "timeline" ? 0 : -1);
579
+ i0.ɵɵadvance();
580
+ i0.ɵɵconditional(ctx_r1.currentView === "comparison" ? 1 : -1);
581
+ i0.ɵɵadvance();
582
+ i0.ɵɵconditional(ctx_r1.currentView === "details" ? 2 : -1);
583
+ } }
584
+ function PromptVersionControlComponent_Conditional_2_Conditional_52_Template(rf, ctx) { if (rf & 1) {
585
+ const _r16 = i0.ɵɵgetCurrentView();
586
+ i0.ɵɵelementStart(0, "div", 57)(1, "div", 138);
587
+ i0.ɵɵelement(2, "i", 139);
588
+ i0.ɵɵtext(3);
589
+ i0.ɵɵelementStart(4, "button", 140);
590
+ i0.ɵɵlistener("click", function PromptVersionControlComponent_Conditional_2_Conditional_52_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r16); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.refreshHistory()); });
591
+ i0.ɵɵelement(5, "i", 53);
592
+ i0.ɵɵtext(6, " Retry ");
593
+ i0.ɵɵelementEnd()()();
594
+ } if (rf & 2) {
595
+ const ctx_r1 = i0.ɵɵnextContext(2);
596
+ i0.ɵɵadvance(3);
597
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.error, " ");
598
+ } }
599
+ function PromptVersionControlComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
600
+ const _r5 = i0.ɵɵgetCurrentView();
601
+ i0.ɵɵelementStart(0, "div", 22)(1, "div", 23)(2, "h5", 24);
602
+ i0.ɵɵelement(3, "i", 3);
603
+ i0.ɵɵtext(4, " Version History ");
604
+ i0.ɵɵtemplate(5, PromptVersionControlComponent_Conditional_2_Conditional_5_Template, 2, 1, "span", 25);
605
+ i0.ɵɵelementEnd();
606
+ i0.ɵɵelementStart(6, "div", 26)(7, "div", 27)(8, "input", 28);
607
+ i0.ɵɵtwoWayListener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Template_input_ngModelChange_8_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.currentView, $event) || (ctx_r1.currentView = $event); return i0.ɵɵresetView($event); });
608
+ i0.ɵɵlistener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Template_input_ngModelChange_8_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onViewChange($event)); });
609
+ i0.ɵɵelementEnd();
610
+ i0.ɵɵelementStart(9, "label", 29);
611
+ i0.ɵɵelement(10, "i", 30);
612
+ i0.ɵɵtext(11, " Timeline ");
613
+ i0.ɵɵelementEnd();
614
+ i0.ɵɵelementStart(12, "input", 31);
615
+ i0.ɵɵtwoWayListener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Template_input_ngModelChange_12_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.currentView, $event) || (ctx_r1.currentView = $event); return i0.ɵɵresetView($event); });
616
+ i0.ɵɵlistener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Template_input_ngModelChange_12_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onViewChange($event)); });
617
+ i0.ɵɵelementEnd();
618
+ i0.ɵɵelementStart(13, "label", 32);
619
+ i0.ɵɵelement(14, "i", 33);
620
+ i0.ɵɵtext(15, " Compare ");
621
+ i0.ɵɵelementEnd();
622
+ i0.ɵɵelementStart(16, "input", 34);
623
+ i0.ɵɵtwoWayListener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Template_input_ngModelChange_16_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.currentView, $event) || (ctx_r1.currentView = $event); return i0.ɵɵresetView($event); });
624
+ i0.ɵɵlistener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Template_input_ngModelChange_16_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onViewChange($event)); });
625
+ i0.ɵɵelementEnd();
626
+ i0.ɵɵelementStart(17, "label", 35);
627
+ i0.ɵɵelement(18, "i", 36);
628
+ i0.ɵɵtext(19, " Details ");
629
+ i0.ɵɵelementEnd()()()();
630
+ i0.ɵɵelementStart(20, "div", 23)(21, "div", 37)(22, "label", 38);
631
+ i0.ɵɵtext(23, "Filter:");
632
+ i0.ɵɵelementEnd();
633
+ i0.ɵɵelementStart(24, "select", 39);
634
+ i0.ɵɵtwoWayListener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Template_select_ngModelChange_24_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.filterBy, $event) || (ctx_r1.filterBy = $event); return i0.ɵɵresetView($event); });
635
+ i0.ɵɵlistener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Template_select_ngModelChange_24_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onFilterChange($event)); });
636
+ i0.ɵɵelementStart(25, "option", 40);
637
+ i0.ɵɵtext(26, "All Changes");
638
+ i0.ɵɵelementEnd();
639
+ i0.ɵɵelementStart(27, "option", 41);
640
+ i0.ɵɵtext(28, "Updates Only");
641
+ i0.ɵɵelementEnd();
642
+ i0.ɵɵelementStart(29, "option", 42);
643
+ i0.ɵɵtext(30, "Major Changes");
644
+ i0.ɵɵelementEnd();
645
+ i0.ɵɵelementStart(31, "option", 43);
646
+ i0.ɵɵtext(32, "Template Changes");
647
+ i0.ɵɵelementEnd()();
648
+ i0.ɵɵelementStart(33, "div", 44)(34, "input", 45);
649
+ i0.ɵɵtwoWayListener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Template_input_ngModelChange_34_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.showSystemChanges, $event) || (ctx_r1.showSystemChanges = $event); return i0.ɵɵresetView($event); });
650
+ i0.ɵɵlistener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Template_input_ngModelChange_34_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.applyFiltersPublic()); });
651
+ i0.ɵɵelementEnd();
652
+ i0.ɵɵelementStart(35, "label", 46);
653
+ i0.ɵɵtext(36, "System");
654
+ i0.ɵɵelementEnd()()();
655
+ i0.ɵɵelementStart(37, "div", 47)(38, "input", 48);
656
+ i0.ɵɵlistener("ngModelChange", function PromptVersionControlComponent_Conditional_2_Template_input_ngModelChange_38_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onSearchChange($event)); });
657
+ i0.ɵɵelementEnd()()();
658
+ i0.ɵɵelementStart(39, "div", 23)(40, "div", 49)(41, "button", 50);
659
+ i0.ɵɵlistener("click", function PromptVersionControlComponent_Conditional_2_Template_button_click_41_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onSortDirectionChange()); });
660
+ i0.ɵɵelement(42, "i", 51);
661
+ i0.ɵɵtext(43, " Sort ");
662
+ i0.ɵɵelementEnd();
663
+ i0.ɵɵelementStart(44, "button", 52);
664
+ i0.ɵɵlistener("click", function PromptVersionControlComponent_Conditional_2_Template_button_click_44_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.refreshHistory()); });
665
+ i0.ɵɵelement(45, "i", 53);
666
+ i0.ɵɵtext(46, " Refresh ");
667
+ i0.ɵɵelementEnd();
668
+ i0.ɵɵelementStart(47, "button", 54);
669
+ i0.ɵɵlistener("click", function PromptVersionControlComponent_Conditional_2_Template_button_click_47_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.exportVersionHistory()); });
670
+ i0.ɵɵelement(48, "i", 55);
671
+ i0.ɵɵtext(49, " Export ");
672
+ i0.ɵɵelementEnd()()()();
673
+ i0.ɵɵtemplate(50, PromptVersionControlComponent_Conditional_2_Conditional_50_Template, 7, 1, "div", 56)(51, PromptVersionControlComponent_Conditional_2_Conditional_51_Template, 3, 3)(52, PromptVersionControlComponent_Conditional_2_Conditional_52_Template, 7, 1, "div", 57);
674
+ } if (rf & 2) {
675
+ const ctx_r1 = i0.ɵɵnextContext();
676
+ i0.ɵɵadvance(5);
677
+ i0.ɵɵconditional(ctx_r1.prompt ? 5 : -1);
678
+ i0.ɵɵadvance(3);
679
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r1.currentView);
680
+ i0.ɵɵadvance(4);
681
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r1.currentView);
682
+ i0.ɵɵadvance(4);
683
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r1.currentView);
684
+ i0.ɵɵadvance(8);
685
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r1.filterBy);
686
+ i0.ɵɵadvance(10);
687
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r1.showSystemChanges);
688
+ i0.ɵɵadvance(4);
689
+ i0.ɵɵproperty("ngModel", ctx_r1.searchTerm$.value);
690
+ i0.ɵɵadvance(3);
691
+ i0.ɵɵproperty("title", "Sort " + (ctx_r1.sortDirection === "asc" ? "descending" : "ascending"));
692
+ i0.ɵɵadvance();
693
+ i0.ɵɵclassProp("fa-sort-up", ctx_r1.sortDirection === "asc")("fa-sort-down", ctx_r1.sortDirection === "desc");
694
+ i0.ɵɵadvance(2);
695
+ i0.ɵɵproperty("disabled", ctx_r1.isLoading);
696
+ i0.ɵɵadvance();
697
+ i0.ɵɵclassProp("fa-spin", ctx_r1.isLoading);
698
+ i0.ɵɵadvance(5);
699
+ i0.ɵɵconditional(ctx_r1.isLoading ? 50 : 51);
700
+ i0.ɵɵadvance(2);
701
+ i0.ɵɵconditional(ctx_r1.error ? 52 : -1);
702
+ } }
703
+ export class PromptVersionControlComponent {
704
+ constructor(notificationService) {
705
+ this.notificationService = notificationService;
706
+ this.prompt = null;
707
+ this.autoLoad = true;
708
+ this.showRestoreActions = true;
709
+ this.showComparison = true;
710
+ this.maxVersions = 50;
711
+ this.versionSelected = new EventEmitter();
712
+ this.versionRestored = new EventEmitter();
713
+ this.versionCompared = new EventEmitter();
714
+ // Data
715
+ this.versions = [];
716
+ this.recordChanges = [];
717
+ this.templateContents = new Map();
718
+ this.availablePrompts = [];
719
+ this.filteredAvailablePrompts = [];
720
+ // UI State
721
+ this.isLoading = false;
722
+ this.loadingMessage = '';
723
+ this.error = null;
724
+ this.currentView = 'timeline';
725
+ this.selectedVersion = null;
726
+ this.compareFromVersion = null;
727
+ this.compareToVersion = null;
728
+ this.comparisonResult = null;
729
+ // Filtering and sorting
730
+ this.filterBy = 'all';
731
+ this.sortDirection = 'desc';
732
+ this.searchTerm$ = new BehaviorSubject('');
733
+ this.promptSearchTerm$ = new BehaviorSubject('');
734
+ this.showSystemChanges = false;
735
+ // Timeline configuration
736
+ this.timelineConfig = {
737
+ showThumbnails: true,
738
+ showDiffs: true,
739
+ compactMode: false,
740
+ groupByDate: true
741
+ };
742
+ this.destroy$ = new Subject();
743
+ }
744
+ ngOnInit() {
745
+ this.loadAvailablePrompts();
746
+ this.setupPromptFiltering();
747
+ if (this.autoLoad && this.prompt) {
748
+ this.loadVersionHistory();
749
+ }
750
+ }
751
+ ngOnDestroy() {
752
+ this.destroy$.next();
753
+ this.destroy$.complete();
754
+ }
755
+ loadVersionHistory() {
756
+ return __awaiter(this, void 0, void 0, function* () {
757
+ if (!this.prompt) {
758
+ this.error = 'No prompt specified for version history';
759
+ return;
760
+ }
761
+ try {
762
+ this.isLoading = true;
763
+ this.error = null;
764
+ this.loadingMessage = 'Loading version history...';
765
+ const md = new Metadata();
766
+ const primaryKey = new CompositeKey();
767
+ primaryKey.KeyValuePairs.push({ FieldName: 'ID', Value: this.prompt.ID });
768
+ // Get record changes using the new method
769
+ this.recordChanges = yield md.GetRecordChanges('AI Prompts', primaryKey);
770
+ if (this.recordChanges.length === 0) {
771
+ this.versions = [];
772
+ LogStatus(`No version history found for prompt: ${this.prompt.Name}`);
773
+ return;
774
+ }
775
+ // Load template contents for versions that have template changes
776
+ yield this.loadTemplateContents();
777
+ // Process record changes into version objects
778
+ this.processRecordChanges();
779
+ // Apply current filters
780
+ this.applyFilters();
781
+ LogStatus(`Loaded ${this.versions.length} versions for prompt: ${this.prompt.Name}`);
782
+ }
783
+ catch (error) {
784
+ this.error = 'Failed to load version history. Please try again.';
785
+ LogError('Error loading prompt version history', undefined, error);
786
+ }
787
+ finally {
788
+ this.isLoading = false;
789
+ }
790
+ });
791
+ }
792
+ loadTemplateContents() {
793
+ return __awaiter(this, void 0, void 0, function* () {
794
+ const templateIds = new Set();
795
+ // Extract template IDs from record changes
796
+ this.recordChanges.forEach(change => {
797
+ try {
798
+ const fullRecord = JSON.parse(change.FullRecordJSON);
799
+ if (fullRecord.TemplateID) {
800
+ templateIds.add(fullRecord.TemplateID);
801
+ }
802
+ // Also check changes JSON for template changes
803
+ if (change.ChangesJSON) {
804
+ const changes = JSON.parse(change.ChangesJSON);
805
+ if (changes.TemplateID && changes.TemplateID.newValue) {
806
+ templateIds.add(changes.TemplateID.newValue);
807
+ }
808
+ if (changes.TemplateID && changes.TemplateID.oldValue) {
809
+ templateIds.add(changes.TemplateID.oldValue);
810
+ }
811
+ }
812
+ }
813
+ catch (e) {
814
+ // Ignore parsing errors
815
+ }
816
+ });
817
+ // Load template content entities
818
+ if (templateIds.size > 0) {
819
+ this.loadingMessage = 'Loading template content history...';
820
+ // Note: We would need a way to get historical template content
821
+ // For now, we'll get current template content and note this limitation
822
+ const md = new Metadata();
823
+ for (const templateId of templateIds) {
824
+ try {
825
+ const templateContent = yield md.GetEntityObject('Template Contents', md.CurrentUser);
826
+ const loaded = yield templateContent.Load(templateId);
827
+ if (loaded) {
828
+ this.templateContents.set(templateId, templateContent);
829
+ }
830
+ }
831
+ catch (e) {
832
+ // Template content might not exist anymore
833
+ LogError(`Failed to load template content for ID: ${templateId}`, undefined, e);
834
+ }
835
+ }
836
+ }
837
+ });
838
+ }
839
+ processRecordChanges() {
840
+ this.versions = this.recordChanges.map((change, index) => {
841
+ let templateContent;
842
+ try {
843
+ const fullRecord = JSON.parse(change.FullRecordJSON);
844
+ if (fullRecord.TemplateID) {
845
+ templateContent = this.templateContents.get(fullRecord.TemplateID);
846
+ }
847
+ }
848
+ catch (e) {
849
+ // Ignore parsing errors
850
+ }
851
+ const version = {
852
+ id: change.ID,
853
+ version: this.recordChanges.length - index, // Version number (newest = highest)
854
+ changedAt: new Date(change.ChangedAt),
855
+ changedBy: change.User || 'Unknown',
856
+ changeType: change.Type,
857
+ changeSource: change.Source,
858
+ changesDescription: change.ChangesDescription,
859
+ changesJSON: this.safeParseJSON(change.ChangesJSON),
860
+ fullRecordJSON: this.safeParseJSON(change.FullRecordJSON),
861
+ templateContent,
862
+ isActive: index === 0, // Most recent version is active
863
+ canRestore: index > 0 && change.Type !== 'Delete' // Can restore if not current and not deleted
864
+ };
865
+ return version;
866
+ });
867
+ }
868
+ safeParseJSON(jsonString) {
869
+ try {
870
+ return JSON.parse(jsonString);
871
+ }
872
+ catch (e) {
873
+ return null;
874
+ }
875
+ }
876
+ applyFilters() {
877
+ let filtered = [...this.versions];
878
+ // Apply filter by type
879
+ switch (this.filterBy) {
880
+ case 'updates':
881
+ filtered = filtered.filter(v => v.changeType === 'Update');
882
+ break;
883
+ case 'major':
884
+ filtered = filtered.filter(v => this.isMajorChange(v));
885
+ break;
886
+ case 'template':
887
+ filtered = filtered.filter(v => this.hasTemplateChanges(v));
888
+ break;
889
+ }
890
+ // Apply system changes filter
891
+ if (!this.showSystemChanges) {
892
+ filtered = filtered.filter(v => v.changeSource !== 'External');
893
+ }
894
+ // Apply search term
895
+ const searchTerm = this.searchTerm$.value.toLowerCase();
896
+ if (searchTerm) {
897
+ filtered = filtered.filter(v => v.changesDescription.toLowerCase().includes(searchTerm) ||
898
+ v.changedBy.toLowerCase().includes(searchTerm));
899
+ }
900
+ // Apply sorting
901
+ filtered.sort((a, b) => {
902
+ const comparison = a.changedAt.getTime() - b.changedAt.getTime();
903
+ return this.sortDirection === 'desc' ? -comparison : comparison;
904
+ });
905
+ this.versions = filtered;
906
+ }
907
+ isMajorChange(version) {
908
+ if (!version.changesJSON)
909
+ return false;
910
+ const majorFields = ['Name', 'Status', 'TemplateID', 'CategoryID', 'TypeID'];
911
+ return majorFields.some(field => version.changesJSON[field]);
912
+ }
913
+ hasTemplateChanges(version) {
914
+ if (!version.changesJSON)
915
+ return false;
916
+ return !!version.changesJSON.TemplateID;
917
+ }
918
+ onVersionSelect(version) {
919
+ this.selectedVersion = version;
920
+ this.versionSelected.emit(version);
921
+ }
922
+ onVersionRestore(version) {
923
+ return this.restoreVersion(version);
924
+ }
925
+ getObjectKeys(obj) {
926
+ return Object.keys(obj || {});
927
+ }
928
+ getFieldDisplayNamePublic(fieldName) {
929
+ return this.getFieldDisplayName(fieldName);
930
+ }
931
+ generateComparisonPublic() {
932
+ this.generateComparison();
933
+ }
934
+ applyFiltersPublic() {
935
+ this.applyFilters();
936
+ }
937
+ restoreVersion(version) {
938
+ return __awaiter(this, void 0, void 0, function* () {
939
+ if (!version.canRestore || !this.prompt) {
940
+ this.notificationService.CreateSimpleNotification('Cannot restore this version', 'warning', 3000);
941
+ return;
942
+ }
943
+ const confirm = window.confirm(`Are you sure you want to restore to version ${version.version} from ${version.changedAt.toLocaleString()}? This will overwrite the current prompt.`);
944
+ if (!confirm)
945
+ return;
946
+ try {
947
+ this.isLoading = true;
948
+ this.loadingMessage = 'Restoring version...';
949
+ const md = new Metadata();
950
+ const promptToRestore = yield md.GetEntityObject('AI Prompts', md.CurrentUser);
951
+ yield promptToRestore.Load(this.prompt.ID);
952
+ // Apply the historical data
953
+ if (version.fullRecordJSON) {
954
+ const historicalData = version.fullRecordJSON;
955
+ // Update prompt fields (excluding system fields)
956
+ const fieldsToRestore = ['Name', 'Description', 'CategoryID', 'TypeID', 'Status', 'TemplateID'];
957
+ fieldsToRestore.forEach(field => {
958
+ if (historicalData[field] !== undefined) {
959
+ promptToRestore[field] = historicalData[field];
960
+ }
961
+ });
962
+ const saved = yield promptToRestore.Save();
963
+ if (saved) {
964
+ this.notificationService.CreateSimpleNotification(`Version ${version.version} restored successfully`, 'success', 3000);
965
+ this.versionRestored.emit(promptToRestore);
966
+ // Reload version history to reflect the new change
967
+ yield this.loadVersionHistory();
968
+ }
969
+ else {
970
+ throw new Error('Failed to save restored version');
971
+ }
972
+ }
973
+ }
974
+ catch (error) {
975
+ this.error = 'Failed to restore version. Please try again.';
976
+ LogError('Error restoring prompt version', undefined, error);
977
+ this.notificationService.CreateSimpleNotification('Failed to restore version', 'error', 4000);
978
+ }
979
+ finally {
980
+ this.isLoading = false;
981
+ }
982
+ });
983
+ }
984
+ startComparison(fromVersion, toVersion) {
985
+ this.compareFromVersion = fromVersion;
986
+ this.compareToVersion = toVersion || (this.versions.find(v => v.version === fromVersion.version + 1) || this.versions[0]);
987
+ this.currentView = 'comparison';
988
+ this.generateComparison();
989
+ }
990
+ generateComparison() {
991
+ if (!this.compareFromVersion || !this.compareToVersion)
992
+ return;
993
+ const differences = [];
994
+ // Compare prompt fields
995
+ const fromData = this.compareFromVersion.fullRecordJSON || {};
996
+ const toData = this.compareToVersion.fullRecordJSON || {};
997
+ const allFields = new Set([...Object.keys(fromData), ...Object.keys(toData)]);
998
+ allFields.forEach(fieldName => {
999
+ if (fieldName.startsWith('__mj_') || fieldName === 'ID')
1000
+ return; // Skip system fields
1001
+ const oldValue = fromData[fieldName];
1002
+ const newValue = toData[fieldName];
1003
+ if (oldValue !== newValue) {
1004
+ let changeType = 'modified';
1005
+ if (oldValue === undefined)
1006
+ changeType = 'added';
1007
+ if (newValue === undefined)
1008
+ changeType = 'removed';
1009
+ differences.push({
1010
+ fieldName,
1011
+ displayName: this.getFieldDisplayName(fieldName),
1012
+ oldValue,
1013
+ newValue,
1014
+ changeType,
1015
+ isTemplate: fieldName === 'TemplateID'
1016
+ });
1017
+ }
1018
+ });
1019
+ // Compare template content if available
1020
+ this.compareTemplateContent(differences);
1021
+ this.comparisonResult = {
1022
+ fromVersion: this.compareFromVersion,
1023
+ toVersion: this.compareToVersion,
1024
+ differences
1025
+ };
1026
+ this.versionCompared.emit(this.comparisonResult);
1027
+ }
1028
+ compareTemplateContent(differences) {
1029
+ var _a, _b;
1030
+ const fromTemplate = (_a = this.compareFromVersion) === null || _a === void 0 ? void 0 : _a.templateContent;
1031
+ const toTemplate = (_b = this.compareToVersion) === null || _b === void 0 ? void 0 : _b.templateContent;
1032
+ if (fromTemplate || toTemplate) {
1033
+ const fromContent = (fromTemplate === null || fromTemplate === void 0 ? void 0 : fromTemplate.TemplateText) || '';
1034
+ const toContent = (toTemplate === null || toTemplate === void 0 ? void 0 : toTemplate.TemplateText) || '';
1035
+ if (fromContent !== toContent) {
1036
+ differences.push({
1037
+ fieldName: 'TemplateText',
1038
+ displayName: 'Template Content',
1039
+ oldValue: fromContent,
1040
+ newValue: toContent,
1041
+ changeType: fromContent === '' ? 'added' : (toContent === '' ? 'removed' : 'modified'),
1042
+ isTemplate: true
1043
+ });
1044
+ }
1045
+ }
1046
+ }
1047
+ getFieldDisplayName(fieldName) {
1048
+ const displayNames = {
1049
+ 'Name': 'Name',
1050
+ 'Description': 'Description',
1051
+ 'CategoryID': 'Category',
1052
+ 'TypeID': 'Type',
1053
+ 'Status': 'Status',
1054
+ 'TemplateID': 'Template',
1055
+ 'TemplateText': 'Template Content'
1056
+ };
1057
+ return displayNames[fieldName] || fieldName;
1058
+ }
1059
+ onFilterChange(filter) {
1060
+ this.filterBy = filter;
1061
+ this.applyFilters();
1062
+ }
1063
+ onSortDirectionChange() {
1064
+ this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
1065
+ this.applyFilters();
1066
+ }
1067
+ onSearchChange(term) {
1068
+ this.searchTerm$.next(term);
1069
+ this.applyFilters();
1070
+ }
1071
+ onViewChange(view) {
1072
+ this.currentView = view;
1073
+ if (view === 'comparison' && !this.comparisonResult && this.versions.length >= 2) {
1074
+ this.startComparison(this.versions[1], this.versions[0]);
1075
+ }
1076
+ }
1077
+ getChangeTypeIcon(changeType) {
1078
+ switch (changeType) {
1079
+ case 'Create': return 'fa-plus-circle';
1080
+ case 'Update': return 'fa-edit';
1081
+ case 'Delete': return 'fa-trash';
1082
+ default: return 'fa-question-circle';
1083
+ }
1084
+ }
1085
+ getChangeTypeClass(changeType) {
1086
+ switch (changeType) {
1087
+ case 'Create': return 'change-create';
1088
+ case 'Update': return 'change-update';
1089
+ case 'Delete': return 'change-delete';
1090
+ default: return 'change-unknown';
1091
+ }
1092
+ }
1093
+ formatChangeValue(value) {
1094
+ if (value === null || value === undefined)
1095
+ return 'null';
1096
+ if (typeof value === 'object')
1097
+ return JSON.stringify(value, null, 2);
1098
+ if (typeof value === 'string' && value.length > 100) {
1099
+ return value.substring(0, 100) + '...';
1100
+ }
1101
+ return String(value);
1102
+ }
1103
+ getVersionLabel(version) {
1104
+ let label = `v${version.version}`;
1105
+ if (version.isActive)
1106
+ label += ' (Current)';
1107
+ if (version.changeType === 'Create')
1108
+ label += ' (Initial)';
1109
+ return label;
1110
+ }
1111
+ exportVersionHistory() {
1112
+ var _a, _b, _c;
1113
+ const exportData = {
1114
+ promptId: (_a = this.prompt) === null || _a === void 0 ? void 0 : _a.ID,
1115
+ promptName: (_b = this.prompt) === null || _b === void 0 ? void 0 : _b.Name,
1116
+ exportedAt: new Date().toISOString(),
1117
+ versions: this.versions.map(v => ({
1118
+ version: v.version,
1119
+ changedAt: v.changedAt.toISOString(),
1120
+ changedBy: v.changedBy,
1121
+ changeType: v.changeType,
1122
+ changesDescription: v.changesDescription,
1123
+ fullRecord: v.fullRecordJSON
1124
+ }))
1125
+ };
1126
+ const blob = new Blob([JSON.stringify(exportData, null, 2)], { type: 'application/json' });
1127
+ const url = URL.createObjectURL(blob);
1128
+ const a = document.createElement('a');
1129
+ a.href = url;
1130
+ a.download = `prompt-version-history-${((_c = this.prompt) === null || _c === void 0 ? void 0 : _c.Name) || 'unknown'}-${new Date().toISOString().split('T')[0]}.json`;
1131
+ a.click();
1132
+ URL.revokeObjectURL(url);
1133
+ }
1134
+ refreshHistory() {
1135
+ this.loadVersionHistory();
1136
+ }
1137
+ loadAvailablePrompts() {
1138
+ return __awaiter(this, void 0, void 0, function* () {
1139
+ try {
1140
+ const metadata = new Metadata();
1141
+ const promptEntity = yield metadata.GetEntityObject('AI Prompts');
1142
+ const prompts = yield promptEntity.GetAll();
1143
+ this.availablePrompts = prompts.sort((a, b) => a.Name.localeCompare(b.Name));
1144
+ this.filteredAvailablePrompts = [...this.availablePrompts];
1145
+ }
1146
+ catch (error) {
1147
+ console.error('Failed to load available prompts:', error);
1148
+ LogError('Failed to load available prompts', undefined, error);
1149
+ }
1150
+ });
1151
+ }
1152
+ setupPromptFiltering() {
1153
+ this.promptSearchTerm$.subscribe(searchTerm => {
1154
+ this.filterAvailablePrompts(searchTerm);
1155
+ });
1156
+ }
1157
+ filterAvailablePrompts(searchTerm) {
1158
+ if (!searchTerm || searchTerm.trim() === '') {
1159
+ this.filteredAvailablePrompts = [...this.availablePrompts];
1160
+ }
1161
+ else {
1162
+ const term = searchTerm.toLowerCase().trim();
1163
+ this.filteredAvailablePrompts = this.availablePrompts.filter(prompt => prompt.Name.toLowerCase().includes(term) ||
1164
+ (prompt.Description && prompt.Description.toLowerCase().includes(term)));
1165
+ }
1166
+ }
1167
+ onPromptSearchChange(searchTerm) {
1168
+ this.promptSearchTerm$.next(searchTerm);
1169
+ }
1170
+ selectPromptForHistory(prompt) {
1171
+ this.prompt = prompt;
1172
+ this.loadVersionHistory();
1173
+ }
1174
+ }
1175
+ PromptVersionControlComponent.ɵfac = function PromptVersionControlComponent_Factory(t) { return new (t || PromptVersionControlComponent)(i0.ɵɵdirectiveInject(i1.MJNotificationService)); };
1176
+ PromptVersionControlComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PromptVersionControlComponent, selectors: [["app-prompt-version-control"]], inputs: { prompt: "prompt", autoLoad: "autoLoad", showRestoreActions: "showRestoreActions", showComparison: "showComparison", maxVersions: "maxVersions" }, outputs: { versionSelected: "versionSelected", versionRestored: "versionRestored", versionCompared: "versionCompared" }, decls: 3, vars: 1, consts: [[1, "prompt-version-control"], [1, "prompt-selector-section"], [1, "section-title"], [1, "fa-solid", "fa-history"], [1, "text-muted", "mb-3"], [1, "prompt-selector"], [1, "search-box", "mb-3"], [1, "input-group"], [1, "input-group-text"], [1, "fa-solid", "fa-search"], ["type", "text", "placeholder", "Search prompts...", 1, "form-control", 3, "ngModelChange", "ngModel"], [1, "prompts-list"], [1, "empty-state"], [1, "fa-solid", "fa-comment-dots", "text-muted"], [1, "text-muted"], [1, "prompt-item"], [1, "prompt-item", 3, "click"], [1, "prompt-info"], [1, "prompt-title"], [1, "prompt-description"], [1, "prompt-actions"], [1, "fa-solid", "fa-arrow-right"], [1, "version-toolbar"], [1, "toolbar-section"], [1, "toolbar-title"], [1, "prompt-name"], [1, "view-mode-toggle"], ["role", "group", 1, "btn-group", "btn-group-sm"], ["type", "radio", "name", "view", "id", "timelineView", "value", "timeline", 1, "btn-check", 3, "ngModelChange", "ngModel"], ["for", "timelineView", 1, "btn", "btn-outline-primary"], [1, "fa-solid", "fa-timeline"], ["type", "radio", "name", "view", "id", "comparisonView", "value", "comparison", 1, "btn-check", 3, "ngModelChange", "ngModel"], ["for", "comparisonView", 1, "btn", "btn-outline-primary"], [1, "fa-solid", "fa-code-compare"], ["type", "radio", "name", "view", "id", "detailsView", "value", "details", 1, "btn-check", 3, "ngModelChange", "ngModel"], ["for", "detailsView", 1, "btn", "btn-outline-primary"], [1, "fa-solid", "fa-list"], [1, "filter-controls"], [1, "form-label"], [1, "form-select", "form-select-sm", 3, "ngModelChange", "ngModel"], ["value", "all"], ["value", "updates"], ["value", "major"], ["value", "template"], [1, "form-check", "form-switch"], ["type", "checkbox", "id", "showSystem", 1, "form-check-input", 3, "ngModelChange", "ngModel"], ["for", "showSystem", 1, "form-check-label"], [1, "search-controls"], ["type", "text", "placeholder", "Search changes...", 1, "form-control", "form-control-sm", 3, "ngModelChange", "ngModel"], [1, "action-buttons"], ["type", "button", 1, "btn", "btn-sm", "btn-outline-secondary", 3, "click", "title"], [1, "fa-solid"], ["type", "button", "title", "Refresh history", 1, "btn", "btn-sm", "btn-outline-secondary", 3, "click", "disabled"], [1, "fa-solid", "fa-refresh"], ["type", "button", "title", "Export history", 1, "btn", "btn-sm", "btn-outline-info", 3, "click"], [1, "fa-solid", "fa-download"], [1, "loading-container"], [1, "error-container"], [1, "loading-content"], ["role", "status", 1, "spinner-border", "text-primary"], [1, "visually-hidden"], [1, "loading-message"], [1, "timeline-container"], [1, "comparison-container"], [1, "details-container"], [1, "version-timeline"], [1, "no-versions-message"], [1, "timeline-item", 3, "selected", "active"], [1, "timeline-item", 3, "click"], [1, "timeline-marker"], [1, "marker-icon"], [1, "timeline-line"], [1, "timeline-content"], [1, "version-header"], [1, "version-info"], [1, "version-label"], [1, "version-meta"], [1, "change-date"], [1, "changed-by"], [1, "change-source", "badge"], [1, "version-actions"], ["type", "button", "title", "Compare with next version", 1, "btn", "btn-sm", "btn-outline-primary"], ["type", "button", "title", "Restore this version", 1, "btn", "btn-sm", "btn-outline-success"], [1, "version-description"], [1, "changes-summary"], ["type", "button", "title", "Compare with next version", 1, "btn", "btn-sm", "btn-outline-primary", 3, "click"], ["type", "button", "title", "Restore this version", 1, "btn", "btn-sm", "btn-outline-success", 3, "click"], [1, "fa-solid", "fa-undo"], [1, "changes-list"], [1, "change-item"], [1, "field-name"], [1, "change-arrow"], [1, "new-value"], [1, "old-value"], [1, "fa-solid", "fa-info-circle", "text-muted"], [1, "comparison-selectors"], [1, "selector-group"], [1, "form-select", 3, "ngModelChange", "ngModel"], [3, "ngValue"], [1, "comparison-arrow"], [1, "comparison-results"], [1, "comparison-header"], [1, "comparison-title"], [1, "changes-count"], [1, "differences-list"], [1, "no-differences"], [1, "difference-item", 3, "class"], [1, "difference-item"], [1, "diff-header"], [1, "field-info"], [1, "change-type", "badge"], [1, "template-badge", "badge", "badge-info"], [1, "diff-content"], [1, "side-by-side-diff"], [1, "diff-added"], [1, "diff-removed"], [1, "diff-old"], [1, "diff-label"], [1, "diff-value", "old-value"], [1, "template-content"], [1, "diff-new"], [1, "diff-value", "new-value"], [1, "fa-solid", "fa-check-circle", "text-success"], [1, "version-details"], [1, "no-selection-message"], [1, "details-header"], [1, "details-title"], [1, "details-meta"], [1, "details-content"], [1, "detail-section"], [1, "detail-grid"], [1, "detail-item"], [1, "detail-label"], [1, "detail-value"], [1, "json-viewer"], [1, "json-content"], [1, "template-viewer"], [1, "fa-solid", "fa-hand-pointer", "text-muted"], ["role", "alert", 1, "alert", "alert-danger"], [1, "fa-solid", "fa-exclamation-triangle"], ["type", "button", 1, "btn", "btn-sm", "btn-outline-danger", "ms-2", 3, "click"]], template: function PromptVersionControlComponent_Template(rf, ctx) { if (rf & 1) {
1177
+ i0.ɵɵelementStart(0, "div", 0);
1178
+ i0.ɵɵtemplate(1, PromptVersionControlComponent_Conditional_1_Template, 15, 2, "div", 1)(2, PromptVersionControlComponent_Conditional_2_Template, 53, 17);
1179
+ i0.ɵɵelementEnd();
1180
+ } if (rf & 2) {
1181
+ i0.ɵɵadvance();
1182
+ i0.ɵɵconditional(!ctx.prompt ? 1 : 2);
1183
+ } }, dependencies: [i2.NgSelectOption, i2.ɵNgSelectMultipleOption, i2.DefaultValueAccessor, i2.CheckboxControlValueAccessor, i2.SelectControlValueAccessor, i2.RadioControlValueAccessor, i2.NgControlStatus, i2.NgModel, i3.JsonPipe, i3.DatePipe], styles: [".prompt-version-control[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n background: #f8f9fa;\n\n .version-toolbar {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n background: white;\n border-bottom: 1px solid #dee2e6;\n flex-shrink: 0;\n gap: 1rem;\n flex-wrap: wrap;\n\n .toolbar-section {\n display: flex;\n align-items: center;\n gap: 1rem;\n flex-wrap: wrap;\n\n .toolbar-title {\n margin: 0;\n color: #495057;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-weight: 600;\n\n i {\n color: #0d6efd;\n }\n\n .prompt-name {\n font-weight: 400;\n color: #6c757d;\n }\n }\n\n .filter-controls,\n .search-controls {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n\n .form-label {\n margin: 0;\n font-size: 0.875rem;\n color: #6c757d;\n white-space: nowrap;\n }\n\n .form-select,\n .form-control {\n min-width: 120px;\n }\n\n .form-check {\n margin: 0;\n \n .form-check-label {\n font-size: 0.875rem;\n }\n }\n }\n\n .action-buttons {\n display: flex;\n gap: 0.5rem;\n\n .btn {\n font-size: 0.875rem;\n }\n }\n }\n }\n\n .loading-container {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .loading-content {\n text-align: center;\n \n .loading-message {\n margin-top: 1rem;\n color: #6c757d;\n }\n }\n }\n\n .timeline-container {\n flex: 1;\n padding: 1rem;\n overflow-y: auto;\n\n .version-timeline {\n max-width: 800px;\n margin: 0 auto;\n\n .timeline-item {\n display: flex;\n position: relative;\n margin-bottom: 2rem;\n cursor: pointer;\n transition: all 0.2s ease;\n\n &:hover {\n .timeline-content {\n box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);\n transform: translateY(-1px);\n }\n }\n\n &.selected {\n .timeline-content {\n border-color: #0d6efd;\n box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);\n }\n }\n\n &.active {\n .timeline-marker .marker-icon {\n border-color: #28a745;\n background-color: #28a745;\n color: white;\n }\n }\n\n .timeline-marker {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-right: 1.5rem;\n flex-shrink: 0;\n\n .marker-icon {\n width: 2.5rem;\n height: 2.5rem;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 3px solid;\n background: white;\n font-size: 1rem;\n z-index: 2;\n\n &.change-create {\n border-color: #28a745;\n color: #28a745;\n }\n\n &.change-update {\n border-color: #0d6efd;\n color: #0d6efd;\n }\n\n &.change-delete {\n border-color: #dc3545;\n color: #dc3545;\n }\n }\n\n .timeline-line {\n width: 2px;\n flex: 1;\n background: #dee2e6;\n margin-top: 0.5rem;\n min-height: 2rem;\n }\n }\n\n .timeline-content {\n flex: 1;\n background: white;\n border: 1px solid #dee2e6;\n border-radius: 0.5rem;\n padding: 1.5rem;\n transition: all 0.2s ease;\n\n .version-header {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n margin-bottom: 1rem;\n\n .version-info {\n .version-label {\n margin: 0 0 0.5rem 0;\n color: #495057;\n font-weight: 600;\n }\n\n .version-meta {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n font-size: 0.875rem;\n color: #6c757d;\n flex-wrap: wrap;\n\n .change-date {\n font-weight: 500;\n }\n\n .badge {\n font-size: 0.75rem;\n }\n }\n }\n\n .version-actions {\n display: flex;\n gap: 0.5rem;\n\n .btn {\n padding: 0.25rem 0.5rem;\n font-size: 0.75rem;\n }\n }\n }\n\n .version-description {\n color: #495057;\n margin-bottom: 1rem;\n line-height: 1.5;\n }\n\n .changes-summary {\n .changes-list {\n .change-item {\n display: flex;\n align-items: center;\n padding: 0.5rem;\n background: #f8f9fa;\n border-radius: 0.375rem;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n\n .field-name {\n font-weight: 500;\n color: #495057;\n margin-right: 0.75rem;\n min-width: 100px;\n }\n\n .change-arrow {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n\n .old-value {\n color: #dc3545;\n text-decoration: line-through;\n }\n\n .new-value {\n color: #28a745;\n font-weight: 500;\n }\n\n i {\n color: #6c757d;\n }\n }\n }\n }\n }\n }\n }\n }\n\n .no-versions-message {\n text-align: center;\n padding: 3rem 1rem;\n color: #6c757d;\n\n i {\n font-size: 3rem;\n margin-bottom: 1rem;\n display: block;\n opacity: 0.5;\n }\n\n p {\n margin: 0.5rem 0;\n font-size: 1rem;\n line-height: 1.5;\n }\n }\n }\n\n .comparison-container {\n flex: 1;\n padding: 1rem;\n overflow-y: auto;\n\n .comparison-selectors {\n display: flex;\n align-items: end;\n gap: 1rem;\n margin-bottom: 2rem;\n padding: 1rem;\n background: white;\n border: 1px solid #dee2e6;\n border-radius: 0.5rem;\n\n .selector-group {\n flex: 1;\n\n .form-label {\n font-weight: 500;\n color: #495057;\n }\n }\n\n .comparison-arrow {\n padding-bottom: 0.375rem;\n color: #6c757d;\n font-size: 1.25rem;\n }\n }\n\n .comparison-results {\n background: white;\n border: 1px solid #dee2e6;\n border-radius: 0.5rem;\n overflow: hidden;\n\n .comparison-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n background: #f8f9fa;\n border-bottom: 1px solid #dee2e6;\n\n .comparison-title {\n margin: 0;\n color: #495057;\n font-weight: 600;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n\n .changes-count {\n font-size: 0.875rem;\n color: #6c757d;\n font-weight: 500;\n }\n }\n\n .differences-list {\n .difference-item {\n border-bottom: 1px solid #f1f3f4;\n padding: 1.5rem;\n\n &:last-child {\n border-bottom: none;\n }\n\n &.diff-added {\n border-left: 4px solid #28a745;\n }\n\n &.diff-modified {\n border-left: 4px solid #ffc107;\n }\n\n &.diff-removed {\n border-left: 4px solid #dc3545;\n }\n\n .diff-header {\n margin-bottom: 1rem;\n\n .field-info {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n\n .field-name {\n font-size: 1rem;\n color: #495057;\n }\n\n .badge {\n font-size: 0.75rem;\n \n &.template-badge {\n background-color: #6f42c1;\n }\n }\n }\n }\n\n .diff-content {\n .side-by-side-diff {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1rem;\n\n .diff-old,\n .diff-new {\n .diff-label {\n font-size: 0.875rem;\n font-weight: 600;\n margin-bottom: 0.5rem;\n color: #6c757d;\n }\n\n .diff-value {\n padding: 1rem;\n border-radius: 0.375rem;\n font-family: 'Fira Code', Monaco, Consolas, monospace;\n font-size: 0.875rem;\n line-height: 1.5;\n white-space: pre-wrap;\n word-break: break-word;\n\n &.old-value {\n background: #fff5f5;\n border: 1px solid #fed7d7;\n color: #c53030;\n }\n\n &.new-value {\n background: #f0fff4;\n border: 1px solid #9ae6b4;\n color: #2f855a;\n }\n\n .template-content {\n margin: 0;\n background: transparent;\n border: none;\n padding: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n white-space: pre-wrap;\n }\n }\n }\n }\n\n .diff-added,\n .diff-removed {\n .diff-label {\n font-size: 0.875rem;\n font-weight: 600;\n margin-bottom: 0.5rem;\n color: #6c757d;\n }\n\n .diff-value {\n padding: 1rem;\n border-radius: 0.375rem;\n font-family: 'Fira Code', Monaco, Consolas, monospace;\n font-size: 0.875rem;\n line-height: 1.5;\n white-space: pre-wrap;\n word-break: break-word;\n }\n }\n\n .diff-added .diff-value {\n background: #f0fff4;\n border: 1px solid #9ae6b4;\n color: #2f855a;\n }\n\n .diff-removed .diff-value {\n background: #fff5f5;\n border: 1px solid #fed7d7;\n color: #c53030;\n }\n }\n }\n }\n\n .no-differences {\n text-align: center;\n padding: 3rem 1rem;\n\n i {\n font-size: 3rem;\n margin-bottom: 1rem;\n display: block;\n }\n\n p {\n margin: 0;\n font-size: 1rem;\n }\n }\n }\n }\n\n .details-container {\n flex: 1;\n padding: 1rem;\n overflow-y: auto;\n\n .version-details {\n max-width: 800px;\n margin: 0 auto;\n background: white;\n border: 1px solid #dee2e6;\n border-radius: 0.5rem;\n overflow: hidden;\n\n .details-header {\n padding: 1.5rem;\n background: #f8f9fa;\n border-bottom: 1px solid #dee2e6;\n\n .details-title {\n margin: 0 0 0.5rem 0;\n color: #495057;\n font-weight: 600;\n }\n\n .details-meta {\n display: flex;\n gap: 1rem;\n font-size: 0.875rem;\n color: #6c757d;\n flex-wrap: wrap;\n }\n }\n\n .details-content {\n padding: 1.5rem;\n\n .detail-section {\n margin-bottom: 2rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .section-title {\n margin: 0 0 1rem 0;\n color: #495057;\n font-weight: 600;\n font-size: 1rem;\n border-bottom: 1px solid #e9ecef;\n padding-bottom: 0.5rem;\n }\n\n .detail-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n gap: 1rem;\n\n .detail-item {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n\n .detail-label {\n font-size: 0.875rem;\n font-weight: 500;\n color: #6c757d;\n }\n\n .detail-value {\n font-size: 0.875rem;\n color: #495057;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n }\n }\n\n .json-viewer,\n .template-viewer {\n .json-content,\n .template-content {\n background: #f8f9fa;\n border: 1px solid #dee2e6;\n border-radius: 0.375rem;\n padding: 1rem;\n margin: 0;\n font-family: 'Fira Code', Monaco, Consolas, monospace;\n font-size: 0.875rem;\n line-height: 1.5;\n overflow-x: auto;\n max-height: 400px;\n overflow-y: auto;\n }\n }\n }\n }\n }\n\n .no-selection-message {\n text-align: center;\n padding: 3rem 1rem;\n color: #6c757d;\n\n i {\n font-size: 3rem;\n margin-bottom: 1rem;\n display: block;\n opacity: 0.5;\n }\n\n p {\n margin: 0;\n font-size: 1rem;\n line-height: 1.5;\n }\n }\n }\n\n .error-container {\n padding: 1rem;\n\n .alert {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n }\n}\n\n//[_ngcontent-%COMP%] Responsive[_ngcontent-%COMP%] adjustments\n@media[_ngcontent-%COMP%] (max-width[_ngcontent-%COMP%]: 1200px)[_ngcontent-%COMP%] {\n .prompt-version-control {\n .version-toolbar {\n .toolbar-section {\n min-width: 100%;\n justify-content: space-between;\n }\n }\n\n .comparison-container {\n .comparison-selectors {\n flex-direction: column;\n align-items: stretch;\n\n .comparison-arrow {\n align-self: center;\n padding: 0.5rem 0;\n }\n }\n\n .comparison-results {\n .differences-list {\n .difference-item {\n .diff-content {\n .side-by-side-diff {\n grid-template-columns: 1fr;\n gap: 0.5rem;\n }\n }\n }\n }\n }\n }\n }\n}\n\n@media (max-width: 768px) {\n .prompt-version-control[_ngcontent-%COMP%] {\n .version-toolbar {\n padding: 0.75rem;\n \n .toolbar-section {\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n }\n\n .timeline-container {\n padding: 0.75rem;\n\n .version-timeline {\n .timeline-item {\n .timeline-marker {\n margin-right: 1rem;\n\n .marker-icon {\n width: 2rem;\n height: 2rem;\n font-size: 0.875rem;\n }\n }\n\n .timeline-content {\n padding: 1rem;\n\n .version-header {\n flex-direction: column;\n align-items: flex-start;\n gap: 0.75rem;\n\n .version-actions {\n align-self: flex-end;\n }\n }\n }\n }\n }\n }\n\n .comparison-container,\n .details-container {\n padding: 0.75rem;\n }\n }\n\n .prompt-selector-section[_ngcontent-%COMP%] {\n padding: 2rem;\n background: white;\n border-radius: 8px;\n margin: 1rem;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n\n .section-title {\n color: #495057;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-weight: 600;\n margin-bottom: 0.5rem;\n\n i {\n color: #007bff;\n }\n }\n\n .prompt-selector {\n .search-box {\n .input-group-text {\n background: #f8f9fa;\n border-color: #ced4da;\n\n i {\n color: #6c757d;\n }\n }\n\n .form-control {\n border-color: #ced4da;\n\n &:focus {\n border-color: #007bff;\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n }\n }\n }\n\n .prompts-list {\n max-height: 400px;\n overflow-y: auto;\n border: 1px solid #dee2e6;\n border-radius: 4px;\n\n .empty-state {\n text-align: center;\n padding: 2rem;\n\n i {\n font-size: 2rem;\n margin-bottom: 0.5rem;\n }\n }\n\n .prompt-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0.75rem 1rem;\n border-bottom: 1px solid #dee2e6;\n cursor: pointer;\n transition: background-color 0.2s;\n\n &:last-child {\n border-bottom: none;\n }\n\n &:hover {\n background-color: #f8f9fa;\n }\n\n .prompt-info {\n flex: 1;\n\n .prompt-title {\n margin: 0 0 0.25rem 0;\n font-weight: 600;\n color: #495057;\n }\n\n .prompt-description {\n margin: 0;\n font-size: 0.875rem;\n color: #6c757d;\n line-height: 1.4;\n }\n }\n\n .prompt-actions {\n color: #007bff;\n opacity: 0.7;\n transition: opacity 0.2s;\n }\n\n &:hover .prompt-actions {\n opacity: 1;\n }\n }\n }\n }\n }\n}"] });
1184
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PromptVersionControlComponent, [{
1185
+ type: Component,
1186
+ args: [{ selector: 'app-prompt-version-control', template: "<div class=\"prompt-version-control\">\n <!-- Prompt Selector (when no prompt selected) -->\n @if (!prompt) {\n <div class=\"prompt-selector-section\">\n <h5 class=\"section-title\">\n <i class=\"fa-solid fa-history\"></i>\n Version History\n </h5>\n <p class=\"text-muted mb-3\">Select a prompt to view its version history</p>\n \n <div class=\"prompt-selector\">\n <div class=\"search-box mb-3\">\n <div class=\"input-group\">\n <span class=\"input-group-text\">\n <i class=\"fa-solid fa-search\"></i>\n </span>\n <input \n type=\"text\" \n class=\"form-control\" \n placeholder=\"Search prompts...\"\n [ngModel]=\"promptSearchTerm$.value\"\n (ngModelChange)=\"onPromptSearchChange($event)\">\n </div>\n </div>\n \n <div class=\"prompts-list\">\n @if (availablePrompts.length === 0) {\n <div class=\"empty-state\">\n <i class=\"fa-solid fa-comment-dots text-muted\"></i>\n <p class=\"text-muted\">No prompts available</p>\n </div>\n } @else {\n @for (promptItem of filteredAvailablePrompts; track promptItem.ID) {\n <div class=\"prompt-item\" (click)=\"selectPromptForHistory(promptItem)\">\n <div class=\"prompt-info\">\n <h6 class=\"prompt-title\">{{ promptItem.Name }}</h6>\n @if (promptItem.Description) {\n <p class=\"prompt-description\">{{ promptItem.Description }}</p>\n }\n </div>\n <div class=\"prompt-actions\">\n <i class=\"fa-solid fa-arrow-right\"></i>\n </div>\n </div>\n }\n }\n </div>\n </div>\n </div>\n } @else {\n <!-- Header toolbar -->\n <div class=\"version-toolbar\">\n <div class=\"toolbar-section\">\n <h5 class=\"toolbar-title\">\n <i class=\"fa-solid fa-history\"></i>\n Version History\n @if (prompt) {\n <span class=\"prompt-name\">- {{ prompt.Name }}</span>\n }\n </h5>\n \n <div class=\"view-mode-toggle\">\n <div class=\"btn-group btn-group-sm\" role=\"group\">\n <input type=\"radio\" class=\"btn-check\" name=\"view\" id=\"timelineView\" value=\"timeline\" [(ngModel)]=\"currentView\" (ngModelChange)=\"onViewChange($event)\">\n <label class=\"btn btn-outline-primary\" for=\"timelineView\">\n <i class=\"fa-solid fa-timeline\"></i>\n Timeline\n </label>\n \n <input type=\"radio\" class=\"btn-check\" name=\"view\" id=\"comparisonView\" value=\"comparison\" [(ngModel)]=\"currentView\" (ngModelChange)=\"onViewChange($event)\">\n <label class=\"btn btn-outline-primary\" for=\"comparisonView\">\n <i class=\"fa-solid fa-code-compare\"></i>\n Compare\n </label>\n \n <input type=\"radio\" class=\"btn-check\" name=\"view\" id=\"detailsView\" value=\"details\" [(ngModel)]=\"currentView\" (ngModelChange)=\"onViewChange($event)\">\n <label class=\"btn btn-outline-primary\" for=\"detailsView\">\n <i class=\"fa-solid fa-list\"></i>\n Details\n </label>\n </div>\n </div>\n </div>\n \n <div class=\"toolbar-section\">\n <div class=\"filter-controls\">\n <label class=\"form-label\">Filter:</label>\n <select class=\"form-select form-select-sm\" [(ngModel)]=\"filterBy\" (ngModelChange)=\"onFilterChange($event)\">\n <option value=\"all\">All Changes</option>\n <option value=\"updates\">Updates Only</option>\n <option value=\"major\">Major Changes</option>\n <option value=\"template\">Template Changes</option>\n </select>\n \n <div class=\"form-check form-switch\">\n <input class=\"form-check-input\" type=\"checkbox\" id=\"showSystem\" [(ngModel)]=\"showSystemChanges\" (ngModelChange)=\"applyFiltersPublic()\">\n <label class=\"form-check-label\" for=\"showSystem\">System</label>\n </div>\n </div>\n \n <div class=\"search-controls\">\n <input \n type=\"text\" \n class=\"form-control form-control-sm\" \n placeholder=\"Search changes...\"\n [ngModel]=\"searchTerm$.value\" (ngModelChange)=\"onSearchChange($event)\">\n </div>\n </div>\n \n <div class=\"toolbar-section\">\n <div class=\"action-buttons\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary\" (click)=\"onSortDirectionChange()\" [title]=\"'Sort ' + (sortDirection === 'asc' ? 'descending' : 'ascending')\">\n <i class=\"fa-solid\" [class.fa-sort-up]=\"sortDirection === 'asc'\" [class.fa-sort-down]=\"sortDirection === 'desc'\"></i>\n Sort\n </button>\n \n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary\" (click)=\"refreshHistory()\" [disabled]=\"isLoading\" title=\"Refresh history\">\n <i class=\"fa-solid fa-refresh\" [class.fa-spin]=\"isLoading\"></i>\n Refresh\n </button>\n \n <button type=\"button\" class=\"btn btn-sm btn-outline-info\" (click)=\"exportVersionHistory()\" title=\"Export history\">\n <i class=\"fa-solid fa-download\"></i>\n Export\n </button>\n </div>\n </div>\n </div>\n \n <!-- Loading state -->\n @if (isLoading) {\n <div class=\"loading-container\">\n <div class=\"loading-content\">\n <div class=\"spinner-border text-primary\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n <p class=\"loading-message\">{{ loadingMessage }}</p>\n </div>\n </div>\n } @else {\n \n <!-- Timeline View -->\n @if (currentView === 'timeline') {\n <div class=\"timeline-container\">\n @if (versions.length > 0) {\n <div class=\"version-timeline\">\n @for (version of versions; track version.id; let i = $index) {\n <div class=\"timeline-item\" \n [class.selected]=\"selectedVersion?.id === version.id\"\n [class.active]=\"version.isActive\"\n (click)=\"onVersionSelect(version)\">\n \n <div class=\"timeline-marker\">\n <div class=\"marker-icon\" [class]=\"getChangeTypeClass(version.changeType)\">\n <i class=\"fa-solid\" [class]=\"getChangeTypeIcon(version.changeType)\"></i>\n </div>\n @if (i < versions.length - 1) {\n <div class=\"timeline-line\"></div>\n }\n </div>\n \n <div class=\"timeline-content\">\n <div class=\"version-header\">\n <div class=\"version-info\">\n <h6 class=\"version-label\">{{ getVersionLabel(version) }}</h6>\n <div class=\"version-meta\">\n <span class=\"change-date\">{{ version.changedAt | date:'medium' }}</span>\n <span class=\"changed-by\">by {{ version.changedBy }}</span>\n <span class=\"change-source badge\" [class.badge-primary]=\"version.changeSource === 'Internal'\" [class.badge-secondary]=\"version.changeSource === 'External'\">\n {{ version.changeSource }}\n </span>\n </div>\n </div>\n \n <div class=\"version-actions\">\n @if (showComparison && i < versions.length - 1) {\n <button \n type=\"button\" \n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"$event.stopPropagation(); startComparison(version)\"\n title=\"Compare with next version\">\n <i class=\"fa-solid fa-code-compare\"></i>\n </button>\n }\n \n @if (showRestoreActions && version.canRestore) {\n <button \n type=\"button\" \n class=\"btn btn-sm btn-outline-success\"\n (click)=\"$event.stopPropagation(); onVersionRestore(version)\"\n title=\"Restore this version\">\n <i class=\"fa-solid fa-undo\"></i>\n </button>\n }\n </div>\n </div>\n \n <div class=\"version-description\">\n {{ version.changesDescription }}\n </div>\n \n @if (version.changesJSON && timelineConfig.showDiffs) {\n <div class=\"changes-summary\">\n <div class=\"changes-list\">\n @for (field of getObjectKeys(version.changesJSON); track field) {\n <div class=\"change-item\">\n <span class=\"field-name\">{{ getFieldDisplayNamePublic(field) }}</span>\n @if (version.changesJSON[field].oldValue !== undefined) {\n <span class=\"change-arrow\">\n <span class=\"old-value\">{{ formatChangeValue(version.changesJSON[field].oldValue) }}</span>\n <i class=\"fa-solid fa-arrow-right\"></i>\n <span class=\"new-value\">{{ formatChangeValue(version.changesJSON[field].newValue) }}</span>\n </span>\n } @else {\n <span class=\"new-value\">{{ formatChangeValue(version.changesJSON[field].newValue) }}</span>\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n </div>\n }\n </div>\n } @else {\n <div class=\"no-versions-message\">\n <i class=\"fa-solid fa-info-circle text-muted\"></i>\n <p class=\"text-muted\">No version history available for this prompt.</p>\n @if (prompt && !prompt.EntityInfo.TrackRecordChanges) {\n <p class=\"text-muted\"><small>Record changes tracking may not be enabled for prompts.</small></p>\n }\n </div>\n }\n </div>\n }\n \n <!-- Comparison View -->\n @if (currentView === 'comparison') {\n <div class=\"comparison-container\">\n <!-- Version selectors -->\n <div class=\"comparison-selectors\">\n <div class=\"selector-group\">\n <label class=\"form-label\">Compare from:</label>\n <select class=\"form-select\" [(ngModel)]=\"compareFromVersion\" (ngModelChange)=\"generateComparisonPublic()\">\n @for (version of versions; track version.id) {\n <option [ngValue]=\"version\">{{ getVersionLabel(version) }} - {{ version.changedAt | date:'short' }}</option>\n }\n </select>\n </div>\n \n <div class=\"comparison-arrow\">\n <i class=\"fa-solid fa-arrow-right\"></i>\n </div>\n \n <div class=\"selector-group\">\n <label class=\"form-label\">Compare to:</label>\n <select class=\"form-select\" [(ngModel)]=\"compareToVersion\" (ngModelChange)=\"generateComparisonPublic()\">\n @for (version of versions; track version.id) {\n <option [ngValue]=\"version\">{{ getVersionLabel(version) }} - {{ version.changedAt | date:'short' }}</option>\n }\n </select>\n </div>\n </div>\n \n <!-- Comparison results -->\n @if (comparisonResult) {\n <div class=\"comparison-results\">\n <div class=\"comparison-header\">\n <h6 class=\"comparison-title\">\n <i class=\"fa-solid fa-code-compare\"></i>\n Changes between {{ getVersionLabel(comparisonResult.fromVersion) }} and {{ getVersionLabel(comparisonResult.toVersion) }}\n </h6>\n <div class=\"changes-count\">\n {{ comparisonResult.differences.length }} change(s) found\n </div>\n </div>\n \n @if (comparisonResult.differences.length > 0) {\n <div class=\"differences-list\">\n @for (diff of comparisonResult.differences; track diff.fieldName) {\n <div class=\"difference-item\" [class]=\"'diff-' + diff.changeType\">\n <div class=\"diff-header\">\n <div class=\"field-info\">\n <strong class=\"field-name\">{{ diff.displayName }}</strong>\n <span class=\"change-type badge\" \n [class.badge-success]=\"diff.changeType === 'added'\"\n [class.badge-warning]=\"diff.changeType === 'modified'\"\n [class.badge-danger]=\"diff.changeType === 'removed'\">\n {{ diff.changeType }}\n </span>\n @if (diff.isTemplate) {\n <span class=\"template-badge badge badge-info\">Template</span>\n }\n </div>\n </div>\n \n <div class=\"diff-content\">\n @if (diff.changeType === 'modified') {\n <div class=\"side-by-side-diff\">\n <div class=\"diff-old\">\n <h6 class=\"diff-label\">Before:</h6>\n <div class=\"diff-value old-value\">\n @if (diff.isTemplate && diff.fieldName === 'TemplateText') {\n <pre class=\"template-content\">{{ diff.oldValue }}</pre>\n } @else {\n {{ formatChangeValue(diff.oldValue) }}\n }\n </div>\n </div>\n \n <div class=\"diff-new\">\n <h6 class=\"diff-label\">After:</h6>\n <div class=\"diff-value new-value\">\n @if (diff.isTemplate && diff.fieldName === 'TemplateText') {\n <pre class=\"template-content\">{{ diff.newValue }}</pre>\n } @else {\n {{ formatChangeValue(diff.newValue) }}\n }\n </div>\n </div>\n </div>\n } @else if (diff.changeType === 'added') {\n <div class=\"diff-added\">\n <h6 class=\"diff-label\">Added:</h6>\n <div class=\"diff-value new-value\">{{ formatChangeValue(diff.newValue) }}</div>\n </div>\n } @else if (diff.changeType === 'removed') {\n <div class=\"diff-removed\">\n <h6 class=\"diff-label\">Removed:</h6>\n <div class=\"diff-value old-value\">{{ formatChangeValue(diff.oldValue) }}</div>\n </div>\n }\n </div>\n </div>\n }\n </div>\n } @else {\n <div class=\"no-differences\">\n <i class=\"fa-solid fa-check-circle text-success\"></i>\n <p class=\"text-muted\">No differences found between the selected versions.</p>\n </div>\n }\n </div>\n }\n </div>\n }\n \n <!-- Details View -->\n @if (currentView === 'details') {\n <div class=\"details-container\">\n @if (selectedVersion) {\n <div class=\"version-details\">\n <div class=\"details-header\">\n <h6 class=\"details-title\">{{ getVersionLabel(selectedVersion) }}</h6>\n <div class=\"details-meta\">\n <span class=\"change-date\">{{ selectedVersion.changedAt | date:'full' }}</span>\n <span class=\"changed-by\">Changed by {{ selectedVersion.changedBy }}</span>\n </div>\n </div>\n \n <div class=\"details-content\">\n <div class=\"detail-section\">\n <h6 class=\"section-title\">Change Information</h6>\n <div class=\"detail-grid\">\n <div class=\"detail-item\">\n <span class=\"detail-label\">Type:</span>\n <span class=\"detail-value\">\n <i class=\"fa-solid\" [class]=\"getChangeTypeIcon(selectedVersion.changeType)\"></i>\n {{ selectedVersion.changeType }}\n </span>\n </div>\n \n <div class=\"detail-item\">\n <span class=\"detail-label\">Source:</span>\n <span class=\"detail-value\">{{ selectedVersion.changeSource }}</span>\n </div>\n \n <div class=\"detail-item\">\n <span class=\"detail-label\">Description:</span>\n <span class=\"detail-value\">{{ selectedVersion.changesDescription }}</span>\n </div>\n </div>\n </div>\n \n @if (selectedVersion.fullRecordJSON) {\n <div class=\"detail-section\">\n <h6 class=\"section-title\">Record State</h6>\n <div class=\"json-viewer\">\n <pre class=\"json-content\">{{ selectedVersion.fullRecordJSON | json }}</pre>\n </div>\n </div>\n }\n \n @if (selectedVersion.templateContent) {\n <div class=\"detail-section\">\n <h6 class=\"section-title\">Template Content</h6>\n <div class=\"template-viewer\">\n <pre class=\"template-content\">{{ selectedVersion.templateContent.TemplateText }}</pre>\n </div>\n </div>\n }\n </div>\n </div>\n } @else {\n <div class=\"no-selection-message\">\n <i class=\"fa-solid fa-hand-pointer text-muted\"></i>\n <p class=\"text-muted\">Select a version from the timeline to view details.</p>\n </div>\n }\n </div>\n }\n }\n \n <!-- Error state -->\n @if (error) {\n <div class=\"error-container\">\n <div class=\"alert alert-danger\" role=\"alert\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n {{ error }}\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger ms-2\" (click)=\"refreshHistory()\">\n <i class=\"fa-solid fa-refresh\"></i>\n Retry\n </button>\n </div>\n </div>\n }\n }\n</div>", styles: [".prompt-version-control {\n display: flex;\n flex-direction: column;\n height: 100%;\n background: #f8f9fa;\n\n .version-toolbar {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n background: white;\n border-bottom: 1px solid #dee2e6;\n flex-shrink: 0;\n gap: 1rem;\n flex-wrap: wrap;\n\n .toolbar-section {\n display: flex;\n align-items: center;\n gap: 1rem;\n flex-wrap: wrap;\n\n .toolbar-title {\n margin: 0;\n color: #495057;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-weight: 600;\n\n i {\n color: #0d6efd;\n }\n\n .prompt-name {\n font-weight: 400;\n color: #6c757d;\n }\n }\n\n .filter-controls,\n .search-controls {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n\n .form-label {\n margin: 0;\n font-size: 0.875rem;\n color: #6c757d;\n white-space: nowrap;\n }\n\n .form-select,\n .form-control {\n min-width: 120px;\n }\n\n .form-check {\n margin: 0;\n \n .form-check-label {\n font-size: 0.875rem;\n }\n }\n }\n\n .action-buttons {\n display: flex;\n gap: 0.5rem;\n\n .btn {\n font-size: 0.875rem;\n }\n }\n }\n }\n\n .loading-container {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .loading-content {\n text-align: center;\n \n .loading-message {\n margin-top: 1rem;\n color: #6c757d;\n }\n }\n }\n\n .timeline-container {\n flex: 1;\n padding: 1rem;\n overflow-y: auto;\n\n .version-timeline {\n max-width: 800px;\n margin: 0 auto;\n\n .timeline-item {\n display: flex;\n position: relative;\n margin-bottom: 2rem;\n cursor: pointer;\n transition: all 0.2s ease;\n\n &:hover {\n .timeline-content {\n box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);\n transform: translateY(-1px);\n }\n }\n\n &.selected {\n .timeline-content {\n border-color: #0d6efd;\n box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);\n }\n }\n\n &.active {\n .timeline-marker .marker-icon {\n border-color: #28a745;\n background-color: #28a745;\n color: white;\n }\n }\n\n .timeline-marker {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin-right: 1.5rem;\n flex-shrink: 0;\n\n .marker-icon {\n width: 2.5rem;\n height: 2.5rem;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 3px solid;\n background: white;\n font-size: 1rem;\n z-index: 2;\n\n &.change-create {\n border-color: #28a745;\n color: #28a745;\n }\n\n &.change-update {\n border-color: #0d6efd;\n color: #0d6efd;\n }\n\n &.change-delete {\n border-color: #dc3545;\n color: #dc3545;\n }\n }\n\n .timeline-line {\n width: 2px;\n flex: 1;\n background: #dee2e6;\n margin-top: 0.5rem;\n min-height: 2rem;\n }\n }\n\n .timeline-content {\n flex: 1;\n background: white;\n border: 1px solid #dee2e6;\n border-radius: 0.5rem;\n padding: 1.5rem;\n transition: all 0.2s ease;\n\n .version-header {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n margin-bottom: 1rem;\n\n .version-info {\n .version-label {\n margin: 0 0 0.5rem 0;\n color: #495057;\n font-weight: 600;\n }\n\n .version-meta {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n font-size: 0.875rem;\n color: #6c757d;\n flex-wrap: wrap;\n\n .change-date {\n font-weight: 500;\n }\n\n .badge {\n font-size: 0.75rem;\n }\n }\n }\n\n .version-actions {\n display: flex;\n gap: 0.5rem;\n\n .btn {\n padding: 0.25rem 0.5rem;\n font-size: 0.75rem;\n }\n }\n }\n\n .version-description {\n color: #495057;\n margin-bottom: 1rem;\n line-height: 1.5;\n }\n\n .changes-summary {\n .changes-list {\n .change-item {\n display: flex;\n align-items: center;\n padding: 0.5rem;\n background: #f8f9fa;\n border-radius: 0.375rem;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n\n .field-name {\n font-weight: 500;\n color: #495057;\n margin-right: 0.75rem;\n min-width: 100px;\n }\n\n .change-arrow {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n\n .old-value {\n color: #dc3545;\n text-decoration: line-through;\n }\n\n .new-value {\n color: #28a745;\n font-weight: 500;\n }\n\n i {\n color: #6c757d;\n }\n }\n }\n }\n }\n }\n }\n }\n\n .no-versions-message {\n text-align: center;\n padding: 3rem 1rem;\n color: #6c757d;\n\n i {\n font-size: 3rem;\n margin-bottom: 1rem;\n display: block;\n opacity: 0.5;\n }\n\n p {\n margin: 0.5rem 0;\n font-size: 1rem;\n line-height: 1.5;\n }\n }\n }\n\n .comparison-container {\n flex: 1;\n padding: 1rem;\n overflow-y: auto;\n\n .comparison-selectors {\n display: flex;\n align-items: end;\n gap: 1rem;\n margin-bottom: 2rem;\n padding: 1rem;\n background: white;\n border: 1px solid #dee2e6;\n border-radius: 0.5rem;\n\n .selector-group {\n flex: 1;\n\n .form-label {\n font-weight: 500;\n color: #495057;\n }\n }\n\n .comparison-arrow {\n padding-bottom: 0.375rem;\n color: #6c757d;\n font-size: 1.25rem;\n }\n }\n\n .comparison-results {\n background: white;\n border: 1px solid #dee2e6;\n border-radius: 0.5rem;\n overflow: hidden;\n\n .comparison-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n background: #f8f9fa;\n border-bottom: 1px solid #dee2e6;\n\n .comparison-title {\n margin: 0;\n color: #495057;\n font-weight: 600;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n\n .changes-count {\n font-size: 0.875rem;\n color: #6c757d;\n font-weight: 500;\n }\n }\n\n .differences-list {\n .difference-item {\n border-bottom: 1px solid #f1f3f4;\n padding: 1.5rem;\n\n &:last-child {\n border-bottom: none;\n }\n\n &.diff-added {\n border-left: 4px solid #28a745;\n }\n\n &.diff-modified {\n border-left: 4px solid #ffc107;\n }\n\n &.diff-removed {\n border-left: 4px solid #dc3545;\n }\n\n .diff-header {\n margin-bottom: 1rem;\n\n .field-info {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n\n .field-name {\n font-size: 1rem;\n color: #495057;\n }\n\n .badge {\n font-size: 0.75rem;\n \n &.template-badge {\n background-color: #6f42c1;\n }\n }\n }\n }\n\n .diff-content {\n .side-by-side-diff {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1rem;\n\n .diff-old,\n .diff-new {\n .diff-label {\n font-size: 0.875rem;\n font-weight: 600;\n margin-bottom: 0.5rem;\n color: #6c757d;\n }\n\n .diff-value {\n padding: 1rem;\n border-radius: 0.375rem;\n font-family: 'Fira Code', Monaco, Consolas, monospace;\n font-size: 0.875rem;\n line-height: 1.5;\n white-space: pre-wrap;\n word-break: break-word;\n\n &.old-value {\n background: #fff5f5;\n border: 1px solid #fed7d7;\n color: #c53030;\n }\n\n &.new-value {\n background: #f0fff4;\n border: 1px solid #9ae6b4;\n color: #2f855a;\n }\n\n .template-content {\n margin: 0;\n background: transparent;\n border: none;\n padding: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n white-space: pre-wrap;\n }\n }\n }\n }\n\n .diff-added,\n .diff-removed {\n .diff-label {\n font-size: 0.875rem;\n font-weight: 600;\n margin-bottom: 0.5rem;\n color: #6c757d;\n }\n\n .diff-value {\n padding: 1rem;\n border-radius: 0.375rem;\n font-family: 'Fira Code', Monaco, Consolas, monospace;\n font-size: 0.875rem;\n line-height: 1.5;\n white-space: pre-wrap;\n word-break: break-word;\n }\n }\n\n .diff-added .diff-value {\n background: #f0fff4;\n border: 1px solid #9ae6b4;\n color: #2f855a;\n }\n\n .diff-removed .diff-value {\n background: #fff5f5;\n border: 1px solid #fed7d7;\n color: #c53030;\n }\n }\n }\n }\n\n .no-differences {\n text-align: center;\n padding: 3rem 1rem;\n\n i {\n font-size: 3rem;\n margin-bottom: 1rem;\n display: block;\n }\n\n p {\n margin: 0;\n font-size: 1rem;\n }\n }\n }\n }\n\n .details-container {\n flex: 1;\n padding: 1rem;\n overflow-y: auto;\n\n .version-details {\n max-width: 800px;\n margin: 0 auto;\n background: white;\n border: 1px solid #dee2e6;\n border-radius: 0.5rem;\n overflow: hidden;\n\n .details-header {\n padding: 1.5rem;\n background: #f8f9fa;\n border-bottom: 1px solid #dee2e6;\n\n .details-title {\n margin: 0 0 0.5rem 0;\n color: #495057;\n font-weight: 600;\n }\n\n .details-meta {\n display: flex;\n gap: 1rem;\n font-size: 0.875rem;\n color: #6c757d;\n flex-wrap: wrap;\n }\n }\n\n .details-content {\n padding: 1.5rem;\n\n .detail-section {\n margin-bottom: 2rem;\n\n &:last-child {\n margin-bottom: 0;\n }\n\n .section-title {\n margin: 0 0 1rem 0;\n color: #495057;\n font-weight: 600;\n font-size: 1rem;\n border-bottom: 1px solid #e9ecef;\n padding-bottom: 0.5rem;\n }\n\n .detail-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n gap: 1rem;\n\n .detail-item {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n\n .detail-label {\n font-size: 0.875rem;\n font-weight: 500;\n color: #6c757d;\n }\n\n .detail-value {\n font-size: 0.875rem;\n color: #495057;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n }\n }\n\n .json-viewer,\n .template-viewer {\n .json-content,\n .template-content {\n background: #f8f9fa;\n border: 1px solid #dee2e6;\n border-radius: 0.375rem;\n padding: 1rem;\n margin: 0;\n font-family: 'Fira Code', Monaco, Consolas, monospace;\n font-size: 0.875rem;\n line-height: 1.5;\n overflow-x: auto;\n max-height: 400px;\n overflow-y: auto;\n }\n }\n }\n }\n }\n\n .no-selection-message {\n text-align: center;\n padding: 3rem 1rem;\n color: #6c757d;\n\n i {\n font-size: 3rem;\n margin-bottom: 1rem;\n display: block;\n opacity: 0.5;\n }\n\n p {\n margin: 0;\n font-size: 1rem;\n line-height: 1.5;\n }\n }\n }\n\n .error-container {\n padding: 1rem;\n\n .alert {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n }\n}\n\n// Responsive adjustments\n@media (max-width: 1200px) {\n .prompt-version-control {\n .version-toolbar {\n .toolbar-section {\n min-width: 100%;\n justify-content: space-between;\n }\n }\n\n .comparison-container {\n .comparison-selectors {\n flex-direction: column;\n align-items: stretch;\n\n .comparison-arrow {\n align-self: center;\n padding: 0.5rem 0;\n }\n }\n\n .comparison-results {\n .differences-list {\n .difference-item {\n .diff-content {\n .side-by-side-diff {\n grid-template-columns: 1fr;\n gap: 0.5rem;\n }\n }\n }\n }\n }\n }\n }\n}\n\n@media (max-width: 768px) {\n .prompt-version-control {\n .version-toolbar {\n padding: 0.75rem;\n \n .toolbar-section {\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n }\n\n .timeline-container {\n padding: 0.75rem;\n\n .version-timeline {\n .timeline-item {\n .timeline-marker {\n margin-right: 1rem;\n\n .marker-icon {\n width: 2rem;\n height: 2rem;\n font-size: 0.875rem;\n }\n }\n\n .timeline-content {\n padding: 1rem;\n\n .version-header {\n flex-direction: column;\n align-items: flex-start;\n gap: 0.75rem;\n\n .version-actions {\n align-self: flex-end;\n }\n }\n }\n }\n }\n }\n\n .comparison-container,\n .details-container {\n padding: 0.75rem;\n }\n }\n\n .prompt-selector-section {\n padding: 2rem;\n background: white;\n border-radius: 8px;\n margin: 1rem;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n\n .section-title {\n color: #495057;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-weight: 600;\n margin-bottom: 0.5rem;\n\n i {\n color: #007bff;\n }\n }\n\n .prompt-selector {\n .search-box {\n .input-group-text {\n background: #f8f9fa;\n border-color: #ced4da;\n\n i {\n color: #6c757d;\n }\n }\n\n .form-control {\n border-color: #ced4da;\n\n &:focus {\n border-color: #007bff;\n box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n }\n }\n }\n\n .prompts-list {\n max-height: 400px;\n overflow-y: auto;\n border: 1px solid #dee2e6;\n border-radius: 4px;\n\n .empty-state {\n text-align: center;\n padding: 2rem;\n\n i {\n font-size: 2rem;\n margin-bottom: 0.5rem;\n }\n }\n\n .prompt-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0.75rem 1rem;\n border-bottom: 1px solid #dee2e6;\n cursor: pointer;\n transition: background-color 0.2s;\n\n &:last-child {\n border-bottom: none;\n }\n\n &:hover {\n background-color: #f8f9fa;\n }\n\n .prompt-info {\n flex: 1;\n\n .prompt-title {\n margin: 0 0 0.25rem 0;\n font-weight: 600;\n color: #495057;\n }\n\n .prompt-description {\n margin: 0;\n font-size: 0.875rem;\n color: #6c757d;\n line-height: 1.4;\n }\n }\n\n .prompt-actions {\n color: #007bff;\n opacity: 0.7;\n transition: opacity 0.2s;\n }\n\n &:hover .prompt-actions {\n opacity: 1;\n }\n }\n }\n }\n }\n}"] }]
1187
+ }], () => [{ type: i1.MJNotificationService }], { prompt: [{
1188
+ type: Input
1189
+ }], autoLoad: [{
1190
+ type: Input
1191
+ }], showRestoreActions: [{
1192
+ type: Input
1193
+ }], showComparison: [{
1194
+ type: Input
1195
+ }], maxVersions: [{
1196
+ type: Input
1197
+ }], versionSelected: [{
1198
+ type: Output
1199
+ }], versionRestored: [{
1200
+ type: Output
1201
+ }], versionCompared: [{
1202
+ type: Output
1203
+ }] }); })();
1204
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PromptVersionControlComponent, { className: "PromptVersionControlComponent", filePath: "src/AI/components/prompts/prompt-version-control.component.ts", lineNumber: 43 }); })();
1205
+ //# sourceMappingURL=prompt-version-control.component.js.map