call-control-sdk 6.4.5-dev.10 → 6.4.5-dev.11
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 +251 -173
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +252 -174
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1360,8 +1360,8 @@ var styles_default = useStyles;
|
|
|
1360
1360
|
|
|
1361
1361
|
// call-control-sdk/lib/components/dialog.tsx
|
|
1362
1362
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
1363
|
-
var ConferenceTableRow = ({ each
|
|
1364
|
-
var _a2, _b, _c, _d, _e;
|
|
1363
|
+
var ConferenceTableRow = ({ each }) => {
|
|
1364
|
+
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;
|
|
1365
1365
|
const state = useSDKState();
|
|
1366
1366
|
const { showToast } = useToast();
|
|
1367
1367
|
const { disabled, enabled, outlined } = styles_default({
|
|
@@ -1373,7 +1373,6 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1373
1373
|
const [conferenceCallStart, setConferenceCallStart] = (0, import_react10.useState)(false);
|
|
1374
1374
|
const [conferenceCallMerge, setConferenceCallMerge] = (0, import_react10.useState)(false);
|
|
1375
1375
|
const [conferenceCallHoldOrUnHold, setConferenceCallHoldOrUnHold] = (0, import_react10.useState)(false);
|
|
1376
|
-
const [conferenceCallMuteOrUnMute, setConferenceCallMuteOrUnMute] = (0, import_react10.useState)(false);
|
|
1377
1376
|
const [conferenceCallEnd, setConferenceCallEnd] = (0, import_react10.useState)(false);
|
|
1378
1377
|
const onConferenceLineUpdate = (line, data) => {
|
|
1379
1378
|
sdkStateManager.setConferenceLine(__spreadValues(__spreadValues({}, line), data));
|
|
@@ -1449,30 +1448,6 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1449
1448
|
setConferenceCallHoldOrUnHold(false);
|
|
1450
1449
|
});
|
|
1451
1450
|
};
|
|
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
1451
|
const onEndConferenceCall = (line, data) => {
|
|
1477
1452
|
var _a3, _b2, _c2, _d2;
|
|
1478
1453
|
const line_used = __spreadValues(__spreadValues({}, line), data);
|
|
@@ -1498,6 +1473,38 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1498
1473
|
setConferenceCallEnd(false);
|
|
1499
1474
|
});
|
|
1500
1475
|
};
|
|
1476
|
+
const [holdOrUnHold, { isLoading: holdOrUnHoldLoading }] = usePostRequest({
|
|
1477
|
+
onSuccess: () => {
|
|
1478
|
+
sdkStateManager.setHolding(!state.isHolding);
|
|
1479
|
+
},
|
|
1480
|
+
onError: (error) => {
|
|
1481
|
+
console.log("\u274C Hold operation error:", error);
|
|
1482
|
+
}
|
|
1483
|
+
});
|
|
1484
|
+
const [muteOrUnMute, { isLoading: muteOrUnMuteLoading }] = usePostRequest({
|
|
1485
|
+
onSuccess: () => {
|
|
1486
|
+
sdkStateManager.setMuted(!state.isMuted);
|
|
1487
|
+
},
|
|
1488
|
+
onError: (error) => {
|
|
1489
|
+
console.log("\u274C Mute operation error:", error);
|
|
1490
|
+
}
|
|
1491
|
+
});
|
|
1492
|
+
const handleHoldToggle = () => {
|
|
1493
|
+
var _a3;
|
|
1494
|
+
const payload = {
|
|
1495
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.hold) === 1 ? "UNHOLD" : "HOLD",
|
|
1496
|
+
userId: state.agentId
|
|
1497
|
+
};
|
|
1498
|
+
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
1499
|
+
};
|
|
1500
|
+
const handleMuteToggle = () => {
|
|
1501
|
+
var _a3;
|
|
1502
|
+
const payload = {
|
|
1503
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.mute) === 1 ? "UNMUTE" : "MUTE",
|
|
1504
|
+
userId: state.agentId
|
|
1505
|
+
};
|
|
1506
|
+
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
1507
|
+
};
|
|
1501
1508
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1502
1509
|
import_material3.TableRow,
|
|
1503
1510
|
{
|
|
@@ -1509,7 +1516,9 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1509
1516
|
import_material3.TableCell,
|
|
1510
1517
|
{
|
|
1511
1518
|
sx: {
|
|
1512
|
-
padding: "6px"
|
|
1519
|
+
padding: "6px",
|
|
1520
|
+
flex: 1,
|
|
1521
|
+
width: "100px"
|
|
1513
1522
|
},
|
|
1514
1523
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Typography, { children: [
|
|
1515
1524
|
"Line ",
|
|
@@ -1522,7 +1531,8 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1522
1531
|
import_material3.TableCell,
|
|
1523
1532
|
{
|
|
1524
1533
|
sx: {
|
|
1525
|
-
padding: "6px"
|
|
1534
|
+
padding: "6px",
|
|
1535
|
+
width: "100px"
|
|
1526
1536
|
},
|
|
1527
1537
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1528
1538
|
import_material3.Typography,
|
|
@@ -1530,7 +1540,8 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1530
1540
|
variant: "body2",
|
|
1531
1541
|
sx: {
|
|
1532
1542
|
px: 1,
|
|
1533
|
-
borderRadius: "10px"
|
|
1543
|
+
borderRadius: "10px",
|
|
1544
|
+
flex: 1
|
|
1534
1545
|
},
|
|
1535
1546
|
children: (_e = each == null ? void 0 : each.status) != null ? _e : ""
|
|
1536
1547
|
}
|
|
@@ -1541,25 +1552,8 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1541
1552
|
import_material3.TableCell,
|
|
1542
1553
|
{
|
|
1543
1554
|
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"
|
|
1555
|
+
padding: "6px",
|
|
1556
|
+
flex: 1
|
|
1563
1557
|
},
|
|
1564
1558
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1565
1559
|
import_material3.TextField,
|
|
@@ -1568,7 +1562,7 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1568
1562
|
placeholder: "Phone Number",
|
|
1569
1563
|
fullWidth: true,
|
|
1570
1564
|
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",
|
|
1565
|
+
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
1566
|
onChange: (e) => {
|
|
1573
1567
|
onConferenceLineUpdate(each, { phone: e.target.value });
|
|
1574
1568
|
}
|
|
@@ -1580,17 +1574,171 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1580
1574
|
import_material3.TableCell,
|
|
1581
1575
|
{
|
|
1582
1576
|
sx: {
|
|
1583
|
-
padding: "6px"
|
|
1577
|
+
padding: "6px",
|
|
1578
|
+
// width: "200px",
|
|
1579
|
+
flex: 1
|
|
1584
1580
|
},
|
|
1585
1581
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1586
1582
|
import_material3.Box,
|
|
1587
1583
|
{
|
|
1588
1584
|
sx: {
|
|
1585
|
+
width: "100%",
|
|
1589
1586
|
display: "flex",
|
|
1590
1587
|
alignItems: "center",
|
|
1591
|
-
justifyContent: "
|
|
1588
|
+
justifyContent: "flex-start",
|
|
1589
|
+
gap: "10px"
|
|
1592
1590
|
},
|
|
1593
1591
|
children: [
|
|
1592
|
+
(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)(
|
|
1593
|
+
import_material3.Button,
|
|
1594
|
+
{
|
|
1595
|
+
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",
|
|
1596
|
+
onClick: (e) => {
|
|
1597
|
+
e.stopPropagation();
|
|
1598
|
+
handleHoldToggle();
|
|
1599
|
+
},
|
|
1600
|
+
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),
|
|
1601
|
+
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,
|
|
1602
|
+
children: ((_r = state.callData) == null ? void 0 : _r.hold) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1603
|
+
import_material3.Box,
|
|
1604
|
+
{
|
|
1605
|
+
sx: {
|
|
1606
|
+
display: "flex",
|
|
1607
|
+
alignItems: "center",
|
|
1608
|
+
justifyContent: "center",
|
|
1609
|
+
gap: "5px",
|
|
1610
|
+
width: "98px"
|
|
1611
|
+
},
|
|
1612
|
+
children: [
|
|
1613
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1614
|
+
import_material3.Typography,
|
|
1615
|
+
{
|
|
1616
|
+
sx: {
|
|
1617
|
+
color: ((_s = state.callData) == null ? void 0 : _s.hold) === 1 ? "#fff" : "initial"
|
|
1618
|
+
},
|
|
1619
|
+
children: "Unhold"
|
|
1620
|
+
}
|
|
1621
|
+
),
|
|
1622
|
+
holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1623
|
+
import_material3.CircularProgress,
|
|
1624
|
+
{
|
|
1625
|
+
size: "16px",
|
|
1626
|
+
sx: {
|
|
1627
|
+
color: theme.palette.primary.main
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.PlayArrow, {})
|
|
1631
|
+
]
|
|
1632
|
+
}
|
|
1633
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1634
|
+
import_material3.Box,
|
|
1635
|
+
{
|
|
1636
|
+
sx: {
|
|
1637
|
+
display: "flex",
|
|
1638
|
+
alignItems: "center",
|
|
1639
|
+
justifyContent: "center",
|
|
1640
|
+
gap: "5px",
|
|
1641
|
+
width: "98px"
|
|
1642
|
+
},
|
|
1643
|
+
children: [
|
|
1644
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1645
|
+
import_material3.Typography,
|
|
1646
|
+
{
|
|
1647
|
+
sx: {
|
|
1648
|
+
color: ((_t = state.callData) == null ? void 0 : _t.hold) === 1 ? "#fff" : "#000"
|
|
1649
|
+
},
|
|
1650
|
+
children: "Hold"
|
|
1651
|
+
}
|
|
1652
|
+
),
|
|
1653
|
+
holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1654
|
+
import_material3.CircularProgress,
|
|
1655
|
+
{
|
|
1656
|
+
size: "16px",
|
|
1657
|
+
sx: {
|
|
1658
|
+
color: theme.palette.primary.main
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Pause, {})
|
|
1662
|
+
]
|
|
1663
|
+
}
|
|
1664
|
+
)
|
|
1665
|
+
}
|
|
1666
|
+
) }),
|
|
1667
|
+
(each == null ? void 0 : each.line) === 1 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.Tooltip, { title: ((_u = state.callData) == null ? void 0 : _u.mute) === 1 ? "Unmute" : "Mute", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1668
|
+
import_material3.Button,
|
|
1669
|
+
{
|
|
1670
|
+
variant: state.isHolding ? "outlined" : ((_v = state.callData) == null ? void 0 : _v.mute) === 1 && ((_x = (_w = state.callData) == null ? void 0 : _w.status) == null ? void 0 : _x.toUpperCase()) === "ONCALL" ? "contained" : "outlined",
|
|
1671
|
+
onClick: (e) => {
|
|
1672
|
+
e.stopPropagation();
|
|
1673
|
+
handleMuteToggle();
|
|
1674
|
+
},
|
|
1675
|
+
sx: ((_y = state.callData) == null ? void 0 : _y.hold) === 1 ? __spreadValues({}, disabled) : ((_z = state.callData) == null ? void 0 : _z.mute) === 1 && ((_B = (_A = state.callData) == null ? void 0 : _A.status) == null ? void 0 : _B.toUpperCase()) === "ONCALL" ? __spreadValues({}, enabled) : ((_D = (_C = state.callData) == null ? void 0 : _C.status) == null ? void 0 : _D.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
1676
|
+
disabled: ((_F = (_E = state.callData) == null ? void 0 : _E.status) == null ? void 0 : _F.toUpperCase()) !== "ONCALL" && ((_G = state.callData) == null ? void 0 : _G.mute) !== 1 || muteOrUnMuteLoading || ((_H = state.callData) == null ? void 0 : _H.hold) === 1,
|
|
1677
|
+
children: ((_I = state.callData) == null ? void 0 : _I.mute) === 1 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1678
|
+
import_material3.Box,
|
|
1679
|
+
{
|
|
1680
|
+
sx: {
|
|
1681
|
+
display: "flex",
|
|
1682
|
+
alignItems: "center",
|
|
1683
|
+
justifyContent: "center",
|
|
1684
|
+
gap: "5px",
|
|
1685
|
+
width: "98px"
|
|
1686
|
+
},
|
|
1687
|
+
children: [
|
|
1688
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1689
|
+
import_material3.Typography,
|
|
1690
|
+
{
|
|
1691
|
+
sx: {
|
|
1692
|
+
color: ((_J = state.callData) == null ? void 0 : _J.mute) === 1 ? "#fff" : "initial"
|
|
1693
|
+
},
|
|
1694
|
+
children: "Unmute"
|
|
1695
|
+
}
|
|
1696
|
+
),
|
|
1697
|
+
muteOrUnMuteLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1698
|
+
import_material3.CircularProgress,
|
|
1699
|
+
{
|
|
1700
|
+
size: "16px",
|
|
1701
|
+
sx: {
|
|
1702
|
+
color: theme.palette.primary.main
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.MicOff, {})
|
|
1706
|
+
]
|
|
1707
|
+
}
|
|
1708
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1709
|
+
import_material3.Box,
|
|
1710
|
+
{
|
|
1711
|
+
sx: {
|
|
1712
|
+
display: "flex",
|
|
1713
|
+
alignItems: "center",
|
|
1714
|
+
justifyContent: "center",
|
|
1715
|
+
gap: "5px",
|
|
1716
|
+
width: "98px"
|
|
1717
|
+
},
|
|
1718
|
+
children: [
|
|
1719
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1720
|
+
import_material3.Typography,
|
|
1721
|
+
{
|
|
1722
|
+
sx: {
|
|
1723
|
+
color: ((_K = state.callData) == null ? void 0 : _K.mute) === 1 ? "#fff" : "#000"
|
|
1724
|
+
},
|
|
1725
|
+
children: "Mute"
|
|
1726
|
+
}
|
|
1727
|
+
),
|
|
1728
|
+
muteOrUnMuteLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1729
|
+
import_material3.CircularProgress,
|
|
1730
|
+
{
|
|
1731
|
+
size: "16px",
|
|
1732
|
+
sx: {
|
|
1733
|
+
color: theme.palette.primary.main
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Mic, {})
|
|
1737
|
+
]
|
|
1738
|
+
}
|
|
1739
|
+
)
|
|
1740
|
+
}
|
|
1741
|
+
) }),
|
|
1594
1742
|
(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
1743
|
import_material3.Button,
|
|
1596
1744
|
{
|
|
@@ -1628,31 +1776,25 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1628
1776
|
)
|
|
1629
1777
|
}
|
|
1630
1778
|
) }),
|
|
1631
|
-
(each == null ? void 0 : each.line)
|
|
1779
|
+
(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
1780
|
import_material3.Button,
|
|
1633
1781
|
{
|
|
1634
|
-
variant:
|
|
1635
|
-
sx:
|
|
1782
|
+
variant: (each == null ? void 0 : each.status) === "ONCALL" ? "contained" : "outlined",
|
|
1783
|
+
sx: (each == null ? void 0 : each.status) === "ONCALL" ? __spreadValues({}, enabled) : __spreadValues({}, disabled),
|
|
1636
1784
|
onClick: () => {
|
|
1637
1785
|
onMergeConferenceCall(each, {
|
|
1638
1786
|
isMergeCall: true
|
|
1639
1787
|
});
|
|
1640
1788
|
},
|
|
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
|
-
]
|
|
1789
|
+
disabled: (each == null ? void 0 : each.status) !== "ONCALL",
|
|
1790
|
+
children: conferenceCallMerge ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material3.CircularProgress, { size: "20px" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.CallSplit, {})
|
|
1646
1791
|
}
|
|
1647
1792
|
) }),
|
|
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)(
|
|
1793
|
+
(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
1794
|
import_material3.Button,
|
|
1650
1795
|
{
|
|
1651
1796
|
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),
|
|
1797
|
+
sx: (each == null ? void 0 : each.status) === "CONFERENCE" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
1656
1798
|
onClick: () => {
|
|
1657
1799
|
if (each.status === "HOLD") {
|
|
1658
1800
|
onHoldOrUnHoldConferenceCall(each, { isHold: false }, "UNHOLDUSER");
|
|
@@ -1660,7 +1802,11 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1660
1802
|
onHoldOrUnHoldConferenceCall(each, { isHold: true }, "HOLDUSER");
|
|
1661
1803
|
}
|
|
1662
1804
|
},
|
|
1663
|
-
disabled: (each == null ? void 0 : each.status)
|
|
1805
|
+
disabled: (each == null ? void 0 : each.status) !== "CONFERENCE" && (each == null ? void 0 : each.status) !== "HOLD" || // each?.status === "IDLE" ||
|
|
1806
|
+
// each?.status === "ONCALL" ||
|
|
1807
|
+
// each?.status === "DIALING" ||
|
|
1808
|
+
// each?.status === "RINGING" ||
|
|
1809
|
+
conferenceCallHoldOrUnHold,
|
|
1664
1810
|
children: conferenceCallHoldOrUnHold ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1665
1811
|
import_material3.CircularProgress,
|
|
1666
1812
|
{
|
|
@@ -1672,31 +1818,7 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1672
1818
|
) : each.status === "HOLD" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.PlayArrow, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.Pause, {})
|
|
1673
1819
|
}
|
|
1674
1820
|
) }),
|
|
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)(
|
|
1821
|
+
(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
1822
|
import_material3.Button,
|
|
1701
1823
|
{
|
|
1702
1824
|
variant: (each == null ? void 0 : each.status) !== "IDLE" && (each == null ? void 0 : each.status) !== "DISCONNECTED" ? "contained" : "outlined",
|
|
@@ -1730,32 +1852,7 @@ var ConferenceTableRow = ({ each, isMergeCall }) => {
|
|
|
1730
1852
|
}
|
|
1731
1853
|
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.CallEnd, {})
|
|
1732
1854
|
}
|
|
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
|
-
)
|
|
1855
|
+
) })
|
|
1759
1856
|
]
|
|
1760
1857
|
}
|
|
1761
1858
|
)
|
|
@@ -1796,22 +1893,12 @@ function ConferenceDialog() {
|
|
|
1796
1893
|
setConferenceCallEndAll(false);
|
|
1797
1894
|
});
|
|
1798
1895
|
};
|
|
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
1896
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1809
1897
|
import_material3.Dialog,
|
|
1810
1898
|
{
|
|
1811
1899
|
open: state.openConferenceDialog,
|
|
1812
1900
|
"aria-labelledby": "alert-dialog-title",
|
|
1813
1901
|
"aria-describedby": "alert-dialog-description",
|
|
1814
|
-
fullWidth: true,
|
|
1815
1902
|
maxWidth: "md",
|
|
1816
1903
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material3.Paper, { sx: { borderRadius: 2 }, children: [
|
|
1817
1904
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
@@ -1880,15 +1967,6 @@ function ConferenceDialog() {
|
|
|
1880
1967
|
children: "Status"
|
|
1881
1968
|
}
|
|
1882
1969
|
),
|
|
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
1970
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1893
1971
|
import_material3.TableCell,
|
|
1894
1972
|
{
|
|
@@ -1910,13 +1988,7 @@ function ConferenceDialog() {
|
|
|
1910
1988
|
]
|
|
1911
1989
|
}
|
|
1912
1990
|
) }),
|
|
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
|
-
)) })
|
|
1991
|
+
/* @__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
1992
|
]
|
|
1921
1993
|
}
|
|
1922
1994
|
)
|
|
@@ -2822,19 +2894,19 @@ var getCombineConfrenceData = (localState, apiData) => {
|
|
|
2822
2894
|
const localConfrenceData = localState == null ? void 0 : localState.conferenceLine;
|
|
2823
2895
|
const apiConferenceData = apiData == null ? void 0 : apiData.conferencestatus;
|
|
2824
2896
|
const updatedConferenceData = localConfrenceData.map((item) => {
|
|
2825
|
-
var _a2, _b, _c, _d;
|
|
2897
|
+
var _a2, _b, _c, _d, _e;
|
|
2826
2898
|
if ((item == null ? void 0 : item.line) === 1) {
|
|
2827
2899
|
const statusKey = `line_${item.line}_status`;
|
|
2828
2900
|
return __spreadProps(__spreadValues({}, item), {
|
|
2829
2901
|
line: 1,
|
|
2830
|
-
status: (
|
|
2831
|
-
phone: (
|
|
2902
|
+
status: (_b = apiConferenceData[statusKey]) != null ? _b : (_a2 = localState == null ? void 0 : localState.callData) == null ? void 0 : _a2.status,
|
|
2903
|
+
phone: (_d = (_c = localState == null ? void 0 : localState.callData) == null ? void 0 : _c.phone_number) != null ? _d : ""
|
|
2832
2904
|
});
|
|
2833
2905
|
} else {
|
|
2834
2906
|
const statusKey = `line_${item.line}_status`;
|
|
2835
2907
|
const phoneKey = `line_${item.line}_phonenumber`;
|
|
2836
2908
|
return __spreadProps(__spreadValues({}, item), {
|
|
2837
|
-
status: (
|
|
2909
|
+
status: (_e = apiConferenceData[statusKey]) != null ? _e : item.status,
|
|
2838
2910
|
phone: apiConferenceData[phoneKey] === null || apiConferenceData[phoneKey] === "0" ? item.phone : apiConferenceData[phoneKey]
|
|
2839
2911
|
});
|
|
2840
2912
|
}
|
|
@@ -2847,7 +2919,7 @@ var formatDuration = (seconds) => {
|
|
|
2847
2919
|
return `${mins.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`;
|
|
2848
2920
|
};
|
|
2849
2921
|
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;
|
|
2922
|
+
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
2923
|
const theme = (0, import_material4.useTheme)();
|
|
2852
2924
|
const state = useSDKState();
|
|
2853
2925
|
const { showToast } = useToast();
|
|
@@ -2912,7 +2984,11 @@ function CallControls({ onDataChange }) {
|
|
|
2912
2984
|
});
|
|
2913
2985
|
const [readyAgentStatus, { isLoading: agentReadyLoading }] = usePostRequest();
|
|
2914
2986
|
const [updateAgentStatus, { isLoading }] = usePostRequest();
|
|
2915
|
-
const [endCall, { isLoading: endCallLoading }] = usePostRequest(
|
|
2987
|
+
const [endCall, { isLoading: endCallLoading }] = usePostRequest({
|
|
2988
|
+
onSuccess: () => {
|
|
2989
|
+
sdkStateManager.resetConferenceLines();
|
|
2990
|
+
}
|
|
2991
|
+
});
|
|
2916
2992
|
const handleCloseQueueCounts = () => {
|
|
2917
2993
|
setAnchorEl(null);
|
|
2918
2994
|
};
|
|
@@ -2964,15 +3040,17 @@ function CallControls({ onDataChange }) {
|
|
|
2964
3040
|
}
|
|
2965
3041
|
};
|
|
2966
3042
|
const handleHoldToggle = () => {
|
|
3043
|
+
var _a3;
|
|
2967
3044
|
const payload = {
|
|
2968
|
-
action: state.
|
|
3045
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.hold) === 1 ? "UNHOLD" : "HOLD",
|
|
2969
3046
|
userId: state.agentId
|
|
2970
3047
|
};
|
|
2971
3048
|
holdOrUnHold(END_POINT.HOLD_CALL, payload);
|
|
2972
3049
|
};
|
|
2973
3050
|
const handleMuteToggle = () => {
|
|
3051
|
+
var _a3;
|
|
2974
3052
|
const payload = {
|
|
2975
|
-
action: state.
|
|
3053
|
+
action: ((_a3 = state.callData) == null ? void 0 : _a3.mute) === 1 ? "UNMUTE" : "MUTE",
|
|
2976
3054
|
userId: state.agentId
|
|
2977
3055
|
};
|
|
2978
3056
|
muteOrUnMute(END_POINT.MUTE_CALL, payload);
|
|
@@ -3378,16 +3456,16 @@ function CallControls({ onDataChange }) {
|
|
|
3378
3456
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.SupportAgent, {})
|
|
3379
3457
|
}
|
|
3380
3458
|
) }),
|
|
3381
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: state.
|
|
3459
|
+
/* @__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
3460
|
import_material4.Button,
|
|
3383
3461
|
{
|
|
3384
|
-
variant: state.
|
|
3462
|
+
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
3463
|
onClick: (e) => {
|
|
3386
3464
|
e.stopPropagation();
|
|
3387
3465
|
handleHoldToggle();
|
|
3388
3466
|
},
|
|
3389
|
-
sx: state.
|
|
3390
|
-
disabled: ((
|
|
3467
|
+
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),
|
|
3468
|
+
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
3469
|
children: holdOrUnHoldLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3392
3470
|
import_material4.CircularProgress,
|
|
3393
3471
|
{
|
|
@@ -3396,19 +3474,19 @@ function CallControls({ onDataChange }) {
|
|
|
3396
3474
|
color: theme.palette.primary.main
|
|
3397
3475
|
}
|
|
3398
3476
|
}
|
|
3399
|
-
) : state.
|
|
3477
|
+
) : ((_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
3478
|
}
|
|
3401
3479
|
) }),
|
|
3402
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Tooltip, { title: state.
|
|
3480
|
+
/* @__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
3481
|
import_material4.Button,
|
|
3404
3482
|
{
|
|
3405
|
-
variant: state.isHolding ? "outlined" : state.
|
|
3483
|
+
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
3484
|
onClick: (e) => {
|
|
3407
3485
|
e.stopPropagation();
|
|
3408
3486
|
handleMuteToggle();
|
|
3409
3487
|
},
|
|
3410
|
-
sx: state.
|
|
3411
|
-
disabled: ((
|
|
3488
|
+
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),
|
|
3489
|
+
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
3490
|
children: muteOrUnMuteLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3413
3491
|
import_material4.CircularProgress,
|
|
3414
3492
|
{
|
|
@@ -3417,10 +3495,10 @@ function CallControls({ onDataChange }) {
|
|
|
3417
3495
|
color: theme.palette.primary.main
|
|
3418
3496
|
}
|
|
3419
3497
|
}
|
|
3420
|
-
) : state.
|
|
3498
|
+
) : ((_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
3499
|
}
|
|
3422
3500
|
) }),
|
|
3423
|
-
!((
|
|
3501
|
+
!((_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
3502
|
import_material4.Button,
|
|
3425
3503
|
{
|
|
3426
3504
|
variant: state.openCallTransferDialog ? "contained" : "outlined",
|
|
@@ -3431,12 +3509,12 @@ function CallControls({ onDataChange }) {
|
|
|
3431
3509
|
sdkStateManager.setOpenCallTransferDialog(true);
|
|
3432
3510
|
}
|
|
3433
3511
|
},
|
|
3434
|
-
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((
|
|
3435
|
-
disabled: ((
|
|
3512
|
+
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((_ka = (_ja = state.callData) == null ? void 0 : _ja.status) == null ? void 0 : _ka.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3513
|
+
disabled: ((_ma = (_la = state.callData) == null ? void 0 : _la.status) == null ? void 0 : _ma.toUpperCase()) !== "ONCALL",
|
|
3436
3514
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.TransferWithinAStation, {})
|
|
3437
3515
|
}
|
|
3438
3516
|
) }),
|
|
3439
|
-
!((
|
|
3517
|
+
!((_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
3518
|
import_material4.Button,
|
|
3441
3519
|
{
|
|
3442
3520
|
variant: state.openConferenceDialog ? "contained" : "outlined",
|
|
@@ -3447,15 +3525,15 @@ function CallControls({ onDataChange }) {
|
|
|
3447
3525
|
sdkStateManager.setOpenConferenceDialog(true);
|
|
3448
3526
|
}
|
|
3449
3527
|
},
|
|
3450
|
-
sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((
|
|
3451
|
-
disabled: ((
|
|
3528
|
+
sx: state.openConferenceDialog ? __spreadValues({}, enabled) : ((_pa = (_oa = state.callData) == null ? void 0 : _oa.status) == null ? void 0 : _pa.toUpperCase()) === "ONCALL" ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3529
|
+
disabled: ((_ra = (_qa = state.callData) == null ? void 0 : _qa.status) == null ? void 0 : _ra.toUpperCase()) !== "ONCALL",
|
|
3452
3530
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material2.Group, {})
|
|
3453
3531
|
}
|
|
3454
3532
|
) }),
|
|
3455
|
-
!((
|
|
3533
|
+
!((_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
3534
|
import_material4.Button,
|
|
3457
3535
|
{
|
|
3458
|
-
variant: ((
|
|
3536
|
+
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
3537
|
onClick: (e) => {
|
|
3460
3538
|
var _a3, _b2, _c2, _d2, _e2, _f2;
|
|
3461
3539
|
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 +3541,7 @@ function CallControls({ onDataChange }) {
|
|
|
3463
3541
|
setOpenCallDisposition(true);
|
|
3464
3542
|
}
|
|
3465
3543
|
},
|
|
3466
|
-
sx: ((
|
|
3544
|
+
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
3545
|
borderRight: "1px",
|
|
3468
3546
|
backgroundColor: "error.main",
|
|
3469
3547
|
minWidth: "60px !important",
|
|
@@ -3482,7 +3560,7 @@ function CallControls({ onDataChange }) {
|
|
|
3482
3560
|
}) : __spreadProps(__spreadValues({}, disabled), {
|
|
3483
3561
|
minWidth: "60px !important"
|
|
3484
3562
|
}),
|
|
3485
|
-
disabled: ((
|
|
3563
|
+
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
3564
|
children: endCallLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3487
3565
|
import_material4.CircularProgress,
|
|
3488
3566
|
{
|
|
@@ -3522,7 +3600,7 @@ function CallControls({ onDataChange }) {
|
|
|
3522
3600
|
transition: theme.transitions.create(["box-shadow", "transform"], {
|
|
3523
3601
|
duration: theme.transitions.duration.short
|
|
3524
3602
|
}),
|
|
3525
|
-
visibility: showIframe && !((
|
|
3603
|
+
visibility: showIframe && !((_La = state.sdkConfig) == null ? void 0 : _La.disableSoftPhone) ? "visible" : "hidden",
|
|
3526
3604
|
userSelect: "none"
|
|
3527
3605
|
},
|
|
3528
3606
|
children: [
|
|
@@ -3556,7 +3634,7 @@ function CallControls({ onDataChange }) {
|
|
|
3556
3634
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material4.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
3557
3635
|
"iframe",
|
|
3558
3636
|
{
|
|
3559
|
-
src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(
|
|
3637
|
+
src: `https://${IP}/ConVoxCCS/iframe?agent_id=${state.agentId}&process_id=${(_Ma = state.process) == null ? void 0 : _Ma.process_id}`,
|
|
3560
3638
|
height: 380,
|
|
3561
3639
|
width: 420,
|
|
3562
3640
|
allow: "camera; microphone; autoplay",
|