call-control-sdk 6.5.1-uat.1 → 6.5.1-uat.3
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.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +194 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +197 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -221,6 +221,8 @@ interface CallData {
|
|
|
221
221
|
interface SDKConfig {
|
|
222
222
|
disableEndCallButton?: boolean;
|
|
223
223
|
disabledDialButton?: boolean;
|
|
224
|
+
enableSmsServices?: boolean;
|
|
225
|
+
enableQueueName?: boolean;
|
|
224
226
|
disableCallTransferButton?: boolean;
|
|
225
227
|
isDraggable?: boolean;
|
|
226
228
|
disableSoftPhone?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -221,6 +221,8 @@ interface CallData {
|
|
|
221
221
|
interface SDKConfig {
|
|
222
222
|
disableEndCallButton?: boolean;
|
|
223
223
|
disabledDialButton?: boolean;
|
|
224
|
+
enableSmsServices?: boolean;
|
|
225
|
+
enableQueueName?: boolean;
|
|
224
226
|
disableCallTransferButton?: boolean;
|
|
225
227
|
isDraggable?: boolean;
|
|
226
228
|
disableSoftPhone?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -86,6 +86,7 @@ var END_POINT = {
|
|
|
86
86
|
AGENTS_LIST: `${BASE_URL}${VERSION.v1}/cti/users`,
|
|
87
87
|
PROCESS_LIST: `${BASE_URL}${VERSION.v1}/cti/processes-list`,
|
|
88
88
|
TRANSFER_TO_DETAILS: `${BASE_URL}${VERSION.v1}/cti/transfer-to-details?provider=convox`,
|
|
89
|
+
SEND_NOTIFICATIONS: `${BASE_URL}${VERSION.v1}/cti/notifications/send`,
|
|
89
90
|
CALL_HISTORY: `${BASE_URL}${VERSION.v1}/dashboard/call-history`,
|
|
90
91
|
SENTIMENTAL_ANALYSIS: `${BASE_URL}${VERSION.v1}/users/get_sentiment_analysis`
|
|
91
92
|
};
|
|
@@ -106,6 +107,7 @@ var SDKStateManager = class {
|
|
|
106
107
|
this.loadFromStorage();
|
|
107
108
|
}
|
|
108
109
|
getInitialState() {
|
|
110
|
+
var _a2, _b;
|
|
109
111
|
return {
|
|
110
112
|
authorization: void 0,
|
|
111
113
|
process: null,
|
|
@@ -116,6 +118,8 @@ var SDKStateManager = class {
|
|
|
116
118
|
sdkConfig: {
|
|
117
119
|
disableEndCallButton: false,
|
|
118
120
|
disabledDialButton: false,
|
|
121
|
+
enableSmsServices: false,
|
|
122
|
+
enableQueueName: false,
|
|
119
123
|
disableCallTransferButton: false,
|
|
120
124
|
isDraggable: true,
|
|
121
125
|
disableSoftPhone: false,
|
|
@@ -129,9 +133,10 @@ var SDKStateManager = class {
|
|
|
129
133
|
status: "idle",
|
|
130
134
|
callStartTime: null,
|
|
131
135
|
controlPanelPosition: { x: 10, y: 10 },
|
|
132
|
-
iframePosition: { x:
|
|
136
|
+
iframePosition: { x: ((_a2 = window.screen) == null ? void 0 : _a2.availWidth) - 460, y: ((_b = window.screen) == null ? void 0 : _b.height) - 580 },
|
|
133
137
|
callData: {
|
|
134
138
|
agent_id: "",
|
|
139
|
+
queue_name: "",
|
|
135
140
|
hold: 0,
|
|
136
141
|
mute: 0,
|
|
137
142
|
status: "",
|
|
@@ -196,6 +201,7 @@ var SDKStateManager = class {
|
|
|
196
201
|
};
|
|
197
202
|
}
|
|
198
203
|
loadFromStorage() {
|
|
204
|
+
var _a2, _b;
|
|
199
205
|
try {
|
|
200
206
|
const stored = localStorage.getItem(this.STORAGE_KEY);
|
|
201
207
|
if (stored) {
|
|
@@ -209,6 +215,8 @@ var SDKStateManager = class {
|
|
|
209
215
|
isInitialized: parsedState.isInitialized || false,
|
|
210
216
|
sdkConfig: parsedState.sdkConfig || {
|
|
211
217
|
disableEndCallButton: false,
|
|
218
|
+
enableSmsServices: false,
|
|
219
|
+
enableQueueName: false,
|
|
212
220
|
disabledDialButton: false,
|
|
213
221
|
disableCallTransferButton: false,
|
|
214
222
|
isDraggable: true,
|
|
@@ -226,7 +234,10 @@ var SDKStateManager = class {
|
|
|
226
234
|
x: 10,
|
|
227
235
|
y: 10
|
|
228
236
|
},
|
|
229
|
-
iframePosition: parsedState.iframePosition || {
|
|
237
|
+
iframePosition: parsedState.iframePosition || {
|
|
238
|
+
x: ((_a2 = window.screen) == null ? void 0 : _a2.availWidth) - 460,
|
|
239
|
+
y: ((_b = window.screen) == null ? void 0 : _b.height) - 580
|
|
240
|
+
},
|
|
230
241
|
callData: parsedState.callData || {
|
|
231
242
|
mobileNumber: "",
|
|
232
243
|
callReferenceId: "",
|
|
@@ -293,6 +304,8 @@ var SDKStateManager = class {
|
|
|
293
304
|
this.state.sdkConfig = __spreadValues({
|
|
294
305
|
disableEndCallButton: false,
|
|
295
306
|
disabledDialButton: false,
|
|
307
|
+
enableSmsServices: false,
|
|
308
|
+
enableQueueName: false,
|
|
296
309
|
disableCallTransferButton: false,
|
|
297
310
|
isDraggable: true,
|
|
298
311
|
disableSoftPhone: false,
|
|
@@ -2905,7 +2918,7 @@ var formatDuration = (seconds) => {
|
|
|
2905
2918
|
return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
2906
2919
|
};
|
|
2907
2920
|
function CallControls({ onDataChange }) {
|
|
2908
|
-
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, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma;
|
|
2921
|
+
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, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za;
|
|
2909
2922
|
const theme = (0, import_material4.useTheme)();
|
|
2910
2923
|
const state = useSDKState();
|
|
2911
2924
|
const { showToast } = useToast();
|
|
@@ -2926,6 +2939,7 @@ function CallControls({ onDataChange }) {
|
|
|
2926
2939
|
const [showIframe, setShowIframe] = (0, import_react11.useState)(true);
|
|
2927
2940
|
const [statusAnchorEl, setStatusAnchorEl] = (0, import_react11.useState)(null);
|
|
2928
2941
|
const [dialerAnchorEl, setDialerAnchorEl] = (0, import_react11.useState)(null);
|
|
2942
|
+
const [ambulanceAnchorEl, setAmbulanceAnchorEl] = (0, import_react11.useState)(null);
|
|
2929
2943
|
const [openCallDisposition, setOpenCallDisposition] = (0, import_react11.useState)(false);
|
|
2930
2944
|
const [openProcessorDialog, setOpenProcessorDialog] = (0, import_react11.useState)(false);
|
|
2931
2945
|
const [openCallHistoryDialog, setOpenCallHistoryDialog] = (0, import_react11.useState)(false);
|
|
@@ -2970,6 +2984,7 @@ function CallControls({ onDataChange }) {
|
|
|
2970
2984
|
});
|
|
2971
2985
|
const [readyAgentStatus, { isLoading: agentReadyLoading }] = usePostRequest();
|
|
2972
2986
|
const [updateAgentStatus, { isLoading }] = usePostRequest();
|
|
2987
|
+
const [sendNotification] = usePostRequest();
|
|
2973
2988
|
const [endCall, { isLoading: endCallLoading }] = usePostRequest({
|
|
2974
2989
|
onSuccess: () => {
|
|
2975
2990
|
sdkStateManager.resetConferenceLines();
|
|
@@ -2983,12 +2998,18 @@ function CallControls({ onDataChange }) {
|
|
|
2983
2998
|
setDialerAnchorEl(event.currentTarget);
|
|
2984
2999
|
sdkStateManager.setStatus("dial");
|
|
2985
3000
|
};
|
|
3001
|
+
const handleOpenAbulanceServices = (event) => {
|
|
3002
|
+
setAmbulanceAnchorEl(event.currentTarget);
|
|
3003
|
+
};
|
|
2986
3004
|
const handleCloseDialer = () => {
|
|
2987
3005
|
if (state.status !== "on call") {
|
|
2988
3006
|
sdkStateManager.setStatus("idle");
|
|
2989
3007
|
}
|
|
2990
3008
|
setDialerAnchorEl(null);
|
|
2991
3009
|
};
|
|
3010
|
+
const handleCloseAmbulance = () => {
|
|
3011
|
+
setAmbulanceAnchorEl(null);
|
|
3012
|
+
};
|
|
2992
3013
|
const handleOpenAgentStatus = (event) => {
|
|
2993
3014
|
setStatusAnchorEl(event.currentTarget);
|
|
2994
3015
|
};
|
|
@@ -3071,6 +3092,52 @@ function CallControls({ onDataChange }) {
|
|
|
3071
3092
|
window.removeEventListener("beforeunload", handleBeforeUnload);
|
|
3072
3093
|
};
|
|
3073
3094
|
}, []);
|
|
3095
|
+
(0, import_react11.useEffect)(() => {
|
|
3096
|
+
const handleKeyDown = (event) => {
|
|
3097
|
+
var _a3, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
3098
|
+
const fullState = JSON.parse((_a3 = localStorage.getItem("call-control-sdk-state")) != null ? _a3 : "");
|
|
3099
|
+
const key = (_b2 = event.key) == null ? void 0 : _b2.toLowerCase();
|
|
3100
|
+
if (!event.altKey || ((_c2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _c2.status) !== "ONCALL") {
|
|
3101
|
+
return;
|
|
3102
|
+
}
|
|
3103
|
+
if (key === "m" && String((_d2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _d2.mute) === "0") {
|
|
3104
|
+
event.preventDefault();
|
|
3105
|
+
const payload = {
|
|
3106
|
+
action: "MUTE",
|
|
3107
|
+
userId: fullState.agentId
|
|
3108
|
+
};
|
|
3109
|
+
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
3110
|
+
}
|
|
3111
|
+
if (key === "u" && String((_e2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _e2.mute) === "1") {
|
|
3112
|
+
event.preventDefault();
|
|
3113
|
+
const payload = {
|
|
3114
|
+
action: "UNMUTE",
|
|
3115
|
+
userId: fullState.agentId
|
|
3116
|
+
};
|
|
3117
|
+
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
3118
|
+
}
|
|
3119
|
+
if (key === "h" && String((_f2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _f2.hold) === "0") {
|
|
3120
|
+
event.preventDefault();
|
|
3121
|
+
const payload = {
|
|
3122
|
+
action: "HOLD",
|
|
3123
|
+
userId: fullState.agentId
|
|
3124
|
+
};
|
|
3125
|
+
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
3126
|
+
}
|
|
3127
|
+
if (key === "r" && String((_g2 = fullState == null ? void 0 : fullState.callData) == null ? void 0 : _g2.hold) === "1") {
|
|
3128
|
+
event.preventDefault();
|
|
3129
|
+
const payload = {
|
|
3130
|
+
action: "UNHOLD",
|
|
3131
|
+
userId: fullState.agentId
|
|
3132
|
+
};
|
|
3133
|
+
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
3134
|
+
}
|
|
3135
|
+
};
|
|
3136
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
3137
|
+
return () => {
|
|
3138
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
3139
|
+
};
|
|
3140
|
+
}, []);
|
|
3074
3141
|
(0, import_react11.useEffect)(() => {
|
|
3075
3142
|
let interval;
|
|
3076
3143
|
if (state.callData.status && state.callData.status === "ONCALL") {
|
|
@@ -3176,7 +3243,8 @@ function CallControls({ onDataChange }) {
|
|
|
3176
3243
|
const confrence = getCombineConfrenceData(JSON.parse(rls || "{}"), data);
|
|
3177
3244
|
sdkStateManager.updateCallData(data);
|
|
3178
3245
|
sdkStateManager.updateConferenceData([...confrence]);
|
|
3179
|
-
if (data.status === "RINGING" || data.status === "DIALING") {
|
|
3246
|
+
if ((data.status === "RINGING" || data.status === "DIALING") && (data == null ? void 0 : data.mode) !== "manual") {
|
|
3247
|
+
setShowIframe(true);
|
|
3180
3248
|
sdkStateManager.updateConferenceData([
|
|
3181
3249
|
{
|
|
3182
3250
|
line: 1,
|
|
@@ -3313,6 +3381,13 @@ function CallControls({ onDataChange }) {
|
|
|
3313
3381
|
reconnectAttemptsRef.current = 0;
|
|
3314
3382
|
};
|
|
3315
3383
|
}, [state.agentId]);
|
|
3384
|
+
const handleSendSMS = (data) => {
|
|
3385
|
+
var _a3;
|
|
3386
|
+
sendNotification(END_POINT.SEND_NOTIFICATIONS, {
|
|
3387
|
+
phone_number: (_a3 = data == null ? void 0 : data.phone_number) != null ? _a3 : "",
|
|
3388
|
+
type: "ambulance"
|
|
3389
|
+
});
|
|
3390
|
+
};
|
|
3316
3391
|
if (!state.isInitialized || !state.process) {
|
|
3317
3392
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Box, { children: Boolean(openProcessorDialog) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3318
3393
|
ProcessorListDialog,
|
|
@@ -3388,7 +3463,8 @@ function CallControls({ onDataChange }) {
|
|
|
3388
3463
|
]
|
|
3389
3464
|
}
|
|
3390
3465
|
),
|
|
3391
|
-
|
|
3466
|
+
((_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 }),
|
|
3467
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Box, { children: !((_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)(
|
|
3392
3468
|
import_material4.IconButton,
|
|
3393
3469
|
{
|
|
3394
3470
|
size: "small",
|
|
@@ -3408,13 +3484,13 @@ function CallControls({ onDataChange }) {
|
|
|
3408
3484
|
import_icons_material2.WifiCalling3,
|
|
3409
3485
|
{
|
|
3410
3486
|
sx: {
|
|
3411
|
-
color: ((
|
|
3487
|
+
color: ((_q = (_p = state.callData) == null ? void 0 : _p.status) == null ? void 0 : _q.toUpperCase()) === "ONCALL" || ((_s = (_r = state.callData) == null ? void 0 : _r.status) == null ? void 0 : _s.toUpperCase()) === "BREAK" || ((_u = (_t = state.callData) == null ? void 0 : _t.status) == null ? void 0 : _u.toUpperCase()) === "RINGING" || ((_w = (_v = state.callData) == null ? void 0 : _v.status) == null ? void 0 : _w.toUpperCase()) === "WRAPUP" ? "action.selected" : "success.main"
|
|
3412
3488
|
}
|
|
3413
3489
|
}
|
|
3414
3490
|
)
|
|
3415
3491
|
}
|
|
3416
3492
|
) }) }),
|
|
3417
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3493
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Box, { onClick: () => setShowIframe(true), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3418
3494
|
import_material4.Typography,
|
|
3419
3495
|
{
|
|
3420
3496
|
sx: {
|
|
@@ -3422,11 +3498,12 @@ function CallControls({ onDataChange }) {
|
|
|
3422
3498
|
width: "40px",
|
|
3423
3499
|
marginRight: "10px",
|
|
3424
3500
|
fontSize: "18px",
|
|
3425
|
-
fontWeight: "600"
|
|
3501
|
+
fontWeight: "600",
|
|
3502
|
+
cursor: "pointer"
|
|
3426
3503
|
},
|
|
3427
3504
|
children: formatDuration(callDuration)
|
|
3428
3505
|
}
|
|
3429
|
-
),
|
|
3506
|
+
) }),
|
|
3430
3507
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3431
3508
|
import_material4.Chip,
|
|
3432
3509
|
{
|
|
@@ -3454,7 +3531,7 @@ function CallControls({ onDataChange }) {
|
|
|
3454
3531
|
width: "60px",
|
|
3455
3532
|
textAlign: "center"
|
|
3456
3533
|
},
|
|
3457
|
-
children: (
|
|
3534
|
+
children: (_z = (_y = (_x = state.callData) == null ? void 0 : _x.status) == null ? void 0 : _y.toUpperCase()) != null ? _z : "N/A"
|
|
3458
3535
|
}
|
|
3459
3536
|
),
|
|
3460
3537
|
onClick: handleOpenAgentStatus,
|
|
@@ -3478,7 +3555,7 @@ function CallControls({ onDataChange }) {
|
|
|
3478
3555
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Agent Ready", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3479
3556
|
import_material4.Button,
|
|
3480
3557
|
{
|
|
3481
|
-
variant: ((
|
|
3558
|
+
variant: ((_B = (_A = state.callData) == null ? void 0 : _A.status) == null ? void 0 : _B.toUpperCase()) === "BREAK" || ((_D = (_C = state.callData) == null ? void 0 : _C.status) == null ? void 0 : _D.toUpperCase()) === "MISSED" ? "outlined" : "contained",
|
|
3482
3559
|
onClick: (e) => {
|
|
3483
3560
|
var _a3, _b2, _c2, _d2;
|
|
3484
3561
|
if (((_b2 = (_a3 = state.callData) == null ? void 0 : _a3.status) == null ? void 0 : _b2.toUpperCase()) === "BREAK" || ((_d2 = (_c2 = state.callData) == null ? void 0 : _c2.status) == null ? void 0 : _d2.toUpperCase()) === "MISSED") {
|
|
@@ -3487,23 +3564,23 @@ function CallControls({ onDataChange }) {
|
|
|
3487
3564
|
}
|
|
3488
3565
|
},
|
|
3489
3566
|
classes: {
|
|
3490
|
-
root: ((
|
|
3567
|
+
root: ((_F = (_E = state.callData) == null ? void 0 : _E.status) == null ? void 0 : _F.toUpperCase()) === "BREAK" || ((_H = (_G = state.callData) == null ? void 0 : _G.status) == null ? void 0 : _H.toUpperCase()) === "MISSED" ? "outlined" : "enabled"
|
|
3491
3568
|
},
|
|
3492
|
-
sx: __spreadValues({}, ((
|
|
3569
|
+
sx: __spreadValues({}, ((_J = (_I = state.callData) == null ? void 0 : _I.status) == null ? void 0 : _J.toUpperCase()) === "BREAK" || ((_L = (_K = state.callData) == null ? void 0 : _K.status) == null ? void 0 : _L.toUpperCase()) === "MISSED" ? outlined : enabled),
|
|
3493
3570
|
disabled: agentReadyLoading,
|
|
3494
3571
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.SupportAgent, {})
|
|
3495
3572
|
}
|
|
3496
3573
|
) }),
|
|
3497
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((
|
|
3574
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((_M = state.callData) == null ? void 0 : _M.hold) === 1 ? "Resume" : "Hold", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3498
3575
|
import_material4.Button,
|
|
3499
3576
|
{
|
|
3500
|
-
variant: ((
|
|
3577
|
+
variant: ((_N = state.callData) == null ? void 0 : _N.hold) === 1 && ((_P = (_O = state.callData) == null ? void 0 : _O.status) == null ? void 0 : _P.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
|
|
3501
3578
|
onClick: (e) => {
|
|
3502
3579
|
e.stopPropagation();
|
|
3503
3580
|
handleHoldToggle();
|
|
3504
3581
|
},
|
|
3505
|
-
sx: ((
|
|
3506
|
-
disabled: ((
|
|
3582
|
+
sx: ((_Q = state.callData) == null ? void 0 : _Q.hold) === 1 && ((_S = (_R = state.callData) == null ? void 0 : _R.status) == null ? void 0 : _S.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_U = (_T = state.callData) == null ? void 0 : _T.status) == null ? void 0 : _U.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3583
|
+
disabled: ((_W = (_V = state.callData) == null ? void 0 : _V.status) == null ? void 0 : _W.toUpperCase()) !== "ONCALL" && ((_X = state.callData) == null ? void 0 : _X.hold) !== 1 || holdOrUnHoldLoading,
|
|
3507
3584
|
children: holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3508
3585
|
import_material4.CircularProgress,
|
|
3509
3586
|
{
|
|
@@ -3512,19 +3589,19 @@ function CallControls({ onDataChange }) {
|
|
|
3512
3589
|
color: theme.palette.primary.main
|
|
3513
3590
|
}
|
|
3514
3591
|
}
|
|
3515
|
-
) : ((
|
|
3592
|
+
) : ((_Y = state.callData) == null ? void 0 : _Y.hold) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.PlayArrow, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Pause, {})
|
|
3516
3593
|
}
|
|
3517
3594
|
) }),
|
|
3518
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((
|
|
3595
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((_Z = state.callData) == null ? void 0 : _Z.mute) === 1 ? "Unmute" : "Mute", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3519
3596
|
import_material4.Button,
|
|
3520
3597
|
{
|
|
3521
|
-
variant:
|
|
3598
|
+
variant: ((__ = state.callData) == null ? void 0 : __.mute) === 1 && ((_aa = (_$ = state.callData) == null ? void 0 : _$.status) == null ? void 0 : _aa.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
|
|
3522
3599
|
onClick: (e) => {
|
|
3523
3600
|
e.stopPropagation();
|
|
3524
3601
|
handleMuteToggle();
|
|
3525
3602
|
},
|
|
3526
|
-
sx: ((
|
|
3527
|
-
disabled: ((
|
|
3603
|
+
sx: ((_ba = state.callData) == null ? void 0 : _ba.hold) === 1 ? __spreadValues({}, disabled) : ((_ca = state.callData) == null ? void 0 : _ca.mute) === 1 && ((_ea = (_da = state.callData) == null ? void 0 : _da.status) == null ? void 0 : _ea.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_ga = (_fa = state.callData) == null ? void 0 : _fa.status) == null ? void 0 : _ga.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3604
|
+
disabled: ((_ia = (_ha = state.callData) == null ? void 0 : _ha.status) == null ? void 0 : _ia.toUpperCase()) !== "ONCALL" && ((_ja = state.callData) == null ? void 0 : _ja.mute) !== 1 || muteOrUnMuteLoading || ((_ka = state.callData) == null ? void 0 : _ka.hold) === 1,
|
|
3528
3605
|
children: muteOrUnMuteLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3529
3606
|
import_material4.CircularProgress,
|
|
3530
3607
|
{
|
|
@@ -3533,10 +3610,10 @@ function CallControls({ onDataChange }) {
|
|
|
3533
3610
|
color: theme.palette.primary.main
|
|
3534
3611
|
}
|
|
3535
3612
|
}
|
|
3536
|
-
) : ((
|
|
3613
|
+
) : ((_la = state.callData) == null ? void 0 : _la.mute) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.MicOff, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Mic, {})
|
|
3537
3614
|
}
|
|
3538
3615
|
) }),
|
|
3539
|
-
!((
|
|
3616
|
+
!((_ma = state.sdkConfig) == null ? void 0 : _ma.disableCallTransferButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Transfer Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3540
3617
|
import_material4.Button,
|
|
3541
3618
|
{
|
|
3542
3619
|
variant: state.openCallTransferDialog ? "contained" : "outlined",
|
|
@@ -3547,12 +3624,12 @@ function CallControls({ onDataChange }) {
|
|
|
3547
3624
|
sdkStateManager.setOpenCallTransferDialog(true);
|
|
3548
3625
|
}
|
|
3549
3626
|
},
|
|
3550
|
-
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((
|
|
3551
|
-
disabled: ((
|
|
3627
|
+
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((_oa = (_na = state.callData) == null ? void 0 : _na.status) == null ? void 0 : _oa.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3628
|
+
disabled: ((_qa = (_pa = state.callData) == null ? void 0 : _pa.status) == null ? void 0 : _qa.toUpperCase()) !== "ONCALL",
|
|
3552
3629
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.TransferWithinAStation, {})
|
|
3553
3630
|
}
|
|
3554
3631
|
) }),
|
|
3555
|
-
!((
|
|
3632
|
+
!((_ra = state.sdkConfig) == null ? void 0 : _ra.disableConferenceButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Conference Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3556
3633
|
import_material4.Button,
|
|
3557
3634
|
{
|
|
3558
3635
|
variant: state.openConferenceDialog ? "contained" : "outlined",
|
|
@@ -3563,15 +3640,31 @@ function CallControls({ onDataChange }) {
|
|
|
3563
3640
|
sdkStateManager.setOpenConferenceDialog(true);
|
|
3564
3641
|
}
|
|
3565
3642
|
},
|
|
3566
|
-
sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((
|
|
3567
|
-
disabled: ((
|
|
3643
|
+
sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((_ta = (_sa = state.callData) == null ? void 0 : _sa.status) == null ? void 0 : _ta.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3644
|
+
disabled: ((_va = (_ua = state.callData) == null ? void 0 : _ua.status) == null ? void 0 : _va.toUpperCase()) !== "ONCALL",
|
|
3568
3645
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Group, {})
|
|
3569
3646
|
}
|
|
3570
3647
|
) }),
|
|
3571
|
-
|
|
3648
|
+
((_wa = state.sdkConfig) == null ? void 0 : _wa.enableSmsServices) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Send SMS", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3572
3649
|
import_material4.Button,
|
|
3573
3650
|
{
|
|
3574
|
-
variant: (
|
|
3651
|
+
variant: Boolean(ambulanceAnchorEl) ? "contained" : "outlined",
|
|
3652
|
+
onClick: (e) => {
|
|
3653
|
+
var _a3, _b2, _c2, _d2;
|
|
3654
|
+
if (((_b2 = (_a3 = state.callData) == null ? void 0 : _a3.status) == null ? void 0 : _b2.toUpperCase()) === "ONCALL" || ((_d2 = (_c2 = state.callData) == null ? void 0 : _c2.status) == null ? void 0 : _d2.toUpperCase()) === "WRAPUP") {
|
|
3655
|
+
e.stopPropagation();
|
|
3656
|
+
handleOpenAbulanceServices(e);
|
|
3657
|
+
}
|
|
3658
|
+
},
|
|
3659
|
+
sx: Boolean(ambulanceAnchorEl) ? __spreadValues({}, enabled) : ((_ya = (_xa = state.callData) == null ? void 0 : _xa.status) == null ? void 0 : _ya.toUpperCase()) === "ONCALL" || ((_Aa = (_za = state.callData) == null ? void 0 : _za.status) == null ? void 0 : _Aa.toUpperCase()) === "WRAPUP" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3660
|
+
disabled: ((_Ca = (_Ba = state.callData) == null ? void 0 : _Ba.status) == null ? void 0 : _Ca.toUpperCase()) !== "ONCALL" && ((_Ea = (_Da = state.callData) == null ? void 0 : _Da.status) == null ? void 0 : _Ea.toUpperCase()) !== "WRAPUP",
|
|
3661
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.SmsSharp, {})
|
|
3662
|
+
}
|
|
3663
|
+
) }),
|
|
3664
|
+
!((_Fa = state.sdkConfig) == null ? void 0 : _Fa.disableEndCallButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "End Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3665
|
+
import_material4.Button,
|
|
3666
|
+
{
|
|
3667
|
+
variant: ((_Ha = (_Ga = state.callData) == null ? void 0 : _Ga.status) == null ? void 0 : _Ha.toUpperCase()) === "ONCALL" || ((_Ja = (_Ia = state.callData) == null ? void 0 : _Ia.status) == null ? void 0 : _Ja.toUpperCase()) === "RINGING" || ((_La = (_Ka = state.callData) == null ? void 0 : _Ka.status) == null ? void 0 : _La.toUpperCase()) === "WRAPUP" ? "contained" : "outlined",
|
|
3575
3668
|
onClick: (e) => {
|
|
3576
3669
|
var _a3, _b2, _c2, _d2, _e2, _f2;
|
|
3577
3670
|
if (((_b2 = (_a3 = state.callData) == null ? void 0 : _a3.status) == null ? void 0 : _b2.toUpperCase()) === "ONCALL" || ((_d2 = (_c2 = state.callData) == null ? void 0 : _c2.status) == null ? void 0 : _d2.toUpperCase()) === "RINGING" || ((_f2 = (_e2 = state.callData) == null ? void 0 : _e2.status) == null ? void 0 : _f2.toUpperCase()) === "WRAPUP") {
|
|
@@ -3579,7 +3672,7 @@ function CallControls({ onDataChange }) {
|
|
|
3579
3672
|
setOpenCallDisposition(true);
|
|
3580
3673
|
}
|
|
3581
3674
|
},
|
|
3582
|
-
sx: ((
|
|
3675
|
+
sx: ((_Na = (_Ma = state.callData) == null ? void 0 : _Ma.status) == null ? void 0 : _Na.toUpperCase()) === "ONCALL" || ((_Pa = (_Oa = state.callData) == null ? void 0 : _Oa.status) == null ? void 0 : _Pa.toUpperCase()) === "RINGING" || ((_Ra = (_Qa = state.callData) == null ? void 0 : _Qa.status) == null ? void 0 : _Ra.toUpperCase()) === "WRAPUP" ? __spreadProps(__spreadValues({}, enabled), {
|
|
3583
3676
|
borderRight: "1px",
|
|
3584
3677
|
backgroundColor: "error.main",
|
|
3585
3678
|
minWidth: "60px !important",
|
|
@@ -3598,7 +3691,7 @@ function CallControls({ onDataChange }) {
|
|
|
3598
3691
|
}) : __spreadProps(__spreadValues({}, disabled), {
|
|
3599
3692
|
minWidth: "60px !important"
|
|
3600
3693
|
}),
|
|
3601
|
-
disabled: ((
|
|
3694
|
+
disabled: ((_Ta = (_Sa = state.callData) == null ? void 0 : _Sa.status) == null ? void 0 : _Ta.toUpperCase()) !== "ONCALL" && ((_Va = (_Ua = state.callData) == null ? void 0 : _Ua.status) == null ? void 0 : _Va.toUpperCase()) !== "RINGING" && ((_Xa = (_Wa = state.callData) == null ? void 0 : _Wa.status) == null ? void 0 : _Xa.toUpperCase()) !== "WRAPUP" || endCallLoading,
|
|
3602
3695
|
children: endCallLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3603
3696
|
import_material4.CircularProgress,
|
|
3604
3697
|
{
|
|
@@ -3638,7 +3731,7 @@ function CallControls({ onDataChange }) {
|
|
|
3638
3731
|
transition: theme.transitions.create(["box-shadow", "transform"], {
|
|
3639
3732
|
duration: theme.transitions.duration.short
|
|
3640
3733
|
}),
|
|
3641
|
-
visibility: showIframe && !((
|
|
3734
|
+
visibility: showIframe && !((_Ya = state.sdkConfig) == null ? void 0 : _Ya.disableSoftPhone) ? "visible" : "hidden",
|
|
3642
3735
|
userSelect: "none"
|
|
3643
3736
|
},
|
|
3644
3737
|
children: [
|
|
@@ -3672,7 +3765,7 @@ function CallControls({ onDataChange }) {
|
|
|
3672
3765
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3673
3766
|
"iframe",
|
|
3674
3767
|
{
|
|
3675
|
-
src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(
|
|
3768
|
+
src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(_Za = state.process) == null ? void 0 : _Za.process_id}`,
|
|
3676
3769
|
height: 380,
|
|
3677
3770
|
width: 420,
|
|
3678
3771
|
allow: "camera; microphone; autoplay",
|
|
@@ -3741,6 +3834,72 @@ function CallControls({ onDataChange }) {
|
|
|
3741
3834
|
)
|
|
3742
3835
|
}
|
|
3743
3836
|
),
|
|
3837
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3838
|
+
import_material4.Menu,
|
|
3839
|
+
{
|
|
3840
|
+
anchorEl: ambulanceAnchorEl,
|
|
3841
|
+
open: Boolean(ambulanceAnchorEl),
|
|
3842
|
+
onClose: handleCloseAmbulance,
|
|
3843
|
+
onClick: (e) => e.stopPropagation(),
|
|
3844
|
+
sx: {
|
|
3845
|
+
zIndex: 99999
|
|
3846
|
+
},
|
|
3847
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3848
|
+
import_material4.Box,
|
|
3849
|
+
{
|
|
3850
|
+
sx: {
|
|
3851
|
+
all: "unset",
|
|
3852
|
+
padding: " 0px 20px",
|
|
3853
|
+
"&hover": {
|
|
3854
|
+
backgroundColor: "white"
|
|
3855
|
+
},
|
|
3856
|
+
display: "flex",
|
|
3857
|
+
alignItems: "center"
|
|
3858
|
+
},
|
|
3859
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Ambulance Service", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3860
|
+
import_material4.Button,
|
|
3861
|
+
{
|
|
3862
|
+
color: "primary",
|
|
3863
|
+
variant: "outlined",
|
|
3864
|
+
onClick: () => {
|
|
3865
|
+
handleSendSMS(state.callData);
|
|
3866
|
+
},
|
|
3867
|
+
children: [
|
|
3868
|
+
"Ambulance",
|
|
3869
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
3870
|
+
import_material4.Box,
|
|
3871
|
+
{
|
|
3872
|
+
sx: {
|
|
3873
|
+
display: "flex",
|
|
3874
|
+
alignItems: "center",
|
|
3875
|
+
backgroundColor: "green",
|
|
3876
|
+
color: "#fff",
|
|
3877
|
+
marginLeft: "14px",
|
|
3878
|
+
padding: "2px 6px",
|
|
3879
|
+
borderRadius: "10px"
|
|
3880
|
+
},
|
|
3881
|
+
children: [
|
|
3882
|
+
"Send",
|
|
3883
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3884
|
+
import_icons_material2.SendRounded,
|
|
3885
|
+
{
|
|
3886
|
+
sx: {
|
|
3887
|
+
marginLeft: "8px",
|
|
3888
|
+
width: "18px",
|
|
3889
|
+
transform: "rotate(-16deg)"
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
)
|
|
3893
|
+
]
|
|
3894
|
+
}
|
|
3895
|
+
)
|
|
3896
|
+
]
|
|
3897
|
+
}
|
|
3898
|
+
) })
|
|
3899
|
+
}
|
|
3900
|
+
)
|
|
3901
|
+
}
|
|
3902
|
+
),
|
|
3744
3903
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3745
3904
|
import_material4.Menu,
|
|
3746
3905
|
{
|