call-control-sdk 6.5.5-uat.4 → 6.5.5-uat.6
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 +562 -473
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +565 -475
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/incoming-4WP3FJI4.mp3 +0 -0
package/dist/index.mjs
CHANGED
|
@@ -44,6 +44,7 @@ var END_POINT = {
|
|
|
44
44
|
CONFERENCE_CALL_MUTE_OT_UN_MUTE: `${BASE_URL}${VERSION.v1}/cti/calls/conference/mute?provider=convox`,
|
|
45
45
|
CONFERENCE_CALL_END: `${BASE_URL}${VERSION.v1}/cti/calls/conference/hangup?provider=convox`,
|
|
46
46
|
CONFERENCE_CALL_END_ALL: `${BASE_URL}${VERSION.v1}/cti/calls/conference/hangup/all?provider=convox`,
|
|
47
|
+
CONFERENCE_CALL_TRANSFER: `${BASE_URL}${VERSION.v1}/cti/calls/conference/transfer?provider=convox`,
|
|
47
48
|
TRANSFER_CALL: `${BASE_URL}${VERSION.v1}/cti/calls/transfer?provider=convox`,
|
|
48
49
|
AGENTS_LIST: `${BASE_URL}${VERSION.v1}/cti/users`,
|
|
49
50
|
PROCESS_LIST: `${BASE_URL}${VERSION.v1}/cti/processes-list`,
|
|
@@ -171,7 +172,6 @@ var SDKStateManager = class {
|
|
|
171
172
|
const stored = getItem(this.STORAGE_KEY);
|
|
172
173
|
if (stored) {
|
|
173
174
|
const parsedState = stored;
|
|
174
|
-
console.log("loading from storage", parsedState);
|
|
175
175
|
this.state = __spreadProps(__spreadValues({}, this.state), {
|
|
176
176
|
agentId: parsedState.agentId || "",
|
|
177
177
|
authorization: parsedState.authorization || void 0,
|
|
@@ -605,6 +605,23 @@ var axios_default = axiosInstance;
|
|
|
605
605
|
|
|
606
606
|
// call-control-sdk/lib/hooks/useLogout.ts
|
|
607
607
|
import { getItem as getItem2, removeItem as removeItem2 } from "@react-solutions/vault";
|
|
608
|
+
|
|
609
|
+
// call-control-sdk/lib/services/usbLight.ts
|
|
610
|
+
var USB_LIGHT_BASE_URL = `/usb-light`;
|
|
611
|
+
var USB_LIGHT_ON = (color) => {
|
|
612
|
+
return `${USB_LIGHT_BASE_URL}/light/${color}/on`;
|
|
613
|
+
};
|
|
614
|
+
var USB_LIGHT_FLASH = (color, number) => {
|
|
615
|
+
return `${USB_LIGHT_BASE_URL}/light/${color}/flash${number}`;
|
|
616
|
+
};
|
|
617
|
+
var USB_LIGHT_ALL_OFF = () => {
|
|
618
|
+
return `${USB_LIGHT_BASE_URL}/all/off`;
|
|
619
|
+
};
|
|
620
|
+
var USB_LIGHT_REQUEST = (url, init) => {
|
|
621
|
+
return fetch(url, init);
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
// call-control-sdk/lib/hooks/useLogout.ts
|
|
608
625
|
var useLogout = () => {
|
|
609
626
|
const [loading, setLoading] = useState(false);
|
|
610
627
|
const [success, setSuccess] = useState(false);
|
|
@@ -612,6 +629,7 @@ var useLogout = () => {
|
|
|
612
629
|
const [error, setError] = useState(null);
|
|
613
630
|
const [data, setData] = useState(null);
|
|
614
631
|
const handleLogout = useCallback(async () => {
|
|
632
|
+
USB_LIGHT_REQUEST(USB_LIGHT_ALL_OFF());
|
|
615
633
|
const state = getItem2(STORAGE_KEY);
|
|
616
634
|
setLoading(true);
|
|
617
635
|
const payload = {
|
|
@@ -838,7 +856,7 @@ import {
|
|
|
838
856
|
Phone,
|
|
839
857
|
PlayArrow as PlayArrow2,
|
|
840
858
|
SupportAgent as SupportAgent2,
|
|
841
|
-
TransferWithinAStation,
|
|
859
|
+
TransferWithinAStation as TransferWithinAStation2,
|
|
842
860
|
Upcoming as Upcoming2,
|
|
843
861
|
WifiCalling3,
|
|
844
862
|
SendRounded,
|
|
@@ -875,6 +893,7 @@ import {
|
|
|
875
893
|
PlayArrow,
|
|
876
894
|
Roofing,
|
|
877
895
|
SupportAgent,
|
|
896
|
+
TransferWithinAStation,
|
|
878
897
|
Upcoming
|
|
879
898
|
} from "@mui/icons-material";
|
|
880
899
|
import {
|
|
@@ -1352,7 +1371,15 @@ var ConferenceTableRow = ({ each, isLineDialing }) => {
|
|
|
1352
1371
|
placeholder: "Phone Number",
|
|
1353
1372
|
fullWidth: true,
|
|
1354
1373
|
value: (each == null ? void 0 : each.phone) || "",
|
|
1355
|
-
disabled: (each == null ? void 0 : each.line) === 1 || [
|
|
1374
|
+
disabled: (each == null ? void 0 : each.line) === 1 || [
|
|
1375
|
+
"ONCALL" /* ONCALL */,
|
|
1376
|
+
"DISCONNECTED" /* DISCONNECTED */,
|
|
1377
|
+
"CONFERENCE" /* CONFERENCE */,
|
|
1378
|
+
"HOLD" /* HOLD */,
|
|
1379
|
+
"MUTE" /* MUTE */,
|
|
1380
|
+
"DIALING" /* DIALING */,
|
|
1381
|
+
"RINGING" /* RINGING */
|
|
1382
|
+
].includes((_f = each == null ? void 0 : each.status) != null ? _f : "") || isLineDialing,
|
|
1356
1383
|
onChange: (e) => {
|
|
1357
1384
|
onConferenceLineUpdate(each, { phone: e.target.value });
|
|
1358
1385
|
}
|
|
@@ -1610,8 +1637,26 @@ function ConferenceDialog() {
|
|
|
1610
1637
|
setConferenceCallEndAll(false);
|
|
1611
1638
|
});
|
|
1612
1639
|
};
|
|
1640
|
+
const handleTransferConferenceCall = () => {
|
|
1641
|
+
var _a3, _b2, _c, _d;
|
|
1642
|
+
const payload = {
|
|
1643
|
+
action: "TRANSFERAPI",
|
|
1644
|
+
userid: (_b2 = (_a3 = state.callData) == null ? void 0 : _a3.agent_id) != null ? _b2 : "",
|
|
1645
|
+
process_name: (_d = (_c = state.callData) == null ? void 0 : _c.process_name) != null ? _d : ""
|
|
1646
|
+
};
|
|
1647
|
+
axios_default.post(END_POINT.CONFERENCE_CALL_TRANSFER, payload).then((res) => {
|
|
1648
|
+
var _a4;
|
|
1649
|
+
showToast((_a4 = res.data) == null ? void 0 : _a4.message, "success");
|
|
1650
|
+
handleClose();
|
|
1651
|
+
}).catch((err) => {
|
|
1652
|
+
var _a4, _b3, _c2, _d2;
|
|
1653
|
+
const message = ((_b3 = (_a4 = err.response) == null ? void 0 : _a4.data) == null ? void 0 : _b3.detail) || ((_d2 = (_c2 = err.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || err.message || "An unknown error occurred";
|
|
1654
|
+
showToast(message, "error");
|
|
1655
|
+
}).finally(() => {
|
|
1656
|
+
setConferenceCallEndAll(false);
|
|
1657
|
+
});
|
|
1658
|
+
};
|
|
1613
1659
|
const isLineDialing = (_a2 = state == null ? void 0 : state.conferenceLine) == null ? void 0 : _a2.some((item) => (item == null ? void 0 : item.status) === "DIALING" /* DIALING */);
|
|
1614
|
-
console.log("dataaaaa", state == null ? void 0 : state.conferenceLine, isLineDialing);
|
|
1615
1660
|
return /* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2(
|
|
1616
1661
|
Dialog,
|
|
1617
1662
|
{
|
|
@@ -1627,14 +1672,45 @@ function ConferenceDialog() {
|
|
|
1627
1672
|
display: "flex",
|
|
1628
1673
|
justifyContent: "space-between",
|
|
1629
1674
|
alignItems: "center",
|
|
1630
|
-
padding: "
|
|
1675
|
+
padding: "0px 16px",
|
|
1676
|
+
paddingBottom: "6px",
|
|
1677
|
+
boxShadow: "1px 1px 2px #e7e5e5ff",
|
|
1678
|
+
margin: "10px 0px"
|
|
1631
1679
|
},
|
|
1632
1680
|
children: [
|
|
1633
|
-
/* @__PURE__ */ jsxs2(
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1681
|
+
/* @__PURE__ */ jsxs2(
|
|
1682
|
+
Typography,
|
|
1683
|
+
{
|
|
1684
|
+
variant: "body1",
|
|
1685
|
+
color: "primary.main",
|
|
1686
|
+
sx: { textTransform: "uppercase", fontWeight: "bold", fontSize: "14px" },
|
|
1687
|
+
children: [
|
|
1688
|
+
(_b = state == null ? void 0 : state.agentId) != null ? _b : "",
|
|
1689
|
+
" conference"
|
|
1690
|
+
]
|
|
1691
|
+
}
|
|
1692
|
+
),
|
|
1693
|
+
/* @__PURE__ */ jsxs2(Box, { children: [
|
|
1694
|
+
/* @__PURE__ */ jsx2(
|
|
1695
|
+
Button,
|
|
1696
|
+
{
|
|
1697
|
+
color: "primary",
|
|
1698
|
+
variant: "outlined",
|
|
1699
|
+
onClick: handleTransferConferenceCall,
|
|
1700
|
+
disabled: conferenceCallEndAll,
|
|
1701
|
+
startIcon: /* @__PURE__ */ jsx2(TransferWithinAStation, {}),
|
|
1702
|
+
children: "Exit Conference"
|
|
1703
|
+
}
|
|
1704
|
+
),
|
|
1705
|
+
/* @__PURE__ */ jsx2(
|
|
1706
|
+
IconButton,
|
|
1707
|
+
{
|
|
1708
|
+
onClick: handleClose,
|
|
1709
|
+
color: "primary",
|
|
1710
|
+
children: /* @__PURE__ */ jsx2(Close, { sx: { color: "primary.main" } })
|
|
1711
|
+
}
|
|
1712
|
+
)
|
|
1713
|
+
] })
|
|
1638
1714
|
]
|
|
1639
1715
|
}
|
|
1640
1716
|
),
|
|
@@ -1707,7 +1783,13 @@ function ConferenceDialog() {
|
|
|
1707
1783
|
]
|
|
1708
1784
|
}
|
|
1709
1785
|
) }),
|
|
1710
|
-
/* @__PURE__ */ jsx2(TableBody, { children: state == null ? void 0 : state.conferenceLine.map((each) => /* @__PURE__ */ jsx2(
|
|
1786
|
+
/* @__PURE__ */ jsx2(TableBody, { children: state == null ? void 0 : state.conferenceLine.map((each) => /* @__PURE__ */ jsx2(
|
|
1787
|
+
ConferenceTableRow,
|
|
1788
|
+
{
|
|
1789
|
+
each,
|
|
1790
|
+
isLineDialing
|
|
1791
|
+
}
|
|
1792
|
+
)) })
|
|
1711
1793
|
]
|
|
1712
1794
|
}
|
|
1713
1795
|
)
|
|
@@ -1799,7 +1881,10 @@ function CallTransferDialog({ open }) {
|
|
|
1799
1881
|
const [getIdelAgentsList, { data: idleAgentsList, isLoading: isIdleAgentsListLoading }] = usePostRequest({
|
|
1800
1882
|
disabledSuccessToast: true
|
|
1801
1883
|
});
|
|
1802
|
-
const [
|
|
1884
|
+
const [
|
|
1885
|
+
getHospitalsServicesList,
|
|
1886
|
+
{ data: hospitalsServicesList, isLoading: isHospitalsServicesListLoading }
|
|
1887
|
+
] = useGetRequest({
|
|
1803
1888
|
disabledSuccessToast: true
|
|
1804
1889
|
});
|
|
1805
1890
|
const [
|
|
@@ -1853,7 +1938,6 @@ function CallTransferDialog({ open }) {
|
|
|
1853
1938
|
callreferenceid: (_K = (_J = state.callData) == null ? void 0 : _J.convox_id) != null ? _K : "",
|
|
1854
1939
|
blind_transfer_no: (_L = data == null ? void 0 : data.mobile_number) != null ? _L : ""
|
|
1855
1940
|
};
|
|
1856
|
-
console.log("payload", payload);
|
|
1857
1941
|
blindTransferCall(END_POINT.BLIEND_TRANSFER, payload);
|
|
1858
1942
|
}
|
|
1859
1943
|
};
|
|
@@ -1962,274 +2046,230 @@ function CallTransferDialog({ open }) {
|
|
|
1962
2046
|
]
|
|
1963
2047
|
}
|
|
1964
2048
|
),
|
|
1965
|
-
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "process" && /* @__PURE__ */ jsx2(
|
|
2049
|
+
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "process" && /* @__PURE__ */ jsx2(
|
|
1966
2050
|
Box,
|
|
1967
2051
|
{
|
|
1968
2052
|
sx: {
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
2053
|
+
display: "grid",
|
|
2054
|
+
gridTemplateColumns: ((_a2 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _a2.process) && ((_c = (_b = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _b.process) == null ? void 0 : _c.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)",
|
|
2055
|
+
gap: 1,
|
|
2056
|
+
padding: "10px",
|
|
2057
|
+
flexWrap: "wrap",
|
|
1972
2058
|
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
1973
|
-
|
|
1974
|
-
borderRadius: "10px",
|
|
1975
|
-
"&:hover": { bgcolor: "action.selected" }
|
|
1976
|
-
},
|
|
1977
|
-
children: [
|
|
1978
|
-
/* @__PURE__ */ jsxs2(
|
|
1979
|
-
Typography,
|
|
1980
|
-
{
|
|
1981
|
-
variant: "body1",
|
|
1982
|
-
sx: {
|
|
1983
|
-
mx: 1,
|
|
1984
|
-
width: "200px",
|
|
1985
|
-
maxWidth: "250px",
|
|
1986
|
-
display: "flex",
|
|
1987
|
-
alignItems: "center"
|
|
1988
|
-
},
|
|
1989
|
-
children: [
|
|
1990
|
-
/* @__PURE__ */ jsx2(MemoryOutlined, { sx: { marginRight: "4px" } }),
|
|
1991
|
-
process.process_name
|
|
1992
|
-
]
|
|
1993
|
-
}
|
|
1994
|
-
),
|
|
1995
|
-
/* @__PURE__ */ jsx2(
|
|
1996
|
-
IconButton,
|
|
1997
|
-
{
|
|
1998
|
-
color: "success",
|
|
1999
|
-
sx: {
|
|
2000
|
-
bgcolor: "action.hover",
|
|
2001
|
-
"&:hover": { bgcolor: "action.selected" }
|
|
2002
|
-
},
|
|
2003
|
-
onClick: () => {
|
|
2004
|
-
handleTransferCall(process, "PROCESS");
|
|
2005
|
-
},
|
|
2006
|
-
children: /* @__PURE__ */ jsx2(Call, {})
|
|
2007
|
-
}
|
|
2008
|
-
)
|
|
2009
|
-
]
|
|
2010
|
-
},
|
|
2011
|
-
index
|
|
2012
|
-
)) : /* @__PURE__ */ jsxs2(
|
|
2013
|
-
Box,
|
|
2014
|
-
{
|
|
2015
|
-
sx: {
|
|
2016
|
-
display: "flex",
|
|
2017
|
-
alignItems: "center",
|
|
2018
|
-
justifyContent: "center",
|
|
2019
|
-
flexDirection: "column"
|
|
2059
|
+
borderRadius: "10px"
|
|
2020
2060
|
},
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2061
|
+
children: ((_d = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _d.process) && ((_f = (_e = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _e.process) == null ? void 0 : _f.length) > 0 ? (_h = (_g = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _g.process) == null ? void 0 : _h.map((process, index) => /* @__PURE__ */ jsxs2(
|
|
2062
|
+
Box,
|
|
2063
|
+
{
|
|
2064
|
+
sx: {
|
|
2065
|
+
p: 1,
|
|
2066
|
+
display: "flex",
|
|
2067
|
+
alignItems: "center",
|
|
2068
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2069
|
+
padding: "6px",
|
|
2070
|
+
borderRadius: "10px",
|
|
2071
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
2072
|
+
},
|
|
2073
|
+
children: [
|
|
2074
|
+
/* @__PURE__ */ jsxs2(
|
|
2075
|
+
Typography,
|
|
2076
|
+
{
|
|
2077
|
+
variant: "body1",
|
|
2078
|
+
sx: {
|
|
2079
|
+
mx: 1,
|
|
2080
|
+
width: "200px",
|
|
2081
|
+
maxWidth: "250px",
|
|
2082
|
+
display: "flex",
|
|
2083
|
+
alignItems: "center"
|
|
2084
|
+
},
|
|
2085
|
+
children: [
|
|
2086
|
+
/* @__PURE__ */ jsx2(MemoryOutlined, { sx: { marginRight: "4px" } }),
|
|
2087
|
+
process.process_name
|
|
2088
|
+
]
|
|
2089
|
+
}
|
|
2090
|
+
),
|
|
2091
|
+
/* @__PURE__ */ jsx2(
|
|
2092
|
+
IconButton,
|
|
2093
|
+
{
|
|
2094
|
+
color: "success",
|
|
2095
|
+
sx: {
|
|
2096
|
+
bgcolor: "action.hover",
|
|
2097
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
2098
|
+
},
|
|
2099
|
+
onClick: () => {
|
|
2100
|
+
handleTransferCall(process, "PROCESS");
|
|
2101
|
+
},
|
|
2102
|
+
children: /* @__PURE__ */ jsx2(Call, {})
|
|
2103
|
+
}
|
|
2104
|
+
)
|
|
2105
|
+
]
|
|
2059
2106
|
},
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
),
|
|
2096
|
-
/* @__PURE__ */ jsx2(
|
|
2097
|
-
IconButton,
|
|
2098
|
-
{
|
|
2099
|
-
color: "success",
|
|
2100
|
-
sx: {
|
|
2101
|
-
bgcolor: "action.hover",
|
|
2102
|
-
"&:hover": { bgcolor: "action.selected" }
|
|
2103
|
-
},
|
|
2104
|
-
onClick: () => {
|
|
2105
|
-
handleTransferCall(queue, "QUEUE");
|
|
2106
|
-
},
|
|
2107
|
-
children: /* @__PURE__ */ jsx2(Call, {})
|
|
2108
|
-
}
|
|
2109
|
-
)
|
|
2110
|
-
]
|
|
2111
|
-
},
|
|
2112
|
-
index
|
|
2113
|
-
);
|
|
2114
|
-
}) : /* @__PURE__ */ jsxs2(
|
|
2115
|
-
Box,
|
|
2116
|
-
{
|
|
2117
|
-
sx: {
|
|
2118
|
-
display: "flex",
|
|
2119
|
-
alignItems: "center",
|
|
2120
|
-
justifyContent: "center",
|
|
2121
|
-
flexDirection: "column"
|
|
2122
|
-
},
|
|
2123
|
-
p: 2,
|
|
2124
|
-
children: [
|
|
2125
|
-
/* @__PURE__ */ jsx2(Upcoming, { color: "primary" }),
|
|
2126
|
-
/* @__PURE__ */ jsx2(
|
|
2127
|
-
Typography,
|
|
2128
|
-
{
|
|
2129
|
-
variant: "body1",
|
|
2130
|
-
sx: {
|
|
2131
|
-
fontSize: "16px",
|
|
2132
|
-
letterSpacing: "0.02em",
|
|
2133
|
-
textTransform: "capitalize",
|
|
2134
|
-
display: "flex",
|
|
2135
|
-
alignItems: "center",
|
|
2136
|
-
justifyContent: "center",
|
|
2137
|
-
width: "100%",
|
|
2138
|
-
margin: "10px 0px",
|
|
2139
|
-
color: "primary.main",
|
|
2140
|
-
height: "20px"
|
|
2141
|
-
},
|
|
2142
|
-
children: "No Queues Found"
|
|
2143
|
-
}
|
|
2144
|
-
)
|
|
2145
|
-
]
|
|
2107
|
+
index
|
|
2108
|
+
)) : /* @__PURE__ */ jsxs2(
|
|
2109
|
+
Box,
|
|
2110
|
+
{
|
|
2111
|
+
sx: {
|
|
2112
|
+
display: "flex",
|
|
2113
|
+
alignItems: "center",
|
|
2114
|
+
justifyContent: "center",
|
|
2115
|
+
flexDirection: "column"
|
|
2116
|
+
},
|
|
2117
|
+
p: 2,
|
|
2118
|
+
children: [
|
|
2119
|
+
/* @__PURE__ */ jsx2(Upcoming, { color: "primary" }),
|
|
2120
|
+
/* @__PURE__ */ jsx2(
|
|
2121
|
+
Typography,
|
|
2122
|
+
{
|
|
2123
|
+
variant: "body1",
|
|
2124
|
+
sx: {
|
|
2125
|
+
fontSize: "16px",
|
|
2126
|
+
letterSpacing: "0.02em",
|
|
2127
|
+
textTransform: "capitalize",
|
|
2128
|
+
display: "flex",
|
|
2129
|
+
alignItems: "center",
|
|
2130
|
+
justifyContent: "center",
|
|
2131
|
+
width: "100%",
|
|
2132
|
+
margin: "10px 0px",
|
|
2133
|
+
color: "primary.main",
|
|
2134
|
+
height: "20px"
|
|
2135
|
+
},
|
|
2136
|
+
children: "No Process Found"
|
|
2137
|
+
}
|
|
2138
|
+
)
|
|
2139
|
+
]
|
|
2140
|
+
}
|
|
2141
|
+
)
|
|
2146
2142
|
}
|
|
2147
|
-
)
|
|
2148
|
-
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "
|
|
2143
|
+
),
|
|
2144
|
+
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "queues" && /* @__PURE__ */ jsx2(
|
|
2149
2145
|
Box,
|
|
2150
2146
|
{
|
|
2151
2147
|
sx: {
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2148
|
+
display: "grid",
|
|
2149
|
+
gridTemplateColumns: ((_i = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _i.queue) && ((_k = (_j = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _j.queue) == null ? void 0 : _k.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)",
|
|
2150
|
+
gap: 1,
|
|
2151
|
+
padding: "10px",
|
|
2152
|
+
flexWrap: "wrap",
|
|
2155
2153
|
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2156
|
-
|
|
2157
|
-
borderRadius: "10px",
|
|
2158
|
-
"&:hover": { bgcolor: "action.selected" }
|
|
2154
|
+
borderRadius: "10px"
|
|
2159
2155
|
},
|
|
2160
|
-
children:
|
|
2161
|
-
|
|
2162
|
-
|
|
2156
|
+
children: ((_l = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _l.queue) && ((_n = (_m = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _m.queue) == null ? void 0 : _n.length) > 0 ? (_p = (_o = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _o.queue) == null ? void 0 : _p.map((queue, index) => {
|
|
2157
|
+
var _a3, _b2, _c2, _d2, _e2, _f2;
|
|
2158
|
+
return /* @__PURE__ */ jsxs2(
|
|
2159
|
+
Box,
|
|
2163
2160
|
{
|
|
2164
|
-
variant: "body1",
|
|
2165
2161
|
sx: {
|
|
2166
|
-
|
|
2167
|
-
width: "200px",
|
|
2168
|
-
maxWidth: "250px",
|
|
2162
|
+
p: 1,
|
|
2169
2163
|
display: "flex",
|
|
2170
|
-
alignItems: "center"
|
|
2164
|
+
alignItems: "center",
|
|
2165
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2166
|
+
padding: "6px",
|
|
2167
|
+
borderRadius: "10px",
|
|
2168
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
2171
2169
|
},
|
|
2172
2170
|
children: [
|
|
2173
|
-
/* @__PURE__ */
|
|
2174
|
-
|
|
2171
|
+
/* @__PURE__ */ jsxs2(
|
|
2172
|
+
Typography,
|
|
2173
|
+
{
|
|
2174
|
+
variant: "body1",
|
|
2175
|
+
sx: {
|
|
2176
|
+
mx: 1,
|
|
2177
|
+
width: "200px",
|
|
2178
|
+
maxWidth: "250px",
|
|
2179
|
+
display: "flex",
|
|
2180
|
+
alignItems: "center"
|
|
2181
|
+
},
|
|
2182
|
+
children: [
|
|
2183
|
+
/* @__PURE__ */ jsx2(Airlines, { sx: { marginRight: "4px" } }),
|
|
2184
|
+
queue.queue_name,
|
|
2185
|
+
((_c2 = (_b2 = (_a3 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _a3.process) == null ? void 0 : _b2.find(
|
|
2186
|
+
(process) => process.process_id === queue.process_id
|
|
2187
|
+
)) == null ? void 0 : _c2.process_name) ? /* @__PURE__ */ jsx2(
|
|
2188
|
+
Typography,
|
|
2189
|
+
{
|
|
2190
|
+
variant: "body1",
|
|
2191
|
+
sx: {
|
|
2192
|
+
fontSize: "12px",
|
|
2193
|
+
fontWeight: "600",
|
|
2194
|
+
letterSpacing: "0.02em",
|
|
2195
|
+
textTransform: "capitalize",
|
|
2196
|
+
color: "gray"
|
|
2197
|
+
},
|
|
2198
|
+
children: "(" + ((_f2 = (_e2 = (_d2 = processAndQueuesList == null ? void 0 : processAndQueuesList.data) == null ? void 0 : _d2.process) == null ? void 0 : _e2.find(
|
|
2199
|
+
(process) => process.process_id === queue.process_id
|
|
2200
|
+
)) == null ? void 0 : _f2.process_name) + ")"
|
|
2201
|
+
}
|
|
2202
|
+
) : ""
|
|
2203
|
+
]
|
|
2204
|
+
}
|
|
2205
|
+
),
|
|
2206
|
+
/* @__PURE__ */ jsx2(
|
|
2207
|
+
IconButton,
|
|
2208
|
+
{
|
|
2209
|
+
color: "success",
|
|
2210
|
+
sx: {
|
|
2211
|
+
bgcolor: "action.hover",
|
|
2212
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
2213
|
+
},
|
|
2214
|
+
onClick: () => {
|
|
2215
|
+
handleTransferCall(queue, "QUEUE");
|
|
2216
|
+
},
|
|
2217
|
+
children: /* @__PURE__ */ jsx2(Call, {})
|
|
2218
|
+
}
|
|
2219
|
+
)
|
|
2175
2220
|
]
|
|
2176
|
-
}
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2221
|
+
},
|
|
2222
|
+
index
|
|
2223
|
+
);
|
|
2224
|
+
}) : /* @__PURE__ */ jsxs2(
|
|
2225
|
+
Box,
|
|
2226
|
+
{
|
|
2227
|
+
sx: {
|
|
2228
|
+
display: "flex",
|
|
2229
|
+
alignItems: "center",
|
|
2230
|
+
justifyContent: "center",
|
|
2231
|
+
flexDirection: "column"
|
|
2232
|
+
},
|
|
2233
|
+
p: 2,
|
|
2234
|
+
children: [
|
|
2235
|
+
/* @__PURE__ */ jsx2(Upcoming, { color: "primary" }),
|
|
2236
|
+
/* @__PURE__ */ jsx2(
|
|
2237
|
+
Typography,
|
|
2238
|
+
{
|
|
2239
|
+
variant: "body1",
|
|
2240
|
+
sx: {
|
|
2241
|
+
fontSize: "16px",
|
|
2242
|
+
letterSpacing: "0.02em",
|
|
2243
|
+
textTransform: "capitalize",
|
|
2244
|
+
display: "flex",
|
|
2245
|
+
alignItems: "center",
|
|
2246
|
+
justifyContent: "center",
|
|
2247
|
+
width: "100%",
|
|
2248
|
+
margin: "10px 0px",
|
|
2249
|
+
color: "primary.main",
|
|
2250
|
+
height: "20px"
|
|
2251
|
+
},
|
|
2252
|
+
children: "No Queues Found"
|
|
2253
|
+
}
|
|
2254
|
+
)
|
|
2255
|
+
]
|
|
2256
|
+
}
|
|
2257
|
+
)
|
|
2258
|
+
}
|
|
2259
|
+
),
|
|
2260
|
+
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "agents" && /* @__PURE__ */ jsx2(
|
|
2196
2261
|
Box,
|
|
2197
2262
|
{
|
|
2198
2263
|
sx: {
|
|
2199
|
-
display: "
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2264
|
+
display: "grid",
|
|
2265
|
+
gridTemplateColumns: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_q = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _q.length) > 0 ? "repeat(2, 1fr)" : "repeat(1, 1fr)",
|
|
2266
|
+
gap: 1,
|
|
2267
|
+
padding: "10px",
|
|
2268
|
+
flexWrap: "wrap",
|
|
2269
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2270
|
+
borderRadius: "10px"
|
|
2203
2271
|
},
|
|
2204
|
-
|
|
2205
|
-
children: [
|
|
2206
|
-
/* @__PURE__ */ jsx2(Upcoming, { color: "primary" }),
|
|
2207
|
-
/* @__PURE__ */ jsx2(
|
|
2208
|
-
Typography,
|
|
2209
|
-
{
|
|
2210
|
-
variant: "body1",
|
|
2211
|
-
sx: {
|
|
2212
|
-
fontSize: "16px",
|
|
2213
|
-
letterSpacing: "0.02em",
|
|
2214
|
-
textTransform: "capitalize",
|
|
2215
|
-
display: "flex",
|
|
2216
|
-
alignItems: "center",
|
|
2217
|
-
justifyContent: "center",
|
|
2218
|
-
width: "100%",
|
|
2219
|
-
margin: "10px 0px",
|
|
2220
|
-
color: "primary.main",
|
|
2221
|
-
height: "20px"
|
|
2222
|
-
},
|
|
2223
|
-
children: "No Agents Found"
|
|
2224
|
-
}
|
|
2225
|
-
)
|
|
2226
|
-
]
|
|
2227
|
-
}
|
|
2228
|
-
) }),
|
|
2229
|
-
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "others" && /* @__PURE__ */ jsxs2(Box, { sx: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 1, padding: "10px", flexWrap: "wrap", boxShadow: "1px 1px 4px #d3d3d3ff", borderRadius: "10px" }, children: [
|
|
2230
|
-
(hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) && ((_t = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _t.length) > 0 && ((_u = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _u.map((service, index) => {
|
|
2231
|
-
var _a3, _b2, _c2;
|
|
2232
|
-
return /* @__PURE__ */ jsxs2(
|
|
2272
|
+
children: (idleAgentsList == null ? void 0 : idleAgentsList.data) && ((_r = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _r.length) > 0 ? (_s = idleAgentsList == null ? void 0 : idleAgentsList.data) == null ? void 0 : _s.map((agent, index) => /* @__PURE__ */ jsxs2(
|
|
2233
2273
|
Box,
|
|
2234
2274
|
{
|
|
2235
2275
|
sx: {
|
|
@@ -2254,25 +2294,12 @@ function CallTransferDialog({ open }) {
|
|
|
2254
2294
|
alignItems: "center"
|
|
2255
2295
|
},
|
|
2256
2296
|
children: [
|
|
2257
|
-
/* @__PURE__ */ jsx2(
|
|
2258
|
-
|
|
2259
|
-
service.name,
|
|
2260
|
-
/* @__PURE__ */ jsx2(Box, { sx: {
|
|
2261
|
-
fontSize: "9px",
|
|
2262
|
-
fontWeight: "600",
|
|
2263
|
-
letterSpacing: "0.02em",
|
|
2264
|
-
textTransform: "capitalize",
|
|
2265
|
-
color: "gray",
|
|
2266
|
-
textOverflow: "ellipsis",
|
|
2267
|
-
whiteSpace: "nowrap",
|
|
2268
|
-
overflow: "hidden",
|
|
2269
|
-
maxWidth: "160px"
|
|
2270
|
-
}, children: (_b2 = service == null ? void 0 : service.description) != null ? _b2 : "" })
|
|
2271
|
-
] }) })
|
|
2297
|
+
/* @__PURE__ */ jsx2(SupportAgent, { sx: { marginRight: "4px" } }),
|
|
2298
|
+
agent.name
|
|
2272
2299
|
]
|
|
2273
2300
|
}
|
|
2274
2301
|
),
|
|
2275
|
-
/* @__PURE__ */ jsx2(
|
|
2302
|
+
/* @__PURE__ */ jsx2(
|
|
2276
2303
|
IconButton,
|
|
2277
2304
|
{
|
|
2278
2305
|
color: "success",
|
|
@@ -2281,89 +2308,220 @@ function CallTransferDialog({ open }) {
|
|
|
2281
2308
|
"&:hover": { bgcolor: "action.selected" }
|
|
2282
2309
|
},
|
|
2283
2310
|
onClick: () => {
|
|
2284
|
-
|
|
2285
|
-
handleTransferCall({
|
|
2286
|
-
mobile_number: (_a4 = service == null ? void 0 : service.phone_number) != null ? _a4 : ""
|
|
2287
|
-
}, "OTHER");
|
|
2311
|
+
handleTransferCall(agent, "AGENT");
|
|
2288
2312
|
},
|
|
2289
2313
|
children: /* @__PURE__ */ jsx2(Call, {})
|
|
2290
2314
|
}
|
|
2291
|
-
)
|
|
2315
|
+
)
|
|
2292
2316
|
]
|
|
2293
2317
|
},
|
|
2294
2318
|
index
|
|
2295
|
-
)
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2319
|
+
)) : /* @__PURE__ */ jsxs2(
|
|
2320
|
+
Box,
|
|
2321
|
+
{
|
|
2322
|
+
sx: {
|
|
2323
|
+
display: "flex",
|
|
2324
|
+
alignItems: "center",
|
|
2325
|
+
justifyContent: "center",
|
|
2326
|
+
flexDirection: "column"
|
|
2327
|
+
},
|
|
2328
|
+
p: 2,
|
|
2329
|
+
children: [
|
|
2330
|
+
/* @__PURE__ */ jsx2(Upcoming, { color: "primary" }),
|
|
2331
|
+
/* @__PURE__ */ jsx2(
|
|
2332
|
+
Typography,
|
|
2333
|
+
{
|
|
2334
|
+
variant: "body1",
|
|
2335
|
+
sx: {
|
|
2336
|
+
fontSize: "16px",
|
|
2337
|
+
letterSpacing: "0.02em",
|
|
2338
|
+
textTransform: "capitalize",
|
|
2339
|
+
display: "flex",
|
|
2340
|
+
alignItems: "center",
|
|
2341
|
+
justifyContent: "center",
|
|
2342
|
+
width: "100%",
|
|
2343
|
+
margin: "10px 0px",
|
|
2344
|
+
color: "primary.main",
|
|
2345
|
+
height: "20px"
|
|
2346
|
+
},
|
|
2347
|
+
children: "No Agents Found"
|
|
2348
|
+
}
|
|
2349
|
+
)
|
|
2350
|
+
]
|
|
2351
|
+
}
|
|
2352
|
+
)
|
|
2353
|
+
}
|
|
2354
|
+
),
|
|
2355
|
+
!isProcessAndQueuesListLoading && !isIdleAgentsListLoading && !isHospitalsServicesListLoading && currentselecteTab === "others" && /* @__PURE__ */ jsxs2(
|
|
2356
|
+
Box,
|
|
2357
|
+
{
|
|
2358
|
+
sx: {
|
|
2359
|
+
display: "grid",
|
|
2360
|
+
gridTemplateColumns: "repeat(2, 1fr)",
|
|
2361
|
+
gap: 1,
|
|
2362
|
+
padding: "10px",
|
|
2363
|
+
flexWrap: "wrap",
|
|
2364
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2365
|
+
borderRadius: "10px"
|
|
2366
|
+
},
|
|
2367
|
+
children: [
|
|
2368
|
+
(hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) && ((_t = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _t.length) > 0 && ((_u = hospitalsServicesList == null ? void 0 : hospitalsServicesList.data) == null ? void 0 : _u.map((service, index) => {
|
|
2369
|
+
var _a3, _b2, _c2;
|
|
2370
|
+
return /* @__PURE__ */ jsxs2(
|
|
2371
|
+
Box,
|
|
2311
2372
|
{
|
|
2312
|
-
variant: "body1",
|
|
2313
2373
|
sx: {
|
|
2314
|
-
|
|
2315
|
-
width: "200px",
|
|
2316
|
-
maxWidth: "250px",
|
|
2374
|
+
p: 1,
|
|
2317
2375
|
display: "flex",
|
|
2318
|
-
alignItems: "center"
|
|
2376
|
+
alignItems: "center",
|
|
2377
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2378
|
+
padding: "6px",
|
|
2379
|
+
borderRadius: "10px",
|
|
2380
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
2319
2381
|
},
|
|
2320
|
-
children:
|
|
2321
|
-
|
|
2382
|
+
children: [
|
|
2383
|
+
/* @__PURE__ */ jsxs2(
|
|
2384
|
+
Typography,
|
|
2385
|
+
{
|
|
2386
|
+
variant: "body1",
|
|
2387
|
+
sx: {
|
|
2388
|
+
mx: 1,
|
|
2389
|
+
width: "200px",
|
|
2390
|
+
maxWidth: "250px",
|
|
2391
|
+
display: "flex",
|
|
2392
|
+
alignItems: "center"
|
|
2393
|
+
},
|
|
2394
|
+
children: [
|
|
2395
|
+
/* @__PURE__ */ jsx2(Roofing, { sx: { marginRight: "4px" } }),
|
|
2396
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: `${(_a3 = service == null ? void 0 : service.description) != null ? _a3 : ""}`, children: /* @__PURE__ */ jsxs2(Box, { sx: { color: "text.secondary" }, children: [
|
|
2397
|
+
service.name,
|
|
2398
|
+
/* @__PURE__ */ jsx2(
|
|
2399
|
+
Box,
|
|
2400
|
+
{
|
|
2401
|
+
sx: {
|
|
2402
|
+
fontSize: "9px",
|
|
2403
|
+
fontWeight: "600",
|
|
2404
|
+
letterSpacing: "0.02em",
|
|
2405
|
+
textTransform: "capitalize",
|
|
2406
|
+
color: "gray",
|
|
2407
|
+
textOverflow: "ellipsis",
|
|
2408
|
+
whiteSpace: "nowrap",
|
|
2409
|
+
overflow: "hidden",
|
|
2410
|
+
maxWidth: "160px"
|
|
2411
|
+
},
|
|
2412
|
+
children: (_b2 = service == null ? void 0 : service.description) != null ? _b2 : ""
|
|
2413
|
+
}
|
|
2414
|
+
)
|
|
2415
|
+
] }) })
|
|
2416
|
+
]
|
|
2417
|
+
}
|
|
2418
|
+
),
|
|
2419
|
+
/* @__PURE__ */ jsx2(Tooltip, { title: (_c2 = service == null ? void 0 : service.phone_number) != null ? _c2 : "", children: /* @__PURE__ */ jsx2(
|
|
2420
|
+
IconButton,
|
|
2421
|
+
{
|
|
2422
|
+
color: "success",
|
|
2423
|
+
sx: {
|
|
2424
|
+
bgcolor: "action.hover",
|
|
2425
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
2426
|
+
},
|
|
2427
|
+
onClick: () => {
|
|
2428
|
+
var _a4;
|
|
2429
|
+
handleTransferCall(
|
|
2430
|
+
{
|
|
2431
|
+
mobile_number: (_a4 = service == null ? void 0 : service.phone_number) != null ? _a4 : ""
|
|
2432
|
+
},
|
|
2433
|
+
"OTHER"
|
|
2434
|
+
);
|
|
2435
|
+
},
|
|
2436
|
+
children: /* @__PURE__ */ jsx2(Call, {})
|
|
2437
|
+
}
|
|
2438
|
+
) })
|
|
2439
|
+
]
|
|
2440
|
+
},
|
|
2441
|
+
index
|
|
2442
|
+
);
|
|
2443
|
+
})),
|
|
2444
|
+
/* @__PURE__ */ jsxs2(
|
|
2445
|
+
Box,
|
|
2446
|
+
{
|
|
2447
|
+
sx: {
|
|
2448
|
+
p: 1,
|
|
2449
|
+
display: "flex",
|
|
2450
|
+
alignItems: "center",
|
|
2451
|
+
boxShadow: "1px 1px 4px #d3d3d3ff",
|
|
2452
|
+
padding: "6px",
|
|
2453
|
+
borderRadius: "10px"
|
|
2454
|
+
},
|
|
2455
|
+
children: [
|
|
2456
|
+
/* @__PURE__ */ jsx2(
|
|
2457
|
+
Typography,
|
|
2322
2458
|
{
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
const v = e.target.value;
|
|
2331
|
-
if (/^\d*$/.test(v)) {
|
|
2332
|
-
setMobileNumber(v);
|
|
2333
|
-
}
|
|
2459
|
+
variant: "body1",
|
|
2460
|
+
sx: {
|
|
2461
|
+
mx: 1,
|
|
2462
|
+
width: "200px",
|
|
2463
|
+
maxWidth: "250px",
|
|
2464
|
+
display: "flex",
|
|
2465
|
+
alignItems: "center"
|
|
2334
2466
|
},
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2467
|
+
children: /* @__PURE__ */ jsx2(
|
|
2468
|
+
TextField,
|
|
2469
|
+
{
|
|
2470
|
+
size: "small",
|
|
2471
|
+
name: "others",
|
|
2472
|
+
label: "Mobile number",
|
|
2473
|
+
variant: "outlined",
|
|
2474
|
+
type: "tel",
|
|
2475
|
+
value: mobileNumber,
|
|
2476
|
+
onChange: (e) => {
|
|
2477
|
+
const v = e.target.value;
|
|
2478
|
+
if (/^\d*$/.test(v)) {
|
|
2479
|
+
setMobileNumber(v);
|
|
2480
|
+
}
|
|
2481
|
+
},
|
|
2482
|
+
slotProps: {
|
|
2483
|
+
htmlInput: {
|
|
2484
|
+
inputMode: "numeric",
|
|
2485
|
+
maxLength: 11
|
|
2486
|
+
}
|
|
2487
|
+
},
|
|
2488
|
+
placeholder: "Enter mobile number",
|
|
2489
|
+
autoComplete: "off"
|
|
2339
2490
|
}
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2491
|
+
)
|
|
2492
|
+
}
|
|
2493
|
+
),
|
|
2494
|
+
/* @__PURE__ */ jsx2(
|
|
2495
|
+
Tooltip,
|
|
2496
|
+
{
|
|
2497
|
+
title: mobileNumber ? `Call To - ${mobileNumber}` : "Enter mobile number",
|
|
2498
|
+
children: /* @__PURE__ */ jsx2(
|
|
2499
|
+
IconButton,
|
|
2500
|
+
{
|
|
2501
|
+
color: "success",
|
|
2502
|
+
sx: {
|
|
2503
|
+
bgcolor: "action.hover",
|
|
2504
|
+
"&:hover": { bgcolor: "action.selected" }
|
|
2505
|
+
},
|
|
2506
|
+
onClick: () => {
|
|
2507
|
+
handleTransferCall(
|
|
2508
|
+
{
|
|
2509
|
+
mobile_number: mobileNumber != null ? mobileNumber : ""
|
|
2510
|
+
},
|
|
2511
|
+
"OTHER"
|
|
2512
|
+
);
|
|
2513
|
+
},
|
|
2514
|
+
children: /* @__PURE__ */ jsx2(Call, {})
|
|
2515
|
+
}
|
|
2516
|
+
)
|
|
2343
2517
|
}
|
|
2344
2518
|
)
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
sx: {
|
|
2352
|
-
bgcolor: "action.hover",
|
|
2353
|
-
"&:hover": { bgcolor: "action.selected" }
|
|
2354
|
-
},
|
|
2355
|
-
onClick: () => {
|
|
2356
|
-
handleTransferCall({
|
|
2357
|
-
mobile_number: mobileNumber != null ? mobileNumber : ""
|
|
2358
|
-
}, "OTHER");
|
|
2359
|
-
},
|
|
2360
|
-
children: /* @__PURE__ */ jsx2(Call, {})
|
|
2361
|
-
}
|
|
2362
|
-
) })
|
|
2363
|
-
]
|
|
2364
|
-
}
|
|
2365
|
-
)
|
|
2366
|
-
] })
|
|
2519
|
+
]
|
|
2520
|
+
}
|
|
2521
|
+
)
|
|
2522
|
+
]
|
|
2523
|
+
}
|
|
2524
|
+
)
|
|
2367
2525
|
]
|
|
2368
2526
|
}
|
|
2369
2527
|
)
|
|
@@ -2507,29 +2665,36 @@ function EndCallDispositionDialog({ open, setOpen, onSubmitDisposition }) {
|
|
|
2507
2665
|
gap: 2,
|
|
2508
2666
|
mt: 2,
|
|
2509
2667
|
children: [
|
|
2510
|
-
/* @__PURE__ */ jsxs2(
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2668
|
+
/* @__PURE__ */ jsxs2(
|
|
2669
|
+
Box,
|
|
2670
|
+
{
|
|
2671
|
+
sx: {
|
|
2672
|
+
flex: "1",
|
|
2673
|
+
border: "1px solid #bdbdbd",
|
|
2674
|
+
borderRadius: "5px"
|
|
2675
|
+
},
|
|
2676
|
+
children: [
|
|
2677
|
+
/* @__PURE__ */ jsx2(
|
|
2678
|
+
Checkbox,
|
|
2679
|
+
{
|
|
2680
|
+
name: "selected_break",
|
|
2681
|
+
sx: {
|
|
2682
|
+
padding: "6px"
|
|
2683
|
+
},
|
|
2684
|
+
checked: formData.selected_break,
|
|
2685
|
+
onChange: (event) => {
|
|
2686
|
+
handleChange("selected_break", event.target.checked);
|
|
2687
|
+
},
|
|
2688
|
+
slotProps: {
|
|
2689
|
+
input: { "aria-label": "controlled" }
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
),
|
|
2693
|
+
" ",
|
|
2694
|
+
"Mark as break"
|
|
2695
|
+
]
|
|
2696
|
+
}
|
|
2697
|
+
),
|
|
2533
2698
|
((_c = (_b = formData == null ? void 0 : formData.followUp) == null ? void 0 : _b.label) == null ? void 0 : _c.toLowerCase()) === "yes" ? /* @__PURE__ */ jsx2(
|
|
2534
2699
|
TextField,
|
|
2535
2700
|
{
|
|
@@ -2900,83 +3065,6 @@ function createMicController(constraints = { audio: true }) {
|
|
|
2900
3065
|
};
|
|
2901
3066
|
}
|
|
2902
3067
|
|
|
2903
|
-
// call-control-sdk/lib/utils/audioLoader.ts
|
|
2904
|
-
import incomingRingtoneUrl from "./incoming-4WP3FJI4.mp3";
|
|
2905
|
-
var audioBlobUrl = null;
|
|
2906
|
-
var audioBuffer = null;
|
|
2907
|
-
async function loadAudioAsBlob() {
|
|
2908
|
-
if (audioBlobUrl) {
|
|
2909
|
-
return audioBlobUrl;
|
|
2910
|
-
}
|
|
2911
|
-
if (incomingRingtoneUrl.startsWith("data:") || incomingRingtoneUrl.startsWith("http://") || incomingRingtoneUrl.startsWith("https://") || incomingRingtoneUrl.startsWith("blob:")) {
|
|
2912
|
-
return incomingRingtoneUrl;
|
|
2913
|
-
}
|
|
2914
|
-
try {
|
|
2915
|
-
const response = await fetch(incomingRingtoneUrl);
|
|
2916
|
-
if (!response.ok) {
|
|
2917
|
-
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
2918
|
-
}
|
|
2919
|
-
const blob = await response.blob();
|
|
2920
|
-
if (blob.size === 0) {
|
|
2921
|
-
throw new Error("Empty blob");
|
|
2922
|
-
}
|
|
2923
|
-
audioBlobUrl = URL.createObjectURL(blob);
|
|
2924
|
-
return audioBlobUrl;
|
|
2925
|
-
} catch (error) {
|
|
2926
|
-
console.error("Could not create blob URL, using direct URL:", error);
|
|
2927
|
-
return incomingRingtoneUrl;
|
|
2928
|
-
}
|
|
2929
|
-
}
|
|
2930
|
-
async function createAudioElement() {
|
|
2931
|
-
const audio = new Audio();
|
|
2932
|
-
audio.loop = true;
|
|
2933
|
-
audio.volume = 0.7;
|
|
2934
|
-
audio.preload = "auto";
|
|
2935
|
-
let audioUrl = "";
|
|
2936
|
-
try {
|
|
2937
|
-
audioUrl = await loadAudioAsBlob();
|
|
2938
|
-
} catch (error) {
|
|
2939
|
-
console.warn("Failed to load audio as blob, trying direct URL:", error);
|
|
2940
|
-
audioUrl = incomingRingtoneUrl;
|
|
2941
|
-
}
|
|
2942
|
-
const tryLoadAudio = async (url) => {
|
|
2943
|
-
return new Promise((resolve) => {
|
|
2944
|
-
const checkCanPlay = () => {
|
|
2945
|
-
const canPlay = audio.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA;
|
|
2946
|
-
if (canPlay) {
|
|
2947
|
-
resolve(true);
|
|
2948
|
-
return;
|
|
2949
|
-
}
|
|
2950
|
-
if (audio.error) {
|
|
2951
|
-
resolve(false);
|
|
2952
|
-
return;
|
|
2953
|
-
}
|
|
2954
|
-
setTimeout(checkCanPlay, 100);
|
|
2955
|
-
};
|
|
2956
|
-
audio.addEventListener("canplay", () => resolve(true), { once: true });
|
|
2957
|
-
audio.addEventListener("error", () => resolve(false), { once: true });
|
|
2958
|
-
audio.src = url;
|
|
2959
|
-
audio.load();
|
|
2960
|
-
setTimeout(() => resolve(false), 2e3);
|
|
2961
|
-
});
|
|
2962
|
-
};
|
|
2963
|
-
let loaded = await tryLoadAudio(audioUrl);
|
|
2964
|
-
if (!loaded && audioUrl !== incomingRingtoneUrl) {
|
|
2965
|
-
loaded = await tryLoadAudio(incomingRingtoneUrl);
|
|
2966
|
-
if (loaded) {
|
|
2967
|
-
audioUrl = incomingRingtoneUrl;
|
|
2968
|
-
}
|
|
2969
|
-
}
|
|
2970
|
-
return audio;
|
|
2971
|
-
}
|
|
2972
|
-
function cleanupAudioResources() {
|
|
2973
|
-
if (audioBlobUrl) {
|
|
2974
|
-
URL.revokeObjectURL(audioBlobUrl);
|
|
2975
|
-
audioBlobUrl = null;
|
|
2976
|
-
}
|
|
2977
|
-
audioBuffer = null;
|
|
2978
|
-
}
|
|
2979
|
-
|
|
2980
3068
|
// call-control-sdk/lib/components/callControls.tsx
|
|
2981
3069
|
import { getItem as getItem5 } from "@react-solutions/vault";
|
|
2982
3070
|
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
@@ -3020,10 +3108,11 @@ function CallControls({ onDataChange }) {
|
|
|
3020
3108
|
});
|
|
3021
3109
|
const micRef = useRef2(null);
|
|
3022
3110
|
const webSocketRef = useRef2(null);
|
|
3023
|
-
const audioRef = useRef2(null);
|
|
3024
3111
|
const reconnectTimeoutRef = useRef2(null);
|
|
3025
3112
|
const pingIntervalRef = useRef2(null);
|
|
3026
3113
|
const reconnectAttemptsRef = useRef2(0);
|
|
3114
|
+
const hasFlashedRef = useRef2(false);
|
|
3115
|
+
const lastEventTimeRef = useRef2(null);
|
|
3027
3116
|
const maxReconnectAttempts = 60;
|
|
3028
3117
|
const baseReconnectDelay = 2e3;
|
|
3029
3118
|
const maxReconnectDelay = 3e4;
|
|
@@ -3281,22 +3370,6 @@ function CallControls({ onDataChange }) {
|
|
|
3281
3370
|
if (wrapUpinterval) clearInterval(wrapUpinterval);
|
|
3282
3371
|
};
|
|
3283
3372
|
}, [state.callData.status]);
|
|
3284
|
-
useEffect5(() => {
|
|
3285
|
-
createAudioElement().then((audio) => {
|
|
3286
|
-
audioRef.current = audio;
|
|
3287
|
-
}).catch((error) => {
|
|
3288
|
-
console.error("Failed to load audio element:", error);
|
|
3289
|
-
});
|
|
3290
|
-
return () => {
|
|
3291
|
-
if (audioRef.current) {
|
|
3292
|
-
audioRef.current.pause();
|
|
3293
|
-
audioRef.current.currentTime = 0;
|
|
3294
|
-
audioRef.current.src = "";
|
|
3295
|
-
audioRef.current = null;
|
|
3296
|
-
}
|
|
3297
|
-
cleanupAudioResources();
|
|
3298
|
-
};
|
|
3299
|
-
}, []);
|
|
3300
3373
|
useEffect5(() => {
|
|
3301
3374
|
if (onDataChange && state.callData) {
|
|
3302
3375
|
const { process_id, process_name, status, phone_number, agent_id, convox_id } = state.callData;
|
|
@@ -3366,7 +3439,7 @@ function CallControls({ onDataChange }) {
|
|
|
3366
3439
|
}, 3e4);
|
|
3367
3440
|
};
|
|
3368
3441
|
webSocketRef.current.onmessage = (event) => {
|
|
3369
|
-
var _a3, _b2;
|
|
3442
|
+
var _a3, _b2, _c2, _d2;
|
|
3370
3443
|
try {
|
|
3371
3444
|
const data = JSON.parse(event.data);
|
|
3372
3445
|
if (data.type === "pong") {
|
|
@@ -3445,24 +3518,41 @@ function CallControls({ onDataChange }) {
|
|
|
3445
3518
|
isMergeCall: false
|
|
3446
3519
|
}
|
|
3447
3520
|
]);
|
|
3448
|
-
if ((data == null ? void 0 : data.mode) !== "manual" && audioRef.current) {
|
|
3449
|
-
audioRef.current.play().catch((error) => {
|
|
3450
|
-
console.error("Failed to play ringtone:", error);
|
|
3451
|
-
});
|
|
3452
|
-
}
|
|
3453
|
-
} else {
|
|
3454
|
-
if (audioRef.current) {
|
|
3455
|
-
audioRef.current.pause();
|
|
3456
|
-
audioRef.current.currentTime = 0;
|
|
3457
|
-
}
|
|
3458
3521
|
}
|
|
3459
|
-
if (data.status === "
|
|
3522
|
+
if (data.status === "IDLE" /* IDLE */) {
|
|
3523
|
+
USB_LIGHT_REQUEST(USB_LIGHT_ON("green"));
|
|
3524
|
+
} else if ((data == null ? void 0 : data.mute) !== 1 && (data == null ? void 0 : data.hold) !== 1 && data.status === "ONCALL" /* ONCALL */) {
|
|
3525
|
+
USB_LIGHT_REQUEST(USB_LIGHT_ON("red"));
|
|
3460
3526
|
sdkStateManager.startCall();
|
|
3461
3527
|
if (!showIframe) {
|
|
3462
3528
|
setShowIframe(true);
|
|
3463
3529
|
}
|
|
3464
|
-
}
|
|
3465
|
-
|
|
3530
|
+
} else if (((data == null ? void 0 : data.mute) === 1 || (data == null ? void 0 : data.hold) === 1) && data.status === "ONCALL" /* ONCALL */) {
|
|
3531
|
+
USB_LIGHT_REQUEST(USB_LIGHT_FLASH("red", 1));
|
|
3532
|
+
} else if (data.status === "BREAK" /* BREAK */) {
|
|
3533
|
+
const breakTime = (_c2 = sdkState == null ? void 0 : sdkState.sdkConfig) == null ? void 0 : _c2.break_time;
|
|
3534
|
+
const eventTime = (_d2 = data == null ? void 0 : data.event_time) != null ? _d2 : null;
|
|
3535
|
+
if (eventTime !== lastEventTimeRef.current) {
|
|
3536
|
+
hasFlashedRef.current = false;
|
|
3537
|
+
lastEventTimeRef.current = eventTime;
|
|
3538
|
+
}
|
|
3539
|
+
let isOverLimit = false;
|
|
3540
|
+
if (breakTime && eventTime) {
|
|
3541
|
+
const differenceInMinutes = ((/* @__PURE__ */ new Date()).getTime() - new Date(eventTime).getTime()) / 6e4;
|
|
3542
|
+
if (Number(differenceInMinutes.toFixed(0)) >= Number(breakTime)) {
|
|
3543
|
+
isOverLimit = true;
|
|
3544
|
+
}
|
|
3545
|
+
}
|
|
3546
|
+
if (isOverLimit) {
|
|
3547
|
+
if (!hasFlashedRef.current) {
|
|
3548
|
+
USB_LIGHT_REQUEST(USB_LIGHT_FLASH("yellow", 1));
|
|
3549
|
+
hasFlashedRef.current = true;
|
|
3550
|
+
}
|
|
3551
|
+
} else {
|
|
3552
|
+
USB_LIGHT_REQUEST(USB_LIGHT_ON("yellow"));
|
|
3553
|
+
}
|
|
3554
|
+
} else if (data.status === "WRAPUP" /* WRAPUP */) {
|
|
3555
|
+
USB_LIGHT_REQUEST(USB_LIGHT_FLASH("green", 1));
|
|
3466
3556
|
sdkStateManager.endCall();
|
|
3467
3557
|
}
|
|
3468
3558
|
} catch (e) {
|
|
@@ -3789,7 +3879,7 @@ function CallControls({ onDataChange }) {
|
|
|
3789
3879
|
},
|
|
3790
3880
|
sx: state.openCallTransferDialog ? __spreadValues({}, enabled) : ((_aa = (_$ = state.callData) == null ? void 0 : _$.status) == null ? void 0 : _aa.toUpperCase()) === "ONCALL" /* ONCALL */ ? __spreadValues({}, outlined) : __spreadValues({}, disabled),
|
|
3791
3881
|
disabled: ((_ca = (_ba = state.callData) == null ? void 0 : _ba.status) == null ? void 0 : _ca.toUpperCase()) !== "ONCALL" /* ONCALL */,
|
|
3792
|
-
children: /* @__PURE__ */ jsx3(
|
|
3882
|
+
children: /* @__PURE__ */ jsx3(TransferWithinAStation2, {})
|
|
3793
3883
|
}
|
|
3794
3884
|
) }),
|
|
3795
3885
|
!((_da = state.sdkConfig) == null ? void 0 : _da.disableConferenceButton) && /* @__PURE__ */ jsx3(Tooltip2, { title: "Conference Call", children: /* @__PURE__ */ jsx3(
|