ahs-cti 1.0.0-beta.2 → 1.0.0-beta.21
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.
- package/README.md +639 -639
- package/dist/callHistory-TZ7SSXSN.mjs +339 -0
- package/dist/callHistory-TZ7SSXSN.mjs.map +1 -0
- package/dist/chunk-6AM6THQM.mjs +920 -0
- package/dist/chunk-6AM6THQM.mjs.map +1 -0
- package/dist/index.d.mts +490 -4
- package/dist/index.d.ts +491 -4
- package/dist/index.js +2580 -1418
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1469 -1637
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1
|
+
import {
|
|
2
|
+
END_POINT,
|
|
3
|
+
SDKProvider,
|
|
4
|
+
SDK_MENU_CODES,
|
|
5
|
+
SDK_PERMISSIONS,
|
|
6
|
+
SDK_WILDCARD,
|
|
7
|
+
STORAGE_KEY,
|
|
8
|
+
__publicField,
|
|
9
|
+
__spreadProps,
|
|
10
|
+
__spreadValues,
|
|
11
|
+
axios_default,
|
|
12
|
+
sdkStateManager,
|
|
13
|
+
useToast
|
|
14
|
+
} from "./chunk-6AM6THQM.mjs";
|
|
21
15
|
|
|
22
16
|
// call-control-sdk/lib/hooks/eventsTracker.ts
|
|
23
17
|
var EventTrackerSDK = class {
|
|
@@ -72,9 +66,9 @@ var EventTrackerSDK = class {
|
|
|
72
66
|
}
|
|
73
67
|
}
|
|
74
68
|
async makeRequest(url, options) {
|
|
75
|
-
var
|
|
69
|
+
var _a;
|
|
76
70
|
const fullUrl = `${this.baseUrl}${url}`;
|
|
77
|
-
const maxRetries = ((
|
|
71
|
+
const maxRetries = ((_a = this.config) == null ? void 0 : _a.retryAttempts) || 3;
|
|
78
72
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
79
73
|
try {
|
|
80
74
|
const response = await fetch(fullUrl, options);
|
|
@@ -100,587 +94,30 @@ if (typeof window !== "undefined") {
|
|
|
100
94
|
window.EventTracker = eventTracker;
|
|
101
95
|
}
|
|
102
96
|
|
|
103
|
-
// call-control-sdk/lib/hooks/sdk-state.ts
|
|
104
|
-
import { getItem, removeItem, setItem } from "@react-solutions/vault";
|
|
105
|
-
|
|
106
|
-
// call-control-sdk/lib/utils/storage.ts
|
|
107
|
-
var STORAGE_KEY = "call-control-sdk-state";
|
|
108
|
-
|
|
109
|
-
// call-control-sdk/lib/permissions/sdk-constants.ts
|
|
110
|
-
var SDK_PERMISSIONS = {
|
|
111
|
-
// main object key constants
|
|
112
|
-
CALLS: "calls",
|
|
113
|
-
CALL_TRANSFER: "call_transfer",
|
|
114
|
-
CALL_CONFERENCE: "call_conference",
|
|
115
|
-
// in each object has items list of objects
|
|
116
|
-
CALL_INBOUND: "call_inbound",
|
|
117
|
-
CALL_OUTBOUND: "call_outbound",
|
|
118
|
-
CONFERENCE: "call_conference",
|
|
119
|
-
TRANSFER_BLIND: "call_transfer_blind",
|
|
120
|
-
TRANSFER_ATTENDED: "call_transfer_attended",
|
|
121
|
-
TRANSFER_WARM: "call_transfer_warm"
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
// call-control-sdk/lib/hooks/sdk-state.ts
|
|
125
|
-
var SDKStateManager = class {
|
|
126
|
-
constructor() {
|
|
127
|
-
__publicField(this, "state");
|
|
128
|
-
__publicField(this, "listeners", []);
|
|
129
|
-
__publicField(this, "STORAGE_KEY", STORAGE_KEY);
|
|
130
|
-
__publicField(this, "apiKey");
|
|
131
|
-
__publicField(this, "tenantId");
|
|
132
|
-
this.state = this.getInitialState();
|
|
133
|
-
this.loadFromStorage();
|
|
134
|
-
}
|
|
135
|
-
getInitialState() {
|
|
136
|
-
var _a2, _b;
|
|
137
|
-
return {
|
|
138
|
-
authorization: void 0,
|
|
139
|
-
process: null,
|
|
140
|
-
agentId: "",
|
|
141
|
-
openConferenceDialog: false,
|
|
142
|
-
openCallTransferDialog: false,
|
|
143
|
-
isInitialized: false,
|
|
144
|
-
sdkConfig: {
|
|
145
|
-
disableEndCallButton: false,
|
|
146
|
-
disabledDialButton: false,
|
|
147
|
-
disabledMoreOptionsButton: false,
|
|
148
|
-
enableSmsServices: false,
|
|
149
|
-
enableQueueName: false,
|
|
150
|
-
disableCallTransferButton: false,
|
|
151
|
-
disableBlindTransfer: false,
|
|
152
|
-
disableAttendedTransfer: false,
|
|
153
|
-
disableWarmTransfer: false,
|
|
154
|
-
isDraggable: true,
|
|
155
|
-
disableSoftPhone: false,
|
|
156
|
-
disableConferenceButton: false,
|
|
157
|
-
disableHoldButton: false,
|
|
158
|
-
disableMuteButton: false,
|
|
159
|
-
disabled: {},
|
|
160
|
-
enabled: {},
|
|
161
|
-
outlined: {}
|
|
162
|
-
},
|
|
163
|
-
urlConfig: {
|
|
164
|
-
baseURL: "",
|
|
165
|
-
iframeURL: "",
|
|
166
|
-
iframeAPIURL: "",
|
|
167
|
-
webSocketURL: "",
|
|
168
|
-
coreBaseURL: "",
|
|
169
|
-
id: "",
|
|
170
|
-
password: ""
|
|
171
|
-
},
|
|
172
|
-
callStartTime: null,
|
|
173
|
-
controlPanelPosition: { x: 10, y: 10 },
|
|
174
|
-
iframePosition: {
|
|
175
|
-
x: ((_a2 = window.screen) == null ? void 0 : _a2.availWidth) - 460,
|
|
176
|
-
y: ((_b = window.screen) == null ? void 0 : _b.height) - 580
|
|
177
|
-
},
|
|
178
|
-
callData: {
|
|
179
|
-
agent_id: -1,
|
|
180
|
-
queue_name: "",
|
|
181
|
-
hold: 0,
|
|
182
|
-
mute: 0,
|
|
183
|
-
status: "",
|
|
184
|
-
type: "",
|
|
185
|
-
event_time: "",
|
|
186
|
-
phone_number: ""
|
|
187
|
-
},
|
|
188
|
-
conferenceLine: [
|
|
189
|
-
{
|
|
190
|
-
line: 1,
|
|
191
|
-
status: "IDLE",
|
|
192
|
-
type: "",
|
|
193
|
-
phone: "",
|
|
194
|
-
isMute: false,
|
|
195
|
-
isHold: false,
|
|
196
|
-
isCallStart: false,
|
|
197
|
-
isMergeCall: false
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
line: 2,
|
|
201
|
-
status: "IDLE",
|
|
202
|
-
type: "",
|
|
203
|
-
phone: "",
|
|
204
|
-
isMute: false,
|
|
205
|
-
isHold: false,
|
|
206
|
-
isCallStart: false,
|
|
207
|
-
isMergeCall: false
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
line: 3,
|
|
211
|
-
status: "IDLE",
|
|
212
|
-
type: "",
|
|
213
|
-
phone: "",
|
|
214
|
-
isMute: false,
|
|
215
|
-
isHold: false,
|
|
216
|
-
isCallStart: false,
|
|
217
|
-
isMergeCall: false
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
line: 4,
|
|
221
|
-
status: "IDLE",
|
|
222
|
-
type: "",
|
|
223
|
-
phone: "",
|
|
224
|
-
isMute: false,
|
|
225
|
-
isHold: false,
|
|
226
|
-
isCallStart: false,
|
|
227
|
-
isMergeCall: false
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
line: 5,
|
|
231
|
-
status: "IDLE",
|
|
232
|
-
type: "",
|
|
233
|
-
phone: "",
|
|
234
|
-
isMute: false,
|
|
235
|
-
isHold: false,
|
|
236
|
-
isCallStart: false,
|
|
237
|
-
isMergeCall: false
|
|
238
|
-
}
|
|
239
|
-
],
|
|
240
|
-
hold: 0,
|
|
241
|
-
mute: 0,
|
|
242
|
-
agentStatus: "",
|
|
243
|
-
sdk: null,
|
|
244
|
-
isPermissionsLoaded: false
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
loadFromStorage() {
|
|
248
|
-
var _a2, _b;
|
|
249
|
-
try {
|
|
250
|
-
const stored = getItem(this.STORAGE_KEY);
|
|
251
|
-
if (stored) {
|
|
252
|
-
const parsedState = stored;
|
|
253
|
-
this.state = __spreadProps(__spreadValues({}, this.state), {
|
|
254
|
-
agentId: parsedState.agentId || "",
|
|
255
|
-
authorization: parsedState.authorization || void 0,
|
|
256
|
-
process: parsedState.process || null,
|
|
257
|
-
openConferenceDialog: (parsedState == null ? void 0 : parsedState.openConferenceDialog) || false,
|
|
258
|
-
openCallTransferDialog: (parsedState == null ? void 0 : parsedState.openCallTransferDialog) || false,
|
|
259
|
-
isInitialized: parsedState.isInitialized || false,
|
|
260
|
-
sdkConfig: parsedState.sdkConfig || {
|
|
261
|
-
disableEndCallButton: false,
|
|
262
|
-
disabledMoreOptionsButton: false,
|
|
263
|
-
enableSmsServices: false,
|
|
264
|
-
enableQueueName: false,
|
|
265
|
-
disabledDialButton: false,
|
|
266
|
-
disableCallTransferButton: false,
|
|
267
|
-
disableBlindTransfer: false,
|
|
268
|
-
disableAttendedTransfer: false,
|
|
269
|
-
disableWarmTransfer: false,
|
|
270
|
-
isDraggable: true,
|
|
271
|
-
disableSoftPhone: false,
|
|
272
|
-
disableConferenceButton: false,
|
|
273
|
-
disableHoldButton: false,
|
|
274
|
-
disableMuteButton: false,
|
|
275
|
-
disabled: {},
|
|
276
|
-
enabled: {},
|
|
277
|
-
outlined: {}
|
|
278
|
-
},
|
|
279
|
-
urlConfig: parsedState.urlConfig || {
|
|
280
|
-
id: "",
|
|
281
|
-
baseURL: "",
|
|
282
|
-
iframeURL: "",
|
|
283
|
-
iframeAPIURL: "",
|
|
284
|
-
webSocketURL: "",
|
|
285
|
-
coreBaseURL: "",
|
|
286
|
-
password: ""
|
|
287
|
-
},
|
|
288
|
-
callStartTime: parsedState.callStartTime || null,
|
|
289
|
-
controlPanelPosition: parsedState.controlPanelPosition || {
|
|
290
|
-
x: 10,
|
|
291
|
-
y: 10
|
|
292
|
-
},
|
|
293
|
-
iframePosition: parsedState.iframePosition || {
|
|
294
|
-
x: ((_a2 = window.screen) == null ? void 0 : _a2.availWidth) - 460,
|
|
295
|
-
y: ((_b = window.screen) == null ? void 0 : _b.height) - 580
|
|
296
|
-
},
|
|
297
|
-
callData: parsedState.callData || {
|
|
298
|
-
mobileNumber: "",
|
|
299
|
-
callReferenceId: "",
|
|
300
|
-
agent_id: "",
|
|
301
|
-
status: "",
|
|
302
|
-
type: "",
|
|
303
|
-
event_time: "",
|
|
304
|
-
phone_number: ""
|
|
305
|
-
},
|
|
306
|
-
conferenceLine: parsedState.conferenceLine && Array.isArray(parsedState.conferenceLine) && parsedState.conferenceLine.length > 0 ? parsedState.conferenceLine : this.state.conferenceLine,
|
|
307
|
-
agentStatus: parsedState.agentStatus,
|
|
308
|
-
sdk: parsedState.sdk || null,
|
|
309
|
-
isPermissionsLoaded: parsedState.isPermissionsLoaded || false
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
} catch (error) {
|
|
313
|
-
console.warn("Failed to load SDK state:", error);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
saveToStorage() {
|
|
317
|
-
try {
|
|
318
|
-
const persistentState = {
|
|
319
|
-
agentId: this.state.agentId,
|
|
320
|
-
authorization: this.state.authorization,
|
|
321
|
-
process: this.state.process,
|
|
322
|
-
isInitialized: this.state.isInitialized,
|
|
323
|
-
openConferenceDialog: this.state.openConferenceDialog,
|
|
324
|
-
openCallTransferDialog: this.state.openCallTransferDialog,
|
|
325
|
-
sdkConfig: this.state.sdkConfig,
|
|
326
|
-
urlConfig: this.state.urlConfig,
|
|
327
|
-
callStartTime: this.state.callStartTime,
|
|
328
|
-
controlPanelPosition: this.state.controlPanelPosition,
|
|
329
|
-
iframePosition: this.state.iframePosition,
|
|
330
|
-
callData: this.state.callData,
|
|
331
|
-
conferenceLine: this.state.conferenceLine,
|
|
332
|
-
agentStatus: this.state.agentStatus,
|
|
333
|
-
sdk: this.state.sdk,
|
|
334
|
-
isPermissionsLoaded: this.state.isPermissionsLoaded
|
|
335
|
-
};
|
|
336
|
-
setItem(this.STORAGE_KEY, persistentState);
|
|
337
|
-
} catch (error) {
|
|
338
|
-
console.warn("Failed to save SDK state:", error);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
notifyListeners() {
|
|
342
|
-
this.listeners.forEach((listener) => listener());
|
|
343
|
-
}
|
|
344
|
-
validateCredentials(apiKey, tenantId) {
|
|
345
|
-
if (!apiKey || typeof apiKey !== "string" || apiKey.trim().length === 0) {
|
|
346
|
-
throw new Error("API key not available");
|
|
347
|
-
}
|
|
348
|
-
if (!tenantId || typeof tenantId !== "string" || tenantId.trim().length === 0) {
|
|
349
|
-
throw new Error("Tenant ID not available");
|
|
350
|
-
}
|
|
351
|
-
this.apiKey = apiKey.trim();
|
|
352
|
-
this.tenantId = tenantId.trim();
|
|
353
|
-
}
|
|
354
|
-
initialize(apiKey, tenantId, agentId, urlConfig, initResult, sdkConfig) {
|
|
355
|
-
this.validateCredentials(apiKey, tenantId);
|
|
356
|
-
if (!agentId || typeof agentId !== "string" || agentId.trim().length === 0) {
|
|
357
|
-
throw new Error("Agent ID not available");
|
|
358
|
-
} else {
|
|
359
|
-
this.state.agentId = agentId;
|
|
360
|
-
this.state.openConferenceDialog = false;
|
|
361
|
-
this.state.openCallTransferDialog = false;
|
|
362
|
-
this.state.authorization = initResult;
|
|
363
|
-
this.state.sdkConfig = __spreadValues(__spreadValues({
|
|
364
|
-
disableEndCallButton: false,
|
|
365
|
-
disabledDialButton: false,
|
|
366
|
-
disabledMoreOptionsButton: false,
|
|
367
|
-
enableQueueName: false,
|
|
368
|
-
disableCallTransferButton: false,
|
|
369
|
-
disableBlindTransfer: false,
|
|
370
|
-
disableAttendedTransfer: false,
|
|
371
|
-
disableWarmTransfer: false,
|
|
372
|
-
isDraggable: true,
|
|
373
|
-
disableSoftPhone: false,
|
|
374
|
-
disableConferenceButton: false,
|
|
375
|
-
disableHoldButton: false,
|
|
376
|
-
disableMuteButton: false,
|
|
377
|
-
disabled: {},
|
|
378
|
-
enabled: {},
|
|
379
|
-
outlined: {}
|
|
380
|
-
}, sdkConfig), initResult == null ? void 0 : initResult.callControls);
|
|
381
|
-
this.state.urlConfig = {
|
|
382
|
-
baseURL: (urlConfig == null ? void 0 : urlConfig.baseURL) || "",
|
|
383
|
-
iframeURL: (urlConfig == null ? void 0 : urlConfig.iframeURL) || "",
|
|
384
|
-
iframeAPIURL: (urlConfig == null ? void 0 : urlConfig.iframeAPIURL) || "",
|
|
385
|
-
webSocketURL: (urlConfig == null ? void 0 : urlConfig.webSocketURL) || "",
|
|
386
|
-
coreBaseURL: (urlConfig == null ? void 0 : urlConfig.coreBaseURL) || "",
|
|
387
|
-
id: (urlConfig == null ? void 0 : urlConfig.id) || "",
|
|
388
|
-
password: (urlConfig == null ? void 0 : urlConfig.password) || ""
|
|
389
|
-
};
|
|
390
|
-
this.state.isInitialized = true;
|
|
391
|
-
this.saveToStorage();
|
|
392
|
-
this.notifyListeners();
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
getState() {
|
|
396
|
-
return __spreadValues({}, this.state);
|
|
397
|
-
}
|
|
398
|
-
getCredentials() {
|
|
399
|
-
return { apiKey: this.apiKey, tenantId: this.tenantId };
|
|
400
|
-
}
|
|
401
|
-
getSdkAuthToken() {
|
|
402
|
-
var _a2;
|
|
403
|
-
return (_a2 = this.state.authorization) == null ? void 0 : _a2.accessToken;
|
|
404
|
-
}
|
|
405
|
-
subscribe(listener) {
|
|
406
|
-
this.listeners.push(listener);
|
|
407
|
-
return () => {
|
|
408
|
-
const index = this.listeners.indexOf(listener);
|
|
409
|
-
if (index > -1) {
|
|
410
|
-
this.listeners.splice(index, 1);
|
|
411
|
-
}
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
// public setHolding(isHolding: boolean): void {
|
|
415
|
-
// this.state.isHolding = isHolding;
|
|
416
|
-
// this.saveToStorage();
|
|
417
|
-
// this.notifyListeners();
|
|
418
|
-
// }
|
|
419
|
-
// public setMuted(isMuted: boolean): void {
|
|
420
|
-
// this.state.isMuted = isMuted;
|
|
421
|
-
// this.saveToStorage();
|
|
422
|
-
// this.notifyListeners();
|
|
423
|
-
// }
|
|
424
|
-
setProcess(process) {
|
|
425
|
-
this.state.process = process;
|
|
426
|
-
this.saveToStorage();
|
|
427
|
-
this.notifyListeners();
|
|
428
|
-
}
|
|
429
|
-
setControlPanelPosition(position) {
|
|
430
|
-
this.state.controlPanelPosition = position;
|
|
431
|
-
this.saveToStorage();
|
|
432
|
-
this.notifyListeners();
|
|
433
|
-
}
|
|
434
|
-
setIframePosition(position) {
|
|
435
|
-
this.state.iframePosition = position;
|
|
436
|
-
this.saveToStorage();
|
|
437
|
-
this.notifyListeners();
|
|
438
|
-
}
|
|
439
|
-
startCall() {
|
|
440
|
-
this.state.callStartTime = Date.now();
|
|
441
|
-
this.saveToStorage();
|
|
442
|
-
this.notifyListeners();
|
|
443
|
-
}
|
|
444
|
-
endCall() {
|
|
445
|
-
this.state.callStartTime = null;
|
|
446
|
-
this.saveToStorage();
|
|
447
|
-
this.notifyListeners();
|
|
448
|
-
}
|
|
449
|
-
setInitCheck() {
|
|
450
|
-
this.state.isInitialized = false;
|
|
451
|
-
this.saveToStorage();
|
|
452
|
-
this.notifyListeners();
|
|
453
|
-
}
|
|
454
|
-
setOpenConferenceDialog(open) {
|
|
455
|
-
this.state.openConferenceDialog = open;
|
|
456
|
-
this.saveToStorage();
|
|
457
|
-
this.notifyListeners();
|
|
458
|
-
}
|
|
459
|
-
setOpenCallTransferDialog(open) {
|
|
460
|
-
this.state.openCallTransferDialog = open;
|
|
461
|
-
this.saveToStorage();
|
|
462
|
-
this.notifyListeners();
|
|
463
|
-
}
|
|
464
|
-
setAgentStatus(status) {
|
|
465
|
-
this.state.agentStatus = status;
|
|
466
|
-
this.saveToStorage();
|
|
467
|
-
this.notifyListeners();
|
|
468
|
-
}
|
|
469
|
-
updateCallData(data) {
|
|
470
|
-
this.state.callData = __spreadValues(__spreadValues({}, this.state.callData), data);
|
|
471
|
-
this.saveToStorage();
|
|
472
|
-
this.notifyListeners();
|
|
473
|
-
}
|
|
474
|
-
updateConferenceData(data) {
|
|
475
|
-
this.state.conferenceLine = [...data];
|
|
476
|
-
this.saveToStorage();
|
|
477
|
-
this.notifyListeners();
|
|
478
|
-
}
|
|
479
|
-
setConferenceLine(line) {
|
|
480
|
-
var _a2;
|
|
481
|
-
if (!this.state.conferenceLine || !Array.isArray(this.state.conferenceLine)) {
|
|
482
|
-
this.state.conferenceLine = this.getInitialState().conferenceLine;
|
|
483
|
-
}
|
|
484
|
-
const conferenceLineData = (_a2 = this.state.conferenceLine) == null ? void 0 : _a2.map(
|
|
485
|
-
(each) => {
|
|
486
|
-
if (each.line === line.line) {
|
|
487
|
-
return line;
|
|
488
|
-
}
|
|
489
|
-
return each;
|
|
490
|
-
}
|
|
491
|
-
);
|
|
492
|
-
this.state.conferenceLine = conferenceLineData;
|
|
493
|
-
this.saveToStorage();
|
|
494
|
-
this.notifyListeners();
|
|
495
|
-
}
|
|
496
|
-
resetConferenceLines() {
|
|
497
|
-
this.state.conferenceLine = [
|
|
498
|
-
{
|
|
499
|
-
line: 1,
|
|
500
|
-
status: "IDLE",
|
|
501
|
-
type: "",
|
|
502
|
-
phone: "",
|
|
503
|
-
isMute: false,
|
|
504
|
-
isHold: false,
|
|
505
|
-
isCallStart: false,
|
|
506
|
-
isMergeCall: false
|
|
507
|
-
},
|
|
508
|
-
{
|
|
509
|
-
line: 2,
|
|
510
|
-
status: "IDLE",
|
|
511
|
-
type: "",
|
|
512
|
-
phone: "",
|
|
513
|
-
isMute: false,
|
|
514
|
-
isHold: false,
|
|
515
|
-
isCallStart: false,
|
|
516
|
-
isMergeCall: false
|
|
517
|
-
},
|
|
518
|
-
{
|
|
519
|
-
line: 3,
|
|
520
|
-
status: "IDLE",
|
|
521
|
-
type: "",
|
|
522
|
-
phone: "",
|
|
523
|
-
isMute: false,
|
|
524
|
-
isHold: false,
|
|
525
|
-
isCallStart: false,
|
|
526
|
-
isMergeCall: false
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
line: 4,
|
|
530
|
-
status: "IDLE",
|
|
531
|
-
type: "",
|
|
532
|
-
phone: "",
|
|
533
|
-
isMute: false,
|
|
534
|
-
isHold: false,
|
|
535
|
-
isCallStart: false,
|
|
536
|
-
isMergeCall: false
|
|
537
|
-
},
|
|
538
|
-
{
|
|
539
|
-
line: 5,
|
|
540
|
-
status: "IDLE",
|
|
541
|
-
type: "",
|
|
542
|
-
phone: "",
|
|
543
|
-
isMute: false,
|
|
544
|
-
isHold: false,
|
|
545
|
-
isCallStart: false,
|
|
546
|
-
isMergeCall: false
|
|
547
|
-
}
|
|
548
|
-
];
|
|
549
|
-
this.saveToStorage();
|
|
550
|
-
this.notifyListeners();
|
|
551
|
-
}
|
|
552
|
-
clearStorageAndReset() {
|
|
553
|
-
try {
|
|
554
|
-
removeItem(this.STORAGE_KEY);
|
|
555
|
-
this.state = this.getInitialState();
|
|
556
|
-
this.notifyListeners();
|
|
557
|
-
} catch (error) {
|
|
558
|
-
console.warn("Failed to clear:", error);
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
getConferenceLines() {
|
|
562
|
-
return this.state.conferenceLine || [];
|
|
563
|
-
}
|
|
564
|
-
/**
|
|
565
|
-
* Update SDK config with permission-based controls.
|
|
566
|
-
* Merges the provided controls with existing config.
|
|
567
|
-
*/
|
|
568
|
-
updateSDKConfigFromPermissions(permissionControls) {
|
|
569
|
-
this.state.sdkConfig = __spreadValues(__spreadValues({}, this.state.sdkConfig), permissionControls);
|
|
570
|
-
this.saveToStorage();
|
|
571
|
-
this.notifyListeners();
|
|
572
|
-
}
|
|
573
|
-
// ============ Entitlement Logic (Ported from SDKPermissionManager) ============
|
|
574
|
-
/**
|
|
575
|
-
* Set user information (entitlements) from login response
|
|
576
|
-
*/
|
|
577
|
-
setSDKPermissions(userInfo) {
|
|
578
|
-
var _a2;
|
|
579
|
-
if (!userInfo) return;
|
|
580
|
-
const sdk = (_a2 = userInfo.entitlements) == null ? void 0 : _a2.sdk;
|
|
581
|
-
this.state.sdk = sdk;
|
|
582
|
-
this.state.isPermissionsLoaded = true;
|
|
583
|
-
const permissionControls = this.getControlsConfig();
|
|
584
|
-
this.updateSDKConfigFromPermissions(permissionControls);
|
|
585
|
-
this.saveToStorage();
|
|
586
|
-
this.notifyListeners();
|
|
587
|
-
}
|
|
588
|
-
/**
|
|
589
|
-
* Check if a bit is enabled in entitlements
|
|
590
|
-
*/
|
|
591
|
-
isBitEnabled(category, bitCode) {
|
|
592
|
-
var _a2;
|
|
593
|
-
const sdk = this.state.sdk;
|
|
594
|
-
if (!sdk) return false;
|
|
595
|
-
const categoryEntitlement = sdk[category];
|
|
596
|
-
if (!categoryEntitlement) return false;
|
|
597
|
-
if (!categoryEntitlement.enabled) return false;
|
|
598
|
-
if (!bitCode) return true;
|
|
599
|
-
const bit = (_a2 = categoryEntitlement.items) == null ? void 0 : _a2.find(
|
|
600
|
-
(item) => item.code === bitCode
|
|
601
|
-
);
|
|
602
|
-
return bit ? bit.enabled : false;
|
|
603
|
-
}
|
|
604
|
-
/**
|
|
605
|
-
* Get SDK controls configuration derived exclusively from structured entitlements.
|
|
606
|
-
*/
|
|
607
|
-
getControlsConfig() {
|
|
608
|
-
const { sdk, isPermissionsLoaded } = this.state;
|
|
609
|
-
if (!isPermissionsLoaded || !sdk) {
|
|
610
|
-
return {
|
|
611
|
-
disabledDialButton: true,
|
|
612
|
-
disableEndCallButton: true,
|
|
613
|
-
disableCallTransferButton: true,
|
|
614
|
-
disableBlindTransfer: true,
|
|
615
|
-
disableAttendedTransfer: true,
|
|
616
|
-
disableWarmTransfer: true,
|
|
617
|
-
disableConferenceButton: true,
|
|
618
|
-
disableHoldButton: true,
|
|
619
|
-
disableMuteButton: true,
|
|
620
|
-
disabledMoreOptionsButton: true
|
|
621
|
-
};
|
|
622
|
-
}
|
|
623
|
-
const isDialAllowed = this.isBitEnabled(
|
|
624
|
-
"calls",
|
|
625
|
-
SDK_PERMISSIONS.CALL_OUTBOUND
|
|
626
|
-
);
|
|
627
|
-
const isInboundAllowed = this.isBitEnabled(
|
|
628
|
-
"calls",
|
|
629
|
-
SDK_PERMISSIONS.CALL_INBOUND
|
|
630
|
-
);
|
|
631
|
-
const isAnyCallAllowed = isDialAllowed || isInboundAllowed;
|
|
632
|
-
const isHoldAllowed = isAnyCallAllowed;
|
|
633
|
-
const isMuteAllowed = isAnyCallAllowed;
|
|
634
|
-
const isEndCallAllowed = isAnyCallAllowed;
|
|
635
|
-
const isConferenceAllowed = this.isBitEnabled("call_conference", "");
|
|
636
|
-
const isTransferEnabled = this.isBitEnabled("call_transfer", "");
|
|
637
|
-
const isBlindAllowed = this.isBitEnabled(
|
|
638
|
-
"call_transfer",
|
|
639
|
-
SDK_PERMISSIONS.TRANSFER_BLIND
|
|
640
|
-
);
|
|
641
|
-
const isAttendedAllowed = this.isBitEnabled(
|
|
642
|
-
"call_transfer",
|
|
643
|
-
SDK_PERMISSIONS.TRANSFER_ATTENDED
|
|
644
|
-
);
|
|
645
|
-
const isWarmAllowed = this.isBitEnabled(
|
|
646
|
-
"call_transfer",
|
|
647
|
-
SDK_PERMISSIONS.TRANSFER_WARM
|
|
648
|
-
);
|
|
649
|
-
return {
|
|
650
|
-
disabledDialButton: !isDialAllowed,
|
|
651
|
-
disableEndCallButton: !isEndCallAllowed,
|
|
652
|
-
disableCallTransferButton: !isTransferEnabled,
|
|
653
|
-
disableBlindTransfer: !isBlindAllowed,
|
|
654
|
-
disableAttendedTransfer: !isAttendedAllowed,
|
|
655
|
-
disableWarmTransfer: !isWarmAllowed,
|
|
656
|
-
disableConferenceButton: !isConferenceAllowed,
|
|
657
|
-
disableHoldButton: !isHoldAllowed,
|
|
658
|
-
disableMuteButton: !isMuteAllowed,
|
|
659
|
-
disabledMoreOptionsButton: false
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
};
|
|
663
|
-
var sdkStateManager = new SDKStateManager();
|
|
664
|
-
|
|
665
97
|
// call-control-sdk/lib/hooks/useLogout.ts
|
|
666
98
|
import { useCallback, useState } from "react";
|
|
667
|
-
import {
|
|
99
|
+
import { removeSession } from "@react-solutions/vault";
|
|
668
100
|
var useLogout = () => {
|
|
669
101
|
const [loading, setLoading] = useState(false);
|
|
670
102
|
const [success, setSuccess] = useState(false);
|
|
671
103
|
const [isError, setIsError] = useState(false);
|
|
672
104
|
const [error, setError] = useState(null);
|
|
673
105
|
const [data, setData] = useState(null);
|
|
106
|
+
const { showToast } = useToast();
|
|
674
107
|
const handleLogout = useCallback(async () => {
|
|
675
|
-
|
|
108
|
+
var _a, _b;
|
|
676
109
|
setLoading(true);
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
110
|
+
try {
|
|
111
|
+
await axios_default.post(END_POINT.AUTH_LOGOUT);
|
|
112
|
+
} catch (err) {
|
|
113
|
+
const message = ((_b = (_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || "Logout failed. Please try again.";
|
|
114
|
+
showToast(message, "error");
|
|
115
|
+
} finally {
|
|
116
|
+
sdkStateManager.clearStorageAndReset();
|
|
117
|
+
removeSession(STORAGE_KEY);
|
|
118
|
+
setSuccess(true);
|
|
119
|
+
setLoading(false);
|
|
120
|
+
}
|
|
684
121
|
}, []);
|
|
685
122
|
return {
|
|
686
123
|
logout: handleLogout,
|
|
@@ -694,188 +131,7 @@ var useLogout = () => {
|
|
|
694
131
|
|
|
695
132
|
// call-control-sdk/lib/hooks/useEndCall.ts
|
|
696
133
|
import { useCallback as useCallback2, useState as useState2 } from "react";
|
|
697
|
-
|
|
698
|
-
// call-control-sdk/lib/services/endPoint.ts
|
|
699
|
-
var getBaseURL = () => {
|
|
700
|
-
var _a2, _b, _c;
|
|
701
|
-
return ((_c = (_b = (_a2 = sdkStateManager) == null ? void 0 : _a2.getState()) == null ? void 0 : _b.urlConfig) == null ? void 0 : _c.baseURL) || "";
|
|
702
|
-
};
|
|
703
|
-
var getCoreURL = () => {
|
|
704
|
-
var _a2, _b, _c;
|
|
705
|
-
return ((_c = (_b = (_a2 = sdkStateManager) == null ? void 0 : _a2.getState()) == null ? void 0 : _b.urlConfig) == null ? void 0 : _c.coreBaseURL) || "";
|
|
706
|
-
};
|
|
707
|
-
var BASE_URL = getBaseURL();
|
|
708
|
-
var CORE_URL = getCoreURL();
|
|
709
|
-
var VERSION = {
|
|
710
|
-
v1: "/api/v1"
|
|
711
|
-
};
|
|
712
|
-
var END_POINT = {
|
|
713
|
-
get LOGIN() {
|
|
714
|
-
return `${getBaseURL()}${VERSION.v1}/cti/login?provider=convox`;
|
|
715
|
-
},
|
|
716
|
-
get READY_AGENT() {
|
|
717
|
-
return `${getCoreURL()}${VERSION.v1}/agents/ready`;
|
|
718
|
-
},
|
|
719
|
-
get UPDATE_AGENT_BREAK() {
|
|
720
|
-
return `${getCoreURL()}${VERSION.v1}/agents/status`;
|
|
721
|
-
},
|
|
722
|
-
get CLICK_TO_CALL() {
|
|
723
|
-
return `${getCoreURL()}${VERSION.v1}/cti/calls/dial`;
|
|
724
|
-
},
|
|
725
|
-
get HOLD_CALL() {
|
|
726
|
-
return `${getCoreURL()}${VERSION.v1}/cti/calls/hold`;
|
|
727
|
-
},
|
|
728
|
-
get MUTE_CALL() {
|
|
729
|
-
return `${getCoreURL()}${VERSION.v1}/cti/calls/mute`;
|
|
730
|
-
},
|
|
731
|
-
get UNMUTE_CALL() {
|
|
732
|
-
return `${getCoreURL()}${VERSION.v1}/cti/mute`;
|
|
733
|
-
},
|
|
734
|
-
get END_CALL() {
|
|
735
|
-
return `${getCoreURL()}${VERSION.v1}/cti/calls/hangup`;
|
|
736
|
-
},
|
|
737
|
-
get LOGOUT() {
|
|
738
|
-
return `${getBaseURL()}${VERSION.v1}/cti/logout?provider=convox`;
|
|
739
|
-
},
|
|
740
|
-
get CONFERENCE_CALL() {
|
|
741
|
-
return `${getCoreURL()}${VERSION.v1}/cti/calls/conference/add`;
|
|
742
|
-
},
|
|
743
|
-
get CONFERENCE_MERGE_CALL() {
|
|
744
|
-
return `${getCoreURL()}${VERSION.v1}/cti/calls/conference/merge`;
|
|
745
|
-
},
|
|
746
|
-
get CONFERENCE_CALL_HOLD_OR_UN_HOLD() {
|
|
747
|
-
return `${getCoreURL()}${VERSION.v1}/cti/calls/hold`;
|
|
748
|
-
},
|
|
749
|
-
get CONFERENCE_CALL_MUTE_OT_UN_MUTE() {
|
|
750
|
-
return `${getCoreURL()}${VERSION.v1}/cti/calls/mute`;
|
|
751
|
-
},
|
|
752
|
-
get CONFERENCE_CALL_END() {
|
|
753
|
-
return `${getCoreURL()}${VERSION.v1}/cti/calls/hangup`;
|
|
754
|
-
},
|
|
755
|
-
get CONFERENCE_CALL_END_ALL() {
|
|
756
|
-
return `${getCoreURL()}${VERSION.v1}/cti/calls/hangup`;
|
|
757
|
-
},
|
|
758
|
-
get CONFERENCE_CALL_TRANSFER() {
|
|
759
|
-
return `${getCoreURL()}${VERSION.v1}/cti/calls/conference/transfer`;
|
|
760
|
-
},
|
|
761
|
-
get TRANSFER_CALL() {
|
|
762
|
-
return `${getCoreURL()}${VERSION.v1}/cti/calls/transfer-call`;
|
|
763
|
-
},
|
|
764
|
-
get AGENTS_LIST() {
|
|
765
|
-
return `${getBaseURL()}${VERSION.v1}/cti/users`;
|
|
766
|
-
},
|
|
767
|
-
get PROCESS_LIST() {
|
|
768
|
-
return `${getBaseURL()}${VERSION.v1}/cti/processes-list`;
|
|
769
|
-
},
|
|
770
|
-
get BREAKS_LIST() {
|
|
771
|
-
return `${getBaseURL()}${VERSION.v1}/cti/breaks`;
|
|
772
|
-
},
|
|
773
|
-
get TRANSFER_TO_DETAILS() {
|
|
774
|
-
return `${getBaseURL()}${VERSION.v1}/cti/transfer-to-details?provider=convox`;
|
|
775
|
-
},
|
|
776
|
-
get SEND_NOTIFICATIONS() {
|
|
777
|
-
return `${getBaseURL()}${VERSION.v1}/cti/notifications/send`;
|
|
778
|
-
},
|
|
779
|
-
get CALL_HISTORY() {
|
|
780
|
-
return `${getBaseURL()}${VERSION.v1}/dashboard/call-history`;
|
|
781
|
-
},
|
|
782
|
-
get SENTIMENTAL_ANALYSIS() {
|
|
783
|
-
return `${getBaseURL()}${VERSION.v1}/users/get_sentiment_analysis`;
|
|
784
|
-
},
|
|
785
|
-
get DISPOSITIONS() {
|
|
786
|
-
return `${getBaseURL()}${VERSION.v1}/cti/calls/dispositions`;
|
|
787
|
-
},
|
|
788
|
-
SET_CALL_DISPOSITION: (callUuid) => `${getBaseURL()}${VERSION.v1}/calls/${callUuid}/disposition`,
|
|
789
|
-
get HOSPITALS_SERVICES() {
|
|
790
|
-
return `${getBaseURL()}${VERSION.v1}/cti/hospital/services`;
|
|
791
|
-
},
|
|
792
|
-
get BLIEND_TRANSFER() {
|
|
793
|
-
return `${getBaseURL()}${VERSION.v1}/cti/calls/blind_transfer?provider=convox`;
|
|
794
|
-
},
|
|
795
|
-
// Permissions
|
|
796
|
-
get USER_PERMISSIONS() {
|
|
797
|
-
return `${getBaseURL()}${VERSION.v1}/rbac/users/me/permissions`;
|
|
798
|
-
}
|
|
799
|
-
};
|
|
800
|
-
|
|
801
|
-
// call-control-sdk/lib/services/axios.ts
|
|
802
|
-
import axios from "axios";
|
|
803
|
-
var _a;
|
|
804
|
-
var DEFAULT_TOKEN = (_a = sdkStateManager.getSdkAuthToken()) != null ? _a : "";
|
|
805
|
-
var REQUEST_TIMEOUT = 6e4;
|
|
806
|
-
function getAuthToken() {
|
|
807
|
-
var _a2;
|
|
808
|
-
return (_a2 = sdkStateManager.getSdkAuthToken()) != null ? _a2 : "";
|
|
809
|
-
}
|
|
810
|
-
function createAxiosInstance() {
|
|
811
|
-
var _a2, _b, _c, _d;
|
|
812
|
-
const instance = axios.create({
|
|
813
|
-
// baseURL: sdkStateManager.getState()?.urlConfig?.baseURL,
|
|
814
|
-
headers: {
|
|
815
|
-
"Content-Type": "application/json",
|
|
816
|
-
Accept: "application/json",
|
|
817
|
-
"x-tenant-id": (_b = (_a2 = sdkStateManager.getCredentials()) == null ? void 0 : _a2.tenantId) != null ? _b : "",
|
|
818
|
-
"x-api-key": (_d = (_c = sdkStateManager.getCredentials()) == null ? void 0 : _c.apiKey) != null ? _d : "",
|
|
819
|
-
Authorization: DEFAULT_TOKEN ? DEFAULT_TOKEN.startsWith("Bearer ") ? DEFAULT_TOKEN : `Bearer ${DEFAULT_TOKEN}` : ""
|
|
820
|
-
},
|
|
821
|
-
timeout: REQUEST_TIMEOUT,
|
|
822
|
-
withCredentials: false
|
|
823
|
-
});
|
|
824
|
-
instance.interceptors.request.use(
|
|
825
|
-
(config) => {
|
|
826
|
-
const token = getAuthToken();
|
|
827
|
-
if (token && config.headers) {
|
|
828
|
-
const authToken = token.startsWith("Bearer ") ? token : `Bearer ${token}`;
|
|
829
|
-
config.headers.Authorization = authToken;
|
|
830
|
-
}
|
|
831
|
-
console.log("API Request:", {
|
|
832
|
-
url: config.url,
|
|
833
|
-
method: config.method,
|
|
834
|
-
hasToken: !!token,
|
|
835
|
-
tokenStartsWithBearer: token == null ? void 0 : token.startsWith("Bearer "),
|
|
836
|
-
headers: {
|
|
837
|
-
Authorization: config.headers.Authorization,
|
|
838
|
-
"x-tenant-id": config.headers["x-tenant-id"],
|
|
839
|
-
"x-api-key": config.headers["x-api-key"]
|
|
840
|
-
}
|
|
841
|
-
});
|
|
842
|
-
config.metadata = { startTime: (/* @__PURE__ */ new Date()).getTime() };
|
|
843
|
-
return config;
|
|
844
|
-
},
|
|
845
|
-
(error) => {
|
|
846
|
-
console.error("Request interceptor error:", error);
|
|
847
|
-
return Promise.reject(error);
|
|
848
|
-
}
|
|
849
|
-
);
|
|
850
|
-
instance.interceptors.response.use(
|
|
851
|
-
(response) => {
|
|
852
|
-
return response;
|
|
853
|
-
},
|
|
854
|
-
async (error) => {
|
|
855
|
-
var _a3;
|
|
856
|
-
const originalRequest = error.config;
|
|
857
|
-
if (((_a3 = error.response) == null ? void 0 : _a3.status) === 401 && !originalRequest._retry) {
|
|
858
|
-
sdkStateManager.setInitCheck();
|
|
859
|
-
console.warn("Unauthorized request, attempting retry...");
|
|
860
|
-
}
|
|
861
|
-
if (!error.response) {
|
|
862
|
-
console.error("Network error:", error.message);
|
|
863
|
-
error.message = "Network error: Please check your internet connection";
|
|
864
|
-
}
|
|
865
|
-
if (error.response && error.response.status >= 500) {
|
|
866
|
-
console.error("Server error:", error.response.status, error.response.data);
|
|
867
|
-
error.message = "Server error: Please try again later";
|
|
868
|
-
}
|
|
869
|
-
return Promise.reject(error);
|
|
870
|
-
}
|
|
871
|
-
);
|
|
872
|
-
return instance;
|
|
873
|
-
}
|
|
874
|
-
var axiosInstance = createAxiosInstance();
|
|
875
|
-
var axios_default = axiosInstance;
|
|
876
|
-
|
|
877
|
-
// call-control-sdk/lib/hooks/useEndCall.ts
|
|
878
|
-
import { getItem as getItem3 } from "@react-solutions/vault";
|
|
134
|
+
import { getSession } from "@react-solutions/vault";
|
|
879
135
|
var useEndCall = () => {
|
|
880
136
|
const [loading, setLoading] = useState2(false);
|
|
881
137
|
const [success, setSuccess] = useState2(false);
|
|
@@ -884,13 +140,13 @@ var useEndCall = () => {
|
|
|
884
140
|
const [data, setData] = useState2(null);
|
|
885
141
|
const handleEndCall = useCallback2(
|
|
886
142
|
async (data2) => {
|
|
887
|
-
var
|
|
888
|
-
const state =
|
|
143
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
144
|
+
const state = getSession(STORAGE_KEY);
|
|
889
145
|
setLoading(true);
|
|
890
146
|
const payload = {
|
|
891
147
|
action: "ENDCALL",
|
|
892
148
|
userId: state == null ? void 0 : state.agentId,
|
|
893
|
-
processid: (_c = (_b = (
|
|
149
|
+
processid: (_c = (_b = (_a = state == null ? void 0 : state.process) == null ? void 0 : _a.process_id) == null ? void 0 : _b.toString()) != null ? _c : "",
|
|
894
150
|
process_name: (_e = (_d = state == null ? void 0 : state.process) == null ? void 0 : _d.process_name) != null ? _e : "",
|
|
895
151
|
callreferenceid: (_g = (_f = state == null ? void 0 : state.callData) == null ? void 0 : _f.convox_id) != null ? _g : "",
|
|
896
152
|
mobile_number: (_i = (_h = state == null ? void 0 : state.callData) == null ? void 0 : _h.phone_number) != null ? _i : "",
|
|
@@ -913,10 +169,10 @@ var useEndCall = () => {
|
|
|
913
169
|
setSuccess(true);
|
|
914
170
|
return res == null ? void 0 : res.data;
|
|
915
171
|
}).catch((err) => {
|
|
916
|
-
var
|
|
172
|
+
var _a2;
|
|
917
173
|
setIsError(true);
|
|
918
174
|
setError(err);
|
|
919
|
-
return (
|
|
175
|
+
return (_a2 = err == null ? void 0 : err.response) == null ? void 0 : _a2.data;
|
|
920
176
|
}).finally(() => {
|
|
921
177
|
setLoading(false);
|
|
922
178
|
});
|
|
@@ -935,7 +191,7 @@ var useEndCall = () => {
|
|
|
935
191
|
|
|
936
192
|
// call-control-sdk/lib/hooks/useClickToCall.ts
|
|
937
193
|
import { useCallback as useCallback3, useState as useState3 } from "react";
|
|
938
|
-
import {
|
|
194
|
+
import { getSession as getSession2 } from "@react-solutions/vault";
|
|
939
195
|
var useClickToCall = () => {
|
|
940
196
|
const [loading, setLoading] = useState3(false);
|
|
941
197
|
const [success, setSuccess] = useState3(false);
|
|
@@ -943,10 +199,10 @@ var useClickToCall = () => {
|
|
|
943
199
|
const [error, setError] = useState3(null);
|
|
944
200
|
const [data, setData] = useState3(null);
|
|
945
201
|
const handleStartCall = useCallback3(async (data2) => {
|
|
946
|
-
var
|
|
947
|
-
const state =
|
|
202
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
203
|
+
const state = getSession2(STORAGE_KEY);
|
|
948
204
|
setLoading(true);
|
|
949
|
-
if (((
|
|
205
|
+
if (((_a = state == null ? void 0 : state.callData) == null ? void 0 : _a.status) === "IDLE") {
|
|
950
206
|
const payload = {
|
|
951
207
|
action: "CALL",
|
|
952
208
|
userId: state == null ? void 0 : state.agentId,
|
|
@@ -958,10 +214,10 @@ var useClickToCall = () => {
|
|
|
958
214
|
setSuccess(true);
|
|
959
215
|
return res == null ? void 0 : res.data;
|
|
960
216
|
}).catch((err) => {
|
|
961
|
-
var
|
|
217
|
+
var _a2;
|
|
962
218
|
setIsError(true);
|
|
963
219
|
setError(err);
|
|
964
|
-
return (
|
|
220
|
+
return (_a2 = err == null ? void 0 : err.response) == null ? void 0 : _a2.data;
|
|
965
221
|
}).finally(() => {
|
|
966
222
|
setLoading(false);
|
|
967
223
|
});
|
|
@@ -981,10 +237,10 @@ var useClickToCall = () => {
|
|
|
981
237
|
sdkStateManager.setOpenConferenceDialog(true);
|
|
982
238
|
return res == null ? void 0 : res.data;
|
|
983
239
|
}).catch((err) => {
|
|
984
|
-
var
|
|
240
|
+
var _a2;
|
|
985
241
|
setIsError(true);
|
|
986
242
|
setError(err);
|
|
987
|
-
return (
|
|
243
|
+
return (_a2 = err == null ? void 0 : err.response) == null ? void 0 : _a2.data;
|
|
988
244
|
}).finally(() => {
|
|
989
245
|
setLoading(false);
|
|
990
246
|
});
|
|
@@ -1059,8 +315,81 @@ function useSDKState() {
|
|
|
1059
315
|
return state;
|
|
1060
316
|
}
|
|
1061
317
|
|
|
318
|
+
// call-control-sdk/lib/hooks/useCallMonitoring.ts
|
|
319
|
+
import { useCallback as useCallback4, useState as useState7 } from "react";
|
|
320
|
+
var useCallMonitoring = () => {
|
|
321
|
+
const [loading, setLoading] = useState7(false);
|
|
322
|
+
const [success, setSuccess] = useState7(false);
|
|
323
|
+
const [isError, setIsError] = useState7(false);
|
|
324
|
+
const [error, setError] = useState7(null);
|
|
325
|
+
const [data, setData] = useState7(null);
|
|
326
|
+
const resetState = () => {
|
|
327
|
+
setSuccess(false);
|
|
328
|
+
setIsError(false);
|
|
329
|
+
setError(null);
|
|
330
|
+
};
|
|
331
|
+
const startMonitoring2 = useCallback4(async (payload) => {
|
|
332
|
+
resetState();
|
|
333
|
+
setLoading(true);
|
|
334
|
+
return axios_default.post(END_POINT.SUPERVISOR_CALL_LISTEN, payload).then((res) => {
|
|
335
|
+
setData(res == null ? void 0 : res.data);
|
|
336
|
+
setSuccess(true);
|
|
337
|
+
return res == null ? void 0 : res.data;
|
|
338
|
+
}).catch((err) => {
|
|
339
|
+
var _a;
|
|
340
|
+
setIsError(true);
|
|
341
|
+
setError(err);
|
|
342
|
+
return (_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data;
|
|
343
|
+
}).finally(() => {
|
|
344
|
+
setLoading(false);
|
|
345
|
+
});
|
|
346
|
+
}, []);
|
|
347
|
+
const stopMonitoring2 = useCallback4(async (payload) => {
|
|
348
|
+
resetState();
|
|
349
|
+
setLoading(true);
|
|
350
|
+
return axios_default.post(END_POINT.SUPERVISOR_CALL_LEAVE, payload).then((res) => {
|
|
351
|
+
setData(res == null ? void 0 : res.data);
|
|
352
|
+
setSuccess(true);
|
|
353
|
+
return res == null ? void 0 : res.data;
|
|
354
|
+
}).catch((err) => {
|
|
355
|
+
var _a;
|
|
356
|
+
setIsError(true);
|
|
357
|
+
setError(err);
|
|
358
|
+
return (_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data;
|
|
359
|
+
}).finally(() => {
|
|
360
|
+
setLoading(false);
|
|
361
|
+
});
|
|
362
|
+
}, []);
|
|
363
|
+
const changeMode = useCallback4(async (payload) => {
|
|
364
|
+
resetState();
|
|
365
|
+
setLoading(true);
|
|
366
|
+
return axios_default.post(END_POINT.SUPERVISOR_CALL_CHANGE_MODE, payload).then((res) => {
|
|
367
|
+
setData(res == null ? void 0 : res.data);
|
|
368
|
+
setSuccess(true);
|
|
369
|
+
return res == null ? void 0 : res.data;
|
|
370
|
+
}).catch((err) => {
|
|
371
|
+
var _a;
|
|
372
|
+
setIsError(true);
|
|
373
|
+
setError(err);
|
|
374
|
+
return (_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data;
|
|
375
|
+
}).finally(() => {
|
|
376
|
+
setLoading(false);
|
|
377
|
+
});
|
|
378
|
+
}, []);
|
|
379
|
+
return {
|
|
380
|
+
startMonitoring: startMonitoring2,
|
|
381
|
+
stopMonitoring: stopMonitoring2,
|
|
382
|
+
changeMode,
|
|
383
|
+
isLoading: loading,
|
|
384
|
+
isSuccess: success,
|
|
385
|
+
isError,
|
|
386
|
+
error,
|
|
387
|
+
data
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
|
|
1062
391
|
// call-control-sdk/lib/components/callControlPanel.tsx
|
|
1063
|
-
import { memo
|
|
392
|
+
import { memo, useCallback as useCallback7 } from "react";
|
|
1064
393
|
|
|
1065
394
|
// call-control-sdk/lib/components/callControls.tsx
|
|
1066
395
|
import {
|
|
@@ -1091,8 +420,8 @@ import {
|
|
|
1091
420
|
CircularProgress as CircularProgress2,
|
|
1092
421
|
Fade,
|
|
1093
422
|
IconButton as IconButton2,
|
|
1094
|
-
Menu,
|
|
1095
|
-
MenuItem,
|
|
423
|
+
Menu as Menu2,
|
|
424
|
+
MenuItem as MenuItem2,
|
|
1096
425
|
Paper as Paper2,
|
|
1097
426
|
TextField as TextField2,
|
|
1098
427
|
Tooltip as Tooltip2,
|
|
@@ -1112,8 +441,10 @@ import {
|
|
|
1112
441
|
Pause,
|
|
1113
442
|
PhoneDisabled,
|
|
1114
443
|
PlayArrow,
|
|
444
|
+
RecordVoiceOver,
|
|
1115
445
|
Roofing,
|
|
1116
446
|
SupportAgent,
|
|
447
|
+
TransferWithinAStation,
|
|
1117
448
|
Upcoming
|
|
1118
449
|
} from "@mui/icons-material";
|
|
1119
450
|
import {
|
|
@@ -1121,6 +452,8 @@ import {
|
|
|
1121
452
|
Button,
|
|
1122
453
|
Dialog,
|
|
1123
454
|
IconButton,
|
|
455
|
+
Menu,
|
|
456
|
+
MenuItem,
|
|
1124
457
|
Paper,
|
|
1125
458
|
TextField,
|
|
1126
459
|
Typography,
|
|
@@ -1139,53 +472,7 @@ import {
|
|
|
1139
472
|
import { useEffect as useEffect4, useMemo, useState as useState8 } from "react";
|
|
1140
473
|
|
|
1141
474
|
// call-control-sdk/lib/services/request.ts
|
|
1142
|
-
import { useCallback as
|
|
1143
|
-
|
|
1144
|
-
// call-control-sdk/lib/services/toastMessage.tsx
|
|
1145
|
-
import { createContext, useContext, useState as useState7 } from "react";
|
|
1146
|
-
import { Snackbar, Alert } from "@mui/material";
|
|
1147
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1148
|
-
var ToastContext = createContext(void 0);
|
|
1149
|
-
var useToast = () => {
|
|
1150
|
-
const ctx = useContext(ToastContext);
|
|
1151
|
-
if (!ctx) throw new Error("useToast must be used inside ToastProvider");
|
|
1152
|
-
return ctx;
|
|
1153
|
-
};
|
|
1154
|
-
var ToastProvider = ({ children }) => {
|
|
1155
|
-
const [open, setOpen] = useState7(false);
|
|
1156
|
-
const [message, setMessage] = useState7("");
|
|
1157
|
-
const [severity, setSeverity] = useState7("info");
|
|
1158
|
-
const showToast = (msg, sev = "info") => {
|
|
1159
|
-
setMessage(msg);
|
|
1160
|
-
setSeverity(sev);
|
|
1161
|
-
setOpen(true);
|
|
1162
|
-
};
|
|
1163
|
-
return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: { showToast }, children: [
|
|
1164
|
-
children,
|
|
1165
|
-
/* @__PURE__ */ jsx(
|
|
1166
|
-
Snackbar,
|
|
1167
|
-
{
|
|
1168
|
-
open,
|
|
1169
|
-
color: severity,
|
|
1170
|
-
autoHideDuration: 3e3,
|
|
1171
|
-
onClose: () => setOpen(false),
|
|
1172
|
-
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
1173
|
-
children: /* @__PURE__ */ jsx(
|
|
1174
|
-
Alert,
|
|
1175
|
-
{
|
|
1176
|
-
variant: "filled",
|
|
1177
|
-
severity,
|
|
1178
|
-
onClose: () => setOpen(false),
|
|
1179
|
-
sx: { width: "100%" },
|
|
1180
|
-
children: message
|
|
1181
|
-
}
|
|
1182
|
-
)
|
|
1183
|
-
}
|
|
1184
|
-
)
|
|
1185
|
-
] });
|
|
1186
|
-
};
|
|
1187
|
-
|
|
1188
|
-
// call-control-sdk/lib/services/request.ts
|
|
475
|
+
import { useCallback as useCallback5, useReducer } from "react";
|
|
1189
476
|
var initialState = {
|
|
1190
477
|
isLoading: false,
|
|
1191
478
|
isSuccess: false,
|
|
@@ -1223,15 +510,15 @@ var useGetRequest = (props = {}) => {
|
|
|
1223
510
|
const { onSuccess = null, onError = null } = props;
|
|
1224
511
|
const { showToast } = useToast();
|
|
1225
512
|
const [state, dispatch] = useReducer(reducer, initialState);
|
|
1226
|
-
const getRequest =
|
|
513
|
+
const getRequest = useCallback5(
|
|
1227
514
|
(url, config = {}) => {
|
|
1228
515
|
dispatch({
|
|
1229
516
|
type: "isLoading",
|
|
1230
517
|
payload: true
|
|
1231
518
|
});
|
|
1232
519
|
axios_default.get(url, config).then((res) => {
|
|
1233
|
-
var
|
|
1234
|
-
if ((
|
|
520
|
+
var _a, _b;
|
|
521
|
+
if ((_a = res.data) == null ? void 0 : _a.success) {
|
|
1235
522
|
dispatch({
|
|
1236
523
|
type: "isSuccess",
|
|
1237
524
|
payload: res.data
|
|
@@ -1246,9 +533,9 @@ var useGetRequest = (props = {}) => {
|
|
|
1246
533
|
onError == null ? void 0 : onError(res.data, config);
|
|
1247
534
|
}
|
|
1248
535
|
}).catch((err) => {
|
|
1249
|
-
var
|
|
536
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
1250
537
|
const error = {
|
|
1251
|
-
status: (_b = (
|
|
538
|
+
status: (_b = (_a = err.response) == null ? void 0 : _a.status) != null ? _b : 500,
|
|
1252
539
|
message: ((_d = (_c = err.response) == null ? void 0 : _c.data) == null ? void 0 : _d.detail) || ((_f = (_e = err.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || err.message || "An unknown error occurred",
|
|
1253
540
|
data: (_h = (_g = err.response) == null ? void 0 : _g.data) != null ? _h : null,
|
|
1254
541
|
statusText: (_j = (_i = err.response) == null ? void 0 : _i.statusText) != null ? _j : "",
|
|
@@ -1276,9 +563,9 @@ var usePostRequest = (props = {}) => {
|
|
|
1276
563
|
const { onSuccess = null, onError = null, disabledSuccessToast = false } = props;
|
|
1277
564
|
const { showToast } = useToast();
|
|
1278
565
|
const [state, dispatch] = useReducer(reducer, initialState);
|
|
1279
|
-
const postRequest =
|
|
566
|
+
const postRequest = useCallback5(
|
|
1280
567
|
async (url, payload, config = {}) => {
|
|
1281
|
-
var
|
|
568
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
1282
569
|
dispatch({
|
|
1283
570
|
type: "isLoading",
|
|
1284
571
|
payload: true
|
|
@@ -1292,7 +579,7 @@ var usePostRequest = (props = {}) => {
|
|
|
1292
579
|
});
|
|
1293
580
|
onSuccess == null ? void 0 : onSuccess(res.data, payload);
|
|
1294
581
|
if (!disabledSuccessToast) {
|
|
1295
|
-
showToast((
|
|
582
|
+
showToast((_a = res.data) == null ? void 0 : _a.message, "success");
|
|
1296
583
|
}
|
|
1297
584
|
} catch (err) {
|
|
1298
585
|
const error = {
|
|
@@ -1387,14 +674,14 @@ var useStyles = ({
|
|
|
1387
674
|
var styles_default = useStyles;
|
|
1388
675
|
|
|
1389
676
|
// call-control-sdk/lib/components/dialog.tsx
|
|
1390
|
-
import { Fragment, jsx
|
|
677
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
1391
678
|
var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
1392
|
-
var
|
|
679
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1393
680
|
const state = useSDKState();
|
|
1394
681
|
const theme = useTheme2();
|
|
1395
682
|
const { showToast } = useToast();
|
|
1396
683
|
const { disabled, enabled, outlined } = styles_default({
|
|
1397
|
-
disabled: ((
|
|
684
|
+
disabled: ((_a = state.sdkConfig) == null ? void 0 : _a.disabled) || {},
|
|
1398
685
|
enabled: ((_b = state.sdkConfig) == null ? void 0 : _b.enabled) || {},
|
|
1399
686
|
outlined: ((_c = state.sdkConfig) == null ? void 0 : _c.outlined) || {}
|
|
1400
687
|
});
|
|
@@ -1412,9 +699,9 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1412
699
|
sdkStateManager.setConferenceLine(__spreadValues(__spreadValues({}, line), data));
|
|
1413
700
|
};
|
|
1414
701
|
const onConferenceCallStart = (line, data) => {
|
|
1415
|
-
var
|
|
702
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
1416
703
|
const line_used = __spreadValues(__spreadValues({}, line), data);
|
|
1417
|
-
if (line_used.phone === ((
|
|
704
|
+
if (line_used.phone === ((_a2 = state.callData) == null ? void 0 : _a2.phone_number)) {
|
|
1418
705
|
showToast("Cannot conference with the active call number", "error");
|
|
1419
706
|
return;
|
|
1420
707
|
}
|
|
@@ -1441,18 +728,18 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1441
728
|
process: (_f2 = (_e2 = state.callData) == null ? void 0 : _e2.process_name) != null ? _f2 : ""
|
|
1442
729
|
};
|
|
1443
730
|
axios_default.post(END_POINT.CONFERENCE_CALL, payload).then((res) => {
|
|
1444
|
-
var
|
|
1445
|
-
showToast((
|
|
731
|
+
var _a3;
|
|
732
|
+
showToast((_a3 = res.data) == null ? void 0 : _a3.message, "success");
|
|
1446
733
|
}).catch((err) => {
|
|
1447
|
-
var
|
|
1448
|
-
const message = ((_b3 = (
|
|
734
|
+
var _a3, _b3, _c3, _d3;
|
|
735
|
+
const message = ((_b3 = (_a3 = err.response) == null ? void 0 : _a3.data) == null ? void 0 : _b3.detail) || ((_d3 = (_c3 = err.response) == null ? void 0 : _c3.data) == null ? void 0 : _d3.message) || err.message || "An unknown error occurred";
|
|
1449
736
|
showToast(message, "error");
|
|
1450
737
|
}).finally(() => {
|
|
1451
738
|
setConferenceCallStart(false);
|
|
1452
739
|
});
|
|
1453
740
|
};
|
|
1454
741
|
const onMergeConferenceCall = (line, data) => {
|
|
1455
|
-
var
|
|
742
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
1456
743
|
const line_used = __spreadValues(__spreadValues({}, line), data);
|
|
1457
744
|
setConferenceCallMerge(true);
|
|
1458
745
|
const payload = {
|
|
@@ -1460,13 +747,13 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1460
747
|
operation: `CONFERENCE`,
|
|
1461
748
|
line_used: String(line_used.line),
|
|
1462
749
|
thirdparty_no: line_used.phone,
|
|
1463
|
-
userid: (_b2 = (
|
|
750
|
+
userid: (_b2 = (_a2 = state.callData) == null ? void 0 : _a2.agent_id) != null ? _b2 : -1,
|
|
1464
751
|
process: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.process_name) != null ? _d2 : "",
|
|
1465
752
|
convox_id: (_f2 = (_e2 = state.callData) == null ? void 0 : _e2.convox_id) != null ? _f2 : ""
|
|
1466
753
|
};
|
|
1467
754
|
axios_default.post(END_POINT.CONFERENCE_MERGE_CALL, payload).then((res) => {
|
|
1468
|
-
var
|
|
1469
|
-
if (((
|
|
755
|
+
var _a3, _b3, _c3;
|
|
756
|
+
if (((_a3 = state.callData) == null ? void 0 : _a3.hold) === 1) {
|
|
1470
757
|
handleHoldToggle();
|
|
1471
758
|
}
|
|
1472
759
|
if (((_b3 = state.callData) == null ? void 0 : _b3.mute) === 1) {
|
|
@@ -1474,39 +761,39 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1474
761
|
}
|
|
1475
762
|
showToast((_c3 = res.data) == null ? void 0 : _c3.message, "success");
|
|
1476
763
|
}).catch((err) => {
|
|
1477
|
-
var
|
|
1478
|
-
const message = ((_b3 = (
|
|
764
|
+
var _a3, _b3, _c3, _d3;
|
|
765
|
+
const message = ((_b3 = (_a3 = err.response) == null ? void 0 : _a3.data) == null ? void 0 : _b3.detail) || ((_d3 = (_c3 = err.response) == null ? void 0 : _c3.data) == null ? void 0 : _d3.message) || err.message || "An unknown error occurred";
|
|
1479
766
|
showToast(message, "error");
|
|
1480
767
|
}).finally(() => {
|
|
1481
768
|
setConferenceCallMerge(false);
|
|
1482
769
|
});
|
|
1483
770
|
};
|
|
1484
771
|
const onHoldOrUnHoldConferenceCall = (line, data, type) => {
|
|
1485
|
-
var
|
|
772
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
1486
773
|
const line_used = __spreadValues(__spreadValues({}, line), data);
|
|
1487
774
|
setConferenceCallHoldOrUnHold(true);
|
|
1488
775
|
const payload = {
|
|
1489
776
|
action: type === "HOLDUSER" ? "HOLD" : "UNHOLD",
|
|
1490
777
|
operation: type,
|
|
1491
778
|
hold_channel_no: type === "HOLDUSER" ? `hold${line_used.line}` : `unhold${line_used.line}`,
|
|
1492
|
-
userid: (_b2 = (
|
|
779
|
+
userid: (_b2 = (_a2 = state.callData) == null ? void 0 : _a2.agent_id) != null ? _b2 : -1,
|
|
1493
780
|
process: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.process_name) != null ? _d2 : "",
|
|
1494
781
|
convox_id: (_f2 = (_e2 = state.callData) == null ? void 0 : _e2.convox_id) != null ? _f2 : "",
|
|
1495
782
|
line_number: Number(line_used.line)
|
|
1496
783
|
};
|
|
1497
784
|
axios_default.post(END_POINT.CONFERENCE_CALL_HOLD_OR_UN_HOLD, payload).then((res) => {
|
|
1498
|
-
var
|
|
1499
|
-
showToast((
|
|
785
|
+
var _a3;
|
|
786
|
+
showToast((_a3 = res.data) == null ? void 0 : _a3.message, "success");
|
|
1500
787
|
}).catch((err) => {
|
|
1501
|
-
var
|
|
1502
|
-
const message = ((_b3 = (
|
|
788
|
+
var _a3, _b3, _c3, _d3;
|
|
789
|
+
const message = ((_b3 = (_a3 = err.response) == null ? void 0 : _a3.data) == null ? void 0 : _b3.detail) || ((_d3 = (_c3 = err.response) == null ? void 0 : _c3.data) == null ? void 0 : _d3.message) || err.message || "An unknown error occurred";
|
|
1503
790
|
showToast(message, "error");
|
|
1504
791
|
}).finally(() => {
|
|
1505
792
|
setConferenceCallHoldOrUnHold(false);
|
|
1506
793
|
});
|
|
1507
794
|
};
|
|
1508
795
|
const onEndConferenceCall = (line, data) => {
|
|
1509
|
-
var
|
|
796
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
1510
797
|
const line_used = __spreadValues(__spreadValues({}, line), data);
|
|
1511
798
|
if (line_used.line === 1) {
|
|
1512
799
|
showToast("Cannot end the primary call from conference controls", "error");
|
|
@@ -1519,16 +806,16 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1519
806
|
line_number: Number(line_used.line),
|
|
1520
807
|
user_type: `THIRDPARTY${line_used.line - 1}`,
|
|
1521
808
|
thirdparty_no: line_used.phone,
|
|
1522
|
-
userid: (_b2 = (
|
|
809
|
+
userid: (_b2 = (_a2 = state.callData) == null ? void 0 : _a2.agent_id) != null ? _b2 : -1,
|
|
1523
810
|
process: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.process_name) != null ? _d2 : "",
|
|
1524
811
|
convox_id: (_f2 = (_e2 = state.callData) == null ? void 0 : _e2.convox_id) != null ? _f2 : ""
|
|
1525
812
|
};
|
|
1526
813
|
axios_default.post(END_POINT.CONFERENCE_CALL_END, payload).then((res) => {
|
|
1527
|
-
var
|
|
1528
|
-
showToast((
|
|
814
|
+
var _a3;
|
|
815
|
+
showToast((_a3 = res.data) == null ? void 0 : _a3.message, "success");
|
|
1529
816
|
}).catch((err) => {
|
|
1530
|
-
var
|
|
1531
|
-
const message = ((_b3 = (
|
|
817
|
+
var _a3, _b3, _c3, _d3;
|
|
818
|
+
const message = ((_b3 = (_a3 = err.response) == null ? void 0 : _a3.data) == null ? void 0 : _b3.detail) || ((_d3 = (_c3 = err.response) == null ? void 0 : _c3.data) == null ? void 0 : _d3.message) || err.message || "An unknown error occurred";
|
|
1532
819
|
showToast(message, "error");
|
|
1533
820
|
}).finally(() => {
|
|
1534
821
|
setConferenceCallEnd(false);
|
|
@@ -1537,29 +824,29 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1537
824
|
const [holdOrUnHold] = usePostRequest();
|
|
1538
825
|
const [muteOrUnMute] = usePostRequest();
|
|
1539
826
|
const handleHoldToggle = () => {
|
|
1540
|
-
var
|
|
827
|
+
var _a2;
|
|
1541
828
|
const payload = {
|
|
1542
|
-
action: ((
|
|
829
|
+
action: ((_a2 = state.callData) == null ? void 0 : _a2.hold) === 1 ? "UNHOLD" /* UNHOLD */ : "HOLD" /* HOLD */,
|
|
1543
830
|
userId: state.agentId
|
|
1544
831
|
};
|
|
1545
832
|
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
1546
833
|
};
|
|
1547
834
|
const handleMuteToggle = () => {
|
|
1548
|
-
var
|
|
835
|
+
var _a2;
|
|
1549
836
|
const payload = {
|
|
1550
|
-
action: ((
|
|
837
|
+
action: ((_a2 = state.callData) == null ? void 0 : _a2.mute) === 1 ? "UNMUTE" /* UNMUTE */ : "MUTE" /* MUTE */,
|
|
1551
838
|
userId: state.agentId
|
|
1552
839
|
};
|
|
1553
840
|
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
1554
841
|
};
|
|
1555
|
-
return /* @__PURE__ */
|
|
842
|
+
return /* @__PURE__ */ jsxs(
|
|
1556
843
|
TableRow,
|
|
1557
844
|
{
|
|
1558
845
|
sx: {
|
|
1559
846
|
border: "2px solid #fff"
|
|
1560
847
|
},
|
|
1561
848
|
children: [
|
|
1562
|
-
/* @__PURE__ */
|
|
849
|
+
/* @__PURE__ */ jsx(
|
|
1563
850
|
TableCell,
|
|
1564
851
|
{
|
|
1565
852
|
sx: {
|
|
@@ -1567,21 +854,21 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1567
854
|
flex: 1,
|
|
1568
855
|
width: "100px"
|
|
1569
856
|
},
|
|
1570
|
-
children: /* @__PURE__ */
|
|
857
|
+
children: /* @__PURE__ */ jsxs(Typography, { children: [
|
|
1571
858
|
"Line ",
|
|
1572
859
|
(_f = each == null ? void 0 : each.line) != null ? _f : "",
|
|
1573
860
|
". "
|
|
1574
861
|
] })
|
|
1575
862
|
}
|
|
1576
863
|
),
|
|
1577
|
-
/* @__PURE__ */
|
|
864
|
+
/* @__PURE__ */ jsx(
|
|
1578
865
|
TableCell,
|
|
1579
866
|
{
|
|
1580
867
|
sx: {
|
|
1581
868
|
padding: "6px",
|
|
1582
869
|
width: "150px"
|
|
1583
870
|
},
|
|
1584
|
-
children: /* @__PURE__ */
|
|
871
|
+
children: /* @__PURE__ */ jsx(
|
|
1585
872
|
Typography,
|
|
1586
873
|
{
|
|
1587
874
|
variant: "body2",
|
|
@@ -1595,14 +882,14 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1595
882
|
)
|
|
1596
883
|
}
|
|
1597
884
|
),
|
|
1598
|
-
/* @__PURE__ */
|
|
885
|
+
/* @__PURE__ */ jsx(
|
|
1599
886
|
TableCell,
|
|
1600
887
|
{
|
|
1601
888
|
sx: {
|
|
1602
889
|
padding: "6px",
|
|
1603
890
|
flex: 1
|
|
1604
891
|
},
|
|
1605
|
-
children: /* @__PURE__ */
|
|
892
|
+
children: /* @__PURE__ */ jsx(
|
|
1606
893
|
TextField,
|
|
1607
894
|
{
|
|
1608
895
|
size: "small",
|
|
@@ -1627,14 +914,14 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1627
914
|
)
|
|
1628
915
|
}
|
|
1629
916
|
),
|
|
1630
|
-
/* @__PURE__ */
|
|
917
|
+
/* @__PURE__ */ jsx(
|
|
1631
918
|
TableCell,
|
|
1632
919
|
{
|
|
1633
920
|
sx: {
|
|
1634
921
|
padding: "6px",
|
|
1635
922
|
flex: 1
|
|
1636
923
|
},
|
|
1637
|
-
children: /* @__PURE__ */
|
|
924
|
+
children: /* @__PURE__ */ jsxs(
|
|
1638
925
|
Box,
|
|
1639
926
|
{
|
|
1640
927
|
sx: {
|
|
@@ -1645,7 +932,7 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1645
932
|
gap: "10px"
|
|
1646
933
|
},
|
|
1647
934
|
children: [
|
|
1648
|
-
(each == null ? void 0 : each.line) === 1 && /* @__PURE__ */
|
|
935
|
+
(each == null ? void 0 : each.line) === 1 && /* @__PURE__ */ jsx(Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" /* HOLD */ ? "Hold" : "Resume", children: /* @__PURE__ */ jsx(
|
|
1649
936
|
Button,
|
|
1650
937
|
{
|
|
1651
938
|
variant: (each == null ? void 0 : each.status) === "HOLD" /* HOLD */ ? "contained" : "outlined",
|
|
@@ -1658,7 +945,7 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1658
945
|
}
|
|
1659
946
|
},
|
|
1660
947
|
disabled: (each == null ? void 0 : each.status) !== "CONFERENCE" /* CONFERENCE */ && (each == null ? void 0 : each.status) !== "HOLD" /* HOLD */ || conferenceCallHoldOrUnHold,
|
|
1661
|
-
children: each.status === "HOLD" /* HOLD */ ? /* @__PURE__ */
|
|
948
|
+
children: each.status === "HOLD" /* HOLD */ ? /* @__PURE__ */ jsxs(
|
|
1662
949
|
Box,
|
|
1663
950
|
{
|
|
1664
951
|
sx: {
|
|
@@ -1669,7 +956,7 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1669
956
|
width: "98px"
|
|
1670
957
|
},
|
|
1671
958
|
children: [
|
|
1672
|
-
/* @__PURE__ */
|
|
959
|
+
/* @__PURE__ */ jsx(
|
|
1673
960
|
Typography,
|
|
1674
961
|
{
|
|
1675
962
|
variant: "body2",
|
|
@@ -1680,10 +967,10 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1680
967
|
children: "Unhold"
|
|
1681
968
|
}
|
|
1682
969
|
),
|
|
1683
|
-
conferenceCallHoldOrUnHold ? /* @__PURE__ */
|
|
970
|
+
conferenceCallHoldOrUnHold ? /* @__PURE__ */ jsx(CircularProgress, { size: "16px", sx: { color: theme.palette.primary.main } }) : /* @__PURE__ */ jsx(PlayArrow, {})
|
|
1684
971
|
]
|
|
1685
972
|
}
|
|
1686
|
-
) : /* @__PURE__ */
|
|
973
|
+
) : /* @__PURE__ */ jsxs(
|
|
1687
974
|
Box,
|
|
1688
975
|
{
|
|
1689
976
|
sx: {
|
|
@@ -1694,7 +981,7 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1694
981
|
width: "98px"
|
|
1695
982
|
},
|
|
1696
983
|
children: [
|
|
1697
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ jsx(
|
|
1698
985
|
Typography,
|
|
1699
986
|
{
|
|
1700
987
|
variant: "body2",
|
|
@@ -1702,17 +989,17 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1702
989
|
children: "Hold"
|
|
1703
990
|
}
|
|
1704
991
|
),
|
|
1705
|
-
conferenceCallHoldOrUnHold ? /* @__PURE__ */
|
|
992
|
+
conferenceCallHoldOrUnHold ? /* @__PURE__ */ jsx(CircularProgress, { size: "16px", sx: { color: theme.palette.primary.main } }) : /* @__PURE__ */ jsx(Pause, {})
|
|
1706
993
|
]
|
|
1707
994
|
}
|
|
1708
995
|
)
|
|
1709
996
|
}
|
|
1710
997
|
) }),
|
|
1711
|
-
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */
|
|
998
|
+
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ jsx(
|
|
1712
999
|
Tooltip,
|
|
1713
1000
|
{
|
|
1714
1001
|
title: hasPhoneConflict ? phoneConflictHelperText || "Cannot dial this number" : "Call",
|
|
1715
|
-
children: /* @__PURE__ */
|
|
1002
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
1716
1003
|
Button,
|
|
1717
1004
|
{
|
|
1718
1005
|
variant: (each == null ? void 0 : each.status) !== "IDLE" /* IDLE */ ? "outlined" : "contained",
|
|
@@ -1733,7 +1020,7 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1733
1020
|
onConferenceCallStart(each, {});
|
|
1734
1021
|
},
|
|
1735
1022
|
disabled: (each == null ? void 0 : each.status) !== "IDLE" /* IDLE */ || isLineDialing || hasPhoneConflict,
|
|
1736
|
-
children: conferenceCallStart ? /* @__PURE__ */
|
|
1023
|
+
children: conferenceCallStart ? /* @__PURE__ */ jsx(CircularProgress, { size: "20px", color: "success" }) : /* @__PURE__ */ jsx(
|
|
1737
1024
|
Call,
|
|
1738
1025
|
{
|
|
1739
1026
|
sx: {
|
|
@@ -1745,7 +1032,7 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1745
1032
|
) })
|
|
1746
1033
|
}
|
|
1747
1034
|
),
|
|
1748
|
-
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */
|
|
1035
|
+
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ jsx(Tooltip, { title: "Merge Call", children: /* @__PURE__ */ jsx(
|
|
1749
1036
|
Button,
|
|
1750
1037
|
{
|
|
1751
1038
|
variant: (each == null ? void 0 : each.status) === "ONCALL" /* ONCALL */ ? "contained" : "outlined",
|
|
@@ -1754,10 +1041,10 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1754
1041
|
onMergeConferenceCall(each, { isMergeCall: true });
|
|
1755
1042
|
},
|
|
1756
1043
|
disabled: (each == null ? void 0 : each.status) !== "ONCALL" /* ONCALL */,
|
|
1757
|
-
children: conferenceCallMerge ? /* @__PURE__ */
|
|
1044
|
+
children: conferenceCallMerge ? /* @__PURE__ */ jsx(CircularProgress, { size: "20px" }) : /* @__PURE__ */ jsx(CallSplit, {})
|
|
1758
1045
|
}
|
|
1759
1046
|
) }),
|
|
1760
|
-
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */
|
|
1047
|
+
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ jsx(Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" /* HOLD */ ? "Hold" : "Resume", children: /* @__PURE__ */ jsx(
|
|
1761
1048
|
Button,
|
|
1762
1049
|
{
|
|
1763
1050
|
variant: (each == null ? void 0 : each.status) === "HOLD" /* HOLD */ ? "contained" : "outlined",
|
|
@@ -1770,10 +1057,10 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1770
1057
|
}
|
|
1771
1058
|
},
|
|
1772
1059
|
disabled: (each == null ? void 0 : each.status) !== "CONFERENCE" /* CONFERENCE */ && (each == null ? void 0 : each.status) !== "HOLD" /* HOLD */ || conferenceCallHoldOrUnHold,
|
|
1773
|
-
children: conferenceCallHoldOrUnHold ? /* @__PURE__ */
|
|
1060
|
+
children: conferenceCallHoldOrUnHold ? /* @__PURE__ */ jsx(CircularProgress, { size: "20px", sx: { color: theme.palette.primary.main } }) : each.status === "HOLD" /* HOLD */ ? /* @__PURE__ */ jsx(PlayArrow, {}) : /* @__PURE__ */ jsx(Pause, {})
|
|
1774
1061
|
}
|
|
1775
1062
|
) }),
|
|
1776
|
-
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */
|
|
1063
|
+
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ jsx(Tooltip, { title: "End Call", children: /* @__PURE__ */ jsx(
|
|
1777
1064
|
Button,
|
|
1778
1065
|
{
|
|
1779
1066
|
variant: (each == null ? void 0 : each.status) !== "IDLE" /* IDLE */ && (each == null ? void 0 : each.status) !== "DISCONNECTED" /* DISCONNECTED */ ? "contained" : "outlined",
|
|
@@ -1799,7 +1086,7 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1799
1086
|
});
|
|
1800
1087
|
},
|
|
1801
1088
|
disabled: (each == null ? void 0 : each.status) === "IDLE" /* IDLE */ || (each == null ? void 0 : each.status) === "DISCONNECTED" /* DISCONNECTED */ || conferenceCallEnd,
|
|
1802
|
-
children: conferenceCallEnd ? /* @__PURE__ */
|
|
1089
|
+
children: conferenceCallEnd ? /* @__PURE__ */ jsx(CircularProgress, { size: "20px", color: "error" }) : /* @__PURE__ */ jsx(CallEnd, {})
|
|
1803
1090
|
}
|
|
1804
1091
|
) })
|
|
1805
1092
|
]
|
|
@@ -1813,7 +1100,7 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1813
1100
|
);
|
|
1814
1101
|
};
|
|
1815
1102
|
function ConferenceDialog() {
|
|
1816
|
-
var
|
|
1103
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1817
1104
|
const state = useSDKState();
|
|
1818
1105
|
const { showToast } = useToast();
|
|
1819
1106
|
const [conferenceCallEndAll, setConferenceCallEndAll] = useState8(false);
|
|
@@ -1821,12 +1108,12 @@ function ConferenceDialog() {
|
|
|
1821
1108
|
sdkStateManager.setOpenConferenceDialog(false);
|
|
1822
1109
|
};
|
|
1823
1110
|
const onEndAllConferenceCalls = () => {
|
|
1824
|
-
var
|
|
1111
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
1825
1112
|
setConferenceCallEndAll(true);
|
|
1826
1113
|
const payload = {
|
|
1827
1114
|
action: "EXTERNAL_CONFERENCE",
|
|
1828
1115
|
operation: "ENDCONFERENCE",
|
|
1829
|
-
userid: (_b2 = (
|
|
1116
|
+
userid: (_b2 = (_a2 = state.callData) == null ? void 0 : _a2.agent_id) != null ? _b2 : -1,
|
|
1830
1117
|
process: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.process_name) != null ? _d2 : "",
|
|
1831
1118
|
processid: (_g2 = (_f2 = (_e2 = state.process) == null ? void 0 : _e2.process_id) == null ? void 0 : _f2.toString()) != null ? _g2 : "",
|
|
1832
1119
|
process_name: (_i = (_h = state.process) == null ? void 0 : _h.process_name) != null ? _i : "",
|
|
@@ -1835,23 +1122,23 @@ function ConferenceDialog() {
|
|
|
1835
1122
|
mobile_number: (_o = (_n = state.callData) == null ? void 0 : _n.phone_number) != null ? _o : ""
|
|
1836
1123
|
};
|
|
1837
1124
|
axios_default.post(END_POINT.CONFERENCE_CALL_END_ALL, payload).then((res) => {
|
|
1838
|
-
var
|
|
1839
|
-
showToast((
|
|
1125
|
+
var _a3;
|
|
1126
|
+
showToast((_a3 = res.data) == null ? void 0 : _a3.message, "success");
|
|
1840
1127
|
sdkStateManager.resetConferenceLines();
|
|
1841
1128
|
handleClose();
|
|
1842
1129
|
}).catch((err) => {
|
|
1843
|
-
var
|
|
1844
|
-
const message = ((_b3 = (
|
|
1130
|
+
var _a3, _b3, _c3, _d3;
|
|
1131
|
+
const message = ((_b3 = (_a3 = err.response) == null ? void 0 : _a3.data) == null ? void 0 : _b3.detail) || ((_d3 = (_c3 = err.response) == null ? void 0 : _c3.data) == null ? void 0 : _d3.message) || err.message || "An unknown error occurred";
|
|
1845
1132
|
showToast(message, "error");
|
|
1846
1133
|
}).finally(() => {
|
|
1847
1134
|
setConferenceCallEndAll(false);
|
|
1848
1135
|
});
|
|
1849
1136
|
};
|
|
1850
1137
|
const handleTransferConferenceCall = () => {
|
|
1851
|
-
var
|
|
1138
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
1852
1139
|
const payload = {
|
|
1853
1140
|
action: "TRANSFERAPI",
|
|
1854
|
-
userid: (_b2 = (
|
|
1141
|
+
userid: (_b2 = (_a2 = state.callData) == null ? void 0 : _a2.agent_id) != null ? _b2 : -1,
|
|
1855
1142
|
process: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.process_name) != null ? _d2 : "",
|
|
1856
1143
|
processid: (_g2 = (_f2 = (_e2 = state.process) == null ? void 0 : _e2.process_id) == null ? void 0 : _f2.toString()) != null ? _g2 : "",
|
|
1857
1144
|
process_name: (_i = (_h = state.process) == null ? void 0 : _h.process_name) != null ? _i : "",
|
|
@@ -1860,29 +1147,30 @@ function ConferenceDialog() {
|
|
|
1860
1147
|
mobile_number: (_o = (_n = state.callData) == null ? void 0 : _n.phone_number) != null ? _o : ""
|
|
1861
1148
|
};
|
|
1862
1149
|
axios_default.post(END_POINT.CONFERENCE_CALL_TRANSFER, payload).then((res) => {
|
|
1863
|
-
var
|
|
1864
|
-
showToast((
|
|
1150
|
+
var _a3;
|
|
1151
|
+
showToast((_a3 = res.data) == null ? void 0 : _a3.message, "success");
|
|
1865
1152
|
sdkStateManager.resetConferenceLines();
|
|
1866
1153
|
handleClose();
|
|
1867
1154
|
}).catch((err) => {
|
|
1868
|
-
var
|
|
1869
|
-
const message = ((_b3 = (
|
|
1155
|
+
var _a3, _b3, _c3, _d3;
|
|
1156
|
+
const message = ((_b3 = (_a3 = err.response) == null ? void 0 : _a3.data) == null ? void 0 : _b3.detail) || ((_d3 = (_c3 = err.response) == null ? void 0 : _c3.data) == null ? void 0 : _d3.message) || err.message || "An unknown error occurred";
|
|
1870
1157
|
showToast(message, "error");
|
|
1871
1158
|
});
|
|
1872
1159
|
};
|
|
1873
|
-
const isLineDialing = (
|
|
1160
|
+
const isLineDialing = (_a = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _a.some((item) => (item == null ? void 0 : item.status) === "DIALING" /* DIALING */);
|
|
1874
1161
|
const conferenceLineCount = (_d = (_c = (_b = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _b.filter((item) => (item == null ? void 0 : item.status) === "CONFERENCE" /* CONFERENCE */)) == null ? void 0 : _c.length) != null ? _d : 0;
|
|
1875
1162
|
const isHold = (_e = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _e.some((item) => (item == null ? void 0 : item.status) === "HOLD" /* HOLD */);
|
|
1876
1163
|
const isOnCall = (_f = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _f.some((item) => (item == null ? void 0 : item.status) === "ONCALL" /* ONCALL */);
|
|
1877
|
-
return /* @__PURE__ */
|
|
1164
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1878
1165
|
Dialog,
|
|
1879
1166
|
{
|
|
1880
1167
|
open: state.openConferenceDialog,
|
|
1881
1168
|
"aria-labelledby": "alert-dialog-title",
|
|
1882
1169
|
"aria-describedby": "alert-dialog-description",
|
|
1883
1170
|
maxWidth: "md",
|
|
1884
|
-
|
|
1885
|
-
|
|
1171
|
+
slotProps: { paper: { sx: { minWidth: 800 } } },
|
|
1172
|
+
children: /* @__PURE__ */ jsxs(Paper, { sx: { borderRadius: 2 }, children: [
|
|
1173
|
+
/* @__PURE__ */ jsxs(
|
|
1886
1174
|
Box,
|
|
1887
1175
|
{
|
|
1888
1176
|
sx: {
|
|
@@ -1895,7 +1183,7 @@ function ConferenceDialog() {
|
|
|
1895
1183
|
margin: "10px 0px"
|
|
1896
1184
|
},
|
|
1897
1185
|
children: [
|
|
1898
|
-
/* @__PURE__ */
|
|
1186
|
+
/* @__PURE__ */ jsxs(
|
|
1899
1187
|
Typography,
|
|
1900
1188
|
{
|
|
1901
1189
|
variant: "body1",
|
|
@@ -1907,18 +1195,18 @@ function ConferenceDialog() {
|
|
|
1907
1195
|
]
|
|
1908
1196
|
}
|
|
1909
1197
|
),
|
|
1910
|
-
/* @__PURE__ */
|
|
1198
|
+
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
1911
1199
|
IconButton,
|
|
1912
1200
|
{
|
|
1913
1201
|
onClick: handleClose,
|
|
1914
1202
|
color: "primary",
|
|
1915
|
-
children: /* @__PURE__ */
|
|
1203
|
+
children: /* @__PURE__ */ jsx(Close, { sx: { color: "primary.main" } })
|
|
1916
1204
|
}
|
|
1917
1205
|
) })
|
|
1918
1206
|
]
|
|
1919
1207
|
}
|
|
1920
1208
|
),
|
|
1921
|
-
/* @__PURE__ */
|
|
1209
|
+
/* @__PURE__ */ jsx(
|
|
1922
1210
|
Box,
|
|
1923
1211
|
{
|
|
1924
1212
|
sx: {
|
|
@@ -1926,7 +1214,7 @@ function ConferenceDialog() {
|
|
|
1926
1214
|
margin: "0px 15px",
|
|
1927
1215
|
borderRadius: "20px"
|
|
1928
1216
|
},
|
|
1929
|
-
children: /* @__PURE__ */
|
|
1217
|
+
children: /* @__PURE__ */ jsx(
|
|
1930
1218
|
TableContainer,
|
|
1931
1219
|
{
|
|
1932
1220
|
component: Paper,
|
|
@@ -1934,20 +1222,20 @@ function ConferenceDialog() {
|
|
|
1934
1222
|
outline: "0px solid gray !important",
|
|
1935
1223
|
boxShadow: "1px 1px 6px #e7e5e5ff"
|
|
1936
1224
|
},
|
|
1937
|
-
children: /* @__PURE__ */
|
|
1938
|
-
/* @__PURE__ */
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
1941
|
-
/* @__PURE__ */
|
|
1942
|
-
/* @__PURE__ */
|
|
1225
|
+
children: /* @__PURE__ */ jsxs(Table, { sx: { border: "4px solid #ffffff !important" }, children: [
|
|
1226
|
+
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { sx: { border: "2px solid #f3f3f3ff !important" }, children: [
|
|
1227
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { padding: "6px" }, children: "Line" }),
|
|
1228
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { padding: "6px" }, children: "Status" }),
|
|
1229
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { padding: "6px" }, children: "Mobile Number" }),
|
|
1230
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { padding: "6px" }, children: "Call Actions" })
|
|
1943
1231
|
] }) }),
|
|
1944
|
-
/* @__PURE__ */
|
|
1232
|
+
/* @__PURE__ */ jsx(TableBody, { children: state == null ? void 0 : state.conferenceLine.map((each) => /* @__PURE__ */ jsx(ConferenceTableRow, { each, isLineDialing }, each.line)) })
|
|
1945
1233
|
] })
|
|
1946
1234
|
}
|
|
1947
1235
|
)
|
|
1948
1236
|
}
|
|
1949
1237
|
),
|
|
1950
|
-
/* @__PURE__ */
|
|
1238
|
+
/* @__PURE__ */ jsx(Box, { textAlign: "center", m: 2, children: /* @__PURE__ */ jsxs(
|
|
1951
1239
|
Button,
|
|
1952
1240
|
{
|
|
1953
1241
|
variant: "outlined",
|
|
@@ -1957,14 +1245,14 @@ function ConferenceDialog() {
|
|
|
1957
1245
|
disabled: conferenceCallEndAll || conferenceLineCount <= 0,
|
|
1958
1246
|
sx: { px: 2, borderRadius: "20px", textTransform: "capitalize" },
|
|
1959
1247
|
children: [
|
|
1960
|
-
conferenceCallEndAll ? /* @__PURE__ */
|
|
1248
|
+
conferenceCallEndAll ? /* @__PURE__ */ jsx(
|
|
1961
1249
|
CircularProgress,
|
|
1962
1250
|
{
|
|
1963
1251
|
size: "20px",
|
|
1964
1252
|
color: "error",
|
|
1965
1253
|
sx: { marginRight: "8px" }
|
|
1966
1254
|
}
|
|
1967
|
-
) : /* @__PURE__ */
|
|
1255
|
+
) : /* @__PURE__ */ jsx(
|
|
1968
1256
|
IconButton,
|
|
1969
1257
|
{
|
|
1970
1258
|
sx: {
|
|
@@ -1984,7 +1272,7 @@ function ConferenceDialog() {
|
|
|
1984
1272
|
justifyContent: "center",
|
|
1985
1273
|
borderRadius: "50%"
|
|
1986
1274
|
},
|
|
1987
|
-
children: /* @__PURE__ */
|
|
1275
|
+
children: /* @__PURE__ */ jsx(PhoneDisabled, { sx: { color: "white", fontSize: "16px", fontWeight: "600" } })
|
|
1988
1276
|
}
|
|
1989
1277
|
),
|
|
1990
1278
|
"End Conference"
|
|
@@ -1996,7 +1284,7 @@ function ConferenceDialog() {
|
|
|
1996
1284
|
) });
|
|
1997
1285
|
}
|
|
1998
1286
|
function CallTransferDialog({ open }) {
|
|
1999
|
-
var
|
|
1287
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
2000
1288
|
const state = useSDKState();
|
|
2001
1289
|
const [mobileNumber, setMobileNumber] = useState8("");
|
|
2002
1290
|
const [transferCall, { isLoading: isTransferLoading }] = usePostRequest({
|
|
@@ -2004,7 +1292,25 @@ function CallTransferDialog({ open }) {
|
|
|
2004
1292
|
sdkStateManager.setOpenCallTransferDialog(false);
|
|
2005
1293
|
}
|
|
2006
1294
|
});
|
|
1295
|
+
const [initiateConsultCall] = usePostRequest({});
|
|
1296
|
+
const [completeConsultTransfer, { isLoading: isCompleteConsultLoading }] = usePostRequest({
|
|
1297
|
+
onSuccess: () => {
|
|
1298
|
+
sdkStateManager.setConsultInfo(null);
|
|
1299
|
+
sdkStateManager.setOpenCallTransferDialog(false);
|
|
1300
|
+
}
|
|
1301
|
+
});
|
|
1302
|
+
const [cancelConsultTransfer, { isLoading: isCancelConsultLoading }] = usePostRequest({
|
|
1303
|
+
onSuccess: () => {
|
|
1304
|
+
sdkStateManager.setConsultInfo(null);
|
|
1305
|
+
}
|
|
1306
|
+
});
|
|
2007
1307
|
const [currentselecteTab, setCurrentselecteTab] = useState8("queues");
|
|
1308
|
+
const [transferMenuAnchor, setTransferMenuAnchor] = useState8(null);
|
|
1309
|
+
const [pendingTransferData, setPendingTransferData] = useState8(null);
|
|
1310
|
+
const blindEnabled = !((_a = state.sdkConfig) == null ? void 0 : _a.disableBlindTransfer);
|
|
1311
|
+
const attendedEnabled = !((_b = state.sdkConfig) == null ? void 0 : _b.disableAttendedTransfer);
|
|
1312
|
+
const enabledTransferModeCount = (blindEnabled ? 1 : 0) + (attendedEnabled ? 1 : 0);
|
|
1313
|
+
const singleTransferMode = enabledTransferModeCount === 1 ? blindEnabled ? "DEFAULT" : "CONSULT" : null;
|
|
2008
1314
|
const [getIdelAgentsList, { data: idleAgentsList, isLoading: isIdleAgentsListLoading }] = usePostRequest({ disabledSuccessToast: true });
|
|
2009
1315
|
const [
|
|
2010
1316
|
getHospitalsServicesList,
|
|
@@ -2017,11 +1323,11 @@ function CallTransferDialog({ open }) {
|
|
|
2017
1323
|
const handleClose = () => {
|
|
2018
1324
|
sdkStateManager.setOpenCallTransferDialog(false);
|
|
2019
1325
|
};
|
|
2020
|
-
const handleTransferCall = (data, type) => {
|
|
2021
|
-
var
|
|
1326
|
+
const handleTransferCall = (data, type, mode = "DEFAULT") => {
|
|
1327
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2, _x2, _y2, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N;
|
|
2022
1328
|
if (type === "PROCESS") {
|
|
2023
1329
|
const payload = {
|
|
2024
|
-
mobile_number: (_b2 = (
|
|
1330
|
+
mobile_number: (_b2 = (_a2 = state.callData) == null ? void 0 : _a2.phone_number) != null ? _b2 : "",
|
|
2025
1331
|
userid: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.agent_id) != null ? _d2 : -1,
|
|
2026
1332
|
type: "PROCESS",
|
|
2027
1333
|
transfer_to: (_e2 = data == null ? void 0 : data.process_name) != null ? _e2 : "",
|
|
@@ -2043,25 +1349,43 @@ function CallTransferDialog({ open }) {
|
|
|
2043
1349
|
transferCall(END_POINT.TRANSFER_CALL, payload);
|
|
2044
1350
|
} else if (type === "AGENT") {
|
|
2045
1351
|
const payload = {
|
|
2046
|
-
mobile_number: (
|
|
2047
|
-
userid: (_z = (
|
|
1352
|
+
mobile_number: (_x2 = (_w2 = state.callData) == null ? void 0 : _w2.phone_number) != null ? _x2 : "",
|
|
1353
|
+
userid: (_z = (_y2 = state.callData) == null ? void 0 : _y2.agent_id) != null ? _z : "",
|
|
2048
1354
|
type: "AGENT",
|
|
1355
|
+
transfer_type: mode === "CONSULT" ? "ATTENDED" : "BLIND",
|
|
2049
1356
|
transfer_to: (_B = (_A = data == null ? void 0 : data.id) == null ? void 0 : _A.toString()) != null ? _B : "",
|
|
2050
1357
|
callreferenceid: (_D = (_C = state.callData) == null ? void 0 : _C.convox_id) != null ? _D : "",
|
|
2051
1358
|
processid: String((_F = (_E = state.callData) == null ? void 0 : _E.process_id) != null ? _F : ""),
|
|
2052
1359
|
process_name: (_H = (_G = state.callData) == null ? void 0 : _G.process_name) != null ? _H : ""
|
|
2053
1360
|
};
|
|
2054
|
-
|
|
1361
|
+
if (mode === "CONSULT") {
|
|
1362
|
+
initiateConsultCall(END_POINT.TRANSFER_CALL, payload);
|
|
1363
|
+
} else {
|
|
1364
|
+
transferCall(END_POINT.TRANSFER_CALL, payload);
|
|
1365
|
+
}
|
|
2055
1366
|
} else if (type === "OTHER") {
|
|
2056
1367
|
const payload = {
|
|
2057
|
-
action: "BLIND_TRANSFER",
|
|
1368
|
+
action: mode === "CONSULT" ? "ATTENDED" : "BLIND_TRANSFER",
|
|
1369
|
+
transfer_type: mode === "CONSULT" ? "ATTENDED" : "BLIND",
|
|
2058
1370
|
type: "OTHER",
|
|
2059
1371
|
transfer_to: (_I = data == null ? void 0 : data.mobile_number) != null ? _I : "",
|
|
2060
1372
|
userid: (_K = (_J = state.callData) == null ? void 0 : _J.agent_id) != null ? _K : -1,
|
|
2061
1373
|
callreferenceid: (_M = (_L = state.callData) == null ? void 0 : _L.convox_id) != null ? _M : "",
|
|
2062
1374
|
blind_transfer_no: (_N = data == null ? void 0 : data.mobile_number) != null ? _N : ""
|
|
2063
1375
|
};
|
|
2064
|
-
|
|
1376
|
+
if (mode === "CONSULT") {
|
|
1377
|
+
initiateConsultCall(END_POINT.TRANSFER_CALL, payload);
|
|
1378
|
+
} else {
|
|
1379
|
+
transferCall(END_POINT.TRANSFER_CALL, payload);
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
};
|
|
1383
|
+
const handleTransferClick = (e, data, type) => {
|
|
1384
|
+
if (singleTransferMode) {
|
|
1385
|
+
handleTransferCall(data, type, singleTransferMode);
|
|
1386
|
+
} else {
|
|
1387
|
+
setPendingTransferData({ data, type });
|
|
1388
|
+
setTransferMenuAnchor(e.currentTarget);
|
|
2065
1389
|
}
|
|
2066
1390
|
};
|
|
2067
1391
|
useEffect4(() => {
|
|
@@ -2069,181 +1393,145 @@ function CallTransferDialog({ open }) {
|
|
|
2069
1393
|
getProcessAndQueuesList(END_POINT.TRANSFER_TO_DETAILS, { status: "ACTIVE", active: true });
|
|
2070
1394
|
getHospitalsServicesList(END_POINT.HOSPITALS_SERVICES);
|
|
2071
1395
|
}, []);
|
|
2072
|
-
return /* @__PURE__ */
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
|
|
2083
|
-
{
|
|
2084
|
-
sx: {
|
|
2085
|
-
display: "flex",
|
|
2086
|
-
justifyContent: "space-between",
|
|
2087
|
-
alignItems: "center",
|
|
2088
|
-
padding: "4px 16px",
|
|
2089
|
-
boxShadow: "0px 1px 2px #f5f5f5ff"
|
|
2090
|
-
},
|
|
2091
|
-
children: [
|
|
2092
|
-
/* @__PURE__ */ jsx2(Typography, { variant: "body1", children: " Call Transfer" }),
|
|
2093
|
-
/* @__PURE__ */ jsx2(IconButton, { onClick: handleClose, children: /* @__PURE__ */ jsx2(Close, {}) })
|
|
2094
|
-
]
|
|
2095
|
-
}
|
|
2096
|
-
),
|
|
2097
|
-
/* @__PURE__ */ jsxs2(Box, { sx: { margin: "10px", borderRadius: "10px" }, children: [
|
|
2098
|
-
/* @__PURE__ */ jsxs2(Box, { sx: { display: "flex", gap: 1, margin: "10px" }, children: [
|
|
2099
|
-
/* @__PURE__ */ jsx2(
|
|
2100
|
-
Button,
|
|
2101
|
-
{
|
|
2102
|
-
variant: currentselecteTab === "queues" ? "contained" : "outlined",
|
|
2103
|
-
onClick: () => setCurrentselecteTab("queues"),
|
|
2104
|
-
children: "Queues"
|
|
2105
|
-
}
|
|
2106
|
-
),
|
|
2107
|
-
/* @__PURE__ */ jsx2(
|
|
2108
|
-
Button,
|
|
2109
|
-
{
|
|
2110
|
-
variant: currentselecteTab === "agents" ? "contained" : "outlined",
|
|
2111
|
-
onClick: () => {
|
|
2112
|
-
setCurrentselecteTab("agents");
|
|
2113
|
-
getIdelAgentsList(END_POINT.AGENTS_LIST, { status: "IDLE", active: true });
|
|
2114
|
-
},
|
|
2115
|
-
children: "Agents"
|
|
2116
|
-
}
|
|
2117
|
-
),
|
|
2118
|
-
!((_a2 = state.sdkConfig) == null ? void 0 : _a2.disableBlindTransfer) && /* @__PURE__ */ jsx2(
|
|
2119
|
-
Button,
|
|
2120
|
-
{
|
|
2121
|
-
variant: currentselecteTab === "others" ? "contained" : "outlined",
|
|
2122
|
-
onClick: () => setCurrentselecteTab("others"),
|
|
2123
|
-
children: "Others"
|
|
2124
|
-
}
|
|
2125
|
-
)
|
|
2126
|
-
] }),
|
|
2127
|
-
(isProcessAndQueuesListLoading || isIdleAgentsListLoading || isHospitalsServicesListLoading || isTransferLoading) && /* @__PURE__ */ jsx2(
|
|
1396
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1397
|
+
/* @__PURE__ */ jsx(
|
|
1398
|
+
Dialog,
|
|
1399
|
+
{
|
|
1400
|
+
open,
|
|
1401
|
+
"aria-labelledby": "alert-dialog-title",
|
|
1402
|
+
"aria-describedby": "alert-dialog-description",
|
|
1403
|
+
maxWidth: "md",
|
|
1404
|
+
slotProps: { paper: { sx: { minWidth: 600 } } },
|
|
1405
|
+
children: /* @__PURE__ */ jsxs(Paper, { sx: { borderRadius: 2 }, children: [
|
|
1406
|
+
/* @__PURE__ */ jsxs(
|
|
2128
1407
|
Box,
|
|
2129
1408
|
{
|
|
2130
1409
|
sx: {
|
|
2131
1410
|
display: "flex",
|
|
2132
|
-
justifyContent: "center",
|
|
2133
1411
|
alignItems: "center",
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
}
|
|
2138
|
-
),
|
|
2139
|
-
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && !isTransferLoading && currentselecteTab === "process" && /* @__PURE__ */ jsx2(
|
|
2140
|
-
Box,
|
|
2141
|
-
{
|
|
2142
|
-
sx: {
|
|
2143
|
-
display: "grid",
|
|
2144
|
-
gridTemplateColumns: ((_b = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _b.process) && ((_d = (_c = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _c.process) == null ? void 0 : _d.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)",
|
|
2145
|
-
gap: 1,
|
|
2146
|
-
padding: "10px",
|
|
2147
|
-
flexWrap: "wrap",
|
|
2148
|
-
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2149
|
-
borderRadius: "10px"
|
|
1412
|
+
padding: "4px 16px",
|
|
1413
|
+
boxShadow: "0px 1px 2px #f5f5f5ff",
|
|
1414
|
+
position: "relative"
|
|
2150
1415
|
},
|
|
2151
|
-
children:
|
|
2152
|
-
|
|
2153
|
-
{
|
|
2154
|
-
sx: {
|
|
2155
|
-
|
|
2156
|
-
display: "flex",
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
1416
|
+
children: [
|
|
1417
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", sx: { flex: 1 }, children: " Call Transfer" }),
|
|
1418
|
+
/* @__PURE__ */ jsxs(Box, { sx: { position: "absolute", left: "50%", transform: "translateX(-50%)" }, children: [
|
|
1419
|
+
state.consultInfo && ((_c = state.consultInfo.status) == null ? void 0 : _c.toUpperCase()) === "RINGING" /* RINGING */ && /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
1420
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", sx: { whiteSpace: "nowrap" }, children: "Trying to consult" }),
|
|
1421
|
+
/* @__PURE__ */ jsx(Box, { component: "span", sx: { display: "inline-flex", gap: "3px", alignItems: "flex-end", height: "14px" }, children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx(Box, { component: "span", sx: {
|
|
1422
|
+
"@keyframes jumpDot": {
|
|
1423
|
+
"0%, 60%, 100%": { transform: "translateY(0)" },
|
|
1424
|
+
"30%": { transform: "translateY(-5px)" }
|
|
1425
|
+
},
|
|
1426
|
+
animation: "jumpDot 1s ease-in-out infinite",
|
|
1427
|
+
animationDelay: `${i * 0.15}s`,
|
|
1428
|
+
fontSize: "14px",
|
|
1429
|
+
fontWeight: 700,
|
|
1430
|
+
lineHeight: 1,
|
|
1431
|
+
display: "inline-block"
|
|
1432
|
+
}, children: "." }, i)) })
|
|
1433
|
+
] }),
|
|
1434
|
+
state.consultInfo && ((_d = state.consultInfo.status) == null ? void 0 : _d.toUpperCase()) === "ONCALL" /* ONCALL */ && /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
1435
|
+
/* @__PURE__ */ jsx(
|
|
1436
|
+
Button,
|
|
2166
1437
|
{
|
|
2167
|
-
variant: "
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
1438
|
+
variant: "outlined",
|
|
1439
|
+
size: "small",
|
|
1440
|
+
startIcon: isCompleteConsultLoading ? /* @__PURE__ */ jsx(CircularProgress, { size: 14 }) : /* @__PURE__ */ jsx(TransferWithinAStation, { sx: { fontSize: 16 } }),
|
|
1441
|
+
disabled: isCompleteConsultLoading || isCancelConsultLoading,
|
|
1442
|
+
onClick: () => {
|
|
1443
|
+
if (state.consultInfo) {
|
|
1444
|
+
completeConsultTransfer(END_POINT.TRANSFER_COMPLETE, {}, {
|
|
1445
|
+
params: { call_uuid: state.consultInfo.call_uuid }
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
2174
1448
|
},
|
|
2175
|
-
children:
|
|
2176
|
-
/* @__PURE__ */ jsx2(MemoryOutlined, { sx: { marginRight: "4px" } }),
|
|
2177
|
-
process.process_name
|
|
2178
|
-
]
|
|
1449
|
+
children: "Transfer"
|
|
2179
1450
|
}
|
|
2180
1451
|
),
|
|
2181
|
-
/* @__PURE__ */
|
|
2182
|
-
|
|
1452
|
+
/* @__PURE__ */ jsx(
|
|
1453
|
+
Button,
|
|
2183
1454
|
{
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
1455
|
+
variant: "outlined",
|
|
1456
|
+
size: "small",
|
|
1457
|
+
color: "error",
|
|
1458
|
+
startIcon: isCancelConsultLoading ? /* @__PURE__ */ jsx(CircularProgress, { size: 14 }) : /* @__PURE__ */ jsx(PhoneDisabled, { sx: { fontSize: 16 } }),
|
|
1459
|
+
disabled: isCancelConsultLoading || isCompleteConsultLoading,
|
|
1460
|
+
onClick: () => {
|
|
1461
|
+
if (state.consultInfo) {
|
|
1462
|
+
cancelConsultTransfer(END_POINT.TRANSFER_CANCEL, {
|
|
1463
|
+
status: state.consultInfo.status,
|
|
1464
|
+
participant_identifier: state.consultInfo.participant_identifier,
|
|
1465
|
+
channel_id: state.consultInfo.channel_id,
|
|
1466
|
+
call_uuid: state.consultInfo.call_uuid,
|
|
1467
|
+
bridge_id: state.consultInfo.bridge_id
|
|
1468
|
+
});
|
|
1469
|
+
}
|
|
2188
1470
|
},
|
|
2189
|
-
|
|
2190
|
-
children: /* @__PURE__ */ jsx2(Call, {})
|
|
1471
|
+
children: "Cancel"
|
|
2191
1472
|
}
|
|
2192
1473
|
)
|
|
2193
|
-
]
|
|
2194
|
-
},
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
1474
|
+
] })
|
|
1475
|
+
] }),
|
|
1476
|
+
/* @__PURE__ */ jsx(Box, { sx: { flex: 1, display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ jsx(IconButton, { onClick: handleClose, children: /* @__PURE__ */ jsx(Close, {}) }) })
|
|
1477
|
+
]
|
|
1478
|
+
}
|
|
1479
|
+
),
|
|
1480
|
+
/* @__PURE__ */ jsxs(Box, { sx: { margin: "10px", borderRadius: "10px" }, children: [
|
|
1481
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", gap: 1, margin: "10px" }, children: [
|
|
1482
|
+
/* @__PURE__ */ jsx(
|
|
1483
|
+
Button,
|
|
2198
1484
|
{
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
1485
|
+
variant: currentselecteTab === "queues" ? "contained" : "outlined",
|
|
1486
|
+
onClick: () => setCurrentselecteTab("queues"),
|
|
1487
|
+
children: "Queues"
|
|
1488
|
+
}
|
|
1489
|
+
),
|
|
1490
|
+
/* @__PURE__ */ jsx(
|
|
1491
|
+
Button,
|
|
1492
|
+
{
|
|
1493
|
+
variant: currentselecteTab === "agents" ? "contained" : "outlined",
|
|
1494
|
+
onClick: () => {
|
|
1495
|
+
setCurrentselecteTab("agents");
|
|
1496
|
+
getIdelAgentsList(END_POINT.AGENTS_LIST, { status: "IDLE", active: true });
|
|
2204
1497
|
},
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
letterSpacing: "0.02em",
|
|
2215
|
-
textTransform: "capitalize",
|
|
2216
|
-
display: "flex",
|
|
2217
|
-
alignItems: "center",
|
|
2218
|
-
justifyContent: "center",
|
|
2219
|
-
width: "100%",
|
|
2220
|
-
margin: "10px 0px",
|
|
2221
|
-
color: "primary.main",
|
|
2222
|
-
height: "20px"
|
|
2223
|
-
},
|
|
2224
|
-
children: "No Process Found"
|
|
2225
|
-
}
|
|
2226
|
-
)
|
|
2227
|
-
]
|
|
1498
|
+
children: "Agents"
|
|
1499
|
+
}
|
|
1500
|
+
),
|
|
1501
|
+
/* @__PURE__ */ jsx(
|
|
1502
|
+
Button,
|
|
1503
|
+
{
|
|
1504
|
+
variant: currentselecteTab === "others" ? "contained" : "outlined",
|
|
1505
|
+
onClick: () => setCurrentselecteTab("others"),
|
|
1506
|
+
children: "Others"
|
|
2228
1507
|
}
|
|
2229
1508
|
)
|
|
2230
|
-
}
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
1509
|
+
] }),
|
|
1510
|
+
(isProcessAndQueuesListLoading || isIdleAgentsListLoading || isHospitalsServicesListLoading || isTransferLoading) && /* @__PURE__ */ jsx(
|
|
1511
|
+
Box,
|
|
1512
|
+
{
|
|
1513
|
+
sx: {
|
|
1514
|
+
display: "flex",
|
|
1515
|
+
justifyContent: "center",
|
|
1516
|
+
alignItems: "center",
|
|
1517
|
+
height: "80px"
|
|
1518
|
+
},
|
|
1519
|
+
children: /* @__PURE__ */ jsx(CircularProgress, {})
|
|
1520
|
+
}
|
|
1521
|
+
),
|
|
1522
|
+
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && !isTransferLoading && currentselecteTab === "process" && /* @__PURE__ */ jsx(
|
|
1523
|
+
Box,
|
|
1524
|
+
{
|
|
1525
|
+
sx: {
|
|
1526
|
+
display: "grid",
|
|
1527
|
+
gridTemplateColumns: ((_e = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _e.process) && ((_g = (_f = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _f.process) == null ? void 0 : _g.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)",
|
|
1528
|
+
gap: 1,
|
|
1529
|
+
padding: "10px",
|
|
1530
|
+
flexWrap: "wrap",
|
|
1531
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
1532
|
+
borderRadius: "10px"
|
|
1533
|
+
},
|
|
1534
|
+
children: ((_h = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _h.process) && ((_j = (_i = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _i.process) == null ? void 0 : _j.length) > 0 ? (_l = (_k = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _k.process) == null ? void 0 : _l.map((process, index) => /* @__PURE__ */ jsxs(
|
|
2247
1535
|
Box,
|
|
2248
1536
|
{
|
|
2249
1537
|
sx: {
|
|
@@ -2256,7 +1544,7 @@ function CallTransferDialog({ open }) {
|
|
|
2256
1544
|
"&:hover": { bgcolor: "action.selected" }
|
|
2257
1545
|
},
|
|
2258
1546
|
children: [
|
|
2259
|
-
/* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ jsxs(
|
|
2260
1548
|
Typography,
|
|
2261
1549
|
{
|
|
2262
1550
|
variant: "body1",
|
|
@@ -2268,30 +1556,12 @@ function CallTransferDialog({ open }) {
|
|
|
2268
1556
|
alignItems: "center"
|
|
2269
1557
|
},
|
|
2270
1558
|
children: [
|
|
2271
|
-
/* @__PURE__ */
|
|
2272
|
-
|
|
2273
|
-
((_c2 = (_b2 = (_a3 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _a3.process) == null ? void 0 : _b2.find(
|
|
2274
|
-
(process) => process.process_id === queue.process_id
|
|
2275
|
-
)) == null ? void 0 : _c2.process_name) ? /* @__PURE__ */ jsx2(
|
|
2276
|
-
Typography,
|
|
2277
|
-
{
|
|
2278
|
-
variant: "body1",
|
|
2279
|
-
sx: {
|
|
2280
|
-
fontSize: "12px",
|
|
2281
|
-
fontWeight: "600",
|
|
2282
|
-
letterSpacing: "0.02em",
|
|
2283
|
-
textTransform: "capitalize",
|
|
2284
|
-
color: "gray"
|
|
2285
|
-
},
|
|
2286
|
-
children: "(" + ((_f2 = (_e2 = (_d2 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _d2.process) == null ? void 0 : _e2.find(
|
|
2287
|
-
(process) => process.process_id === queue.process_id
|
|
2288
|
-
)) == null ? void 0 : _f2.process_name) + ")"
|
|
2289
|
-
}
|
|
2290
|
-
) : ""
|
|
1559
|
+
/* @__PURE__ */ jsx(MemoryOutlined, { sx: { marginRight: "4px" } }),
|
|
1560
|
+
process.process_name
|
|
2291
1561
|
]
|
|
2292
1562
|
}
|
|
2293
1563
|
),
|
|
2294
|
-
/* @__PURE__ */
|
|
1564
|
+
/* @__PURE__ */ jsx(Tooltip, { title: state.consultInfo ? "Please complete or cancel the ongoing consult transfer before proceeding." : "", children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
2295
1565
|
IconButton,
|
|
2296
1566
|
{
|
|
2297
1567
|
color: "success",
|
|
@@ -2299,161 +1569,345 @@ function CallTransferDialog({ open }) {
|
|
|
2299
1569
|
bgcolor: "action.hover",
|
|
2300
1570
|
"&:hover": { bgcolor: "action.selected" }
|
|
2301
1571
|
},
|
|
2302
|
-
|
|
2303
|
-
|
|
1572
|
+
disabled: !!state.consultInfo,
|
|
1573
|
+
onClick: () => handleTransferCall(process, "PROCESS"),
|
|
1574
|
+
children: /* @__PURE__ */ jsx(Call, {})
|
|
2304
1575
|
}
|
|
2305
|
-
)
|
|
1576
|
+
) }) })
|
|
2306
1577
|
]
|
|
2307
1578
|
},
|
|
2308
1579
|
index
|
|
2309
|
-
)
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
1580
|
+
)) : /* @__PURE__ */ jsxs(
|
|
1581
|
+
Box,
|
|
1582
|
+
{
|
|
1583
|
+
sx: {
|
|
1584
|
+
display: "flex",
|
|
1585
|
+
alignItems: "center",
|
|
1586
|
+
justifyContent: "center",
|
|
1587
|
+
flexDirection: "column"
|
|
1588
|
+
},
|
|
1589
|
+
p: 2,
|
|
1590
|
+
children: [
|
|
1591
|
+
/* @__PURE__ */ jsx(Upcoming, { color: "primary" }),
|
|
1592
|
+
/* @__PURE__ */ jsx(
|
|
1593
|
+
Typography,
|
|
1594
|
+
{
|
|
1595
|
+
variant: "body1",
|
|
1596
|
+
sx: {
|
|
1597
|
+
fontSize: "16px",
|
|
1598
|
+
letterSpacing: "0.02em",
|
|
1599
|
+
textTransform: "capitalize",
|
|
1600
|
+
display: "flex",
|
|
1601
|
+
alignItems: "center",
|
|
1602
|
+
justifyContent: "center",
|
|
1603
|
+
width: "100%",
|
|
1604
|
+
margin: "10px 0px",
|
|
1605
|
+
color: "primary.main",
|
|
1606
|
+
height: "20px"
|
|
1607
|
+
},
|
|
1608
|
+
children: "No Process Found"
|
|
1609
|
+
}
|
|
1610
|
+
)
|
|
1611
|
+
]
|
|
1612
|
+
}
|
|
1613
|
+
)
|
|
1614
|
+
}
|
|
1615
|
+
),
|
|
1616
|
+
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && !isTransferLoading && currentselecteTab === "queues" && /* @__PURE__ */ jsx(
|
|
1617
|
+
Box,
|
|
1618
|
+
{
|
|
1619
|
+
sx: {
|
|
1620
|
+
display: "grid",
|
|
1621
|
+
gridTemplateColumns: ((_m = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _m.queue) && ((_o = (_n = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _n.queue) == null ? void 0 : _o.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)",
|
|
1622
|
+
gap: 1,
|
|
1623
|
+
padding: "10px",
|
|
1624
|
+
flexWrap: "wrap",
|
|
1625
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
1626
|
+
borderRadius: "10px"
|
|
1627
|
+
},
|
|
1628
|
+
children: ((_p = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _p.queue) && ((_r = (_q = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _q.queue) == null ? void 0 : _r.length) > 0 ? (_t = (_s = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _s.queue) == null ? void 0 : _t.map((queue, index) => {
|
|
1629
|
+
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
1630
|
+
return /* @__PURE__ */ jsxs(
|
|
1631
|
+
Box,
|
|
1632
|
+
{
|
|
1633
|
+
sx: {
|
|
1634
|
+
p: 1,
|
|
1635
|
+
display: "flex",
|
|
1636
|
+
alignItems: "center",
|
|
1637
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
1638
|
+
padding: "6px",
|
|
1639
|
+
borderRadius: "10px",
|
|
1640
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
1641
|
+
},
|
|
1642
|
+
children: [
|
|
1643
|
+
/* @__PURE__ */ jsxs(
|
|
1644
|
+
Typography,
|
|
1645
|
+
{
|
|
1646
|
+
variant: "body1",
|
|
1647
|
+
sx: {
|
|
1648
|
+
mx: 1,
|
|
1649
|
+
width: "200px",
|
|
1650
|
+
maxWidth: "250px",
|
|
1651
|
+
display: "flex",
|
|
1652
|
+
alignItems: "center"
|
|
1653
|
+
},
|
|
1654
|
+
children: [
|
|
1655
|
+
/* @__PURE__ */ jsx(Airlines, { sx: { marginRight: "4px" } }),
|
|
1656
|
+
queue.queue_name,
|
|
1657
|
+
((_c2 = (_b2 = (_a2 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _a2.process) == null ? void 0 : _b2.find(
|
|
1658
|
+
(process) => process.process_id === queue.process_id
|
|
1659
|
+
)) == null ? void 0 : _c2.process_name) ? /* @__PURE__ */ jsx(
|
|
1660
|
+
Typography,
|
|
1661
|
+
{
|
|
1662
|
+
variant: "body1",
|
|
1663
|
+
sx: {
|
|
1664
|
+
fontSize: "12px",
|
|
1665
|
+
fontWeight: "600",
|
|
1666
|
+
letterSpacing: "0.02em",
|
|
1667
|
+
textTransform: "capitalize",
|
|
1668
|
+
color: "gray"
|
|
1669
|
+
},
|
|
1670
|
+
children: "(" + ((_f2 = (_e2 = (_d2 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _d2.process) == null ? void 0 : _e2.find(
|
|
1671
|
+
(process) => process.process_id === queue.process_id
|
|
1672
|
+
)) == null ? void 0 : _f2.process_name) + ")"
|
|
1673
|
+
}
|
|
1674
|
+
) : ""
|
|
1675
|
+
]
|
|
1676
|
+
}
|
|
1677
|
+
),
|
|
1678
|
+
/* @__PURE__ */ jsx(Tooltip, { title: state.consultInfo ? "Please complete or cancel the ongoing consult transfer before proceeding." : "", children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
1679
|
+
IconButton,
|
|
1680
|
+
{
|
|
1681
|
+
color: "success",
|
|
1682
|
+
sx: {
|
|
1683
|
+
bgcolor: "action.hover",
|
|
1684
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
1685
|
+
},
|
|
1686
|
+
disabled: !!state.consultInfo,
|
|
1687
|
+
onClick: () => handleTransferCall(queue, "QUEUE"),
|
|
1688
|
+
children: /* @__PURE__ */ jsx(Call, {})
|
|
1689
|
+
}
|
|
1690
|
+
) }) })
|
|
1691
|
+
]
|
|
1692
|
+
},
|
|
1693
|
+
index
|
|
1694
|
+
);
|
|
1695
|
+
}) : /* @__PURE__ */ jsxs(
|
|
1696
|
+
Box,
|
|
1697
|
+
{
|
|
1698
|
+
sx: {
|
|
1699
|
+
display: "flex",
|
|
1700
|
+
alignItems: "center",
|
|
1701
|
+
justifyContent: "center",
|
|
1702
|
+
flexDirection: "column"
|
|
1703
|
+
},
|
|
1704
|
+
p: 2,
|
|
1705
|
+
children: [
|
|
1706
|
+
/* @__PURE__ */ jsx(Upcoming, { color: "primary" }),
|
|
1707
|
+
/* @__PURE__ */ jsx(
|
|
1708
|
+
Typography,
|
|
1709
|
+
{
|
|
1710
|
+
variant: "body1",
|
|
1711
|
+
sx: {
|
|
1712
|
+
fontSize: "16px",
|
|
1713
|
+
letterSpacing: "0.02em",
|
|
1714
|
+
textTransform: "capitalize",
|
|
1715
|
+
display: "flex",
|
|
1716
|
+
alignItems: "center",
|
|
1717
|
+
justifyContent: "center",
|
|
1718
|
+
width: "100%",
|
|
1719
|
+
margin: "10px 0px",
|
|
1720
|
+
color: "primary.main",
|
|
1721
|
+
height: "20px"
|
|
1722
|
+
},
|
|
1723
|
+
children: "No Queues Found"
|
|
1724
|
+
}
|
|
1725
|
+
)
|
|
1726
|
+
]
|
|
1727
|
+
}
|
|
1728
|
+
)
|
|
1729
|
+
}
|
|
1730
|
+
),
|
|
1731
|
+
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && !isTransferLoading && currentselecteTab === "agents" && /* @__PURE__ */ jsx(
|
|
1732
|
+
Box,
|
|
1733
|
+
{
|
|
1734
|
+
sx: {
|
|
1735
|
+
display: "grid",
|
|
1736
|
+
gridTemplateColumns: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_u = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _u.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)",
|
|
1737
|
+
gap: 1,
|
|
1738
|
+
padding: "10px",
|
|
1739
|
+
flexWrap: "wrap",
|
|
1740
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
1741
|
+
borderRadius: "10px"
|
|
1742
|
+
},
|
|
1743
|
+
children: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_v = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _v.length) > 0 ? (_w = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _w.map((agent, index) => /* @__PURE__ */ jsxs(
|
|
1744
|
+
Box,
|
|
1745
|
+
{
|
|
1746
|
+
sx: {
|
|
1747
|
+
p: 1,
|
|
1748
|
+
display: "flex",
|
|
1749
|
+
alignItems: "center",
|
|
1750
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
1751
|
+
padding: "6px",
|
|
1752
|
+
borderRadius: "10px",
|
|
1753
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
1754
|
+
},
|
|
1755
|
+
children: [
|
|
1756
|
+
/* @__PURE__ */ jsxs(
|
|
1757
|
+
Typography,
|
|
1758
|
+
{
|
|
1759
|
+
variant: "body1",
|
|
1760
|
+
sx: {
|
|
1761
|
+
mx: 1,
|
|
1762
|
+
width: "200px",
|
|
1763
|
+
maxWidth: "250px",
|
|
1764
|
+
display: "flex",
|
|
1765
|
+
alignItems: "center"
|
|
1766
|
+
},
|
|
1767
|
+
children: [
|
|
1768
|
+
/* @__PURE__ */ jsx(SupportAgent, { sx: { marginRight: "4px" } }),
|
|
1769
|
+
agent.name
|
|
1770
|
+
]
|
|
1771
|
+
}
|
|
1772
|
+
),
|
|
1773
|
+
/* @__PURE__ */ jsx(Tooltip, { title: state.consultInfo ? "Please complete or cancel the ongoing consult transfer before proceeding." : "", children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
1774
|
+
IconButton,
|
|
1775
|
+
{
|
|
1776
|
+
color: "success",
|
|
1777
|
+
sx: {
|
|
1778
|
+
bgcolor: "action.hover",
|
|
1779
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
1780
|
+
},
|
|
1781
|
+
disabled: !!state.consultInfo,
|
|
1782
|
+
onClick: (e) => handleTransferClick(e, agent, "AGENT"),
|
|
1783
|
+
children: /* @__PURE__ */ jsx(Call, {})
|
|
1784
|
+
}
|
|
1785
|
+
) }) })
|
|
1786
|
+
]
|
|
2318
1787
|
},
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
1788
|
+
index
|
|
1789
|
+
)) : /* @__PURE__ */ jsxs(
|
|
1790
|
+
Box,
|
|
1791
|
+
{
|
|
1792
|
+
sx: {
|
|
1793
|
+
display: "flex",
|
|
1794
|
+
alignItems: "center",
|
|
1795
|
+
justifyContent: "center",
|
|
1796
|
+
flexDirection: "column"
|
|
1797
|
+
},
|
|
1798
|
+
p: 2,
|
|
1799
|
+
children: [
|
|
1800
|
+
/* @__PURE__ */ jsx(Upcoming, { color: "primary" }),
|
|
1801
|
+
/* @__PURE__ */ jsx(
|
|
1802
|
+
Typography,
|
|
1803
|
+
{
|
|
1804
|
+
variant: "body1",
|
|
1805
|
+
sx: {
|
|
1806
|
+
fontSize: "16px",
|
|
1807
|
+
letterSpacing: "0.02em",
|
|
1808
|
+
textTransform: "capitalize",
|
|
1809
|
+
display: "flex",
|
|
1810
|
+
alignItems: "center",
|
|
1811
|
+
justifyContent: "center",
|
|
1812
|
+
width: "100%",
|
|
1813
|
+
margin: "10px 0px",
|
|
1814
|
+
color: "primary.main",
|
|
1815
|
+
height: "20px"
|
|
1816
|
+
},
|
|
1817
|
+
children: "No Agents Found"
|
|
1818
|
+
}
|
|
1819
|
+
)
|
|
1820
|
+
]
|
|
1821
|
+
}
|
|
1822
|
+
)
|
|
1823
|
+
}
|
|
1824
|
+
),
|
|
1825
|
+
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && !isTransferLoading && currentselecteTab === "others" && /* @__PURE__ */ jsxs(
|
|
1826
|
+
Box,
|
|
1827
|
+
{
|
|
1828
|
+
sx: {
|
|
1829
|
+
display: "grid",
|
|
1830
|
+
gridTemplateColumns: "repeat(2, 1fr)",
|
|
1831
|
+
gap: 1,
|
|
1832
|
+
padding: "10px",
|
|
1833
|
+
flexWrap: "wrap",
|
|
1834
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
1835
|
+
borderRadius: "10px"
|
|
1836
|
+
},
|
|
1837
|
+
children: [
|
|
1838
|
+
(hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) && ((_x = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _x.length) > 0 && ((_y = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _y.map((service, index) => {
|
|
1839
|
+
var _a2, _b2, _c2;
|
|
1840
|
+
return /* @__PURE__ */ jsxs(
|
|
1841
|
+
Box,
|
|
2324
1842
|
{
|
|
2325
|
-
variant: "body1",
|
|
2326
1843
|
sx: {
|
|
2327
|
-
|
|
2328
|
-
letterSpacing: "0.02em",
|
|
2329
|
-
textTransform: "capitalize",
|
|
1844
|
+
p: 1,
|
|
2330
1845
|
display: "flex",
|
|
2331
1846
|
alignItems: "center",
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
height: "20px"
|
|
2337
|
-
},
|
|
2338
|
-
children: "No Queues Found"
|
|
2339
|
-
}
|
|
2340
|
-
)
|
|
2341
|
-
]
|
|
2342
|
-
}
|
|
2343
|
-
)
|
|
2344
|
-
}
|
|
2345
|
-
),
|
|
2346
|
-
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && !isTransferLoading && currentselecteTab === "agents" && /* @__PURE__ */ jsx2(
|
|
2347
|
-
Box,
|
|
2348
|
-
{
|
|
2349
|
-
sx: {
|
|
2350
|
-
display: "grid",
|
|
2351
|
-
gridTemplateColumns: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_r = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _r.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)",
|
|
2352
|
-
gap: 1,
|
|
2353
|
-
padding: "10px",
|
|
2354
|
-
flexWrap: "wrap",
|
|
2355
|
-
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2356
|
-
borderRadius: "10px"
|
|
2357
|
-
},
|
|
2358
|
-
children: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_s = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _s.length) > 0 ? (_t = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _t.map((agent, index) => /* @__PURE__ */ jsxs2(
|
|
2359
|
-
Box,
|
|
2360
|
-
{
|
|
2361
|
-
sx: {
|
|
2362
|
-
p: 1,
|
|
2363
|
-
display: "flex",
|
|
2364
|
-
alignItems: "center",
|
|
2365
|
-
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2366
|
-
padding: "6px",
|
|
2367
|
-
borderRadius: "10px",
|
|
2368
|
-
"&:hover": { bgcolor: "action.selected" }
|
|
2369
|
-
},
|
|
2370
|
-
children: [
|
|
2371
|
-
/* @__PURE__ */ jsxs2(
|
|
2372
|
-
Typography,
|
|
2373
|
-
{
|
|
2374
|
-
variant: "body1",
|
|
2375
|
-
sx: {
|
|
2376
|
-
mx: 1,
|
|
2377
|
-
width: "200px",
|
|
2378
|
-
maxWidth: "250px",
|
|
2379
|
-
display: "flex",
|
|
2380
|
-
alignItems: "center"
|
|
1847
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
1848
|
+
padding: "6px",
|
|
1849
|
+
borderRadius: "10px",
|
|
1850
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
2381
1851
|
},
|
|
2382
1852
|
children: [
|
|
2383
|
-
/* @__PURE__ */
|
|
2384
|
-
|
|
1853
|
+
/* @__PURE__ */ jsxs(
|
|
1854
|
+
Typography,
|
|
1855
|
+
{
|
|
1856
|
+
variant: "body1",
|
|
1857
|
+
sx: {
|
|
1858
|
+
mx: 1,
|
|
1859
|
+
width: "200px",
|
|
1860
|
+
maxWidth: "250px",
|
|
1861
|
+
display: "flex",
|
|
1862
|
+
alignItems: "center"
|
|
1863
|
+
},
|
|
1864
|
+
children: [
|
|
1865
|
+
/* @__PURE__ */ jsx(Roofing, { sx: { marginRight: "4px" } }),
|
|
1866
|
+
/* @__PURE__ */ jsx(Tooltip, { title: `${(_a2 = service == null ? void 0 : service.description) != null ? _a2 : ""}`, children: /* @__PURE__ */ jsxs(Box, { sx: { color: "text.secondary" }, children: [
|
|
1867
|
+
service.name,
|
|
1868
|
+
/* @__PURE__ */ jsx(
|
|
1869
|
+
Box,
|
|
1870
|
+
{
|
|
1871
|
+
sx: {
|
|
1872
|
+
fontSize: "9px",
|
|
1873
|
+
fontWeight: "600",
|
|
1874
|
+
letterSpacing: "0.02em",
|
|
1875
|
+
textTransform: "capitalize",
|
|
1876
|
+
color: "gray",
|
|
1877
|
+
textOverflow: "ellipsis",
|
|
1878
|
+
whiteSpace: "nowrap",
|
|
1879
|
+
overflow: "hidden",
|
|
1880
|
+
maxWidth: "160px"
|
|
1881
|
+
},
|
|
1882
|
+
children: (_b2 = service == null ? void 0 : service.description) != null ? _b2 : ""
|
|
1883
|
+
}
|
|
1884
|
+
)
|
|
1885
|
+
] }) })
|
|
1886
|
+
]
|
|
1887
|
+
}
|
|
1888
|
+
),
|
|
1889
|
+
/* @__PURE__ */ jsx(Tooltip, { title: state.consultInfo ? "Please complete or cancel the ongoing consult transfer before proceeding." : (_c2 = service == null ? void 0 : service.phone_number) != null ? _c2 : "", children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
1890
|
+
IconButton,
|
|
1891
|
+
{
|
|
1892
|
+
color: "success",
|
|
1893
|
+
disabled: !!state.consultInfo,
|
|
1894
|
+
sx: {
|
|
1895
|
+
bgcolor: "action.hover",
|
|
1896
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
1897
|
+
},
|
|
1898
|
+
onClick: (e) => {
|
|
1899
|
+
var _a3;
|
|
1900
|
+
return handleTransferClick(e, { mobile_number: (_a3 = service == null ? void 0 : service.phone_number) != null ? _a3 : "" }, "OTHER");
|
|
1901
|
+
},
|
|
1902
|
+
children: /* @__PURE__ */ jsx(Call, {})
|
|
1903
|
+
}
|
|
1904
|
+
) }) })
|
|
2385
1905
|
]
|
|
2386
|
-
}
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
color: "success",
|
|
2392
|
-
sx: {
|
|
2393
|
-
bgcolor: "action.hover",
|
|
2394
|
-
"&:hover": { bgcolor: "action.selected" }
|
|
2395
|
-
},
|
|
2396
|
-
onClick: () => {
|
|
2397
|
-
handleTransferCall(agent, "AGENT");
|
|
2398
|
-
},
|
|
2399
|
-
children: /* @__PURE__ */ jsx2(Call, {})
|
|
2400
|
-
}
|
|
2401
|
-
)
|
|
2402
|
-
]
|
|
2403
|
-
},
|
|
2404
|
-
index
|
|
2405
|
-
)) : /* @__PURE__ */ jsxs2(
|
|
2406
|
-
Box,
|
|
2407
|
-
{
|
|
2408
|
-
sx: {
|
|
2409
|
-
display: "flex",
|
|
2410
|
-
alignItems: "center",
|
|
2411
|
-
justifyContent: "center",
|
|
2412
|
-
flexDirection: "column"
|
|
2413
|
-
},
|
|
2414
|
-
p: 2,
|
|
2415
|
-
children: [
|
|
2416
|
-
/* @__PURE__ */ jsx2(Upcoming, { color: "primary" }),
|
|
2417
|
-
/* @__PURE__ */ jsx2(
|
|
2418
|
-
Typography,
|
|
2419
|
-
{
|
|
2420
|
-
variant: "body1",
|
|
2421
|
-
sx: {
|
|
2422
|
-
fontSize: "16px",
|
|
2423
|
-
letterSpacing: "0.02em",
|
|
2424
|
-
textTransform: "capitalize",
|
|
2425
|
-
display: "flex",
|
|
2426
|
-
alignItems: "center",
|
|
2427
|
-
justifyContent: "center",
|
|
2428
|
-
width: "100%",
|
|
2429
|
-
margin: "10px 0px",
|
|
2430
|
-
color: "primary.main",
|
|
2431
|
-
height: "20px"
|
|
2432
|
-
},
|
|
2433
|
-
children: "No Agents Found"
|
|
2434
|
-
}
|
|
2435
|
-
)
|
|
2436
|
-
]
|
|
2437
|
-
}
|
|
2438
|
-
)
|
|
2439
|
-
}
|
|
2440
|
-
),
|
|
2441
|
-
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && !isTransferLoading && currentselecteTab === "others" && /* @__PURE__ */ jsxs2(
|
|
2442
|
-
Box,
|
|
2443
|
-
{
|
|
2444
|
-
sx: {
|
|
2445
|
-
display: "grid",
|
|
2446
|
-
gridTemplateColumns: "repeat(2, 1fr)",
|
|
2447
|
-
gap: 1,
|
|
2448
|
-
padding: "10px",
|
|
2449
|
-
flexWrap: "wrap",
|
|
2450
|
-
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2451
|
-
borderRadius: "10px"
|
|
2452
|
-
},
|
|
2453
|
-
children: [
|
|
2454
|
-
(hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) && ((_u = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _u.length) > 0 && ((_v = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _v.map((service, index) => {
|
|
2455
|
-
var _a3, _b2, _c2;
|
|
2456
|
-
return /* @__PURE__ */ jsxs2(
|
|
1906
|
+
},
|
|
1907
|
+
index
|
|
1908
|
+
);
|
|
1909
|
+
})),
|
|
1910
|
+
/* @__PURE__ */ jsxs(
|
|
2457
1911
|
Box,
|
|
2458
1912
|
{
|
|
2459
1913
|
sx: {
|
|
@@ -2461,12 +1915,11 @@ function CallTransferDialog({ open }) {
|
|
|
2461
1915
|
display: "flex",
|
|
2462
1916
|
alignItems: "center",
|
|
2463
1917
|
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2464
|
-
padding: "6px",
|
|
2465
|
-
borderRadius: "10px"
|
|
2466
|
-
"&:hover": { bgcolor: "action.selected" }
|
|
1918
|
+
padding: "6px",
|
|
1919
|
+
borderRadius: "10px"
|
|
2467
1920
|
},
|
|
2468
1921
|
children: [
|
|
2469
|
-
/* @__PURE__ */
|
|
1922
|
+
/* @__PURE__ */ jsx(
|
|
2470
1923
|
Typography,
|
|
2471
1924
|
{
|
|
2472
1925
|
variant: "body1",
|
|
@@ -2477,135 +1930,106 @@ function CallTransferDialog({ open }) {
|
|
|
2477
1930
|
display: "flex",
|
|
2478
1931
|
alignItems: "center"
|
|
2479
1932
|
},
|
|
2480
|
-
children:
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
textOverflow: "ellipsis",
|
|
2494
|
-
whiteSpace: "nowrap",
|
|
2495
|
-
overflow: "hidden",
|
|
2496
|
-
maxWidth: "160px"
|
|
2497
|
-
},
|
|
2498
|
-
children: (_b2 = service == null ? void 0 : service.description) != null ? _b2 : ""
|
|
1933
|
+
children: /* @__PURE__ */ jsx(
|
|
1934
|
+
TextField,
|
|
1935
|
+
{
|
|
1936
|
+
size: "small",
|
|
1937
|
+
name: "others",
|
|
1938
|
+
label: "Mobile number",
|
|
1939
|
+
variant: "outlined",
|
|
1940
|
+
type: "tel",
|
|
1941
|
+
value: mobileNumber,
|
|
1942
|
+
onChange: (e) => {
|
|
1943
|
+
const v = e.target.value;
|
|
1944
|
+
if (/^\d*$/.test(v)) {
|
|
1945
|
+
setMobileNumber(v);
|
|
2499
1946
|
}
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
1947
|
+
},
|
|
1948
|
+
slotProps: {
|
|
1949
|
+
htmlInput: {
|
|
1950
|
+
inputMode: "numeric",
|
|
1951
|
+
maxLength: 11
|
|
1952
|
+
}
|
|
1953
|
+
},
|
|
1954
|
+
placeholder: "Enter mobile number",
|
|
1955
|
+
autoComplete: "off"
|
|
1956
|
+
}
|
|
1957
|
+
)
|
|
2503
1958
|
}
|
|
2504
1959
|
),
|
|
2505
|
-
/* @__PURE__ */
|
|
2506
|
-
|
|
1960
|
+
/* @__PURE__ */ jsx(
|
|
1961
|
+
Tooltip,
|
|
2507
1962
|
{
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
1963
|
+
title: state.consultInfo ? "Please complete or cancel the ongoing consult transfer before proceeding." : mobileNumber ? `Call To - ${mobileNumber}` : "Enter mobile number",
|
|
1964
|
+
children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
1965
|
+
IconButton,
|
|
1966
|
+
{
|
|
1967
|
+
color: "success",
|
|
1968
|
+
disabled: !!state.consultInfo,
|
|
1969
|
+
sx: {
|
|
1970
|
+
bgcolor: "action.hover",
|
|
1971
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
1972
|
+
},
|
|
1973
|
+
onClick: (e) => handleTransferClick(e, { mobile_number: mobileNumber != null ? mobileNumber : "" }, "OTHER"),
|
|
1974
|
+
children: /* @__PURE__ */ jsx(Call, {})
|
|
1975
|
+
}
|
|
1976
|
+
) })
|
|
2521
1977
|
}
|
|
2522
|
-
)
|
|
1978
|
+
)
|
|
2523
1979
|
]
|
|
2524
|
-
}
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
htmlInput: {
|
|
2568
|
-
inputMode: "numeric",
|
|
2569
|
-
maxLength: 11
|
|
2570
|
-
}
|
|
2571
|
-
},
|
|
2572
|
-
placeholder: "Enter mobile number",
|
|
2573
|
-
autoComplete: "off"
|
|
2574
|
-
}
|
|
2575
|
-
)
|
|
2576
|
-
}
|
|
2577
|
-
),
|
|
2578
|
-
/* @__PURE__ */ jsx2(
|
|
2579
|
-
Tooltip,
|
|
2580
|
-
{
|
|
2581
|
-
title: mobileNumber ? `Call To - ${mobileNumber}` : "Enter mobile number",
|
|
2582
|
-
children: /* @__PURE__ */ jsx2(
|
|
2583
|
-
IconButton,
|
|
2584
|
-
{
|
|
2585
|
-
color: "success",
|
|
2586
|
-
sx: {
|
|
2587
|
-
bgcolor: "action.hover",
|
|
2588
|
-
"&:hover": { bgcolor: "action.selected" }
|
|
2589
|
-
},
|
|
2590
|
-
onClick: () => handleTransferCall({ mobile_number: mobileNumber != null ? mobileNumber : "" }, "OTHER"),
|
|
2591
|
-
children: /* @__PURE__ */ jsx2(Call, {})
|
|
2592
|
-
}
|
|
2593
|
-
)
|
|
2594
|
-
}
|
|
2595
|
-
)
|
|
2596
|
-
]
|
|
2597
|
-
}
|
|
2598
|
-
)
|
|
1980
|
+
}
|
|
1981
|
+
)
|
|
1982
|
+
]
|
|
1983
|
+
}
|
|
1984
|
+
)
|
|
1985
|
+
] })
|
|
1986
|
+
] })
|
|
1987
|
+
}
|
|
1988
|
+
),
|
|
1989
|
+
/* @__PURE__ */ jsxs(
|
|
1990
|
+
Menu,
|
|
1991
|
+
{
|
|
1992
|
+
anchorEl: transferMenuAnchor,
|
|
1993
|
+
open: Boolean(transferMenuAnchor),
|
|
1994
|
+
onClose: () => setTransferMenuAnchor(null),
|
|
1995
|
+
anchorOrigin: { vertical: "top", horizontal: "left" },
|
|
1996
|
+
transformOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1997
|
+
children: [
|
|
1998
|
+
blindEnabled && /* @__PURE__ */ jsxs(
|
|
1999
|
+
MenuItem,
|
|
2000
|
+
{
|
|
2001
|
+
onClick: () => {
|
|
2002
|
+
if (pendingTransferData) handleTransferCall(pendingTransferData.data, pendingTransferData.type, "DEFAULT");
|
|
2003
|
+
setTransferMenuAnchor(null);
|
|
2004
|
+
},
|
|
2005
|
+
sx: { gap: 1 },
|
|
2006
|
+
children: [
|
|
2007
|
+
/* @__PURE__ */ jsx(TransferWithinAStation, { fontSize: "small", color: "primary" }),
|
|
2008
|
+
"Transfer"
|
|
2009
|
+
]
|
|
2010
|
+
}
|
|
2011
|
+
),
|
|
2012
|
+
attendedEnabled && /* @__PURE__ */ jsxs(
|
|
2013
|
+
MenuItem,
|
|
2014
|
+
{
|
|
2015
|
+
onClick: () => {
|
|
2016
|
+
if (pendingTransferData) handleTransferCall(pendingTransferData.data, pendingTransferData.type, "CONSULT");
|
|
2017
|
+
setTransferMenuAnchor(null);
|
|
2018
|
+
},
|
|
2019
|
+
sx: { gap: 1 },
|
|
2020
|
+
children: [
|
|
2021
|
+
/* @__PURE__ */ jsx(RecordVoiceOver, { fontSize: "small", color: "primary" }),
|
|
2022
|
+
"Consult then Transfer"
|
|
2599
2023
|
]
|
|
2600
2024
|
}
|
|
2601
2025
|
)
|
|
2602
|
-
]
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2026
|
+
]
|
|
2027
|
+
}
|
|
2028
|
+
)
|
|
2029
|
+
] });
|
|
2606
2030
|
}
|
|
2607
2031
|
function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
2608
|
-
var
|
|
2032
|
+
var _a, _b, _c, _d, _e;
|
|
2609
2033
|
const [getDispositions, data] = useGetRequest();
|
|
2610
2034
|
const [formData, setFormData] = useState8({
|
|
2611
2035
|
disposition: { label: "", value: "", id: 0 },
|
|
@@ -2642,23 +2066,23 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2642
2066
|
getDispositions(END_POINT.DISPOSITIONS);
|
|
2643
2067
|
}, []);
|
|
2644
2068
|
const dispositionsOptions = useMemo(() => {
|
|
2645
|
-
var
|
|
2646
|
-
return ((_d2 = (_c2 = (_b2 = (
|
|
2069
|
+
var _a2, _b2, _c2, _d2;
|
|
2070
|
+
return ((_d2 = (_c2 = (_b2 = (_a2 = data == null ? void 0 : data.data) == null ? void 0 : _a2.data) == null ? void 0 : _b2.filter((item) => item.name !== "Resolved")) == null ? void 0 : _c2.map((item) => ({
|
|
2647
2071
|
label: item.name,
|
|
2648
2072
|
value: item.code,
|
|
2649
2073
|
id: item.disposition_id
|
|
2650
2074
|
}))) == null ? void 0 : _d2.sort((a, b) => a.label.localeCompare(b.label))) || [];
|
|
2651
|
-
}, [(
|
|
2652
|
-
return /* @__PURE__ */
|
|
2075
|
+
}, [(_a = data == null ? void 0 : data.data) == null ? void 0 : _a.data]);
|
|
2076
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2653
2077
|
Dialog,
|
|
2654
2078
|
{
|
|
2655
2079
|
open,
|
|
2656
2080
|
"aria-labelledby": "alert-dialog-title",
|
|
2657
2081
|
"aria-describedby": "alert-dialog-description",
|
|
2658
|
-
fullWidth: true,
|
|
2659
2082
|
maxWidth: "xs",
|
|
2660
|
-
|
|
2661
|
-
|
|
2083
|
+
slotProps: { paper: { sx: { minWidth: 500 } } },
|
|
2084
|
+
children: /* @__PURE__ */ jsxs(Paper, { sx: { borderRadius: 2 }, children: [
|
|
2085
|
+
/* @__PURE__ */ jsx(
|
|
2662
2086
|
Box,
|
|
2663
2087
|
{
|
|
2664
2088
|
sx: {
|
|
@@ -2668,7 +2092,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2668
2092
|
padding: "4px 16px",
|
|
2669
2093
|
boxShadow: "0px 1px 2px #f5f5f5ff"
|
|
2670
2094
|
},
|
|
2671
|
-
children: /* @__PURE__ */
|
|
2095
|
+
children: /* @__PURE__ */ jsxs(
|
|
2672
2096
|
Typography,
|
|
2673
2097
|
{
|
|
2674
2098
|
variant: "body1",
|
|
@@ -2681,7 +2105,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2681
2105
|
)
|
|
2682
2106
|
}
|
|
2683
2107
|
),
|
|
2684
|
-
/* @__PURE__ */
|
|
2108
|
+
/* @__PURE__ */ jsxs(
|
|
2685
2109
|
Box,
|
|
2686
2110
|
{
|
|
2687
2111
|
sx: {
|
|
@@ -2691,13 +2115,13 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2691
2115
|
borderRadius: "10px"
|
|
2692
2116
|
},
|
|
2693
2117
|
children: [
|
|
2694
|
-
/* @__PURE__ */
|
|
2118
|
+
/* @__PURE__ */ jsxs(
|
|
2695
2119
|
Box,
|
|
2696
2120
|
{
|
|
2697
2121
|
display: "flex",
|
|
2698
2122
|
gap: 2,
|
|
2699
2123
|
children: [
|
|
2700
|
-
/* @__PURE__ */
|
|
2124
|
+
/* @__PURE__ */ jsx(
|
|
2701
2125
|
Autocomplete,
|
|
2702
2126
|
{
|
|
2703
2127
|
value: formData.disposition,
|
|
@@ -2705,7 +2129,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2705
2129
|
getOptionLabel: (opt) => opt.label,
|
|
2706
2130
|
onChange: (_, val) => handleChange("disposition", val),
|
|
2707
2131
|
size: "small",
|
|
2708
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2132
|
+
renderInput: (params) => /* @__PURE__ */ jsx(
|
|
2709
2133
|
TextField,
|
|
2710
2134
|
__spreadProps(__spreadValues({}, params), {
|
|
2711
2135
|
label: "Disposition",
|
|
@@ -2715,7 +2139,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2715
2139
|
sx: { flex: 1 }
|
|
2716
2140
|
}
|
|
2717
2141
|
),
|
|
2718
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ jsx(
|
|
2719
2143
|
Autocomplete,
|
|
2720
2144
|
{
|
|
2721
2145
|
options: followUpOptions,
|
|
@@ -2723,7 +2147,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2723
2147
|
value: formData.followUp,
|
|
2724
2148
|
onChange: (_, val) => handleChange("followUp", val),
|
|
2725
2149
|
size: "small",
|
|
2726
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2150
|
+
renderInput: (params) => /* @__PURE__ */ jsx(
|
|
2727
2151
|
TextField,
|
|
2728
2152
|
__spreadProps(__spreadValues({}, params), {
|
|
2729
2153
|
label: "Follow Up",
|
|
@@ -2736,14 +2160,14 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2736
2160
|
]
|
|
2737
2161
|
}
|
|
2738
2162
|
),
|
|
2739
|
-
/* @__PURE__ */
|
|
2163
|
+
/* @__PURE__ */ jsxs(
|
|
2740
2164
|
Box,
|
|
2741
2165
|
{
|
|
2742
2166
|
display: "flex",
|
|
2743
2167
|
gap: 2,
|
|
2744
2168
|
mt: 2,
|
|
2745
2169
|
children: [
|
|
2746
|
-
/* @__PURE__ */
|
|
2170
|
+
/* @__PURE__ */ jsxs(
|
|
2747
2171
|
Box,
|
|
2748
2172
|
{
|
|
2749
2173
|
sx: {
|
|
@@ -2752,7 +2176,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2752
2176
|
borderRadius: "5px"
|
|
2753
2177
|
},
|
|
2754
2178
|
children: [
|
|
2755
|
-
/* @__PURE__ */
|
|
2179
|
+
/* @__PURE__ */ jsx(
|
|
2756
2180
|
Checkbox,
|
|
2757
2181
|
{
|
|
2758
2182
|
name: "selected_break",
|
|
@@ -2773,7 +2197,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2773
2197
|
]
|
|
2774
2198
|
}
|
|
2775
2199
|
),
|
|
2776
|
-
((_c = (_b = formData == null ? void 0 : formData.followUp) == null ? void 0 : _b.label) == null ? void 0 : _c.toLowerCase()) === "yes" ? /* @__PURE__ */
|
|
2200
|
+
((_c = (_b = formData == null ? void 0 : formData.followUp) == null ? void 0 : _b.label) == null ? void 0 : _c.toLowerCase()) === "yes" ? /* @__PURE__ */ jsx(
|
|
2777
2201
|
TextField,
|
|
2778
2202
|
{
|
|
2779
2203
|
size: "small",
|
|
@@ -2787,37 +2211,37 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2787
2211
|
fullWidth: true,
|
|
2788
2212
|
sx: { flex: 1 }
|
|
2789
2213
|
}
|
|
2790
|
-
) : /* @__PURE__ */
|
|
2214
|
+
) : /* @__PURE__ */ jsx(Box, { sx: { flex: 1 } })
|
|
2791
2215
|
]
|
|
2792
2216
|
}
|
|
2793
2217
|
),
|
|
2794
|
-
((_e = (_d = formData == null ? void 0 : formData.followUp) == null ? void 0 : _d.label) == null ? void 0 : _e.toLowerCase()) === "yes" && /* @__PURE__ */
|
|
2218
|
+
((_e = (_d = formData == null ? void 0 : formData.followUp) == null ? void 0 : _d.label) == null ? void 0 : _e.toLowerCase()) === "yes" && /* @__PURE__ */ jsxs(
|
|
2795
2219
|
Box,
|
|
2796
2220
|
{
|
|
2797
2221
|
display: "flex",
|
|
2798
2222
|
gap: 2,
|
|
2799
2223
|
mt: 2,
|
|
2800
2224
|
children: [
|
|
2801
|
-
/* @__PURE__ */
|
|
2225
|
+
/* @__PURE__ */ jsx(
|
|
2802
2226
|
Autocomplete,
|
|
2803
2227
|
{
|
|
2804
2228
|
size: "small",
|
|
2805
2229
|
options: Array.from({ length: 24 }, (_, i) => String(i).padStart(2, "0")),
|
|
2806
2230
|
value: formData.callbackHrs || null,
|
|
2807
2231
|
onChange: (_, value) => handleChange("callbackHrs", value || ""),
|
|
2808
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2232
|
+
renderInput: (params) => /* @__PURE__ */ jsx(TextField, __spreadProps(__spreadValues({}, params), { label: "Hours (0-23)" })),
|
|
2809
2233
|
fullWidth: true,
|
|
2810
2234
|
sx: { flex: 1 }
|
|
2811
2235
|
}
|
|
2812
2236
|
),
|
|
2813
|
-
/* @__PURE__ */
|
|
2237
|
+
/* @__PURE__ */ jsx(
|
|
2814
2238
|
Autocomplete,
|
|
2815
2239
|
{
|
|
2816
2240
|
size: "small",
|
|
2817
2241
|
options: Array.from({ length: 60 }, (_, i) => String(i).padStart(2, "0")),
|
|
2818
2242
|
value: formData.callbackMins || null,
|
|
2819
2243
|
onChange: (_, value) => handleChange("callbackMins", value || ""),
|
|
2820
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2244
|
+
renderInput: (params) => /* @__PURE__ */ jsx(TextField, __spreadProps(__spreadValues({}, params), { label: "Minutes (0-59)" })),
|
|
2821
2245
|
fullWidth: true,
|
|
2822
2246
|
sx: { flex: 1 }
|
|
2823
2247
|
}
|
|
@@ -2825,7 +2249,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2825
2249
|
]
|
|
2826
2250
|
}
|
|
2827
2251
|
),
|
|
2828
|
-
/* @__PURE__ */
|
|
2252
|
+
/* @__PURE__ */ jsx(Box, { mt: 2, children: /* @__PURE__ */ jsx(
|
|
2829
2253
|
TextField,
|
|
2830
2254
|
{
|
|
2831
2255
|
size: "small",
|
|
@@ -2841,13 +2265,13 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2841
2265
|
]
|
|
2842
2266
|
}
|
|
2843
2267
|
),
|
|
2844
|
-
/* @__PURE__ */
|
|
2268
|
+
/* @__PURE__ */ jsxs(
|
|
2845
2269
|
Box,
|
|
2846
2270
|
{
|
|
2847
2271
|
textAlign: "right",
|
|
2848
2272
|
m: 2,
|
|
2849
2273
|
children: [
|
|
2850
|
-
/* @__PURE__ */
|
|
2274
|
+
/* @__PURE__ */ jsx(
|
|
2851
2275
|
Button,
|
|
2852
2276
|
{
|
|
2853
2277
|
variant: "outlined",
|
|
@@ -2863,7 +2287,7 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2863
2287
|
children: "cancel"
|
|
2864
2288
|
}
|
|
2865
2289
|
),
|
|
2866
|
-
/* @__PURE__ */
|
|
2290
|
+
/* @__PURE__ */ jsx(
|
|
2867
2291
|
Button,
|
|
2868
2292
|
{
|
|
2869
2293
|
variant: "contained",
|
|
@@ -2890,15 +2314,16 @@ function ProcessorListDialog({
|
|
|
2890
2314
|
const handleClose = () => {
|
|
2891
2315
|
setOpen(false);
|
|
2892
2316
|
};
|
|
2893
|
-
return /* @__PURE__ */
|
|
2317
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2894
2318
|
Dialog,
|
|
2895
2319
|
{
|
|
2896
2320
|
open,
|
|
2897
2321
|
"aria-labelledby": "alert-dialog-title",
|
|
2898
2322
|
"aria-describedby": "alert-dialog-description",
|
|
2899
2323
|
maxWidth: "xs",
|
|
2900
|
-
|
|
2901
|
-
|
|
2324
|
+
slotProps: { paper: { sx: { minWidth: 500 } } },
|
|
2325
|
+
children: /* @__PURE__ */ jsxs(Paper, { sx: { borderRadius: 2 }, children: [
|
|
2326
|
+
/* @__PURE__ */ jsxs(
|
|
2902
2327
|
Box,
|
|
2903
2328
|
{
|
|
2904
2329
|
sx: {
|
|
@@ -2909,12 +2334,12 @@ function ProcessorListDialog({
|
|
|
2909
2334
|
boxShadow: "0px 1px 2px #f5f5f5ff"
|
|
2910
2335
|
},
|
|
2911
2336
|
children: [
|
|
2912
|
-
/* @__PURE__ */
|
|
2913
|
-
/* @__PURE__ */
|
|
2337
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", children: " Process List" }),
|
|
2338
|
+
/* @__PURE__ */ jsx(IconButton, { onClick: handleClose, children: /* @__PURE__ */ jsx(Close, {}) })
|
|
2914
2339
|
]
|
|
2915
2340
|
}
|
|
2916
2341
|
),
|
|
2917
|
-
/* @__PURE__ */
|
|
2342
|
+
/* @__PURE__ */ jsx(
|
|
2918
2343
|
Box,
|
|
2919
2344
|
{
|
|
2920
2345
|
sx: {
|
|
@@ -2923,7 +2348,7 @@ function ProcessorListDialog({
|
|
|
2923
2348
|
margin: "10px",
|
|
2924
2349
|
borderRadius: "10px"
|
|
2925
2350
|
},
|
|
2926
|
-
children: processList.length > 0 ? processList == null ? void 0 : processList.map((process, index) => /* @__PURE__ */
|
|
2351
|
+
children: processList.length > 0 ? processList == null ? void 0 : processList.map((process, index) => /* @__PURE__ */ jsx(
|
|
2927
2352
|
Box,
|
|
2928
2353
|
{
|
|
2929
2354
|
sx: {
|
|
@@ -2940,7 +2365,7 @@ function ProcessorListDialog({
|
|
|
2940
2365
|
onClick: () => {
|
|
2941
2366
|
handleSelectedProcessor(process);
|
|
2942
2367
|
},
|
|
2943
|
-
children: /* @__PURE__ */
|
|
2368
|
+
children: /* @__PURE__ */ jsxs(
|
|
2944
2369
|
Typography,
|
|
2945
2370
|
{
|
|
2946
2371
|
variant: "body1",
|
|
@@ -2952,7 +2377,7 @@ function ProcessorListDialog({
|
|
|
2952
2377
|
alignItems: "center"
|
|
2953
2378
|
},
|
|
2954
2379
|
children: [
|
|
2955
|
-
/* @__PURE__ */
|
|
2380
|
+
/* @__PURE__ */ jsx(SupportAgent, { sx: { marginRight: "4px" } }),
|
|
2956
2381
|
process.process_name
|
|
2957
2382
|
]
|
|
2958
2383
|
}
|
|
@@ -2970,16 +2395,16 @@ function CallHistoryDialog({ open, setOpen }) {
|
|
|
2970
2395
|
const handleClose = () => {
|
|
2971
2396
|
setOpen(false);
|
|
2972
2397
|
};
|
|
2973
|
-
return /* @__PURE__ */
|
|
2398
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2974
2399
|
Dialog,
|
|
2975
2400
|
{
|
|
2976
2401
|
open,
|
|
2977
2402
|
"aria-labelledby": "alert-dialog-title",
|
|
2978
2403
|
"aria-describedby": "alert-dialog-description",
|
|
2979
|
-
fullWidth: true,
|
|
2980
2404
|
maxWidth: "md",
|
|
2981
|
-
|
|
2982
|
-
|
|
2405
|
+
slotProps: { paper: { sx: { minWidth: 500 } } },
|
|
2406
|
+
children: /* @__PURE__ */ jsxs(Paper, { sx: { borderRadius: 2 }, children: [
|
|
2407
|
+
/* @__PURE__ */ jsxs(
|
|
2983
2408
|
Box,
|
|
2984
2409
|
{
|
|
2985
2410
|
sx: {
|
|
@@ -2990,12 +2415,12 @@ function CallHistoryDialog({ open, setOpen }) {
|
|
|
2990
2415
|
boxShadow: "0px 1px 2px #f5f5f5ff"
|
|
2991
2416
|
},
|
|
2992
2417
|
children: [
|
|
2993
|
-
/* @__PURE__ */
|
|
2994
|
-
/* @__PURE__ */
|
|
2418
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", children: " Call History" }),
|
|
2419
|
+
/* @__PURE__ */ jsx(IconButton, { onClick: handleClose, children: /* @__PURE__ */ jsx(Close, {}) })
|
|
2995
2420
|
]
|
|
2996
2421
|
}
|
|
2997
2422
|
),
|
|
2998
|
-
/* @__PURE__ */
|
|
2423
|
+
/* @__PURE__ */ jsx(
|
|
2999
2424
|
Box,
|
|
3000
2425
|
{
|
|
3001
2426
|
sx: {
|
|
@@ -3016,14 +2441,14 @@ function CallHistoryDialog({ open, setOpen }) {
|
|
|
3016
2441
|
}
|
|
3017
2442
|
|
|
3018
2443
|
// call-control-sdk/lib/hooks/useDraggable.ts
|
|
3019
|
-
import { useCallback as
|
|
2444
|
+
import { useCallback as useCallback6, useRef, useState as useState9 } from "react";
|
|
3020
2445
|
function useDraggable(initialPosition, onPositionChange) {
|
|
3021
2446
|
const [position, setPosition] = useState9(initialPosition);
|
|
3022
2447
|
const [isDragging, setIsDragging] = useState9(false);
|
|
3023
2448
|
const dragRef = useRef();
|
|
3024
2449
|
const dragStart = useRef({ x: 0, y: 0 });
|
|
3025
2450
|
const elementStart = useRef({ x: 0, y: 0 });
|
|
3026
|
-
const updatePosition =
|
|
2451
|
+
const updatePosition = useCallback6(
|
|
3027
2452
|
(newPosition) => {
|
|
3028
2453
|
const element = dragRef.current;
|
|
3029
2454
|
if (!element) return;
|
|
@@ -3039,7 +2464,7 @@ function useDraggable(initialPosition, onPositionChange) {
|
|
|
3039
2464
|
},
|
|
3040
2465
|
[onPositionChange]
|
|
3041
2466
|
);
|
|
3042
|
-
const handleStart =
|
|
2467
|
+
const handleStart = useCallback6(
|
|
3043
2468
|
(clientX, clientY) => {
|
|
3044
2469
|
setIsDragging(true);
|
|
3045
2470
|
dragStart.current = { x: clientX, y: clientY };
|
|
@@ -3079,14 +2504,14 @@ function useDraggable(initialPosition, onPositionChange) {
|
|
|
3079
2504
|
},
|
|
3080
2505
|
[position, updatePosition]
|
|
3081
2506
|
);
|
|
3082
|
-
const handleMouseDown =
|
|
2507
|
+
const handleMouseDown = useCallback6(
|
|
3083
2508
|
(e) => {
|
|
3084
2509
|
e.preventDefault();
|
|
3085
2510
|
handleStart(e.clientX, e.clientY);
|
|
3086
2511
|
},
|
|
3087
2512
|
[handleStart]
|
|
3088
2513
|
);
|
|
3089
|
-
const handleTouchStart =
|
|
2514
|
+
const handleTouchStart = useCallback6(
|
|
3090
2515
|
(e) => {
|
|
3091
2516
|
e.preventDefault();
|
|
3092
2517
|
const touch = e.touches[0];
|
|
@@ -3234,18 +2659,18 @@ function cleanupAudioResources() {
|
|
|
3234
2659
|
}
|
|
3235
2660
|
|
|
3236
2661
|
// call-control-sdk/lib/components/callControls.tsx
|
|
3237
|
-
import {
|
|
3238
|
-
import { Fragment as Fragment2, jsx as
|
|
2662
|
+
import { getSession as getSession3 } from "@react-solutions/vault";
|
|
2663
|
+
import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
3239
2664
|
var getCombineConfrenceData = (localState, apiData) => {
|
|
3240
2665
|
const localConfrenceData = localState == null ? void 0 : localState.conferenceLine;
|
|
3241
2666
|
const apiConferenceData = apiData == null ? void 0 : apiData.conferencestatus;
|
|
3242
2667
|
const updatedConferenceData = localConfrenceData.map((item) => {
|
|
3243
|
-
var
|
|
2668
|
+
var _a, _b, _c, _d, _e;
|
|
3244
2669
|
if ((item == null ? void 0 : item.line) === 1) {
|
|
3245
2670
|
const statusKey = `line_${item.line}_status`;
|
|
3246
2671
|
return __spreadProps(__spreadValues({}, item), {
|
|
3247
2672
|
line: 1,
|
|
3248
|
-
status: (_b = apiConferenceData == null ? void 0 : apiConferenceData[statusKey]) != null ? _b : (
|
|
2673
|
+
status: (_b = apiConferenceData == null ? void 0 : apiConferenceData[statusKey]) != null ? _b : (_a = localState == null ? void 0 : localState.callData) == null ? void 0 : _a.status,
|
|
3249
2674
|
phone: (_d = (_c = localState == null ? void 0 : localState.callData) == null ? void 0 : _c.phone_number) != null ? _d : ""
|
|
3250
2675
|
});
|
|
3251
2676
|
} else {
|
|
@@ -3270,12 +2695,12 @@ var formatDuration = (seconds) => {
|
|
|
3270
2695
|
return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
3271
2696
|
};
|
|
3272
2697
|
function CallControls({ onDataChange }) {
|
|
3273
|
-
var
|
|
2698
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb;
|
|
3274
2699
|
const theme = useTheme3();
|
|
3275
2700
|
const state = useSDKState();
|
|
3276
2701
|
const { showToast } = useToast();
|
|
3277
2702
|
const { disabled, enabled, outlined } = styles_default({
|
|
3278
|
-
disabled: ((
|
|
2703
|
+
disabled: ((_a = state.sdkConfig) == null ? void 0 : _a.disabled) || {},
|
|
3279
2704
|
enabled: ((_b = state.sdkConfig) == null ? void 0 : _b.enabled) || {},
|
|
3280
2705
|
outlined: ((_c = state.sdkConfig) == null ? void 0 : _c.outlined) || {}
|
|
3281
2706
|
});
|
|
@@ -3322,7 +2747,7 @@ function CallControls({ onDataChange }) {
|
|
|
3322
2747
|
state.iframePosition,
|
|
3323
2748
|
(newPosition) => sdkStateManager.setIframePosition(newPosition)
|
|
3324
2749
|
);
|
|
3325
|
-
const [
|
|
2750
|
+
const [clickToCall2, { isLoading: clickToCallLoading }] = usePostRequest({
|
|
3326
2751
|
onSuccess: () => {
|
|
3327
2752
|
setPhoneNumber("");
|
|
3328
2753
|
setDialerAnchorEl(null);
|
|
@@ -3337,7 +2762,7 @@ function CallControls({ onDataChange }) {
|
|
|
3337
2762
|
});
|
|
3338
2763
|
const [updateAgentStatus, { isLoading }] = usePostRequest();
|
|
3339
2764
|
const [sendNotification] = usePostRequest();
|
|
3340
|
-
const [
|
|
2765
|
+
const [endCall2, { isLoading: endCallLoading }] = usePostRequest({
|
|
3341
2766
|
onSuccess: () => {
|
|
3342
2767
|
sdkStateManager.endCall();
|
|
3343
2768
|
setOpenCallDisposition(false);
|
|
@@ -3381,9 +2806,9 @@ function CallControls({ onDataChange }) {
|
|
|
3381
2806
|
readyAgentStatus(END_POINT.READY_AGENT, payload);
|
|
3382
2807
|
};
|
|
3383
2808
|
const handleUpdateAgentStatus = (status) => {
|
|
3384
|
-
var
|
|
2809
|
+
var _a2, _b2;
|
|
3385
2810
|
setStatusAnchorEl(null);
|
|
3386
|
-
const currentStatus = (_b2 = (
|
|
2811
|
+
const currentStatus = (_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase();
|
|
3387
2812
|
if (["ONCALL" /* ONCALL */, "RINGING" /* RINGING */, "DIALING" /* DIALING */, "WRAPUP" /* WRAPUP */].includes(currentStatus)) {
|
|
3388
2813
|
showToast("Cannot put agent on break while on a call", "error");
|
|
3389
2814
|
return;
|
|
@@ -3408,31 +2833,31 @@ function CallControls({ onDataChange }) {
|
|
|
3408
2833
|
phone_number: number,
|
|
3409
2834
|
userId: state.agentId
|
|
3410
2835
|
};
|
|
3411
|
-
|
|
2836
|
+
clickToCall2(END_POINT.CLICK_TO_CALL, payload);
|
|
3412
2837
|
}
|
|
3413
2838
|
};
|
|
3414
2839
|
const handleHoldToggle = () => {
|
|
3415
|
-
var
|
|
2840
|
+
var _a2;
|
|
3416
2841
|
const payload = {
|
|
3417
|
-
action: ((
|
|
2842
|
+
action: ((_a2 = state.callData) == null ? void 0 : _a2.hold) === 1 ? "UNHOLD" /* UNHOLD */ : "HOLD" /* HOLD */,
|
|
3418
2843
|
userId: state.agentId
|
|
3419
2844
|
};
|
|
3420
2845
|
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
3421
2846
|
};
|
|
3422
2847
|
const handleMuteToggle = () => {
|
|
3423
|
-
var
|
|
2848
|
+
var _a2;
|
|
3424
2849
|
const payload = {
|
|
3425
|
-
action: ((
|
|
2850
|
+
action: ((_a2 = state.callData) == null ? void 0 : _a2.mute) === 1 ? "UNMUTE" /* UNMUTE */ : "MUTE" /* MUTE */,
|
|
3426
2851
|
userId: state.agentId
|
|
3427
2852
|
};
|
|
3428
2853
|
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
3429
2854
|
};
|
|
3430
2855
|
const handleEndCall = (data) => {
|
|
3431
|
-
var
|
|
2856
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2;
|
|
3432
2857
|
const payload = {
|
|
3433
2858
|
action: "ENDCALL",
|
|
3434
2859
|
userId: state.agentId,
|
|
3435
|
-
processid: (_c2 = (_b2 = (
|
|
2860
|
+
processid: (_c2 = (_b2 = (_a2 = state.process) == null ? void 0 : _a2.process_id) == null ? void 0 : _b2.toString()) != null ? _c2 : "",
|
|
3436
2861
|
process_name: (_e2 = (_d2 = state.process) == null ? void 0 : _d2.process_name) != null ? _e2 : "",
|
|
3437
2862
|
convox_id: (_g2 = (_f2 = state.callData) == null ? void 0 : _f2.convox_id) != null ? _g2 : "",
|
|
3438
2863
|
mobile_number: (_i2 = (_h2 = state.callData) == null ? void 0 : _h2.phone_number) != null ? _i2 : "",
|
|
@@ -3444,13 +2869,13 @@ function CallControls({ onDataChange }) {
|
|
|
3444
2869
|
endcall_type: "CLOSE"
|
|
3445
2870
|
};
|
|
3446
2871
|
setPhoneNumber("");
|
|
3447
|
-
|
|
2872
|
+
endCall2(END_POINT.END_CALL, payload, {
|
|
3448
2873
|
params: {
|
|
3449
2874
|
isBreak: (_q2 = data == null ? void 0 : data.selected_break) != null ? _q2 : false
|
|
3450
2875
|
}
|
|
3451
2876
|
}).then(() => {
|
|
3452
|
-
var
|
|
3453
|
-
const callUuid = (
|
|
2877
|
+
var _a3, _b3, _c3, _d3, _e3, _f3, _g3, _h3, _i3;
|
|
2878
|
+
const callUuid = (_a3 = state.callData) == null ? void 0 : _a3.convox_id;
|
|
3454
2879
|
if (callUuid) {
|
|
3455
2880
|
let callbackScheduledAt = null;
|
|
3456
2881
|
if (((_b3 = data == null ? void 0 : data.followUp) == null ? void 0 : _b3.value) === "Y" && (data == null ? void 0 : data.callbackDate)) {
|
|
@@ -3483,9 +2908,9 @@ function CallControls({ onDataChange }) {
|
|
|
3483
2908
|
console.error("Failed to start mic:", err);
|
|
3484
2909
|
});
|
|
3485
2910
|
const handleKeyDown = (event) => {
|
|
3486
|
-
var
|
|
3487
|
-
const fullState =
|
|
3488
|
-
const key = (
|
|
2911
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
2912
|
+
const fullState = getSession3(STORAGE_KEY);
|
|
2913
|
+
const key = (_a2 = event.key) == null ? void 0 : _a2.toLowerCase();
|
|
3489
2914
|
if (!event.altKey || ((_b2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _b2.status) !== "ONCALL" /* ONCALL */) {
|
|
3490
2915
|
return;
|
|
3491
2916
|
}
|
|
@@ -3565,9 +2990,9 @@ function CallControls({ onDataChange }) {
|
|
|
3565
2990
|
};
|
|
3566
2991
|
}, [state.callData.status]);
|
|
3567
2992
|
useEffect5(() => {
|
|
3568
|
-
var
|
|
2993
|
+
var _a2, _b2, _c2;
|
|
3569
2994
|
let holdInterval;
|
|
3570
|
-
const isOnCall = ((_b2 = (
|
|
2995
|
+
const isOnCall = ((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()) === "ONCALL" /* ONCALL */;
|
|
3571
2996
|
const isOnHold2 = ((_c2 = state.callData) == null ? void 0 : _c2.hold) === 1;
|
|
3572
2997
|
if (isOnHold2 && isOnCall) {
|
|
3573
2998
|
if (!holdStartTimeRef.current) {
|
|
@@ -3587,9 +3012,9 @@ function CallControls({ onDataChange }) {
|
|
|
3587
3012
|
};
|
|
3588
3013
|
}, [(_d = state.callData) == null ? void 0 : _d.hold, (_e = state.callData) == null ? void 0 : _e.status]);
|
|
3589
3014
|
useEffect5(() => {
|
|
3590
|
-
var
|
|
3015
|
+
var _a2, _b2, _c2, _d2;
|
|
3591
3016
|
let muteInterval;
|
|
3592
|
-
const isOnCall = ((_b2 = (
|
|
3017
|
+
const isOnCall = ((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()) === "ONCALL" /* ONCALL */;
|
|
3593
3018
|
const isMuted2 = ((_c2 = state.callData) == null ? void 0 : _c2.mute) === 1;
|
|
3594
3019
|
const isHeld = ((_d2 = state.callData) == null ? void 0 : _d2.hold) === 1;
|
|
3595
3020
|
if (isMuted2 && isOnCall && !isHeld) {
|
|
@@ -3642,9 +3067,13 @@ function CallControls({ onDataChange }) {
|
|
|
3642
3067
|
useEffect5(() => {
|
|
3643
3068
|
if (state.agentId) {
|
|
3644
3069
|
axios_default.get(END_POINT.BREAKS_LIST).then((res) => {
|
|
3645
|
-
var
|
|
3646
|
-
if (res && ((
|
|
3070
|
+
var _a2, _b2, _c2, _d2;
|
|
3071
|
+
if (res && ((_a2 = res.data) == null ? void 0 : _a2.data) && ((_c2 = (_b2 = res == null ? void 0 : res.data) == null ? void 0 : _b2.data) == null ? void 0 : _c2.length)) {
|
|
3647
3072
|
setBreaksList(res.data.data);
|
|
3073
|
+
const liveStatus = (_d2 = sdkStateManager.getState().callData) == null ? void 0 : _d2.status;
|
|
3074
|
+
if (!liveStatus) {
|
|
3075
|
+
handleUpdateAgentStatus(res.data.data[0].type);
|
|
3076
|
+
}
|
|
3648
3077
|
}
|
|
3649
3078
|
}).catch((err) => {
|
|
3650
3079
|
showToast(err.response.data.message, "error");
|
|
@@ -3652,7 +3081,7 @@ function CallControls({ onDataChange }) {
|
|
|
3652
3081
|
}
|
|
3653
3082
|
}, [state.agentId]);
|
|
3654
3083
|
const connectWebSocket = () => {
|
|
3655
|
-
var
|
|
3084
|
+
var _a2, _b2;
|
|
3656
3085
|
if (!state.agentId) {
|
|
3657
3086
|
return;
|
|
3658
3087
|
}
|
|
@@ -3661,7 +3090,7 @@ function CallControls({ onDataChange }) {
|
|
|
3661
3090
|
reconnectTimeoutRef.current = null;
|
|
3662
3091
|
}
|
|
3663
3092
|
try {
|
|
3664
|
-
webSocketRef.current = new WebSocket(`${(
|
|
3093
|
+
webSocketRef.current = new WebSocket(`${(_a2 = state.urlConfig) == null ? void 0 : _a2.webSocketURL}/api/v1/ws/agent/events?token=${(_b2 = state.authorization) == null ? void 0 : _b2.accessToken}`);
|
|
3665
3094
|
webSocketRef.current.onopen = () => {
|
|
3666
3095
|
console.log("\u{1F310} WebSocket connection established");
|
|
3667
3096
|
reconnectAttemptsRef.current = 0;
|
|
@@ -3679,13 +3108,13 @@ function CallControls({ onDataChange }) {
|
|
|
3679
3108
|
}, 3e4);
|
|
3680
3109
|
};
|
|
3681
3110
|
webSocketRef.current.onmessage = (event) => {
|
|
3682
|
-
var
|
|
3111
|
+
var _a3, _b3, _c2, _d2, _e2, _f2;
|
|
3683
3112
|
try {
|
|
3684
3113
|
const data = JSON.parse(event.data);
|
|
3685
3114
|
if (data.type === "pong") {
|
|
3686
3115
|
return;
|
|
3687
3116
|
}
|
|
3688
|
-
const sdkState =
|
|
3117
|
+
const sdkState = getSession3(STORAGE_KEY);
|
|
3689
3118
|
const confrence = getCombineConfrenceData(sdkState, data);
|
|
3690
3119
|
const callData = {
|
|
3691
3120
|
agent_id: data == null ? void 0 : data.agent_id,
|
|
@@ -3703,9 +3132,15 @@ function CallControls({ onDataChange }) {
|
|
|
3703
3132
|
};
|
|
3704
3133
|
sdkStateManager.updateCallData(callData);
|
|
3705
3134
|
sdkStateManager.updateConferenceData([...confrence]);
|
|
3135
|
+
sdkStateManager.setConsultInfo((_a3 = data.consult_info) != null ? _a3 : null);
|
|
3136
|
+
if (data == null ? void 0 : data.call_consult_controls) {
|
|
3137
|
+
sdkStateManager.updateSDKConfigFromPermissions(data.call_consult_controls);
|
|
3138
|
+
} else {
|
|
3139
|
+
sdkStateManager.resetConsultControls();
|
|
3140
|
+
}
|
|
3706
3141
|
if (["RINGING" /* RINGING */, "DIALING" /* DIALING */].includes(data.status)) {
|
|
3707
3142
|
setShowIframe(true);
|
|
3708
|
-
setCallWrapuptime((
|
|
3143
|
+
setCallWrapuptime((_c2 = (_b3 = sdkState == null ? void 0 : sdkState.sdkConfig) == null ? void 0 : _b3.auto_wrapup_time) != null ? _c2 : null);
|
|
3709
3144
|
sdkStateManager.updateConferenceData([
|
|
3710
3145
|
{
|
|
3711
3146
|
line: 1,
|
|
@@ -3758,7 +3193,7 @@ function CallControls({ onDataChange }) {
|
|
|
3758
3193
|
isMergeCall: false
|
|
3759
3194
|
}
|
|
3760
3195
|
]);
|
|
3761
|
-
if ((data == null ? void 0 : data.mode) !== "manual" && audioRef.current && ((
|
|
3196
|
+
if ((data == null ? void 0 : data.mode) !== "manual" && audioRef.current && ((_d2 = state == null ? void 0 : state.sdkConfig) == null ? void 0 : _d2.enableRingtone)) {
|
|
3762
3197
|
audioRef.current.play().catch((error) => {
|
|
3763
3198
|
console.error("Failed to play ringtone:", error);
|
|
3764
3199
|
});
|
|
@@ -3782,8 +3217,8 @@ function CallControls({ onDataChange }) {
|
|
|
3782
3217
|
}
|
|
3783
3218
|
} else if (((data == null ? void 0 : data.mute) === 1 || (data == null ? void 0 : data.hold) === 1) && data.status === "ONCALL" /* ONCALL */) {
|
|
3784
3219
|
} else if (data.status === "BREAK" /* BREAK */) {
|
|
3785
|
-
const breakTime = (
|
|
3786
|
-
const eventTime = (
|
|
3220
|
+
const breakTime = (_e2 = sdkState == null ? void 0 : sdkState.sdkConfig) == null ? void 0 : _e2.break_time;
|
|
3221
|
+
const eventTime = (_f2 = data == null ? void 0 : data.event_time) != null ? _f2 : null;
|
|
3787
3222
|
if (eventTime !== lastEventTimeRef.current) {
|
|
3788
3223
|
hasFlashedRef.current = false;
|
|
3789
3224
|
lastEventTimeRef.current = eventTime;
|
|
@@ -3866,14 +3301,14 @@ function CallControls({ onDataChange }) {
|
|
|
3866
3301
|
};
|
|
3867
3302
|
}, [state.agentId]);
|
|
3868
3303
|
const handleSendSMS = (data) => {
|
|
3869
|
-
var
|
|
3304
|
+
var _a2;
|
|
3870
3305
|
sendNotification(END_POINT.SEND_NOTIFICATIONS, {
|
|
3871
|
-
phone_number: (
|
|
3306
|
+
phone_number: (_a2 = data == null ? void 0 : data.phone_number) != null ? _a2 : "",
|
|
3872
3307
|
type: "ambulance"
|
|
3873
3308
|
});
|
|
3874
3309
|
};
|
|
3875
3310
|
if (!state.isInitialized) {
|
|
3876
|
-
return /* @__PURE__ */
|
|
3311
|
+
return /* @__PURE__ */ jsx2(Box2, { children: Boolean(openProcessorDialog) && /* @__PURE__ */ jsx2(
|
|
3877
3312
|
ProcessorListDialog,
|
|
3878
3313
|
{
|
|
3879
3314
|
processList,
|
|
@@ -3887,48 +3322,51 @@ function CallControls({ onDataChange }) {
|
|
|
3887
3322
|
}
|
|
3888
3323
|
const isOnHold = ((_h = state.callData) == null ? void 0 : _h.hold) === 1 && ((_j = (_i = state.callData) == null ? void 0 : _i.status) == null ? void 0 : _j.toUpperCase()) === "ONCALL" /* ONCALL */;
|
|
3889
3324
|
const isMuted = ((_k = state.callData) == null ? void 0 : _k.mute) === 1 && ((_m = (_l = state.callData) == null ? void 0 : _l.status) == null ? void 0 : _m.toUpperCase()) === "ONCALL" /* ONCALL */;
|
|
3890
|
-
|
|
3891
|
-
|
|
3325
|
+
const isVertical = ((_n = state.sdkConfig) == null ? void 0 : _n.sdkPosition) === "vertical";
|
|
3326
|
+
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
3327
|
+
/* @__PURE__ */ jsx2(Box2, { children: /* @__PURE__ */ jsx2(Fade, { in: true, timeout: 300, children: /* @__PURE__ */ jsx2(
|
|
3892
3328
|
Paper2,
|
|
3893
3329
|
{
|
|
3894
|
-
ref: ((
|
|
3895
|
-
elevation: isDragging ? 4 : ((
|
|
3330
|
+
ref: ((_o = state.sdkConfig) == null ? void 0 : _o.isDraggable) ? dragRef : null,
|
|
3331
|
+
elevation: isDragging ? 4 : ((_p = state.sdkConfig) == null ? void 0 : _p.isDraggable) ? 1 : 0,
|
|
3896
3332
|
sx: {
|
|
3897
|
-
position: ((
|
|
3898
|
-
left: ((
|
|
3899
|
-
top: ((
|
|
3333
|
+
position: ((_q = state.sdkConfig) == null ? void 0 : _q.isDraggable) ? "fixed" : "relative",
|
|
3334
|
+
left: ((_r = state.sdkConfig) == null ? void 0 : _r.isDraggable) ? position.x : "auto",
|
|
3335
|
+
top: ((_s = state.sdkConfig) == null ? void 0 : _s.isDraggable) ? position.y : "auto",
|
|
3900
3336
|
display: "inline-block",
|
|
3901
|
-
width: "auto",
|
|
3337
|
+
width: isVertical ? "180px" : "auto",
|
|
3902
3338
|
flexShrink: 0,
|
|
3903
3339
|
whiteSpace: "nowrap",
|
|
3904
3340
|
p: 0.5,
|
|
3905
3341
|
borderRadius: 3,
|
|
3906
3342
|
bgcolor: "background.paper",
|
|
3907
|
-
zIndex: ((
|
|
3343
|
+
zIndex: ((_t = state.sdkConfig) == null ? void 0 : _t.isDraggable) ? Number.MAX_SAFE_INTEGER : 0,
|
|
3908
3344
|
transition: theme.transitions.create(["box-shadow", "transform"], {
|
|
3909
3345
|
duration: theme.transitions.duration.short
|
|
3910
3346
|
}),
|
|
3911
3347
|
userSelect: "none"
|
|
3912
3348
|
},
|
|
3913
|
-
children: /* @__PURE__ */
|
|
3349
|
+
children: /* @__PURE__ */ jsxs2(
|
|
3914
3350
|
Box2,
|
|
3915
3351
|
{
|
|
3916
3352
|
sx: {
|
|
3917
3353
|
display: "flex",
|
|
3918
|
-
|
|
3354
|
+
flexDirection: isVertical ? "column" : "row",
|
|
3355
|
+
alignItems: isVertical ? "stretch" : "center"
|
|
3919
3356
|
},
|
|
3920
3357
|
children: [
|
|
3921
|
-
/* @__PURE__ */
|
|
3358
|
+
/* @__PURE__ */ jsxs2(
|
|
3922
3359
|
Box2,
|
|
3923
3360
|
{
|
|
3924
3361
|
sx: {
|
|
3925
3362
|
display: "flex",
|
|
3926
|
-
|
|
3363
|
+
flexDirection: isVertical ? "column" : "row",
|
|
3364
|
+
alignItems: isVertical ? "stretch" : "center",
|
|
3927
3365
|
gap: 1,
|
|
3928
|
-
margin: "0px 10px"
|
|
3366
|
+
margin: isVertical ? "10px 8px 4px 8px" : "0px 10px"
|
|
3929
3367
|
},
|
|
3930
3368
|
children: [
|
|
3931
|
-
((
|
|
3369
|
+
((_u = state.sdkConfig) == null ? void 0 : _u.isDraggable) && /* @__PURE__ */ jsx2(
|
|
3932
3370
|
IconButton2,
|
|
3933
3371
|
{
|
|
3934
3372
|
component: "div",
|
|
@@ -3938,22 +3376,63 @@ function CallControls({ onDataChange }) {
|
|
|
3938
3376
|
},
|
|
3939
3377
|
onMouseDown: handleMouseDown,
|
|
3940
3378
|
onTouchStart: handleTouchStart,
|
|
3941
|
-
children: /* @__PURE__ */
|
|
3379
|
+
children: /* @__PURE__ */ jsx2(DragIndicator, {})
|
|
3942
3380
|
}
|
|
3943
3381
|
),
|
|
3944
|
-
((
|
|
3945
|
-
/* @__PURE__ */
|
|
3382
|
+
((_v = state.sdkConfig) == null ? void 0 : _v.enableQueueName) && ((_w = state == null ? void 0 : state.callData) == null ? void 0 : _w.queue_name) && ((_x = state == null ? void 0 : state.callData) == null ? void 0 : _x.mode) !== "manual" && /* @__PURE__ */ jsx2(Chip, { label: (_y = state == null ? void 0 : state.callData) == null ? void 0 : _y.queue_name }),
|
|
3383
|
+
/* @__PURE__ */ jsx2(Tooltip2, { title: ((_z = state.sdkConfig) == null ? void 0 : _z.disabledDialButton) ? "Outbound call feature is disabled" : "Dial", children: /* @__PURE__ */ jsx2(Box2, { component: "span", sx: isVertical ? { display: "block" } : {}, children: isVertical ? /* @__PURE__ */ jsx2(
|
|
3384
|
+
Button2,
|
|
3385
|
+
{
|
|
3386
|
+
variant: "outlined",
|
|
3387
|
+
startIcon: /* @__PURE__ */ jsx2(WifiCalling3, {}),
|
|
3388
|
+
onClick: (e) => {
|
|
3389
|
+
var _a2, _b2, _c2;
|
|
3390
|
+
if (![
|
|
3391
|
+
"BREAK" /* BREAK */,
|
|
3392
|
+
"ONCALL" /* ONCALL */,
|
|
3393
|
+
"RINGING" /* RINGING */,
|
|
3394
|
+
"WRAPUP" /* WRAPUP */
|
|
3395
|
+
].includes((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()) && !((_c2 = state.sdkConfig) == null ? void 0 : _c2.disabledDialButton)) {
|
|
3396
|
+
handleOpenDialer(e);
|
|
3397
|
+
}
|
|
3398
|
+
},
|
|
3399
|
+
disabled: [
|
|
3400
|
+
"BREAK" /* BREAK */,
|
|
3401
|
+
"ONCALL" /* ONCALL */,
|
|
3402
|
+
"RINGING" /* RINGING */,
|
|
3403
|
+
"WRAPUP" /* WRAPUP */
|
|
3404
|
+
].includes((_A = state.callData.status) == null ? void 0 : _A.toUpperCase()) || ((_B = state.sdkConfig) == null ? void 0 : _B.disabledDialButton),
|
|
3405
|
+
sx: {
|
|
3406
|
+
justifyContent: "flex-start",
|
|
3407
|
+
width: "100%",
|
|
3408
|
+
px: 2,
|
|
3409
|
+
color: [
|
|
3410
|
+
"BREAK" /* BREAK */,
|
|
3411
|
+
"ONCALL" /* ONCALL */,
|
|
3412
|
+
"RINGING" /* RINGING */,
|
|
3413
|
+
"WRAPUP" /* WRAPUP */
|
|
3414
|
+
].includes((_C = state.callData.status) == null ? void 0 : _C.toUpperCase()) || ((_D = state.sdkConfig) == null ? void 0 : _D.disabledDialButton) ? "action.selected" : "success.main",
|
|
3415
|
+
borderColor: [
|
|
3416
|
+
"BREAK" /* BREAK */,
|
|
3417
|
+
"ONCALL" /* ONCALL */,
|
|
3418
|
+
"RINGING" /* RINGING */,
|
|
3419
|
+
"WRAPUP" /* WRAPUP */
|
|
3420
|
+
].includes((_E = state.callData.status) == null ? void 0 : _E.toUpperCase()) || ((_F = state.sdkConfig) == null ? void 0 : _F.disabledDialButton) ? "action.selected" : "success.main"
|
|
3421
|
+
},
|
|
3422
|
+
children: "Dial"
|
|
3423
|
+
}
|
|
3424
|
+
) : /* @__PURE__ */ jsx2(
|
|
3946
3425
|
IconButton2,
|
|
3947
3426
|
{
|
|
3948
3427
|
size: "small",
|
|
3949
3428
|
onClick: (e) => {
|
|
3950
|
-
var
|
|
3429
|
+
var _a2, _b2, _c2;
|
|
3951
3430
|
if (![
|
|
3952
3431
|
"BREAK" /* BREAK */,
|
|
3953
3432
|
"ONCALL" /* ONCALL */,
|
|
3954
3433
|
"RINGING" /* RINGING */,
|
|
3955
3434
|
"WRAPUP" /* WRAPUP */
|
|
3956
|
-
].includes((_b2 = (
|
|
3435
|
+
].includes((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()) && !((_c2 = state.sdkConfig) == null ? void 0 : _c2.disabledDialButton)) {
|
|
3957
3436
|
handleOpenDialer(e);
|
|
3958
3437
|
}
|
|
3959
3438
|
},
|
|
@@ -3962,8 +3441,8 @@ function CallControls({ onDataChange }) {
|
|
|
3962
3441
|
"ONCALL" /* ONCALL */,
|
|
3963
3442
|
"RINGING" /* RINGING */,
|
|
3964
3443
|
"WRAPUP" /* WRAPUP */
|
|
3965
|
-
].includes((
|
|
3966
|
-
children: /* @__PURE__ */
|
|
3444
|
+
].includes((_G = state.callData.status) == null ? void 0 : _G.toUpperCase()) || ((_H = state.sdkConfig) == null ? void 0 : _H.disabledDialButton),
|
|
3445
|
+
children: /* @__PURE__ */ jsx2(
|
|
3967
3446
|
WifiCalling3,
|
|
3968
3447
|
{
|
|
3969
3448
|
sx: {
|
|
@@ -3972,13 +3451,13 @@ function CallControls({ onDataChange }) {
|
|
|
3972
3451
|
"ONCALL" /* ONCALL */,
|
|
3973
3452
|
"RINGING" /* RINGING */,
|
|
3974
3453
|
"WRAPUP" /* WRAPUP */
|
|
3975
|
-
].includes((
|
|
3454
|
+
].includes((_I = state.callData.status) == null ? void 0 : _I.toUpperCase()) || ((_J = state.sdkConfig) == null ? void 0 : _J.disabledDialButton) ? "action.selected" : "success.main"
|
|
3976
3455
|
}
|
|
3977
3456
|
}
|
|
3978
3457
|
)
|
|
3979
3458
|
}
|
|
3980
3459
|
) }) }),
|
|
3981
|
-
/* @__PURE__ */
|
|
3460
|
+
/* @__PURE__ */ jsxs2(
|
|
3982
3461
|
Box2,
|
|
3983
3462
|
{
|
|
3984
3463
|
onClick: () => setShowIframe(true),
|
|
@@ -3991,7 +3470,7 @@ function CallControls({ onDataChange }) {
|
|
|
3991
3470
|
marginRight: "10px"
|
|
3992
3471
|
},
|
|
3993
3472
|
children: [
|
|
3994
|
-
/* @__PURE__ */
|
|
3473
|
+
/* @__PURE__ */ jsx2(
|
|
3995
3474
|
Typography2,
|
|
3996
3475
|
{
|
|
3997
3476
|
sx: {
|
|
@@ -4003,7 +3482,7 @@ function CallControls({ onDataChange }) {
|
|
|
4003
3482
|
children: state.callData.status === "WRAPUP" /* WRAPUP */ && callWrapuptime !== null ? formatDuration(callWrapuptime) : formatDuration(callDuration)
|
|
4004
3483
|
}
|
|
4005
3484
|
),
|
|
4006
|
-
isOnHold && /* @__PURE__ */
|
|
3485
|
+
isOnHold && /* @__PURE__ */ jsxs2(
|
|
4007
3486
|
Box2,
|
|
4008
3487
|
{
|
|
4009
3488
|
sx: {
|
|
@@ -4018,8 +3497,8 @@ function CallControls({ onDataChange }) {
|
|
|
4018
3497
|
mt: "2px"
|
|
4019
3498
|
},
|
|
4020
3499
|
children: [
|
|
4021
|
-
/* @__PURE__ */
|
|
4022
|
-
/* @__PURE__ */
|
|
3500
|
+
/* @__PURE__ */ jsx2(Pause2, { sx: { fontSize: "11px" } }),
|
|
3501
|
+
/* @__PURE__ */ jsx2(
|
|
4023
3502
|
Typography2,
|
|
4024
3503
|
{
|
|
4025
3504
|
sx: {
|
|
@@ -4033,7 +3512,7 @@ function CallControls({ onDataChange }) {
|
|
|
4033
3512
|
]
|
|
4034
3513
|
}
|
|
4035
3514
|
),
|
|
4036
|
-
isMuted && !isOnHold && /* @__PURE__ */
|
|
3515
|
+
isMuted && !isOnHold && /* @__PURE__ */ jsxs2(
|
|
4037
3516
|
Box2,
|
|
4038
3517
|
{
|
|
4039
3518
|
sx: {
|
|
@@ -4048,8 +3527,8 @@ function CallControls({ onDataChange }) {
|
|
|
4048
3527
|
mt: "2px"
|
|
4049
3528
|
},
|
|
4050
3529
|
children: [
|
|
4051
|
-
/* @__PURE__ */
|
|
4052
|
-
/* @__PURE__ */
|
|
3530
|
+
/* @__PURE__ */ jsx2(MicOff, { sx: { fontSize: "11px" } }),
|
|
3531
|
+
/* @__PURE__ */ jsx2(
|
|
4053
3532
|
Typography2,
|
|
4054
3533
|
{
|
|
4055
3534
|
sx: {
|
|
@@ -4066,11 +3545,11 @@ function CallControls({ onDataChange }) {
|
|
|
4066
3545
|
]
|
|
4067
3546
|
}
|
|
4068
3547
|
),
|
|
4069
|
-
/* @__PURE__ */
|
|
3548
|
+
/* @__PURE__ */ jsx2(
|
|
4070
3549
|
Chip,
|
|
4071
3550
|
{
|
|
4072
3551
|
sx: { padding: "18px 0px" },
|
|
4073
|
-
label: isLoading || agentReadyLoading ? /* @__PURE__ */
|
|
3552
|
+
label: isLoading || agentReadyLoading ? /* @__PURE__ */ jsx2(
|
|
4074
3553
|
Box2,
|
|
4075
3554
|
{
|
|
4076
3555
|
sx: {
|
|
@@ -4080,9 +3559,9 @@ function CallControls({ onDataChange }) {
|
|
|
4080
3559
|
alignItems: "center",
|
|
4081
3560
|
justifyContent: "center"
|
|
4082
3561
|
},
|
|
4083
|
-
children: /* @__PURE__ */
|
|
3562
|
+
children: /* @__PURE__ */ jsx2(CircularProgress2, { size: "20px" })
|
|
4084
3563
|
}
|
|
4085
|
-
) : /* @__PURE__ */
|
|
3564
|
+
) : /* @__PURE__ */ jsx2(
|
|
4086
3565
|
Typography2,
|
|
4087
3566
|
{
|
|
4088
3567
|
variant: "body2",
|
|
@@ -4091,37 +3570,40 @@ function CallControls({ onDataChange }) {
|
|
|
4091
3570
|
width: "60px",
|
|
4092
3571
|
textAlign: "center"
|
|
4093
3572
|
},
|
|
4094
|
-
children: (
|
|
3573
|
+
children: (_M = (_L = (_K = state.callData) == null ? void 0 : _K.status) == null ? void 0 : _L.toUpperCase()) != null ? _M : "N/A"
|
|
4095
3574
|
}
|
|
4096
3575
|
),
|
|
4097
3576
|
onClick: handleOpenAgentStatus,
|
|
4098
|
-
deleteIcon: /* @__PURE__ */
|
|
3577
|
+
deleteIcon: /* @__PURE__ */ jsx2(KeyboardArrowDown, { color: "primary" }),
|
|
4099
3578
|
onDelete: handleOpenAgentStatus
|
|
4100
3579
|
}
|
|
4101
3580
|
)
|
|
4102
3581
|
]
|
|
4103
3582
|
}
|
|
4104
3583
|
),
|
|
4105
|
-
/* @__PURE__ */
|
|
3584
|
+
/* @__PURE__ */ jsxs2(
|
|
4106
3585
|
Box2,
|
|
4107
3586
|
{
|
|
4108
3587
|
sx: {
|
|
4109
3588
|
display: "flex",
|
|
3589
|
+
flexDirection: isVertical ? "column" : "row",
|
|
4110
3590
|
gap: 1,
|
|
4111
3591
|
justifyContent: "center",
|
|
4112
|
-
alignItems: "center"
|
|
3592
|
+
alignItems: isVertical ? "stretch" : "center",
|
|
3593
|
+
margin: isVertical ? "0px 8px 8px 8px" : "0px"
|
|
4113
3594
|
},
|
|
4114
3595
|
children: [
|
|
4115
|
-
/* @__PURE__ */
|
|
3596
|
+
/* @__PURE__ */ jsx2(Tooltip2, { title: "Agent Ready", children: /* @__PURE__ */ jsx2(
|
|
4116
3597
|
Button2,
|
|
4117
3598
|
{
|
|
4118
3599
|
variant: ["BREAK" /* BREAK */, "MISSED" /* MISSED */].includes(
|
|
4119
|
-
(
|
|
3600
|
+
(_O = (_N = state.callData) == null ? void 0 : _N.status) == null ? void 0 : _O.toUpperCase()
|
|
4120
3601
|
) ? "outlined" : "contained",
|
|
3602
|
+
startIcon: isVertical ? /* @__PURE__ */ jsx2(SupportAgent2, {}) : void 0,
|
|
4121
3603
|
onClick: (e) => {
|
|
4122
|
-
var
|
|
3604
|
+
var _a2, _b2;
|
|
4123
3605
|
if (["BREAK" /* BREAK */, "MISSED" /* MISSED */].includes(
|
|
4124
|
-
(_b2 = (
|
|
3606
|
+
(_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()
|
|
4125
3607
|
)) {
|
|
4126
3608
|
e.stopPropagation();
|
|
4127
3609
|
handleAgentReady();
|
|
@@ -4129,115 +3611,120 @@ function CallControls({ onDataChange }) {
|
|
|
4129
3611
|
},
|
|
4130
3612
|
classes: {
|
|
4131
3613
|
root: ["BREAK" /* BREAK */, "MISSED" /* MISSED */].includes(
|
|
4132
|
-
(
|
|
3614
|
+
(_Q = (_P = state.callData) == null ? void 0 : _P.status) == null ? void 0 : _Q.toUpperCase()
|
|
4133
3615
|
) ? "outlined" : "enabled"
|
|
4134
3616
|
},
|
|
4135
|
-
sx: __spreadValues({}, ["BREAK" /* BREAK */, "MISSED" /* MISSED */].includes(
|
|
4136
|
-
(
|
|
4137
|
-
) ? outlined : enabled),
|
|
3617
|
+
sx: __spreadValues(__spreadValues({}, ["BREAK" /* BREAK */, "MISSED" /* MISSED */].includes(
|
|
3618
|
+
(_S = (_R = state.callData) == null ? void 0 : _R.status) == null ? void 0 : _S.toUpperCase()
|
|
3619
|
+
) ? outlined : enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
4138
3620
|
disabled: agentReadyLoading,
|
|
4139
|
-
children: /* @__PURE__ */
|
|
3621
|
+
children: isVertical ? "Agent Ready" : /* @__PURE__ */ jsx2(SupportAgent2, {})
|
|
4140
3622
|
}
|
|
4141
3623
|
) }),
|
|
4142
|
-
/* @__PURE__ */
|
|
3624
|
+
/* @__PURE__ */ jsx2(Tooltip2, { title: ((_T = state.sdkConfig) == null ? void 0 : _T.disableHoldButton) ? "Hold feature is disabled" : ((_U = state.callData) == null ? void 0 : _U.hold) === 1 ? "Resume" : "Hold", children: /* @__PURE__ */ jsx2(Box2, { component: "span", sx: isVertical ? { display: "block" } : {}, children: /* @__PURE__ */ jsx2(
|
|
4143
3625
|
Button2,
|
|
4144
3626
|
{
|
|
4145
|
-
variant: ((
|
|
3627
|
+
variant: ((_V = state.callData) == null ? void 0 : _V.hold) === 1 && ((_X = (_W = state.callData) == null ? void 0 : _W.status) == null ? void 0 : _X.toUpperCase()) === "ONCALL" /* ONCALL */ ? "contained" : "outlined",
|
|
3628
|
+
startIcon: isVertical ? holdOrUnHoldLoading ? void 0 : ((_Y = state.callData) == null ? void 0 : _Y.hold) === 1 ? /* @__PURE__ */ jsx2(PlayArrow2, {}) : /* @__PURE__ */ jsx2(Pause2, {}) : void 0,
|
|
4146
3629
|
onClick: (e) => {
|
|
4147
|
-
var
|
|
3630
|
+
var _a2;
|
|
4148
3631
|
e.stopPropagation();
|
|
4149
|
-
if (!((
|
|
3632
|
+
if (!((_a2 = state.sdkConfig) == null ? void 0 : _a2.disableHoldButton)) {
|
|
4150
3633
|
handleHoldToggle();
|
|
4151
3634
|
}
|
|
4152
3635
|
},
|
|
4153
|
-
sx: ((
|
|
4154
|
-
disabled: ((
|
|
4155
|
-
children: holdOrUnHoldLoading ? /* @__PURE__ */
|
|
3636
|
+
sx: ((_Z = state.callData) == null ? void 0 : _Z.hold) === 1 && ((_$ = (__ = state.callData) == null ? void 0 : __.status) == null ? void 0 : _$.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ((_ba = (_aa = state.callData) == null ? void 0 : _aa.status) == null ? void 0 : _ba.toUpperCase()) === "ONCALL" /* ONCALL */ && !((_ca = state.sdkConfig) == null ? void 0 : _ca.disableHoldButton) ? __spreadValues(__spreadValues({}, outlined), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : __spreadValues(__spreadValues({}, disabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
3637
|
+
disabled: ((_ea = (_da = state.callData) == null ? void 0 : _da.status) == null ? void 0 : _ea.toUpperCase()) !== "ONCALL" /* ONCALL */ && ((_fa = state.callData) == null ? void 0 : _fa.hold) !== 1 || holdOrUnHoldLoading || ((_ga = state.sdkConfig) == null ? void 0 : _ga.disableHoldButton),
|
|
3638
|
+
children: holdOrUnHoldLoading ? /* @__PURE__ */ jsx2(
|
|
4156
3639
|
CircularProgress2,
|
|
4157
3640
|
{
|
|
4158
3641
|
size: "20px",
|
|
4159
3642
|
sx: { color: theme.palette.primary.main }
|
|
4160
3643
|
}
|
|
4161
|
-
) : ((
|
|
3644
|
+
) : isVertical ? ((_ha = state.callData) == null ? void 0 : _ha.hold) === 1 ? "Resume" : "Hold" : ((_ia = state.callData) == null ? void 0 : _ia.hold) === 1 ? /* @__PURE__ */ jsx2(PlayArrow2, {}) : /* @__PURE__ */ jsx2(Pause2, {})
|
|
4162
3645
|
}
|
|
4163
3646
|
) }) }),
|
|
4164
|
-
/* @__PURE__ */
|
|
3647
|
+
/* @__PURE__ */ jsx2(Tooltip2, { title: ((_ja = state.sdkConfig) == null ? void 0 : _ja.disableMuteButton) ? "Mute feature is disabled" : ((_ka = state.callData) == null ? void 0 : _ka.mute) === 1 ? "Unmute" : "Mute", children: /* @__PURE__ */ jsx2(Box2, { component: "span", sx: isVertical ? { display: "block" } : {}, children: /* @__PURE__ */ jsx2(
|
|
4165
3648
|
Button2,
|
|
4166
3649
|
{
|
|
4167
|
-
variant: ((
|
|
3650
|
+
variant: ((_la = state.callData) == null ? void 0 : _la.mute) === 1 && ((_na = (_ma = state.callData) == null ? void 0 : _ma.status) == null ? void 0 : _na.toUpperCase()) === "ONCALL" /* ONCALL */ ? "contained" : "outlined",
|
|
3651
|
+
startIcon: isVertical ? muteOrUnMuteLoading ? void 0 : ((_oa = state.callData) == null ? void 0 : _oa.mute) === 1 ? /* @__PURE__ */ jsx2(MicOff, {}) : /* @__PURE__ */ jsx2(Mic, {}) : void 0,
|
|
4168
3652
|
onClick: (e) => {
|
|
4169
|
-
var
|
|
3653
|
+
var _a2;
|
|
4170
3654
|
e.stopPropagation();
|
|
4171
|
-
if (!((
|
|
3655
|
+
if (!((_a2 = state.sdkConfig) == null ? void 0 : _a2.disableMuteButton)) {
|
|
4172
3656
|
handleMuteToggle();
|
|
4173
3657
|
}
|
|
4174
3658
|
},
|
|
4175
|
-
sx: ((
|
|
4176
|
-
disabled: ((
|
|
4177
|
-
children: muteOrUnMuteLoading ? /* @__PURE__ */
|
|
3659
|
+
sx: ((_pa = state.sdkConfig) == null ? void 0 : _pa.disableMuteButton) || ((_qa = state.callData) == null ? void 0 : _qa.hold) === 1 ? __spreadValues(__spreadValues({}, disabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ((_ra = state.callData) == null ? void 0 : _ra.mute) === 1 && ((_ta = (_sa = state.callData) == null ? void 0 : _sa.status) == null ? void 0 : _ta.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ((_va = (_ua = state.callData) == null ? void 0 : _ua.status) == null ? void 0 : _va.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues(__spreadValues({}, outlined), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : __spreadValues(__spreadValues({}, disabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
3660
|
+
disabled: ((_xa = (_wa = state.callData) == null ? void 0 : _wa.status) == null ? void 0 : _xa.toUpperCase()) !== "ONCALL" /* ONCALL */ && ((_ya = state.callData) == null ? void 0 : _ya.mute) !== 1 || muteOrUnMuteLoading || ((_za = state.callData) == null ? void 0 : _za.hold) === 1 || ((_Aa = state.sdkConfig) == null ? void 0 : _Aa.disableMuteButton),
|
|
3661
|
+
children: muteOrUnMuteLoading ? /* @__PURE__ */ jsx2(
|
|
4178
3662
|
CircularProgress2,
|
|
4179
3663
|
{
|
|
4180
3664
|
size: "20px",
|
|
4181
3665
|
sx: { color: theme.palette.primary.main }
|
|
4182
3666
|
}
|
|
4183
|
-
) : ((
|
|
3667
|
+
) : isVertical ? ((_Ba = state.callData) == null ? void 0 : _Ba.mute) === 1 ? "Unmute" : "Mute" : ((_Ca = state.callData) == null ? void 0 : _Ca.mute) === 1 ? /* @__PURE__ */ jsx2(MicOff, {}) : /* @__PURE__ */ jsx2(Mic, {})
|
|
4184
3668
|
}
|
|
4185
3669
|
) }) }),
|
|
4186
|
-
/* @__PURE__ */
|
|
3670
|
+
/* @__PURE__ */ jsx2(Tooltip2, { title: ((_Da = state.sdkConfig) == null ? void 0 : _Da.disableCallTransferButton) ? "Transfer Call feature is disabled" : "Transfer Call", children: /* @__PURE__ */ jsx2(Box2, { component: "span", sx: isVertical ? { display: "block" } : {}, children: /* @__PURE__ */ jsx2(
|
|
4187
3671
|
Button2,
|
|
4188
3672
|
{
|
|
4189
3673
|
variant: state.openCallTransferDialog ? "contained" : "outlined",
|
|
3674
|
+
startIcon: isVertical ? /* @__PURE__ */ jsx2(TransferWithinAStation2, {}) : void 0,
|
|
4190
3675
|
onClick: (e) => {
|
|
4191
|
-
var
|
|
4192
|
-
if (((_b2 = (
|
|
3676
|
+
var _a2, _b2, _c2;
|
|
3677
|
+
if (((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()) === "ONCALL" /* ONCALL */ && !((_c2 = state.sdkConfig) == null ? void 0 : _c2.disableCallTransferButton)) {
|
|
4193
3678
|
e.stopPropagation();
|
|
4194
3679
|
sdkStateManager.setOpenCallTransferDialog(true);
|
|
4195
3680
|
}
|
|
4196
3681
|
},
|
|
4197
|
-
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((
|
|
4198
|
-
disabled: ((
|
|
4199
|
-
children: /* @__PURE__ */
|
|
3682
|
+
sx: state.openCallTransferDialog ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ((_Fa = (_Ea = state.callData) == null ? void 0 : _Ea.status) == null ? void 0 : _Fa.toUpperCase()) === "ONCALL" /* ONCALL */ && !((_Ga = state.sdkConfig) == null ? void 0 : _Ga.disableCallTransferButton) ? __spreadValues(__spreadValues({}, outlined), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : __spreadValues(__spreadValues({}, disabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
3683
|
+
disabled: ((_Ia = (_Ha = state.callData) == null ? void 0 : _Ha.status) == null ? void 0 : _Ia.toUpperCase()) !== "ONCALL" /* ONCALL */ || ((_Ja = state.sdkConfig) == null ? void 0 : _Ja.disableCallTransferButton),
|
|
3684
|
+
children: isVertical ? "Transfer" : /* @__PURE__ */ jsx2(TransferWithinAStation2, {})
|
|
4200
3685
|
}
|
|
4201
3686
|
) }) }),
|
|
4202
|
-
/* @__PURE__ */
|
|
3687
|
+
/* @__PURE__ */ jsx2(Tooltip2, { title: ((_Ka = state.sdkConfig) == null ? void 0 : _Ka.disableConferenceButton) ? "Conference Call feature is disabled" : "Conference Call", children: /* @__PURE__ */ jsx2(Box2, { component: "span", sx: isVertical ? { display: "block" } : {}, children: /* @__PURE__ */ jsx2(
|
|
4203
3688
|
Button2,
|
|
4204
3689
|
{
|
|
4205
3690
|
variant: state.openConferenceDialog ? "contained" : "outlined",
|
|
3691
|
+
startIcon: isVertical ? /* @__PURE__ */ jsx2(Group, {}) : void 0,
|
|
4206
3692
|
onClick: (e) => {
|
|
4207
|
-
var
|
|
4208
|
-
if (((_b2 = (
|
|
3693
|
+
var _a2, _b2, _c2;
|
|
3694
|
+
if (((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()) === "ONCALL" /* ONCALL */ && !((_c2 = state.sdkConfig) == null ? void 0 : _c2.disableConferenceButton)) {
|
|
4209
3695
|
e.stopPropagation();
|
|
4210
3696
|
sdkStateManager.setOpenConferenceDialog(true);
|
|
4211
3697
|
}
|
|
4212
3698
|
},
|
|
4213
|
-
sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((
|
|
4214
|
-
disabled: ((
|
|
4215
|
-
children: /* @__PURE__ */
|
|
3699
|
+
sx: state.openConferenceDialog ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ((_Ma = (_La = state.callData) == null ? void 0 : _La.status) == null ? void 0 : _Ma.toUpperCase()) === "ONCALL" /* ONCALL */ && !((_Na = state.sdkConfig) == null ? void 0 : _Na.disableConferenceButton) ? __spreadValues(__spreadValues({}, outlined), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : __spreadValues(__spreadValues({}, disabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
3700
|
+
disabled: ((_Pa = (_Oa = state.callData) == null ? void 0 : _Oa.status) == null ? void 0 : _Pa.toUpperCase()) !== "ONCALL" /* ONCALL */ || ((_Qa = state.sdkConfig) == null ? void 0 : _Qa.disableConferenceButton),
|
|
3701
|
+
children: isVertical ? "Conference" : /* @__PURE__ */ jsx2(Group, {})
|
|
4216
3702
|
}
|
|
4217
3703
|
) }) }),
|
|
4218
|
-
((
|
|
3704
|
+
((_Ra = state.sdkConfig) == null ? void 0 : _Ra.enableSmsServices) && /* @__PURE__ */ jsx2(Tooltip2, { title: "Send SMS", children: /* @__PURE__ */ jsx2(
|
|
4219
3705
|
Button2,
|
|
4220
3706
|
{
|
|
4221
3707
|
variant: Boolean(ambulanceAnchorEl) ? "contained" : "outlined",
|
|
3708
|
+
startIcon: isVertical ? /* @__PURE__ */ jsx2(SmsSharp, {}) : void 0,
|
|
4222
3709
|
onClick: (e) => {
|
|
4223
|
-
var
|
|
3710
|
+
var _a2, _b2;
|
|
4224
3711
|
if (["ONCALL" /* ONCALL */, "WRAPUP" /* WRAPUP */].includes(
|
|
4225
|
-
(_b2 = (
|
|
3712
|
+
(_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()
|
|
4226
3713
|
)) {
|
|
4227
3714
|
e.stopPropagation();
|
|
4228
3715
|
handleOpenAbulanceServices(e);
|
|
4229
3716
|
}
|
|
4230
3717
|
},
|
|
4231
|
-
sx: Boolean(ambulanceAnchorEl) ? __spreadValues({}, enabled) : ["ONCALL" /* ONCALL */, "WRAPUP" /* WRAPUP */].includes(
|
|
4232
|
-
(
|
|
4233
|
-
) ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3718
|
+
sx: Boolean(ambulanceAnchorEl) ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : ["ONCALL" /* ONCALL */, "WRAPUP" /* WRAPUP */].includes(
|
|
3719
|
+
(_Ta = (_Sa = state.callData) == null ? void 0 : _Sa.status) == null ? void 0 : _Ta.toUpperCase()
|
|
3720
|
+
) ? __spreadValues(__spreadValues({}, outlined), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : __spreadValues(__spreadValues({}, disabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
4234
3721
|
disabled: !["ONCALL" /* ONCALL */, "WRAPUP" /* WRAPUP */].includes(
|
|
4235
|
-
(
|
|
3722
|
+
(_Va = (_Ua = state.callData) == null ? void 0 : _Ua.status) == null ? void 0 : _Va.toUpperCase()
|
|
4236
3723
|
),
|
|
4237
|
-
children: /* @__PURE__ */
|
|
3724
|
+
children: isVertical ? "Send SMS" : /* @__PURE__ */ jsx2(SmsSharp, {})
|
|
4238
3725
|
}
|
|
4239
3726
|
) }),
|
|
4240
|
-
/* @__PURE__ */
|
|
3727
|
+
/* @__PURE__ */ jsx2(Tooltip2, { title: ((_Wa = state.sdkConfig) == null ? void 0 : _Wa.disableEndCallButton) ? "End Call feature is disabled" : "End Call", children: /* @__PURE__ */ jsx2(Box2, { component: "span", sx: isVertical ? { display: "block" } : {}, children: /* @__PURE__ */ jsx2(
|
|
4241
3728
|
Button2,
|
|
4242
3729
|
{
|
|
4243
3730
|
variant: [
|
|
@@ -4245,15 +3732,16 @@ function CallControls({ onDataChange }) {
|
|
|
4245
3732
|
"RINGING" /* RINGING */,
|
|
4246
3733
|
"DIALING" /* DIALING */,
|
|
4247
3734
|
"WRAPUP" /* WRAPUP */
|
|
4248
|
-
].includes((
|
|
3735
|
+
].includes((_Ya = (_Xa = state.callData) == null ? void 0 : _Xa.status) == null ? void 0 : _Ya.toUpperCase()) && !((_Za = state.sdkConfig) == null ? void 0 : _Za.disableEndCallButton) ? "contained" : "outlined",
|
|
3736
|
+
startIcon: isVertical && !endCallLoading ? /* @__PURE__ */ jsx2(CallEnd2, {}) : void 0,
|
|
4249
3737
|
onClick: (e) => {
|
|
4250
|
-
var
|
|
3738
|
+
var _a2, _b2, _c2;
|
|
4251
3739
|
if ([
|
|
4252
3740
|
"ONCALL" /* ONCALL */,
|
|
4253
3741
|
"RINGING" /* RINGING */,
|
|
4254
3742
|
"DIALING" /* DIALING */,
|
|
4255
3743
|
"WRAPUP" /* WRAPUP */
|
|
4256
|
-
].includes((_b2 = (
|
|
3744
|
+
].includes((_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()) && !((_c2 = state.sdkConfig) == null ? void 0 : _c2.disableEndCallButton)) {
|
|
4257
3745
|
e.stopPropagation();
|
|
4258
3746
|
setOpenCallDisposition(true);
|
|
4259
3747
|
}
|
|
@@ -4263,7 +3751,7 @@ function CallControls({ onDataChange }) {
|
|
|
4263
3751
|
"RINGING" /* RINGING */,
|
|
4264
3752
|
"DIALING" /* DIALING */,
|
|
4265
3753
|
"WRAPUP" /* WRAPUP */
|
|
4266
|
-
].includes((
|
|
3754
|
+
].includes((_$a = (__a = state.callData) == null ? void 0 : __a.status) == null ? void 0 : _$a.toUpperCase()) && !((_ab = state.sdkConfig) == null ? void 0 : _ab.disableEndCallButton) ? __spreadValues(__spreadProps(__spreadValues({}, enabled), {
|
|
4267
3755
|
borderRight: "1px",
|
|
4268
3756
|
backgroundColor: "error.main",
|
|
4269
3757
|
minWidth: "60px !important",
|
|
@@ -4279,36 +3767,37 @@ function CallControls({ onDataChange }) {
|
|
|
4279
3767
|
bgcolor: "error.light",
|
|
4280
3768
|
boxShadow: `inset 1px -2px 4px ${theme.palette.primary.light}`
|
|
4281
3769
|
}
|
|
4282
|
-
}) : __spreadProps(__spreadValues({}, disabled), {
|
|
3770
|
+
}), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : __spreadValues(__spreadProps(__spreadValues({}, disabled), {
|
|
4283
3771
|
minWidth: "60px !important"
|
|
4284
|
-
}),
|
|
3772
|
+
}), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
4285
3773
|
disabled: ![
|
|
4286
3774
|
"ONCALL" /* ONCALL */,
|
|
4287
3775
|
"RINGING" /* RINGING */,
|
|
4288
3776
|
"DIALING" /* DIALING */,
|
|
4289
3777
|
"WRAPUP" /* WRAPUP */
|
|
4290
|
-
].includes((
|
|
4291
|
-
children: endCallLoading ? /* @__PURE__ */
|
|
3778
|
+
].includes((_cb = (_bb = state.callData) == null ? void 0 : _bb.status) == null ? void 0 : _cb.toUpperCase()) || endCallLoading || ((_db = state.sdkConfig) == null ? void 0 : _db.disableEndCallButton),
|
|
3779
|
+
children: endCallLoading ? /* @__PURE__ */ jsx2(CircularProgress2, { size: "20px", color: "error" }) : isVertical ? "End Call" : /* @__PURE__ */ jsx2(CallEnd2, {})
|
|
4292
3780
|
}
|
|
4293
3781
|
) }) }),
|
|
4294
|
-
!((
|
|
3782
|
+
!((_eb = state.sdkConfig) == null ? void 0 : _eb.disabledMoreOptionsButton) && processList && (processList == null ? void 0 : processList.length) > 1 && /* @__PURE__ */ jsx2(Tooltip2, { title: "Switch Process", children: /* @__PURE__ */ jsx2(
|
|
4295
3783
|
Button2,
|
|
4296
3784
|
{
|
|
4297
3785
|
variant: Boolean(moreOptionsAnchorEl) ? "contained" : "outlined",
|
|
3786
|
+
startIcon: isVertical ? /* @__PURE__ */ jsx2(MoreVert, {}) : void 0,
|
|
4298
3787
|
onClick: (e) => {
|
|
4299
|
-
var
|
|
3788
|
+
var _a2, _b2;
|
|
4300
3789
|
if (["BREAK" /* BREAK */, "IDLE" /* IDLE */].includes(
|
|
4301
|
-
(_b2 = (
|
|
3790
|
+
(_b2 = (_a2 = state.callData) == null ? void 0 : _a2.status) == null ? void 0 : _b2.toUpperCase()
|
|
4302
3791
|
)) {
|
|
4303
3792
|
e.stopPropagation();
|
|
4304
3793
|
handleOpenMoreOptions(e);
|
|
4305
3794
|
}
|
|
4306
3795
|
},
|
|
4307
|
-
sx: Boolean(moreOptionsAnchorEl) ? __spreadValues({}, enabled) : __spreadValues({}, outlined),
|
|
3796
|
+
sx: Boolean(moreOptionsAnchorEl) ? __spreadValues(__spreadValues({}, enabled), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }) : __spreadValues(__spreadValues({}, outlined), isVertical && { justifyContent: "flex-start", width: "100%", px: 2 }),
|
|
4308
3797
|
disabled: !["BREAK" /* BREAK */, "IDLE" /* IDLE */].includes(
|
|
4309
|
-
(
|
|
3798
|
+
(_gb = (_fb = state.callData) == null ? void 0 : _fb.status) == null ? void 0 : _gb.toUpperCase()
|
|
4310
3799
|
),
|
|
4311
|
-
children: /* @__PURE__ */
|
|
3800
|
+
children: isVertical ? "Switch Process" : /* @__PURE__ */ jsx2(MoreVert, {})
|
|
4312
3801
|
}
|
|
4313
3802
|
) })
|
|
4314
3803
|
]
|
|
@@ -4319,12 +3808,12 @@ function CallControls({ onDataChange }) {
|
|
|
4319
3808
|
)
|
|
4320
3809
|
}
|
|
4321
3810
|
) }) }),
|
|
4322
|
-
/* @__PURE__ */
|
|
3811
|
+
/* @__PURE__ */ jsx2(
|
|
4323
3812
|
Fade,
|
|
4324
3813
|
{
|
|
4325
3814
|
in: true,
|
|
4326
3815
|
timeout: 300,
|
|
4327
|
-
children: /* @__PURE__ */
|
|
3816
|
+
children: /* @__PURE__ */ jsxs2(
|
|
4328
3817
|
Paper2,
|
|
4329
3818
|
{
|
|
4330
3819
|
ref: iframeDragRef,
|
|
@@ -4339,11 +3828,11 @@ function CallControls({ onDataChange }) {
|
|
|
4339
3828
|
transition: theme.transitions.create(["box-shadow", "transform"], {
|
|
4340
3829
|
duration: theme.transitions.duration.short
|
|
4341
3830
|
}),
|
|
4342
|
-
visibility: showIframe && !((
|
|
3831
|
+
visibility: showIframe && !((_hb = state.sdkConfig) == null ? void 0 : _hb.disableSoftPhone) ? "visible" : "hidden",
|
|
4343
3832
|
userSelect: "none"
|
|
4344
3833
|
},
|
|
4345
3834
|
children: [
|
|
4346
|
-
/* @__PURE__ */
|
|
3835
|
+
/* @__PURE__ */ jsxs2(
|
|
4347
3836
|
Box2,
|
|
4348
3837
|
{
|
|
4349
3838
|
sx: {
|
|
@@ -4356,7 +3845,7 @@ function CallControls({ onDataChange }) {
|
|
|
4356
3845
|
onMouseDown: iframeHandleMouseDown,
|
|
4357
3846
|
onTouchStart: iframeHandleTouchStart,
|
|
4358
3847
|
children: [
|
|
4359
|
-
/* @__PURE__ */
|
|
3848
|
+
/* @__PURE__ */ jsx2(
|
|
4360
3849
|
DragIndicator,
|
|
4361
3850
|
{
|
|
4362
3851
|
sx: {
|
|
@@ -4366,15 +3855,15 @@ function CallControls({ onDataChange }) {
|
|
|
4366
3855
|
}
|
|
4367
3856
|
),
|
|
4368
3857
|
" ",
|
|
4369
|
-
/* @__PURE__ */
|
|
4370
|
-
/* @__PURE__ */
|
|
3858
|
+
/* @__PURE__ */ jsx2(Typography2, { variant: "subtitle1", fontWeight: 600, textAlign: "center", children: "ahs-cti" }),
|
|
3859
|
+
/* @__PURE__ */ jsx2(IconButton2, { onClick: () => setShowIframe(false), children: /* @__PURE__ */ jsx2(Close2, {}) })
|
|
4371
3860
|
]
|
|
4372
3861
|
}
|
|
4373
3862
|
),
|
|
4374
|
-
/* @__PURE__ */
|
|
3863
|
+
/* @__PURE__ */ jsx2(Box2, { children: /* @__PURE__ */ jsx2(
|
|
4375
3864
|
"iframe",
|
|
4376
3865
|
{
|
|
4377
|
-
src: `${(
|
|
3866
|
+
src: `${(_ib = state.urlConfig) == null ? void 0 : _ib.iframeURL}/static/phone/index.html?user_id=${(_jb = state.urlConfig) == null ? void 0 : _jb.id}&api_url=${(_kb = state.urlConfig) == null ? void 0 : _kb.iframeAPIURL}&token=${(_lb = state.authorization) == null ? void 0 : _lb.accessToken}`,
|
|
4378
3867
|
height: 380,
|
|
4379
3868
|
width: 420,
|
|
4380
3869
|
allow: "camera; microphone; autoplay",
|
|
@@ -4388,8 +3877,8 @@ function CallControls({ onDataChange }) {
|
|
|
4388
3877
|
)
|
|
4389
3878
|
}
|
|
4390
3879
|
),
|
|
4391
|
-
/* @__PURE__ */
|
|
4392
|
-
|
|
3880
|
+
/* @__PURE__ */ jsx2(
|
|
3881
|
+
Menu2,
|
|
4393
3882
|
{
|
|
4394
3883
|
anchorEl: dialerAnchorEl,
|
|
4395
3884
|
open: Boolean(dialerAnchorEl),
|
|
@@ -4398,7 +3887,7 @@ function CallControls({ onDataChange }) {
|
|
|
4398
3887
|
sx: {
|
|
4399
3888
|
zIndex: 99999
|
|
4400
3889
|
},
|
|
4401
|
-
children: /* @__PURE__ */
|
|
3890
|
+
children: /* @__PURE__ */ jsxs2(
|
|
4402
3891
|
Box2,
|
|
4403
3892
|
{
|
|
4404
3893
|
sx: {
|
|
@@ -4409,7 +3898,7 @@ function CallControls({ onDataChange }) {
|
|
|
4409
3898
|
}
|
|
4410
3899
|
},
|
|
4411
3900
|
children: [
|
|
4412
|
-
/* @__PURE__ */
|
|
3901
|
+
/* @__PURE__ */ jsx2(
|
|
4413
3902
|
TextField2,
|
|
4414
3903
|
{
|
|
4415
3904
|
size: "small",
|
|
@@ -4426,14 +3915,14 @@ function CallControls({ onDataChange }) {
|
|
|
4426
3915
|
}
|
|
4427
3916
|
}
|
|
4428
3917
|
),
|
|
4429
|
-
/* @__PURE__ */
|
|
3918
|
+
/* @__PURE__ */ jsx2(
|
|
4430
3919
|
IconButton2,
|
|
4431
3920
|
{
|
|
4432
3921
|
color: "info",
|
|
4433
3922
|
onClick: () => {
|
|
4434
3923
|
handleStartCall(phoneNumber);
|
|
4435
3924
|
},
|
|
4436
|
-
children: clickToCallLoading ? /* @__PURE__ */
|
|
3925
|
+
children: clickToCallLoading ? /* @__PURE__ */ jsx2(
|
|
4437
3926
|
CircularProgress2,
|
|
4438
3927
|
{
|
|
4439
3928
|
size: "20px",
|
|
@@ -4441,7 +3930,7 @@ function CallControls({ onDataChange }) {
|
|
|
4441
3930
|
color: theme.palette.success.main
|
|
4442
3931
|
}
|
|
4443
3932
|
}
|
|
4444
|
-
) : /* @__PURE__ */
|
|
3933
|
+
) : /* @__PURE__ */ jsx2(Phone, { color: "success" })
|
|
4445
3934
|
}
|
|
4446
3935
|
)
|
|
4447
3936
|
]
|
|
@@ -4449,8 +3938,8 @@ function CallControls({ onDataChange }) {
|
|
|
4449
3938
|
)
|
|
4450
3939
|
}
|
|
4451
3940
|
),
|
|
4452
|
-
/* @__PURE__ */
|
|
4453
|
-
|
|
3941
|
+
/* @__PURE__ */ jsx2(
|
|
3942
|
+
Menu2,
|
|
4454
3943
|
{
|
|
4455
3944
|
anchorEl: ambulanceAnchorEl,
|
|
4456
3945
|
open: Boolean(ambulanceAnchorEl),
|
|
@@ -4459,7 +3948,7 @@ function CallControls({ onDataChange }) {
|
|
|
4459
3948
|
sx: {
|
|
4460
3949
|
zIndex: 99999
|
|
4461
3950
|
},
|
|
4462
|
-
children: /* @__PURE__ */
|
|
3951
|
+
children: /* @__PURE__ */ jsx2(
|
|
4463
3952
|
Box2,
|
|
4464
3953
|
{
|
|
4465
3954
|
sx: {
|
|
@@ -4471,7 +3960,7 @@ function CallControls({ onDataChange }) {
|
|
|
4471
3960
|
display: "flex",
|
|
4472
3961
|
alignItems: "center"
|
|
4473
3962
|
},
|
|
4474
|
-
children: /* @__PURE__ */
|
|
3963
|
+
children: /* @__PURE__ */ jsx2(Tooltip2, { title: "Ambulance Service", children: /* @__PURE__ */ jsxs2(
|
|
4475
3964
|
Button2,
|
|
4476
3965
|
{
|
|
4477
3966
|
color: "primary",
|
|
@@ -4481,7 +3970,7 @@ function CallControls({ onDataChange }) {
|
|
|
4481
3970
|
},
|
|
4482
3971
|
children: [
|
|
4483
3972
|
"Ambulance",
|
|
4484
|
-
/* @__PURE__ */
|
|
3973
|
+
/* @__PURE__ */ jsxs2(
|
|
4485
3974
|
Box2,
|
|
4486
3975
|
{
|
|
4487
3976
|
sx: {
|
|
@@ -4495,7 +3984,7 @@ function CallControls({ onDataChange }) {
|
|
|
4495
3984
|
},
|
|
4496
3985
|
children: [
|
|
4497
3986
|
"Send",
|
|
4498
|
-
/* @__PURE__ */
|
|
3987
|
+
/* @__PURE__ */ jsx2(
|
|
4499
3988
|
SendRounded,
|
|
4500
3989
|
{
|
|
4501
3990
|
sx: {
|
|
@@ -4515,8 +4004,8 @@ function CallControls({ onDataChange }) {
|
|
|
4515
4004
|
)
|
|
4516
4005
|
}
|
|
4517
4006
|
),
|
|
4518
|
-
/* @__PURE__ */
|
|
4519
|
-
|
|
4007
|
+
/* @__PURE__ */ jsx2(
|
|
4008
|
+
Menu2,
|
|
4520
4009
|
{
|
|
4521
4010
|
anchorEl: moreOptionsAnchorEl,
|
|
4522
4011
|
open: Boolean(moreOptionsAnchorEl),
|
|
@@ -4525,7 +4014,7 @@ function CallControls({ onDataChange }) {
|
|
|
4525
4014
|
sx: {
|
|
4526
4015
|
zIndex: 99999
|
|
4527
4016
|
},
|
|
4528
|
-
children: /* @__PURE__ */
|
|
4017
|
+
children: /* @__PURE__ */ jsx2(
|
|
4529
4018
|
Box2,
|
|
4530
4019
|
{
|
|
4531
4020
|
sx: {
|
|
@@ -4540,14 +4029,14 @@ function CallControls({ onDataChange }) {
|
|
|
4540
4029
|
gap: 1
|
|
4541
4030
|
},
|
|
4542
4031
|
children: processList == null ? void 0 : processList.map((item) => {
|
|
4543
|
-
var
|
|
4544
|
-
return /* @__PURE__ */
|
|
4032
|
+
var _a2, _b2, _c2;
|
|
4033
|
+
return /* @__PURE__ */ jsx2(
|
|
4545
4034
|
Box2,
|
|
4546
4035
|
{
|
|
4547
4036
|
sx: {
|
|
4548
4037
|
width: "100%"
|
|
4549
4038
|
},
|
|
4550
|
-
children: /* @__PURE__ */
|
|
4039
|
+
children: /* @__PURE__ */ jsx2(Tooltip2, { title: (_a2 = item == null ? void 0 : item.process_name) != null ? _a2 : "", children: /* @__PURE__ */ jsx2(
|
|
4551
4040
|
Button2,
|
|
4552
4041
|
{
|
|
4553
4042
|
color: "primary",
|
|
@@ -4569,8 +4058,8 @@ function CallControls({ onDataChange }) {
|
|
|
4569
4058
|
)
|
|
4570
4059
|
}
|
|
4571
4060
|
),
|
|
4572
|
-
/* @__PURE__ */
|
|
4573
|
-
|
|
4061
|
+
/* @__PURE__ */ jsx2(
|
|
4062
|
+
Menu2,
|
|
4574
4063
|
{
|
|
4575
4064
|
anchorEl: statusAnchorEl,
|
|
4576
4065
|
open: Boolean(statusAnchorEl),
|
|
@@ -4579,14 +4068,14 @@ function CallControls({ onDataChange }) {
|
|
|
4579
4068
|
sx: {
|
|
4580
4069
|
zIndex: 99999
|
|
4581
4070
|
},
|
|
4582
|
-
children: !breaksList || (breaksList == null ? void 0 : breaksList.length) === 0 ? /* @__PURE__ */
|
|
4583
|
-
var
|
|
4584
|
-
return /* @__PURE__ */
|
|
4585
|
-
|
|
4071
|
+
children: !breaksList || (breaksList == null ? void 0 : breaksList.length) === 0 ? /* @__PURE__ */ jsx2(MenuItem2, { onClick: () => handleUpdateAgentStatus("Lunch"), children: "- Break" }) : breaksList == null ? void 0 : breaksList.map((item) => {
|
|
4072
|
+
var _a2, _b2, _c2;
|
|
4073
|
+
return /* @__PURE__ */ jsxs2(
|
|
4074
|
+
MenuItem2,
|
|
4586
4075
|
{
|
|
4587
4076
|
sx: {
|
|
4588
4077
|
// hilight background of selected
|
|
4589
|
-
backgroundColor: ((
|
|
4078
|
+
backgroundColor: ((_a2 = state == null ? void 0 : state.callData) == null ? void 0 : _a2.status) === "BREAK" && (state == null ? void 0 : state.agentStatus) === (item == null ? void 0 : item.type) ? "primary.main" : "transparent",
|
|
4590
4079
|
color: ((_b2 = state == null ? void 0 : state.callData) == null ? void 0 : _b2.status) === "BREAK" && (state == null ? void 0 : state.agentStatus) === (item == null ? void 0 : item.type) ? "white" : "primary.main",
|
|
4591
4080
|
":hover": {
|
|
4592
4081
|
backgroundColor: ((_c2 = state == null ? void 0 : state.callData) == null ? void 0 : _c2.status) === "BREAK" && (state == null ? void 0 : state.agentStatus) === (item == null ? void 0 : item.type) ? "primary.dark" : "selected.hover"
|
|
@@ -4607,8 +4096,8 @@ function CallControls({ onDataChange }) {
|
|
|
4607
4096
|
})
|
|
4608
4097
|
}
|
|
4609
4098
|
),
|
|
4610
|
-
/* @__PURE__ */
|
|
4611
|
-
|
|
4099
|
+
/* @__PURE__ */ jsx2(
|
|
4100
|
+
Menu2,
|
|
4612
4101
|
{
|
|
4613
4102
|
anchorEl,
|
|
4614
4103
|
open: Boolean(anchorEl),
|
|
@@ -4617,7 +4106,7 @@ function CallControls({ onDataChange }) {
|
|
|
4617
4106
|
sx: {
|
|
4618
4107
|
zIndex: 99999
|
|
4619
4108
|
},
|
|
4620
|
-
children: /* @__PURE__ */
|
|
4109
|
+
children: /* @__PURE__ */ jsxs2(
|
|
4621
4110
|
Box2,
|
|
4622
4111
|
{
|
|
4623
4112
|
sx: {
|
|
@@ -4630,10 +4119,10 @@ function CallControls({ onDataChange }) {
|
|
|
4630
4119
|
}
|
|
4631
4120
|
},
|
|
4632
4121
|
children: [
|
|
4633
|
-
/* @__PURE__ */
|
|
4122
|
+
/* @__PURE__ */ jsx2(
|
|
4634
4123
|
Chip,
|
|
4635
4124
|
{
|
|
4636
|
-
icon: /* @__PURE__ */
|
|
4125
|
+
icon: /* @__PURE__ */ jsx2(Layers, { color: "secondary" }),
|
|
4637
4126
|
variant: "outlined",
|
|
4638
4127
|
label: "Waiting - 25",
|
|
4639
4128
|
sx: {
|
|
@@ -4641,10 +4130,10 @@ function CallControls({ onDataChange }) {
|
|
|
4641
4130
|
}
|
|
4642
4131
|
}
|
|
4643
4132
|
),
|
|
4644
|
-
/* @__PURE__ */
|
|
4133
|
+
/* @__PURE__ */ jsx2(
|
|
4645
4134
|
Chip,
|
|
4646
4135
|
{
|
|
4647
|
-
icon: /* @__PURE__ */
|
|
4136
|
+
icon: /* @__PURE__ */ jsx2(Pending, { color: "info" }),
|
|
4648
4137
|
label: "Pending - 99+",
|
|
4649
4138
|
variant: "outlined",
|
|
4650
4139
|
sx: {
|
|
@@ -4652,10 +4141,10 @@ function CallControls({ onDataChange }) {
|
|
|
4652
4141
|
}
|
|
4653
4142
|
}
|
|
4654
4143
|
),
|
|
4655
|
-
/* @__PURE__ */
|
|
4144
|
+
/* @__PURE__ */ jsx2(
|
|
4656
4145
|
Chip,
|
|
4657
4146
|
{
|
|
4658
|
-
icon: /* @__PURE__ */
|
|
4147
|
+
icon: /* @__PURE__ */ jsx2(Upcoming2, { color: "success" }),
|
|
4659
4148
|
variant: "outlined",
|
|
4660
4149
|
label: "Upcoming - 66",
|
|
4661
4150
|
sx: {
|
|
@@ -4668,9 +4157,9 @@ function CallControls({ onDataChange }) {
|
|
|
4668
4157
|
)
|
|
4669
4158
|
}
|
|
4670
4159
|
),
|
|
4671
|
-
Boolean(state.openConferenceDialog) && /* @__PURE__ */
|
|
4672
|
-
Boolean(state.openCallTransferDialog) && /* @__PURE__ */
|
|
4673
|
-
Boolean(openCallDisposition) && /* @__PURE__ */
|
|
4160
|
+
Boolean(state.openConferenceDialog) && /* @__PURE__ */ jsx2(ConferenceDialog, {}),
|
|
4161
|
+
Boolean(state.openCallTransferDialog) && /* @__PURE__ */ jsx2(CallTransferDialog, { open: state.openCallTransferDialog }),
|
|
4162
|
+
Boolean(openCallDisposition) && /* @__PURE__ */ jsx2(
|
|
4674
4163
|
EndCallDispositionDialog,
|
|
4675
4164
|
{
|
|
4676
4165
|
open: openCallDisposition,
|
|
@@ -4678,7 +4167,7 @@ function CallControls({ onDataChange }) {
|
|
|
4678
4167
|
onSubmitDisposition: handleEndCall
|
|
4679
4168
|
}
|
|
4680
4169
|
),
|
|
4681
|
-
Boolean(openCallHistoryDialog) && /* @__PURE__ */
|
|
4170
|
+
Boolean(openCallHistoryDialog) && /* @__PURE__ */ jsx2(
|
|
4682
4171
|
CallHistoryDialog,
|
|
4683
4172
|
{
|
|
4684
4173
|
open: openCallHistoryDialog,
|
|
@@ -4688,18 +4177,12 @@ function CallControls({ onDataChange }) {
|
|
|
4688
4177
|
] });
|
|
4689
4178
|
}
|
|
4690
4179
|
|
|
4691
|
-
// call-control-sdk/lib/components/SDKProvider.tsx
|
|
4692
|
-
import { memo } from "react";
|
|
4693
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
4694
|
-
var SDKProvider = memo(({ children }) => {
|
|
4695
|
-
return /* @__PURE__ */ jsx4(ToastProvider, { children });
|
|
4696
|
-
});
|
|
4697
|
-
SDKProvider.displayName = "SDKProvider";
|
|
4698
|
-
|
|
4699
4180
|
// call-control-sdk/lib/components/callControlPanel.tsx
|
|
4700
|
-
import { jsx as
|
|
4701
|
-
var CallControlPanel =
|
|
4702
|
-
|
|
4181
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
4182
|
+
var CallControlPanel = memo(({ onDataChange }) => {
|
|
4183
|
+
var _a;
|
|
4184
|
+
const { sdk } = useSDKState();
|
|
4185
|
+
const handleDataChange = useCallback7(
|
|
4703
4186
|
(data) => {
|
|
4704
4187
|
try {
|
|
4705
4188
|
if (onDataChange && typeof onDataChange === "function") {
|
|
@@ -4711,10 +4194,342 @@ var CallControlPanel = memo2(({ onDataChange }) => {
|
|
|
4711
4194
|
},
|
|
4712
4195
|
[onDataChange]
|
|
4713
4196
|
);
|
|
4714
|
-
|
|
4197
|
+
const sdkObject = sdk == null ? void 0 : sdk.calls;
|
|
4198
|
+
const hasDialerAccess = (sdkObject == null ? void 0 : sdkObject.enabled) && ((_a = sdkObject == null ? void 0 : sdkObject.items) == null ? void 0 : _a.some(
|
|
4199
|
+
(item) => item.code === SDK_PERMISSIONS.CALL_OUTBOUND || item.code === SDK_PERMISSIONS.CALL_INBOUND
|
|
4200
|
+
));
|
|
4201
|
+
if (!hasDialerAccess) return null;
|
|
4202
|
+
return /* @__PURE__ */ jsx3(SDKProvider, { children: /* @__PURE__ */ jsx3(CallControls, { onDataChange: handleDataChange }) });
|
|
4715
4203
|
});
|
|
4716
4204
|
CallControlPanel.displayName = "CallControlPanel";
|
|
4717
4205
|
|
|
4206
|
+
// call-control-sdk/lib/pages/sdkPages.tsx
|
|
4207
|
+
import React3 from "react";
|
|
4208
|
+
|
|
4209
|
+
// call-control-sdk/lib/hooks/useSDKPermissions.ts
|
|
4210
|
+
import { useState as useState11, useEffect as useEffect6, useCallback as useCallback8 } from "react";
|
|
4211
|
+
function useSDKPermissions() {
|
|
4212
|
+
var _a, _b;
|
|
4213
|
+
const [state, setState] = useState11(() => sdkStateManager.getState());
|
|
4214
|
+
useEffect6(() => {
|
|
4215
|
+
const unsubscribe = sdkStateManager.subscribe(() => {
|
|
4216
|
+
setState(sdkStateManager.getState());
|
|
4217
|
+
});
|
|
4218
|
+
return unsubscribe;
|
|
4219
|
+
}, []);
|
|
4220
|
+
const hasPermission = useCallback8(
|
|
4221
|
+
(permission) => sdkStateManager.hasPermission(permission),
|
|
4222
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4223
|
+
[state.userPermissions]
|
|
4224
|
+
);
|
|
4225
|
+
const hasAnyPermission = useCallback8(
|
|
4226
|
+
(permissions) => sdkStateManager.hasAnyPermission(permissions),
|
|
4227
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4228
|
+
[state.userPermissions]
|
|
4229
|
+
);
|
|
4230
|
+
const hasAllPermissions = useCallback8(
|
|
4231
|
+
(permissions) => sdkStateManager.hasAllPermissions(permissions),
|
|
4232
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4233
|
+
[state.userPermissions]
|
|
4234
|
+
);
|
|
4235
|
+
const hasMenuFeature = useCallback8(
|
|
4236
|
+
(code) => sdkStateManager.hasMenuFeature(code),
|
|
4237
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4238
|
+
[state.menuEntitlements]
|
|
4239
|
+
);
|
|
4240
|
+
return {
|
|
4241
|
+
permissions: (_a = state.userPermissions) != null ? _a : [],
|
|
4242
|
+
menuEntitlements: (_b = state.menuEntitlements) != null ? _b : [],
|
|
4243
|
+
isLoaded: state.isPermissionsLoaded,
|
|
4244
|
+
hasPermission,
|
|
4245
|
+
hasAnyPermission,
|
|
4246
|
+
hasAllPermissions,
|
|
4247
|
+
hasMenuFeature
|
|
4248
|
+
};
|
|
4249
|
+
}
|
|
4250
|
+
|
|
4251
|
+
// call-control-sdk/lib/components/SDKAccessDenied.tsx
|
|
4252
|
+
import { Box as Box3, Typography as Typography3 } from "@mui/material";
|
|
4253
|
+
import LockOutlinedIcon from "@mui/icons-material/LockOutlined";
|
|
4254
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
4255
|
+
var SDKAccessDenied = ({
|
|
4256
|
+
message = "You don't have permission to view this page."
|
|
4257
|
+
}) => /* @__PURE__ */ jsxs3(
|
|
4258
|
+
Box3,
|
|
4259
|
+
{
|
|
4260
|
+
display: "flex",
|
|
4261
|
+
flexDirection: "column",
|
|
4262
|
+
alignItems: "center",
|
|
4263
|
+
justifyContent: "center",
|
|
4264
|
+
minHeight: 300,
|
|
4265
|
+
gap: 2,
|
|
4266
|
+
p: 4,
|
|
4267
|
+
children: [
|
|
4268
|
+
/* @__PURE__ */ jsx4(LockOutlinedIcon, { sx: { fontSize: 56, color: "text.disabled" } }),
|
|
4269
|
+
/* @__PURE__ */ jsx4(Typography3, { variant: "h6", fontWeight: 600, color: "text.secondary", children: "Access Denied" }),
|
|
4270
|
+
/* @__PURE__ */ jsx4(Typography3, { variant: "body2", color: "text.disabled", textAlign: "center", children: message })
|
|
4271
|
+
]
|
|
4272
|
+
}
|
|
4273
|
+
);
|
|
4274
|
+
|
|
4275
|
+
// call-control-sdk/lib/components/SDKPermissionGuard.tsx
|
|
4276
|
+
import { Fragment as Fragment3, jsx as jsx5 } from "react/jsx-runtime";
|
|
4277
|
+
var SDKPermissionGuard = ({
|
|
4278
|
+
children,
|
|
4279
|
+
permission,
|
|
4280
|
+
permissions,
|
|
4281
|
+
requireAll = false,
|
|
4282
|
+
menuFeature,
|
|
4283
|
+
requireAllMenus = false,
|
|
4284
|
+
fallback,
|
|
4285
|
+
showFallback = true,
|
|
4286
|
+
onDenied
|
|
4287
|
+
}) => {
|
|
4288
|
+
const { isLoaded, hasPermission, hasAnyPermission, hasAllPermissions, hasMenuFeature } = useSDKPermissions();
|
|
4289
|
+
if (!isLoaded) return null;
|
|
4290
|
+
const isAllowed = checkAccess({
|
|
4291
|
+
permission,
|
|
4292
|
+
permissions,
|
|
4293
|
+
requireAll,
|
|
4294
|
+
menuFeature,
|
|
4295
|
+
requireAllMenus,
|
|
4296
|
+
hasPermission,
|
|
4297
|
+
hasAnyPermission,
|
|
4298
|
+
hasAllPermissions,
|
|
4299
|
+
hasMenuFeature
|
|
4300
|
+
});
|
|
4301
|
+
if (!isAllowed) {
|
|
4302
|
+
onDenied == null ? void 0 : onDenied();
|
|
4303
|
+
if (fallback !== void 0) return /* @__PURE__ */ jsx5(Fragment3, { children: fallback });
|
|
4304
|
+
if (showFallback) return /* @__PURE__ */ jsx5(SDKAccessDenied, {});
|
|
4305
|
+
return null;
|
|
4306
|
+
}
|
|
4307
|
+
return /* @__PURE__ */ jsx5(Fragment3, { children });
|
|
4308
|
+
};
|
|
4309
|
+
function checkAccess({
|
|
4310
|
+
permission,
|
|
4311
|
+
permissions,
|
|
4312
|
+
requireAll,
|
|
4313
|
+
menuFeature,
|
|
4314
|
+
requireAllMenus,
|
|
4315
|
+
hasPermission,
|
|
4316
|
+
hasAnyPermission,
|
|
4317
|
+
hasAllPermissions,
|
|
4318
|
+
hasMenuFeature
|
|
4319
|
+
}) {
|
|
4320
|
+
const menuCodes = menuFeature ? Array.isArray(menuFeature) ? menuFeature : [menuFeature] : [];
|
|
4321
|
+
const hasNoGuards = !permission && (!permissions || permissions.length === 0) && menuCodes.length === 0;
|
|
4322
|
+
if (hasNoGuards) return true;
|
|
4323
|
+
if (menuCodes.length > 0) {
|
|
4324
|
+
const menuGranted = requireAllMenus ? menuCodes.every((c) => hasMenuFeature(c)) : menuCodes.some((c) => hasMenuFeature(c));
|
|
4325
|
+
if (!menuGranted) return false;
|
|
4326
|
+
}
|
|
4327
|
+
if (permission && !hasPermission(permission)) return false;
|
|
4328
|
+
if (permissions && permissions.length > 0) {
|
|
4329
|
+
const granted = requireAll ? hasAllPermissions(permissions) : hasAnyPermission(permissions);
|
|
4330
|
+
if (!granted) return false;
|
|
4331
|
+
}
|
|
4332
|
+
return true;
|
|
4333
|
+
}
|
|
4334
|
+
|
|
4335
|
+
// call-control-sdk/lib/pages/sdkPages.tsx
|
|
4336
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
4337
|
+
function withGuard(menuCodes, loader) {
|
|
4338
|
+
return React3.lazy(async () => {
|
|
4339
|
+
const mod = await loader();
|
|
4340
|
+
const Page = mod.default;
|
|
4341
|
+
const Guarded = (props) => /* @__PURE__ */ jsx6(SDKPermissionGuard, { menuFeature: menuCodes, children: /* @__PURE__ */ jsx6(Page, __spreadValues({}, props)) });
|
|
4342
|
+
return { default: Guarded };
|
|
4343
|
+
});
|
|
4344
|
+
}
|
|
4345
|
+
var SDKPages = {
|
|
4346
|
+
CallHistory: withGuard(SDK_MENU_CODES.CALL_HISTORY, () => import("./callHistory-TZ7SSXSN.mjs"))
|
|
4347
|
+
};
|
|
4348
|
+
|
|
4349
|
+
// call-control-sdk/lib/hooks/useClickToConference.ts
|
|
4350
|
+
import { useCallback as useCallback9, useEffect as useEffect7, useRef as useRef3, useState as useState12 } from "react";
|
|
4351
|
+
import { getSession as getSession4 } from "@react-solutions/vault";
|
|
4352
|
+
var useClickToConference = () => {
|
|
4353
|
+
const [loading, setLoading] = useState12(false);
|
|
4354
|
+
const [success, setSuccess] = useState12(false);
|
|
4355
|
+
const [isError, setIsError] = useState12(false);
|
|
4356
|
+
const [error, setError] = useState12(null);
|
|
4357
|
+
const [data, setData] = useState12(null);
|
|
4358
|
+
const pendingLineRef = useRef3(null);
|
|
4359
|
+
const prevConferenceRef = useRef3([]);
|
|
4360
|
+
useEffect7(() => {
|
|
4361
|
+
if (pendingLineRef.current === null) return;
|
|
4362
|
+
const unsubscribe = sdkStateManager.subscribe(() => {
|
|
4363
|
+
var _a;
|
|
4364
|
+
const state = sdkStateManager.getState();
|
|
4365
|
+
const targetLine = pendingLineRef.current;
|
|
4366
|
+
if (targetLine === null) return;
|
|
4367
|
+
const line = (_a = state.conferenceLine) == null ? void 0 : _a.find(
|
|
4368
|
+
(l) => l.line === targetLine
|
|
4369
|
+
);
|
|
4370
|
+
if (line && line.status !== "IDLE") {
|
|
4371
|
+
pendingLineRef.current = null;
|
|
4372
|
+
prevConferenceRef.current = [];
|
|
4373
|
+
sdkStateManager.setOpenConferenceDialog(true);
|
|
4374
|
+
}
|
|
4375
|
+
});
|
|
4376
|
+
return unsubscribe;
|
|
4377
|
+
}, [loading]);
|
|
4378
|
+
const handleStartConferenceCall = useCallback9(
|
|
4379
|
+
async (payload) => {
|
|
4380
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4381
|
+
const state = getSession4(STORAGE_KEY);
|
|
4382
|
+
if (((_a = state == null ? void 0 : state.callData) == null ? void 0 : _a.status) !== "ONCALL") {
|
|
4383
|
+
const msg = "Conference call requires an active call (ONCALL status)";
|
|
4384
|
+
setIsError(true);
|
|
4385
|
+
setError(new Error(msg));
|
|
4386
|
+
throw new Error(msg);
|
|
4387
|
+
}
|
|
4388
|
+
const availableLine = payload.lineNumber != null ? (_b = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _b.find(
|
|
4389
|
+
(l) => l.line === payload.lineNumber
|
|
4390
|
+
) : (_d = (_c = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _c.filter((l) => l.line !== 1)) == null ? void 0 : _d.find((l) => l.status === "IDLE" && !(l == null ? void 0 : l.isCallStart));
|
|
4391
|
+
if (!availableLine) {
|
|
4392
|
+
const msg = "No available conference line found";
|
|
4393
|
+
setIsError(true);
|
|
4394
|
+
setError(new Error(msg));
|
|
4395
|
+
throw new Error(msg);
|
|
4396
|
+
}
|
|
4397
|
+
const requestPayload = {
|
|
4398
|
+
action: "EXTERNAL_CONFERENCE",
|
|
4399
|
+
operation: `CALL${availableLine.line}`,
|
|
4400
|
+
target: payload.mobileNumber,
|
|
4401
|
+
line_number: Number(availableLine.line),
|
|
4402
|
+
userid: (_f = (_e = state.callData) == null ? void 0 : _e.agent_id) != null ? _f : -1,
|
|
4403
|
+
process: (_h = (_g = state.callData) == null ? void 0 : _g.process_name) != null ? _h : ""
|
|
4404
|
+
};
|
|
4405
|
+
setLoading(true);
|
|
4406
|
+
setIsError(false);
|
|
4407
|
+
setError(null);
|
|
4408
|
+
setSuccess(false);
|
|
4409
|
+
pendingLineRef.current = availableLine.line;
|
|
4410
|
+
return axios_default.post(END_POINT.CONFERENCE_CALL, requestPayload).then((res) => {
|
|
4411
|
+
setData(res == null ? void 0 : res.data);
|
|
4412
|
+
setSuccess(true);
|
|
4413
|
+
return res == null ? void 0 : res.data;
|
|
4414
|
+
}).catch((err) => {
|
|
4415
|
+
var _a2;
|
|
4416
|
+
pendingLineRef.current = null;
|
|
4417
|
+
setIsError(true);
|
|
4418
|
+
setError(err);
|
|
4419
|
+
return (_a2 = err == null ? void 0 : err.response) == null ? void 0 : _a2.data;
|
|
4420
|
+
}).finally(() => {
|
|
4421
|
+
setLoading(false);
|
|
4422
|
+
});
|
|
4423
|
+
},
|
|
4424
|
+
[]
|
|
4425
|
+
);
|
|
4426
|
+
return {
|
|
4427
|
+
handleStartConferenceCall,
|
|
4428
|
+
isLoading: loading,
|
|
4429
|
+
isSuccess: success,
|
|
4430
|
+
isError,
|
|
4431
|
+
error,
|
|
4432
|
+
data
|
|
4433
|
+
};
|
|
4434
|
+
};
|
|
4435
|
+
|
|
4436
|
+
// call-control-sdk/lib/angular-services/index.ts
|
|
4437
|
+
import { getSession as getSession5, removeSession as removeSession2 } from "@react-solutions/vault";
|
|
4438
|
+
async function clickToCall(payload) {
|
|
4439
|
+
const state = getSession5(STORAGE_KEY);
|
|
4440
|
+
const body = {
|
|
4441
|
+
action: "CALL",
|
|
4442
|
+
userId: state == null ? void 0 : state.agentId,
|
|
4443
|
+
phone_number: payload.mobileNumber
|
|
4444
|
+
};
|
|
4445
|
+
try {
|
|
4446
|
+
const res = await axios_default.post(END_POINT.CLICK_TO_CALL, body);
|
|
4447
|
+
sdkStateManager.resetConferenceLines();
|
|
4448
|
+
if (!(res == null ? void 0 : res.success)) {
|
|
4449
|
+
throw res;
|
|
4450
|
+
}
|
|
4451
|
+
return res.data;
|
|
4452
|
+
} catch (err) {
|
|
4453
|
+
throw err;
|
|
4454
|
+
}
|
|
4455
|
+
}
|
|
4456
|
+
async function clickToConference(payload) {
|
|
4457
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
4458
|
+
const state = getSession5(STORAGE_KEY);
|
|
4459
|
+
const availableLine = payload.lineNumber != null ? (_a = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _a.find((l) => l.line === payload.lineNumber) : (_c = (_b = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _b.filter((l) => l.line !== 1)) == null ? void 0 : _c.find((l) => l.status === "IDLE" && !(l == null ? void 0 : l.isCallStart));
|
|
4460
|
+
if (!availableLine) {
|
|
4461
|
+
throw new Error("No available conference line found");
|
|
4462
|
+
}
|
|
4463
|
+
const body = {
|
|
4464
|
+
action: "EXTERNAL_CONFERENCE",
|
|
4465
|
+
operation: `CALL${availableLine.line}`,
|
|
4466
|
+
target: payload.mobileNumber,
|
|
4467
|
+
line_number: Number(availableLine.line),
|
|
4468
|
+
userid: (_e = (_d = state.callData) == null ? void 0 : _d.agent_id) != null ? _e : -1,
|
|
4469
|
+
process: (_g = (_f = state.callData) == null ? void 0 : _f.process_name) != null ? _g : ""
|
|
4470
|
+
};
|
|
4471
|
+
try {
|
|
4472
|
+
const res = await axios_default.post(END_POINT.CONFERENCE_CALL, body);
|
|
4473
|
+
sdkStateManager.setOpenConferenceDialog(true);
|
|
4474
|
+
if (!(res == null ? void 0 : res.success)) {
|
|
4475
|
+
throw res;
|
|
4476
|
+
}
|
|
4477
|
+
return res.data;
|
|
4478
|
+
} catch (err) {
|
|
4479
|
+
throw new Error((_j = (_i = (_h = err == null ? void 0 : err.response) == null ? void 0 : _h.data) == null ? void 0 : _i.message) != null ? _j : "Conference call API failed");
|
|
4480
|
+
}
|
|
4481
|
+
}
|
|
4482
|
+
async function endCall(options = {}) {
|
|
4483
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
4484
|
+
const state = getSession5(STORAGE_KEY);
|
|
4485
|
+
const body = {
|
|
4486
|
+
action: "ENDCALL",
|
|
4487
|
+
userId: state == null ? void 0 : state.agentId,
|
|
4488
|
+
processid: (_c = (_b = (_a = state == null ? void 0 : state.process) == null ? void 0 : _a.process_id) == null ? void 0 : _b.toString()) != null ? _c : "",
|
|
4489
|
+
process_name: (_e = (_d = state == null ? void 0 : state.process) == null ? void 0 : _d.process_name) != null ? _e : "",
|
|
4490
|
+
callreferenceid: (_g = (_f = state == null ? void 0 : state.callData) == null ? void 0 : _f.convox_id) != null ? _g : "",
|
|
4491
|
+
mobile_number: (_i = (_h = state == null ? void 0 : state.callData) == null ? void 0 : _h.phone_number) != null ? _i : "",
|
|
4492
|
+
disposition: (_j = options.disposition) != null ? _j : "RES",
|
|
4493
|
+
set_followUp: (_k = options.followUp) != null ? _k : "N",
|
|
4494
|
+
callback_date: (_l = options.callbackDate) != null ? _l : "",
|
|
4495
|
+
callback_hrs: (_m = options.callbackHrs) != null ? _m : "",
|
|
4496
|
+
callback_mins: (_n = options.callbackMins) != null ? _n : "",
|
|
4497
|
+
endcall_type: "CLOSE",
|
|
4498
|
+
patient_enquiry: (_o = options.patientLog) != null ? _o : null
|
|
4499
|
+
};
|
|
4500
|
+
const res = await axios_default.post(END_POINT.END_CALL, body, {
|
|
4501
|
+
params: { isBreak: (_p = options.isBreak) != null ? _p : false }
|
|
4502
|
+
});
|
|
4503
|
+
sdkStateManager.resetConferenceLines();
|
|
4504
|
+
sdkStateManager.endCall();
|
|
4505
|
+
return res.data;
|
|
4506
|
+
}
|
|
4507
|
+
async function logout() {
|
|
4508
|
+
var _a, _b;
|
|
4509
|
+
let logoutError;
|
|
4510
|
+
try {
|
|
4511
|
+
await axios_default.post(END_POINT.AUTH_LOGOUT);
|
|
4512
|
+
} catch (err) {
|
|
4513
|
+
logoutError = new Error(((_b = (_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || "Logout failed. Please try again.");
|
|
4514
|
+
} finally {
|
|
4515
|
+
sdkStateManager.clearStorageAndReset();
|
|
4516
|
+
removeSession2(STORAGE_KEY);
|
|
4517
|
+
}
|
|
4518
|
+
if (logoutError) throw logoutError;
|
|
4519
|
+
}
|
|
4520
|
+
async function startMonitoring(payload) {
|
|
4521
|
+
const res = await axios_default.post(END_POINT.SUPERVISOR_CALL_LISTEN, payload);
|
|
4522
|
+
return res.data;
|
|
4523
|
+
}
|
|
4524
|
+
async function stopMonitoring(payload) {
|
|
4525
|
+
const res = await axios_default.post(END_POINT.SUPERVISOR_CALL_LEAVE, payload);
|
|
4526
|
+
return res.data;
|
|
4527
|
+
}
|
|
4528
|
+
async function changeMonitorMode(payload) {
|
|
4529
|
+
const res = await axios_default.post(END_POINT.SUPERVISOR_CALL_CHANGE_MODE, payload);
|
|
4530
|
+
return res.data;
|
|
4531
|
+
}
|
|
4532
|
+
|
|
4718
4533
|
// call-control-sdk/index.ts
|
|
4719
4534
|
async function initSDK({
|
|
4720
4535
|
apiKey,
|
|
@@ -4754,7 +4569,8 @@ async function initSDK({
|
|
|
4754
4569
|
accessToken: initResult.accessToken,
|
|
4755
4570
|
expiration: initResult.expiration,
|
|
4756
4571
|
ticketId: initResult.ticketId,
|
|
4757
|
-
callControls: callcontrolConfig
|
|
4572
|
+
callControls: callcontrolConfig,
|
|
4573
|
+
userInfo: initResult.userInfo
|
|
4758
4574
|
};
|
|
4759
4575
|
console.info("SDK initialized successfully");
|
|
4760
4576
|
sdkStateManager.initialize(
|
|
@@ -4781,15 +4597,31 @@ function isSDKInitialized() {
|
|
|
4781
4597
|
}
|
|
4782
4598
|
export {
|
|
4783
4599
|
CallControlPanel,
|
|
4600
|
+
SDKAccessDenied,
|
|
4601
|
+
SDKPages,
|
|
4602
|
+
SDKPermissionGuard,
|
|
4603
|
+
SDK_MENU_CODES,
|
|
4784
4604
|
SDK_PERMISSIONS,
|
|
4605
|
+
SDK_WILDCARD,
|
|
4606
|
+
changeMonitorMode,
|
|
4607
|
+
clickToCall,
|
|
4608
|
+
clickToConference,
|
|
4609
|
+
endCall,
|
|
4785
4610
|
getSDKVersion,
|
|
4786
4611
|
initSDK,
|
|
4787
4612
|
isSDKInitialized,
|
|
4613
|
+
logout,
|
|
4614
|
+
sdkStateManager,
|
|
4615
|
+
startMonitoring,
|
|
4616
|
+
stopMonitoring,
|
|
4617
|
+
useCallMonitoring,
|
|
4788
4618
|
useClickToCall,
|
|
4619
|
+
useClickToConference,
|
|
4789
4620
|
useEndCall,
|
|
4790
4621
|
useGetAuthorizationToken,
|
|
4791
4622
|
useGetCallerData,
|
|
4792
4623
|
useLogout,
|
|
4624
|
+
useSDKPermissions,
|
|
4793
4625
|
useSDKState
|
|
4794
4626
|
};
|
|
4795
4627
|
//# sourceMappingURL=index.mjs.map
|