@memberjunction/ng-explorer-core 5.41.0 → 5.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 (25) hide show
  1. package/dist/lib/resource-wrappers/chat-collections-resource.component.d.ts +7 -0
  2. package/dist/lib/resource-wrappers/chat-collections-resource.component.d.ts.map +1 -1
  3. package/dist/lib/resource-wrappers/chat-collections-resource.component.js +42 -22
  4. package/dist/lib/resource-wrappers/chat-collections-resource.component.js.map +1 -1
  5. package/dist/lib/resource-wrappers/livekit-room-resource.component.d.ts +119 -0
  6. package/dist/lib/resource-wrappers/livekit-room-resource.component.d.ts.map +1 -0
  7. package/dist/lib/resource-wrappers/livekit-room-resource.component.js +698 -0
  8. package/dist/lib/resource-wrappers/livekit-room-resource.component.js.map +1 -0
  9. package/dist/lib/shell/components/header/app-nav.component.js +7 -4
  10. package/dist/lib/shell/components/header/app-nav.component.js.map +1 -1
  11. package/dist/lib/shell/components/header/app-switcher.component.js +11 -6
  12. package/dist/lib/shell/components/header/app-switcher.component.js.map +1 -1
  13. package/dist/lib/shell/shell.module.d.ts +1 -1
  14. package/dist/lib/shell/shell.module.d.ts.map +1 -1
  15. package/dist/lib/shell/shell.module.js +3 -1
  16. package/dist/lib/shell/shell.module.js.map +1 -1
  17. package/dist/lib/user-notifications/user-notifications.component.d.ts +6 -0
  18. package/dist/lib/user-notifications/user-notifications.component.d.ts.map +1 -1
  19. package/dist/lib/user-notifications/user-notifications.component.js +32 -1
  20. package/dist/lib/user-notifications/user-notifications.component.js.map +1 -1
  21. package/dist/module.d.ts +33 -31
  22. package/dist/module.d.ts.map +1 -1
  23. package/dist/module.js +11 -4
  24. package/dist/module.js.map +1 -1
  25. package/package.json +47 -46
@@ -0,0 +1,698 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Component, ChangeDetectorRef, inject } from '@angular/core';
8
+ import { BaseResourceComponent } from '@memberjunction/ng-shared';
9
+ import { RegisterClass, UUIDsEqual } from '@memberjunction/global';
10
+ import { AIEngineBase } from '@memberjunction/ai-engine-base';
11
+ import { RunView } from '@memberjunction/core';
12
+ import { GraphQLLiveKitClient } from '@memberjunction/graphql-dataprovider';
13
+ import { UserHoldsAuthorization, REALTIME_ADVANCED_SESSION_CONTROLS } from '@memberjunction/ng-conversations';
14
+ import * as i0 from "@angular/core";
15
+ import * as i1 from "@angular/forms";
16
+ import * as i2 from "@memberjunction/ng-ui-components";
17
+ import * as i3 from "@memberjunction/ng-mj-livekit-room";
18
+ const _forTrack0 = ($index, $item) => $item.ID;
19
+ const _forTrack1 = ($index, $item) => $item.ModelID;
20
+ function LiveKitRoomResource_Case_0_Template(rf, ctx) { if (rf & 1) {
21
+ const _r1 = i0.ɵɵgetCurrentView();
22
+ i0.ɵɵelementStart(0, "mj-livekit-agent-room", 4);
23
+ i0.ɵɵlistener("Connected", function LiveKitRoomResource_Case_0_Template_mj_livekit_agent_room_Connected_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.NotifyLoadComplete()); })("ErrorOccurred", function LiveKitRoomResource_Case_0_Template_mj_livekit_agent_room_ErrorOccurred_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.NotifyLoadComplete()); })("InvitePeopleRequested", function LiveKitRoomResource_Case_0_Template_mj_livekit_agent_room_InvitePeopleRequested_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.openInvite($event)); });
24
+ i0.ɵɵelementEnd();
25
+ } if (rf & 2) {
26
+ const ctx_r1 = i0.ɵɵnextContext();
27
+ i0.ɵɵproperty("Mode", ctx_r1.roomMode)("RoomName", ctx_r1.joinRoomName)("AgentID", ctx_r1.agentId)("TargetAgentID", ctx_r1.targetAgentId)("AgentName", ctx_r1.targetAgentName)("AvailableAgents", ctx_r1.agents)("RealtimeModelID", ctx_r1.selectedModelId)("RealtimeVoice", ctx_r1.selectedVoice)("CanPickModelVoice", ctx_r1.canPickModelVoice)("AvailableModels", ctx_r1.realtimeModels)("Provider", ctx_r1.ProviderToUse)("ShowAgentState", true)("ShowWhiteboard", true)("EnableLayoutSwitcher", true)("EnablePinning", true);
28
+ } }
29
+ function LiveKitRoomResource_Case_1_For_12_Template(rf, ctx) { if (rf & 1) {
30
+ i0.ɵɵelementStart(0, "option", 12);
31
+ i0.ɵɵtext(1);
32
+ i0.ɵɵelementEnd();
33
+ } if (rf & 2) {
34
+ const a_r4 = ctx.$implicit;
35
+ const ctx_r1 = i0.ɵɵnextContext(2);
36
+ i0.ɵɵproperty("value", a_r4.ID)("selected", ctx_r1.UUIDsEqual(a_r4.ID, ctx_r1.selectedTargetId));
37
+ i0.ɵɵadvance();
38
+ i0.ɵɵtextInterpolate(a_r4.Name);
39
+ } }
40
+ function LiveKitRoomResource_Case_1_Conditional_13_Template(rf, ctx) { if (rf & 1) {
41
+ i0.ɵɵelementStart(0, "p", 13);
42
+ i0.ɵɵtext(1);
43
+ i0.ɵɵelementEnd();
44
+ } if (rf & 2) {
45
+ const ctx_r1 = i0.ɵɵnextContext(2);
46
+ i0.ɵɵadvance();
47
+ i0.ɵɵtextInterpolate(ctx_r1.selectedDescription);
48
+ } }
49
+ function LiveKitRoomResource_Case_1_Conditional_14_For_8_Template(rf, ctx) { if (rf & 1) {
50
+ i0.ɵɵelementStart(0, "option", 12);
51
+ i0.ɵɵtext(1);
52
+ i0.ɵɵelementEnd();
53
+ } if (rf & 2) {
54
+ const m_r6 = ctx.$implicit;
55
+ const ctx_r1 = i0.ɵɵnextContext(3);
56
+ i0.ɵɵproperty("value", m_r6.ModelID)("selected", ctx_r1.UUIDsEqual(m_r6.ModelID, ctx_r1.selectedModelId));
57
+ i0.ɵɵadvance();
58
+ i0.ɵɵtextInterpolate(m_r6.ModelName);
59
+ } }
60
+ function LiveKitRoomResource_Case_1_Conditional_14_Conditional_9_For_8_Template(rf, ctx) { if (rf & 1) {
61
+ i0.ɵɵelementStart(0, "option", 12);
62
+ i0.ɵɵtext(1);
63
+ i0.ɵɵelementEnd();
64
+ } if (rf & 2) {
65
+ const v_r8 = ctx.$implicit;
66
+ const ctx_r1 = i0.ɵɵnextContext(4);
67
+ i0.ɵɵproperty("value", v_r8.ID)("selected", v_r8.ID === ctx_r1.selectedVoice);
68
+ i0.ɵɵadvance();
69
+ i0.ɵɵtextInterpolate(v_r8.Name);
70
+ } }
71
+ function LiveKitRoomResource_Case_1_Conditional_14_Conditional_9_Template(rf, ctx) { if (rf & 1) {
72
+ const _r7 = i0.ɵɵgetCurrentView();
73
+ i0.ɵɵelementStart(0, "label", 20);
74
+ i0.ɵɵtext(1, "Voice ");
75
+ i0.ɵɵelementStart(2, "span", 17);
76
+ i0.ɵɵtext(3, "dev");
77
+ i0.ɵɵelementEnd()();
78
+ i0.ɵɵelementStart(4, "select", 21);
79
+ i0.ɵɵlistener("change", function LiveKitRoomResource_Case_1_Conditional_14_Conditional_9_Template_select_change_4_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onVoiceChange($event)); });
80
+ i0.ɵɵelementStart(5, "option", 19);
81
+ i0.ɵɵtext(6, "Default voice");
82
+ i0.ɵɵelementEnd();
83
+ i0.ɵɵrepeaterCreate(7, LiveKitRoomResource_Case_1_Conditional_14_Conditional_9_For_8_Template, 2, 3, "option", 12, _forTrack0);
84
+ i0.ɵɵelementEnd();
85
+ } if (rf & 2) {
86
+ const ctx_r1 = i0.ɵɵnextContext(3);
87
+ i0.ɵɵadvance(7);
88
+ i0.ɵɵrepeater(ctx_r1.selectedModelVoices);
89
+ } }
90
+ function LiveKitRoomResource_Case_1_Conditional_14_Template(rf, ctx) { if (rf & 1) {
91
+ const _r5 = i0.ɵɵgetCurrentView();
92
+ i0.ɵɵelementStart(0, "label", 16);
93
+ i0.ɵɵtext(1, "Model ");
94
+ i0.ɵɵelementStart(2, "span", 17);
95
+ i0.ɵɵtext(3, "dev");
96
+ i0.ɵɵelementEnd()();
97
+ i0.ɵɵelementStart(4, "select", 18);
98
+ i0.ɵɵlistener("change", function LiveKitRoomResource_Case_1_Conditional_14_Template_select_change_4_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onModelChange($event)); });
99
+ i0.ɵɵelementStart(5, "option", 19);
100
+ i0.ɵɵtext(6, "Default model");
101
+ i0.ɵɵelementEnd();
102
+ i0.ɵɵrepeaterCreate(7, LiveKitRoomResource_Case_1_Conditional_14_For_8_Template, 2, 3, "option", 12, _forTrack1);
103
+ i0.ɵɵelementEnd();
104
+ i0.ɵɵconditionalCreate(9, LiveKitRoomResource_Case_1_Conditional_14_Conditional_9_Template, 9, 0);
105
+ } if (rf & 2) {
106
+ const ctx_r1 = i0.ɵɵnextContext(2);
107
+ i0.ɵɵadvance(7);
108
+ i0.ɵɵrepeater(ctx_r1.realtimeModels);
109
+ i0.ɵɵadvance(2);
110
+ i0.ɵɵconditional(ctx_r1.selectedModelVoices.length ? 9 : -1);
111
+ } }
112
+ function LiveKitRoomResource_Case_1_Template(rf, ctx) { if (rf & 1) {
113
+ const _r3 = i0.ɵɵgetCurrentView();
114
+ i0.ɵɵelementStart(0, "div", 1)(1, "div", 5)(2, "div", 6);
115
+ i0.ɵɵelement(3, "i", 7);
116
+ i0.ɵɵelementEnd();
117
+ i0.ɵɵelementStart(4, "h2", 8);
118
+ i0.ɵɵtext(5, "Start a call");
119
+ i0.ɵɵelementEnd();
120
+ i0.ɵɵelementStart(6, "p", 9);
121
+ i0.ɵɵtext(7, " Choose the agent you want to talk to. You can add more agents (and invite people) once you're in the room. ");
122
+ i0.ɵɵelementEnd();
123
+ i0.ɵɵelementStart(8, "label", 10);
124
+ i0.ɵɵtext(9, "Agent");
125
+ i0.ɵɵelementEnd();
126
+ i0.ɵɵelementStart(10, "select", 11);
127
+ i0.ɵɵlistener("change", function LiveKitRoomResource_Case_1_Template_select_change_10_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onTargetChange($event)); });
128
+ i0.ɵɵrepeaterCreate(11, LiveKitRoomResource_Case_1_For_12_Template, 2, 3, "option", 12, _forTrack0);
129
+ i0.ɵɵelementEnd();
130
+ i0.ɵɵconditionalCreate(13, LiveKitRoomResource_Case_1_Conditional_13_Template, 2, 1, "p", 13);
131
+ i0.ɵɵconditionalCreate(14, LiveKitRoomResource_Case_1_Conditional_14_Template, 10, 1);
132
+ i0.ɵɵelementStart(15, "button", 14);
133
+ i0.ɵɵlistener("click", function LiveKitRoomResource_Case_1_Template_button_click_15_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.startCall()); });
134
+ i0.ɵɵelement(16, "i", 15);
135
+ i0.ɵɵtext(17, " Start call ");
136
+ i0.ɵɵelementEnd()()();
137
+ } if (rf & 2) {
138
+ const ctx_r1 = i0.ɵɵnextContext();
139
+ i0.ɵɵadvance(11);
140
+ i0.ɵɵrepeater(ctx_r1.agents);
141
+ i0.ɵɵadvance(2);
142
+ i0.ɵɵconditional(ctx_r1.selectedDescription ? 13 : -1);
143
+ i0.ɵɵadvance();
144
+ i0.ɵɵconditional(ctx_r1.canPickModelVoice && ctx_r1.realtimeModels.length ? 14 : -1);
145
+ i0.ɵɵadvance();
146
+ i0.ɵɵproperty("disabled", !ctx_r1.selectedTargetId);
147
+ } }
148
+ function LiveKitRoomResource_Case_2_Template(rf, ctx) { if (rf & 1) {
149
+ i0.ɵɵelementStart(0, "div", 2);
150
+ i0.ɵɵelement(1, "i", 22);
151
+ i0.ɵɵelementStart(2, "span");
152
+ i0.ɵɵtext(3);
153
+ i0.ɵɵelementEnd()();
154
+ } if (rf & 2) {
155
+ const ctx_r1 = i0.ɵɵnextContext();
156
+ i0.ɵɵadvance(3);
157
+ i0.ɵɵtextInterpolate(ctx_r1.resolveError);
158
+ } }
159
+ function LiveKitRoomResource_Case_3_Template(rf, ctx) { if (rf & 1) {
160
+ i0.ɵɵelementStart(0, "div", 2);
161
+ i0.ɵɵtext(1, "Preparing room\u2026");
162
+ i0.ɵɵelementEnd();
163
+ } }
164
+ function LiveKitRoomResource_Conditional_4_Conditional_8_For_2_Template(rf, ctx) { if (rf & 1) {
165
+ const _r10 = i0.ɵɵgetCurrentView();
166
+ i0.ɵɵelementStart(0, "span", 37);
167
+ i0.ɵɵtext(1);
168
+ i0.ɵɵelementStart(2, "button", 38);
169
+ i0.ɵɵlistener("click", function LiveKitRoomResource_Conditional_4_Conditional_8_For_2_Template_button_click_2_listener() { const u_r11 = i0.ɵɵrestoreView(_r10).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.removeInvitee(u_r11.ID)); });
170
+ i0.ɵɵelement(3, "i", 39);
171
+ i0.ɵɵelementEnd()();
172
+ } if (rf & 2) {
173
+ const u_r11 = ctx.$implicit;
174
+ i0.ɵɵadvance();
175
+ i0.ɵɵtextInterpolate1(" ", u_r11.Name, " ");
176
+ } }
177
+ function LiveKitRoomResource_Conditional_4_Conditional_8_Template(rf, ctx) { if (rf & 1) {
178
+ i0.ɵɵelementStart(0, "div", 30);
179
+ i0.ɵɵrepeaterCreate(1, LiveKitRoomResource_Conditional_4_Conditional_8_For_2_Template, 4, 1, "span", 37, _forTrack0);
180
+ i0.ɵɵelementEnd();
181
+ } if (rf & 2) {
182
+ const ctx_r1 = i0.ɵɵnextContext(2);
183
+ i0.ɵɵadvance();
184
+ i0.ɵɵrepeater(ctx_r1.selectedInvitees);
185
+ } }
186
+ function LiveKitRoomResource_Conditional_4_Conditional_9_For_2_Conditional_3_Template(rf, ctx) { if (rf & 1) {
187
+ i0.ɵɵelementStart(0, "span", 43);
188
+ i0.ɵɵtext(1);
189
+ i0.ɵɵelementEnd();
190
+ } if (rf & 2) {
191
+ const u_r13 = i0.ɵɵnextContext().$implicit;
192
+ i0.ɵɵadvance();
193
+ i0.ɵɵtextInterpolate(u_r13.Email);
194
+ } }
195
+ function LiveKitRoomResource_Conditional_4_Conditional_9_For_2_Template(rf, ctx) { if (rf & 1) {
196
+ const _r12 = i0.ɵɵgetCurrentView();
197
+ i0.ɵɵelementStart(0, "button", 41);
198
+ i0.ɵɵlistener("click", function LiveKitRoomResource_Conditional_4_Conditional_9_For_2_Template_button_click_0_listener() { const u_r13 = i0.ɵɵrestoreView(_r12).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.addInvitee(u_r13)); });
199
+ i0.ɵɵelementStart(1, "span", 42);
200
+ i0.ɵɵtext(2);
201
+ i0.ɵɵelementEnd();
202
+ i0.ɵɵconditionalCreate(3, LiveKitRoomResource_Conditional_4_Conditional_9_For_2_Conditional_3_Template, 2, 1, "span", 43);
203
+ i0.ɵɵelementEnd();
204
+ } if (rf & 2) {
205
+ const u_r13 = ctx.$implicit;
206
+ i0.ɵɵadvance(2);
207
+ i0.ɵɵtextInterpolate(u_r13.Name);
208
+ i0.ɵɵadvance();
209
+ i0.ɵɵconditional(u_r13.Email ? 3 : -1);
210
+ } }
211
+ function LiveKitRoomResource_Conditional_4_Conditional_9_Template(rf, ctx) { if (rf & 1) {
212
+ i0.ɵɵelementStart(0, "div", 31);
213
+ i0.ɵɵrepeaterCreate(1, LiveKitRoomResource_Conditional_4_Conditional_9_For_2_Template, 4, 2, "button", 40, _forTrack0);
214
+ i0.ɵɵelementEnd();
215
+ } if (rf & 2) {
216
+ const ctx_r1 = i0.ɵɵnextContext(2);
217
+ i0.ɵɵadvance();
218
+ i0.ɵɵrepeater(ctx_r1.userResults);
219
+ } }
220
+ function LiveKitRoomResource_Conditional_4_Conditional_10_Template(rf, ctx) { if (rf & 1) {
221
+ i0.ɵɵelementStart(0, "div", 32);
222
+ i0.ɵɵtext(1, "No matching people.");
223
+ i0.ɵɵelementEnd();
224
+ } }
225
+ function LiveKitRoomResource_Conditional_4_Conditional_11_Template(rf, ctx) { if (rf & 1) {
226
+ i0.ɵɵelementStart(0, "div", 33);
227
+ i0.ɵɵtext(1);
228
+ i0.ɵɵelementEnd();
229
+ } if (rf & 2) {
230
+ const ctx_r1 = i0.ɵɵnextContext(2);
231
+ i0.ɵɵadvance();
232
+ i0.ɵɵtextInterpolate(ctx_r1.inviteMessage);
233
+ } }
234
+ function LiveKitRoomResource_Conditional_4_Template(rf, ctx) { if (rf & 1) {
235
+ const _r9 = i0.ɵɵgetCurrentView();
236
+ i0.ɵɵelementStart(0, "mj-dialog", 23);
237
+ i0.ɵɵlistener("Close", function LiveKitRoomResource_Conditional_4_Template_mj_dialog_Close_0_listener() { i0.ɵɵrestoreView(_r9); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.showInvite = false); });
238
+ i0.ɵɵelementStart(1, "div", 24)(2, "p", 25);
239
+ i0.ɵɵtext(3, "They'll get an in-app notification (and an email if Comms is set up) to join this room.");
240
+ i0.ɵɵelementEnd();
241
+ i0.ɵɵelementStart(4, "div", 26)(5, "input", 27);
242
+ i0.ɵɵlistener("input", function LiveKitRoomResource_Conditional_4_Template_input_input_5_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.userSearch = $event.target.value); })("keydown.enter", function LiveKitRoomResource_Conditional_4_Template_input_keydown_enter_5_listener() { i0.ɵɵrestoreView(_r9); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.searchUsers()); });
243
+ i0.ɵɵelementEnd();
244
+ i0.ɵɵelementStart(6, "button", 28);
245
+ i0.ɵɵlistener("click", function LiveKitRoomResource_Conditional_4_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r9); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.searchUsers()); });
246
+ i0.ɵɵelement(7, "i", 29);
247
+ i0.ɵɵelementEnd()();
248
+ i0.ɵɵconditionalCreate(8, LiveKitRoomResource_Conditional_4_Conditional_8_Template, 3, 0, "div", 30);
249
+ i0.ɵɵconditionalCreate(9, LiveKitRoomResource_Conditional_4_Conditional_9_Template, 3, 0, "div", 31)(10, LiveKitRoomResource_Conditional_4_Conditional_10_Template, 2, 0, "div", 32);
250
+ i0.ɵɵconditionalCreate(11, LiveKitRoomResource_Conditional_4_Conditional_11_Template, 2, 1, "div", 33);
251
+ i0.ɵɵelementStart(12, "div", 34)(13, "button", 35);
252
+ i0.ɵɵlistener("click", function LiveKitRoomResource_Conditional_4_Template_button_click_13_listener() { i0.ɵɵrestoreView(_r9); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.sendInvites()); });
253
+ i0.ɵɵelement(14, "i", 29);
254
+ i0.ɵɵtext(15);
255
+ i0.ɵɵelementEnd();
256
+ i0.ɵɵelementStart(16, "button", 36);
257
+ i0.ɵɵlistener("click", function LiveKitRoomResource_Conditional_4_Template_button_click_16_listener() { i0.ɵɵrestoreView(_r9); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.showInvite = false); });
258
+ i0.ɵɵtext(17, "Cancel");
259
+ i0.ɵɵelementEnd()()()();
260
+ } if (rf & 2) {
261
+ const ctx_r1 = i0.ɵɵnextContext();
262
+ i0.ɵɵproperty("Visible", ctx_r1.showInvite)("Width", 440);
263
+ i0.ɵɵadvance(5);
264
+ i0.ɵɵproperty("value", ctx_r1.userSearch);
265
+ i0.ɵɵadvance();
266
+ i0.ɵɵproperty("disabled", ctx_r1.searching);
267
+ i0.ɵɵadvance();
268
+ i0.ɵɵclassProp("fa-magnifying-glass", !ctx_r1.searching)("fa-spinner", ctx_r1.searching)("fa-spin", ctx_r1.searching);
269
+ i0.ɵɵadvance();
270
+ i0.ɵɵconditional(ctx_r1.selectedInvitees.length ? 8 : -1);
271
+ i0.ɵɵadvance();
272
+ i0.ɵɵconditional(ctx_r1.userResults.length ? 9 : ctx_r1.searched && !ctx_r1.searching ? 10 : -1);
273
+ i0.ɵɵadvance(2);
274
+ i0.ɵɵconditional(ctx_r1.inviteMessage ? 11 : -1);
275
+ i0.ɵɵadvance(2);
276
+ i0.ɵɵproperty("disabled", !ctx_r1.selectedInvitees.length || ctx_r1.inviting);
277
+ i0.ɵɵadvance();
278
+ i0.ɵɵclassProp("fa-paper-plane", !ctx_r1.inviting)("fa-spinner", ctx_r1.inviting)("fa-spin", ctx_r1.inviting);
279
+ i0.ɵɵadvance();
280
+ i0.ɵɵtextInterpolate1(" Invite ", ctx_r1.selectedInvitees.length || "", " ");
281
+ } }
282
+ /**
283
+ * LiveKit Room Resource — hosts the MJ-native LiveKit room (`mj-livekit-agent-room`) as an Explorer tab
284
+ * (the **Meet** app's "Live Room").
285
+ *
286
+ * Flow: resolve the Realtime **co-agent** (voice front-end), then show a **pre-join picker** to choose
287
+ * the **target** agent you're "calling" (the co-agent voices it via `invoke-target-agent` — without a
288
+ * target it sits idle). "Start call" joins the room. An explicit `ResourceRecordID` skips the picker and
289
+ * calls that agent directly.
290
+ *
291
+ * Registered via `@RegisterClass(BaseResourceComponent, 'LiveKitRoomResource')`.
292
+ */
293
+ let LiveKitRoomResource = class LiveKitRoomResource extends BaseResourceComponent {
294
+ /** Render phase: spinner while resolving → pre-join picker → live room (or an error message). */
295
+ phase = 'loading';
296
+ /** `'agent'` to start/voice an agent (the default), or `'join'` when opened from an invite link. */
297
+ roomMode = 'agent';
298
+ /** The room to JOIN when opened via an invite link (`?room=…`); null in agent mode. */
299
+ joinRoomName = null;
300
+ /** The Realtime co-agent (voice front-end) id — the resolved default Realtime-type agent. */
301
+ agentId = null;
302
+ /** The TARGET agent the co-agent voices (the one being "called"); the bot is named after it. */
303
+ targetAgentId = null;
304
+ /** The target agent's display name — used as the bot name + addressing word ("Sage, …"). */
305
+ targetAgentName = null;
306
+ /** The agents offered in the pre-join picker (active, excluding the Realtime co-agent itself). */
307
+ agents = [];
308
+ /** The currently-selected target in the picker (defaults to "Sage" when present). */
309
+ selectedTargetId = null;
310
+ // ── Dev model/voice override (gated by the `Realtime: Advanced Session Controls` authorization) ──────
311
+ /** Whether the current user may override the realtime model/voice (drives the dev pickers). */
312
+ canPickModelVoice = false;
313
+ /** Active Realtime models + their voices (loaded once when the user can override). */
314
+ realtimeModels = [];
315
+ /** The MODEL override chosen for the FIRST agent in the pre-join picker (null = default). */
316
+ selectedModelId = null;
317
+ /** The VOICE override chosen for the FIRST agent in the pre-join picker (null = default). */
318
+ selectedVoice = null;
319
+ /** Voices for the model chosen in the pre-join picker. */
320
+ get selectedModelVoices() {
321
+ return this.realtimeModels.find((m) => UUIDsEqual(m.ModelID, this.selectedModelId))?.Voices ?? [];
322
+ }
323
+ /** Records the pre-join MODEL choice; clears the voice so it can't outlive a model switch. */
324
+ onModelChange(event) {
325
+ this.selectedModelId = event.target.value || null;
326
+ this.selectedVoice = null;
327
+ }
328
+ /** Records the pre-join VOICE choice. */
329
+ onVoiceChange(event) {
330
+ this.selectedVoice = event.target.value || null;
331
+ }
332
+ /** Exposed for template use — platform-safe UUID equality (SQL upper vs PG lower). */
333
+ UUIDsEqual = UUIDsEqual;
334
+ /** Set when no co-agent could be resolved — shown instead of the room. */
335
+ resolveError = null;
336
+ // ── "Invite people" dialog state ─────────────────────────────────────────────────
337
+ /** Whether the invite-people dialog is open. */
338
+ showInvite = false;
339
+ /** The room the invite targets (the live room name). */
340
+ inviteRoomName = null;
341
+ /** Current search text in the people search box. */
342
+ userSearch = '';
343
+ /** People matching the last search (minus already-selected + the current user). */
344
+ userResults = [];
345
+ /** People chosen to invite. */
346
+ selectedInvitees = [];
347
+ /** True while a people search is running. */
348
+ searching = false;
349
+ /** True once a search has run (drives the "no matches" empty state). */
350
+ searched = false;
351
+ /** True while invites are being sent. */
352
+ inviting = false;
353
+ /** Result/status message under the dialog. */
354
+ inviteMessage = null;
355
+ cdr = inject(ChangeDetectorRef);
356
+ /** Description of the selected target, shown under the picker. */
357
+ get selectedDescription() {
358
+ return this.agents.find((a) => UUIDsEqual(a.ID, this.selectedTargetId))?.Description ?? null;
359
+ }
360
+ ngOnInit() {
361
+ super.ngOnInit();
362
+ this.resolve();
363
+ }
364
+ /**
365
+ * Resolves the co-agent + target choices. Synchronous when the AI engine is already loaded (the common
366
+ * case — it bootstraps at startup) so the first render is settled (avoids NG0100 from an async branch
367
+ * flip under the app's frequent change-detection); a cold engine takes the async path and flushes.
368
+ */
369
+ resolve() {
370
+ // Invite link (?room=…): join that existing room directly — no agent resolution / picker needed.
371
+ const invitedRoom = this.GetQueryParams()?.['room']?.trim();
372
+ if (invitedRoom) {
373
+ this.roomMode = 'join';
374
+ this.joinRoomName = invitedRoom;
375
+ this.phase = 'live';
376
+ this.NotifyLoadComplete();
377
+ return;
378
+ }
379
+ if (AIEngineBase.Instance.Loaded) {
380
+ this.applyResolution();
381
+ return;
382
+ }
383
+ void AIEngineBase.Instance.Config(false, undefined, this.ProviderToUse).then(() => {
384
+ this.applyResolution();
385
+ this.cdr.detectChanges();
386
+ });
387
+ }
388
+ /** Resolves the co-agent, builds the target list, and chooses the next phase (live for an explicit record, else picker). */
389
+ applyResolution() {
390
+ const realtimeType = AIEngineBase.Instance.AgentTypes.find((t) => t.Name?.trim().toLowerCase() === 'realtime');
391
+ const coAgent = realtimeType
392
+ ? AIEngineBase.Instance.Agents.find((a) => a.Status === 'Active' && UUIDsEqual(a.TypeID, realtimeType.ID))
393
+ : undefined;
394
+ if (!coAgent) {
395
+ this.resolveError =
396
+ 'No active Realtime agent is configured, so the Live Room has no voice to bring in. ' +
397
+ 'Create a Realtime-type AI Agent (e.g. "Realtime Co-Agent") and try again.';
398
+ this.phase = 'error';
399
+ this.NotifyLoadComplete();
400
+ return;
401
+ }
402
+ this.agentId = coAgent.ID;
403
+ // Dev model/voice override: gate on the `Realtime: Advanced Session Controls` authorization and, when
404
+ // held, load the active models + their voices for the pickers (here and the in-room add-agent control).
405
+ this.canPickModelVoice = UserHoldsAuthorization(this.ProviderToUse?.CurrentUser, REALTIME_ADVANCED_SESSION_CONTROLS, this.ProviderToUse);
406
+ if (this.canPickModelVoice) {
407
+ void this.loadRealtimeModels();
408
+ }
409
+ // Target candidates: every active agent EXCEPT the Realtime co-agents (they voice a target, not themselves).
410
+ this.agents = AIEngineBase.Instance.Agents
411
+ .filter((a) => a.Status === 'Active' && (!realtimeType || !UUIDsEqual(a.TypeID, realtimeType.ID)))
412
+ .map((a) => ({ ID: a.ID, Name: a.Name ?? '(unnamed)', Description: a.Description ?? null }))
413
+ .sort((a, b) => a.Name.localeCompare(b.Name));
414
+ // An explicit record id (deep link to a specific agent) skips the picker and calls it directly.
415
+ const explicit = this.Data?.ResourceRecordID ? String(this.Data.ResourceRecordID) : null;
416
+ if (explicit) {
417
+ this.selectedTargetId = explicit;
418
+ this.startCall();
419
+ return;
420
+ }
421
+ // Default the picker to the general assistant "Sage" when present, else the first candidate.
422
+ this.selectedTargetId =
423
+ this.agents.find((a) => a.Name.trim().toLowerCase() === 'sage')?.ID ?? this.agents[0]?.ID ?? null;
424
+ this.phase = 'picking';
425
+ this.NotifyLoadComplete();
426
+ }
427
+ /** Picker selection handler (native select; avoids a FormsModule dependency). */
428
+ onTargetChange(event) {
429
+ this.selectedTargetId = event.target.value || null;
430
+ }
431
+ /** Loads active Realtime models + their voices for the dev pickers (best-effort; empty on failure). */
432
+ async loadRealtimeModels() {
433
+ try {
434
+ const client = new GraphQLLiveKitClient(this.ProviderToUse);
435
+ this.realtimeModels = await client.GetRealtimeModelVoices();
436
+ }
437
+ catch {
438
+ this.realtimeModels = [];
439
+ }
440
+ this.cdr.markForCheck();
441
+ }
442
+ /** Commits the chosen target and switches to the live room. */
443
+ startCall() {
444
+ if (!this.selectedTargetId) {
445
+ return;
446
+ }
447
+ this.targetAgentId = this.selectedTargetId;
448
+ this.targetAgentName = this.agents.find((a) => UUIDsEqual(a.ID, this.selectedTargetId))?.Name ?? null;
449
+ this.phase = 'live';
450
+ }
451
+ /** Opens the invite-people dialog for the given room. */
452
+ openInvite(roomName) {
453
+ this.inviteRoomName = roomName || null;
454
+ this.userSearch = '';
455
+ this.userResults = [];
456
+ this.selectedInvitees = [];
457
+ this.searched = false;
458
+ this.inviteMessage = null;
459
+ this.showInvite = true;
460
+ }
461
+ /** Searches `MJ: Users` by name/email, excluding the current user + already-selected people. */
462
+ async searchUsers() {
463
+ const term = this.userSearch.trim();
464
+ if (!term) {
465
+ return;
466
+ }
467
+ this.searching = true;
468
+ this.cdr.markForCheck();
469
+ try {
470
+ const p = this.ProviderToUse;
471
+ const escaped = term.replace(/'/g, "''");
472
+ const excluded = [p.CurrentUser?.ID, ...this.selectedInvitees.map((u) => u.ID)].filter(Boolean);
473
+ const excludeFilter = excluded.length ? ` AND ID NOT IN (${excluded.map((id) => `'${id}'`).join(',')})` : '';
474
+ const result = await RunView.FromMetadataProvider(p).RunView({
475
+ EntityName: 'Users',
476
+ ExtraFilter: `IsActive = 1 AND (Name LIKE '%${escaped}%' OR Email LIKE '%${escaped}%')${excludeFilter}`,
477
+ OrderBy: 'Name',
478
+ Fields: ['ID', 'Name', 'Email'],
479
+ MaxRows: 20,
480
+ ResultType: 'simple',
481
+ });
482
+ this.userResults = (result.Success ? result.Results : []).map((u) => ({
483
+ ID: u.ID,
484
+ Name: u.Name || u.Email || '(unnamed)',
485
+ Email: u.Email ?? null,
486
+ }));
487
+ }
488
+ finally {
489
+ this.searching = false;
490
+ this.searched = true;
491
+ this.cdr.markForCheck();
492
+ }
493
+ }
494
+ /** Adds a person to the invite list (and out of the results). */
495
+ addInvitee(user) {
496
+ if (!this.selectedInvitees.some((u) => UUIDsEqual(u.ID, user.ID))) {
497
+ this.selectedInvitees = [...this.selectedInvitees, user];
498
+ }
499
+ this.userResults = this.userResults.filter((u) => !UUIDsEqual(u.ID, user.ID));
500
+ }
501
+ /** Removes a person from the invite list. */
502
+ removeInvitee(userId) {
503
+ this.selectedInvitees = this.selectedInvitees.filter((u) => !UUIDsEqual(u.ID, userId));
504
+ }
505
+ /** Sends the invites — the server notifies each person (in-app + Comms when configured). */
506
+ async sendInvites() {
507
+ if (!this.selectedInvitees.length || !this.inviteRoomName || this.inviting) {
508
+ return;
509
+ }
510
+ this.inviting = true;
511
+ this.inviteMessage = null;
512
+ this.cdr.markForCheck();
513
+ try {
514
+ const client = new GraphQLLiveKitClient(this.ProviderToUse);
515
+ const ok = await client.InviteUsers(this.inviteRoomName, this.selectedInvitees.map((u) => u.ID));
516
+ if (ok) {
517
+ this.inviteMessage = `Invited ${this.selectedInvitees.length} ${this.selectedInvitees.length === 1 ? 'person' : 'people'}.`;
518
+ this.selectedInvitees = [];
519
+ setTimeout(() => {
520
+ this.showInvite = false;
521
+ this.cdr.markForCheck();
522
+ }, 900);
523
+ }
524
+ else {
525
+ this.inviteMessage = 'Could not send the invites. Please try again.';
526
+ }
527
+ }
528
+ catch (err) {
529
+ this.inviteMessage = err instanceof Error ? err.message : String(err);
530
+ }
531
+ finally {
532
+ this.inviting = false;
533
+ this.cdr.markForCheck();
534
+ }
535
+ }
536
+ ngAfterViewInit() {
537
+ // Clear the shell loading screen even if resolution is slow — the picker/room/message shows its own
538
+ // state, so the loader must not hang on direct URL navigation.
539
+ this.NotifyLoadComplete();
540
+ }
541
+ ngOnDestroy() {
542
+ super.ngOnDestroy();
543
+ }
544
+ async GetResourceDisplayName(_data) {
545
+ return 'Live Room';
546
+ }
547
+ async GetResourceIconClass(_data) {
548
+ return 'fa-solid fa-video';
549
+ }
550
+ static ɵfac = /*@__PURE__*/ (() => { let ɵLiveKitRoomResource_BaseFactory; return function LiveKitRoomResource_Factory(__ngFactoryType__) { return (ɵLiveKitRoomResource_BaseFactory || (ɵLiveKitRoomResource_BaseFactory = i0.ɵɵgetInheritedFactory(LiveKitRoomResource)))(__ngFactoryType__ || LiveKitRoomResource); }; })();
551
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LiveKitRoomResource, selectors: [["mj-livekit-room-resource"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 5, vars: 2, consts: [[1, "mj-livekit-room-resource", 3, "Mode", "RoomName", "AgentID", "TargetAgentID", "AgentName", "AvailableAgents", "RealtimeModelID", "RealtimeVoice", "CanPickModelVoice", "AvailableModels", "Provider", "ShowAgentState", "ShowWhiteboard", "EnableLayoutSwitcher", "EnablePinning"], [1, "mj-lk-prejoin"], [1, "mj-livekit-room-resource__message"], ["Title", "Invite people", "Size", "auto", 3, "Visible", "Width"], [1, "mj-livekit-room-resource", 3, "Connected", "ErrorOccurred", "InvitePeopleRequested", "Mode", "RoomName", "AgentID", "TargetAgentID", "AgentName", "AvailableAgents", "RealtimeModelID", "RealtimeVoice", "CanPickModelVoice", "AvailableModels", "Provider", "ShowAgentState", "ShowWhiteboard", "EnableLayoutSwitcher", "EnablePinning"], [1, "mj-lk-prejoin__card"], [1, "mj-lk-prejoin__icon"], [1, "fa-solid", "fa-video"], [1, "mj-lk-prejoin__title"], [1, "mj-lk-prejoin__subtitle"], ["for", "mj-lk-target", 1, "mj-lk-prejoin__label"], ["id", "mj-lk-target", 1, "mj-input", "mj-lk-prejoin__select", 3, "change"], [3, "value", "selected"], [1, "mj-lk-prejoin__desc"], ["type", "button", 1, "mj-lk-prejoin__start", 3, "click", "disabled"], [1, "fa-solid", "fa-phone"], ["for", "mj-lk-model", 1, "mj-lk-prejoin__label"], [1, "mj-lk-prejoin__dev"], ["id", "mj-lk-model", 1, "mj-input", "mj-lk-prejoin__select", 3, "change"], ["value", ""], ["for", "mj-lk-voice", 1, "mj-lk-prejoin__label"], ["id", "mj-lk-voice", 1, "mj-input", "mj-lk-prejoin__select", 3, "change"], [1, "fa-solid", "fa-circle-exclamation"], ["Title", "Invite people", "Size", "auto", 3, "Close", "Visible", "Width"], [1, "mj-lk-invite"], [1, "mj-lk-invite__hint"], [1, "mj-lk-invite__search"], ["type", "text", "placeholder", "Search people by name or email\u2026", 1, "mj-input", 3, "input", "keydown.enter", "value"], ["type", "button", 1, "mj-lk-invite__searchbtn", 3, "click", "disabled"], [1, "fa-solid"], [1, "mj-lk-invite__chips"], [1, "mj-lk-invite__results"], [1, "mj-lk-invite__empty"], [1, "mj-lk-invite__msg"], [1, "mj-lk-invite__actions"], ["type", "button", 1, "mj-lk-invite__send", 3, "click", "disabled"], ["type", "button", 1, "mj-lk-invite__cancel", 3, "click"], [1, "mj-lk-invite__chip"], ["type", "button", 1, "mj-lk-invite__chipx", 3, "click"], [1, "fa-solid", "fa-xmark"], ["type", "button", 1, "mj-lk-invite__result"], ["type", "button", 1, "mj-lk-invite__result", 3, "click"], [1, "mj-lk-invite__rname"], [1, "mj-lk-invite__remail"]], template: function LiveKitRoomResource_Template(rf, ctx) { if (rf & 1) {
552
+ i0.ɵɵconditionalCreate(0, LiveKitRoomResource_Case_0_Template, 1, 15, "mj-livekit-agent-room", 0)(1, LiveKitRoomResource_Case_1_Template, 18, 3, "div", 1)(2, LiveKitRoomResource_Case_2_Template, 4, 1, "div", 2)(3, LiveKitRoomResource_Case_3_Template, 2, 0, "div", 2);
553
+ i0.ɵɵconditionalCreate(4, LiveKitRoomResource_Conditional_4_Template, 18, 21, "mj-dialog", 3);
554
+ } if (rf & 2) {
555
+ let tmp_0_0;
556
+ i0.ɵɵconditional((tmp_0_0 = ctx.phase) === "live" ? 0 : tmp_0_0 === "picking" ? 1 : tmp_0_0 === "error" ? 2 : 3);
557
+ i0.ɵɵadvance(4);
558
+ i0.ɵɵconditional(ctx.showInvite ? 4 : -1);
559
+ } }, dependencies: [i1.NgSelectOption, i1.ɵNgSelectMultipleOption, i2.MJDialogComponent, i3.MJLiveKitRoomComponent], styles: ["[_nghost-%COMP%] {\n display: block;\n height: 100%;\n }\n .mj-livekit-room-resource[_ngcontent-%COMP%] {\n display: block;\n height: 100%;\n }\n .mj-livekit-room-resource__message[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n height: 100%;\n padding: 1.5rem;\n text-align: center;\n color: var(--mj-text-secondary);\n }\n .mj-livekit-room-resource__message[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--mj-status-warning);\n }\n .mj-lk-prejoin[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: 1.5rem;\n background: var(--mj-bg-page);\n }\n .mj-lk-prejoin__card[_ngcontent-%COMP%] {\n width: 100%;\n max-width: 440px;\n padding: 2rem;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg, 12px);\n background: var(--mj-bg-surface);\n box-shadow: var(--mj-shadow-md, 0 4px 16px rgba(0, 0, 0, 0.12));\n text-align: center;\n }\n .mj-lk-prejoin__icon[_ngcontent-%COMP%] {\n font-size: 1.75rem;\n color: var(--mj-brand-primary);\n margin-bottom: 0.75rem;\n }\n .mj-lk-prejoin__title[_ngcontent-%COMP%] {\n margin: 0 0 0.5rem;\n color: var(--mj-text-primary);\n font-size: 1.25rem;\n }\n .mj-lk-prejoin__subtitle[_ngcontent-%COMP%] {\n margin: 0 0 1.5rem;\n color: var(--mj-text-secondary);\n font-size: 0.875rem;\n line-height: 1.4;\n }\n .mj-lk-prejoin__label[_ngcontent-%COMP%] {\n display: block;\n text-align: left;\n margin-bottom: 0.35rem;\n color: var(--mj-text-secondary);\n font-size: 0.8125rem;\n font-weight: 600;\n }\n .mj-lk-prejoin__dev[_ngcontent-%COMP%] {\n margin-left: 0.35rem;\n padding: 0 0.35rem;\n border-radius: 999px;\n font-size: 0.625rem;\n font-weight: 700;\n text-transform: uppercase;\n color: var(--mj-text-inverse);\n background: var(--mj-brand-primary);\n vertical-align: middle;\n }\n .mj-lk-prejoin__select[_ngcontent-%COMP%] {\n width: 100%;\n margin-bottom: 0.75rem;\n }\n .mj-lk-prejoin__desc[_ngcontent-%COMP%] {\n text-align: left;\n margin: 0 0 1.25rem;\n color: var(--mj-text-muted);\n font-size: 0.8125rem;\n line-height: 1.4;\n }\n .mj-lk-prejoin__start[_ngcontent-%COMP%] {\n width: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n padding: 0.625rem 1rem;\n border: none;\n border-radius: var(--mj-radius-md, 8px);\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 0.9375rem;\n font-weight: 600;\n cursor: pointer;\n }\n .mj-lk-prejoin__start[_ngcontent-%COMP%]:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover);\n }\n .mj-lk-prejoin__start[_ngcontent-%COMP%]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .mj-lk-invite[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n min-width: 360px;\n padding: 0.25rem;\n }\n .mj-lk-invite__hint[_ngcontent-%COMP%] {\n margin: 0;\n color: var(--mj-text-muted);\n font-size: 0.8125rem;\n }\n .mj-lk-invite__search[_ngcontent-%COMP%] {\n display: flex;\n gap: 0.5rem;\n }\n .mj-lk-invite__search[_ngcontent-%COMP%] .mj-input[_ngcontent-%COMP%] {\n flex: 1;\n }\n .mj-lk-invite__searchbtn[_ngcontent-%COMP%], \n .mj-lk-invite__send[_ngcontent-%COMP%], \n .mj-lk-invite__cancel[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.4rem;\n padding: 0.5rem 0.85rem;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n cursor: pointer;\n font-size: 0.875rem;\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n }\n .mj-lk-invite__send[_ngcontent-%COMP%] {\n border: none;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n }\n .mj-lk-invite__send[_ngcontent-%COMP%]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .mj-lk-invite__chips[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n gap: 0.4rem;\n }\n .mj-lk-invite__chip[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 0.35rem;\n padding: 0.2rem 0.5rem;\n border-radius: 999px;\n font-size: 0.8125rem;\n color: var(--mj-text-primary);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n }\n .mj-lk-invite__chipx[_ngcontent-%COMP%] {\n border: none;\n background: transparent;\n cursor: pointer;\n color: var(--mj-text-muted);\n padding: 0;\n }\n .mj-lk-invite__results[_ngcontent-%COMP%] {\n max-height: 220px;\n overflow-y: auto;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n }\n .mj-lk-invite__result[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 0.1rem;\n width: 100%;\n padding: 0.5rem 0.75rem;\n border: none;\n border-bottom: 1px solid var(--mj-border-subtle, var(--mj-border-default));\n background: transparent;\n cursor: pointer;\n text-align: left;\n }\n .mj-lk-invite__result[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n }\n .mj-lk-invite__rname[_ngcontent-%COMP%] {\n color: var(--mj-text-primary);\n font-size: 0.875rem;\n }\n .mj-lk-invite__remail[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: 0.75rem;\n }\n .mj-lk-invite__empty[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: 0.8125rem;\n padding: 0.25rem;\n }\n .mj-lk-invite__msg[_ngcontent-%COMP%] {\n color: var(--mj-text-secondary);\n font-size: 0.8125rem;\n }\n .mj-lk-invite__actions[_ngcontent-%COMP%] {\n display: flex;\n gap: 0.5rem;\n margin-top: 0.25rem;\n }"] });
560
+ };
561
+ LiveKitRoomResource = __decorate([
562
+ RegisterClass(BaseResourceComponent, 'LiveKitRoomResource')
563
+ ], LiveKitRoomResource);
564
+ export { LiveKitRoomResource };
565
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LiveKitRoomResource, [{
566
+ type: Component,
567
+ args: [{ standalone: false, selector: 'mj-livekit-room-resource', template: `
568
+ @switch (phase) {
569
+ @case ('live') {
570
+ <mj-livekit-agent-room
571
+ class="mj-livekit-room-resource"
572
+ [Mode]="roomMode"
573
+ [RoomName]="joinRoomName"
574
+ [AgentID]="agentId"
575
+ [TargetAgentID]="targetAgentId"
576
+ [AgentName]="targetAgentName"
577
+ [AvailableAgents]="agents"
578
+ [RealtimeModelID]="selectedModelId"
579
+ [RealtimeVoice]="selectedVoice"
580
+ [CanPickModelVoice]="canPickModelVoice"
581
+ [AvailableModels]="realtimeModels"
582
+ [Provider]="ProviderToUse"
583
+ [ShowAgentState]="true"
584
+ [ShowWhiteboard]="true"
585
+ [EnableLayoutSwitcher]="true"
586
+ [EnablePinning]="true"
587
+ (Connected)="NotifyLoadComplete()"
588
+ (ErrorOccurred)="NotifyLoadComplete()"
589
+ (InvitePeopleRequested)="openInvite($event)"
590
+ ></mj-livekit-agent-room>
591
+ }
592
+ @case ('picking') {
593
+ <div class="mj-lk-prejoin">
594
+ <div class="mj-lk-prejoin__card">
595
+ <div class="mj-lk-prejoin__icon"><i class="fa-solid fa-video"></i></div>
596
+ <h2 class="mj-lk-prejoin__title">Start a call</h2>
597
+ <p class="mj-lk-prejoin__subtitle">
598
+ Choose the agent you want to talk to. You can add more agents (and invite people) once
599
+ you're in the room.
600
+ </p>
601
+ <label class="mj-lk-prejoin__label" for="mj-lk-target">Agent</label>
602
+ <select id="mj-lk-target" class="mj-input mj-lk-prejoin__select" (change)="onTargetChange($event)">
603
+ @for (a of agents; track a.ID) {
604
+ <option [value]="a.ID" [selected]="UUIDsEqual(a.ID, selectedTargetId)">{{ a.Name }}</option>
605
+ }
606
+ </select>
607
+ @if (selectedDescription) {
608
+ <p class="mj-lk-prejoin__desc">{{ selectedDescription }}</p>
609
+ }
610
+ @if (canPickModelVoice && realtimeModels.length) {
611
+ <label class="mj-lk-prejoin__label" for="mj-lk-model">Model <span class="mj-lk-prejoin__dev">dev</span></label>
612
+ <select id="mj-lk-model" class="mj-input mj-lk-prejoin__select" (change)="onModelChange($event)">
613
+ <option value="">Default model</option>
614
+ @for (m of realtimeModels; track m.ModelID) {
615
+ <option [value]="m.ModelID" [selected]="UUIDsEqual(m.ModelID, selectedModelId)">{{ m.ModelName }}</option>
616
+ }
617
+ </select>
618
+ @if (selectedModelVoices.length) {
619
+ <label class="mj-lk-prejoin__label" for="mj-lk-voice">Voice <span class="mj-lk-prejoin__dev">dev</span></label>
620
+ <select id="mj-lk-voice" class="mj-input mj-lk-prejoin__select" (change)="onVoiceChange($event)">
621
+ <option value="">Default voice</option>
622
+ @for (v of selectedModelVoices; track v.ID) {
623
+ <option [value]="v.ID" [selected]="v.ID === selectedVoice">{{ v.Name }}</option>
624
+ }
625
+ </select>
626
+ }
627
+ }
628
+ <button type="button" class="mj-lk-prejoin__start" [disabled]="!selectedTargetId" (click)="startCall()">
629
+ <i class="fa-solid fa-phone"></i> Start call
630
+ </button>
631
+ </div>
632
+ </div>
633
+ }
634
+ @case ('error') {
635
+ <div class="mj-livekit-room-resource__message">
636
+ <i class="fa-solid fa-circle-exclamation"></i>
637
+ <span>{{ resolveError }}</span>
638
+ </div>
639
+ }
640
+ @default {
641
+ <div class="mj-livekit-room-resource__message">Preparing room…</div>
642
+ }
643
+ }
644
+
645
+ @if (showInvite) {
646
+ <mj-dialog [Visible]="showInvite" (Close)="showInvite = false" Title="Invite people" Size="auto" [Width]="440">
647
+ <div class="mj-lk-invite">
648
+ <p class="mj-lk-invite__hint">They'll get an in-app notification (and an email if Comms is set up) to join this room.</p>
649
+ <div class="mj-lk-invite__search">
650
+ <input class="mj-input" type="text" [value]="userSearch" placeholder="Search people by name or email…"
651
+ (input)="userSearch = $any($event.target).value" (keydown.enter)="searchUsers()" />
652
+ <button type="button" class="mj-lk-invite__searchbtn" [disabled]="searching" (click)="searchUsers()">
653
+ <i class="fa-solid" [class.fa-magnifying-glass]="!searching" [class.fa-spinner]="searching" [class.fa-spin]="searching"></i>
654
+ </button>
655
+ </div>
656
+
657
+ @if (selectedInvitees.length) {
658
+ <div class="mj-lk-invite__chips">
659
+ @for (u of selectedInvitees; track u.ID) {
660
+ <span class="mj-lk-invite__chip">
661
+ {{ u.Name }}
662
+ <button type="button" class="mj-lk-invite__chipx" (click)="removeInvitee(u.ID)"><i class="fa-solid fa-xmark"></i></button>
663
+ </span>
664
+ }
665
+ </div>
666
+ }
667
+
668
+ @if (userResults.length) {
669
+ <div class="mj-lk-invite__results">
670
+ @for (u of userResults; track u.ID) {
671
+ <button type="button" class="mj-lk-invite__result" (click)="addInvitee(u)">
672
+ <span class="mj-lk-invite__rname">{{ u.Name }}</span>
673
+ @if (u.Email) { <span class="mj-lk-invite__remail">{{ u.Email }}</span> }
674
+ </button>
675
+ }
676
+ </div>
677
+ } @else if (searched && !searching) {
678
+ <div class="mj-lk-invite__empty">No matching people.</div>
679
+ }
680
+
681
+ @if (inviteMessage) {
682
+ <div class="mj-lk-invite__msg">{{ inviteMessage }}</div>
683
+ }
684
+
685
+ <div class="mj-lk-invite__actions">
686
+ <button type="button" class="mj-lk-invite__send" [disabled]="!selectedInvitees.length || inviting" (click)="sendInvites()">
687
+ <i class="fa-solid" [class.fa-paper-plane]="!inviting" [class.fa-spinner]="inviting" [class.fa-spin]="inviting"></i>
688
+ Invite {{ selectedInvitees.length || '' }}
689
+ </button>
690
+ <button type="button" class="mj-lk-invite__cancel" (click)="showInvite = false">Cancel</button>
691
+ </div>
692
+ </div>
693
+ </mj-dialog>
694
+ }
695
+ `, styles: ["\n :host {\n display: block;\n height: 100%;\n }\n .mj-livekit-room-resource {\n display: block;\n height: 100%;\n }\n .mj-livekit-room-resource__message {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n height: 100%;\n padding: 1.5rem;\n text-align: center;\n color: var(--mj-text-secondary);\n }\n .mj-livekit-room-resource__message i {\n color: var(--mj-status-warning);\n }\n .mj-lk-prejoin {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: 1.5rem;\n background: var(--mj-bg-page);\n }\n .mj-lk-prejoin__card {\n width: 100%;\n max-width: 440px;\n padding: 2rem;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg, 12px);\n background: var(--mj-bg-surface);\n box-shadow: var(--mj-shadow-md, 0 4px 16px rgba(0, 0, 0, 0.12));\n text-align: center;\n }\n .mj-lk-prejoin__icon {\n font-size: 1.75rem;\n color: var(--mj-brand-primary);\n margin-bottom: 0.75rem;\n }\n .mj-lk-prejoin__title {\n margin: 0 0 0.5rem;\n color: var(--mj-text-primary);\n font-size: 1.25rem;\n }\n .mj-lk-prejoin__subtitle {\n margin: 0 0 1.5rem;\n color: var(--mj-text-secondary);\n font-size: 0.875rem;\n line-height: 1.4;\n }\n .mj-lk-prejoin__label {\n display: block;\n text-align: left;\n margin-bottom: 0.35rem;\n color: var(--mj-text-secondary);\n font-size: 0.8125rem;\n font-weight: 600;\n }\n .mj-lk-prejoin__dev {\n margin-left: 0.35rem;\n padding: 0 0.35rem;\n border-radius: 999px;\n font-size: 0.625rem;\n font-weight: 700;\n text-transform: uppercase;\n color: var(--mj-text-inverse);\n background: var(--mj-brand-primary);\n vertical-align: middle;\n }\n .mj-lk-prejoin__select {\n width: 100%;\n margin-bottom: 0.75rem;\n }\n .mj-lk-prejoin__desc {\n text-align: left;\n margin: 0 0 1.25rem;\n color: var(--mj-text-muted);\n font-size: 0.8125rem;\n line-height: 1.4;\n }\n .mj-lk-prejoin__start {\n width: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n padding: 0.625rem 1rem;\n border: none;\n border-radius: var(--mj-radius-md, 8px);\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 0.9375rem;\n font-weight: 600;\n cursor: pointer;\n }\n .mj-lk-prejoin__start:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover);\n }\n .mj-lk-prejoin__start:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .mj-lk-invite {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n min-width: 360px;\n padding: 0.25rem;\n }\n .mj-lk-invite__hint {\n margin: 0;\n color: var(--mj-text-muted);\n font-size: 0.8125rem;\n }\n .mj-lk-invite__search {\n display: flex;\n gap: 0.5rem;\n }\n .mj-lk-invite__search .mj-input {\n flex: 1;\n }\n .mj-lk-invite__searchbtn,\n .mj-lk-invite__send,\n .mj-lk-invite__cancel {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.4rem;\n padding: 0.5rem 0.85rem;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n cursor: pointer;\n font-size: 0.875rem;\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n }\n .mj-lk-invite__send {\n border: none;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n }\n .mj-lk-invite__send:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .mj-lk-invite__chips {\n display: flex;\n flex-wrap: wrap;\n gap: 0.4rem;\n }\n .mj-lk-invite__chip {\n display: inline-flex;\n align-items: center;\n gap: 0.35rem;\n padding: 0.2rem 0.5rem;\n border-radius: 999px;\n font-size: 0.8125rem;\n color: var(--mj-text-primary);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n }\n .mj-lk-invite__chipx {\n border: none;\n background: transparent;\n cursor: pointer;\n color: var(--mj-text-muted);\n padding: 0;\n }\n .mj-lk-invite__results {\n max-height: 220px;\n overflow-y: auto;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n }\n .mj-lk-invite__result {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 0.1rem;\n width: 100%;\n padding: 0.5rem 0.75rem;\n border: none;\n border-bottom: 1px solid var(--mj-border-subtle, var(--mj-border-default));\n background: transparent;\n cursor: pointer;\n text-align: left;\n }\n .mj-lk-invite__result:hover {\n background: var(--mj-bg-surface-hover);\n }\n .mj-lk-invite__rname {\n color: var(--mj-text-primary);\n font-size: 0.875rem;\n }\n .mj-lk-invite__remail {\n color: var(--mj-text-muted);\n font-size: 0.75rem;\n }\n .mj-lk-invite__empty {\n color: var(--mj-text-muted);\n font-size: 0.8125rem;\n padding: 0.25rem;\n }\n .mj-lk-invite__msg {\n color: var(--mj-text-secondary);\n font-size: 0.8125rem;\n }\n .mj-lk-invite__actions {\n display: flex;\n gap: 0.5rem;\n margin-top: 0.25rem;\n }\n "] }]
696
+ }], null, null); })();
697
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LiveKitRoomResource, { className: "LiveKitRoomResource", filePath: "src/lib/resource-wrappers/livekit-room-resource.component.ts", lineNumber: 390 }); })();
698
+ //# sourceMappingURL=livekit-room-resource.component.js.map