call-control-sdk 6.4.8 → 6.4.9-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +240 -176
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +241 -179
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -61,7 +61,7 @@ __export(index_exports, {
|
|
|
61
61
|
module.exports = __toCommonJS(index_exports);
|
|
62
62
|
|
|
63
63
|
// call-control-sdk/lib/services/endPoint.ts
|
|
64
|
-
var IP = "cti.aighospitals.com";
|
|
64
|
+
var IP = "uat-cti.aighospitals.com";
|
|
65
65
|
var BASE_URL = `https://${IP}:8095`;
|
|
66
66
|
var WS_BASE_URL = `wss://${IP}:8095`;
|
|
67
67
|
var VERSION = {
|
|
@@ -132,6 +132,8 @@ var SDKStateManager = class {
|
|
|
132
132
|
iframePosition: { x: 10, y: 80 },
|
|
133
133
|
callData: {
|
|
134
134
|
agent_id: "",
|
|
135
|
+
hold: 0,
|
|
136
|
+
mute: 0,
|
|
135
137
|
status: "",
|
|
136
138
|
type: "",
|
|
137
139
|
event_time: "",
|
|
@@ -188,7 +190,9 @@ var SDKStateManager = class {
|
|
|
188
190
|
isCallStart: false,
|
|
189
191
|
isMergeCall: false
|
|
190
192
|
}
|
|
191
|
-
]
|
|
193
|
+
],
|
|
194
|
+
hold: 0,
|
|
195
|
+
mute: 0
|
|
192
196
|
};
|
|
193
197
|
}
|
|
194
198
|
loadFromStorage() {
|
|
@@ -407,7 +411,58 @@ var SDKStateManager = class {
|
|
|
407
411
|
this.notifyListeners();
|
|
408
412
|
}
|
|
409
413
|
resetConferenceLines() {
|
|
410
|
-
this.state.conferenceLine =
|
|
414
|
+
this.state.conferenceLine = [
|
|
415
|
+
{
|
|
416
|
+
line: 1,
|
|
417
|
+
status: "IDLE",
|
|
418
|
+
type: "",
|
|
419
|
+
phone: "",
|
|
420
|
+
isMute: false,
|
|
421
|
+
isHold: false,
|
|
422
|
+
isCallStart: false,
|
|
423
|
+
isMergeCall: false
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
line: 2,
|
|
427
|
+
status: "IDLE",
|
|
428
|
+
type: "",
|
|
429
|
+
phone: "",
|
|
430
|
+
isMute: false,
|
|
431
|
+
isHold: false,
|
|
432
|
+
isCallStart: false,
|
|
433
|
+
isMergeCall: false
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
line: 3,
|
|
437
|
+
status: "IDLE",
|
|
438
|
+
type: "",
|
|
439
|
+
phone: "",
|
|
440
|
+
isMute: false,
|
|
441
|
+
isHold: false,
|
|
442
|
+
isCallStart: false,
|
|
443
|
+
isMergeCall: false
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
line: 4,
|
|
447
|
+
status: "IDLE",
|
|
448
|
+
type: "",
|
|
449
|
+
phone: "",
|
|
450
|
+
isMute: false,
|
|
451
|
+
isHold: false,
|
|
452
|
+
isCallStart: false,
|
|
453
|
+
isMergeCall: false
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
line: 5,
|
|
457
|
+
status: "IDLE",
|
|
458
|
+
type: "",
|
|
459
|
+
phone: "",
|
|
460
|
+
isMute: false,
|
|
461
|
+
isHold: false,
|
|
462
|
+
isCallStart: false,
|
|
463
|
+
isMergeCall: false
|
|
464
|
+
}
|
|
465
|
+
];
|
|
411
466
|
this.saveToStorage();
|
|
412
467
|
this.notifyListeners();
|
|
413
468
|
}
|
|
@@ -908,6 +963,7 @@ var useEndCall = () => {
|
|
|
908
963
|
endcall_type: "CLOSE"
|
|
909
964
|
};
|
|
910
965
|
return axios_default.post(END_POINT.END_CALL, payload).then((res) => {
|
|
966
|
+
sdkStateManager.resetConferenceLines();
|
|
911
967
|
sdkStateManager.endCall();
|
|
912
968
|
setData(res == null ? void 0 : res.data);
|
|
913
969
|
setSuccess(true);
|
|
@@ -952,6 +1008,7 @@ var useClickToCall = () => {
|
|
|
952
1008
|
phone_number: data2 == null ? void 0 : data2.mobileNumber
|
|
953
1009
|
};
|
|
954
1010
|
return axios_default.post(END_POINT.CLICK_TO_CALL, payload).then((res) => {
|
|
1011
|
+
sdkStateManager.resetConferenceLines();
|
|
955
1012
|
setData(res == null ? void 0 : res.data);
|
|
956
1013
|
setSuccess(true);
|
|
957
1014
|
return res == null ? void 0 : res.data;
|
|
@@ -1360,8 +1417,8 @@ var styles_default = useStyles;
|
|
|
1360
1417
|
|
|
1361
1418
|
// call-control-sdk/lib/components/dialog.tsx
|
|
1362
1419
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
1363
|
-
var ConferenceTableRow = ({ each
|
|
1364
|
-
var _a2, _b, _c, _d, _e;
|
|
1420
|
+
var ConferenceTableRow = ({ each }) => {
|
|
1421
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
1365
1422
|
const state = useSDKState();
|
|
1366
1423
|
const { showToast } = useToast();
|
|
1367
1424
|
const { disabled, enabled, outlined } = styles_default({
|
|
@@ -1373,7 +1430,6 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1373
1430
|
const [conferenceCallStart, setConferenceCallStart] = (0, import_react10.useState)(false);
|
|
1374
1431
|
const [conferenceCallMerge, setConferenceCallMerge] = (0, import_react10.useState)(false);
|
|
1375
1432
|
const [conferenceCallHoldOrUnHold, setConferenceCallHoldOrUnHold] = (0, import_react10.useState)(false);
|
|
1376
|
-
const [conferenceCallMuteOrUnMute, setConferenceCallMuteOrUnMute] = (0, import_react10.useState)(false);
|
|
1377
1433
|
const [conferenceCallEnd, setConferenceCallEnd] = (0, import_react10.useState)(false);
|
|
1378
1434
|
const onConferenceLineUpdate = (line, data) => {
|
|
1379
1435
|
sdkStateManager.setConferenceLine(__spreadValues(__spreadValues({}, line), data));
|
|
@@ -1449,30 +1505,6 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1449
1505
|
setConferenceCallHoldOrUnHold(false);
|
|
1450
1506
|
});
|
|
1451
1507
|
};
|
|
1452
|
-
const onMuteOrUnMuteConferenceCall = (line, data, type) => {
|
|
1453
|
-
var _a3, _b2, _c2, _d2;
|
|
1454
|
-
const line_used = __spreadValues(__spreadValues({}, line), data);
|
|
1455
|
-
setConferenceCallMuteOrUnMute(true);
|
|
1456
|
-
const payload = {
|
|
1457
|
-
action: "EXTERNAL_CONFERENCE",
|
|
1458
|
-
operation: type,
|
|
1459
|
-
channel_no: type === "MUTEUSER" ? `mute${line_used.line}` : `play${line_used.line}`,
|
|
1460
|
-
userid: (_b2 = (_a3 = state.callData) == null ? void 0 : _a3.agent_id) != null ? _b2 : "",
|
|
1461
|
-
thirdparty_no: line_used.phone,
|
|
1462
|
-
process: (_d2 = (_c2 = state.callData) == null ? void 0 : _c2.process_name) != null ? _d2 : ""
|
|
1463
|
-
};
|
|
1464
|
-
axios_default.post(END_POINT.CONFERENCE_CALL_MUTE_OT_UN_MUTE, payload).then((res) => {
|
|
1465
|
-
var _a4;
|
|
1466
|
-
showToast((_a4 = res.data) == null ? void 0 : _a4.message, "success");
|
|
1467
|
-
sdkStateManager.setConferenceLine(__spreadValues(__spreadValues({}, line), data));
|
|
1468
|
-
}).catch((err) => {
|
|
1469
|
-
var _a4, _b3, _c3, _d3;
|
|
1470
|
-
const message = ((_b3 = (_a4 = err.response) == null ? void 0 : _a4.data) == null ? void 0 : _b3.detail) || ((_d3 = (_c3 = err.response) == null ? void 0 : _c3.data) == null ? void 0 : _d3.message) || err.message || "An unknown error occurred";
|
|
1471
|
-
showToast(message, "error");
|
|
1472
|
-
}).finally(() => {
|
|
1473
|
-
setConferenceCallMuteOrUnMute(false);
|
|
1474
|
-
});
|
|
1475
|
-
};
|
|
1476
1508
|
const onEndConferenceCall = (line, data) => {
|
|
1477
1509
|
var _a3, _b2, _c2, _d2;
|
|
1478
1510
|
const line_used = __spreadValues(__spreadValues({}, line), data);
|
|
@@ -1498,6 +1530,38 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1498
1530
|
setConferenceCallEnd(false);
|
|
1499
1531
|
});
|
|
1500
1532
|
};
|
|
1533
|
+
const [holdOrUnHold, { isLoading: holdOrUnHoldLoading }] = usePostRequest({
|
|
1534
|
+
onSuccess: () => {
|
|
1535
|
+
sdkStateManager.setHolding(!state.isHolding);
|
|
1536
|
+
},
|
|
1537
|
+
onError: (error) => {
|
|
1538
|
+
console.log("\u274C Hold operation error:", error);
|
|
1539
|
+
}
|
|
1540
|
+
});
|
|
1541
|
+
const [muteOrUnMute, { isLoading: muteOrUnMuteLoading }] = usePostRequest({
|
|
1542
|
+
onSuccess: () => {
|
|
1543
|
+
sdkStateManager.setMuted(!state.isMuted);
|
|
1544
|
+
},
|
|
1545
|
+
onError: (error) => {
|
|
1546
|
+
console.log("\u274C Mute operation error:", error);
|
|
1547
|
+
}
|
|
1548
|
+
});
|
|
1549
|
+
const handleHoldToggle = () => {
|
|
1550
|
+
var _a3;
|
|
1551
|
+
const payload = {
|
|
1552
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.hold) === 1 ? "UNHOLD" : "HOLD",
|
|
1553
|
+
userId: state.agentId
|
|
1554
|
+
};
|
|
1555
|
+
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
1556
|
+
};
|
|
1557
|
+
const handleMuteToggle = () => {
|
|
1558
|
+
var _a3;
|
|
1559
|
+
const payload = {
|
|
1560
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.mute) === 1 ? "UNMUTE" : "MUTE",
|
|
1561
|
+
userId: state.agentId
|
|
1562
|
+
};
|
|
1563
|
+
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
1564
|
+
};
|
|
1501
1565
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1502
1566
|
import_material3.TableRow,
|
|
1503
1567
|
{
|
|
@@ -1509,7 +1573,9 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1509
1573
|
import_material3.TableCell,
|
|
1510
1574
|
{
|
|
1511
1575
|
sx: {
|
|
1512
|
-
padding: "6px"
|
|
1576
|
+
padding: "6px",
|
|
1577
|
+
flex: 1,
|
|
1578
|
+
width: "100px"
|
|
1513
1579
|
},
|
|
1514
1580
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Typography, { children: [
|
|
1515
1581
|
"Line ",
|
|
@@ -1522,7 +1588,8 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1522
1588
|
import_material3.TableCell,
|
|
1523
1589
|
{
|
|
1524
1590
|
sx: {
|
|
1525
|
-
padding: "6px"
|
|
1591
|
+
padding: "6px",
|
|
1592
|
+
width: "100px"
|
|
1526
1593
|
},
|
|
1527
1594
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1528
1595
|
import_material3.Typography,
|
|
@@ -1530,7 +1597,8 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1530
1597
|
variant: "body2",
|
|
1531
1598
|
sx: {
|
|
1532
1599
|
px: 1,
|
|
1533
|
-
borderRadius: "10px"
|
|
1600
|
+
borderRadius: "10px",
|
|
1601
|
+
flex: 1
|
|
1534
1602
|
},
|
|
1535
1603
|
children: (_e = each == null ? void 0 : each.status) != null ? _e : ""
|
|
1536
1604
|
}
|
|
@@ -1541,25 +1609,8 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1541
1609
|
import_material3.TableCell,
|
|
1542
1610
|
{
|
|
1543
1611
|
sx: {
|
|
1544
|
-
padding: "6px"
|
|
1545
|
-
|
|
1546
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1547
|
-
import_material3.Button,
|
|
1548
|
-
{
|
|
1549
|
-
sx: {
|
|
1550
|
-
textTransform: "capitalize"
|
|
1551
|
-
},
|
|
1552
|
-
size: "small",
|
|
1553
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Typography, { variant: "body2", children: (each == null ? void 0 : each.line) === 1 ? "Internal" : "External" })
|
|
1554
|
-
}
|
|
1555
|
-
)
|
|
1556
|
-
}
|
|
1557
|
-
),
|
|
1558
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1559
|
-
import_material3.TableCell,
|
|
1560
|
-
{
|
|
1561
|
-
sx: {
|
|
1562
|
-
padding: "6px"
|
|
1612
|
+
padding: "6px",
|
|
1613
|
+
flex: 1
|
|
1563
1614
|
},
|
|
1564
1615
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1565
1616
|
import_material3.TextField,
|
|
@@ -1568,7 +1619,7 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1568
1619
|
placeholder: "Phone Number",
|
|
1569
1620
|
fullWidth: true,
|
|
1570
1621
|
value: (each == null ? void 0 : each.phone) || "",
|
|
1571
|
-
disabled: (each == null ? void 0 : each.line) === 1 || (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "DISCONNECTED" || (each == null ? void 0 : each.status) === "CONFERENCE" || (each == null ? void 0 : each.status) === "HOLD" || (each == null ? void 0 : each.status) === "MUTE",
|
|
1622
|
+
disabled: (each == null ? void 0 : each.line) === 1 || (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "DISCONNECTED" || (each == null ? void 0 : each.status) === "CONFERENCE" || (each == null ? void 0 : each.status) === "HOLD" || (each == null ? void 0 : each.status) === "MUTE" || (each == null ? void 0 : each.status) === "DIALING" || (each == null ? void 0 : each.status) === "RINGING",
|
|
1572
1623
|
onChange: (e) => {
|
|
1573
1624
|
onConferenceLineUpdate(each, { phone: e.target.value });
|
|
1574
1625
|
}
|
|
@@ -1580,17 +1631,100 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1580
1631
|
import_material3.TableCell,
|
|
1581
1632
|
{
|
|
1582
1633
|
sx: {
|
|
1583
|
-
padding: "6px"
|
|
1634
|
+
padding: "6px",
|
|
1635
|
+
// width: "200px",
|
|
1636
|
+
flex: 1
|
|
1584
1637
|
},
|
|
1585
1638
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1586
1639
|
import_material3.Box,
|
|
1587
1640
|
{
|
|
1588
1641
|
sx: {
|
|
1642
|
+
width: "100%",
|
|
1589
1643
|
display: "flex",
|
|
1590
1644
|
alignItems: "center",
|
|
1591
|
-
justifyContent: "
|
|
1645
|
+
justifyContent: "flex-start",
|
|
1646
|
+
gap: "10px"
|
|
1592
1647
|
},
|
|
1593
1648
|
children: [
|
|
1649
|
+
(each == null ? void 0 : each.line) === 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: ((_f = state.callData) == null ? void 0 : _f.hold) === 1 ? "Resume" : "Hold", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1650
|
+
import_material3.Button,
|
|
1651
|
+
{
|
|
1652
|
+
variant: ((_g = state.callData) == null ? void 0 : _g.hold) === 1 && ((_i = (_h = state.callData) == null ? void 0 : _h.status) == null ? void 0 : _i.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
|
|
1653
|
+
onClick: (e) => {
|
|
1654
|
+
e.stopPropagation();
|
|
1655
|
+
handleHoldToggle();
|
|
1656
|
+
},
|
|
1657
|
+
sx: ((_j = state.callData) == null ? void 0 : _j.hold) === 1 && ((_l = (_k = state.callData) == null ? void 0 : _k.status) == null ? void 0 : _l.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_n = (_m = state.callData) == null ? void 0 : _m.status) == null ? void 0 : _n.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
1658
|
+
disabled: ((_p = (_o = state.callData) == null ? void 0 : _o.status) == null ? void 0 : _p.toUpperCase()) !== "ONCALL" && ((_q = state.callData) == null ? void 0 : _q.hold) !== 1 || holdOrUnHoldLoading,
|
|
1659
|
+
children: ((_r = state.callData) == null ? void 0 : _r.hold) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1660
|
+
import_material3.Box,
|
|
1661
|
+
{
|
|
1662
|
+
sx: {
|
|
1663
|
+
display: "flex",
|
|
1664
|
+
alignItems: "center",
|
|
1665
|
+
justifyContent: "center",
|
|
1666
|
+
gap: "5px",
|
|
1667
|
+
width: "98px"
|
|
1668
|
+
},
|
|
1669
|
+
children: [
|
|
1670
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1671
|
+
import_material3.Typography,
|
|
1672
|
+
{
|
|
1673
|
+
variant: "body2",
|
|
1674
|
+
sx: {
|
|
1675
|
+
fontSize: "12px",
|
|
1676
|
+
color: ((_s = state.callData) == null ? void 0 : _s.hold) === 1 ? "#fff" : "initial"
|
|
1677
|
+
},
|
|
1678
|
+
children: "Unhold"
|
|
1679
|
+
}
|
|
1680
|
+
),
|
|
1681
|
+
holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1682
|
+
import_material3.CircularProgress,
|
|
1683
|
+
{
|
|
1684
|
+
size: "16px",
|
|
1685
|
+
sx: {
|
|
1686
|
+
color: theme.palette.primary.main
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.PlayArrow, {})
|
|
1690
|
+
]
|
|
1691
|
+
}
|
|
1692
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1693
|
+
import_material3.Box,
|
|
1694
|
+
{
|
|
1695
|
+
sx: {
|
|
1696
|
+
display: "flex",
|
|
1697
|
+
alignItems: "center",
|
|
1698
|
+
justifyContent: "center",
|
|
1699
|
+
gap: "5px",
|
|
1700
|
+
width: "98px"
|
|
1701
|
+
},
|
|
1702
|
+
children: [
|
|
1703
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1704
|
+
import_material3.Typography,
|
|
1705
|
+
{
|
|
1706
|
+
variant: "body2",
|
|
1707
|
+
sx: {
|
|
1708
|
+
color: ((_t = state.callData) == null ? void 0 : _t.hold) === 1 ? "#fff" : "#000",
|
|
1709
|
+
fontSize: "12px"
|
|
1710
|
+
},
|
|
1711
|
+
children: "Hold"
|
|
1712
|
+
}
|
|
1713
|
+
),
|
|
1714
|
+
holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1715
|
+
import_material3.CircularProgress,
|
|
1716
|
+
{
|
|
1717
|
+
size: "16px",
|
|
1718
|
+
sx: {
|
|
1719
|
+
color: theme.palette.primary.main
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Pause, {})
|
|
1723
|
+
]
|
|
1724
|
+
}
|
|
1725
|
+
)
|
|
1726
|
+
}
|
|
1727
|
+
) }),
|
|
1594
1728
|
(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)(
|
|
1595
1729
|
import_material3.Button,
|
|
1596
1730
|
{
|
|
@@ -1628,31 +1762,25 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1628
1762
|
)
|
|
1629
1763
|
}
|
|
1630
1764
|
) }),
|
|
1631
|
-
(each == null ? void 0 : each.line)
|
|
1765
|
+
(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)(
|
|
1632
1766
|
import_material3.Button,
|
|
1633
1767
|
{
|
|
1634
|
-
variant:
|
|
1635
|
-
sx:
|
|
1768
|
+
variant: (each == null ? void 0 : each.status) === "ONCALL" ? "contained" : "outlined",
|
|
1769
|
+
sx: (each == null ? void 0 : each.status) === "ONCALL" ? __spreadValues({}, enabled) : __spreadValues({}, disabled),
|
|
1636
1770
|
onClick: () => {
|
|
1637
1771
|
onMergeConferenceCall(each, {
|
|
1638
1772
|
isMergeCall: true
|
|
1639
1773
|
});
|
|
1640
1774
|
},
|
|
1641
|
-
disabled:
|
|
1642
|
-
children:
|
|
1643
|
-
(each == null ? void 0 : each.isMergeCall) ? "Merged" : "Merge",
|
|
1644
|
-
conferenceCallMerge ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.CircularProgress, { size: "20px" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.CallSplit, {})
|
|
1645
|
-
]
|
|
1775
|
+
disabled: (each == null ? void 0 : each.status) !== "ONCALL",
|
|
1776
|
+
children: conferenceCallMerge ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.CircularProgress, { size: "20px" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.CallSplit, {})
|
|
1646
1777
|
}
|
|
1647
1778
|
) }),
|
|
1648
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: (each == null ? void 0 : each.status) !== "HOLD" ? "Hold" : "Un Hold", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1779
|
+
(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" : "Un Hold", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1649
1780
|
import_material3.Button,
|
|
1650
1781
|
{
|
|
1651
1782
|
variant: (each == null ? void 0 : each.status) === "HOLD" ? "contained" : "outlined",
|
|
1652
|
-
sx: (each == null ? void 0 : each.status) === "
|
|
1653
|
-
// each.status === "IDLE"
|
|
1654
|
-
__spreadValues({}, outlined)
|
|
1655
|
-
) : __spreadValues({}, disabled),
|
|
1783
|
+
sx: (each == null ? void 0 : each.status) === "CONFERENCE" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
1656
1784
|
onClick: () => {
|
|
1657
1785
|
if (each.status === "HOLD") {
|
|
1658
1786
|
onHoldOrUnHoldConferenceCall(each, { isHold: false }, "UNHOLDUSER");
|
|
@@ -1660,7 +1788,11 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1660
1788
|
onHoldOrUnHoldConferenceCall(each, { isHold: true }, "HOLDUSER");
|
|
1661
1789
|
}
|
|
1662
1790
|
},
|
|
1663
|
-
disabled: (each == null ? void 0 : each.status)
|
|
1791
|
+
disabled: (each == null ? void 0 : each.status) !== "CONFERENCE" && (each == null ? void 0 : each.status) !== "HOLD" || // each?.status === "IDLE" ||
|
|
1792
|
+
// each?.status === "ONCALL" ||
|
|
1793
|
+
// each?.status === "DIALING" ||
|
|
1794
|
+
// each?.status === "RINGING" ||
|
|
1795
|
+
conferenceCallHoldOrUnHold,
|
|
1664
1796
|
children: conferenceCallHoldOrUnHold ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1665
1797
|
import_material3.CircularProgress,
|
|
1666
1798
|
{
|
|
@@ -1672,31 +1804,7 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1672
1804
|
) : each.status === "HOLD" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.PlayArrow, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Pause, {})
|
|
1673
1805
|
}
|
|
1674
1806
|
) }),
|
|
1675
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title:
|
|
1676
|
-
import_material3.Button,
|
|
1677
|
-
{
|
|
1678
|
-
variant: each.status === "MUTE" ? "contained" : "outlined",
|
|
1679
|
-
sx: each.status === "DISCONNECTED" || (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "CONFERENCE" || (each == null ? void 0 : each.status) === "DIALING" || (each == null ? void 0 : each.status) === "RINGING" ? __spreadValues({}, disabled) : (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "CONFERENCE" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
1680
|
-
onClick: () => {
|
|
1681
|
-
if (each.status === "MUTE") {
|
|
1682
|
-
onMuteOrUnMuteConferenceCall(each, { isMute: false }, "PLAYUSER");
|
|
1683
|
-
} else {
|
|
1684
|
-
onMuteOrUnMuteConferenceCall(each, { isMute: true }, "MUTEUSER");
|
|
1685
|
-
}
|
|
1686
|
-
},
|
|
1687
|
-
disabled: (each == null ? void 0 : each.status) === "DISCONNECTED" || (each == null ? void 0 : each.status) === "IDLE" || (each == null ? void 0 : each.status) === "HOLD" || (each == null ? void 0 : each.status) === "ONCALL" || (each == null ? void 0 : each.status) === "DIALING" || (each == null ? void 0 : each.status) === "RINGING" || conferenceCallMuteOrUnMute,
|
|
1688
|
-
children: conferenceCallMuteOrUnMute ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1689
|
-
import_material3.CircularProgress,
|
|
1690
|
-
{
|
|
1691
|
-
size: "20px",
|
|
1692
|
-
sx: {
|
|
1693
|
-
color: theme.palette.primary.main
|
|
1694
|
-
}
|
|
1695
|
-
}
|
|
1696
|
-
) : each.status === "MUTE" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.MicOff, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Mic, {})
|
|
1697
|
-
}
|
|
1698
|
-
) }),
|
|
1699
|
-
(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)(
|
|
1807
|
+
(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)(
|
|
1700
1808
|
import_material3.Button,
|
|
1701
1809
|
{
|
|
1702
1810
|
variant: (each == null ? void 0 : each.status) !== "IDLE" && (each == null ? void 0 : each.status) !== "DISCONNECTED" ? "contained" : "outlined",
|
|
@@ -1730,32 +1838,7 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1730
1838
|
}
|
|
1731
1839
|
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.CallEnd, {})
|
|
1732
1840
|
}
|
|
1733
|
-
) })
|
|
1734
|
-
import_material3.Button,
|
|
1735
|
-
{
|
|
1736
|
-
variant: (each == null ? void 0 : each.status) !== "IDLE" || (each == null ? void 0 : each.status) !== "DISCONNECTED" ? "contained" : "outlined",
|
|
1737
|
-
color: "error",
|
|
1738
|
-
sx: {
|
|
1739
|
-
display: "none"
|
|
1740
|
-
},
|
|
1741
|
-
onClick: () => {
|
|
1742
|
-
onEndConferenceCall(each, {
|
|
1743
|
-
isCallStart: false,
|
|
1744
|
-
isMergeCall: false,
|
|
1745
|
-
isMute: false,
|
|
1746
|
-
isHold: false
|
|
1747
|
-
});
|
|
1748
|
-
},
|
|
1749
|
-
disabled: (each == null ? void 0 : each.status) === "IDLE" || (each == null ? void 0 : each.status) === "DISCONNECTED" || conferenceCallEnd,
|
|
1750
|
-
children: conferenceCallEnd ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1751
|
-
import_material3.CircularProgress,
|
|
1752
|
-
{
|
|
1753
|
-
size: "20px",
|
|
1754
|
-
color: "error"
|
|
1755
|
-
}
|
|
1756
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.CallEnd, {})
|
|
1757
|
-
}
|
|
1758
|
-
)
|
|
1841
|
+
) })
|
|
1759
1842
|
]
|
|
1760
1843
|
}
|
|
1761
1844
|
)
|
|
@@ -1796,22 +1879,12 @@ function ConferenceDialog() {
|
|
|
1796
1879
|
setConferenceCallEndAll(false);
|
|
1797
1880
|
});
|
|
1798
1881
|
};
|
|
1799
|
-
const isMergeCall = (0, import_react10.useMemo)(() => {
|
|
1800
|
-
var _a3;
|
|
1801
|
-
return (_a3 = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _a3.some((each) => {
|
|
1802
|
-
if ((each == null ? void 0 : each.line) !== 1) {
|
|
1803
|
-
return (each == null ? void 0 : each.status) === "ONCALL";
|
|
1804
|
-
}
|
|
1805
|
-
return false;
|
|
1806
|
-
});
|
|
1807
|
-
}, [state == null ? void 0 : state.conferenceLine]);
|
|
1808
1882
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1809
1883
|
import_material3.Dialog,
|
|
1810
1884
|
{
|
|
1811
1885
|
open: state.openConferenceDialog,
|
|
1812
1886
|
"aria-labelledby": "alert-dialog-title",
|
|
1813
1887
|
"aria-describedby": "alert-dialog-description",
|
|
1814
|
-
fullWidth: true,
|
|
1815
1888
|
maxWidth: "md",
|
|
1816
1889
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Paper, { sx: { borderRadius: 2 }, children: [
|
|
1817
1890
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
@@ -1880,15 +1953,6 @@ function ConferenceDialog() {
|
|
|
1880
1953
|
children: "Status"
|
|
1881
1954
|
}
|
|
1882
1955
|
),
|
|
1883
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1884
|
-
import_material3.TableCell,
|
|
1885
|
-
{
|
|
1886
|
-
sx: {
|
|
1887
|
-
padding: "6px"
|
|
1888
|
-
},
|
|
1889
|
-
children: "Call Type"
|
|
1890
|
-
}
|
|
1891
|
-
),
|
|
1892
1956
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1893
1957
|
import_material3.TableCell,
|
|
1894
1958
|
{
|
|
@@ -1910,13 +1974,7 @@ function ConferenceDialog() {
|
|
|
1910
1974
|
]
|
|
1911
1975
|
}
|
|
1912
1976
|
) }),
|
|
1913
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.TableBody, { children: state == null ? void 0 : state.conferenceLine.map((each) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1914
|
-
ConferenceTableRow,
|
|
1915
|
-
{
|
|
1916
|
-
each,
|
|
1917
|
-
isMergeCall
|
|
1918
|
-
}
|
|
1919
|
-
)) })
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.TableBody, { children: state == null ? void 0 : state.conferenceLine.map((each) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ConferenceTableRow, { each })) })
|
|
1920
1978
|
]
|
|
1921
1979
|
}
|
|
1922
1980
|
)
|
|
@@ -2822,19 +2880,19 @@ var getCombineConfrenceData = (localState, apiData) => {
|
|
|
2822
2880
|
const localConfrenceData = localState == null ? void 0 : localState.conferenceLine;
|
|
2823
2881
|
const apiConferenceData = apiData == null ? void 0 : apiData.conferencestatus;
|
|
2824
2882
|
const updatedConferenceData = localConfrenceData.map((item) => {
|
|
2825
|
-
var _a2, _b, _c, _d;
|
|
2883
|
+
var _a2, _b, _c, _d, _e;
|
|
2826
2884
|
if ((item == null ? void 0 : item.line) === 1) {
|
|
2827
2885
|
const statusKey = `line_${item.line}_status`;
|
|
2828
2886
|
return __spreadProps(__spreadValues({}, item), {
|
|
2829
2887
|
line: 1,
|
|
2830
|
-
status: (
|
|
2831
|
-
phone: (
|
|
2888
|
+
status: (_b = apiConferenceData[statusKey]) != null ? _b : (_a2 = localState == null ? void 0 : localState.callData) == null ? void 0 : _a2.status,
|
|
2889
|
+
phone: (_d = (_c = localState == null ? void 0 : localState.callData) == null ? void 0 : _c.phone_number) != null ? _d : ""
|
|
2832
2890
|
});
|
|
2833
2891
|
} else {
|
|
2834
2892
|
const statusKey = `line_${item.line}_status`;
|
|
2835
2893
|
const phoneKey = `line_${item.line}_phonenumber`;
|
|
2836
2894
|
return __spreadProps(__spreadValues({}, item), {
|
|
2837
|
-
status: (
|
|
2895
|
+
status: (_e = apiConferenceData[statusKey]) != null ? _e : item.status,
|
|
2838
2896
|
phone: apiConferenceData[phoneKey] === null || apiConferenceData[phoneKey] === "0" ? item.phone : apiConferenceData[phoneKey]
|
|
2839
2897
|
});
|
|
2840
2898
|
}
|
|
@@ -2847,7 +2905,7 @@ var formatDuration = (seconds) => {
|
|
|
2847
2905
|
return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
2848
2906
|
};
|
|
2849
2907
|
function CallControls({ onDataChange }) {
|
|
2850
|
-
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;
|
|
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;
|
|
2851
2909
|
const theme = (0, import_material4.useTheme)();
|
|
2852
2910
|
const state = useSDKState();
|
|
2853
2911
|
const { showToast } = useToast();
|
|
@@ -2912,7 +2970,11 @@ function CallControls({ onDataChange }) {
|
|
|
2912
2970
|
});
|
|
2913
2971
|
const [readyAgentStatus, { isLoading: agentReadyLoading }] = usePostRequest();
|
|
2914
2972
|
const [updateAgentStatus, { isLoading }] = usePostRequest();
|
|
2915
|
-
const [endCall, { isLoading: endCallLoading }] = usePostRequest(
|
|
2973
|
+
const [endCall, { isLoading: endCallLoading }] = usePostRequest({
|
|
2974
|
+
onSuccess: () => {
|
|
2975
|
+
sdkStateManager.resetConferenceLines();
|
|
2976
|
+
}
|
|
2977
|
+
});
|
|
2916
2978
|
const handleCloseQueueCounts = () => {
|
|
2917
2979
|
setAnchorEl(null);
|
|
2918
2980
|
};
|
|
@@ -2964,15 +3026,17 @@ function CallControls({ onDataChange }) {
|
|
|
2964
3026
|
}
|
|
2965
3027
|
};
|
|
2966
3028
|
const handleHoldToggle = () => {
|
|
3029
|
+
var _a3;
|
|
2967
3030
|
const payload = {
|
|
2968
|
-
action: state.
|
|
3031
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.hold) === 1 ? "UNHOLD" : "HOLD",
|
|
2969
3032
|
userId: state.agentId
|
|
2970
3033
|
};
|
|
2971
3034
|
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
2972
3035
|
};
|
|
2973
3036
|
const handleMuteToggle = () => {
|
|
3037
|
+
var _a3;
|
|
2974
3038
|
const payload = {
|
|
2975
|
-
action: state.
|
|
3039
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.mute) === 1 ? "UNMUTE" : "MUTE",
|
|
2976
3040
|
userId: state.agentId
|
|
2977
3041
|
};
|
|
2978
3042
|
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
@@ -3378,16 +3442,16 @@ function CallControls({ onDataChange }) {
|
|
|
3378
3442
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.SupportAgent, {})
|
|
3379
3443
|
}
|
|
3380
3444
|
) }),
|
|
3381
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: state.
|
|
3445
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((_I = state.callData) == null ? void 0 : _I.hold) === 1 ? "Resume" : "Hold", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3382
3446
|
import_material4.Button,
|
|
3383
3447
|
{
|
|
3384
|
-
variant: state.
|
|
3448
|
+
variant: ((_J = state.callData) == null ? void 0 : _J.hold) === 1 && ((_L = (_K = state.callData) == null ? void 0 : _K.status) == null ? void 0 : _L.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
|
|
3385
3449
|
onClick: (e) => {
|
|
3386
3450
|
e.stopPropagation();
|
|
3387
3451
|
handleHoldToggle();
|
|
3388
3452
|
},
|
|
3389
|
-
sx: state.
|
|
3390
|
-
disabled: ((
|
|
3453
|
+
sx: ((_M = state.callData) == null ? void 0 : _M.hold) === 1 && ((_O = (_N = state.callData) == null ? void 0 : _N.status) == null ? void 0 : _O.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_Q = (_P = state.callData) == null ? void 0 : _P.status) == null ? void 0 : _Q.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3454
|
+
disabled: ((_S = (_R = state.callData) == null ? void 0 : _R.status) == null ? void 0 : _S.toUpperCase()) !== "ONCALL" && ((_T = state.callData) == null ? void 0 : _T.hold) !== 1 || holdOrUnHoldLoading,
|
|
3391
3455
|
children: holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3392
3456
|
import_material4.CircularProgress,
|
|
3393
3457
|
{
|
|
@@ -3396,19 +3460,19 @@ function CallControls({ onDataChange }) {
|
|
|
3396
3460
|
color: theme.palette.primary.main
|
|
3397
3461
|
}
|
|
3398
3462
|
}
|
|
3399
|
-
) : state.
|
|
3463
|
+
) : ((_U = state.callData) == null ? void 0 : _U.hold) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.PlayArrow, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Pause, {})
|
|
3400
3464
|
}
|
|
3401
3465
|
) }),
|
|
3402
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: state.
|
|
3466
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: ((_V = state.callData) == null ? void 0 : _V.mute) === 1 ? "Unmute" : "Mute", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3403
3467
|
import_material4.Button,
|
|
3404
3468
|
{
|
|
3405
|
-
variant: state.isHolding ? "outlined" : state.
|
|
3469
|
+
variant: state.isHolding ? "outlined" : ((_W = state.callData) == null ? void 0 : _W.mute) === 1 && ((_Y = (_X = state.callData) == null ? void 0 : _X.status) == null ? void 0 : _Y.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
|
|
3406
3470
|
onClick: (e) => {
|
|
3407
3471
|
e.stopPropagation();
|
|
3408
3472
|
handleMuteToggle();
|
|
3409
3473
|
},
|
|
3410
|
-
sx: state.
|
|
3411
|
-
disabled: ((
|
|
3474
|
+
sx: ((_Z = state.callData) == null ? void 0 : _Z.hold) === 1 ? __spreadValues({}, disabled) : ((__ = state.callData) == null ? void 0 : __.mute) === 1 && ((_aa = (_$ = state.callData) == null ? void 0 : _$.status) == null ? void 0 : _aa.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_ca = (_ba = state.callData) == null ? void 0 : _ba.status) == null ? void 0 : _ca.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3475
|
+
disabled: ((_ea = (_da = state.callData) == null ? void 0 : _da.status) == null ? void 0 : _ea.toUpperCase()) !== "ONCALL" && ((_fa = state.callData) == null ? void 0 : _fa.mute) !== 1 || muteOrUnMuteLoading || ((_ga = state.callData) == null ? void 0 : _ga.hold) === 1,
|
|
3412
3476
|
children: muteOrUnMuteLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3413
3477
|
import_material4.CircularProgress,
|
|
3414
3478
|
{
|
|
@@ -3417,10 +3481,10 @@ function CallControls({ onDataChange }) {
|
|
|
3417
3481
|
color: theme.palette.primary.main
|
|
3418
3482
|
}
|
|
3419
3483
|
}
|
|
3420
|
-
) : state.
|
|
3484
|
+
) : ((_ha = state.callData) == null ? void 0 : _ha.mute) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.MicOff, {}) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Mic, {})
|
|
3421
3485
|
}
|
|
3422
3486
|
) }),
|
|
3423
|
-
!((
|
|
3487
|
+
!((_ia = state.sdkConfig) == null ? void 0 : _ia.disableCallTransferButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Transfer Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3424
3488
|
import_material4.Button,
|
|
3425
3489
|
{
|
|
3426
3490
|
variant: state.openCallTransferDialog ? "contained" : "outlined",
|
|
@@ -3431,12 +3495,12 @@ function CallControls({ onDataChange }) {
|
|
|
3431
3495
|
sdkStateManager.setOpenCallTransferDialog(true);
|
|
3432
3496
|
}
|
|
3433
3497
|
},
|
|
3434
|
-
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((
|
|
3435
|
-
disabled: ((
|
|
3498
|
+
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((_ka = (_ja = state.callData) == null ? void 0 : _ja.status) == null ? void 0 : _ka.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3499
|
+
disabled: ((_ma = (_la = state.callData) == null ? void 0 : _la.status) == null ? void 0 : _ma.toUpperCase()) !== "ONCALL",
|
|
3436
3500
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.TransferWithinAStation, {})
|
|
3437
3501
|
}
|
|
3438
3502
|
) }),
|
|
3439
|
-
!((
|
|
3503
|
+
!((_na = state.sdkConfig) == null ? void 0 : _na.disableConferenceButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "Conference Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3440
3504
|
import_material4.Button,
|
|
3441
3505
|
{
|
|
3442
3506
|
variant: state.openConferenceDialog ? "contained" : "outlined",
|
|
@@ -3447,15 +3511,15 @@ function CallControls({ onDataChange }) {
|
|
|
3447
3511
|
sdkStateManager.setOpenConferenceDialog(true);
|
|
3448
3512
|
}
|
|
3449
3513
|
},
|
|
3450
|
-
sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((
|
|
3451
|
-
disabled: ((
|
|
3514
|
+
sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((_pa = (_oa = state.callData) == null ? void 0 : _oa.status) == null ? void 0 : _pa.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3515
|
+
disabled: ((_ra = (_qa = state.callData) == null ? void 0 : _qa.status) == null ? void 0 : _ra.toUpperCase()) !== "ONCALL",
|
|
3452
3516
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Group, {})
|
|
3453
3517
|
}
|
|
3454
3518
|
) }),
|
|
3455
|
-
!((
|
|
3519
|
+
!((_sa = state.sdkConfig) == null ? void 0 : _sa.disableEndCallButton) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: "End Call", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3456
3520
|
import_material4.Button,
|
|
3457
3521
|
{
|
|
3458
|
-
variant: ((
|
|
3522
|
+
variant: ((_ua = (_ta = state.callData) == null ? void 0 : _ta.status) == null ? void 0 : _ua.toUpperCase()) === "ONCALL" || ((_wa = (_va = state.callData) == null ? void 0 : _va.status) == null ? void 0 : _wa.toUpperCase()) === "RINGING" || ((_ya = (_xa = state.callData) == null ? void 0 : _xa.status) == null ? void 0 : _ya.toUpperCase()) === "WRAPUP" ? "contained" : "outlined",
|
|
3459
3523
|
onClick: (e) => {
|
|
3460
3524
|
var _a3, _b2, _c2, _d2, _e2, _f2;
|
|
3461
3525
|
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") {
|
|
@@ -3463,7 +3527,7 @@ function CallControls({ onDataChange }) {
|
|
|
3463
3527
|
setOpenCallDisposition(true);
|
|
3464
3528
|
}
|
|
3465
3529
|
},
|
|
3466
|
-
sx: ((
|
|
3530
|
+
sx: ((_Aa = (_za = state.callData) == null ? void 0 : _za.status) == null ? void 0 : _Aa.toUpperCase()) === "ONCALL" || ((_Ca = (_Ba = state.callData) == null ? void 0 : _Ba.status) == null ? void 0 : _Ca.toUpperCase()) === "RINGING" || ((_Ea = (_Da = state.callData) == null ? void 0 : _Da.status) == null ? void 0 : _Ea.toUpperCase()) === "WRAPUP" ? __spreadProps(__spreadValues({}, enabled), {
|
|
3467
3531
|
borderRight: "1px",
|
|
3468
3532
|
backgroundColor: "error.main",
|
|
3469
3533
|
minWidth: "60px !important",
|
|
@@ -3482,7 +3546,7 @@ function CallControls({ onDataChange }) {
|
|
|
3482
3546
|
}) : __spreadProps(__spreadValues({}, disabled), {
|
|
3483
3547
|
minWidth: "60px !important"
|
|
3484
3548
|
}),
|
|
3485
|
-
disabled: ((
|
|
3549
|
+
disabled: ((_Ga = (_Fa = state.callData) == null ? void 0 : _Fa.status) == null ? void 0 : _Ga.toUpperCase()) !== "ONCALL" && ((_Ia = (_Ha = state.callData) == null ? void 0 : _Ha.status) == null ? void 0 : _Ia.toUpperCase()) !== "RINGING" && ((_Ka = (_Ja = state.callData) == null ? void 0 : _Ja.status) == null ? void 0 : _Ka.toUpperCase()) !== "WRAPUP" || endCallLoading,
|
|
3486
3550
|
children: endCallLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3487
3551
|
import_material4.CircularProgress,
|
|
3488
3552
|
{
|
|
@@ -3522,7 +3586,7 @@ function CallControls({ onDataChange }) {
|
|
|
3522
3586
|
transition: theme.transitions.create(["box-shadow", "transform"], {
|
|
3523
3587
|
duration: theme.transitions.duration.short
|
|
3524
3588
|
}),
|
|
3525
|
-
visibility: showIframe && !((
|
|
3589
|
+
visibility: showIframe && !((_La = state.sdkConfig) == null ? void 0 : _La.disableSoftPhone) ? "visible" : "hidden",
|
|
3526
3590
|
userSelect: "none"
|
|
3527
3591
|
},
|
|
3528
3592
|
children: [
|
|
@@ -3556,7 +3620,7 @@ function CallControls({ onDataChange }) {
|
|
|
3556
3620
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3557
3621
|
"iframe",
|
|
3558
3622
|
{
|
|
3559
|
-
src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(
|
|
3623
|
+
src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(_Ma = state.process) == null ? void 0 : _Ma.process_id}`,
|
|
3560
3624
|
height: 380,
|
|
3561
3625
|
width: 420,
|
|
3562
3626
|
allow: "camera; microphone; autoplay",
|