@memberjunction/ng-dashboards 2.49.0 → 2.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/AI/ai-dashboard.component.d.ts +4 -0
  2. package/dist/AI/ai-dashboard.component.d.ts.map +1 -1
  3. package/dist/AI/ai-dashboard.component.js +71 -23
  4. package/dist/AI/ai-dashboard.component.js.map +1 -1
  5. package/dist/AI/components/agents/agent-configuration.component.d.ts +18 -8
  6. package/dist/AI/components/agents/agent-configuration.component.d.ts.map +1 -1
  7. package/dist/AI/components/agents/agent-configuration.component.js +338 -130
  8. package/dist/AI/components/agents/agent-configuration.component.js.map +1 -1
  9. package/dist/AI/components/agents/agent-editor.component.d.ts.map +1 -1
  10. package/dist/AI/components/agents/agent-editor.component.js +0 -5
  11. package/dist/AI/components/agents/agent-editor.component.js.map +1 -1
  12. package/dist/AI/components/agents/agent-filter-panel.component.d.ts +16 -1
  13. package/dist/AI/components/agents/agent-filter-panel.component.d.ts.map +1 -1
  14. package/dist/AI/components/agents/agent-filter-panel.component.js +124 -14
  15. package/dist/AI/components/agents/agent-filter-panel.component.js.map +1 -1
  16. package/dist/AI/components/charts/time-series-chart.component.d.ts +2 -0
  17. package/dist/AI/components/charts/time-series-chart.component.d.ts.map +1 -1
  18. package/dist/AI/components/charts/time-series-chart.component.js +56 -2
  19. package/dist/AI/components/charts/time-series-chart.component.js.map +1 -1
  20. package/dist/AI/components/execution-monitoring.component.d.ts +4 -7
  21. package/dist/AI/components/execution-monitoring.component.d.ts.map +1 -1
  22. package/dist/AI/components/execution-monitoring.component.js +339 -368
  23. package/dist/AI/components/execution-monitoring.component.js.map +1 -1
  24. package/dist/AI/components/models/model-management-v2.component.d.ts +92 -0
  25. package/dist/AI/components/models/model-management-v2.component.d.ts.map +1 -0
  26. package/dist/AI/components/models/model-management-v2.component.js +1004 -0
  27. package/dist/AI/components/models/model-management-v2.component.js.map +1 -0
  28. package/dist/AI/components/prompts/prompt-management-v2.component.d.ts +66 -0
  29. package/dist/AI/components/prompts/prompt-management-v2.component.d.ts.map +1 -0
  30. package/dist/AI/components/prompts/prompt-management-v2.component.js +719 -0
  31. package/dist/AI/components/prompts/prompt-management-v2.component.js.map +1 -0
  32. package/dist/AI/services/ai-instrumentation.service.d.ts +7 -6
  33. package/dist/AI/services/ai-instrumentation.service.d.ts.map +1 -1
  34. package/dist/AI/services/ai-instrumentation.service.js +141 -147
  35. package/dist/AI/services/ai-instrumentation.service.js.map +1 -1
  36. package/dist/Actions/actions-management-dashboard.component.js +8 -8
  37. package/dist/Actions/actions-management-dashboard.component.js.map +1 -1
  38. package/dist/Actions/components/actions-list-view.component.d.ts +0 -2
  39. package/dist/Actions/components/actions-list-view.component.d.ts.map +1 -1
  40. package/dist/Actions/components/actions-list-view.component.js +37 -37
  41. package/dist/Actions/components/actions-list-view.component.js.map +1 -1
  42. package/dist/Actions/components/actions-overview.component.d.ts +7 -4
  43. package/dist/Actions/components/actions-overview.component.d.ts.map +1 -1
  44. package/dist/Actions/components/actions-overview.component.js +147 -90
  45. package/dist/Actions/components/actions-overview.component.js.map +1 -1
  46. package/dist/Actions/components/categories-list-view.component.d.ts +23 -2
  47. package/dist/Actions/components/categories-list-view.component.d.ts.map +1 -1
  48. package/dist/Actions/components/categories-list-view.component.js +283 -17
  49. package/dist/Actions/components/categories-list-view.component.js.map +1 -1
  50. package/dist/Actions/components/execution-monitoring.component.d.ts +0 -2
  51. package/dist/Actions/components/execution-monitoring.component.d.ts.map +1 -1
  52. package/dist/Actions/components/execution-monitoring.component.js +25 -37
  53. package/dist/Actions/components/execution-monitoring.component.js.map +1 -1
  54. package/dist/module.d.ts +3 -3
  55. package/dist/module.js +6 -6
  56. package/dist/module.js.map +1 -1
  57. package/package.json +7 -6
  58. package/dist/AI/components/models/model-management.component.d.ts +0 -73
  59. package/dist/AI/components/models/model-management.component.d.ts.map +0 -1
  60. package/dist/AI/components/models/model-management.component.js +0 -643
  61. package/dist/AI/components/models/model-management.component.js.map +0 -1
  62. package/dist/AI/components/prompts/prompt-management.component.d.ts +0 -118
  63. package/dist/AI/components/prompts/prompt-management.component.d.ts.map +0 -1
  64. package/dist/AI/components/prompts/prompt-management.component.js +0 -1351
  65. package/dist/AI/components/prompts/prompt-management.component.js.map +0 -1
@@ -1,1351 +0,0 @@
1
- import { Component, Output, EventEmitter } from '@angular/core';
2
- import { RunView, Metadata, LogError, LogStatus } from '@memberjunction/core';
3
- import { Subject, BehaviorSubject, combineLatest } from 'rxjs';
4
- import { debounceTime, takeUntil, distinctUntilChanged } from 'rxjs/operators';
5
- import { languages } from '@codemirror/language-data';
6
- import { TemplateEngineBase } from '@memberjunction/templates-base-types';
7
- import * as i0 from "@angular/core";
8
- import * as i1 from "@memberjunction/ng-notifications";
9
- import * as i2 from "@angular/forms";
10
- import * as i3 from "@progress/kendo-angular-layout";
11
- import * as i4 from "@memberjunction/ng-container-directives";
12
- import * as i5 from "@memberjunction/ng-code-editor";
13
- import * as i6 from "./prompt-filter-panel.component";
14
- import * as i7 from "./model-prompt-priority-matrix.component";
15
- import * as i8 from "./prompt-version-control.component";
16
- const _forTrack0 = ($index, $item) => $item.prompt.ID || $index;
17
- const _forTrack1 = ($index, $item) => $item.ID;
18
- function PromptManagementComponent_Conditional_1_Conditional_5_Template(rf, ctx) { if (rf & 1) {
19
- i0.ɵɵtext(0, " Hide Filters ");
20
- } }
21
- function PromptManagementComponent_Conditional_1_Conditional_6_Template(rf, ctx) { if (rf & 1) {
22
- i0.ɵɵtext(0, " Show Filters ");
23
- } }
24
- function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_5_Template(rf, ctx) { if (rf & 1) {
25
- i0.ɵɵelementStart(0, "div", 28)(1, "div", 31)(2, "div", 32);
26
- i0.ɵɵelement(3, "div", 33)(4, "div", 33)(5, "div", 33);
27
- i0.ɵɵelementEnd();
28
- i0.ɵɵelementStart(6, "div", 34);
29
- i0.ɵɵtext(7);
30
- i0.ɵɵelementEnd()()();
31
- } if (rf & 2) {
32
- const ctx_r1 = i0.ɵɵnextContext(3);
33
- i0.ɵɵadvance(7);
34
- i0.ɵɵtextInterpolate(ctx_r1.loadingMessage);
35
- } }
36
- function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_6_Template(rf, ctx) { if (rf & 1) {
37
- i0.ɵɵelementStart(0, "div", 29)(1, "p", 35);
38
- i0.ɵɵelement(2, "i", 36);
39
- i0.ɵɵtext(3);
40
- i0.ɵɵelementEnd()();
41
- } if (rf & 2) {
42
- const ctx_r1 = i0.ɵɵnextContext(3);
43
- i0.ɵɵadvance(3);
44
- i0.ɵɵtextInterpolate1(" ", ctx_r1.error, " ");
45
- } }
46
- function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_1_Template(rf, ctx) { if (rf & 1) {
47
- i0.ɵɵelementStart(0, "div", 37);
48
- i0.ɵɵelement(1, "i", 39);
49
- i0.ɵɵelementStart(2, "h3");
50
- i0.ɵɵtext(3, "No prompts found");
51
- i0.ɵɵelementEnd();
52
- i0.ɵɵelementStart(4, "p");
53
- i0.ɵɵtext(5, "No prompts match your current filters. Try adjusting your search criteria or create a new prompt.");
54
- i0.ɵɵelementEnd()();
55
- } }
56
- function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Conditional_11_Template(rf, ctx) { if (rf & 1) {
57
- i0.ɵɵelementStart(0, "span", 49);
58
- i0.ɵɵtext(1);
59
- i0.ɵɵelementEnd();
60
- } if (rf & 2) {
61
- const promptWithTemplate_r5 = i0.ɵɵnextContext().$implicit;
62
- i0.ɵɵadvance();
63
- i0.ɵɵtextInterpolate1("\u2022 ", promptWithTemplate_r5.type.Name, "");
64
- } }
65
- function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Conditional_15_Template(rf, ctx) { if (rf & 1) {
66
- i0.ɵɵelementStart(0, "p", 51);
67
- i0.ɵɵtext(1);
68
- i0.ɵɵelementEnd();
69
- } if (rf & 2) {
70
- const promptWithTemplate_r5 = i0.ɵɵnextContext().$implicit;
71
- i0.ɵɵadvance();
72
- i0.ɵɵtextInterpolate(promptWithTemplate_r5.prompt.Description);
73
- } }
74
- function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Conditional_16_Template(rf, ctx) { if (rf & 1) {
75
- i0.ɵɵelementStart(0, "p", 52);
76
- i0.ɵɵtext(1, "No description provided");
77
- i0.ɵɵelementEnd();
78
- } }
79
- function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Conditional_18_Conditional_4_Template(rf, ctx) { if (rf & 1) {
80
- i0.ɵɵelementStart(0, "div", 64)(1, "small");
81
- i0.ɵɵtext(2);
82
- i0.ɵɵelementEnd()();
83
- } if (rf & 2) {
84
- const promptWithTemplate_r5 = i0.ɵɵnextContext(2).$implicit;
85
- i0.ɵɵadvance(2);
86
- i0.ɵɵtextInterpolate1(" Template content: ", (promptWithTemplate_r5.templateContent.TemplateText || "").length, " characters ");
87
- } }
88
- function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Conditional_18_Template(rf, ctx) { if (rf & 1) {
89
- i0.ɵɵelementStart(0, "div", 62);
90
- i0.ɵɵelement(1, "i", 63);
91
- i0.ɵɵelementStart(2, "span");
92
- i0.ɵɵtext(3);
93
- i0.ɵɵelementEnd()();
94
- i0.ɵɵtemplate(4, PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Conditional_18_Conditional_4_Template, 3, 1, "div", 64);
95
- } if (rf & 2) {
96
- const promptWithTemplate_r5 = i0.ɵɵnextContext().$implicit;
97
- i0.ɵɵadvance(3);
98
- i0.ɵɵtextInterpolate(promptWithTemplate_r5.template.Name);
99
- i0.ɵɵadvance();
100
- i0.ɵɵconditional(promptWithTemplate_r5.templateContent ? 4 : -1);
101
- } }
102
- function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Conditional_19_Template(rf, ctx) { if (rf & 1) {
103
- i0.ɵɵelementStart(0, "div", 54);
104
- i0.ɵɵelement(1, "i", 63);
105
- i0.ɵɵelementStart(2, "span");
106
- i0.ɵɵtext(3, "No template assigned");
107
- i0.ɵɵelementEnd()();
108
- } }
109
- function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Template(rf, ctx) { if (rf & 1) {
110
- const _r4 = i0.ɵɵgetCurrentView();
111
- i0.ɵɵelementStart(0, "div", 41);
112
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Template_div_click_0_listener() { const promptWithTemplate_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.viewPrompt(promptWithTemplate_r5)); });
113
- i0.ɵɵelementStart(1, "div", 42)(2, "div", 43)(3, "div", 44);
114
- i0.ɵɵelement(4, "i");
115
- i0.ɵɵelementEnd();
116
- i0.ɵɵelementStart(5, "div", 45)(6, "h4", 46);
117
- i0.ɵɵtext(7);
118
- i0.ɵɵelementEnd();
119
- i0.ɵɵelementStart(8, "div", 47)(9, "span", 48);
120
- i0.ɵɵtext(10);
121
- i0.ɵɵelementEnd();
122
- i0.ɵɵtemplate(11, PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Conditional_11_Template, 2, 1, "span", 49);
123
- i0.ɵɵelementEnd()()();
124
- i0.ɵɵelementStart(12, "div");
125
- i0.ɵɵtext(13);
126
- i0.ɵɵelementEnd()();
127
- i0.ɵɵelementStart(14, "div", 50);
128
- i0.ɵɵtemplate(15, PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Conditional_15_Template, 2, 1, "p", 51)(16, PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Conditional_16_Template, 2, 0, "p", 52);
129
- i0.ɵɵelementStart(17, "div", 53);
130
- i0.ɵɵtemplate(18, PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Conditional_18_Template, 5, 2)(19, PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Conditional_19_Template, 4, 0, "div", 54);
131
- i0.ɵɵelementEnd()();
132
- i0.ɵɵelementStart(20, "div", 55);
133
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Template_div_click_20_listener($event) { i0.ɵɵrestoreView(_r4); return i0.ɵɵresetView($event.stopPropagation()); });
134
- i0.ɵɵelementStart(21, "button", 56);
135
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Template_button_click_21_listener() { const promptWithTemplate_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.viewPrompt(promptWithTemplate_r5)); });
136
- i0.ɵɵelement(22, "i", 57);
137
- i0.ɵɵtext(23, " View ");
138
- i0.ɵɵelementEnd();
139
- i0.ɵɵelementStart(24, "button", 58);
140
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Template_button_click_24_listener() { const promptWithTemplate_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.editPrompt(promptWithTemplate_r5)); });
141
- i0.ɵɵelement(25, "i", 59);
142
- i0.ɵɵtext(26, " Edit ");
143
- i0.ɵɵelementEnd();
144
- i0.ɵɵelementStart(27, "button", 60);
145
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Template_button_click_27_listener() { const promptWithTemplate_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.deletePrompt(promptWithTemplate_r5)); });
146
- i0.ɵɵelement(28, "i", 61);
147
- i0.ɵɵtext(29, " Delete ");
148
- i0.ɵɵelementEnd()()();
149
- } if (rf & 2) {
150
- const promptWithTemplate_r5 = ctx.$implicit;
151
- const ctx_r1 = i0.ɵɵnextContext(5);
152
- i0.ɵɵadvance(4);
153
- i0.ɵɵclassMap(ctx_r1.getPromptIcon());
154
- i0.ɵɵadvance(3);
155
- i0.ɵɵtextInterpolate(promptWithTemplate_r5.prompt.Name);
156
- i0.ɵɵadvance(3);
157
- i0.ɵɵtextInterpolate(ctx_r1.getCategoryName(promptWithTemplate_r5.prompt.CategoryID));
158
- i0.ɵɵadvance();
159
- i0.ɵɵconditional(promptWithTemplate_r5.type ? 11 : -1);
160
- i0.ɵɵadvance();
161
- i0.ɵɵclassMapInterpolate1("status-badge status-", promptWithTemplate_r5.prompt.Status.toLowerCase(), "");
162
- i0.ɵɵadvance();
163
- i0.ɵɵtextInterpolate1(" ", promptWithTemplate_r5.prompt.Status, " ");
164
- i0.ɵɵadvance(2);
165
- i0.ɵɵconditional(promptWithTemplate_r5.prompt.Description ? 15 : 16);
166
- i0.ɵɵadvance(3);
167
- i0.ɵɵconditional(promptWithTemplate_r5.template ? 18 : 19);
168
- } }
169
- function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_Template(rf, ctx) { if (rf & 1) {
170
- i0.ɵɵelementStart(0, "div", 38);
171
- i0.ɵɵrepeaterCreate(1, PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_For_2_Template, 30, 11, "div", 40, _forTrack0);
172
- i0.ɵɵelementEnd();
173
- } if (rf & 2) {
174
- const ctx_r1 = i0.ɵɵnextContext(4);
175
- i0.ɵɵadvance();
176
- i0.ɵɵrepeater(ctx_r1.filteredPrompts);
177
- } }
178
- function PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Template(rf, ctx) { if (rf & 1) {
179
- i0.ɵɵelementStart(0, "div", 30);
180
- i0.ɵɵtemplate(1, PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_1_Template, 6, 0, "div", 37)(2, PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Conditional_2_Template, 3, 0, "div", 38);
181
- i0.ɵɵelementEnd();
182
- } if (rf & 2) {
183
- const ctx_r1 = i0.ɵɵnextContext(3);
184
- i0.ɵɵadvance();
185
- i0.ɵɵconditional(ctx_r1.filteredPrompts.length === 0 ? 1 : 2);
186
- } }
187
- function PromptManagementComponent_Conditional_1_Conditional_24_Template(rf, ctx) { if (rf & 1) {
188
- const _r3 = i0.ɵɵgetCurrentView();
189
- i0.ɵɵelementStart(0, "kendo-splitter", 23);
190
- i0.ɵɵlistener("layoutChange", function PromptManagementComponent_Conditional_1_Conditional_24_Template_kendo_splitter_layoutChange_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onMainSplitterChange($event)); });
191
- i0.ɵɵelementStart(1, "kendo-splitter-pane", 24)(2, "mj-prompt-filter-panel", 25);
192
- i0.ɵɵlistener("filtersChange", function PromptManagementComponent_Conditional_1_Conditional_24_Template_mj_prompt_filter_panel_filtersChange_2_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onFiltersChange($event)); })("filterChange", function PromptManagementComponent_Conditional_1_Conditional_24_Template_mj_prompt_filter_panel_filterChange_2_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onFilterChange()); })("resetFilters", function PromptManagementComponent_Conditional_1_Conditional_24_Template_mj_prompt_filter_panel_resetFilters_2_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onResetFilters()); })("closePanel", function PromptManagementComponent_Conditional_1_Conditional_24_Template_mj_prompt_filter_panel_closePanel_2_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.toggleFilterPanel()); });
193
- i0.ɵɵelementEnd()();
194
- i0.ɵɵelementStart(3, "kendo-splitter-pane", 26)(4, "div", 27);
195
- i0.ɵɵtemplate(5, PromptManagementComponent_Conditional_1_Conditional_24_Conditional_5_Template, 8, 1, "div", 28)(6, PromptManagementComponent_Conditional_1_Conditional_24_Conditional_6_Template, 4, 1, "div", 29)(7, PromptManagementComponent_Conditional_1_Conditional_24_Conditional_7_Template, 3, 1, "div", 30);
196
- i0.ɵɵelementEnd()()();
197
- } if (rf & 2) {
198
- const ctx_r1 = i0.ɵɵnextContext(2);
199
- i0.ɵɵadvance();
200
- i0.ɵɵproperty("size", ctx_r1.filterPanelVisible ? "320px" : "0px")("collapsible", false)("resizable", ctx_r1.filterPanelVisible)("scrollable", false)("hidden", !ctx_r1.filterPanelVisible);
201
- i0.ɵɵadvance();
202
- i0.ɵɵproperty("prompts", ctx_r1.promptsWithTemplates)("filteredPrompts", ctx_r1.filteredPrompts)("categories", ctx_r1.categories)("types", ctx_r1.types)("filters", ctx_r1.currentFilters);
203
- i0.ɵɵadvance();
204
- i0.ɵɵproperty("resizable", true)("scrollable", false);
205
- i0.ɵɵadvance(2);
206
- i0.ɵɵconditional(ctx_r1.isLoading ? 5 : -1);
207
- i0.ɵɵadvance();
208
- i0.ɵɵconditional(ctx_r1.error ? 6 : -1);
209
- i0.ɵɵadvance();
210
- i0.ɵɵconditional(!ctx_r1.isLoading && !ctx_r1.error ? 7 : -1);
211
- } }
212
- function PromptManagementComponent_Conditional_1_Conditional_25_Template(rf, ctx) { if (rf & 1) {
213
- const _r6 = i0.ɵɵgetCurrentView();
214
- i0.ɵɵelementStart(0, "app-model-prompt-priority-matrix", 65);
215
- i0.ɵɵlistener("promptSelected", function PromptManagementComponent_Conditional_1_Conditional_25_Template_app_model_prompt_priority_matrix_promptSelected_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onPromptSelectedFromMatrix($event)); });
216
- i0.ɵɵelementEnd();
217
- } if (rf & 2) {
218
- const ctx_r1 = i0.ɵɵnextContext(2);
219
- i0.ɵɵproperty("selectedPrompts", ctx_r1.promptsForMatrix);
220
- } }
221
- function PromptManagementComponent_Conditional_1_Conditional_26_Template(rf, ctx) { if (rf & 1) {
222
- const _r7 = i0.ɵɵgetCurrentView();
223
- i0.ɵɵelementStart(0, "app-prompt-version-control", 66);
224
- i0.ɵɵlistener("versionSelected", function PromptManagementComponent_Conditional_1_Conditional_26_Template_app_prompt_version_control_versionSelected_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onVersionSelected($event)); });
225
- i0.ɵɵelementEnd();
226
- } if (rf & 2) {
227
- const ctx_r1 = i0.ɵɵnextContext(2);
228
- i0.ɵɵproperty("prompt", (ctx_r1.selectedPrompt == null ? null : ctx_r1.selectedPrompt.prompt) || null);
229
- } }
230
- function PromptManagementComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
231
- const _r1 = i0.ɵɵgetCurrentView();
232
- i0.ɵɵelementStart(0, "div", 2)(1, "div", 4)(2, "div", 5)(3, "button", 6);
233
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_1_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.toggleFilterPanel()); });
234
- i0.ɵɵelement(4, "i", 7);
235
- i0.ɵɵtemplate(5, PromptManagementComponent_Conditional_1_Conditional_5_Template, 1, 0)(6, PromptManagementComponent_Conditional_1_Conditional_6_Template, 1, 0);
236
- i0.ɵɵelementEnd();
237
- i0.ɵɵelementStart(7, "span", 8);
238
- i0.ɵɵtext(8);
239
- i0.ɵɵelementEnd()();
240
- i0.ɵɵelementStart(9, "div", 9)(10, "button", 10);
241
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_1_Template_button_click_10_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.createNewPrompt()); });
242
- i0.ɵɵelement(11, "i", 11);
243
- i0.ɵɵtext(12, " New Prompt ");
244
- i0.ɵɵelementEnd()()();
245
- i0.ɵɵelementStart(13, "div", 12)(14, "button", 13);
246
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_1_Template_button_click_14_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.setSubView("list")); });
247
- i0.ɵɵelement(15, "i", 14);
248
- i0.ɵɵtext(16, " List View ");
249
- i0.ɵɵelementEnd();
250
- i0.ɵɵelementStart(17, "button", 15);
251
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_1_Template_button_click_17_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.setSubView("priority-matrix")); });
252
- i0.ɵɵelement(18, "i", 16);
253
- i0.ɵɵtext(19, " Priority Matrix ");
254
- i0.ɵɵelementEnd();
255
- i0.ɵɵelementStart(20, "button", 17);
256
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_1_Template_button_click_20_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.setSubView("version-control")); });
257
- i0.ɵɵelement(21, "i", 18);
258
- i0.ɵɵtext(22, " Version Control ");
259
- i0.ɵɵelementEnd()();
260
- i0.ɵɵelementStart(23, "div", 19);
261
- i0.ɵɵtemplate(24, PromptManagementComponent_Conditional_1_Conditional_24_Template, 8, 15, "kendo-splitter", 20)(25, PromptManagementComponent_Conditional_1_Conditional_25_Template, 1, 1, "app-model-prompt-priority-matrix", 21)(26, PromptManagementComponent_Conditional_1_Conditional_26_Template, 1, 1, "app-prompt-version-control", 22);
262
- i0.ɵɵelementEnd()();
263
- } if (rf & 2) {
264
- const ctx_r1 = i0.ɵɵnextContext();
265
- i0.ɵɵadvance(5);
266
- i0.ɵɵconditional(ctx_r1.filterPanelVisible ? 5 : 6);
267
- i0.ɵɵadvance(3);
268
- i0.ɵɵtextInterpolate1("", ctx_r1.filteredPrompts.length, " prompts");
269
- i0.ɵɵadvance(6);
270
- i0.ɵɵclassProp("active", ctx_r1.currentSubView === "list");
271
- i0.ɵɵadvance(3);
272
- i0.ɵɵclassProp("active", ctx_r1.currentSubView === "priority-matrix");
273
- i0.ɵɵadvance(3);
274
- i0.ɵɵclassProp("active", ctx_r1.currentSubView === "version-control");
275
- i0.ɵɵadvance(4);
276
- i0.ɵɵconditional(ctx_r1.currentSubView === "list" ? 24 : -1);
277
- i0.ɵɵadvance();
278
- i0.ɵɵconditional(ctx_r1.currentSubView === "priority-matrix" ? 25 : -1);
279
- i0.ɵɵadvance();
280
- i0.ɵɵconditional(ctx_r1.currentSubView === "version-control" ? 26 : -1);
281
- } }
282
- function PromptManagementComponent_Conditional_2_Conditional_8_Template(rf, ctx) { if (rf & 1) {
283
- i0.ɵɵelement(0, "i", 11);
284
- i0.ɵɵtext(1, " Create New Prompt ");
285
- } }
286
- function PromptManagementComponent_Conditional_2_Conditional_9_Template(rf, ctx) { if (rf & 1) {
287
- i0.ɵɵelement(0, "i", 59);
288
- i0.ɵɵtext(1, " Edit Prompt ");
289
- } }
290
- function PromptManagementComponent_Conditional_2_Conditional_10_Template(rf, ctx) { if (rf & 1) {
291
- i0.ɵɵelement(0, "i", 57);
292
- i0.ɵɵtext(1, " View Prompt ");
293
- } }
294
- function PromptManagementComponent_Conditional_2_Conditional_11_Template(rf, ctx) { if (rf & 1) {
295
- i0.ɵɵelementStart(0, "div");
296
- i0.ɵɵtext(1);
297
- i0.ɵɵelementEnd();
298
- } if (rf & 2) {
299
- const ctx_r1 = i0.ɵɵnextContext(2);
300
- i0.ɵɵclassMapInterpolate1("status-badge status-", ctx_r1.selectedPrompt.prompt.Status.toLowerCase(), "");
301
- i0.ɵɵadvance();
302
- i0.ɵɵtextInterpolate1(" ", ctx_r1.selectedPrompt.prompt.Status, " ");
303
- } }
304
- function PromptManagementComponent_Conditional_2_Conditional_13_Template(rf, ctx) { if (rf & 1) {
305
- const _r9 = i0.ɵɵgetCurrentView();
306
- i0.ɵɵelementStart(0, "button", 10);
307
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_2_Conditional_13_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r9); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.toggleEdit()); });
308
- i0.ɵɵelement(1, "i", 59);
309
- i0.ɵɵtext(2, " Edit ");
310
- i0.ɵɵelementEnd();
311
- } }
312
- function PromptManagementComponent_Conditional_2_Conditional_14_Conditional_4_Template(rf, ctx) { if (rf & 1) {
313
- i0.ɵɵelement(0, "span", 94);
314
- } }
315
- function PromptManagementComponent_Conditional_2_Conditional_14_Conditional_5_Template(rf, ctx) { if (rf & 1) {
316
- i0.ɵɵelement(0, "i", 95);
317
- } }
318
- function PromptManagementComponent_Conditional_2_Conditional_14_Template(rf, ctx) { if (rf & 1) {
319
- const _r10 = i0.ɵɵgetCurrentView();
320
- i0.ɵɵelementStart(0, "button", 10);
321
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_2_Conditional_14_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r10); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.toggleEdit()); });
322
- i0.ɵɵelement(1, "i", 92);
323
- i0.ɵɵtext(2, " Cancel ");
324
- i0.ɵɵelementEnd();
325
- i0.ɵɵelementStart(3, "button", 93);
326
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_2_Conditional_14_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r10); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.savePrompt()); });
327
- i0.ɵɵtemplate(4, PromptManagementComponent_Conditional_2_Conditional_14_Conditional_4_Template, 1, 0, "span", 94)(5, PromptManagementComponent_Conditional_2_Conditional_14_Conditional_5_Template, 1, 0, "i", 95);
328
- i0.ɵɵtext(6, " Save ");
329
- i0.ɵɵelementEnd();
330
- } if (rf & 2) {
331
- const ctx_r1 = i0.ɵɵnextContext(2);
332
- i0.ɵɵadvance(3);
333
- i0.ɵɵproperty("disabled", ctx_r1.isLoading);
334
- i0.ɵɵadvance();
335
- i0.ɵɵconditional(ctx_r1.isLoading ? 4 : 5);
336
- } }
337
- function PromptManagementComponent_Conditional_2_Conditional_24_Template(rf, ctx) { if (rf & 1) {
338
- const _r11 = i0.ɵɵgetCurrentView();
339
- i0.ɵɵelementStart(0, "input", 96);
340
- i0.ɵɵtwoWayListener("ngModelChange", function PromptManagementComponent_Conditional_2_Conditional_24_Template_input_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r11); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.selectedPrompt.prompt.Name, $event) || (ctx_r1.selectedPrompt.prompt.Name = $event); return i0.ɵɵresetView($event); });
341
- i0.ɵɵlistener("input", function PromptManagementComponent_Conditional_2_Conditional_24_Template_input_input_0_listener() { i0.ɵɵrestoreView(_r11); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.isDirty = true); });
342
- i0.ɵɵelementEnd();
343
- } if (rf & 2) {
344
- const ctx_r1 = i0.ɵɵnextContext(2);
345
- i0.ɵɵtwoWayProperty("ngModel", ctx_r1.selectedPrompt.prompt.Name);
346
- } }
347
- function PromptManagementComponent_Conditional_2_Conditional_25_Template(rf, ctx) { if (rf & 1) {
348
- i0.ɵɵelementStart(0, "div", 82);
349
- i0.ɵɵtext(1);
350
- i0.ɵɵelementEnd();
351
- } if (rf & 2) {
352
- const ctx_r1 = i0.ɵɵnextContext(2);
353
- i0.ɵɵadvance();
354
- i0.ɵɵtextInterpolate(ctx_r1.selectedPrompt.prompt.Name);
355
- } }
356
- function PromptManagementComponent_Conditional_2_Conditional_29_Template(rf, ctx) { if (rf & 1) {
357
- const _r12 = i0.ɵɵgetCurrentView();
358
- i0.ɵɵelementStart(0, "textarea", 97);
359
- i0.ɵɵtwoWayListener("ngModelChange", function PromptManagementComponent_Conditional_2_Conditional_29_Template_textarea_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.selectedPrompt.prompt.Description, $event) || (ctx_r1.selectedPrompt.prompt.Description = $event); return i0.ɵɵresetView($event); });
360
- i0.ɵɵlistener("input", function PromptManagementComponent_Conditional_2_Conditional_29_Template_textarea_input_0_listener() { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.isDirty = true); });
361
- i0.ɵɵelementEnd();
362
- } if (rf & 2) {
363
- const ctx_r1 = i0.ɵɵnextContext(2);
364
- i0.ɵɵtwoWayProperty("ngModel", ctx_r1.selectedPrompt.prompt.Description);
365
- } }
366
- function PromptManagementComponent_Conditional_2_Conditional_30_Template(rf, ctx) { if (rf & 1) {
367
- i0.ɵɵelementStart(0, "div", 82);
368
- i0.ɵɵtext(1);
369
- i0.ɵɵelementEnd();
370
- } if (rf & 2) {
371
- const ctx_r1 = i0.ɵɵnextContext(2);
372
- i0.ɵɵadvance();
373
- i0.ɵɵtextInterpolate1(" ", ctx_r1.selectedPrompt.prompt.Description || "No description provided", " ");
374
- } }
375
- function PromptManagementComponent_Conditional_2_Conditional_34_Conditional_0_For_4_Template(rf, ctx) { if (rf & 1) {
376
- i0.ɵɵelementStart(0, "option", 101);
377
- i0.ɵɵtext(1);
378
- i0.ɵɵelementEnd();
379
- } if (rf & 2) {
380
- const category_r14 = ctx.$implicit;
381
- i0.ɵɵproperty("value", category_r14.ID);
382
- i0.ɵɵadvance();
383
- i0.ɵɵtextInterpolate(category_r14.Name);
384
- } }
385
- function PromptManagementComponent_Conditional_2_Conditional_34_Conditional_0_Template(rf, ctx) { if (rf & 1) {
386
- const _r13 = i0.ɵɵgetCurrentView();
387
- i0.ɵɵelementStart(0, "select", 99);
388
- i0.ɵɵtwoWayListener("ngModelChange", function PromptManagementComponent_Conditional_2_Conditional_34_Conditional_0_Template_select_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r1 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r1.selectedPrompt.prompt.CategoryID, $event) || (ctx_r1.selectedPrompt.prompt.CategoryID = $event); return i0.ɵɵresetView($event); });
389
- i0.ɵɵlistener("ngModelChange", function PromptManagementComponent_Conditional_2_Conditional_34_Conditional_0_Template_select_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onCategoryChange($event)); });
390
- i0.ɵɵelementStart(1, "option", 100);
391
- i0.ɵɵtext(2, "Select category...");
392
- i0.ɵɵelementEnd();
393
- i0.ɵɵrepeaterCreate(3, PromptManagementComponent_Conditional_2_Conditional_34_Conditional_0_For_4_Template, 2, 2, "option", 101, _forTrack1);
394
- i0.ɵɵelementStart(5, "option", 102);
395
- i0.ɵɵtext(6, "+ Create New Category");
396
- i0.ɵɵelementEnd()();
397
- } if (rf & 2) {
398
- const ctx_r1 = i0.ɵɵnextContext(3);
399
- i0.ɵɵtwoWayProperty("ngModel", ctx_r1.selectedPrompt.prompt.CategoryID);
400
- i0.ɵɵadvance(3);
401
- i0.ɵɵrepeater(ctx_r1.categories);
402
- } }
403
- function PromptManagementComponent_Conditional_2_Conditional_34_Conditional_1_Template(rf, ctx) { if (rf & 1) {
404
- const _r15 = i0.ɵɵgetCurrentView();
405
- i0.ɵɵelementStart(0, "div", 98)(1, "input", 103, 0);
406
- i0.ɵɵtwoWayListener("ngModelChange", function PromptManagementComponent_Conditional_2_Conditional_34_Conditional_1_Template_input_ngModelChange_1_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r1.newCategoryName, $event) || (ctx_r1.newCategoryName = $event); return i0.ɵɵresetView($event); });
407
- i0.ɵɵlistener("keyup", function PromptManagementComponent_Conditional_2_Conditional_34_Conditional_1_Template_input_keyup_1_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onCreateNewCategoryKeyup($event)); });
408
- i0.ɵɵelementEnd();
409
- i0.ɵɵelementStart(3, "div", 104)(4, "button", 58);
410
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_2_Conditional_34_Conditional_1_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.createAndSelectNewCategory()); });
411
- i0.ɵɵelement(5, "i", 105);
412
- i0.ɵɵelementEnd();
413
- i0.ɵɵelementStart(6, "button", 56);
414
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_2_Conditional_34_Conditional_1_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.cancelNewCategory()); });
415
- i0.ɵɵelement(7, "i", 92);
416
- i0.ɵɵelementEnd()()();
417
- } if (rf & 2) {
418
- const ctx_r1 = i0.ɵɵnextContext(3);
419
- i0.ɵɵadvance();
420
- i0.ɵɵtwoWayProperty("ngModel", ctx_r1.newCategoryName);
421
- } }
422
- function PromptManagementComponent_Conditional_2_Conditional_34_Template(rf, ctx) { if (rf & 1) {
423
- i0.ɵɵtemplate(0, PromptManagementComponent_Conditional_2_Conditional_34_Conditional_0_Template, 7, 1, "select", 84)(1, PromptManagementComponent_Conditional_2_Conditional_34_Conditional_1_Template, 8, 1, "div", 98);
424
- } if (rf & 2) {
425
- const ctx_r1 = i0.ɵɵnextContext(2);
426
- i0.ɵɵconditional(!ctx_r1.showNewCategoryInput ? 0 : 1);
427
- } }
428
- function PromptManagementComponent_Conditional_2_Conditional_35_Template(rf, ctx) { if (rf & 1) {
429
- i0.ɵɵelementStart(0, "div", 82);
430
- i0.ɵɵtext(1);
431
- i0.ɵɵelementEnd();
432
- } if (rf & 2) {
433
- const ctx_r1 = i0.ɵɵnextContext(2);
434
- i0.ɵɵadvance();
435
- i0.ɵɵtextInterpolate1(" ", ctx_r1.getCategoryName(ctx_r1.selectedPrompt.prompt.CategoryID), " ");
436
- } }
437
- function PromptManagementComponent_Conditional_2_Conditional_39_For_4_Template(rf, ctx) { if (rf & 1) {
438
- i0.ɵɵelementStart(0, "option", 101);
439
- i0.ɵɵtext(1);
440
- i0.ɵɵelementEnd();
441
- } if (rf & 2) {
442
- const type_r17 = ctx.$implicit;
443
- i0.ɵɵproperty("value", type_r17.ID);
444
- i0.ɵɵadvance();
445
- i0.ɵɵtextInterpolate(type_r17.Name);
446
- } }
447
- function PromptManagementComponent_Conditional_2_Conditional_39_Template(rf, ctx) { if (rf & 1) {
448
- const _r16 = i0.ɵɵgetCurrentView();
449
- i0.ɵɵelementStart(0, "select", 106);
450
- i0.ɵɵtwoWayListener("ngModelChange", function PromptManagementComponent_Conditional_2_Conditional_39_Template_select_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r16); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.selectedPrompt.prompt.TypeID, $event) || (ctx_r1.selectedPrompt.prompt.TypeID = $event); return i0.ɵɵresetView($event); });
451
- i0.ɵɵlistener("change", function PromptManagementComponent_Conditional_2_Conditional_39_Template_select_change_0_listener() { i0.ɵɵrestoreView(_r16); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.isDirty = true); });
452
- i0.ɵɵelementStart(1, "option", 100);
453
- i0.ɵɵtext(2, "Select type...");
454
- i0.ɵɵelementEnd();
455
- i0.ɵɵrepeaterCreate(3, PromptManagementComponent_Conditional_2_Conditional_39_For_4_Template, 2, 2, "option", 101, _forTrack1);
456
- i0.ɵɵelementEnd();
457
- } if (rf & 2) {
458
- const ctx_r1 = i0.ɵɵnextContext(2);
459
- i0.ɵɵtwoWayProperty("ngModel", ctx_r1.selectedPrompt.prompt.TypeID);
460
- i0.ɵɵadvance(3);
461
- i0.ɵɵrepeater(ctx_r1.types);
462
- } }
463
- function PromptManagementComponent_Conditional_2_Conditional_40_Template(rf, ctx) { if (rf & 1) {
464
- i0.ɵɵelementStart(0, "div", 82);
465
- i0.ɵɵtext(1);
466
- i0.ɵɵelementEnd();
467
- } if (rf & 2) {
468
- const ctx_r1 = i0.ɵɵnextContext(2);
469
- i0.ɵɵadvance();
470
- i0.ɵɵtextInterpolate1(" ", ctx_r1.getTypeName(ctx_r1.selectedPrompt.prompt.TypeID), " ");
471
- } }
472
- function PromptManagementComponent_Conditional_2_Conditional_44_Template(rf, ctx) { if (rf & 1) {
473
- const _r18 = i0.ɵɵgetCurrentView();
474
- i0.ɵɵelementStart(0, "select", 106);
475
- i0.ɵɵtwoWayListener("ngModelChange", function PromptManagementComponent_Conditional_2_Conditional_44_Template_select_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r18); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.selectedPrompt.prompt.Status, $event) || (ctx_r1.selectedPrompt.prompt.Status = $event); return i0.ɵɵresetView($event); });
476
- i0.ɵɵlistener("change", function PromptManagementComponent_Conditional_2_Conditional_44_Template_select_change_0_listener() { i0.ɵɵrestoreView(_r18); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.isDirty = true); });
477
- i0.ɵɵelementStart(1, "option", 107);
478
- i0.ɵɵtext(2, "Active");
479
- i0.ɵɵelementEnd();
480
- i0.ɵɵelementStart(3, "option", 108);
481
- i0.ɵɵtext(4, "Pending");
482
- i0.ɵɵelementEnd();
483
- i0.ɵɵelementStart(5, "option", 109);
484
- i0.ɵɵtext(6, "Disabled");
485
- i0.ɵɵelementEnd()();
486
- } if (rf & 2) {
487
- const ctx_r1 = i0.ɵɵnextContext(2);
488
- i0.ɵɵtwoWayProperty("ngModel", ctx_r1.selectedPrompt.prompt.Status);
489
- } }
490
- function PromptManagementComponent_Conditional_2_Conditional_45_Template(rf, ctx) { if (rf & 1) {
491
- i0.ɵɵelementStart(0, "div", 82)(1, "span");
492
- i0.ɵɵtext(2);
493
- i0.ɵɵelementEnd()();
494
- } if (rf & 2) {
495
- const ctx_r1 = i0.ɵɵnextContext(2);
496
- i0.ɵɵadvance();
497
- i0.ɵɵclassMapInterpolate1("status-badge status-", ctx_r1.selectedPrompt.prompt.Status.toLowerCase(), "");
498
- i0.ɵɵadvance();
499
- i0.ɵɵtextInterpolate1(" ", ctx_r1.selectedPrompt.prompt.Status, " ");
500
- } }
501
- function PromptManagementComponent_Conditional_2_Conditional_46_Conditional_8_Template(rf, ctx) { if (rf & 1) {
502
- i0.ɵɵelementStart(0, "div")(1, "strong");
503
- i0.ɵɵtext(2, "Description:");
504
- i0.ɵɵelementEnd();
505
- i0.ɵɵtext(3);
506
- i0.ɵɵelementEnd();
507
- } if (rf & 2) {
508
- const ctx_r1 = i0.ɵɵnextContext(3);
509
- i0.ɵɵadvance(3);
510
- i0.ɵɵtextInterpolate1(" ", ctx_r1.selectedPrompt.template.Description, "");
511
- } }
512
- function PromptManagementComponent_Conditional_2_Conditional_46_Conditional_9_Template(rf, ctx) { if (rf & 1) {
513
- i0.ɵɵelementStart(0, "div")(1, "strong");
514
- i0.ɵɵtext(2, "Content Length:");
515
- i0.ɵɵelementEnd();
516
- i0.ɵɵtext(3);
517
- i0.ɵɵelementEnd();
518
- } if (rf & 2) {
519
- const ctx_r1 = i0.ɵɵnextContext(3);
520
- i0.ɵɵadvance(3);
521
- i0.ɵɵtextInterpolate1(" ", (ctx_r1.selectedPrompt.templateContent.TemplateText || "").length, " characters");
522
- } }
523
- function PromptManagementComponent_Conditional_2_Conditional_46_Template(rf, ctx) { if (rf & 1) {
524
- i0.ɵɵelementStart(0, "div", 85)(1, "h4");
525
- i0.ɵɵtext(2, "Template Information");
526
- i0.ɵɵelementEnd();
527
- i0.ɵɵelementStart(3, "div", 110)(4, "div")(5, "strong");
528
- i0.ɵɵtext(6, "Template:");
529
- i0.ɵɵelementEnd();
530
- i0.ɵɵtext(7);
531
- i0.ɵɵelementEnd();
532
- i0.ɵɵtemplate(8, PromptManagementComponent_Conditional_2_Conditional_46_Conditional_8_Template, 4, 1, "div")(9, PromptManagementComponent_Conditional_2_Conditional_46_Conditional_9_Template, 4, 1, "div");
533
- i0.ɵɵelementEnd()();
534
- } if (rf & 2) {
535
- const ctx_r1 = i0.ɵɵnextContext(2);
536
- i0.ɵɵadvance(7);
537
- i0.ɵɵtextInterpolate1(" ", ctx_r1.selectedPrompt.template.Name, "");
538
- i0.ɵɵadvance();
539
- i0.ɵɵconditional(ctx_r1.selectedPrompt.template.Description ? 8 : -1);
540
- i0.ɵɵadvance();
541
- i0.ɵɵconditional(ctx_r1.selectedPrompt.templateContent ? 9 : -1);
542
- } }
543
- function PromptManagementComponent_Conditional_2_Conditional_53_Conditional_2_Template(rf, ctx) { if (rf & 1) {
544
- i0.ɵɵelementStart(0, "span", 112);
545
- i0.ɵɵtext(1, "Unsaved Changes");
546
- i0.ɵɵelementEnd();
547
- } }
548
- function PromptManagementComponent_Conditional_2_Conditional_53_Template(rf, ctx) { if (rf & 1) {
549
- i0.ɵɵelementStart(0, "span", 111);
550
- i0.ɵɵtext(1, "Nunjucks Template");
551
- i0.ɵɵelementEnd();
552
- i0.ɵɵtemplate(2, PromptManagementComponent_Conditional_2_Conditional_53_Conditional_2_Template, 2, 0, "span", 112);
553
- } if (rf & 2) {
554
- const ctx_r1 = i0.ɵɵnextContext(2);
555
- i0.ɵɵadvance(2);
556
- i0.ɵɵconditional(ctx_r1.isDirty ? 2 : -1);
557
- } }
558
- function PromptManagementComponent_Conditional_2_Conditional_54_Template(rf, ctx) { if (rf & 1) {
559
- i0.ɵɵelementStart(0, "span", 88);
560
- i0.ɵɵtext(1, "Read Only");
561
- i0.ɵɵelementEnd();
562
- } }
563
- function PromptManagementComponent_Conditional_2_Conditional_57_Template(rf, ctx) { if (rf & 1) {
564
- i0.ɵɵelementStart(0, "div", 91)(1, "div", 113)(2, "h5");
565
- i0.ɵɵtext(3, "Nunjucks Template Syntax");
566
- i0.ɵɵelementEnd();
567
- i0.ɵɵelementStart(4, "div", 114)(5, "div", 115)(6, "code");
568
- i0.ɵɵtext(7);
569
- i0.ɵɵelementEnd();
570
- i0.ɵɵtext(8, " - Variable output ");
571
- i0.ɵɵelementEnd();
572
- i0.ɵɵelementStart(9, "div", 115)(10, "code");
573
- i0.ɵɵtext(11);
574
- i0.ɵɵelementEnd();
575
- i0.ɵɵtext(12, " - Conditionals ");
576
- i0.ɵɵelementEnd();
577
- i0.ɵɵelementStart(13, "div", 115)(14, "code");
578
- i0.ɵɵtext(15);
579
- i0.ɵɵelementEnd();
580
- i0.ɵɵtext(16, " - Loops ");
581
- i0.ɵɵelementEnd()()()();
582
- } if (rf & 2) {
583
- i0.ɵɵadvance(7);
584
- i0.ɵɵtextInterpolate("{{ variable }}");
585
- i0.ɵɵadvance(4);
586
- i0.ɵɵtextInterpolate("{% if condition %} ... {% endif %}");
587
- i0.ɵɵadvance(4);
588
- i0.ɵɵtextInterpolate("{% for item in items %} ... {% endfor %}");
589
- } }
590
- function PromptManagementComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
591
- const _r8 = i0.ɵɵgetCurrentView();
592
- i0.ɵɵelementStart(0, "div", 3)(1, "div", 67)(2, "div", 68)(3, "button", 69);
593
- i0.ɵɵlistener("click", function PromptManagementComponent_Conditional_2_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.backToList()); });
594
- i0.ɵɵelement(4, "i", 70);
595
- i0.ɵɵtext(5, " Back to Prompts ");
596
- i0.ɵɵelementEnd()();
597
- i0.ɵɵelementStart(6, "div", 71)(7, "h2");
598
- i0.ɵɵtemplate(8, PromptManagementComponent_Conditional_2_Conditional_8_Template, 2, 0)(9, PromptManagementComponent_Conditional_2_Conditional_9_Template, 2, 0)(10, PromptManagementComponent_Conditional_2_Conditional_10_Template, 2, 0);
599
- i0.ɵɵelementEnd();
600
- i0.ɵɵtemplate(11, PromptManagementComponent_Conditional_2_Conditional_11_Template, 2, 4, "div", 72);
601
- i0.ɵɵelementEnd();
602
- i0.ɵɵelementStart(12, "div", 73);
603
- i0.ɵɵtemplate(13, PromptManagementComponent_Conditional_2_Conditional_13_Template, 3, 0, "button", 74)(14, PromptManagementComponent_Conditional_2_Conditional_14_Template, 7, 2);
604
- i0.ɵɵelementEnd()();
605
- i0.ɵɵelementStart(15, "div", 75)(16, "kendo-splitter", 76);
606
- i0.ɵɵlistener("layoutChange", function PromptManagementComponent_Conditional_2_Template_kendo_splitter_layoutChange_16_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onEditorSplitterChange($event)); });
607
- i0.ɵɵelementStart(17, "kendo-splitter-pane", 77)(18, "div", 78)(19, "h3");
608
- i0.ɵɵtext(20, "Prompt Details");
609
- i0.ɵɵelementEnd();
610
- i0.ɵɵelementStart(21, "div", 79)(22, "label", 80);
611
- i0.ɵɵtext(23, "Name *");
612
- i0.ɵɵelementEnd();
613
- i0.ɵɵtemplate(24, PromptManagementComponent_Conditional_2_Conditional_24_Template, 1, 1, "input", 81)(25, PromptManagementComponent_Conditional_2_Conditional_25_Template, 2, 1, "div", 82);
614
- i0.ɵɵelementEnd();
615
- i0.ɵɵelementStart(26, "div", 79)(27, "label", 80);
616
- i0.ɵɵtext(28, "Description");
617
- i0.ɵɵelementEnd();
618
- i0.ɵɵtemplate(29, PromptManagementComponent_Conditional_2_Conditional_29_Template, 1, 1, "textarea", 83)(30, PromptManagementComponent_Conditional_2_Conditional_30_Template, 2, 1, "div", 82);
619
- i0.ɵɵelementEnd();
620
- i0.ɵɵelementStart(31, "div", 79)(32, "label", 80);
621
- i0.ɵɵtext(33, "Category");
622
- i0.ɵɵelementEnd();
623
- i0.ɵɵtemplate(34, PromptManagementComponent_Conditional_2_Conditional_34_Template, 2, 1)(35, PromptManagementComponent_Conditional_2_Conditional_35_Template, 2, 1, "div", 82);
624
- i0.ɵɵelementEnd();
625
- i0.ɵɵelementStart(36, "div", 79)(37, "label", 80);
626
- i0.ɵɵtext(38, "Type");
627
- i0.ɵɵelementEnd();
628
- i0.ɵɵtemplate(39, PromptManagementComponent_Conditional_2_Conditional_39_Template, 5, 1, "select", 84)(40, PromptManagementComponent_Conditional_2_Conditional_40_Template, 2, 1, "div", 82);
629
- i0.ɵɵelementEnd();
630
- i0.ɵɵelementStart(41, "div", 79)(42, "label", 80);
631
- i0.ɵɵtext(43, "Status");
632
- i0.ɵɵelementEnd();
633
- i0.ɵɵtemplate(44, PromptManagementComponent_Conditional_2_Conditional_44_Template, 7, 1, "select", 84)(45, PromptManagementComponent_Conditional_2_Conditional_45_Template, 3, 4, "div", 82);
634
- i0.ɵɵelementEnd();
635
- i0.ɵɵtemplate(46, PromptManagementComponent_Conditional_2_Conditional_46_Template, 10, 3, "div", 85);
636
- i0.ɵɵelementEnd()();
637
- i0.ɵɵelementStart(47, "kendo-splitter-pane", 26)(48, "div", 86)(49, "div", 67)(50, "h3");
638
- i0.ɵɵtext(51, "Template Content");
639
- i0.ɵɵelementEnd();
640
- i0.ɵɵelementStart(52, "div", 87);
641
- i0.ɵɵtemplate(53, PromptManagementComponent_Conditional_2_Conditional_53_Template, 3, 1)(54, PromptManagementComponent_Conditional_2_Conditional_54_Template, 2, 0, "span", 88);
642
- i0.ɵɵelementEnd()();
643
- i0.ɵɵelementStart(55, "div", 89)(56, "mj-code-editor", 90);
644
- i0.ɵɵlistener("change", function PromptManagementComponent_Conditional_2_Template_mj_code_editor_change_56_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onEditorContentChange($event)); });
645
- i0.ɵɵelementEnd()();
646
- i0.ɵɵtemplate(57, PromptManagementComponent_Conditional_2_Conditional_57_Template, 17, 3, "div", 91);
647
- i0.ɵɵelementEnd()()()()();
648
- } if (rf & 2) {
649
- const ctx_r1 = i0.ɵɵnextContext();
650
- i0.ɵɵadvance(8);
651
- i0.ɵɵconditional(ctx_r1.isEditing && !ctx_r1.selectedPrompt.prompt.ID ? 8 : ctx_r1.isEditing ? 9 : 10);
652
- i0.ɵɵadvance(3);
653
- i0.ɵɵconditional(ctx_r1.selectedPrompt.prompt.ID ? 11 : -1);
654
- i0.ɵɵadvance(2);
655
- i0.ɵɵconditional(!ctx_r1.isEditing ? 13 : 14);
656
- i0.ɵɵadvance(4);
657
- i0.ɵɵproperty("collapsible", false)("resizable", true)("scrollable", true);
658
- i0.ɵɵadvance(7);
659
- i0.ɵɵconditional(ctx_r1.isEditing ? 24 : 25);
660
- i0.ɵɵadvance(5);
661
- i0.ɵɵconditional(ctx_r1.isEditing ? 29 : 30);
662
- i0.ɵɵadvance(5);
663
- i0.ɵɵconditional(ctx_r1.isEditing ? 34 : 35);
664
- i0.ɵɵadvance(5);
665
- i0.ɵɵconditional(ctx_r1.isEditing ? 39 : 40);
666
- i0.ɵɵadvance(5);
667
- i0.ɵɵconditional(ctx_r1.isEditing ? 44 : 45);
668
- i0.ɵɵadvance(2);
669
- i0.ɵɵconditional(ctx_r1.selectedPrompt.template ? 46 : -1);
670
- i0.ɵɵadvance();
671
- i0.ɵɵproperty("resizable", true)("scrollable", true);
672
- i0.ɵɵadvance(6);
673
- i0.ɵɵconditional(ctx_r1.isEditing ? 53 : 54);
674
- i0.ɵɵadvance(3);
675
- i0.ɵɵproperty("value", ctx_r1.editorContent)("languages", ctx_r1.supportedLanguages)("language", ctx_r1.editorLanguage)("placeholder", "Enter your Nunjucks template here...")("lineWrapping", true)("highlightWhitespace", false)("indentWithTab", true)("indentUnit", " ")("readonly", !ctx_r1.isEditing);
676
- i0.ɵɵadvance();
677
- i0.ɵɵconditional(ctx_r1.isEditing ? 57 : -1);
678
- } }
679
- export class PromptManagementComponent {
680
- mjNotificationsService;
681
- openEntityRecord = new EventEmitter();
682
- stateChange = new EventEmitter();
683
- // Data properties
684
- prompts = [];
685
- categories = [];
686
- types = [];
687
- templates = [];
688
- templateContents = [];
689
- promptsWithTemplates = [];
690
- filteredPrompts = [];
691
- // UI state
692
- isLoading = false;
693
- loadingMessage = 'Loading prompts...';
694
- error = null;
695
- currentView = 'list';
696
- currentSubView = 'list';
697
- selectedPrompt = null;
698
- isEditing = false;
699
- isDirty = false;
700
- // Editor state
701
- editorContent = '';
702
- editorMode = 'nunjucks';
703
- showPreview = false;
704
- supportedLanguages = languages;
705
- editorLanguage = 'jinja2';
706
- // Category creation
707
- newCategoryName = '';
708
- showNewCategoryInput = false;
709
- // Splitter panel width
710
- promptDetailsPanelWidth = 300;
711
- // Filter panel visibility
712
- filterPanelVisible = true;
713
- // Current filters object for the filter panel
714
- currentFilters = {
715
- searchTerm: '',
716
- categoryId: 'all',
717
- typeId: 'all',
718
- status: 'all'
719
- };
720
- // Filter state
721
- searchTerm$ = new BehaviorSubject('');
722
- selectedCategory$ = new BehaviorSubject('all');
723
- selectedType$ = new BehaviorSubject('all');
724
- selectedStatus$ = new BehaviorSubject('all');
725
- categoryOptions = [];
726
- typeOptions = [];
727
- statusOptions = [
728
- { text: 'All Statuses', value: 'all' },
729
- { text: 'Active', value: 'Active' },
730
- { text: 'Pending', value: 'Pending' },
731
- { text: 'Disabled', value: 'Disabled' }
732
- ];
733
- destroy$ = new Subject();
734
- constructor(mjNotificationsService) {
735
- this.mjNotificationsService = mjNotificationsService;
736
- }
737
- toggleFilterPanel() {
738
- this.filterPanelVisible = !this.filterPanelVisible;
739
- this.emitStateChange();
740
- }
741
- onMainSplitterChange(event) {
742
- // Handle main splitter layout changes if needed
743
- this.emitStateChange();
744
- }
745
- onFiltersChange(filters) {
746
- this.currentFilters = { ...filters };
747
- // Update the BehaviorSubjects to match the filter panel
748
- this.searchTerm$.next(filters.searchTerm);
749
- this.selectedCategory$.next(filters.categoryId);
750
- this.selectedType$.next(filters.typeId);
751
- this.selectedStatus$.next(filters.status);
752
- }
753
- onFilterChange() {
754
- // This will be called by the filter panel, filtering is handled by existing logic
755
- }
756
- onResetFilters() {
757
- this.currentFilters = {
758
- searchTerm: '',
759
- categoryId: 'all',
760
- typeId: 'all',
761
- status: 'all'
762
- };
763
- this.searchTerm$.next('');
764
- this.selectedCategory$.next('all');
765
- this.selectedType$.next('all');
766
- this.selectedStatus$.next('all');
767
- }
768
- ngOnInit() {
769
- this.setupFilters();
770
- this.loadData();
771
- }
772
- ngOnDestroy() {
773
- this.destroy$.next();
774
- this.destroy$.complete();
775
- }
776
- setupFilters() {
777
- combineLatest([
778
- this.searchTerm$.pipe(debounceTime(300), distinctUntilChanged()),
779
- this.selectedCategory$.pipe(distinctUntilChanged()),
780
- this.selectedType$.pipe(distinctUntilChanged()),
781
- this.selectedStatus$.pipe(distinctUntilChanged())
782
- ]).pipe(takeUntil(this.destroy$)).subscribe(() => {
783
- this.applyFilters();
784
- });
785
- }
786
- async loadData() {
787
- try {
788
- this.isLoading = true;
789
- this.error = null;
790
- this.loadingMessage = 'Loading prompts and templates...';
791
- const [prompts, categories, types, templates, templateContents] = await Promise.all([
792
- this.loadPrompts(),
793
- this.loadCategories(),
794
- this.loadTypes(),
795
- this.loadTemplates(),
796
- this.loadTemplateContents()
797
- ]);
798
- this.prompts = prompts;
799
- this.categories = categories;
800
- this.types = types;
801
- this.templates = templates;
802
- this.templateContents = templateContents;
803
- this.buildPromptTemplateRelationships();
804
- this.buildFilterOptions();
805
- this.applyFilters();
806
- LogStatus('Prompt management data loaded successfully');
807
- }
808
- catch (error) {
809
- this.error = 'Failed to load prompt data. Please try again.';
810
- LogError('Error loading prompt management data', undefined, error);
811
- }
812
- finally {
813
- this.isLoading = false;
814
- }
815
- }
816
- async loadPrompts() {
817
- const rv = new RunView();
818
- const result = await rv.RunView({
819
- EntityName: 'AI Prompts',
820
- ExtraFilter: '',
821
- OrderBy: 'Name',
822
- UserSearchString: '',
823
- IgnoreMaxRows: false,
824
- MaxRows: 1000
825
- });
826
- if (result && result.Success && result.Results) {
827
- return result.Results;
828
- }
829
- else {
830
- throw new Error('Failed to load AI prompts');
831
- }
832
- }
833
- async loadCategories() {
834
- const rv = new RunView();
835
- const result = await rv.RunView({
836
- EntityName: 'AI Prompt Categories',
837
- ExtraFilter: '',
838
- OrderBy: 'Name',
839
- UserSearchString: '',
840
- IgnoreMaxRows: false,
841
- MaxRows: 1000
842
- });
843
- if (result && result.Success && result.Results) {
844
- return result.Results;
845
- }
846
- else {
847
- throw new Error('Failed to load AI prompt categories');
848
- }
849
- }
850
- async loadTypes() {
851
- const rv = new RunView();
852
- const result = await rv.RunView({
853
- EntityName: 'AI Prompt Types',
854
- ExtraFilter: '',
855
- OrderBy: 'Name',
856
- UserSearchString: '',
857
- IgnoreMaxRows: false,
858
- MaxRows: 1000
859
- });
860
- if (result && result.Success && result.Results) {
861
- return result.Results;
862
- }
863
- else {
864
- throw new Error('Failed to load AI prompt types');
865
- }
866
- }
867
- async loadTemplates() {
868
- const rv = new RunView();
869
- const result = await rv.RunView({
870
- EntityName: 'Templates',
871
- ExtraFilter: '',
872
- OrderBy: 'Name',
873
- UserSearchString: '',
874
- IgnoreMaxRows: false,
875
- MaxRows: 1000
876
- });
877
- if (result && result.Success && result.Results) {
878
- return result.Results;
879
- }
880
- else {
881
- throw new Error('Failed to load templates');
882
- }
883
- }
884
- async loadTemplateContents() {
885
- const rv = new RunView();
886
- const result = await rv.RunView({
887
- EntityName: 'Template Contents',
888
- ExtraFilter: '',
889
- OrderBy: 'TemplateID',
890
- UserSearchString: '',
891
- IgnoreMaxRows: false,
892
- MaxRows: 1000
893
- });
894
- if (result && result.Success && result.Results) {
895
- return result.Results;
896
- }
897
- else {
898
- throw new Error('Failed to load template contents');
899
- }
900
- }
901
- buildPromptTemplateRelationships() {
902
- this.promptsWithTemplates = this.prompts.map(prompt => {
903
- const template = this.templates.find(t => t.ID === prompt.TemplateID) || null;
904
- const templateContent = template ?
905
- this.templateContents.find(tc => tc.TemplateID === template.ID) || null : null;
906
- const category = this.categories.find(c => c.ID === prompt.CategoryID) || null;
907
- const type = this.types.find(t => t.ID === prompt.TypeID) || null;
908
- return {
909
- prompt,
910
- template,
911
- templateContent,
912
- category,
913
- type
914
- };
915
- });
916
- }
917
- buildFilterOptions() {
918
- this.categoryOptions = [
919
- { text: 'All Categories', value: 'all' },
920
- ...this.categories.map(cat => ({ text: cat.Name, value: cat.ID }))
921
- ];
922
- this.typeOptions = [
923
- { text: 'All Types', value: 'all' },
924
- ...this.types.map(type => ({ text: type.Name, value: type.ID }))
925
- ];
926
- }
927
- applyFilters() {
928
- let filtered = [...this.promptsWithTemplates];
929
- // Apply search filter
930
- const searchTerm = this.searchTerm$.value.toLowerCase();
931
- if (searchTerm) {
932
- filtered = filtered.filter(item => item.prompt.Name.toLowerCase().includes(searchTerm) ||
933
- (item.prompt.Description || '').toLowerCase().includes(searchTerm) ||
934
- (item.category?.Name || '').toLowerCase().includes(searchTerm) ||
935
- (item.template?.Name || '').toLowerCase().includes(searchTerm));
936
- }
937
- // Apply category filter
938
- const categoryId = this.selectedCategory$.value;
939
- if (categoryId !== 'all') {
940
- filtered = filtered.filter(item => item.prompt.CategoryID === categoryId);
941
- }
942
- // Apply type filter
943
- const typeId = this.selectedType$.value;
944
- if (typeId !== 'all') {
945
- filtered = filtered.filter(item => item.prompt.TypeID === typeId);
946
- }
947
- // Apply status filter
948
- const status = this.selectedStatus$.value;
949
- if (status !== 'all') {
950
- filtered = filtered.filter(item => item.prompt.Status === status);
951
- }
952
- this.filteredPrompts = filtered;
953
- }
954
- // Event handlers
955
- onSearchChange(searchTerm) {
956
- this.searchTerm$.next(searchTerm);
957
- }
958
- onCategoryFilterChange(categoryId) {
959
- this.selectedCategory$.next(categoryId);
960
- }
961
- onTypeFilterChange(typeId) {
962
- this.selectedType$.next(typeId);
963
- }
964
- onStatusFilterChange(status) {
965
- this.selectedStatus$.next(status);
966
- }
967
- // Navigation methods
968
- viewPrompt(promptWithTemplate) {
969
- this.selectedPrompt = promptWithTemplate;
970
- this.currentView = 'editor';
971
- this.isEditing = false;
972
- this.isDirty = false;
973
- this.editorContent = promptWithTemplate.templateContent?.TemplateText || '';
974
- this.emitStateChange();
975
- }
976
- editPrompt(promptWithTemplate) {
977
- this.selectedPrompt = promptWithTemplate;
978
- this.currentView = 'editor';
979
- this.isEditing = true;
980
- this.isDirty = false;
981
- this.editorContent = promptWithTemplate.templateContent?.TemplateText || '';
982
- this.emitStateChange();
983
- }
984
- async createNewCategory() {
985
- if (!this.newCategoryName.trim())
986
- return null;
987
- try {
988
- const md = new Metadata();
989
- if (!md)
990
- throw new Error('Metadata provider not available');
991
- const category = await md.GetEntityObject('AI Prompt Categories', md.CurrentUser);
992
- category.Name = this.newCategoryName.trim();
993
- category.Description = 'Category created during prompt editing';
994
- const result = await category.Save();
995
- if (result) {
996
- LogStatus('Category created successfully');
997
- this.mjNotificationsService.CreateSimpleNotification('Category created successfully', 'success', 2000);
998
- await this.loadCategories();
999
- this.buildFilterOptions();
1000
- // Update filter panel categories
1001
- this.updateFilterPanelCategories();
1002
- this.newCategoryName = '';
1003
- this.showNewCategoryInput = false;
1004
- return category.ID;
1005
- }
1006
- else {
1007
- // Handle save failure
1008
- const errorMessage = category.LatestResult?.Message || 'Unknown error occurred while saving category';
1009
- console.error('Category save failed:', category.LatestResult);
1010
- LogError('Category save failed', undefined, category.LatestResult);
1011
- this.mjNotificationsService.CreateSimpleNotification(errorMessage, 'error', 3500);
1012
- this.error = `Failed to create category: ${errorMessage}`;
1013
- return null;
1014
- }
1015
- }
1016
- catch (error) {
1017
- LogError('Error creating category', undefined, error);
1018
- this.mjNotificationsService.CreateSimpleNotification('Failed to create category. Please try again.', 'error', 3500);
1019
- this.error = 'Failed to create category. Please try again.';
1020
- return null;
1021
- }
1022
- }
1023
- updateFilterPanelCategories() {
1024
- // Trigger update of filter panel categories when new ones are created
1025
- // This ensures the filter panel dropdown is updated
1026
- }
1027
- onCategoryChange(categoryId) {
1028
- if (categoryId === 'new') {
1029
- this.showNewCategoryInput = true;
1030
- this.selectedPrompt.prompt.CategoryID = ''; // Reset to empty when creating new
1031
- }
1032
- else {
1033
- this.showNewCategoryInput = false;
1034
- this.isDirty = true;
1035
- }
1036
- }
1037
- async onCreateNewCategoryKeyup(event) {
1038
- if (event.key === 'Enter') {
1039
- await this.createAndSelectNewCategory();
1040
- }
1041
- else if (event.key === 'Escape') {
1042
- this.newCategoryName = '';
1043
- this.showNewCategoryInput = false;
1044
- }
1045
- }
1046
- cancelNewCategory() {
1047
- this.newCategoryName = '';
1048
- this.showNewCategoryInput = false;
1049
- }
1050
- async createAndSelectNewCategory() {
1051
- const newCategoryId = await this.createNewCategory();
1052
- if (newCategoryId && this.selectedPrompt) {
1053
- this.selectedPrompt.prompt.CategoryID = newCategoryId;
1054
- this.isDirty = true;
1055
- }
1056
- }
1057
- async createNewPrompt() {
1058
- // Create a new prompt structure
1059
- const md = new Metadata();
1060
- if (!md)
1061
- return;
1062
- const promptEntity = await md.GetEntityObject('AI Prompts', md.CurrentUser);
1063
- promptEntity.Name = 'New Prompt';
1064
- promptEntity.Description = '';
1065
- promptEntity.CategoryID = '';
1066
- promptEntity.TypeID = '';
1067
- promptEntity.Status = 'Pending';
1068
- promptEntity.TemplateID = '';
1069
- const newPrompt = {
1070
- prompt: promptEntity,
1071
- template: null,
1072
- templateContent: null,
1073
- category: null,
1074
- type: null
1075
- };
1076
- this.selectedPrompt = newPrompt;
1077
- this.currentView = 'editor';
1078
- this.isEditing = true;
1079
- this.isDirty = false;
1080
- this.editorContent = '';
1081
- }
1082
- backToList() {
1083
- if (this.isDirty) {
1084
- const confirm = window.confirm('You have unsaved changes. Are you sure you want to go back?');
1085
- if (!confirm)
1086
- return;
1087
- }
1088
- this.currentView = 'list';
1089
- this.selectedPrompt = null;
1090
- this.isEditing = false;
1091
- this.isDirty = false;
1092
- this.showNewCategoryInput = false;
1093
- this.newCategoryName = '';
1094
- this.emitStateChange();
1095
- }
1096
- toggleEdit() {
1097
- this.isEditing = !this.isEditing;
1098
- if (!this.isEditing) {
1099
- this.showNewCategoryInput = false;
1100
- this.newCategoryName = '';
1101
- }
1102
- }
1103
- onEditorContentChange(content) {
1104
- // don't modify our modle, it is directly bound to the editor
1105
- this.isDirty = true;
1106
- }
1107
- onEditorSplitterChange(event) {
1108
- // Update the panel width when user resizes
1109
- if (event.panes && event.panes.length > 0) {
1110
- const firstPane = event.panes[0];
1111
- if (firstPane.size) {
1112
- // Extract numeric value from size (could be '300px' or just 300)
1113
- const sizeValue = typeof firstPane.size === 'string' ?
1114
- parseInt(firstPane.size.replace('px', '')) : firstPane.size;
1115
- if (!isNaN(sizeValue)) {
1116
- this.promptDetailsPanelWidth = sizeValue;
1117
- this.emitStateChange();
1118
- }
1119
- }
1120
- }
1121
- }
1122
- emitStateChange() {
1123
- const state = {
1124
- currentView: this.currentView,
1125
- currentSubView: this.currentSubView,
1126
- selectedPromptId: this.selectedPrompt?.prompt.ID || null,
1127
- isEditing: this.isEditing,
1128
- promptDetailsPanelWidth: this.promptDetailsPanelWidth,
1129
- filterPanelVisible: this.filterPanelVisible,
1130
- searchTerm: this.searchTerm$.value,
1131
- selectedCategory: this.selectedCategory$.value,
1132
- selectedType: this.selectedType$.value,
1133
- selectedStatus: this.selectedStatus$.value
1134
- };
1135
- this.stateChange.emit(state);
1136
- }
1137
- async savePrompt() {
1138
- if (!this.selectedPrompt || !this.isEditing)
1139
- return;
1140
- try {
1141
- this.isLoading = true;
1142
- const md = new Metadata();
1143
- if (!md)
1144
- throw new Error('Metadata provider not available');
1145
- // Save or create template content first
1146
- let templateContentId = this.selectedPrompt.templateContent?.ID;
1147
- if (!templateContentId) {
1148
- // Create new template content
1149
- const templateContent = await md.GetEntityObject('Template Contents', md.CurrentUser);
1150
- templateContent.TemplateText = this.editorContent;
1151
- // make sure the template engine metadata is set correctly
1152
- await TemplateEngineBase.Instance.Config(false);
1153
- const tcType = TemplateEngineBase.Instance.TemplateContentTypes.find(tct => tct.Name.trim().toLowerCase() === 'text');
1154
- if (!tcType) {
1155
- throw new Error('Template content type "text" not found');
1156
- }
1157
- templateContent.TypeID = tcType.ID;
1158
- templateContent.Priority = 0; // Default priority
1159
- // We need to link to a template, create one if needed
1160
- if (!this.selectedPrompt.template) {
1161
- const template = await md.GetEntityObject('Templates', md.CurrentUser);
1162
- template.Name = this.selectedPrompt.prompt.Name + ' Template';
1163
- template.Description = 'Template for ' + this.selectedPrompt.prompt.Name;
1164
- template.UserID = md.CurrentUser.ID;
1165
- if (await template.Save()) {
1166
- templateContent.TemplateID = template.ID;
1167
- this.selectedPrompt.template = template;
1168
- }
1169
- else {
1170
- // we have an error saving the template
1171
- const errorMessage = template.LatestResult?.Message || 'Unknown error occurred while saving template';
1172
- console.error('Template save failed:', errorMessage);
1173
- LogError('Template save failed', undefined, errorMessage);
1174
- this.mjNotificationsService.CreateSimpleNotification(errorMessage, 'error', 3500);
1175
- this.error = `Failed to save template: ${errorMessage}`;
1176
- return;
1177
- }
1178
- }
1179
- else {
1180
- templateContent.TemplateID = this.selectedPrompt.template.ID;
1181
- }
1182
- if (await templateContent.Save()) {
1183
- templateContentId = templateContent.ID;
1184
- this.selectedPrompt.templateContent = templateContent;
1185
- }
1186
- else {
1187
- // Handle save failure
1188
- const errorMessage = templateContent.LatestResult?.Message || 'Unknown error occurred while saving template content';
1189
- console.error('Template content save failed:', errorMessage);
1190
- LogError('Template content save failed', undefined, errorMessage);
1191
- this.mjNotificationsService.CreateSimpleNotification(errorMessage, 'error', 3500);
1192
- this.error = `Failed to save template content: ${errorMessage}`;
1193
- return;
1194
- }
1195
- }
1196
- else {
1197
- // Update existing template content
1198
- const templateContent = await md.GetEntityObject('Template Contents');
1199
- await templateContent.Load(templateContentId);
1200
- templateContent.TemplateText = this.editorContent;
1201
- if (!await templateContent.Save()) {
1202
- // Handle save failure
1203
- const errorMessage = templateContent.LatestResult?.Message || 'Unknown error occurred while saving template content';
1204
- console.error('Template content update failed:', errorMessage);
1205
- LogError('Template content update failed', undefined, errorMessage);
1206
- this.mjNotificationsService.CreateSimpleNotification(errorMessage, 'error', 3500);
1207
- this.error = `Failed to update template content: ${errorMessage}`;
1208
- return;
1209
- }
1210
- }
1211
- // Save the prompt
1212
- let prompt;
1213
- if (this.selectedPrompt.prompt.ID) {
1214
- // Update existing prompt
1215
- prompt = await md.GetEntityObject('AI Prompts', md.CurrentUser);
1216
- await prompt.Load(this.selectedPrompt.prompt.ID);
1217
- }
1218
- else {
1219
- // Create new prompt
1220
- prompt = await md.GetEntityObject('AI Prompts', md.CurrentUser);
1221
- }
1222
- // Update prompt properties
1223
- prompt.Name = this.selectedPrompt.prompt.Name;
1224
- prompt.Description = this.selectedPrompt.prompt.Description;
1225
- prompt.CategoryID = this.selectedPrompt.prompt.CategoryID;
1226
- prompt.TypeID = this.selectedPrompt.prompt.TypeID;
1227
- prompt.Status = this.selectedPrompt.prompt.Status;
1228
- prompt.TemplateID = this.selectedPrompt.template?.ID || '';
1229
- const promptResult = await prompt.Save();
1230
- if (promptResult) {
1231
- this.isDirty = false;
1232
- this.isEditing = false;
1233
- LogStatus('Prompt saved successfully');
1234
- // Reload data to get the updated state
1235
- await this.loadData();
1236
- // Find and select the updated prompt
1237
- this.selectedPrompt = this.promptsWithTemplates.find(p => p.prompt.ID === prompt.ID) || null;
1238
- }
1239
- else {
1240
- // Handle save failure
1241
- const errorMessage = prompt.LatestResult?.Message || 'Unknown error occurred while saving prompt';
1242
- console.error('Prompt save failed:', errorMessage);
1243
- LogError('Prompt save failed', undefined, errorMessage);
1244
- this.mjNotificationsService.CreateSimpleNotification(errorMessage, 'error', 3500);
1245
- this.error = `Failed to save prompt: ${errorMessage}`;
1246
- }
1247
- }
1248
- catch (error) {
1249
- LogError('Error saving prompt', undefined, error);
1250
- this.error = 'Failed to save prompt. Please try again.';
1251
- }
1252
- finally {
1253
- this.isLoading = false;
1254
- }
1255
- }
1256
- async deletePrompt(promptWithTemplate) {
1257
- if (!promptWithTemplate.prompt.ID)
1258
- return;
1259
- const confirm = window.confirm(`Are you sure you want to delete "${promptWithTemplate.prompt.Name}"?`);
1260
- if (!confirm)
1261
- return;
1262
- try {
1263
- this.isLoading = true;
1264
- const md = Metadata.Provider;
1265
- if (!md)
1266
- throw new Error('Metadata provider not available');
1267
- const prompt = await md.GetEntityObject('AI Prompts', md.CurrentUser);
1268
- await prompt.Load(promptWithTemplate.prompt.ID);
1269
- const result = await prompt.Delete();
1270
- if (result) {
1271
- LogStatus('Prompt deleted successfully');
1272
- await this.loadData();
1273
- if (this.selectedPrompt?.prompt.ID === promptWithTemplate.prompt.ID) {
1274
- this.backToList();
1275
- }
1276
- }
1277
- }
1278
- catch (error) {
1279
- LogError('Error deleting prompt', undefined, error);
1280
- this.error = 'Failed to delete prompt. Please try again.';
1281
- }
1282
- finally {
1283
- this.isLoading = false;
1284
- }
1285
- }
1286
- // Utility methods
1287
- getStatusColor(status) {
1288
- switch (status) {
1289
- case 'Active': return 'success';
1290
- case 'Pending': return 'warning';
1291
- case 'Disabled': return 'error';
1292
- default: return 'info';
1293
- }
1294
- }
1295
- getPromptIcon() {
1296
- return 'fa-solid fa-comment-dots';
1297
- }
1298
- getCategoryName(categoryId) {
1299
- if (!categoryId || categoryId === '')
1300
- return 'No Category';
1301
- return this.categories.find(c => c.ID === categoryId)?.Name || 'Unknown Category';
1302
- }
1303
- getTypeName(typeId) {
1304
- if (!typeId || typeId === '')
1305
- return 'No Type';
1306
- return this.types.find(t => t.ID === typeId)?.Name || 'Unknown Type';
1307
- }
1308
- setSubView(subView) {
1309
- this.currentSubView = subView;
1310
- this.emitStateChange();
1311
- }
1312
- onPromptSelectedFromMatrix(prompt) {
1313
- const promptWithTemplate = this.promptsWithTemplates.find(p => p.prompt.ID === prompt.ID);
1314
- if (promptWithTemplate) {
1315
- this.viewPrompt(promptWithTemplate);
1316
- }
1317
- }
1318
- onVersionSelected(version) {
1319
- // Handle version selection from version control component
1320
- console.log('Version selected:', version);
1321
- if (version && this.selectedPrompt) {
1322
- this.editorContent = version.content || '';
1323
- this.isDirty = true;
1324
- }
1325
- }
1326
- get promptsForMatrix() {
1327
- return this.filteredPrompts.map(p => p.prompt);
1328
- }
1329
- static ɵfac = function PromptManagementComponent_Factory(t) { return new (t || PromptManagementComponent)(i0.ɵɵdirectiveInject(i1.MJNotificationService)); };
1330
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PromptManagementComponent, selectors: [["app-prompt-management"]], outputs: { openEntityRecord: "openEntityRecord", stateChange: "stateChange" }, decls: 3, vars: 4, consts: [["newCategoryInput", ""], ["mjFillContainer", "", 1, "prompt-management-container", 3, "rightMargin", "bottomMargin"], [1, "list-view"], [1, "editor-view"], [1, "dashboard-header"], [1, "header-info"], ["type", "button", "title", "Toggle Filters", 1, "filter-toggle-btn", 3, "click"], [1, "fa-solid", "fa-filter"], [1, "prompt-count"], [1, "header-controls"], ["type", "button", 1, "control-btn", 3, "click"], [1, "fa-solid", "fa-plus"], [1, "sub-navigation"], ["type", "button", "title", "List View", 1, "sub-nav-btn", 3, "click"], [1, "fa-solid", "fa-list"], ["type", "button", "title", "Priority Matrix", 1, "sub-nav-btn", 3, "click"], [1, "fa-solid", "fa-th"], ["type", "button", "title", "Version Control", 1, "sub-nav-btn", 3, "click"], [1, "fa-solid", "fa-code-branch"], [1, "main-content"], ["orientation", "horizontal", "mjFillContainer", "", 1, "main-splitter"], ["mjFillContainer", "", 3, "selectedPrompts"], ["mjFillContainer", "", 3, "prompt"], ["orientation", "horizontal", "mjFillContainer", "", 1, "main-splitter", 3, "layoutChange"], [3, "size", "collapsible", "resizable", "scrollable", "hidden"], [3, "filtersChange", "filterChange", "resetFilters", "closePanel", "prompts", "filteredPrompts", "categories", "types", "filters"], [3, "resizable", "scrollable"], [1, "prompts-content"], [1, "loading-container"], [1, "error-container"], [1, "prompts-list"], [1, "loading-content"], [1, "loading-spinner"], [1, "spinner-ring"], [1, "loading-text"], [1, "error-message"], [1, "fa-solid", "fa-exclamation-triangle"], [1, "empty-state"], [1, "prompts-grid"], [1, "fa-solid", "fa-comment-dots"], [1, "prompt-card"], [1, "prompt-card", 3, "click"], [1, "card-header"], [1, "prompt-info"], [1, "prompt-icon"], [1, "prompt-details"], [1, "prompt-name"], [1, "prompt-meta"], [1, "prompt-category"], [1, "prompt-type"], [1, "card-body"], [1, "prompt-description"], [1, "prompt-description", "text-muted"], [1, "template-info"], [1, "template-item", "text-muted"], [1, "card-actions", 3, "click"], ["type", "button", 1, "action-btn", 3, "click"], [1, "fa-solid", "fa-eye"], ["type", "button", 1, "action-btn", "action-btn-primary", 3, "click"], [1, "fa-solid", "fa-edit"], ["type", "button", 1, "action-btn", "action-btn-danger", 3, "click"], [1, "fa-solid", "fa-trash"], [1, "template-item"], [1, "fa-solid", "fa-file-code"], [1, "template-content-info"], ["mjFillContainer", "", 3, "promptSelected", "selectedPrompts"], ["mjFillContainer", "", 3, "versionSelected", "prompt"], [1, "editor-header"], [1, "breadcrumb-section"], ["type", "button", 1, "back-btn", 3, "click"], [1, "fa-solid", "fa-arrow-left"], [1, "editor-title"], [3, "class"], [1, "editor-actions"], ["type", "button", 1, "control-btn"], [1, "editor-content"], ["orientation", "horizontal", "mjFillContainer", "", 1, "editor-splitter", 3, "layoutChange"], [3, "collapsible", "resizable", "scrollable"], [1, "prompt-details-panel"], [1, "form-field"], [1, "field-label"], ["type", "text", "placeholder", "Enter prompt name", 1, "field-input", 3, "ngModel"], [1, "field-value"], ["placeholder", "Enter prompt description", 1, "field-textarea", 3, "ngModel"], [1, "field-select", 3, "ngModel"], [1, "template-info-section"], [1, "template-editor-panel"], [1, "editor-info"], [1, "editor-badge", "editor-badge-secondary"], [1, "editor-container"], [3, "change", "value", "languages", "language", "placeholder", "lineWrapping", "highlightWhitespace", "indentWithTab", "indentUnit", "readonly"], [1, "editor-help"], [1, "fa-solid", "fa-times"], ["type", "button", 1, "control-btn", "control-btn-primary", 3, "click", "disabled"], [1, "loading-spinner-sm"], [1, "fa-solid", "fa-save"], ["type", "text", "placeholder", "Enter prompt name", 1, "field-input", 3, "ngModelChange", "input", "ngModel"], ["placeholder", "Enter prompt description", 1, "field-textarea", 3, "ngModelChange", "input", "ngModel"], [1, "new-category-container"], [1, "field-select", 3, "ngModelChange", "ngModel"], ["value", ""], [3, "value"], ["value", "new", 1, "new-category-option"], ["type", "text", "placeholder", "Enter new category name", 1, "field-input", 3, "ngModelChange", "keyup", "ngModel"], [1, "new-category-actions"], [1, "fa-solid", "fa-check"], [1, "field-select", 3, "ngModelChange", "change", "ngModel"], ["value", "Active"], ["value", "Pending"], ["value", "Disabled"], [1, "template-details"], [1, "editor-badge", "editor-badge-info"], [1, "editor-badge", "editor-badge-warning"], [1, "help-section"], [1, "syntax-examples"], [1, "syntax-item"]], template: function PromptManagementComponent_Template(rf, ctx) { if (rf & 1) {
1331
- i0.ɵɵelementStart(0, "div", 1);
1332
- i0.ɵɵtemplate(1, PromptManagementComponent_Conditional_1_Template, 27, 11, "div", 2)(2, PromptManagementComponent_Conditional_2_Template, 58, 25, "div", 3);
1333
- i0.ɵɵelementEnd();
1334
- } if (rf & 2) {
1335
- i0.ɵɵproperty("rightMargin", 8)("bottomMargin", 8);
1336
- i0.ɵɵadvance();
1337
- i0.ɵɵconditional(ctx.currentView === "list" ? 1 : -1);
1338
- i0.ɵɵadvance();
1339
- i0.ɵɵconditional(ctx.currentView === "editor" && ctx.selectedPrompt ? 2 : -1);
1340
- } }, dependencies: [i2.NgSelectOption, i2.ɵNgSelectMultipleOption, i2.DefaultValueAccessor, i2.SelectControlValueAccessor, i2.NgControlStatus, i2.NgModel, i3.SplitterComponent, i3.SplitterPaneComponent, i4.FillContainer, i5.CodeEditorComponent, i6.PromptFilterPanelComponent, i7.ModelPromptPriorityMatrixComponent, i8.PromptVersionControlComponent], styles: [".prompt-management-container[_ngcontent-%COMP%] {\n overflow: hidden;\n padding: 4px;\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.dashboard-header[_ngcontent-%COMP%] {\n margin-bottom: 16px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-shrink: 0;\n \n .header-info {\n flex: 1;\n display: flex;\n align-items: center;\n gap: 12px;\n }\n \n .filter-toggle-btn {\n padding: 6px 10px;\n border: 1px solid #ddd;\n border-radius: 4px;\n background: white;\n cursor: pointer;\n font-size: 11px;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.2s;\n color: #555;\n \n &:hover {\n background-color: #f0f0f0;\n border-color: #2196f3;\n color: #2196f3;\n }\n \n .fa-solid {\n font-size: 10px;\n }\n }\n \n .prompt-count {\n font-size: 12px;\n color: #2196f3;\n font-weight: 600;\n background: rgba(33, 150, 243, 0.1);\n padding: 4px 8px;\n border-radius: 4px;\n border: 1px solid rgba(33, 150, 243, 0.2);\n }\n \n .header-controls {\n display: flex;\n gap: 8px;\n \n .control-btn {\n padding: 8px 12px;\n border: 1px solid #ccc;\n border-radius: 4px;\n background: white;\n cursor: pointer;\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.2s;\n \n &:hover {\n background-color: #f0f0f0;\n border-color: #2196f3;\n }\n \n &.active {\n background-color: #2196f3;\n border-color: #2196f3;\n color: white;\n }\n \n &.control-btn-primary {\n background-color: #2196f3;\n border-color: #2196f3;\n color: white;\n \n &:hover {\n background-color: #1976d2;\n }\n }\n \n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n \n &:hover {\n background-color: white;\n border-color: #ccc;\n }\n }\n \n .fa-solid {\n font-size: 14px;\n }\n }\n }\n}\n\n//[_ngcontent-%COMP%] Filters[_ngcontent-%COMP%] now[_ngcontent-%COMP%] handled[_ngcontent-%COMP%] by[_ngcontent-%COMP%] filter[_ngcontent-%COMP%] panel[_ngcontent-%COMP%] component\n\n.loading-container[_ngcontent-%COMP%], .error-container[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background: #fafafa;\n flex: 1;\n \n p {\n color: #666;\n font-size: 14px;\n }\n}\n\n.error-message[_ngcontent-%COMP%] {\n color: #d32f2f;\n font-weight: 500;\n \n .fa-solid {\n margin-right: 8px;\n }\n}\n\n.loading-content[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n}\n\n.loading-spinner[_ngcontent-%COMP%] {\n display: inline-block;\n position: relative;\n width: 40px;\n height: 40px;\n \n .spinner-ring {\n box-sizing: border-box;\n display: block;\n position: absolute;\n width: 32px;\n height: 32px;\n margin: 4px;\n border: 3px solid #2196f3;\n border-radius: 50%;\n animation: _ngcontent-%COMP%_loading-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: #2196f3 transparent transparent transparent;\n \n &:nth-child(1) { animation-delay: -0.45s; }\n &:nth-child(2) { animation-delay: -0.3s; }\n &:nth-child(3) { animation-delay: -0.15s; }\n }\n}\n\n@keyframes _ngcontent-%COMP%_loading-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n.empty-state[_ngcontent-%COMP%] {\n text-align: center;\n padding: 60px 20px;\n color: #666;\n \n .fa-solid {\n font-size: 48px;\n margin-bottom: 16px;\n color: #ccc;\n }\n \n h3 {\n margin: 0 0 8px 0;\n color: #333;\n font-size: 18px;\n font-weight: 500;\n }\n \n p {\n margin: 0;\n font-size: 14px;\n }\n}\n\n.prompts-grid[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));\n gap: 16px;\n flex: 1;\n overflow-y: auto;\n}\n\n.prompt-card[_ngcontent-%COMP%] {\n background: white;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 16px;\n transition: all 0.2s ease;\n height: fit-content;\n cursor: pointer;\n \n &:hover {\n border-color: #2196f3;\n box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);\n transform: translateY(-1px);\n }\n \n .card-header {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n margin-bottom: 12px;\n \n .prompt-info {\n display: flex;\n gap: 12px;\n flex: 1;\n \n .prompt-icon {\n color: #2196f3;\n font-size: 20px;\n margin-top: 2px;\n }\n \n .prompt-details {\n flex: 1;\n \n .prompt-name {\n margin: 0 0 4px 0;\n font-size: 16px;\n font-weight: 500;\n color: #333;\n }\n \n .prompt-meta {\n font-size: 12px;\n color: #666;\n \n .prompt-type {\n margin-left: 8px;\n }\n }\n }\n }\n }\n \n .card-body {\n margin-bottom: 12px;\n \n .prompt-description {\n margin-bottom: 12px;\n color: #555;\n font-size: 13px;\n line-height: 1.4;\n }\n \n .template-info {\n .template-item {\n display: flex;\n align-items: center;\n margin-bottom: 4px;\n font-size: 12px;\n color: #666;\n \n .fa-solid {\n margin-right: 6px;\n color: #999;\n }\n }\n \n .template-content-info {\n font-size: 11px;\n color: #999;\n }\n }\n }\n \n .card-actions {\n display: flex;\n gap: 8px;\n border-top: 1px solid #f0f0f0;\n padding-top: 12px;\n \n .action-btn {\n padding: 6px 12px;\n border: 1px solid #ddd;\n border-radius: 3px;\n background: white;\n cursor: pointer;\n font-size: 11px;\n display: flex;\n align-items: center;\n gap: 4px;\n transition: all 0.2s;\n \n &:hover {\n background-color: #f5f5f5;\n border-color: #bbb;\n }\n \n &.action-btn-primary {\n background-color: #2196f3;\n border-color: #2196f3;\n color: white;\n \n &:hover {\n background-color: #1976d2;\n }\n }\n \n &.action-btn-danger {\n background-color: #f44336;\n border-color: #f44336;\n color: white;\n \n &:hover {\n background-color: #d32f2f;\n }\n }\n \n .fa-solid {\n font-size: 10px;\n }\n }\n }\n}\n\n//[_ngcontent-%COMP%] Editor[_ngcontent-%COMP%] View\n.editor-view[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: hidden;\n}\n\n.editor-header[_ngcontent-%COMP%] {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 16px;\n padding-bottom: 16px;\n border-bottom: 1px solid #e0e0e0;\n \n .breadcrumb-section {\n .back-btn {\n background: none;\n border: none;\n color: #2196f3;\n cursor: pointer;\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 6px;\n \n &:hover {\n text-decoration: underline;\n }\n }\n }\n \n .editor-title {\n flex: 1;\n margin: 0 20px;\n \n h2 {\n margin: 0;\n font-size: 18px;\n font-weight: 500;\n color: #333;\n display: flex;\n align-items: center;\n gap: 8px;\n }\n }\n \n .editor-actions {\n display: flex;\n gap: 8px;\n }\n}\n\n.editor-content[_ngcontent-%COMP%] {\n flex: 1;\n overflow: hidden;\n}\n\n.editor-splitter[_ngcontent-%COMP%] {\n height: 100%;\n \n .k-pane {\n overflow: hidden;\n }\n}\n\n.prompt-details-panel[_ngcontent-%COMP%], .template-editor-panel[_ngcontent-%COMP%] {\n background: white;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 16px;\n height: 100%;\n overflow-y: auto;\n \n h3 {\n margin: 0 0 16px 0;\n font-size: 16px;\n font-weight: 500;\n color: #333;\n border-bottom: 1px solid #f0f0f0;\n padding-bottom: 8px;\n }\n}\n\n.form-field[_ngcontent-%COMP%] {\n margin-bottom: 16px;\n \n .field-label {\n display: block;\n margin-bottom: 4px;\n font-size: 12px;\n font-weight: 500;\n color: #555;\n }\n \n .field-input, .field-select {\n width: 100%;\n padding: 6px 8px;\n border: 1px solid #ddd;\n border-radius: 3px;\n font-size: 12px;\n \n &:focus {\n outline: none;\n border-color: #2196f3;\n }\n }\n \n .field-textarea {\n width: 100%;\n padding: 6px 8px;\n border: 1px solid #ddd;\n border-radius: 3px;\n font-size: 12px;\n resize: vertical;\n min-height: 60px;\n \n &:focus {\n outline: none;\n border-color: #2196f3;\n }\n }\n \n .field-value {\n padding: 6px 8px;\n background: #f8f9fa;\n border: 1px solid #e0e0e0;\n border-radius: 3px;\n font-size: 12px;\n color: #555;\n }\n}\n\n.template-editor-panel[_ngcontent-%COMP%] {\n .editor-container {\n margin-bottom: 16px;\n \n .code-editor {\n width: 100%;\n min-height: 300px;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 12px;\n border: 1px solid #ddd;\n border-radius: 3px;\n padding: 8px;\n background: #f8f9fa;\n \n &:focus {\n outline: none;\n border-color: #2196f3;\n }\n }\n \n .code-display {\n border: 1px solid #e0e0e0;\n border-radius: 3px;\n background: #f8f9fa;\n max-height: 400px;\n overflow-y: auto;\n \n pre {\n margin: 0;\n padding: 12px;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 12px;\n line-height: 1.4;\n color: #333;\n \n code {\n background: none;\n padding: 0;\n font-size: inherit;\n color: inherit;\n }\n }\n }\n }\n \n .editor-help {\n .help-section {\n h5 {\n font-size: 13px;\n font-weight: 500;\n margin-bottom: 8px;\n color: #333;\n }\n \n .syntax-examples {\n .syntax-item {\n margin-bottom: 6px;\n padding: 6px 8px;\n background: #f0f0f0;\n border-radius: 3px;\n font-size: 11px;\n \n code {\n background: #e0e0e0;\n padding: 2px 4px;\n border-radius: 2px;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n margin-right: 8px;\n }\n }\n }\n }\n }\n}\n\n//[_ngcontent-%COMP%] CodeMirror[_ngcontent-%COMP%] overrides\n.CodeMirror[_ngcontent-%COMP%] {\n border: 1px solid #ddd !important;\n border-radius: 3px !important;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;\n font-size: 12px !important;\n min-height: 300px !important;\n}\n\n.CodeMirror-focused[_ngcontent-%COMP%] {\n border-color: #2196f3 !important;\n}\n\n//[_ngcontent-%COMP%] Status[_ngcontent-%COMP%] badges\n.status-badge[_ngcontent-%COMP%] {\n padding: 2px 6px;\n border-radius: 3px;\n font-size: 10px;\n font-weight: 500;\n text-transform: uppercase;\n \n &.status-active {\n background: #e8f5e8;\n color: #2e7d32;\n }\n \n &.status-pending {\n background: #fff3e0;\n color: #f57c00;\n }\n \n &.status-disabled {\n background: #ffebee;\n color: #c62828;\n }\n}\n\n//[_ngcontent-%COMP%] Editor[_ngcontent-%COMP%] badges\n.editor-badge[_ngcontent-%COMP%] {\n padding: 2px 6px;\n border-radius: 3px;\n font-size: 10px;\n font-weight: 500;\n margin-left: 8px;\n \n &.editor-badge-info {\n background: #e3f2fd;\n color: #1976d2;\n }\n \n &.editor-badge-warning {\n background: #fff3e0;\n color: #f57c00;\n }\n \n &.editor-badge-secondary {\n background: #f5f5f5;\n color: #666;\n }\n}\n\n//[_ngcontent-%COMP%] New[_ngcontent-%COMP%] category[_ngcontent-%COMP%] creation\n.new-category-container[_ngcontent-%COMP%] {\n display: flex;\n gap: 4px;\n align-items: center;\n \n .field-input {\n flex: 1;\n }\n \n .new-category-actions {\n display: flex;\n gap: 2px;\n \n .action-btn {\n padding: 4px 6px;\n border: 1px solid #ddd;\n border-radius: 3px;\n background: white;\n cursor: pointer;\n font-size: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 24px;\n height: 24px;\n \n &:hover {\n background-color: #f5f5f5;\n }\n \n &.action-btn-primary {\n background-color: #2196f3;\n border-color: #2196f3;\n color: white;\n \n &:hover {\n background-color: #1976d2;\n }\n }\n \n .fa-solid {\n font-size: 10px;\n }\n }\n }\n}\n\n.new-category-option[_ngcontent-%COMP%] {\n color: #2196f3;\n font-style: italic;\n}\n\n//[_ngcontent-%COMP%] CodeMirror[_ngcontent-%COMP%] 6[_ngcontent-%COMP%] styling\nmj-code-editor[_ngcontent-%COMP%] {\n display: block;\n border: 1px solid #ddd;\n border-radius: 3px;\n overflow: hidden;\n min-height: 300px;\n \n .cm-editor {\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;\n font-size: 12px !important;\n min-height: 300px;\n }\n \n .cm-focused {\n outline: none !important;\n }\n \n .cm-editor.cm-focused {\n border-color: #2196f3;\n }\n}\n\n//[_ngcontent-%COMP%] List[_ngcontent-%COMP%] View[_ngcontent-%COMP%] Layout\n.list-view[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: hidden;\n}\n\n.sub-navigation[_ngcontent-%COMP%] {\n display: flex;\n gap: 8px;\n margin-bottom: 16px;\n padding: 8px 0;\n border-bottom: 1px solid #e0e0e0;\n flex-shrink: 0;\n\n .sub-nav-btn {\n padding: 8px 12px;\n border: 1px solid #ddd;\n border-radius: 4px;\n background: white;\n cursor: pointer;\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.2s;\n color: #555;\n font-weight: 500;\n\n &:hover {\n background-color: #f0f0f0;\n border-color: #2196f3;\n color: #2196f3;\n }\n\n &.active {\n background-color: #2196f3;\n border-color: #2196f3;\n color: white;\n box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);\n }\n\n .fa-solid {\n font-size: 11px;\n }\n }\n}\n\n.main-content[_ngcontent-%COMP%] {\n flex: 1;\n overflow: hidden;\n}\n\n.main-splitter[_ngcontent-%COMP%] {\n height: 100%;\n \n .k-pane {\n overflow: hidden;\n }\n}\n\n.prompts-content[_ngcontent-%COMP%] {\n height: 100%;\n overflow-y: auto;\n padding: 0 16px;\n}"] });
1341
- }
1342
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PromptManagementComponent, [{
1343
- type: Component,
1344
- args: [{ selector: 'app-prompt-management', template: "<div class=\"prompt-management-container\" mjFillContainer [rightMargin]=\"8\" [bottomMargin]=\"8\">\n <!-- List View -->\n @if (currentView === 'list') {\n <div class=\"list-view\">\n <!-- Header -->\n <div class=\"dashboard-header\">\n <div class=\"header-info\">\n <button \n type=\"button\" \n class=\"filter-toggle-btn\"\n (click)=\"toggleFilterPanel()\"\n title=\"Toggle Filters\">\n <i class=\"fa-solid fa-filter\"></i>\n @if (filterPanelVisible) {\n Hide Filters\n } @else {\n Show Filters\n }\n </button>\n <span class=\"prompt-count\">{{ filteredPrompts.length }} prompts</span>\n </div>\n \n <div class=\"header-controls\">\n <button \n type=\"button\" \n class=\"control-btn\"\n (click)=\"createNewPrompt()\">\n <i class=\"fa-solid fa-plus\"></i>\n New Prompt\n </button>\n </div>\n </div>\n\n <!-- Sub Navigation -->\n <div class=\"sub-navigation\">\n <button \n type=\"button\" \n class=\"sub-nav-btn\"\n [class.active]=\"currentSubView === 'list'\"\n (click)=\"setSubView('list')\"\n title=\"List View\">\n <i class=\"fa-solid fa-list\"></i>\n List View\n </button>\n <button \n type=\"button\" \n class=\"sub-nav-btn\"\n [class.active]=\"currentSubView === 'priority-matrix'\"\n (click)=\"setSubView('priority-matrix')\"\n title=\"Priority Matrix\">\n <i class=\"fa-solid fa-th\"></i>\n Priority Matrix\n </button>\n <button \n type=\"button\" \n class=\"sub-nav-btn\"\n [class.active]=\"currentSubView === 'version-control'\"\n (click)=\"setSubView('version-control')\"\n title=\"Version Control\">\n <i class=\"fa-solid fa-code-branch\"></i>\n Version Control\n </button>\n </div>\n\n <!-- Main Content with Splitter -->\n <div class=\"main-content\">\n <!-- List View Content -->\n @if (currentSubView === 'list') {\n <kendo-splitter \n class=\"main-splitter\"\n orientation=\"horizontal\"\n (layoutChange)=\"onMainSplitterChange($event)\"\n mjFillContainer>\n \n <!-- Filter Panel (Left) -->\n <kendo-splitter-pane \n [size]=\"filterPanelVisible ? '320px' : '0px'\"\n [collapsible]=\"false\"\n [resizable]=\"filterPanelVisible\"\n [scrollable]=\"false\"\n [hidden]=\"!filterPanelVisible\">\n <mj-prompt-filter-panel\n [prompts]=\"promptsWithTemplates\"\n [filteredPrompts]=\"filteredPrompts\"\n [categories]=\"categories\"\n [types]=\"types\"\n [filters]=\"currentFilters\"\n (filtersChange)=\"onFiltersChange($event)\"\n (filterChange)=\"onFilterChange()\"\n (resetFilters)=\"onResetFilters()\"\n (closePanel)=\"toggleFilterPanel()\">\n </mj-prompt-filter-panel>\n </kendo-splitter-pane>\n \n <!-- Prompts List Panel -->\n <kendo-splitter-pane \n [resizable]=\"true\"\n [scrollable]=\"false\">\n <div class=\"prompts-content\">\n\n <!-- Loading State -->\n @if (isLoading) {\n <div class=\"loading-container\">\n <div class=\"loading-content\">\n <div class=\"loading-spinner\">\n <div class=\"spinner-ring\"></div>\n <div class=\"spinner-ring\"></div>\n <div class=\"spinner-ring\"></div>\n </div>\n <div class=\"loading-text\">{{ loadingMessage }}</div>\n </div>\n </div>\n }\n\n <!-- Error State -->\n @if (error) {\n <div class=\"error-container\">\n <p class=\"error-message\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n {{ error }}\n </p>\n </div>\n }\n\n <!-- Prompts List -->\n @if (!isLoading && !error) {\n <div class=\"prompts-list\">\n @if (filteredPrompts.length === 0) {\n <div class=\"empty-state\">\n <i class=\"fa-solid fa-comment-dots\"></i>\n <h3>No prompts found</h3>\n <p>No prompts match your current filters. Try adjusting your search criteria or create a new prompt.</p>\n </div>\n } @else {\n <div class=\"prompts-grid\">\n @for (promptWithTemplate of filteredPrompts; track promptWithTemplate.prompt.ID || $index) {\n <div class=\"prompt-card\" (click)=\"viewPrompt(promptWithTemplate)\">\n <!-- Card Header -->\n <div class=\"card-header\">\n <div class=\"prompt-info\">\n <div class=\"prompt-icon\">\n <i [class]=\"getPromptIcon()\"></i>\n </div>\n <div class=\"prompt-details\">\n <h4 class=\"prompt-name\">{{ promptWithTemplate.prompt.Name }}</h4>\n <div class=\"prompt-meta\">\n <span class=\"prompt-category\">{{ getCategoryName(promptWithTemplate.prompt.CategoryID) }}</span>\n @if (promptWithTemplate.type) {\n <span class=\"prompt-type\">\u2022 {{ promptWithTemplate.type.Name }}</span>\n }\n </div>\n </div>\n </div>\n \n <div class=\"status-badge status-{{ promptWithTemplate.prompt.Status.toLowerCase() }}\">\n {{ promptWithTemplate.prompt.Status }}\n </div>\n </div>\n\n <!-- Card Body -->\n <div class=\"card-body\">\n @if (promptWithTemplate.prompt.Description) {\n <p class=\"prompt-description\">{{ promptWithTemplate.prompt.Description }}</p>\n } @else {\n <p class=\"prompt-description text-muted\">No description provided</p>\n }\n \n <!-- Template Info -->\n <div class=\"template-info\">\n @if (promptWithTemplate.template) {\n <div class=\"template-item\">\n <i class=\"fa-solid fa-file-code\"></i>\n <span>{{ promptWithTemplate.template.Name }}</span>\n </div>\n @if (promptWithTemplate.templateContent) {\n <div class=\"template-content-info\">\n <small>\n Template content: {{ (promptWithTemplate.templateContent.TemplateText || '').length }} characters\n </small>\n </div>\n }\n } @else {\n <div class=\"template-item text-muted\">\n <i class=\"fa-solid fa-file-code\"></i>\n <span>No template assigned</span>\n </div>\n }\n </div>\n </div>\n\n <!-- Card Actions -->\n <div class=\"card-actions\" (click)=\"$event.stopPropagation()\">\n <button \n type=\"button\" \n class=\"action-btn\"\n (click)=\"viewPrompt(promptWithTemplate)\">\n <i class=\"fa-solid fa-eye\"></i>\n View\n </button>\n \n <button \n type=\"button\" \n class=\"action-btn action-btn-primary\"\n (click)=\"editPrompt(promptWithTemplate)\">\n <i class=\"fa-solid fa-edit\"></i>\n Edit\n </button>\n \n <button \n type=\"button\" \n class=\"action-btn action-btn-danger\"\n (click)=\"deletePrompt(promptWithTemplate)\">\n <i class=\"fa-solid fa-trash\"></i>\n Delete\n </button>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n </kendo-splitter-pane>\n </kendo-splitter>\n }\n\n\n <!-- Priority Matrix View -->\n @if (currentSubView === 'priority-matrix') {\n <app-model-prompt-priority-matrix\n [selectedPrompts]=\"promptsForMatrix\"\n (promptSelected)=\"onPromptSelectedFromMatrix($event)\"\n mjFillContainer>\n </app-model-prompt-priority-matrix>\n }\n\n <!-- Version Control View -->\n @if (currentSubView === 'version-control') {\n <app-prompt-version-control\n [prompt]=\"selectedPrompt?.prompt || null\"\n (versionSelected)=\"onVersionSelected($event)\"\n mjFillContainer>\n </app-prompt-version-control>\n }\n </div>\n </div>\n }\n\n <!-- Editor View -->\n @if (currentView === 'editor' && selectedPrompt) {\n <div class=\"editor-view\">\n <!-- Editor Header -->\n <div class=\"editor-header\">\n <div class=\"breadcrumb-section\">\n <button \n type=\"button\" \n class=\"back-btn\"\n (click)=\"backToList()\">\n <i class=\"fa-solid fa-arrow-left\"></i>\n Back to Prompts\n </button>\n </div>\n \n <div class=\"editor-title\">\n <h2>\n @if (isEditing && !selectedPrompt.prompt.ID) {\n <i class=\"fa-solid fa-plus\"></i>\n Create New Prompt\n } @else if (isEditing) {\n <i class=\"fa-solid fa-edit\"></i>\n Edit Prompt\n } @else {\n <i class=\"fa-solid fa-eye\"></i>\n View Prompt\n }\n </h2>\n \n @if (selectedPrompt.prompt.ID) {\n <div class=\"status-badge status-{{ selectedPrompt.prompt.Status.toLowerCase() }}\">\n {{ selectedPrompt.prompt.Status }}\n </div>\n }\n </div>\n \n <div class=\"editor-actions\">\n @if (!isEditing) {\n <button \n type=\"button\" \n class=\"control-btn\"\n (click)=\"toggleEdit()\">\n <i class=\"fa-solid fa-edit\"></i>\n Edit\n </button>\n } @else {\n <button \n type=\"button\" \n class=\"control-btn\"\n (click)=\"toggleEdit()\">\n <i class=\"fa-solid fa-times\"></i>\n Cancel\n </button>\n \n <button \n type=\"button\" \n class=\"control-btn control-btn-primary\"\n (click)=\"savePrompt()\"\n [disabled]=\"isLoading\">\n @if (isLoading) {\n <span class=\"loading-spinner-sm\"></span>\n } @else {\n <i class=\"fa-solid fa-save\"></i>\n }\n Save\n </button>\n }\n </div>\n </div>\n\n <!-- Editor Content -->\n <div class=\"editor-content\">\n <kendo-splitter \n class=\"editor-splitter\"\n orientation=\"horizontal\"\n (layoutChange)=\"onEditorSplitterChange($event)\"\n mjFillContainer>\n \n <!-- Prompt Details Panel -->\n <kendo-splitter-pane \n [collapsible]=\"false\"\n [resizable]=\"true\"\n [scrollable]=\"true\">\n <div class=\"prompt-details-panel\">\n <h3>Prompt Details</h3>\n \n <!-- Name -->\n <div class=\"form-field\">\n <label class=\"field-label\">Name *</label>\n @if (isEditing) {\n <input \n type=\"text\" \n class=\"field-input\"\n [(ngModel)]=\"selectedPrompt.prompt.Name\"\n placeholder=\"Enter prompt name\"\n (input)=\"isDirty = true\">\n } @else {\n <div class=\"field-value\">{{ selectedPrompt.prompt.Name }}</div>\n }\n </div>\n \n <!-- Description -->\n <div class=\"form-field\">\n <label class=\"field-label\">Description</label>\n @if (isEditing) {\n <textarea \n class=\"field-textarea\"\n [(ngModel)]=\"selectedPrompt.prompt.Description\"\n placeholder=\"Enter prompt description\"\n (input)=\"isDirty = true\"></textarea>\n } @else {\n <div class=\"field-value\">\n {{ selectedPrompt.prompt.Description || 'No description provided' }}\n </div>\n }\n </div>\n \n <!-- Category -->\n <div class=\"form-field\">\n <label class=\"field-label\">Category</label>\n @if (isEditing) {\n @if (!showNewCategoryInput) {\n <select \n class=\"field-select\"\n [(ngModel)]=\"selectedPrompt.prompt.CategoryID\"\n (ngModelChange)=\"onCategoryChange($event)\">\n <option value=\"\">Select category...</option>\n @for (category of categories; track category.ID) {\n <option [value]=\"category.ID\">{{ category.Name }}</option>\n }\n <option value=\"new\" class=\"new-category-option\">+ Create New Category</option>\n </select>\n } @else {\n <div class=\"new-category-container\">\n <input \n type=\"text\" \n class=\"field-input\"\n [(ngModel)]=\"newCategoryName\"\n placeholder=\"Enter new category name\"\n (keyup)=\"onCreateNewCategoryKeyup($event)\"\n #newCategoryInput>\n <div class=\"new-category-actions\">\n <button \n type=\"button\" \n class=\"action-btn action-btn-primary\"\n (click)=\"createAndSelectNewCategory()\">\n <i class=\"fa-solid fa-check\"></i>\n </button>\n <button \n type=\"button\" \n class=\"action-btn\"\n (click)=\"cancelNewCategory()\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n </div>\n }\n } @else {\n <div class=\"field-value\">\n {{ getCategoryName(selectedPrompt.prompt.CategoryID) }}\n </div>\n }\n </div>\n \n <!-- Type -->\n <div class=\"form-field\">\n <label class=\"field-label\">Type</label>\n @if (isEditing) {\n <select \n class=\"field-select\"\n [(ngModel)]=\"selectedPrompt.prompt.TypeID\"\n (change)=\"isDirty = true\">\n <option value=\"\">Select type...</option>\n @for (type of types; track type.ID) {\n <option [value]=\"type.ID\">{{ type.Name }}</option>\n }\n </select>\n } @else {\n <div class=\"field-value\">\n {{ getTypeName(selectedPrompt.prompt.TypeID) }}\n </div>\n }\n </div>\n \n <!-- Status -->\n <div class=\"form-field\">\n <label class=\"field-label\">Status</label>\n @if (isEditing) {\n <select \n class=\"field-select\"\n [(ngModel)]=\"selectedPrompt.prompt.Status\"\n (change)=\"isDirty = true\">\n <option value=\"Active\">Active</option>\n <option value=\"Pending\">Pending</option>\n <option value=\"Disabled\">Disabled</option>\n </select>\n } @else {\n <div class=\"field-value\">\n <span class=\"status-badge status-{{ selectedPrompt.prompt.Status.toLowerCase() }}\">\n {{ selectedPrompt.prompt.Status }}\n </span>\n </div>\n }\n </div>\n \n <!-- Template Info -->\n @if (selectedPrompt.template) {\n <div class=\"template-info-section\">\n <h4>Template Information</h4>\n <div class=\"template-details\">\n <div><strong>Template:</strong> {{ selectedPrompt.template.Name }}</div>\n @if (selectedPrompt.template.Description) {\n <div><strong>Description:</strong> {{ selectedPrompt.template.Description }}</div>\n }\n @if (selectedPrompt.templateContent) {\n <div><strong>Content Length:</strong> {{ (selectedPrompt.templateContent.TemplateText || '').length }} characters</div>\n }\n </div>\n </div>\n }\n </div>\n </kendo-splitter-pane>\n \n <!-- Template Editor Panel -->\n <kendo-splitter-pane \n [resizable]=\"true\"\n [scrollable]=\"true\">\n <div class=\"template-editor-panel\">\n <div class=\"editor-header\">\n <h3>Template Content</h3>\n <div class=\"editor-info\">\n @if (isEditing) {\n <span class=\"editor-badge editor-badge-info\">Nunjucks Template</span>\n @if (isDirty) {\n <span class=\"editor-badge editor-badge-warning\">Unsaved Changes</span>\n }\n } @else {\n <span class=\"editor-badge editor-badge-secondary\">Read Only</span>\n }\n </div>\n </div>\n \n <div class=\"editor-container\">\n <mj-code-editor\n [value]=\"editorContent\"\n [languages]=\"supportedLanguages\"\n [language]=\"editorLanguage\"\n [placeholder]=\"'Enter your Nunjucks template here...'\"\n [lineWrapping]=\"true\"\n [highlightWhitespace]=\"false\"\n [indentWithTab]=\"true\"\n [indentUnit]=\"' '\"\n [readonly]=\"!isEditing\"\n (change)=\"onEditorContentChange($event)\">\n </mj-code-editor>\n </div>\n \n <!-- Editor Help -->\n @if (isEditing) {\n <div class=\"editor-help\">\n <div class=\"help-section\">\n <h5>Nunjucks Template Syntax</h5>\n <div class=\"syntax-examples\">\n <div class=\"syntax-item\">\n <code>{{ \"{{ variable }}\" }}</code> - Variable output\n </div>\n <div class=\"syntax-item\">\n <code>{{ \"{% if condition %} ... {% endif %}\" }}</code> - Conditionals\n </div>\n <div class=\"syntax-item\">\n <code>{{ \"{% for item in items %} ... {% endfor %}\" }}</code> - Loops\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n </kendo-splitter-pane>\n </kendo-splitter>\n </div>\n </div>\n }\n</div>", styles: [".prompt-management-container {\n overflow: hidden;\n padding: 4px;\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.dashboard-header {\n margin-bottom: 16px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-shrink: 0;\n \n .header-info {\n flex: 1;\n display: flex;\n align-items: center;\n gap: 12px;\n }\n \n .filter-toggle-btn {\n padding: 6px 10px;\n border: 1px solid #ddd;\n border-radius: 4px;\n background: white;\n cursor: pointer;\n font-size: 11px;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.2s;\n color: #555;\n \n &:hover {\n background-color: #f0f0f0;\n border-color: #2196f3;\n color: #2196f3;\n }\n \n .fa-solid {\n font-size: 10px;\n }\n }\n \n .prompt-count {\n font-size: 12px;\n color: #2196f3;\n font-weight: 600;\n background: rgba(33, 150, 243, 0.1);\n padding: 4px 8px;\n border-radius: 4px;\n border: 1px solid rgba(33, 150, 243, 0.2);\n }\n \n .header-controls {\n display: flex;\n gap: 8px;\n \n .control-btn {\n padding: 8px 12px;\n border: 1px solid #ccc;\n border-radius: 4px;\n background: white;\n cursor: pointer;\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.2s;\n \n &:hover {\n background-color: #f0f0f0;\n border-color: #2196f3;\n }\n \n &.active {\n background-color: #2196f3;\n border-color: #2196f3;\n color: white;\n }\n \n &.control-btn-primary {\n background-color: #2196f3;\n border-color: #2196f3;\n color: white;\n \n &:hover {\n background-color: #1976d2;\n }\n }\n \n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n \n &:hover {\n background-color: white;\n border-color: #ccc;\n }\n }\n \n .fa-solid {\n font-size: 14px;\n }\n }\n }\n}\n\n// Filters now handled by filter panel component\n\n.loading-container, .error-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background: #fafafa;\n flex: 1;\n \n p {\n color: #666;\n font-size: 14px;\n }\n}\n\n.error-message {\n color: #d32f2f;\n font-weight: 500;\n \n .fa-solid {\n margin-right: 8px;\n }\n}\n\n.loading-content {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 16px;\n}\n\n.loading-spinner {\n display: inline-block;\n position: relative;\n width: 40px;\n height: 40px;\n \n .spinner-ring {\n box-sizing: border-box;\n display: block;\n position: absolute;\n width: 32px;\n height: 32px;\n margin: 4px;\n border: 3px solid #2196f3;\n border-radius: 50%;\n animation: loading-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: #2196f3 transparent transparent transparent;\n \n &:nth-child(1) { animation-delay: -0.45s; }\n &:nth-child(2) { animation-delay: -0.3s; }\n &:nth-child(3) { animation-delay: -0.15s; }\n }\n}\n\n@keyframes loading-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n.empty-state {\n text-align: center;\n padding: 60px 20px;\n color: #666;\n \n .fa-solid {\n font-size: 48px;\n margin-bottom: 16px;\n color: #ccc;\n }\n \n h3 {\n margin: 0 0 8px 0;\n color: #333;\n font-size: 18px;\n font-weight: 500;\n }\n \n p {\n margin: 0;\n font-size: 14px;\n }\n}\n\n.prompts-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));\n gap: 16px;\n flex: 1;\n overflow-y: auto;\n}\n\n.prompt-card {\n background: white;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 16px;\n transition: all 0.2s ease;\n height: fit-content;\n cursor: pointer;\n \n &:hover {\n border-color: #2196f3;\n box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);\n transform: translateY(-1px);\n }\n \n .card-header {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n margin-bottom: 12px;\n \n .prompt-info {\n display: flex;\n gap: 12px;\n flex: 1;\n \n .prompt-icon {\n color: #2196f3;\n font-size: 20px;\n margin-top: 2px;\n }\n \n .prompt-details {\n flex: 1;\n \n .prompt-name {\n margin: 0 0 4px 0;\n font-size: 16px;\n font-weight: 500;\n color: #333;\n }\n \n .prompt-meta {\n font-size: 12px;\n color: #666;\n \n .prompt-type {\n margin-left: 8px;\n }\n }\n }\n }\n }\n \n .card-body {\n margin-bottom: 12px;\n \n .prompt-description {\n margin-bottom: 12px;\n color: #555;\n font-size: 13px;\n line-height: 1.4;\n }\n \n .template-info {\n .template-item {\n display: flex;\n align-items: center;\n margin-bottom: 4px;\n font-size: 12px;\n color: #666;\n \n .fa-solid {\n margin-right: 6px;\n color: #999;\n }\n }\n \n .template-content-info {\n font-size: 11px;\n color: #999;\n }\n }\n }\n \n .card-actions {\n display: flex;\n gap: 8px;\n border-top: 1px solid #f0f0f0;\n padding-top: 12px;\n \n .action-btn {\n padding: 6px 12px;\n border: 1px solid #ddd;\n border-radius: 3px;\n background: white;\n cursor: pointer;\n font-size: 11px;\n display: flex;\n align-items: center;\n gap: 4px;\n transition: all 0.2s;\n \n &:hover {\n background-color: #f5f5f5;\n border-color: #bbb;\n }\n \n &.action-btn-primary {\n background-color: #2196f3;\n border-color: #2196f3;\n color: white;\n \n &:hover {\n background-color: #1976d2;\n }\n }\n \n &.action-btn-danger {\n background-color: #f44336;\n border-color: #f44336;\n color: white;\n \n &:hover {\n background-color: #d32f2f;\n }\n }\n \n .fa-solid {\n font-size: 10px;\n }\n }\n }\n}\n\n// Editor View\n.editor-view {\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: hidden;\n}\n\n.editor-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 16px;\n padding-bottom: 16px;\n border-bottom: 1px solid #e0e0e0;\n \n .breadcrumb-section {\n .back-btn {\n background: none;\n border: none;\n color: #2196f3;\n cursor: pointer;\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 6px;\n \n &:hover {\n text-decoration: underline;\n }\n }\n }\n \n .editor-title {\n flex: 1;\n margin: 0 20px;\n \n h2 {\n margin: 0;\n font-size: 18px;\n font-weight: 500;\n color: #333;\n display: flex;\n align-items: center;\n gap: 8px;\n }\n }\n \n .editor-actions {\n display: flex;\n gap: 8px;\n }\n}\n\n.editor-content {\n flex: 1;\n overflow: hidden;\n}\n\n.editor-splitter {\n height: 100%;\n \n .k-pane {\n overflow: hidden;\n }\n}\n\n.prompt-details-panel, .template-editor-panel {\n background: white;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 16px;\n height: 100%;\n overflow-y: auto;\n \n h3 {\n margin: 0 0 16px 0;\n font-size: 16px;\n font-weight: 500;\n color: #333;\n border-bottom: 1px solid #f0f0f0;\n padding-bottom: 8px;\n }\n}\n\n.form-field {\n margin-bottom: 16px;\n \n .field-label {\n display: block;\n margin-bottom: 4px;\n font-size: 12px;\n font-weight: 500;\n color: #555;\n }\n \n .field-input, .field-select {\n width: 100%;\n padding: 6px 8px;\n border: 1px solid #ddd;\n border-radius: 3px;\n font-size: 12px;\n \n &:focus {\n outline: none;\n border-color: #2196f3;\n }\n }\n \n .field-textarea {\n width: 100%;\n padding: 6px 8px;\n border: 1px solid #ddd;\n border-radius: 3px;\n font-size: 12px;\n resize: vertical;\n min-height: 60px;\n \n &:focus {\n outline: none;\n border-color: #2196f3;\n }\n }\n \n .field-value {\n padding: 6px 8px;\n background: #f8f9fa;\n border: 1px solid #e0e0e0;\n border-radius: 3px;\n font-size: 12px;\n color: #555;\n }\n}\n\n.template-editor-panel {\n .editor-container {\n margin-bottom: 16px;\n \n .code-editor {\n width: 100%;\n min-height: 300px;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 12px;\n border: 1px solid #ddd;\n border-radius: 3px;\n padding: 8px;\n background: #f8f9fa;\n \n &:focus {\n outline: none;\n border-color: #2196f3;\n }\n }\n \n .code-display {\n border: 1px solid #e0e0e0;\n border-radius: 3px;\n background: #f8f9fa;\n max-height: 400px;\n overflow-y: auto;\n \n pre {\n margin: 0;\n padding: 12px;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 12px;\n line-height: 1.4;\n color: #333;\n \n code {\n background: none;\n padding: 0;\n font-size: inherit;\n color: inherit;\n }\n }\n }\n }\n \n .editor-help {\n .help-section {\n h5 {\n font-size: 13px;\n font-weight: 500;\n margin-bottom: 8px;\n color: #333;\n }\n \n .syntax-examples {\n .syntax-item {\n margin-bottom: 6px;\n padding: 6px 8px;\n background: #f0f0f0;\n border-radius: 3px;\n font-size: 11px;\n \n code {\n background: #e0e0e0;\n padding: 2px 4px;\n border-radius: 2px;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n margin-right: 8px;\n }\n }\n }\n }\n }\n}\n\n// CodeMirror overrides\n.CodeMirror {\n border: 1px solid #ddd !important;\n border-radius: 3px !important;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;\n font-size: 12px !important;\n min-height: 300px !important;\n}\n\n.CodeMirror-focused {\n border-color: #2196f3 !important;\n}\n\n// Status badges\n.status-badge {\n padding: 2px 6px;\n border-radius: 3px;\n font-size: 10px;\n font-weight: 500;\n text-transform: uppercase;\n \n &.status-active {\n background: #e8f5e8;\n color: #2e7d32;\n }\n \n &.status-pending {\n background: #fff3e0;\n color: #f57c00;\n }\n \n &.status-disabled {\n background: #ffebee;\n color: #c62828;\n }\n}\n\n// Editor badges\n.editor-badge {\n padding: 2px 6px;\n border-radius: 3px;\n font-size: 10px;\n font-weight: 500;\n margin-left: 8px;\n \n &.editor-badge-info {\n background: #e3f2fd;\n color: #1976d2;\n }\n \n &.editor-badge-warning {\n background: #fff3e0;\n color: #f57c00;\n }\n \n &.editor-badge-secondary {\n background: #f5f5f5;\n color: #666;\n }\n}\n\n// New category creation\n.new-category-container {\n display: flex;\n gap: 4px;\n align-items: center;\n \n .field-input {\n flex: 1;\n }\n \n .new-category-actions {\n display: flex;\n gap: 2px;\n \n .action-btn {\n padding: 4px 6px;\n border: 1px solid #ddd;\n border-radius: 3px;\n background: white;\n cursor: pointer;\n font-size: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 24px;\n height: 24px;\n \n &:hover {\n background-color: #f5f5f5;\n }\n \n &.action-btn-primary {\n background-color: #2196f3;\n border-color: #2196f3;\n color: white;\n \n &:hover {\n background-color: #1976d2;\n }\n }\n \n .fa-solid {\n font-size: 10px;\n }\n }\n }\n}\n\n.new-category-option {\n color: #2196f3;\n font-style: italic;\n}\n\n// CodeMirror 6 styling\nmj-code-editor {\n display: block;\n border: 1px solid #ddd;\n border-radius: 3px;\n overflow: hidden;\n min-height: 300px;\n \n .cm-editor {\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;\n font-size: 12px !important;\n min-height: 300px;\n }\n \n .cm-focused {\n outline: none !important;\n }\n \n .cm-editor.cm-focused {\n border-color: #2196f3;\n }\n}\n\n// List View Layout\n.list-view {\n display: flex;\n flex-direction: column;\n flex: 1;\n overflow: hidden;\n}\n\n.sub-navigation {\n display: flex;\n gap: 8px;\n margin-bottom: 16px;\n padding: 8px 0;\n border-bottom: 1px solid #e0e0e0;\n flex-shrink: 0;\n\n .sub-nav-btn {\n padding: 8px 12px;\n border: 1px solid #ddd;\n border-radius: 4px;\n background: white;\n cursor: pointer;\n font-size: 12px;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.2s;\n color: #555;\n font-weight: 500;\n\n &:hover {\n background-color: #f0f0f0;\n border-color: #2196f3;\n color: #2196f3;\n }\n\n &.active {\n background-color: #2196f3;\n border-color: #2196f3;\n color: white;\n box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);\n }\n\n .fa-solid {\n font-size: 11px;\n }\n }\n}\n\n.main-content {\n flex: 1;\n overflow: hidden;\n}\n\n.main-splitter {\n height: 100%;\n \n .k-pane {\n overflow: hidden;\n }\n}\n\n.prompts-content {\n height: 100%;\n overflow-y: auto;\n padding: 0 16px;\n}"] }]
1345
- }], () => [{ type: i1.MJNotificationService }], { openEntityRecord: [{
1346
- type: Output
1347
- }], stateChange: [{
1348
- type: Output
1349
- }] }); })();
1350
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PromptManagementComponent, { className: "PromptManagementComponent", filePath: "src/AI/components/prompts/prompt-management.component.ts", lineNumber: 24 }); })();
1351
- //# sourceMappingURL=prompt-management.component.js.map