call-control-sdk 6.5.1-uat.6 → 6.5.2-uat.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +696 -476
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +754 -530
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -2
package/dist/index.js
CHANGED
|
@@ -60,6 +60,9 @@ __export(index_exports, {
|
|
|
60
60
|
});
|
|
61
61
|
module.exports = __toCommonJS(index_exports);
|
|
62
62
|
|
|
63
|
+
// call-control-sdk/lib/hooks/sdk-state.ts
|
|
64
|
+
var import_vault = require("@react-solutions/vault");
|
|
65
|
+
|
|
63
66
|
// call-control-sdk/lib/services/endPoint.ts
|
|
64
67
|
var IP = "uat-cti.aighospitals.com";
|
|
65
68
|
var BASE_URL = `https://${IP}:8095`;
|
|
@@ -89,7 +92,9 @@ var END_POINT = {
|
|
|
89
92
|
SEND_NOTIFICATIONS: `${BASE_URL}${VERSION.v1}/cti/notifications/send`,
|
|
90
93
|
CALL_HISTORY: `${BASE_URL}${VERSION.v1}/dashboard/call-history`,
|
|
91
94
|
SENTIMENTAL_ANALYSIS: `${BASE_URL}${VERSION.v1}/users/get_sentiment_analysis`,
|
|
92
|
-
DISPOSITIONS: `${BASE_URL}${VERSION.v1}/cti/calls/dispositions
|
|
95
|
+
DISPOSITIONS: `${BASE_URL}${VERSION.v1}/cti/calls/dispositions`,
|
|
96
|
+
HOSPITALS_SERVICES: `${BASE_URL}${VERSION.v1}/cti/hospital/services`,
|
|
97
|
+
BLIEND_TRANSFER: `${BASE_URL}${VERSION.v1}/cti/calls/blind_transfer?provider=convox`
|
|
93
98
|
};
|
|
94
99
|
var WS_END_POINT = {
|
|
95
100
|
WS: `${WS_BASE_URL}${VERSION.v1}/cti/ws`
|
|
@@ -129,9 +134,6 @@ var SDKStateManager = class {
|
|
|
129
134
|
enabled: {},
|
|
130
135
|
outlined: {}
|
|
131
136
|
},
|
|
132
|
-
isHolding: false,
|
|
133
|
-
isMuted: false,
|
|
134
|
-
status: "idle",
|
|
135
137
|
callStartTime: null,
|
|
136
138
|
controlPanelPosition: { x: 10, y: 10 },
|
|
137
139
|
iframePosition: { x: ((_a2 = window.screen) == null ? void 0 : _a2.availWidth) - 460, y: ((_b = window.screen) == null ? void 0 : _b.height) - 580 },
|
|
@@ -204,9 +206,9 @@ var SDKStateManager = class {
|
|
|
204
206
|
loadFromStorage() {
|
|
205
207
|
var _a2, _b;
|
|
206
208
|
try {
|
|
207
|
-
const stored =
|
|
209
|
+
const stored = (0, import_vault.getItem)(this.STORAGE_KEY);
|
|
208
210
|
if (stored) {
|
|
209
|
-
const parsedState =
|
|
211
|
+
const parsedState = stored;
|
|
210
212
|
this.state = __spreadProps(__spreadValues({}, this.state), {
|
|
211
213
|
agentId: parsedState.agentId || "",
|
|
212
214
|
authorization: parsedState.authorization || void 0,
|
|
@@ -227,9 +229,6 @@ var SDKStateManager = class {
|
|
|
227
229
|
enabled: {},
|
|
228
230
|
outlined: {}
|
|
229
231
|
},
|
|
230
|
-
isHolding: parsedState.isHolding || false,
|
|
231
|
-
isMuted: parsedState.isMuted || false,
|
|
232
|
-
status: parsedState.status || "idle",
|
|
233
232
|
callStartTime: parsedState.callStartTime || null,
|
|
234
233
|
controlPanelPosition: parsedState.controlPanelPosition || {
|
|
235
234
|
x: 10,
|
|
@@ -248,7 +247,6 @@ var SDKStateManager = class {
|
|
|
248
247
|
event_time: "",
|
|
249
248
|
phone_number: ""
|
|
250
249
|
},
|
|
251
|
-
// Fix: Properly handle conferenceLine with fallback to initial state
|
|
252
250
|
conferenceLine: parsedState.conferenceLine && Array.isArray(parsedState.conferenceLine) && parsedState.conferenceLine.length > 0 ? parsedState.conferenceLine : this.state.conferenceLine
|
|
253
251
|
});
|
|
254
252
|
}
|
|
@@ -266,16 +264,13 @@ var SDKStateManager = class {
|
|
|
266
264
|
openConferenceDialog: this.state.openConferenceDialog,
|
|
267
265
|
openCallTransferDialog: this.state.openCallTransferDialog,
|
|
268
266
|
sdkConfig: this.state.sdkConfig,
|
|
269
|
-
isHolding: this.state.isHolding,
|
|
270
|
-
isMuted: this.state.isMuted,
|
|
271
|
-
status: this.state.status,
|
|
272
267
|
callStartTime: this.state.callStartTime,
|
|
273
268
|
controlPanelPosition: this.state.controlPanelPosition,
|
|
274
269
|
iframePosition: this.state.iframePosition,
|
|
275
270
|
callData: this.state.callData,
|
|
276
271
|
conferenceLine: this.state.conferenceLine
|
|
277
272
|
};
|
|
278
|
-
|
|
273
|
+
(0, import_vault.setItem)(this.STORAGE_KEY, persistentState);
|
|
279
274
|
} catch (error) {
|
|
280
275
|
console.warn("Failed to save SDK state:", error);
|
|
281
276
|
}
|
|
@@ -339,21 +334,16 @@ var SDKStateManager = class {
|
|
|
339
334
|
}
|
|
340
335
|
};
|
|
341
336
|
}
|
|
342
|
-
setHolding(isHolding) {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
347
|
-
setMuted(isMuted) {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
}
|
|
352
|
-
setStatus(status) {
|
|
353
|
-
this.state.status = status;
|
|
354
|
-
this.saveToStorage();
|
|
355
|
-
this.notifyListeners();
|
|
356
|
-
}
|
|
337
|
+
// public setHolding(isHolding: boolean): void {
|
|
338
|
+
// this.state.isHolding = isHolding;
|
|
339
|
+
// this.saveToStorage();
|
|
340
|
+
// this.notifyListeners();
|
|
341
|
+
// }
|
|
342
|
+
// public setMuted(isMuted: boolean): void {
|
|
343
|
+
// this.state.isMuted = isMuted;
|
|
344
|
+
// this.saveToStorage();
|
|
345
|
+
// this.notifyListeners();
|
|
346
|
+
// }
|
|
357
347
|
setProcess(process) {
|
|
358
348
|
this.state.process = process;
|
|
359
349
|
this.saveToStorage();
|
|
@@ -371,15 +361,11 @@ var SDKStateManager = class {
|
|
|
371
361
|
}
|
|
372
362
|
startCall() {
|
|
373
363
|
this.state.callStartTime = Date.now();
|
|
374
|
-
this.state.status = "on call";
|
|
375
364
|
this.saveToStorage();
|
|
376
365
|
this.notifyListeners();
|
|
377
366
|
}
|
|
378
367
|
endCall() {
|
|
379
368
|
this.state.callStartTime = null;
|
|
380
|
-
this.state.status = "idle";
|
|
381
|
-
this.state.isHolding = false;
|
|
382
|
-
this.state.isMuted = false;
|
|
383
369
|
this.saveToStorage();
|
|
384
370
|
this.notifyListeners();
|
|
385
371
|
}
|
|
@@ -481,7 +467,7 @@ var SDKStateManager = class {
|
|
|
481
467
|
}
|
|
482
468
|
clearStorageAndReset() {
|
|
483
469
|
try {
|
|
484
|
-
|
|
470
|
+
(0, import_vault.removeItem)(this.STORAGE_KEY);
|
|
485
471
|
this.state = this.getInitialState();
|
|
486
472
|
this.notifyListeners();
|
|
487
473
|
} catch (error) {
|
|
@@ -646,6 +632,7 @@ var axiosInstance = createAxiosInstance();
|
|
|
646
632
|
var axios_default = axiosInstance;
|
|
647
633
|
|
|
648
634
|
// call-control-sdk/lib/hooks/useLogout.ts
|
|
635
|
+
var import_vault2 = require("@react-solutions/vault");
|
|
649
636
|
var useLogout = () => {
|
|
650
637
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
651
638
|
const [success, setSuccess] = (0, import_react.useState)(false);
|
|
@@ -653,8 +640,7 @@ var useLogout = () => {
|
|
|
653
640
|
const [error, setError] = (0, import_react.useState)(null);
|
|
654
641
|
const [data, setData] = (0, import_react.useState)(null);
|
|
655
642
|
const handleLogout = (0, import_react.useCallback)(async () => {
|
|
656
|
-
|
|
657
|
-
const state = JSON.parse((_a2 = localStorage.getItem(STORAGE_KEY)) != null ? _a2 : "");
|
|
643
|
+
const state = (0, import_vault2.getItem)(STORAGE_KEY);
|
|
658
644
|
setLoading(true);
|
|
659
645
|
const payload = {
|
|
660
646
|
action: "LOGOUTUSER",
|
|
@@ -662,16 +648,15 @@ var useLogout = () => {
|
|
|
662
648
|
};
|
|
663
649
|
return axios_default.post(END_POINT.LOGOUT, payload).then((res) => {
|
|
664
650
|
sdkStateManager.clearStorageAndReset();
|
|
665
|
-
|
|
666
|
-
sessionStorage.clear();
|
|
651
|
+
(0, import_vault2.removeItem)(STORAGE_KEY);
|
|
667
652
|
setData(res == null ? void 0 : res.data);
|
|
668
653
|
setSuccess(true);
|
|
669
654
|
return res == null ? void 0 : res.data;
|
|
670
655
|
}).catch((err) => {
|
|
671
|
-
var
|
|
656
|
+
var _a2;
|
|
672
657
|
setIsError(true);
|
|
673
658
|
setError(err);
|
|
674
|
-
return (
|
|
659
|
+
return (_a2 = err == null ? void 0 : err.response) == null ? void 0 : _a2.data;
|
|
675
660
|
}).finally(() => {
|
|
676
661
|
setLoading(false);
|
|
677
662
|
});
|
|
@@ -688,6 +673,7 @@ var useLogout = () => {
|
|
|
688
673
|
|
|
689
674
|
// call-control-sdk/lib/hooks/useEndCall.ts
|
|
690
675
|
var import_react2 = require("react");
|
|
676
|
+
var import_vault3 = require("@react-solutions/vault");
|
|
691
677
|
var useEndCall = () => {
|
|
692
678
|
const [loading, setLoading] = (0, import_react2.useState)(false);
|
|
693
679
|
const [success, setSuccess] = (0, import_react2.useState)(false);
|
|
@@ -696,26 +682,26 @@ var useEndCall = () => {
|
|
|
696
682
|
const [data, setData] = (0, import_react2.useState)(null);
|
|
697
683
|
const handleEndCall = (0, import_react2.useCallback)(
|
|
698
684
|
async (data2) => {
|
|
699
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o
|
|
700
|
-
const state =
|
|
685
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
686
|
+
const state = (0, import_vault3.getItem)(STORAGE_KEY);
|
|
701
687
|
setLoading(true);
|
|
702
688
|
const payload = {
|
|
703
689
|
action: "ENDCALL",
|
|
704
690
|
userId: state == null ? void 0 : state.agentId,
|
|
705
|
-
processid: (
|
|
706
|
-
process_name: (
|
|
707
|
-
callreferenceid: (
|
|
708
|
-
mobile_number: (
|
|
709
|
-
disposition: (
|
|
710
|
-
set_followUp: (
|
|
711
|
-
callback_date: (
|
|
712
|
-
callback_hrs: (
|
|
713
|
-
callback_mins: (
|
|
691
|
+
processid: (_c = (_b = (_a2 = state == null ? void 0 : state.process) == null ? void 0 : _a2.process_id) == null ? void 0 : _b.toString()) != null ? _c : "",
|
|
692
|
+
process_name: (_e = (_d = state == null ? void 0 : state.process) == null ? void 0 : _d.process_name) != null ? _e : "",
|
|
693
|
+
callreferenceid: (_g = (_f = state == null ? void 0 : state.callData) == null ? void 0 : _f.convox_id) != null ? _g : "",
|
|
694
|
+
mobile_number: (_i = (_h = state == null ? void 0 : state.callData) == null ? void 0 : _h.phone_number) != null ? _i : "",
|
|
695
|
+
disposition: (_j = data2 == null ? void 0 : data2.disposition) != null ? _j : "RES",
|
|
696
|
+
set_followUp: (_k = data2 == null ? void 0 : data2.followUp) != null ? _k : "N",
|
|
697
|
+
callback_date: (_l = data2 == null ? void 0 : data2.callbackDate) != null ? _l : "",
|
|
698
|
+
callback_hrs: (_m = data2 == null ? void 0 : data2.callbackHrs) != null ? _m : "",
|
|
699
|
+
callback_mins: (_n = data2 == null ? void 0 : data2.callbackMins) != null ? _n : "",
|
|
714
700
|
endcall_type: "CLOSE"
|
|
715
701
|
};
|
|
716
702
|
return axios_default.post(END_POINT.END_CALL, payload, {
|
|
717
703
|
params: {
|
|
718
|
-
isBreak: (
|
|
704
|
+
isBreak: (_o = data2 == null ? void 0 : data2.isBreak) != null ? _o : false
|
|
719
705
|
}
|
|
720
706
|
}).then((res) => {
|
|
721
707
|
sdkStateManager.resetConferenceLines();
|
|
@@ -746,6 +732,7 @@ var useEndCall = () => {
|
|
|
746
732
|
|
|
747
733
|
// call-control-sdk/lib/hooks/useClickToCall.ts
|
|
748
734
|
var import_react3 = require("react");
|
|
735
|
+
var import_vault4 = require("@react-solutions/vault");
|
|
749
736
|
var useClickToCall = () => {
|
|
750
737
|
const [loading, setLoading] = (0, import_react3.useState)(false);
|
|
751
738
|
const [success, setSuccess] = (0, import_react3.useState)(false);
|
|
@@ -753,10 +740,10 @@ var useClickToCall = () => {
|
|
|
753
740
|
const [error, setError] = (0, import_react3.useState)(null);
|
|
754
741
|
const [data, setData] = (0, import_react3.useState)(null);
|
|
755
742
|
const handleStartCall = (0, import_react3.useCallback)(async (data2) => {
|
|
756
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h
|
|
757
|
-
const state =
|
|
743
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
744
|
+
const state = (0, import_vault4.getItem)(STORAGE_KEY);
|
|
758
745
|
setLoading(true);
|
|
759
|
-
if (((
|
|
746
|
+
if (((_a2 = state == null ? void 0 : state.callData) == null ? void 0 : _a2.status) === "IDLE") {
|
|
760
747
|
const payload = {
|
|
761
748
|
action: "CALL",
|
|
762
749
|
userId: state == null ? void 0 : state.agentId,
|
|
@@ -775,15 +762,15 @@ var useClickToCall = () => {
|
|
|
775
762
|
}).finally(() => {
|
|
776
763
|
setLoading(false);
|
|
777
764
|
});
|
|
778
|
-
} else if (((
|
|
779
|
-
const line_used = (
|
|
765
|
+
} else if (((_b = state == null ? void 0 : state.callData) == null ? void 0 : _b.status) === "ONCALL") {
|
|
766
|
+
const line_used = (_d = (_c = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _c.filter((each) => each.line !== 1)) == null ? void 0 : _d.find((each) => each.status === "IDLE" && !(each == null ? void 0 : each.isCallStart));
|
|
780
767
|
const payload = {
|
|
781
768
|
action: "EXTERNAL_CONFERENCE",
|
|
782
769
|
operation: `CALL${line_used.line}`,
|
|
783
770
|
line_used: String(line_used.line),
|
|
784
771
|
thirdparty_no: data2 == null ? void 0 : data2.mobileNumber,
|
|
785
|
-
userid: (
|
|
786
|
-
process: (
|
|
772
|
+
userid: (_f = (_e = state.callData) == null ? void 0 : _e.agent_id) != null ? _f : "",
|
|
773
|
+
process: (_h = (_g = state.callData) == null ? void 0 : _g.process_name) != null ? _h : ""
|
|
787
774
|
};
|
|
788
775
|
return axios_default.post(END_POINT.CONFERENCE_CALL, payload).then((res) => {
|
|
789
776
|
setData(res == null ? void 0 : res.data);
|
|
@@ -864,101 +851,16 @@ var import_icons_material2 = require("@mui/icons-material");
|
|
|
864
851
|
var import_material4 = require("@mui/material");
|
|
865
852
|
var import_react11 = require("react");
|
|
866
853
|
|
|
867
|
-
// call-control-sdk/lib/
|
|
868
|
-
var
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
const [isDragging, setIsDragging] = (0, import_react6.useState)(false);
|
|
872
|
-
const dragRef = (0, import_react6.useRef)();
|
|
873
|
-
const dragStart = (0, import_react6.useRef)({ x: 0, y: 0 });
|
|
874
|
-
const elementStart = (0, import_react6.useRef)({ x: 0, y: 0 });
|
|
875
|
-
const updatePosition = (0, import_react6.useCallback)(
|
|
876
|
-
(newPosition) => {
|
|
877
|
-
const element = dragRef.current;
|
|
878
|
-
if (!element) return;
|
|
879
|
-
const rect = element.getBoundingClientRect();
|
|
880
|
-
const viewportWidth = window.innerWidth;
|
|
881
|
-
const viewportHeight = window.innerHeight;
|
|
882
|
-
const constrainedPosition = {
|
|
883
|
-
x: Math.max(0, Math.min(newPosition.x, viewportWidth - rect.width)),
|
|
884
|
-
y: Math.max(0, Math.min(newPosition.y, viewportHeight - rect.height))
|
|
885
|
-
};
|
|
886
|
-
setPosition(constrainedPosition);
|
|
887
|
-
onPositionChange == null ? void 0 : onPositionChange(constrainedPosition);
|
|
888
|
-
},
|
|
889
|
-
[onPositionChange]
|
|
890
|
-
);
|
|
891
|
-
const handleStart = (0, import_react6.useCallback)(
|
|
892
|
-
(clientX, clientY) => {
|
|
893
|
-
setIsDragging(true);
|
|
894
|
-
dragStart.current = { x: clientX, y: clientY };
|
|
895
|
-
elementStart.current = position;
|
|
896
|
-
const handleMove = (moveClientX, moveClientY) => {
|
|
897
|
-
const deltaX = moveClientX - dragStart.current.x;
|
|
898
|
-
const deltaY = moveClientY - dragStart.current.y;
|
|
899
|
-
updatePosition({
|
|
900
|
-
x: elementStart.current.x + deltaX,
|
|
901
|
-
y: elementStart.current.y + deltaY
|
|
902
|
-
});
|
|
903
|
-
};
|
|
904
|
-
const handleMouseMove = (e) => {
|
|
905
|
-
e.preventDefault();
|
|
906
|
-
handleMove(e.clientX, e.clientY);
|
|
907
|
-
};
|
|
908
|
-
const handleTouchMove = (e) => {
|
|
909
|
-
e.preventDefault();
|
|
910
|
-
const touch = e.touches[0];
|
|
911
|
-
if (touch) {
|
|
912
|
-
handleMove(touch.clientX, touch.clientY);
|
|
913
|
-
}
|
|
914
|
-
};
|
|
915
|
-
const handleEnd = () => {
|
|
916
|
-
setIsDragging(false);
|
|
917
|
-
document.removeEventListener("mousemove", handleMouseMove);
|
|
918
|
-
document.removeEventListener("mouseup", handleEnd);
|
|
919
|
-
document.removeEventListener("touchmove", handleTouchMove);
|
|
920
|
-
document.removeEventListener("touchend", handleEnd);
|
|
921
|
-
};
|
|
922
|
-
document.addEventListener("mousemove", handleMouseMove);
|
|
923
|
-
document.addEventListener("mouseup", handleEnd);
|
|
924
|
-
document.addEventListener("touchmove", handleTouchMove, {
|
|
925
|
-
passive: false
|
|
926
|
-
});
|
|
927
|
-
document.addEventListener("touchend", handleEnd);
|
|
928
|
-
},
|
|
929
|
-
[position, updatePosition]
|
|
930
|
-
);
|
|
931
|
-
const handleMouseDown = (0, import_react6.useCallback)(
|
|
932
|
-
(e) => {
|
|
933
|
-
e.preventDefault();
|
|
934
|
-
handleStart(e.clientX, e.clientY);
|
|
935
|
-
},
|
|
936
|
-
[handleStart]
|
|
937
|
-
);
|
|
938
|
-
const handleTouchStart = (0, import_react6.useCallback)(
|
|
939
|
-
(e) => {
|
|
940
|
-
e.preventDefault();
|
|
941
|
-
const touch = e.touches[0];
|
|
942
|
-
if (touch) {
|
|
943
|
-
handleStart(touch.clientX, touch.clientY);
|
|
944
|
-
}
|
|
945
|
-
},
|
|
946
|
-
[handleStart]
|
|
947
|
-
);
|
|
948
|
-
return {
|
|
949
|
-
position,
|
|
950
|
-
isDragging,
|
|
951
|
-
dragRef,
|
|
952
|
-
handleMouseDown,
|
|
953
|
-
handleTouchStart
|
|
954
|
-
};
|
|
955
|
-
}
|
|
854
|
+
// call-control-sdk/lib/components/dialog.tsx
|
|
855
|
+
var import_icons_material = require("@mui/icons-material");
|
|
856
|
+
var import_material3 = require("@mui/material");
|
|
857
|
+
var import_react9 = require("react");
|
|
956
858
|
|
|
957
859
|
// call-control-sdk/lib/hooks/useSDKState.ts
|
|
958
|
-
var
|
|
860
|
+
var import_react6 = require("react");
|
|
959
861
|
function useSDKState() {
|
|
960
|
-
const [state, setState] = (0,
|
|
961
|
-
(0,
|
|
862
|
+
const [state, setState] = (0, import_react6.useState)(sdkStateManager.getState());
|
|
863
|
+
(0, import_react6.useEffect)(() => {
|
|
962
864
|
const unsubscribe = sdkStateManager.subscribe(() => {
|
|
963
865
|
setState(sdkStateManager.getState());
|
|
964
866
|
});
|
|
@@ -968,22 +870,22 @@ function useSDKState() {
|
|
|
968
870
|
}
|
|
969
871
|
|
|
970
872
|
// call-control-sdk/lib/services/request.ts
|
|
971
|
-
var
|
|
873
|
+
var import_react8 = require("react");
|
|
972
874
|
|
|
973
875
|
// call-control-sdk/lib/services/toastMessage.tsx
|
|
974
|
-
var
|
|
876
|
+
var import_react7 = require("react");
|
|
975
877
|
var import_material = require("@mui/material");
|
|
976
878
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
977
|
-
var ToastContext = (0,
|
|
879
|
+
var ToastContext = (0, import_react7.createContext)(void 0);
|
|
978
880
|
var useToast = () => {
|
|
979
|
-
const ctx = (0,
|
|
881
|
+
const ctx = (0, import_react7.useContext)(ToastContext);
|
|
980
882
|
if (!ctx) throw new Error("useToast must be used inside ToastProvider");
|
|
981
883
|
return ctx;
|
|
982
884
|
};
|
|
983
885
|
var ToastProvider = ({ children }) => {
|
|
984
|
-
const [open, setOpen] = (0,
|
|
985
|
-
const [message, setMessage] = (0,
|
|
986
|
-
const [severity, setSeverity] = (0,
|
|
886
|
+
const [open, setOpen] = (0, import_react7.useState)(false);
|
|
887
|
+
const [message, setMessage] = (0, import_react7.useState)("");
|
|
888
|
+
const [severity, setSeverity] = (0, import_react7.useState)("info");
|
|
987
889
|
const showToast = (msg, sev = "info") => {
|
|
988
890
|
setMessage(msg);
|
|
989
891
|
setSeverity(sev);
|
|
@@ -1051,8 +953,8 @@ var reducer = (state, action) => {
|
|
|
1051
953
|
var useGetRequest = (props = {}) => {
|
|
1052
954
|
const { onSuccess = null, onError = null } = props;
|
|
1053
955
|
const { showToast } = useToast();
|
|
1054
|
-
const [state, dispatch] = (0,
|
|
1055
|
-
const getRequest = (0,
|
|
956
|
+
const [state, dispatch] = (0, import_react8.useReducer)(reducer, initialState);
|
|
957
|
+
const getRequest = (0, import_react8.useCallback)(
|
|
1056
958
|
(url, config = {}) => {
|
|
1057
959
|
dispatch({
|
|
1058
960
|
type: "isLoading",
|
|
@@ -1104,8 +1006,8 @@ var useGetRequest = (props = {}) => {
|
|
|
1104
1006
|
var usePostRequest = (props = {}) => {
|
|
1105
1007
|
const { onSuccess = null, onError = null, disabledSuccessToast = false } = props;
|
|
1106
1008
|
const { showToast } = useToast();
|
|
1107
|
-
const [state, dispatch] = (0,
|
|
1108
|
-
const postRequest = (0,
|
|
1009
|
+
const [state, dispatch] = (0, import_react8.useReducer)(reducer, initialState);
|
|
1010
|
+
const postRequest = (0, import_react8.useCallback)(
|
|
1109
1011
|
(url, payload, config = {}) => {
|
|
1110
1012
|
dispatch({
|
|
1111
1013
|
type: "isLoading",
|
|
@@ -1149,11 +1051,6 @@ var usePostRequest = (props = {}) => {
|
|
|
1149
1051
|
return [postRequest, state];
|
|
1150
1052
|
};
|
|
1151
1053
|
|
|
1152
|
-
// call-control-sdk/lib/components/dialog.tsx
|
|
1153
|
-
var import_icons_material = require("@mui/icons-material");
|
|
1154
|
-
var import_material3 = require("@mui/material");
|
|
1155
|
-
var import_react10 = require("react");
|
|
1156
|
-
|
|
1157
1054
|
// call-control-sdk/lib/components/styles.ts
|
|
1158
1055
|
var import_material2 = require("@mui/material");
|
|
1159
1056
|
var useStyles = ({
|
|
@@ -1221,19 +1118,19 @@ var styles_default = useStyles;
|
|
|
1221
1118
|
// call-control-sdk/lib/components/dialog.tsx
|
|
1222
1119
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
1223
1120
|
var ConferenceTableRow = ({ each }) => {
|
|
1224
|
-
var _a2, _b, _c, _d, _e;
|
|
1121
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
1225
1122
|
const state = useSDKState();
|
|
1123
|
+
const theme = (0, import_material3.useTheme)();
|
|
1226
1124
|
const { showToast } = useToast();
|
|
1227
1125
|
const { disabled, enabled, outlined } = styles_default({
|
|
1228
1126
|
disabled: ((_a2 = state.sdkConfig) == null ? void 0 : _a2.disabled) || {},
|
|
1229
1127
|
enabled: ((_b = state.sdkConfig) == null ? void 0 : _b.enabled) || {},
|
|
1230
1128
|
outlined: ((_c = state.sdkConfig) == null ? void 0 : _c.outlined) || {}
|
|
1231
1129
|
});
|
|
1232
|
-
const
|
|
1233
|
-
const [
|
|
1234
|
-
const [
|
|
1235
|
-
const [
|
|
1236
|
-
const [conferenceCallEnd, setConferenceCallEnd] = (0, import_react10.useState)(false);
|
|
1130
|
+
const [conferenceCallStart, setConferenceCallStart] = (0, import_react9.useState)(false);
|
|
1131
|
+
const [conferenceCallMerge, setConferenceCallMerge] = (0, import_react9.useState)(false);
|
|
1132
|
+
const [conferenceCallHoldOrUnHold, setConferenceCallHoldOrUnHold] = (0, import_react9.useState)(false);
|
|
1133
|
+
const [conferenceCallEnd, setConferenceCallEnd] = (0, import_react9.useState)(false);
|
|
1237
1134
|
const onConferenceLineUpdate = (line, data) => {
|
|
1238
1135
|
sdkStateManager.setConferenceLine(__spreadValues(__spreadValues({}, line), data));
|
|
1239
1136
|
};
|
|
@@ -1242,7 +1139,7 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1242
1139
|
const line_used = __spreadValues(__spreadValues({}, line), data);
|
|
1243
1140
|
setConferenceCallStart(true);
|
|
1244
1141
|
const payload = {
|
|
1245
|
-
action: "
|
|
1142
|
+
action: "EXTERNAL_CONFERENCE",
|
|
1246
1143
|
operation: `CALL${line_used.line}`,
|
|
1247
1144
|
line_used: String(line_used.line),
|
|
1248
1145
|
thirdparty_no: line_used.phone,
|
|
@@ -1335,20 +1232,12 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1335
1232
|
setConferenceCallEnd(false);
|
|
1336
1233
|
});
|
|
1337
1234
|
};
|
|
1338
|
-
const [holdOrUnHold] = usePostRequest(
|
|
1339
|
-
|
|
1340
|
-
sdkStateManager.setHolding(!state.isHolding);
|
|
1341
|
-
}
|
|
1342
|
-
});
|
|
1343
|
-
const [muteOrUnMute] = usePostRequest({
|
|
1344
|
-
onSuccess: () => {
|
|
1345
|
-
sdkStateManager.setMuted(!state.isMuted);
|
|
1346
|
-
}
|
|
1347
|
-
});
|
|
1235
|
+
const [holdOrUnHold] = usePostRequest();
|
|
1236
|
+
const [muteOrUnMute] = usePostRequest();
|
|
1348
1237
|
const handleHoldToggle = () => {
|
|
1349
1238
|
var _a3;
|
|
1350
1239
|
const payload = {
|
|
1351
|
-
action: ((_a3 = state.callData) == null ? void 0 : _a3.hold) === 1 ? "UNHOLD" : "HOLD"
|
|
1240
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.hold) === 1 ? "UNHOLD" /* UNHOLD */ : "HOLD" /* HOLD */,
|
|
1352
1241
|
userId: state.agentId
|
|
1353
1242
|
};
|
|
1354
1243
|
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
@@ -1356,7 +1245,7 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1356
1245
|
const handleMuteToggle = () => {
|
|
1357
1246
|
var _a3;
|
|
1358
1247
|
const payload = {
|
|
1359
|
-
action: ((_a3 = state.callData) == null ? void 0 : _a3.mute) === 1 ? "UNMUTE" : "MUTE"
|
|
1248
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.mute) === 1 ? "UNMUTE" /* UNMUTE */ : "MUTE" /* MUTE */,
|
|
1360
1249
|
userId: state.agentId
|
|
1361
1250
|
};
|
|
1362
1251
|
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
@@ -1418,7 +1307,7 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1418
1307
|
placeholder: "Phone Number",
|
|
1419
1308
|
fullWidth: true,
|
|
1420
1309
|
value: (each == null ? void 0 : each.phone) || "",
|
|
1421
|
-
disabled: (each == null ? void 0 : each.line) === 1 ||
|
|
1310
|
+
disabled: (each == null ? void 0 : each.line) === 1 || ["ONCALL" /* ONCALL */, "DISCONNECTED" /* DISCONNECTED */, "CONFERENCE" /* CONFERENCE */, "HOLD" /* HOLD */, "MUTE" /* MUTE */, "DIALING" /* DIALING */, "RINGING" /* RINGING */].includes((_f = each == null ? void 0 : each.status) != null ? _f : ""),
|
|
1422
1311
|
onChange: (e) => {
|
|
1423
1312
|
onConferenceLineUpdate(each, { phone: e.target.value });
|
|
1424
1313
|
}
|
|
@@ -1431,7 +1320,6 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1431
1320
|
{
|
|
1432
1321
|
sx: {
|
|
1433
1322
|
padding: "6px",
|
|
1434
|
-
// width: "200px",
|
|
1435
1323
|
flex: 1
|
|
1436
1324
|
},
|
|
1437
1325
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
@@ -1445,20 +1333,20 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1445
1333
|
gap: "10px"
|
|
1446
1334
|
},
|
|
1447
1335
|
children: [
|
|
1448
|
-
(each == null ? void 0 : each.line) === 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" ? "Hold" : "Resume", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1336
|
+
(each == null ? void 0 : each.line) === 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" /* HOLD */ ? "Hold" : "Resume", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1449
1337
|
import_material3.Button,
|
|
1450
1338
|
{
|
|
1451
|
-
variant: (each == null ? void 0 : each.status) === "HOLD" ? "contained" : "outlined",
|
|
1452
|
-
sx: (each == null ? void 0 : each.status) === "CONFERENCE" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
1339
|
+
variant: (each == null ? void 0 : each.status) === "HOLD" /* HOLD */ ? "contained" : "outlined",
|
|
1340
|
+
sx: (each == null ? void 0 : each.status) === "CONFERENCE" /* CONFERENCE */ ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
1453
1341
|
onClick: () => {
|
|
1454
|
-
if (each.status === "HOLD") {
|
|
1342
|
+
if (each.status === "HOLD" /* HOLD */) {
|
|
1455
1343
|
onHoldOrUnHoldConferenceCall(each, { isHold: false }, "UNHOLDUSER");
|
|
1456
1344
|
} else {
|
|
1457
1345
|
onHoldOrUnHoldConferenceCall(each, { isHold: true }, "HOLDUSER");
|
|
1458
1346
|
}
|
|
1459
1347
|
},
|
|
1460
|
-
disabled: (each == null ? void 0 : each.status) !== "CONFERENCE" && (each == null ? void 0 : each.status) !== "HOLD" || conferenceCallHoldOrUnHold,
|
|
1461
|
-
children: each.status === "HOLD" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1348
|
+
disabled: (each == null ? void 0 : each.status) !== "CONFERENCE" /* CONFERENCE */ && (each == null ? void 0 : each.status) !== "HOLD" /* HOLD */ || conferenceCallHoldOrUnHold,
|
|
1349
|
+
children: each.status === "HOLD" /* HOLD */ ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1462
1350
|
import_material3.Box,
|
|
1463
1351
|
{
|
|
1464
1352
|
sx: {
|
|
@@ -1475,7 +1363,7 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1475
1363
|
variant: "body2",
|
|
1476
1364
|
sx: {
|
|
1477
1365
|
fontSize: "12px",
|
|
1478
|
-
color: each.status === "HOLD" ? "#fff" : "initial"
|
|
1366
|
+
color: each.status === "HOLD" /* HOLD */ ? "#fff" : "initial"
|
|
1479
1367
|
},
|
|
1480
1368
|
children: "Unhold"
|
|
1481
1369
|
}
|
|
@@ -1507,7 +1395,7 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1507
1395
|
{
|
|
1508
1396
|
variant: "body2",
|
|
1509
1397
|
sx: {
|
|
1510
|
-
color: each.status === "HOLD" ? "#fff" : "#000",
|
|
1398
|
+
color: each.status === "HOLD" /* HOLD */ ? "#fff" : "#000",
|
|
1511
1399
|
fontSize: "12px"
|
|
1512
1400
|
},
|
|
1513
1401
|
children: "Hold"
|
|
@@ -1530,9 +1418,9 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1530
1418
|
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: "Call", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1531
1419
|
import_material3.Button,
|
|
1532
1420
|
{
|
|
1533
|
-
variant: (each == null ? void 0 : each.status) !== "IDLE" ? "outlined" : "contained",
|
|
1421
|
+
variant: (each == null ? void 0 : each.status) !== "IDLE" /* IDLE */ ? "outlined" : "contained",
|
|
1534
1422
|
color: "success",
|
|
1535
|
-
sx: (each == null ? void 0 : each.status) !== "IDLE" ? __spreadValues({}, disabled) : __spreadProps(__spreadValues({}, enabled), {
|
|
1423
|
+
sx: (each == null ? void 0 : each.status) !== "IDLE" /* IDLE */ ? __spreadValues({}, disabled) : __spreadProps(__spreadValues({}, enabled), {
|
|
1536
1424
|
border: `0px solid ${theme.palette.success.light}`,
|
|
1537
1425
|
"&:hover": {
|
|
1538
1426
|
bgcolor: "success.light",
|
|
@@ -1547,7 +1435,7 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1547
1435
|
onClick: () => {
|
|
1548
1436
|
onConferenceCallStart(each, {});
|
|
1549
1437
|
},
|
|
1550
|
-
disabled: (each == null ? void 0 : each.status) !== "IDLE"
|
|
1438
|
+
disabled: (each == null ? void 0 : each.status) !== "IDLE" /* IDLE */,
|
|
1551
1439
|
children: conferenceCallStart ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1552
1440
|
import_material3.CircularProgress,
|
|
1553
1441
|
{
|
|
@@ -1558,7 +1446,7 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1558
1446
|
import_icons_material.Call,
|
|
1559
1447
|
{
|
|
1560
1448
|
sx: {
|
|
1561
|
-
color: (each == null ? void 0 : each.status) !== "IDLE" ? "default" : "#f3f2f2"
|
|
1449
|
+
color: (each == null ? void 0 : each.status) !== "IDLE" /* IDLE */ ? "default" : "#f3f2f2"
|
|
1562
1450
|
}
|
|
1563
1451
|
}
|
|
1564
1452
|
)
|
|
@@ -1567,34 +1455,30 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1567
1455
|
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: "Merge Call", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1568
1456
|
import_material3.Button,
|
|
1569
1457
|
{
|
|
1570
|
-
variant: (each == null ? void 0 : each.status) === "ONCALL" ? "contained" : "outlined",
|
|
1571
|
-
sx: (each == null ? void 0 : each.status) === "ONCALL" ? __spreadValues({}, enabled) : __spreadValues({}, disabled),
|
|
1458
|
+
variant: (each == null ? void 0 : each.status) === "ONCALL" /* ONCALL */ ? "contained" : "outlined",
|
|
1459
|
+
sx: (each == null ? void 0 : each.status) === "ONCALL" /* ONCALL */ ? __spreadValues({}, enabled) : __spreadValues({}, disabled),
|
|
1572
1460
|
onClick: () => {
|
|
1573
1461
|
onMergeConferenceCall(each, {
|
|
1574
1462
|
isMergeCall: true
|
|
1575
1463
|
});
|
|
1576
1464
|
},
|
|
1577
|
-
disabled: (each == null ? void 0 : each.status) !== "ONCALL"
|
|
1465
|
+
disabled: (each == null ? void 0 : each.status) !== "ONCALL" /* ONCALL */,
|
|
1578
1466
|
children: conferenceCallMerge ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.CircularProgress, { size: "20px" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.CallSplit, {})
|
|
1579
1467
|
}
|
|
1580
1468
|
) }),
|
|
1581
|
-
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" ? "Hold" : "Resume", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1469
|
+
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" /* HOLD */ ? "Hold" : "Resume", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1582
1470
|
import_material3.Button,
|
|
1583
1471
|
{
|
|
1584
|
-
variant: (each == null ? void 0 : each.status) === "HOLD" ? "contained" : "outlined",
|
|
1585
|
-
sx: (each == null ? void 0 : each.status) === "CONFERENCE" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
1472
|
+
variant: (each == null ? void 0 : each.status) === "HOLD" /* HOLD */ ? "contained" : "outlined",
|
|
1473
|
+
sx: (each == null ? void 0 : each.status) === "CONFERENCE" /* CONFERENCE */ ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
1586
1474
|
onClick: () => {
|
|
1587
|
-
if (each.status === "HOLD") {
|
|
1475
|
+
if (each.status === "HOLD" /* HOLD */) {
|
|
1588
1476
|
onHoldOrUnHoldConferenceCall(each, { isHold: false }, "UNHOLDUSER");
|
|
1589
1477
|
} else {
|
|
1590
1478
|
onHoldOrUnHoldConferenceCall(each, { isHold: true }, "HOLDUSER");
|
|
1591
1479
|
}
|
|
1592
1480
|
},
|
|
1593
|
-
disabled: (each == null ? void 0 : each.status) !== "CONFERENCE" && (each == null ? void 0 : each.status) !== "HOLD"
|
|
1594
|
-
// each?.status === "ONCALL" ||
|
|
1595
|
-
// each?.status === "DIALING" ||
|
|
1596
|
-
// each?.status === "RINGING" ||
|
|
1597
|
-
conferenceCallHoldOrUnHold,
|
|
1481
|
+
disabled: (each == null ? void 0 : each.status) !== "CONFERENCE" /* CONFERENCE */ && (each == null ? void 0 : each.status) !== "HOLD" /* HOLD */ || conferenceCallHoldOrUnHold,
|
|
1598
1482
|
children: conferenceCallHoldOrUnHold ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1599
1483
|
import_material3.CircularProgress,
|
|
1600
1484
|
{
|
|
@@ -1603,15 +1487,15 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1603
1487
|
color: theme.palette.primary.main
|
|
1604
1488
|
}
|
|
1605
1489
|
}
|
|
1606
|
-
) : each.status === "HOLD" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.PlayArrow, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Pause, {})
|
|
1490
|
+
) : each.status === "HOLD" /* HOLD */ ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.PlayArrow, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Pause, {})
|
|
1607
1491
|
}
|
|
1608
1492
|
) }),
|
|
1609
1493
|
(each == null ? void 0 : each.line) !== 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: "End Call", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1610
1494
|
import_material3.Button,
|
|
1611
1495
|
{
|
|
1612
|
-
variant: (each == null ? void 0 : each.status) !== "IDLE" && (each == null ? void 0 : each.status) !== "DISCONNECTED" ? "contained" : "outlined",
|
|
1496
|
+
variant: (each == null ? void 0 : each.status) !== "IDLE" /* IDLE */ && (each == null ? void 0 : each.status) !== "DISCONNECTED" /* DISCONNECTED */ ? "contained" : "outlined",
|
|
1613
1497
|
color: "error",
|
|
1614
|
-
sx: (each == null ? void 0 : each.status) !== "IDLE" && (each == null ? void 0 : each.status) !== "DISCONNECTED" ? __spreadProps(__spreadValues({}, enabled), {
|
|
1498
|
+
sx: (each == null ? void 0 : each.status) !== "IDLE" /* IDLE */ && (each == null ? void 0 : each.status) !== "DISCONNECTED" /* DISCONNECTED */ ? __spreadProps(__spreadValues({}, enabled), {
|
|
1615
1499
|
border: `0px solid ${theme.palette.error.light}`,
|
|
1616
1500
|
"&:hover": {
|
|
1617
1501
|
bgcolor: "error.light",
|
|
@@ -1631,7 +1515,7 @@ var ConferenceTableRow = ({ each }) => {
|
|
|
1631
1515
|
isHold: false
|
|
1632
1516
|
});
|
|
1633
1517
|
},
|
|
1634
|
-
disabled: (each == null ? void 0 : each.status) === "IDLE" || (each == null ? void 0 : each.status) === "DISCONNECTED" || conferenceCallEnd,
|
|
1518
|
+
disabled: (each == null ? void 0 : each.status) === "IDLE" /* IDLE */ || (each == null ? void 0 : each.status) === "DISCONNECTED" /* DISCONNECTED */ || conferenceCallEnd,
|
|
1635
1519
|
children: conferenceCallEnd ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1636
1520
|
import_material3.CircularProgress,
|
|
1637
1521
|
{
|
|
@@ -1655,7 +1539,7 @@ function ConferenceDialog() {
|
|
|
1655
1539
|
var _a2;
|
|
1656
1540
|
const state = useSDKState();
|
|
1657
1541
|
const { showToast } = useToast();
|
|
1658
|
-
const [conferenceCallEndAll, setConferenceCallEndAll] = (0,
|
|
1542
|
+
const [conferenceCallEndAll, setConferenceCallEndAll] = (0, import_react9.useState)(false);
|
|
1659
1543
|
const handleClose = () => {
|
|
1660
1544
|
sdkStateManager.setOpenConferenceDialog(false);
|
|
1661
1545
|
};
|
|
@@ -1851,17 +1735,26 @@ function ConferenceDialog() {
|
|
|
1851
1735
|
) });
|
|
1852
1736
|
}
|
|
1853
1737
|
function CallTransferDialog({ open }) {
|
|
1854
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
1738
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
1855
1739
|
const state = useSDKState();
|
|
1740
|
+
const [mobileNumber, setMobileNumber] = (0, import_react9.useState)("");
|
|
1856
1741
|
const [transferCall] = usePostRequest({
|
|
1857
1742
|
onSuccess: () => {
|
|
1858
1743
|
sdkStateManager.setOpenCallTransferDialog(false);
|
|
1859
1744
|
}
|
|
1860
1745
|
});
|
|
1861
|
-
const [
|
|
1746
|
+
const [blindTransferCall] = usePostRequest({
|
|
1747
|
+
onSuccess: () => {
|
|
1748
|
+
sdkStateManager.setOpenCallTransferDialog(false);
|
|
1749
|
+
}
|
|
1750
|
+
});
|
|
1751
|
+
const [currentselecteTab, setCurrentselecteTab] = (0, import_react9.useState)("process");
|
|
1862
1752
|
const [getIdelAgentsList, { data: idleAgentsList, isLoading: isIdleAgentsListLoading }] = usePostRequest({
|
|
1863
1753
|
disabledSuccessToast: true
|
|
1864
1754
|
});
|
|
1755
|
+
const [getHospitalsServicesList, { data: hospitalsServicesList, isLoading: isHospitalsServicesListLoading }] = useGetRequest({
|
|
1756
|
+
disabledSuccessToast: true
|
|
1757
|
+
});
|
|
1865
1758
|
const [
|
|
1866
1759
|
getProcessAndQueuesList,
|
|
1867
1760
|
{ data: processAndQueuesList, isLoading: isProcessAndQueuesListLoading }
|
|
@@ -1872,7 +1765,7 @@ function CallTransferDialog({ open }) {
|
|
|
1872
1765
|
sdkStateManager.setOpenCallTransferDialog(false);
|
|
1873
1766
|
};
|
|
1874
1767
|
const handleTransferCall = (data, type) => {
|
|
1875
|
-
var _a3, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2,
|
|
1768
|
+
var _a3, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L;
|
|
1876
1769
|
if (type === "PROCESS") {
|
|
1877
1770
|
const payload = {
|
|
1878
1771
|
mobile_number: (_b2 = (_a3 = state.callData) == null ? void 0 : _a3.phone_number) != null ? _b2 : "",
|
|
@@ -1886,13 +1779,13 @@ function CallTransferDialog({ open }) {
|
|
|
1886
1779
|
transferCall(END_POINT.TRANSFER_CALL, payload);
|
|
1887
1780
|
} else if (type === "QUEUE") {
|
|
1888
1781
|
const payload = {
|
|
1889
|
-
mobile_number: (
|
|
1890
|
-
userid: (
|
|
1782
|
+
mobile_number: (_m2 = (_l2 = state.callData) == null ? void 0 : _l2.phone_number) != null ? _m2 : "",
|
|
1783
|
+
userid: (_o2 = (_n2 = state.callData) == null ? void 0 : _n2.agent_id) != null ? _o2 : "",
|
|
1891
1784
|
type: "QUEUE",
|
|
1892
|
-
transfer_to: (
|
|
1893
|
-
callreferenceid: (
|
|
1894
|
-
processid: String((
|
|
1895
|
-
process_name: (_v = (
|
|
1785
|
+
transfer_to: (_p2 = data == null ? void 0 : data.queue_name) != null ? _p2 : "",
|
|
1786
|
+
callreferenceid: (_r2 = (_q2 = state.callData) == null ? void 0 : _q2.convox_id) != null ? _r2 : "",
|
|
1787
|
+
processid: String((_t2 = (_s2 = state.callData) == null ? void 0 : _s2.process_id) != null ? _t2 : ""),
|
|
1788
|
+
process_name: (_v = (_u2 = state.callData) == null ? void 0 : _u2.process_name) != null ? _v : ""
|
|
1896
1789
|
};
|
|
1897
1790
|
transferCall(END_POINT.TRANSFER_CALL, payload);
|
|
1898
1791
|
} else if (type === "AGENT") {
|
|
@@ -1906,9 +1799,18 @@ function CallTransferDialog({ open }) {
|
|
|
1906
1799
|
process_name: (_G = (_F = state.callData) == null ? void 0 : _F.process_name) != null ? _G : ""
|
|
1907
1800
|
};
|
|
1908
1801
|
transferCall(END_POINT.TRANSFER_CALL, payload);
|
|
1802
|
+
} else if (type === "OTHER") {
|
|
1803
|
+
const payload = {
|
|
1804
|
+
action: "BLIND_TRANSFER",
|
|
1805
|
+
userid: (_I = (_H = state.callData) == null ? void 0 : _H.agent_id) != null ? _I : "",
|
|
1806
|
+
callreferenceid: (_K = (_J = state.callData) == null ? void 0 : _J.convox_id) != null ? _K : "",
|
|
1807
|
+
blind_transfer_no: (_L = data == null ? void 0 : data.mobile_number) != null ? _L : ""
|
|
1808
|
+
};
|
|
1809
|
+
console.log("payload", payload);
|
|
1810
|
+
blindTransferCall(END_POINT.BLIEND_TRANSFER, payload);
|
|
1909
1811
|
}
|
|
1910
1812
|
};
|
|
1911
|
-
(0,
|
|
1813
|
+
(0, import_react9.useEffect)(() => {
|
|
1912
1814
|
getIdelAgentsList(END_POINT.AGENTS_LIST, {
|
|
1913
1815
|
status: "IDLE",
|
|
1914
1816
|
active: true
|
|
@@ -1917,6 +1819,7 @@ function CallTransferDialog({ open }) {
|
|
|
1917
1819
|
status: "ACTIVE",
|
|
1918
1820
|
active: true
|
|
1919
1821
|
});
|
|
1822
|
+
getHospitalsServicesList(END_POINT.HOSPITALS_SERVICES);
|
|
1920
1823
|
}, []);
|
|
1921
1824
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1922
1825
|
import_material3.Dialog,
|
|
@@ -1925,7 +1828,7 @@ function CallTransferDialog({ open }) {
|
|
|
1925
1828
|
"aria-labelledby": "alert-dialog-title",
|
|
1926
1829
|
"aria-describedby": "alert-dialog-description",
|
|
1927
1830
|
fullWidth: true,
|
|
1928
|
-
maxWidth: "
|
|
1831
|
+
maxWidth: "sm",
|
|
1929
1832
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Paper, { sx: { borderRadius: 2 }, children: [
|
|
1930
1833
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1931
1834
|
import_material3.Box,
|
|
@@ -1947,23 +1850,17 @@ function CallTransferDialog({ open }) {
|
|
|
1947
1850
|
import_material3.Box,
|
|
1948
1851
|
{
|
|
1949
1852
|
sx: {
|
|
1950
|
-
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
1951
|
-
padding: "6px 10px",
|
|
1952
1853
|
margin: "10px",
|
|
1953
1854
|
borderRadius: "10px"
|
|
1954
1855
|
},
|
|
1955
1856
|
children: [
|
|
1956
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Box, { sx: { display: "flex", gap: 1 }, children: [
|
|
1857
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Box, { sx: { display: "flex", gap: 1, margin: "10px" }, children: [
|
|
1957
1858
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1958
1859
|
import_material3.Button,
|
|
1959
1860
|
{
|
|
1960
1861
|
variant: currentselecteTab === "process" ? "contained" : "outlined",
|
|
1961
1862
|
onClick: () => {
|
|
1962
1863
|
setCurrentselecteTab("process");
|
|
1963
|
-
getProcessAndQueuesList(END_POINT.TRANSFER_TO_DETAILS, {
|
|
1964
|
-
status: "ACTIVE",
|
|
1965
|
-
active: true
|
|
1966
|
-
});
|
|
1967
1864
|
},
|
|
1968
1865
|
children: "Process"
|
|
1969
1866
|
}
|
|
@@ -1974,10 +1871,6 @@ function CallTransferDialog({ open }) {
|
|
|
1974
1871
|
variant: currentselecteTab === "queues" ? "contained" : "outlined",
|
|
1975
1872
|
onClick: () => {
|
|
1976
1873
|
setCurrentselecteTab("queues");
|
|
1977
|
-
getProcessAndQueuesList(END_POINT.TRANSFER_TO_DETAILS, {
|
|
1978
|
-
status: "ACTIVE",
|
|
1979
|
-
active: true
|
|
1980
|
-
});
|
|
1981
1874
|
},
|
|
1982
1875
|
children: "Queues"
|
|
1983
1876
|
}
|
|
@@ -1995,9 +1888,19 @@ function CallTransferDialog({ open }) {
|
|
|
1995
1888
|
},
|
|
1996
1889
|
children: "Agents"
|
|
1997
1890
|
}
|
|
1891
|
+
),
|
|
1892
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1893
|
+
import_material3.Button,
|
|
1894
|
+
{
|
|
1895
|
+
variant: currentselecteTab === "others" ? "contained" : "outlined",
|
|
1896
|
+
onClick: () => {
|
|
1897
|
+
setCurrentselecteTab("others");
|
|
1898
|
+
},
|
|
1899
|
+
children: "Others"
|
|
1900
|
+
}
|
|
1998
1901
|
)
|
|
1999
1902
|
] }),
|
|
2000
|
-
(isProcessAndQueuesListLoading || isIdleAgentsListLoading) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1903
|
+
(isProcessAndQueuesListLoading || isIdleAgentsListLoading || isHospitalsServicesListLoading) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2001
1904
|
import_material3.Box,
|
|
2002
1905
|
{
|
|
2003
1906
|
sx: {
|
|
@@ -2012,7 +1915,7 @@ function CallTransferDialog({ open }) {
|
|
|
2012
1915
|
]
|
|
2013
1916
|
}
|
|
2014
1917
|
),
|
|
2015
|
-
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && currentselecteTab === "process" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: { display: "
|
|
1918
|
+
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "process" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: { display: "grid", gridTemplateColumns: ((_a2 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _a2.process) && ((_c = (_b = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _b.process) == null ? void 0 : _c.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)", gap: 1, padding: "10px", flexWrap: "wrap", boxShadow: "1px 1px 4px #d3d3d3ff", borderRadius: "10px" }, children: ((_d = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _d.process) && ((_f = (_e = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _e.process) == null ? void 0 : _f.length) > 0 ? (_h = (_g = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _g.process) == null ? void 0 : _h.map((process, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2016
1919
|
import_material3.Box,
|
|
2017
1920
|
{
|
|
2018
1921
|
sx: {
|
|
@@ -2037,7 +1940,7 @@ function CallTransferDialog({ open }) {
|
|
|
2037
1940
|
alignItems: "center"
|
|
2038
1941
|
},
|
|
2039
1942
|
children: [
|
|
2040
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.
|
|
1943
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.MemoryOutlined, { sx: { marginRight: "4px" } }),
|
|
2041
1944
|
process.process_name
|
|
2042
1945
|
]
|
|
2043
1946
|
}
|
|
@@ -2059,26 +1962,41 @@ function CallTransferDialog({ open }) {
|
|
|
2059
1962
|
]
|
|
2060
1963
|
},
|
|
2061
1964
|
index
|
|
2062
|
-
)) : /* @__PURE__ */ (0, import_jsx_runtime2.
|
|
2063
|
-
import_material3.
|
|
1965
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1966
|
+
import_material3.Box,
|
|
2064
1967
|
{
|
|
2065
|
-
variant: "body1",
|
|
2066
1968
|
sx: {
|
|
2067
|
-
fontSize: "16px",
|
|
2068
|
-
letterSpacing: "0.02em",
|
|
2069
|
-
textTransform: "capitalize",
|
|
2070
1969
|
display: "flex",
|
|
2071
1970
|
alignItems: "center",
|
|
2072
1971
|
justifyContent: "center",
|
|
2073
|
-
|
|
2074
|
-
margin: "10px 0px",
|
|
2075
|
-
color: "gray",
|
|
2076
|
-
height: "60px"
|
|
1972
|
+
flexDirection: "column"
|
|
2077
1973
|
},
|
|
2078
|
-
|
|
1974
|
+
p: 2,
|
|
1975
|
+
children: [
|
|
1976
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Upcoming, { color: "primary" }),
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1978
|
+
import_material3.Typography,
|
|
1979
|
+
{
|
|
1980
|
+
variant: "body1",
|
|
1981
|
+
sx: {
|
|
1982
|
+
fontSize: "16px",
|
|
1983
|
+
letterSpacing: "0.02em",
|
|
1984
|
+
textTransform: "capitalize",
|
|
1985
|
+
display: "flex",
|
|
1986
|
+
alignItems: "center",
|
|
1987
|
+
justifyContent: "center",
|
|
1988
|
+
width: "100%",
|
|
1989
|
+
margin: "10px 0px",
|
|
1990
|
+
color: "primary.main",
|
|
1991
|
+
height: "20px"
|
|
1992
|
+
},
|
|
1993
|
+
children: "No Process Found"
|
|
1994
|
+
}
|
|
1995
|
+
)
|
|
1996
|
+
]
|
|
2079
1997
|
}
|
|
2080
1998
|
) }),
|
|
2081
|
-
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && currentselecteTab === "queues" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: { display: "
|
|
1999
|
+
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "queues" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: { display: "grid", gridTemplateColumns: ((_i = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _i.queue) && ((_k = (_j = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _j.queue) == null ? void 0 : _k.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)", gap: 1, padding: "10px", flexWrap: "wrap", boxShadow: "1px 1px 4px #d3d3d3ff", borderRadius: "10px" }, children: ((_l = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _l.queue) && ((_n = (_m = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _m.queue) == null ? void 0 : _n.length) > 0 ? (_p = (_o = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _o.queue) == null ? void 0 : _p.map((queue, index) => {
|
|
2082
2000
|
var _a3, _b2, _c2, _d2, _e2, _f2;
|
|
2083
2001
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2084
2002
|
import_material3.Box,
|
|
@@ -2105,7 +2023,7 @@ function CallTransferDialog({ open }) {
|
|
|
2105
2023
|
alignItems: "center"
|
|
2106
2024
|
},
|
|
2107
2025
|
children: [
|
|
2108
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.
|
|
2026
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Airlines, { sx: { marginRight: "4px" } }),
|
|
2109
2027
|
queue.queue_name,
|
|
2110
2028
|
((_c2 = (_b2 = (_a3 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _a3.process) == null ? void 0 : _b2.find(
|
|
2111
2029
|
(process) => process.process_id === queue.process_id
|
|
@@ -2146,26 +2064,41 @@ function CallTransferDialog({ open }) {
|
|
|
2146
2064
|
},
|
|
2147
2065
|
index
|
|
2148
2066
|
);
|
|
2149
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime2.
|
|
2150
|
-
import_material3.
|
|
2067
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2068
|
+
import_material3.Box,
|
|
2151
2069
|
{
|
|
2152
|
-
variant: "body1",
|
|
2153
2070
|
sx: {
|
|
2154
|
-
fontSize: "16px",
|
|
2155
|
-
letterSpacing: "0.02em",
|
|
2156
|
-
textTransform: "capitalize",
|
|
2157
2071
|
display: "flex",
|
|
2158
2072
|
alignItems: "center",
|
|
2159
2073
|
justifyContent: "center",
|
|
2160
|
-
|
|
2161
|
-
margin: "10px 0px",
|
|
2162
|
-
color: "gray",
|
|
2163
|
-
height: "60px"
|
|
2074
|
+
flexDirection: "column"
|
|
2164
2075
|
},
|
|
2165
|
-
|
|
2076
|
+
p: 2,
|
|
2077
|
+
children: [
|
|
2078
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Upcoming, { color: "primary" }),
|
|
2079
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
2080
|
+
import_material3.Typography,
|
|
2081
|
+
{
|
|
2082
|
+
variant: "body1",
|
|
2083
|
+
sx: {
|
|
2084
|
+
fontSize: "16px",
|
|
2085
|
+
letterSpacing: "0.02em",
|
|
2086
|
+
textTransform: "capitalize",
|
|
2087
|
+
display: "flex",
|
|
2088
|
+
alignItems: "center",
|
|
2089
|
+
justifyContent: "center",
|
|
2090
|
+
width: "100%",
|
|
2091
|
+
margin: "10px 0px",
|
|
2092
|
+
color: "primary.main",
|
|
2093
|
+
height: "20px"
|
|
2094
|
+
},
|
|
2095
|
+
children: "No Queues Found"
|
|
2096
|
+
}
|
|
2097
|
+
)
|
|
2098
|
+
]
|
|
2166
2099
|
}
|
|
2167
2100
|
) }),
|
|
2168
|
-
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && currentselecteTab === "agents" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: { display: "
|
|
2101
|
+
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "agents" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: { display: "grid", gridTemplateColumns: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_q = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _q.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)", gap: 1, padding: "10px", flexWrap: "wrap", boxShadow: "1px 1px 4px #d3d3d3ff", borderRadius: "10px" }, children: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_r = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _r.length) > 0 ? (_s = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _s.map((agent, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2169
2102
|
import_material3.Box,
|
|
2170
2103
|
{
|
|
2171
2104
|
sx: {
|
|
@@ -2212,25 +2145,178 @@ function CallTransferDialog({ open }) {
|
|
|
2212
2145
|
]
|
|
2213
2146
|
},
|
|
2214
2147
|
index
|
|
2215
|
-
)) : /* @__PURE__ */ (0, import_jsx_runtime2.
|
|
2216
|
-
import_material3.
|
|
2148
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2149
|
+
import_material3.Box,
|
|
2217
2150
|
{
|
|
2218
|
-
variant: "body1",
|
|
2219
2151
|
sx: {
|
|
2220
|
-
fontSize: "16px",
|
|
2221
|
-
letterSpacing: "0.02em",
|
|
2222
|
-
textTransform: "capitalize",
|
|
2223
2152
|
display: "flex",
|
|
2224
2153
|
alignItems: "center",
|
|
2225
2154
|
justifyContent: "center",
|
|
2226
|
-
|
|
2227
|
-
margin: "10px 0px",
|
|
2228
|
-
color: "gray",
|
|
2229
|
-
height: "60px"
|
|
2155
|
+
flexDirection: "column"
|
|
2230
2156
|
},
|
|
2231
|
-
|
|
2157
|
+
p: 2,
|
|
2158
|
+
children: [
|
|
2159
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Upcoming, { color: "primary" }),
|
|
2160
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
2161
|
+
import_material3.Typography,
|
|
2162
|
+
{
|
|
2163
|
+
variant: "body1",
|
|
2164
|
+
sx: {
|
|
2165
|
+
fontSize: "16px",
|
|
2166
|
+
letterSpacing: "0.02em",
|
|
2167
|
+
textTransform: "capitalize",
|
|
2168
|
+
display: "flex",
|
|
2169
|
+
alignItems: "center",
|
|
2170
|
+
justifyContent: "center",
|
|
2171
|
+
width: "100%",
|
|
2172
|
+
margin: "10px 0px",
|
|
2173
|
+
color: "primary.main",
|
|
2174
|
+
height: "20px"
|
|
2175
|
+
},
|
|
2176
|
+
children: "No Agents Found"
|
|
2177
|
+
}
|
|
2178
|
+
)
|
|
2179
|
+
]
|
|
2232
2180
|
}
|
|
2233
|
-
) })
|
|
2181
|
+
) }),
|
|
2182
|
+
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "others" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Box, { sx: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 1, padding: "10px", flexWrap: "wrap", boxShadow: "1px 1px 4px #d3d3d3ff", borderRadius: "10px" }, children: [
|
|
2183
|
+
(hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) && ((_t = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _t.length) > 0 && ((_u = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _u.map((service, index) => {
|
|
2184
|
+
var _a3, _b2, _c2;
|
|
2185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2186
|
+
import_material3.Box,
|
|
2187
|
+
{
|
|
2188
|
+
sx: {
|
|
2189
|
+
p: 1,
|
|
2190
|
+
display: "flex",
|
|
2191
|
+
alignItems: "center",
|
|
2192
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2193
|
+
padding: "6px",
|
|
2194
|
+
borderRadius: "10px",
|
|
2195
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
2196
|
+
},
|
|
2197
|
+
children: [
|
|
2198
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2199
|
+
import_material3.Typography,
|
|
2200
|
+
{
|
|
2201
|
+
variant: "body1",
|
|
2202
|
+
sx: {
|
|
2203
|
+
mx: 1,
|
|
2204
|
+
width: "200px",
|
|
2205
|
+
maxWidth: "250px",
|
|
2206
|
+
display: "flex",
|
|
2207
|
+
alignItems: "center"
|
|
2208
|
+
},
|
|
2209
|
+
children: [
|
|
2210
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Roofing, { sx: { marginRight: "4px" } }),
|
|
2211
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: `${(_a3 = service == null ? void 0 : service.description) != null ? _a3 : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Box, { sx: { color: "text.secondary" }, children: [
|
|
2212
|
+
service.name,
|
|
2213
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Box, { sx: {
|
|
2214
|
+
fontSize: "9px",
|
|
2215
|
+
fontWeight: "600",
|
|
2216
|
+
letterSpacing: "0.02em",
|
|
2217
|
+
textTransform: "capitalize",
|
|
2218
|
+
color: "gray",
|
|
2219
|
+
textOverflow: "ellipsis",
|
|
2220
|
+
whiteSpace: "nowrap",
|
|
2221
|
+
overflow: "hidden",
|
|
2222
|
+
maxWidth: "160px"
|
|
2223
|
+
}, children: (_b2 = service == null ? void 0 : service.description) != null ? _b2 : "" })
|
|
2224
|
+
] }) })
|
|
2225
|
+
]
|
|
2226
|
+
}
|
|
2227
|
+
),
|
|
2228
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: (_c2 = service == null ? void 0 : service.phone_number) != null ? _c2 : "", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
2229
|
+
import_material3.IconButton,
|
|
2230
|
+
{
|
|
2231
|
+
color: "success",
|
|
2232
|
+
sx: {
|
|
2233
|
+
bgcolor: "action.hover",
|
|
2234
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
2235
|
+
},
|
|
2236
|
+
onClick: () => {
|
|
2237
|
+
var _a4;
|
|
2238
|
+
handleTransferCall({
|
|
2239
|
+
mobile_number: (_a4 = service == null ? void 0 : service.phone_number) != null ? _a4 : ""
|
|
2240
|
+
}, "OTHER");
|
|
2241
|
+
},
|
|
2242
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Call, {})
|
|
2243
|
+
}
|
|
2244
|
+
) })
|
|
2245
|
+
]
|
|
2246
|
+
},
|
|
2247
|
+
index
|
|
2248
|
+
);
|
|
2249
|
+
})),
|
|
2250
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
2251
|
+
import_material3.Box,
|
|
2252
|
+
{
|
|
2253
|
+
sx: {
|
|
2254
|
+
p: 1,
|
|
2255
|
+
display: "flex",
|
|
2256
|
+
alignItems: "center",
|
|
2257
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2258
|
+
padding: "6px",
|
|
2259
|
+
borderRadius: "10px"
|
|
2260
|
+
},
|
|
2261
|
+
children: [
|
|
2262
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
2263
|
+
import_material3.Typography,
|
|
2264
|
+
{
|
|
2265
|
+
variant: "body1",
|
|
2266
|
+
sx: {
|
|
2267
|
+
mx: 1,
|
|
2268
|
+
width: "200px",
|
|
2269
|
+
maxWidth: "250px",
|
|
2270
|
+
display: "flex",
|
|
2271
|
+
alignItems: "center"
|
|
2272
|
+
},
|
|
2273
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
2274
|
+
import_material3.TextField,
|
|
2275
|
+
{
|
|
2276
|
+
size: "small",
|
|
2277
|
+
name: "others",
|
|
2278
|
+
label: "Mobile number",
|
|
2279
|
+
variant: "outlined",
|
|
2280
|
+
type: "tel",
|
|
2281
|
+
value: mobileNumber,
|
|
2282
|
+
onChange: (e) => {
|
|
2283
|
+
const v = e.target.value;
|
|
2284
|
+
if (/^\d*$/.test(v)) {
|
|
2285
|
+
setMobileNumber(v);
|
|
2286
|
+
}
|
|
2287
|
+
},
|
|
2288
|
+
slotProps: {
|
|
2289
|
+
htmlInput: {
|
|
2290
|
+
inputMode: "numeric",
|
|
2291
|
+
maxLength: 11
|
|
2292
|
+
}
|
|
2293
|
+
},
|
|
2294
|
+
placeholder: "Enter mobile number",
|
|
2295
|
+
autoComplete: "off"
|
|
2296
|
+
}
|
|
2297
|
+
)
|
|
2298
|
+
}
|
|
2299
|
+
),
|
|
2300
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: mobileNumber ? `Call To - ${mobileNumber}` : "Enter mobile number", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
2301
|
+
import_material3.IconButton,
|
|
2302
|
+
{
|
|
2303
|
+
color: "success",
|
|
2304
|
+
sx: {
|
|
2305
|
+
bgcolor: "action.hover",
|
|
2306
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
2307
|
+
},
|
|
2308
|
+
onClick: () => {
|
|
2309
|
+
handleTransferCall({
|
|
2310
|
+
mobile_number: mobileNumber != null ? mobileNumber : ""
|
|
2311
|
+
}, "OTHER");
|
|
2312
|
+
},
|
|
2313
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Call, {})
|
|
2314
|
+
}
|
|
2315
|
+
) })
|
|
2316
|
+
]
|
|
2317
|
+
}
|
|
2318
|
+
)
|
|
2319
|
+
] })
|
|
2234
2320
|
]
|
|
2235
2321
|
}
|
|
2236
2322
|
)
|
|
@@ -2241,7 +2327,7 @@ function CallTransferDialog({ open }) {
|
|
|
2241
2327
|
function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
2242
2328
|
var _a2, _b, _c, _d, _e;
|
|
2243
2329
|
const [getDispositions, data] = useGetRequest();
|
|
2244
|
-
const [formData, setFormData] = (0,
|
|
2330
|
+
const [formData, setFormData] = (0, import_react9.useState)({
|
|
2245
2331
|
disposition: { label: "Resolved", value: "RES" },
|
|
2246
2332
|
followUp: { label: "No", value: "N" },
|
|
2247
2333
|
callbackDate: "",
|
|
@@ -2270,10 +2356,10 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2270
2356
|
handleReset();
|
|
2271
2357
|
setOpen(false);
|
|
2272
2358
|
};
|
|
2273
|
-
(0,
|
|
2359
|
+
(0, import_react9.useEffect)(() => {
|
|
2274
2360
|
getDispositions(END_POINT.DISPOSITIONS);
|
|
2275
2361
|
}, []);
|
|
2276
|
-
const dispositionsOptions = (0,
|
|
2362
|
+
const dispositionsOptions = (0, import_react9.useMemo)(() => {
|
|
2277
2363
|
var _a3, _b2;
|
|
2278
2364
|
return ((_b2 = (_a3 = data == null ? void 0 : data.data) == null ? void 0 : _a3.data) == null ? void 0 : _b2.map((item) => ({
|
|
2279
2365
|
label: item.name,
|
|
@@ -2626,6 +2712,147 @@ function CallHistoryDialog({ open, setOpen }) {
|
|
|
2626
2712
|
) });
|
|
2627
2713
|
}
|
|
2628
2714
|
|
|
2715
|
+
// call-control-sdk/lib/hooks/useDraggable.ts
|
|
2716
|
+
var import_react10 = require("react");
|
|
2717
|
+
function useDraggable(initialPosition, onPositionChange) {
|
|
2718
|
+
const [position, setPosition] = (0, import_react10.useState)(initialPosition);
|
|
2719
|
+
const [isDragging, setIsDragging] = (0, import_react10.useState)(false);
|
|
2720
|
+
const dragRef = (0, import_react10.useRef)();
|
|
2721
|
+
const dragStart = (0, import_react10.useRef)({ x: 0, y: 0 });
|
|
2722
|
+
const elementStart = (0, import_react10.useRef)({ x: 0, y: 0 });
|
|
2723
|
+
const updatePosition = (0, import_react10.useCallback)(
|
|
2724
|
+
(newPosition) => {
|
|
2725
|
+
const element = dragRef.current;
|
|
2726
|
+
if (!element) return;
|
|
2727
|
+
const rect = element.getBoundingClientRect();
|
|
2728
|
+
const viewportWidth = window.innerWidth;
|
|
2729
|
+
const viewportHeight = window.innerHeight;
|
|
2730
|
+
const constrainedPosition = {
|
|
2731
|
+
x: Math.max(0, Math.min(newPosition.x, viewportWidth - rect.width)),
|
|
2732
|
+
y: Math.max(0, Math.min(newPosition.y, viewportHeight - rect.height))
|
|
2733
|
+
};
|
|
2734
|
+
setPosition(constrainedPosition);
|
|
2735
|
+
onPositionChange == null ? void 0 : onPositionChange(constrainedPosition);
|
|
2736
|
+
},
|
|
2737
|
+
[onPositionChange]
|
|
2738
|
+
);
|
|
2739
|
+
const handleStart = (0, import_react10.useCallback)(
|
|
2740
|
+
(clientX, clientY) => {
|
|
2741
|
+
setIsDragging(true);
|
|
2742
|
+
dragStart.current = { x: clientX, y: clientY };
|
|
2743
|
+
elementStart.current = position;
|
|
2744
|
+
const handleMove = (moveClientX, moveClientY) => {
|
|
2745
|
+
const deltaX = moveClientX - dragStart.current.x;
|
|
2746
|
+
const deltaY = moveClientY - dragStart.current.y;
|
|
2747
|
+
updatePosition({
|
|
2748
|
+
x: elementStart.current.x + deltaX,
|
|
2749
|
+
y: elementStart.current.y + deltaY
|
|
2750
|
+
});
|
|
2751
|
+
};
|
|
2752
|
+
const handleMouseMove = (e) => {
|
|
2753
|
+
e.preventDefault();
|
|
2754
|
+
handleMove(e.clientX, e.clientY);
|
|
2755
|
+
};
|
|
2756
|
+
const handleTouchMove = (e) => {
|
|
2757
|
+
e.preventDefault();
|
|
2758
|
+
const touch = e.touches[0];
|
|
2759
|
+
if (touch) {
|
|
2760
|
+
handleMove(touch.clientX, touch.clientY);
|
|
2761
|
+
}
|
|
2762
|
+
};
|
|
2763
|
+
const handleEnd = () => {
|
|
2764
|
+
setIsDragging(false);
|
|
2765
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
2766
|
+
document.removeEventListener("mouseup", handleEnd);
|
|
2767
|
+
document.removeEventListener("touchmove", handleTouchMove);
|
|
2768
|
+
document.removeEventListener("touchend", handleEnd);
|
|
2769
|
+
};
|
|
2770
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
2771
|
+
document.addEventListener("mouseup", handleEnd);
|
|
2772
|
+
document.addEventListener("touchmove", handleTouchMove, {
|
|
2773
|
+
passive: false
|
|
2774
|
+
});
|
|
2775
|
+
document.addEventListener("touchend", handleEnd);
|
|
2776
|
+
},
|
|
2777
|
+
[position, updatePosition]
|
|
2778
|
+
);
|
|
2779
|
+
const handleMouseDown = (0, import_react10.useCallback)(
|
|
2780
|
+
(e) => {
|
|
2781
|
+
e.preventDefault();
|
|
2782
|
+
handleStart(e.clientX, e.clientY);
|
|
2783
|
+
},
|
|
2784
|
+
[handleStart]
|
|
2785
|
+
);
|
|
2786
|
+
const handleTouchStart = (0, import_react10.useCallback)(
|
|
2787
|
+
(e) => {
|
|
2788
|
+
e.preventDefault();
|
|
2789
|
+
const touch = e.touches[0];
|
|
2790
|
+
if (touch) {
|
|
2791
|
+
handleStart(touch.clientX, touch.clientY);
|
|
2792
|
+
}
|
|
2793
|
+
},
|
|
2794
|
+
[handleStart]
|
|
2795
|
+
);
|
|
2796
|
+
return {
|
|
2797
|
+
position,
|
|
2798
|
+
isDragging,
|
|
2799
|
+
dragRef,
|
|
2800
|
+
handleMouseDown,
|
|
2801
|
+
handleTouchStart
|
|
2802
|
+
};
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
// call-control-sdk/lib/services/micController.ts
|
|
2806
|
+
function createMicController(constraints = { audio: true }) {
|
|
2807
|
+
let stream = null;
|
|
2808
|
+
let muted = false;
|
|
2809
|
+
async function start() {
|
|
2810
|
+
if (stream) return;
|
|
2811
|
+
stream = await navigator.mediaDevices.getUserMedia(constraints);
|
|
2812
|
+
stream.getAudioTracks().forEach((track) => track.enabled = true);
|
|
2813
|
+
muted = false;
|
|
2814
|
+
}
|
|
2815
|
+
function setEnabled(enabled) {
|
|
2816
|
+
if (!stream) return;
|
|
2817
|
+
stream.getAudioTracks().forEach((track) => track.enabled = enabled);
|
|
2818
|
+
muted = !enabled;
|
|
2819
|
+
}
|
|
2820
|
+
function mute() {
|
|
2821
|
+
setEnabled(false);
|
|
2822
|
+
}
|
|
2823
|
+
function unmute() {
|
|
2824
|
+
setEnabled(true);
|
|
2825
|
+
}
|
|
2826
|
+
function toggleMute() {
|
|
2827
|
+
if (muted) {
|
|
2828
|
+
unmute();
|
|
2829
|
+
} else {
|
|
2830
|
+
mute();
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
function stop() {
|
|
2834
|
+
if (!stream) return;
|
|
2835
|
+
stream.getTracks().forEach((t) => t.stop());
|
|
2836
|
+
stream = null;
|
|
2837
|
+
muted = false;
|
|
2838
|
+
}
|
|
2839
|
+
function isMuted() {
|
|
2840
|
+
return muted;
|
|
2841
|
+
}
|
|
2842
|
+
function getStream() {
|
|
2843
|
+
return stream;
|
|
2844
|
+
}
|
|
2845
|
+
return {
|
|
2846
|
+
start,
|
|
2847
|
+
stop,
|
|
2848
|
+
mute,
|
|
2849
|
+
unmute,
|
|
2850
|
+
toggleMute,
|
|
2851
|
+
isMuted,
|
|
2852
|
+
getStream
|
|
2853
|
+
};
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2629
2856
|
// call-control-sdk/lib/utils/audioLoader.ts
|
|
2630
2857
|
var import_incoming = __toESM(require("./incoming-4WP3FJI4.mp3"));
|
|
2631
2858
|
var audioBlobUrl = null;
|
|
@@ -2703,58 +2930,8 @@ function cleanupAudioResources() {
|
|
|
2703
2930
|
audioBuffer = null;
|
|
2704
2931
|
}
|
|
2705
2932
|
|
|
2706
|
-
// call-control-sdk/lib/services/micController.ts
|
|
2707
|
-
function createMicController(constraints = { audio: true }) {
|
|
2708
|
-
let stream = null;
|
|
2709
|
-
let muted = false;
|
|
2710
|
-
async function start() {
|
|
2711
|
-
if (stream) return;
|
|
2712
|
-
stream = await navigator.mediaDevices.getUserMedia(constraints);
|
|
2713
|
-
stream.getAudioTracks().forEach((track) => track.enabled = true);
|
|
2714
|
-
muted = false;
|
|
2715
|
-
}
|
|
2716
|
-
function setEnabled(enabled) {
|
|
2717
|
-
if (!stream) return;
|
|
2718
|
-
stream.getAudioTracks().forEach((track) => track.enabled = enabled);
|
|
2719
|
-
muted = !enabled;
|
|
2720
|
-
}
|
|
2721
|
-
function mute() {
|
|
2722
|
-
setEnabled(false);
|
|
2723
|
-
}
|
|
2724
|
-
function unmute() {
|
|
2725
|
-
setEnabled(true);
|
|
2726
|
-
}
|
|
2727
|
-
function toggleMute() {
|
|
2728
|
-
if (muted) {
|
|
2729
|
-
unmute();
|
|
2730
|
-
} else {
|
|
2731
|
-
mute();
|
|
2732
|
-
}
|
|
2733
|
-
}
|
|
2734
|
-
function stop() {
|
|
2735
|
-
if (!stream) return;
|
|
2736
|
-
stream.getTracks().forEach((t) => t.stop());
|
|
2737
|
-
stream = null;
|
|
2738
|
-
muted = false;
|
|
2739
|
-
}
|
|
2740
|
-
function isMuted() {
|
|
2741
|
-
return muted;
|
|
2742
|
-
}
|
|
2743
|
-
function getStream() {
|
|
2744
|
-
return stream;
|
|
2745
|
-
}
|
|
2746
|
-
return {
|
|
2747
|
-
start,
|
|
2748
|
-
stop,
|
|
2749
|
-
mute,
|
|
2750
|
-
unmute,
|
|
2751
|
-
toggleMute,
|
|
2752
|
-
isMuted,
|
|
2753
|
-
getStream
|
|
2754
|
-
};
|
|
2755
|
-
}
|
|
2756
|
-
|
|
2757
2933
|
// call-control-sdk/lib/components/callControls.tsx
|
|
2934
|
+
var import_vault5 = require("@react-solutions/vault");
|
|
2758
2935
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
2759
2936
|
var getCombineConfrenceData = (localState, apiData) => {
|
|
2760
2937
|
const localConfrenceData = localState == null ? void 0 : localState.conferenceLine;
|
|
@@ -2785,7 +2962,7 @@ var formatDuration = (seconds) => {
|
|
|
2785
2962
|
return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
2786
2963
|
};
|
|
2787
2964
|
function CallControls({ onDataChange }) {
|
|
2788
|
-
var _a2, _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
|
|
2965
|
+
var _a2, _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;
|
|
2789
2966
|
const theme = (0, import_material4.useTheme)();
|
|
2790
2967
|
const state = useSDKState();
|
|
2791
2968
|
const { showToast } = useToast();
|
|
@@ -2804,10 +2981,10 @@ function CallControls({ onDataChange }) {
|
|
|
2804
2981
|
const baseReconnectDelay = 2e3;
|
|
2805
2982
|
const maxReconnectDelay = 3e4;
|
|
2806
2983
|
const [anchorEl, setAnchorEl] = (0, import_react11.useState)(null);
|
|
2807
|
-
const [showIframe, setShowIframe] = (0, import_react11.useState)(true);
|
|
2808
2984
|
const [statusAnchorEl, setStatusAnchorEl] = (0, import_react11.useState)(null);
|
|
2809
2985
|
const [dialerAnchorEl, setDialerAnchorEl] = (0, import_react11.useState)(null);
|
|
2810
2986
|
const [ambulanceAnchorEl, setAmbulanceAnchorEl] = (0, import_react11.useState)(null);
|
|
2987
|
+
const [showIframe, setShowIframe] = (0, import_react11.useState)(true);
|
|
2811
2988
|
const [openCallDisposition, setOpenCallDisposition] = (0, import_react11.useState)(false);
|
|
2812
2989
|
const [openProcessorDialog, setOpenProcessorDialog] = (0, import_react11.useState)(false);
|
|
2813
2990
|
const [openCallHistoryDialog, setOpenCallHistoryDialog] = (0, import_react11.useState)(false);
|
|
@@ -2836,20 +3013,22 @@ function CallControls({ onDataChange }) {
|
|
|
2836
3013
|
}
|
|
2837
3014
|
});
|
|
2838
3015
|
const [holdOrUnHold, { isLoading: holdOrUnHoldLoading }] = usePostRequest({
|
|
2839
|
-
onSuccess: () => {
|
|
2840
|
-
|
|
2841
|
-
}
|
|
3016
|
+
// onSuccess: () => {
|
|
3017
|
+
// sdkStateManager.setHolding(!state.isHolding);
|
|
3018
|
+
// },
|
|
2842
3019
|
});
|
|
2843
3020
|
const [muteOrUnMute, { isLoading: muteOrUnMuteLoading }] = usePostRequest({
|
|
2844
|
-
onSuccess: () => {
|
|
2845
|
-
|
|
2846
|
-
}
|
|
3021
|
+
// onSuccess: () => {
|
|
3022
|
+
// sdkStateManager.setMuted(!state.isMuted);
|
|
3023
|
+
// },
|
|
2847
3024
|
});
|
|
2848
3025
|
const [readyAgentStatus, { isLoading: agentReadyLoading }] = usePostRequest();
|
|
2849
3026
|
const [updateAgentStatus, { isLoading }] = usePostRequest();
|
|
2850
3027
|
const [sendNotification] = usePostRequest();
|
|
2851
3028
|
const [endCall, { isLoading: endCallLoading }] = usePostRequest({
|
|
2852
3029
|
onSuccess: () => {
|
|
3030
|
+
sdkStateManager.endCall();
|
|
3031
|
+
setOpenCallDisposition(false);
|
|
2853
3032
|
sdkStateManager.resetConferenceLines();
|
|
2854
3033
|
}
|
|
2855
3034
|
});
|
|
@@ -2859,15 +3038,11 @@ function CallControls({ onDataChange }) {
|
|
|
2859
3038
|
const handleOpenDialer = (event) => {
|
|
2860
3039
|
setShowIframe(true);
|
|
2861
3040
|
setDialerAnchorEl(event.currentTarget);
|
|
2862
|
-
sdkStateManager.setStatus("dial");
|
|
2863
3041
|
};
|
|
2864
3042
|
const handleOpenAbulanceServices = (event) => {
|
|
2865
3043
|
setAmbulanceAnchorEl(event.currentTarget);
|
|
2866
3044
|
};
|
|
2867
3045
|
const handleCloseDialer = () => {
|
|
2868
|
-
if (state.status !== "on call") {
|
|
2869
|
-
sdkStateManager.setStatus("idle");
|
|
2870
|
-
}
|
|
2871
3046
|
setDialerAnchorEl(null);
|
|
2872
3047
|
};
|
|
2873
3048
|
const handleCloseAmbulance = () => {
|
|
@@ -2912,7 +3087,7 @@ function CallControls({ onDataChange }) {
|
|
|
2912
3087
|
const handleHoldToggle = () => {
|
|
2913
3088
|
var _a3;
|
|
2914
3089
|
const payload = {
|
|
2915
|
-
action: ((_a3 = state.callData) == null ? void 0 : _a3.hold) === 1 ? "UNHOLD" : "HOLD"
|
|
3090
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.hold) === 1 ? "UNHOLD" /* UNHOLD */ : "HOLD" /* HOLD */,
|
|
2916
3091
|
userId: state.agentId
|
|
2917
3092
|
};
|
|
2918
3093
|
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
@@ -2920,7 +3095,7 @@ function CallControls({ onDataChange }) {
|
|
|
2920
3095
|
const handleMuteToggle = () => {
|
|
2921
3096
|
var _a3;
|
|
2922
3097
|
const payload = {
|
|
2923
|
-
action: ((_a3 = state.callData) == null ? void 0 : _a3.mute) === 1 ? "UNMUTE" : "MUTE"
|
|
3098
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.mute) === 1 ? "UNMUTE" /* UNMUTE */ : "MUTE" /* MUTE */,
|
|
2924
3099
|
userId: state.agentId
|
|
2925
3100
|
};
|
|
2926
3101
|
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
@@ -2947,8 +3122,6 @@ function CallControls({ onDataChange }) {
|
|
|
2947
3122
|
isBreak: (_q2 = data == null ? void 0 : data.selected_break) != null ? _q2 : false
|
|
2948
3123
|
}
|
|
2949
3124
|
});
|
|
2950
|
-
sdkStateManager.endCall();
|
|
2951
|
-
setOpenCallDisposition(false);
|
|
2952
3125
|
};
|
|
2953
3126
|
(0, import_react11.useEffect)(() => {
|
|
2954
3127
|
const handleBeforeUnload = (e) => {
|
|
@@ -2966,42 +3139,42 @@ function CallControls({ onDataChange }) {
|
|
|
2966
3139
|
console.error("Failed to start mic:", err);
|
|
2967
3140
|
});
|
|
2968
3141
|
const handleKeyDown = (event) => {
|
|
2969
|
-
var _a3, _b2, _c2, _d2, _e2, _f2, _g2, _h2
|
|
2970
|
-
const fullState =
|
|
2971
|
-
const key = (
|
|
2972
|
-
if (!event.altKey || ((
|
|
3142
|
+
var _a3, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
3143
|
+
const fullState = (0, import_vault5.getItem)(STORAGE_KEY);
|
|
3144
|
+
const key = (_a3 = event.key) == null ? void 0 : _a3.toLowerCase();
|
|
3145
|
+
if (!event.altKey || ((_b2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _b2.status) !== "ONCALL" /* ONCALL */) {
|
|
2973
3146
|
return;
|
|
2974
3147
|
}
|
|
2975
|
-
if (key === "m" && String((
|
|
3148
|
+
if (key === "m" && String((_c2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _c2.mute) === "0") {
|
|
2976
3149
|
event.preventDefault();
|
|
2977
|
-
(
|
|
3150
|
+
(_d2 = micRef.current) == null ? void 0 : _d2.mute();
|
|
2978
3151
|
const payload = {
|
|
2979
|
-
action: "MUTE"
|
|
3152
|
+
action: "MUTE" /* MUTE */,
|
|
2980
3153
|
userId: fullState.agentId
|
|
2981
3154
|
};
|
|
2982
3155
|
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
2983
3156
|
}
|
|
2984
|
-
if (key === "u" && String((
|
|
3157
|
+
if (key === "u" && String((_e2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _e2.mute) === "1") {
|
|
2985
3158
|
event.preventDefault();
|
|
2986
3159
|
const payload = {
|
|
2987
|
-
action: "UNMUTE"
|
|
3160
|
+
action: "UNMUTE" /* UNMUTE */,
|
|
2988
3161
|
userId: fullState.agentId
|
|
2989
3162
|
};
|
|
2990
3163
|
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
2991
|
-
(
|
|
3164
|
+
(_f2 = micRef.current) == null ? void 0 : _f2.unmute();
|
|
2992
3165
|
}
|
|
2993
|
-
if (key === "h" && String((
|
|
3166
|
+
if (key === "h" && String((_g2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _g2.hold) === "0") {
|
|
2994
3167
|
event.preventDefault();
|
|
2995
3168
|
const payload = {
|
|
2996
|
-
action: "HOLD"
|
|
3169
|
+
action: "HOLD" /* HOLD */,
|
|
2997
3170
|
userId: fullState.agentId
|
|
2998
3171
|
};
|
|
2999
3172
|
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
3000
3173
|
}
|
|
3001
|
-
if (key === "r" && String((
|
|
3174
|
+
if (key === "r" && String((_h2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _h2.hold) === "1") {
|
|
3002
3175
|
event.preventDefault();
|
|
3003
3176
|
const payload = {
|
|
3004
|
-
action: "UNHOLD"
|
|
3177
|
+
action: "UNHOLD" /* UNHOLD */,
|
|
3005
3178
|
userId: fullState.agentId
|
|
3006
3179
|
};
|
|
3007
3180
|
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
@@ -3015,7 +3188,7 @@ function CallControls({ onDataChange }) {
|
|
|
3015
3188
|
(0, import_react11.useEffect)(() => {
|
|
3016
3189
|
let interval;
|
|
3017
3190
|
let wrapUpinterval;
|
|
3018
|
-
if (state.callData.status && state.callData.status === "ONCALL") {
|
|
3191
|
+
if (state.callData.status && state.callData.status === "ONCALL" /* ONCALL */) {
|
|
3019
3192
|
interval = setInterval(() => {
|
|
3020
3193
|
const elapsed = Math.floor((Date.now() - state.callStartTime) / 1e3);
|
|
3021
3194
|
setCallDuration(elapsed);
|
|
@@ -3023,7 +3196,7 @@ function CallControls({ onDataChange }) {
|
|
|
3023
3196
|
} else {
|
|
3024
3197
|
setCallDuration(0);
|
|
3025
3198
|
}
|
|
3026
|
-
if (state.callData.status && state.callData.status === "WRAPUP" && callWrapuptime !== null) {
|
|
3199
|
+
if (state.callData.status && state.callData.status === "WRAPUP" /* WRAPUP */ && callWrapuptime !== null) {
|
|
3027
3200
|
wrapUpinterval = setInterval(() => {
|
|
3028
3201
|
setCallWrapuptime((prevTime) => {
|
|
3029
3202
|
if (prevTime === null || prevTime <= 1) {
|
|
@@ -3124,71 +3297,88 @@ function CallControls({ onDataChange }) {
|
|
|
3124
3297
|
}, 3e4);
|
|
3125
3298
|
};
|
|
3126
3299
|
webSocketRef.current.onmessage = (event) => {
|
|
3127
|
-
var _a3, _b2
|
|
3300
|
+
var _a3, _b2;
|
|
3128
3301
|
try {
|
|
3129
3302
|
const data = JSON.parse(event.data);
|
|
3130
3303
|
if (data.type === "pong") {
|
|
3131
3304
|
return;
|
|
3132
3305
|
}
|
|
3133
|
-
const
|
|
3134
|
-
const confrence = getCombineConfrenceData(
|
|
3135
|
-
|
|
3306
|
+
const sdkState = (0, import_vault5.getItem)(STORAGE_KEY);
|
|
3307
|
+
const confrence = getCombineConfrenceData(sdkState, data);
|
|
3308
|
+
const callData = {
|
|
3309
|
+
"agent_id": data == null ? void 0 : data.agent_id,
|
|
3310
|
+
"status": data == null ? void 0 : data.status,
|
|
3311
|
+
"type": data == null ? void 0 : data.type,
|
|
3312
|
+
"event_time": data == null ? void 0 : data.event_time,
|
|
3313
|
+
"phone_number": data == null ? void 0 : data.phone_number,
|
|
3314
|
+
"convox_id": data == null ? void 0 : data.convox_id,
|
|
3315
|
+
"process_id": data == null ? void 0 : data.process_id,
|
|
3316
|
+
"process_name": data == null ? void 0 : data.process_name,
|
|
3317
|
+
"hold": data == null ? void 0 : data.hold,
|
|
3318
|
+
"mute": data == null ? void 0 : data.mute,
|
|
3319
|
+
"mode": data == null ? void 0 : data.mode,
|
|
3320
|
+
"queue_name": data == null ? void 0 : data.queue_name
|
|
3321
|
+
};
|
|
3322
|
+
sdkStateManager.updateCallData(callData);
|
|
3136
3323
|
sdkStateManager.updateConferenceData([...confrence]);
|
|
3137
|
-
if (
|
|
3324
|
+
if (["RINGING" /* RINGING */, "DIALING" /* DIALING */].includes(data.status)) {
|
|
3138
3325
|
setShowIframe(true);
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3326
|
+
setCallWrapuptime((_b2 = (_a3 = sdkState == null ? void 0 : sdkState.sdkConfig) == null ? void 0 : _a3.auto_wrapup_time) != null ? _b2 : null);
|
|
3327
|
+
sdkStateManager.updateConferenceData(
|
|
3328
|
+
[
|
|
3329
|
+
{
|
|
3330
|
+
line: 1,
|
|
3331
|
+
status: "IDLE",
|
|
3332
|
+
type: "",
|
|
3333
|
+
phone: "",
|
|
3334
|
+
isMute: false,
|
|
3335
|
+
isHold: false,
|
|
3336
|
+
isCallStart: false,
|
|
3337
|
+
isMergeCall: false
|
|
3338
|
+
},
|
|
3339
|
+
{
|
|
3340
|
+
line: 2,
|
|
3341
|
+
status: "IDLE",
|
|
3342
|
+
type: "",
|
|
3343
|
+
phone: "",
|
|
3344
|
+
isMute: false,
|
|
3345
|
+
isHold: false,
|
|
3346
|
+
isCallStart: false,
|
|
3347
|
+
isMergeCall: false
|
|
3348
|
+
},
|
|
3349
|
+
{
|
|
3350
|
+
line: 3,
|
|
3351
|
+
status: "IDLE",
|
|
3352
|
+
type: "",
|
|
3353
|
+
phone: "",
|
|
3354
|
+
isMute: false,
|
|
3355
|
+
isHold: false,
|
|
3356
|
+
isCallStart: false,
|
|
3357
|
+
isMergeCall: false
|
|
3358
|
+
},
|
|
3359
|
+
{
|
|
3360
|
+
line: 4,
|
|
3361
|
+
status: "IDLE",
|
|
3362
|
+
type: "",
|
|
3363
|
+
phone: "",
|
|
3364
|
+
isMute: false,
|
|
3365
|
+
isHold: false,
|
|
3366
|
+
isCallStart: false,
|
|
3367
|
+
isMergeCall: false
|
|
3368
|
+
},
|
|
3369
|
+
{
|
|
3370
|
+
line: 5,
|
|
3371
|
+
status: "IDLE",
|
|
3372
|
+
type: "",
|
|
3373
|
+
phone: "",
|
|
3374
|
+
isMute: false,
|
|
3375
|
+
isHold: false,
|
|
3376
|
+
isCallStart: false,
|
|
3377
|
+
isMergeCall: false
|
|
3378
|
+
}
|
|
3379
|
+
]
|
|
3380
|
+
);
|
|
3381
|
+
if ((data == null ? void 0 : data.mode) !== "manual" && audioRef.current) {
|
|
3192
3382
|
audioRef.current.play().catch((error) => {
|
|
3193
3383
|
console.error("Failed to play ringtone:", error);
|
|
3194
3384
|
});
|
|
@@ -3199,14 +3389,13 @@ function CallControls({ onDataChange }) {
|
|
|
3199
3389
|
audioRef.current.currentTime = 0;
|
|
3200
3390
|
}
|
|
3201
3391
|
}
|
|
3202
|
-
if (data.status === "ONCALL") {
|
|
3392
|
+
if (data.status === "ONCALL" /* ONCALL */) {
|
|
3203
3393
|
sdkStateManager.startCall();
|
|
3204
|
-
setCallWrapuptime((_c2 = (_b2 = rls == null ? void 0 : rls.sdkConfig) == null ? void 0 : _b2.auto_wrapup_time) != null ? _c2 : null);
|
|
3205
3394
|
if (!showIframe) {
|
|
3206
3395
|
setShowIframe(true);
|
|
3207
3396
|
}
|
|
3208
3397
|
}
|
|
3209
|
-
if (data.status === "WRAPUP") {
|
|
3398
|
+
if (data.status === "WRAPUP" /* WRAPUP */) {
|
|
3210
3399
|
sdkStateManager.endCall();
|
|
3211
3400
|
}
|
|
3212
3401
|
} catch (e) {
|
|
@@ -3353,32 +3542,29 @@ function CallControls({ onDataChange }) {
|
|
|
3353
3542
|
}
|
|
3354
3543
|
),
|
|
3355
3544
|
((_k = state.sdkConfig) == null ? void 0 : _k.enableQueueName) && ((_l = state == null ? void 0 : state.callData) == null ? void 0 : _l.queue_name) && ((_m = state == null ? void 0 : state.callData) == null ? void 0 : _m.mode) !== "manual" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Chip, { label: (_n = state == null ? void 0 : state.callData) == null ? void 0 : _n.queue_name }),
|
|
3356
|
-
|
|
3545
|
+
!((_o = state.sdkConfig) == null ? void 0 : _o.disabledDialButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Dial", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3357
3546
|
import_material4.IconButton,
|
|
3358
3547
|
{
|
|
3359
3548
|
size: "small",
|
|
3360
3549
|
onClick: (e) => {
|
|
3361
|
-
var _a3, _b2
|
|
3362
|
-
if (
|
|
3550
|
+
var _a3, _b2;
|
|
3551
|
+
if (!["BREAK" /* BREAK */, "ONCALL" /* ONCALL */, "RINGING" /* RINGING */, "WRAPUP" /* WRAPUP */].includes(
|
|
3552
|
+
(_b2 = (_a3 = state.callData) == null ? void 0 : _a3.status) == null ? void 0 : _b2.toUpperCase()
|
|
3553
|
+
)) {
|
|
3363
3554
|
handleOpenDialer(e);
|
|
3364
3555
|
}
|
|
3365
3556
|
},
|
|
3366
|
-
|
|
3367
|
-
bgcolor: "action.hover",
|
|
3368
|
-
"&:hover": {
|
|
3369
|
-
bgcolor: "warning"
|
|
3370
|
-
}
|
|
3371
|
-
},
|
|
3557
|
+
disabled: ["BREAK" /* BREAK */, "ONCALL" /* ONCALL */, "RINGING" /* RINGING */, "WRAPUP" /* WRAPUP */].includes(state.callData.status.toUpperCase()),
|
|
3372
3558
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3373
3559
|
import_icons_material2.WifiCalling3,
|
|
3374
3560
|
{
|
|
3375
3561
|
sx: {
|
|
3376
|
-
color:
|
|
3562
|
+
color: ["BREAK" /* BREAK */, "ONCALL" /* ONCALL */, "RINGING" /* RINGING */, "WRAPUP" /* WRAPUP */].includes(state.callData.status.toUpperCase()) ? "action.selected" : "success.main"
|
|
3377
3563
|
}
|
|
3378
3564
|
}
|
|
3379
3565
|
)
|
|
3380
3566
|
}
|
|
3381
|
-
) })
|
|
3567
|
+
) }),
|
|
3382
3568
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Box, { onClick: () => setShowIframe(true), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3383
3569
|
import_material4.Typography,
|
|
3384
3570
|
{
|
|
@@ -3390,7 +3576,7 @@ function CallControls({ onDataChange }) {
|
|
|
3390
3576
|
fontWeight: "600",
|
|
3391
3577
|
cursor: "pointer"
|
|
3392
3578
|
},
|
|
3393
|
-
children: state.callData.status === "WRAPUP" && callWrapuptime !== null ? formatDuration(callWrapuptime) : formatDuration(callDuration)
|
|
3579
|
+
children: state.callData.status === "WRAPUP" /* WRAPUP */ && callWrapuptime !== null ? formatDuration(callWrapuptime) : formatDuration(callDuration)
|
|
3394
3580
|
}
|
|
3395
3581
|
) }),
|
|
3396
3582
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -3420,7 +3606,7 @@ function CallControls({ onDataChange }) {
|
|
|
3420
3606
|
width: "60px",
|
|
3421
3607
|
textAlign: "center"
|
|
3422
3608
|
},
|
|
3423
|
-
children: (
|
|
3609
|
+
children: (_r = (_q = (_p = state.callData) == null ? void 0 : _p.status) == null ? void 0 : _q.toUpperCase()) != null ? _r : "N/A"
|
|
3424
3610
|
}
|
|
3425
3611
|
),
|
|
3426
3612
|
onClick: handleOpenAgentStatus,
|
|
@@ -3444,32 +3630,32 @@ function CallControls({ onDataChange }) {
|
|
|
3444
3630
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Agent Ready", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3445
3631
|
import_material4.Button,
|
|
3446
3632
|
{
|
|
3447
|
-
variant:
|
|
3633
|
+
variant: ["BREAK" /* BREAK */, "MISSED" /* MISSED */].includes((_t = (_s = state.callData) == null ? void 0 : _s.status) == null ? void 0 : _t.toUpperCase()) ? "outlined" : "contained",
|
|
3448
3634
|
onClick: (e) => {
|
|
3449
|
-
var _a3, _b2
|
|
3450
|
-
if (
|
|
3635
|
+
var _a3, _b2;
|
|
3636
|
+
if (["BREAK" /* BREAK */, "MISSED" /* MISSED */].includes((_b2 = (_a3 = state.callData) == null ? void 0 : _a3.status) == null ? void 0 : _b2.toUpperCase())) {
|
|
3451
3637
|
e.stopPropagation();
|
|
3452
3638
|
handleAgentReady();
|
|
3453
3639
|
}
|
|
3454
3640
|
},
|
|
3455
3641
|
classes: {
|
|
3456
|
-
root:
|
|
3642
|
+
root: ["BREAK" /* BREAK */, "MISSED" /* MISSED */].includes((_v = (_u = state.callData) == null ? void 0 : _u.status) == null ? void 0 : _v.toUpperCase()) ? "outlined" : "enabled"
|
|
3457
3643
|
},
|
|
3458
|
-
sx: __spreadValues({},
|
|
3644
|
+
sx: __spreadValues({}, ["BREAK" /* BREAK */, "MISSED" /* MISSED */].includes((_x = (_w = state.callData) == null ? void 0 : _w.status) == null ? void 0 : _x.toUpperCase()) ? outlined : enabled),
|
|
3459
3645
|
disabled: agentReadyLoading,
|
|
3460
3646
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.SupportAgent, {})
|
|
3461
3647
|
}
|
|
3462
3648
|
) }),
|
|
3463
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((
|
|
3649
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((_y = state.callData) == null ? void 0 : _y.hold) === 1 ? "Resume" : "Hold", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3464
3650
|
import_material4.Button,
|
|
3465
3651
|
{
|
|
3466
|
-
variant: ((
|
|
3652
|
+
variant: ((_z = state.callData) == null ? void 0 : _z.hold) === 1 && ((_B = (_A = state.callData) == null ? void 0 : _A.status) == null ? void 0 : _B.toUpperCase()) === "ONCALL" /* ONCALL */ ? "contained" : "outlined",
|
|
3467
3653
|
onClick: (e) => {
|
|
3468
3654
|
e.stopPropagation();
|
|
3469
3655
|
handleHoldToggle();
|
|
3470
3656
|
},
|
|
3471
|
-
sx: ((
|
|
3472
|
-
disabled: ((
|
|
3657
|
+
sx: ((_C = state.callData) == null ? void 0 : _C.hold) === 1 && ((_E = (_D = state.callData) == null ? void 0 : _D.status) == null ? void 0 : _E.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues({}, enabled) : ((_G = (_F = state.callData) == null ? void 0 : _F.status) == null ? void 0 : _G.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3658
|
+
disabled: ((_I = (_H = state.callData) == null ? void 0 : _H.status) == null ? void 0 : _I.toUpperCase()) !== "ONCALL" /* ONCALL */ && ((_J = state.callData) == null ? void 0 : _J.hold) !== 1 || holdOrUnHoldLoading,
|
|
3473
3659
|
children: holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3474
3660
|
import_material4.CircularProgress,
|
|
3475
3661
|
{
|
|
@@ -3478,19 +3664,19 @@ function CallControls({ onDataChange }) {
|
|
|
3478
3664
|
color: theme.palette.primary.main
|
|
3479
3665
|
}
|
|
3480
3666
|
}
|
|
3481
|
-
) : ((
|
|
3667
|
+
) : ((_K = state.callData) == null ? void 0 : _K.hold) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.PlayArrow, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Pause, {})
|
|
3482
3668
|
}
|
|
3483
3669
|
) }),
|
|
3484
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((
|
|
3670
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((_L = state.callData) == null ? void 0 : _L.mute) === 1 ? "Unmute" : "Mute", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3485
3671
|
import_material4.Button,
|
|
3486
3672
|
{
|
|
3487
|
-
variant: ((
|
|
3673
|
+
variant: ((_M = state.callData) == null ? void 0 : _M.mute) === 1 && ((_O = (_N = state.callData) == null ? void 0 : _N.status) == null ? void 0 : _O.toUpperCase()) === "ONCALL" /* ONCALL */ ? "contained" : "outlined",
|
|
3488
3674
|
onClick: (e) => {
|
|
3489
3675
|
e.stopPropagation();
|
|
3490
3676
|
handleMuteToggle();
|
|
3491
3677
|
},
|
|
3492
|
-
sx: ((
|
|
3493
|
-
disabled: ((
|
|
3678
|
+
sx: ((_P = state.callData) == null ? void 0 : _P.hold) === 1 ? __spreadValues({}, disabled) : ((_Q = state.callData) == null ? void 0 : _Q.mute) === 1 && ((_S = (_R = state.callData) == null ? void 0 : _R.status) == null ? void 0 : _S.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues({}, enabled) : ((_U = (_T = state.callData) == null ? void 0 : _T.status) == null ? void 0 : _U.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3679
|
+
disabled: ((_W = (_V = state.callData) == null ? void 0 : _V.status) == null ? void 0 : _W.toUpperCase()) !== "ONCALL" /* ONCALL */ && ((_X = state.callData) == null ? void 0 : _X.mute) !== 1 || muteOrUnMuteLoading || ((_Y = state.callData) == null ? void 0 : _Y.hold) === 1,
|
|
3494
3680
|
children: muteOrUnMuteLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3495
3681
|
import_material4.CircularProgress,
|
|
3496
3682
|
{
|
|
@@ -3499,69 +3685,93 @@ function CallControls({ onDataChange }) {
|
|
|
3499
3685
|
color: theme.palette.primary.main
|
|
3500
3686
|
}
|
|
3501
3687
|
}
|
|
3502
|
-
) : ((
|
|
3688
|
+
) : ((_Z = state.callData) == null ? void 0 : _Z.mute) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.MicOff, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Mic, {})
|
|
3503
3689
|
}
|
|
3504
3690
|
) }),
|
|
3505
|
-
!((
|
|
3691
|
+
!((__ = state.sdkConfig) == null ? void 0 : __.disableCallTransferButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Transfer Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3506
3692
|
import_material4.Button,
|
|
3507
3693
|
{
|
|
3508
3694
|
variant: state.openCallTransferDialog ? "contained" : "outlined",
|
|
3509
3695
|
onClick: (e) => {
|
|
3510
3696
|
var _a3, _b2;
|
|
3511
|
-
if (((_b2 = (_a3 = state.callData) == null ? void 0 : _a3.status) == null ? void 0 : _b2.toUpperCase()) === "ONCALL") {
|
|
3697
|
+
if (((_b2 = (_a3 = state.callData) == null ? void 0 : _a3.status) == null ? void 0 : _b2.toUpperCase()) === "ONCALL" /* ONCALL */) {
|
|
3512
3698
|
e.stopPropagation();
|
|
3513
3699
|
sdkStateManager.setOpenCallTransferDialog(true);
|
|
3514
3700
|
}
|
|
3515
3701
|
},
|
|
3516
|
-
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((
|
|
3517
|
-
disabled: ((
|
|
3702
|
+
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((_aa = (_$ = state.callData) == null ? void 0 : _$.status) == null ? void 0 : _aa.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3703
|
+
disabled: ((_ca = (_ba = state.callData) == null ? void 0 : _ba.status) == null ? void 0 : _ca.toUpperCase()) !== "ONCALL" /* ONCALL */,
|
|
3518
3704
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.TransferWithinAStation, {})
|
|
3519
3705
|
}
|
|
3520
3706
|
) }),
|
|
3521
|
-
!((
|
|
3707
|
+
!((_da = state.sdkConfig) == null ? void 0 : _da.disableConferenceButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Conference Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3522
3708
|
import_material4.Button,
|
|
3523
3709
|
{
|
|
3524
3710
|
variant: state.openConferenceDialog ? "contained" : "outlined",
|
|
3525
3711
|
onClick: (e) => {
|
|
3526
3712
|
var _a3, _b2;
|
|
3527
|
-
if (((_b2 = (_a3 = state.callData) == null ? void 0 : _a3.status) == null ? void 0 : _b2.toUpperCase()) === "ONCALL") {
|
|
3713
|
+
if (((_b2 = (_a3 = state.callData) == null ? void 0 : _a3.status) == null ? void 0 : _b2.toUpperCase()) === "ONCALL" /* ONCALL */) {
|
|
3528
3714
|
e.stopPropagation();
|
|
3529
3715
|
sdkStateManager.setOpenConferenceDialog(true);
|
|
3530
3716
|
}
|
|
3531
3717
|
},
|
|
3532
|
-
sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((
|
|
3533
|
-
disabled: ((
|
|
3718
|
+
sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((_fa = (_ea = state.callData) == null ? void 0 : _ea.status) == null ? void 0 : _fa.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3719
|
+
disabled: ((_ha = (_ga = state.callData) == null ? void 0 : _ga.status) == null ? void 0 : _ha.toUpperCase()) !== "ONCALL" /* ONCALL */,
|
|
3534
3720
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Group, {})
|
|
3535
3721
|
}
|
|
3536
3722
|
) }),
|
|
3537
|
-
((
|
|
3723
|
+
((_ia = state.sdkConfig) == null ? void 0 : _ia.enableSmsServices) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Send SMS", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3538
3724
|
import_material4.Button,
|
|
3539
3725
|
{
|
|
3540
3726
|
variant: Boolean(ambulanceAnchorEl) ? "contained" : "outlined",
|
|
3541
3727
|
onClick: (e) => {
|
|
3542
|
-
var _a3, _b2
|
|
3543
|
-
if (
|
|
3728
|
+
var _a3, _b2;
|
|
3729
|
+
if ([
|
|
3730
|
+
"ONCALL" /* ONCALL */,
|
|
3731
|
+
"WRAPUP" /* WRAPUP */
|
|
3732
|
+
].includes((_b2 = (_a3 = state.callData) == null ? void 0 : _a3.status) == null ? void 0 : _b2.toUpperCase())) {
|
|
3544
3733
|
e.stopPropagation();
|
|
3545
3734
|
handleOpenAbulanceServices(e);
|
|
3546
3735
|
}
|
|
3547
3736
|
},
|
|
3548
|
-
sx: Boolean(ambulanceAnchorEl) ? __spreadValues({}, enabled) :
|
|
3549
|
-
|
|
3737
|
+
sx: Boolean(ambulanceAnchorEl) ? __spreadValues({}, enabled) : [
|
|
3738
|
+
"ONCALL" /* ONCALL */,
|
|
3739
|
+
"WRAPUP" /* WRAPUP */
|
|
3740
|
+
].includes((_ka = (_ja = state.callData) == null ? void 0 : _ja.status) == null ? void 0 : _ka.toUpperCase()) ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3741
|
+
disabled: ![
|
|
3742
|
+
"ONCALL" /* ONCALL */,
|
|
3743
|
+
"WRAPUP" /* WRAPUP */
|
|
3744
|
+
].includes((_ma = (_la = state.callData) == null ? void 0 : _la.status) == null ? void 0 : _ma.toUpperCase()),
|
|
3550
3745
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.SmsSharp, {})
|
|
3551
3746
|
}
|
|
3552
3747
|
) }),
|
|
3553
|
-
!((
|
|
3748
|
+
!((_na = state.sdkConfig) == null ? void 0 : _na.disableEndCallButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "End Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3554
3749
|
import_material4.Button,
|
|
3555
3750
|
{
|
|
3556
|
-
variant:
|
|
3751
|
+
variant: [
|
|
3752
|
+
"ONCALL" /* ONCALL */,
|
|
3753
|
+
"RINGING" /* RINGING */,
|
|
3754
|
+
"DIALING" /* DIALING */,
|
|
3755
|
+
"WRAPUP" /* WRAPUP */
|
|
3756
|
+
].includes((_pa = (_oa = state.callData) == null ? void 0 : _oa.status) == null ? void 0 : _pa.toUpperCase()) ? "contained" : "outlined",
|
|
3557
3757
|
onClick: (e) => {
|
|
3558
|
-
var _a3, _b2
|
|
3559
|
-
if (
|
|
3758
|
+
var _a3, _b2;
|
|
3759
|
+
if ([
|
|
3760
|
+
"ONCALL" /* ONCALL */,
|
|
3761
|
+
"RINGING" /* RINGING */,
|
|
3762
|
+
"DIALING" /* DIALING */,
|
|
3763
|
+
"WRAPUP" /* WRAPUP */
|
|
3764
|
+
].includes((_b2 = (_a3 = state.callData) == null ? void 0 : _a3.status) == null ? void 0 : _b2.toUpperCase())) {
|
|
3560
3765
|
e.stopPropagation();
|
|
3561
3766
|
setOpenCallDisposition(true);
|
|
3562
3767
|
}
|
|
3563
3768
|
},
|
|
3564
|
-
sx:
|
|
3769
|
+
sx: [
|
|
3770
|
+
"ONCALL" /* ONCALL */,
|
|
3771
|
+
"RINGING" /* RINGING */,
|
|
3772
|
+
"DIALING" /* DIALING */,
|
|
3773
|
+
"WRAPUP" /* WRAPUP */
|
|
3774
|
+
].includes((_ra = (_qa = state.callData) == null ? void 0 : _qa.status) == null ? void 0 : _ra.toUpperCase()) ? __spreadProps(__spreadValues({}, enabled), {
|
|
3565
3775
|
borderRight: "1px",
|
|
3566
3776
|
backgroundColor: "error.main",
|
|
3567
3777
|
minWidth: "60px !important",
|
|
@@ -3580,7 +3790,12 @@ function CallControls({ onDataChange }) {
|
|
|
3580
3790
|
}) : __spreadProps(__spreadValues({}, disabled), {
|
|
3581
3791
|
minWidth: "60px !important"
|
|
3582
3792
|
}),
|
|
3583
|
-
disabled:
|
|
3793
|
+
disabled: ![
|
|
3794
|
+
"ONCALL" /* ONCALL */,
|
|
3795
|
+
"RINGING" /* RINGING */,
|
|
3796
|
+
"DIALING" /* DIALING */,
|
|
3797
|
+
"WRAPUP" /* WRAPUP */
|
|
3798
|
+
].includes((_ta = (_sa = state.callData) == null ? void 0 : _sa.status) == null ? void 0 : _ta.toUpperCase()) || endCallLoading,
|
|
3584
3799
|
children: endCallLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3585
3800
|
import_material4.CircularProgress,
|
|
3586
3801
|
{
|
|
@@ -3620,7 +3835,7 @@ function CallControls({ onDataChange }) {
|
|
|
3620
3835
|
transition: theme.transitions.create(["box-shadow", "transform"], {
|
|
3621
3836
|
duration: theme.transitions.duration.short
|
|
3622
3837
|
}),
|
|
3623
|
-
visibility: showIframe && !((
|
|
3838
|
+
visibility: showIframe && !((_ua = state.sdkConfig) == null ? void 0 : _ua.disableSoftPhone) ? "visible" : "hidden",
|
|
3624
3839
|
userSelect: "none"
|
|
3625
3840
|
},
|
|
3626
3841
|
children: [
|
|
@@ -3654,7 +3869,7 @@ function CallControls({ onDataChange }) {
|
|
|
3654
3869
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3655
3870
|
"iframe",
|
|
3656
3871
|
{
|
|
3657
|
-
src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(
|
|
3872
|
+
src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(_va = state.process) == null ? void 0 : _va.process_id}`,
|
|
3658
3873
|
height: 380,
|
|
3659
3874
|
width: 420,
|
|
3660
3875
|
allow: "camera; microphone; autoplay",
|
|
@@ -3939,6 +4154,11 @@ async function initSDK({
|
|
|
3939
4154
|
agentId: agentId.trim(),
|
|
3940
4155
|
baseUrl: BASE_URL
|
|
3941
4156
|
});
|
|
4157
|
+
const res = {
|
|
4158
|
+
accessToken: initResult == null ? void 0 : initResult.accessToken,
|
|
4159
|
+
expiration: initResult == null ? void 0 : initResult.expiration,
|
|
4160
|
+
ticketId: initResult == null ? void 0 : initResult.ticketId
|
|
4161
|
+
};
|
|
3942
4162
|
if (initResult) {
|
|
3943
4163
|
console.info("SDK initialized successfully");
|
|
3944
4164
|
sdkStateManager.initialize(
|
|
@@ -3946,7 +4166,7 @@ async function initSDK({
|
|
|
3946
4166
|
tenantId.trim(),
|
|
3947
4167
|
agentId.trim(),
|
|
3948
4168
|
__spreadValues(__spreadValues({}, initResult == null ? void 0 : initResult.call_controls), sdkConfig),
|
|
3949
|
-
|
|
4169
|
+
res
|
|
3950
4170
|
);
|
|
3951
4171
|
} else {
|
|
3952
4172
|
sdkStateManager.setInitCheck();
|