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