@ammarkhalidfarooq/dashboard-package 0.6.126 → 0.6.128
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/README.md +305 -305
- package/dist/ActiveCampaignsCard.cjs.js +419 -243
- package/dist/ActiveCampaignsCard.cjs.js.map +1 -1
- package/dist/ActiveCampaignsCard.es.js +421 -245
- package/dist/ActiveCampaignsCard.es.js.map +1 -1
- package/dist/MetricCard.cjs.js.map +1 -1
- package/dist/MetricCard.es.js.map +1 -1
- package/dist/RenderChartCard.cjs.js.map +1 -1
- package/dist/RenderChartCard.es.js.map +1 -1
- package/dist/index.cjs.js +749 -808
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +750 -809
- package/dist/index.es.js.map +1 -1
- package/package.json +80 -80
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Suspense, lazy, useState, useRef, useEffect, useMemo } from 'react';
|
|
2
2
|
import { Box, Button, Menu, MenuItem, useTheme, useMediaQuery, Grid, Card, CardContent, Typography, IconButton, ThemeProvider, CircularProgress, Avatar, LinearProgress, Stack, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Skeleton } from '@mui/material';
|
|
3
|
-
import { MoreHoriz, TrendingDown, TrendingUp, MoreVert, Check, InfoOutlined, Settings, PeopleAltOutlined, RequestQuoteOutlined, PaidOutlined, PersonOutlined, IndeterminateCheckBoxOutlined, FavoriteOutlined, SearchOutlined, HighlightOff, Email } from '@mui/icons-material';
|
|
3
|
+
import { MoreHoriz, TrendingDown, TrendingUp, MoreVert, Check, InfoOutlined, Settings, PeopleAltOutlined, RequestQuoteOutlined, PaidOutlined, Adjust, PersonOutlined, IndeterminateCheckBoxOutlined, FavoriteOutlined, SearchOutlined, HighlightOff, Email } from '@mui/icons-material';
|
|
4
4
|
import { createTheme } from '@mui/material/styles';
|
|
5
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
import Grid$1 from '@mui/material/Grid';
|
|
@@ -434,13 +434,13 @@ function formatCurrency(value) {
|
|
|
434
434
|
}
|
|
435
435
|
function formatNumber(num) {
|
|
436
436
|
if (num >= 1000000000) {
|
|
437
|
-
return (num / 1000000000).toFixed(
|
|
437
|
+
return (num / 1000000000).toFixed(2).replace(/\.00$/, "") + "B";
|
|
438
438
|
}
|
|
439
439
|
if (num >= 1000000) {
|
|
440
|
-
return (num / 1000000).toFixed(
|
|
440
|
+
return (num / 1000000).toFixed(2).replace(/\.00$/, "") + "M";
|
|
441
441
|
}
|
|
442
442
|
if (num >= 1000) {
|
|
443
|
-
return (num / 1000).toFixed(
|
|
443
|
+
return (num / 1000).toFixed(2).replace(/\.00$/, "") + "K";
|
|
444
444
|
}
|
|
445
445
|
return (num !== null && num !== void 0 ? num : 0).toString();
|
|
446
446
|
}
|
|
@@ -1019,262 +1019,482 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
|
|
|
1019
1019
|
title = _ref$title === void 0 ? "Active campaigns" : _ref$title,
|
|
1020
1020
|
_ref$subtitle = _ref.subtitle,
|
|
1021
1021
|
subtitle = _ref$subtitle === void 0 ? "Live fundraisers ranked by velocity" : _ref$subtitle,
|
|
1022
|
-
actionLabel = _ref.actionLabel,
|
|
1023
1022
|
_ref$columns = _ref.columns,
|
|
1024
|
-
columns = _ref$columns === void 0 ? ["Campaign", "Raised", "Progress", "Donors", "Avg
|
|
1023
|
+
columns = _ref$columns === void 0 ? ["Campaign", "Raised", "Progress", "Donors", "Avg gift"] : _ref$columns,
|
|
1025
1024
|
_ref$rows = _ref.rows,
|
|
1026
1025
|
rows = _ref$rows === void 0 ? [] : _ref$rows,
|
|
1027
1026
|
_ref$gridTemplateColu = _ref.gridTemplateColumns,
|
|
1028
|
-
gridTemplateColumns = _ref$gridTemplateColu === void 0 ? "3fr 1fr 1.5fr 0.8fr 1fr
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
boxShadow: compact ? "0 2px 12px rgba(0,0,0,0.05)" : "0 4px 24px rgba(0,0,0,0.06)",
|
|
1044
|
-
p: compact ? 1.5 : 3,
|
|
1045
|
-
height: height
|
|
1046
|
-
}, sx),
|
|
1047
|
-
children: [/*#__PURE__*/jsxs(Box, {
|
|
1048
|
-
sx: _objectSpread2({
|
|
1049
|
-
display: "flex",
|
|
1050
|
-
justifyContent: "space-between",
|
|
1051
|
-
alignItems: "flex-start",
|
|
1052
|
-
mb: compact ? 1.25 : 3
|
|
1053
|
-
}, headerSx),
|
|
1027
|
+
gridTemplateColumns = _ref$gridTemplateColu === void 0 ? "3fr 1fr 1.5fr 0.8fr 1fr" : _ref$gridTemplateColu;
|
|
1028
|
+
var theme = useTheme();
|
|
1029
|
+
var isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
1030
|
+
var isTablet = useMediaQuery(theme.breakpoints.between("sm", "md"));
|
|
1031
|
+
|
|
1032
|
+
/* ─── Desktop / Tablet: Grid Table ─── */
|
|
1033
|
+
if (!isMobile) {
|
|
1034
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
1035
|
+
sx: {
|
|
1036
|
+
bgcolor: "#fff",
|
|
1037
|
+
borderRadius: 4,
|
|
1038
|
+
border: "1px solid #f0f0f0",
|
|
1039
|
+
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
1040
|
+
p: 3
|
|
1041
|
+
},
|
|
1054
1042
|
children: [/*#__PURE__*/jsxs(Box, {
|
|
1043
|
+
sx: {
|
|
1044
|
+
mb: 3
|
|
1045
|
+
},
|
|
1055
1046
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
1056
1047
|
sx: {
|
|
1057
1048
|
fontWeight: 700,
|
|
1058
|
-
fontSize:
|
|
1059
|
-
color: "#000"
|
|
1060
|
-
textAlign: "left",
|
|
1061
|
-
lineHeight: 1.15
|
|
1049
|
+
fontSize: "18px",
|
|
1050
|
+
color: "#000"
|
|
1062
1051
|
},
|
|
1063
1052
|
children: title
|
|
1064
1053
|
}), /*#__PURE__*/jsx(Typography, {
|
|
1065
1054
|
sx: {
|
|
1066
|
-
fontSize:
|
|
1067
|
-
color: "rgba(0,
|
|
1068
|
-
|
|
1069
|
-
lineHeight: 1.15
|
|
1055
|
+
fontSize: "13px",
|
|
1056
|
+
color: "rgba(0,0,0,0.4)",
|
|
1057
|
+
mt: 0.2
|
|
1070
1058
|
},
|
|
1071
1059
|
children: subtitle
|
|
1072
1060
|
})]
|
|
1073
|
-
}),
|
|
1061
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
1074
1062
|
sx: {
|
|
1075
|
-
|
|
1076
|
-
fontWeight: 600,
|
|
1077
|
-
color: "rgb(99, 99, 230)",
|
|
1078
|
-
cursor: "pointer"
|
|
1063
|
+
overflowX: "auto"
|
|
1079
1064
|
},
|
|
1080
|
-
children:
|
|
1065
|
+
children: /*#__PURE__*/jsxs(Box, {
|
|
1066
|
+
sx: {
|
|
1067
|
+
minWidth: "600px"
|
|
1068
|
+
},
|
|
1069
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
1070
|
+
sx: {
|
|
1071
|
+
display: "grid",
|
|
1072
|
+
gridTemplateColumns: gridTemplateColumns,
|
|
1073
|
+
gap: 2,
|
|
1074
|
+
pb: 2.5,
|
|
1075
|
+
borderBottom: "1px solid #f0f0f0"
|
|
1076
|
+
},
|
|
1077
|
+
children: columns.map(function (header, colIdx) {
|
|
1078
|
+
return /*#__PURE__*/jsx(Typography, {
|
|
1079
|
+
sx: {
|
|
1080
|
+
fontSize: "12px",
|
|
1081
|
+
color: "rgba(0,0,0,0.4)",
|
|
1082
|
+
fontWeight: 500,
|
|
1083
|
+
whiteSpace: "nowrap",
|
|
1084
|
+
textAlign: colIdx === 0 ? "left" : "center"
|
|
1085
|
+
},
|
|
1086
|
+
children: header
|
|
1087
|
+
}, header);
|
|
1088
|
+
})
|
|
1089
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
1090
|
+
sx: {
|
|
1091
|
+
mt: 1
|
|
1092
|
+
},
|
|
1093
|
+
children: rows.map(function (row, idx) {
|
|
1094
|
+
var isDisabled = row.comingSoon;
|
|
1095
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
1096
|
+
sx: {
|
|
1097
|
+
display: "grid",
|
|
1098
|
+
gridTemplateColumns: gridTemplateColumns,
|
|
1099
|
+
gap: 2,
|
|
1100
|
+
py: 1.2,
|
|
1101
|
+
alignItems: "center",
|
|
1102
|
+
borderBottom: idx === rows.length - 1 ? "none" : "1px solid #f5f5f5",
|
|
1103
|
+
opacity: isDisabled ? 0.55 : 1,
|
|
1104
|
+
transition: "opacity 0.2s ease"
|
|
1105
|
+
},
|
|
1106
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
1107
|
+
sx: {
|
|
1108
|
+
display: "flex",
|
|
1109
|
+
alignItems: "center",
|
|
1110
|
+
gap: 1.5,
|
|
1111
|
+
minWidth: 0
|
|
1112
|
+
},
|
|
1113
|
+
children: [row.id && /*#__PURE__*/jsx(Avatar, {
|
|
1114
|
+
sx: {
|
|
1115
|
+
width: 28,
|
|
1116
|
+
height: 28,
|
|
1117
|
+
fontSize: "10px",
|
|
1118
|
+
fontWeight: 700,
|
|
1119
|
+
bgcolor: row.avatarBg || "#F3F4F6",
|
|
1120
|
+
color: row.avatarColor || "#fff",
|
|
1121
|
+
flexShrink: 0
|
|
1122
|
+
},
|
|
1123
|
+
children: row.id
|
|
1124
|
+
}), /*#__PURE__*/jsxs(Box, {
|
|
1125
|
+
sx: {
|
|
1126
|
+
display: "flex",
|
|
1127
|
+
alignItems: "center",
|
|
1128
|
+
gap: 0.8,
|
|
1129
|
+
flexWrap: "nowrap",
|
|
1130
|
+
minWidth: 0
|
|
1131
|
+
},
|
|
1132
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1133
|
+
sx: {
|
|
1134
|
+
fontSize: "12px",
|
|
1135
|
+
fontWeight: 700,
|
|
1136
|
+
color: "#000",
|
|
1137
|
+
whiteSpace: "nowrap"
|
|
1138
|
+
},
|
|
1139
|
+
children: row.name
|
|
1140
|
+
}), isDisabled && /*#__PURE__*/jsx(Box, {
|
|
1141
|
+
sx: {
|
|
1142
|
+
display: "inline-flex",
|
|
1143
|
+
alignItems: "center",
|
|
1144
|
+
px: 0.8,
|
|
1145
|
+
py: 0.2,
|
|
1146
|
+
borderRadius: "100px",
|
|
1147
|
+
bgcolor: "#F3F4F6",
|
|
1148
|
+
border: "1px solid #E5E7EB",
|
|
1149
|
+
flexShrink: 0,
|
|
1150
|
+
whiteSpace: "nowrap"
|
|
1151
|
+
},
|
|
1152
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
1153
|
+
sx: {
|
|
1154
|
+
fontSize: "8px",
|
|
1155
|
+
fontWeight: 700,
|
|
1156
|
+
color: "#6B7280",
|
|
1157
|
+
letterSpacing: "0.3px",
|
|
1158
|
+
textTransform: "uppercase",
|
|
1159
|
+
whiteSpace: "nowrap"
|
|
1160
|
+
},
|
|
1161
|
+
children: "Coming Soon"
|
|
1162
|
+
})
|
|
1163
|
+
})]
|
|
1164
|
+
})]
|
|
1165
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
1166
|
+
sx: {
|
|
1167
|
+
fontSize: "13px",
|
|
1168
|
+
fontWeight: 600,
|
|
1169
|
+
color: isDisabled ? "#9CA3AF" : "#000",
|
|
1170
|
+
whiteSpace: "nowrap",
|
|
1171
|
+
textAlign: "center"
|
|
1172
|
+
},
|
|
1173
|
+
children: row.val1
|
|
1174
|
+
}), row.type === "progress" ? /*#__PURE__*/jsxs(Box, {
|
|
1175
|
+
sx: {
|
|
1176
|
+
display: "flex",
|
|
1177
|
+
alignItems: "center",
|
|
1178
|
+
gap: 1.5,
|
|
1179
|
+
justifyContent: "center"
|
|
1180
|
+
},
|
|
1181
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
1182
|
+
sx: {
|
|
1183
|
+
flexGrow: 1,
|
|
1184
|
+
maxWidth: "80px"
|
|
1185
|
+
},
|
|
1186
|
+
children: /*#__PURE__*/jsx(LinearProgress, {
|
|
1187
|
+
variant: "determinate",
|
|
1188
|
+
value: row.progress,
|
|
1189
|
+
sx: {
|
|
1190
|
+
height: 8,
|
|
1191
|
+
borderRadius: 4,
|
|
1192
|
+
bgcolor: "#F3F4F6",
|
|
1193
|
+
"& .MuiLinearProgress-bar": {
|
|
1194
|
+
borderRadius: 4,
|
|
1195
|
+
bgcolor: row.progressColor || "rgb(99,99,230)"
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
})
|
|
1199
|
+
}), /*#__PURE__*/jsxs(Typography, {
|
|
1200
|
+
sx: {
|
|
1201
|
+
fontSize: "11px",
|
|
1202
|
+
color: "rgba(0,0,0,0.4)",
|
|
1203
|
+
minWidth: "30px",
|
|
1204
|
+
textAlign: "center"
|
|
1205
|
+
},
|
|
1206
|
+
children: [row.progress, "%"]
|
|
1207
|
+
})]
|
|
1208
|
+
}) : /*#__PURE__*/jsx(Typography, {
|
|
1209
|
+
sx: {
|
|
1210
|
+
fontSize: "13px",
|
|
1211
|
+
fontWeight: 600,
|
|
1212
|
+
color: isDisabled ? "#9CA3AF" : "#000",
|
|
1213
|
+
whiteSpace: "nowrap",
|
|
1214
|
+
textAlign: "center"
|
|
1215
|
+
},
|
|
1216
|
+
children: row.val2
|
|
1217
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
1218
|
+
sx: {
|
|
1219
|
+
fontSize: "13px",
|
|
1220
|
+
fontWeight: row.highlightVal3 ? 700 : 500,
|
|
1221
|
+
color: isDisabled ? "#9CA3AF" : row.highlightVal3 ? row.val3Color || "#22C55E" : "#000",
|
|
1222
|
+
whiteSpace: "nowrap",
|
|
1223
|
+
textAlign: "center"
|
|
1224
|
+
},
|
|
1225
|
+
children: row.val3
|
|
1226
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
1227
|
+
sx: {
|
|
1228
|
+
fontSize: "13px",
|
|
1229
|
+
fontWeight: 500,
|
|
1230
|
+
color: isDisabled ? "#9CA3AF" : "#000",
|
|
1231
|
+
whiteSpace: "nowrap",
|
|
1232
|
+
textAlign: "center"
|
|
1233
|
+
},
|
|
1234
|
+
children: row.val4
|
|
1235
|
+
}), columns.length > 5 && /*#__PURE__*/jsx(Box, {
|
|
1236
|
+
sx: {
|
|
1237
|
+
display: "flex",
|
|
1238
|
+
justifyContent: "center"
|
|
1239
|
+
},
|
|
1240
|
+
children: row.type === "trend" ? /*#__PURE__*/jsxs(Box, {
|
|
1241
|
+
sx: {
|
|
1242
|
+
display: "flex",
|
|
1243
|
+
alignItems: "center",
|
|
1244
|
+
gap: 0.5
|
|
1245
|
+
},
|
|
1246
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1247
|
+
sx: {
|
|
1248
|
+
fontSize: "14px",
|
|
1249
|
+
color: row.trendType === "up" ? "#22C55E" : "#EF4444"
|
|
1250
|
+
},
|
|
1251
|
+
children: row.trendType === "up" ? "▲" : "▼"
|
|
1252
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
1253
|
+
sx: {
|
|
1254
|
+
fontSize: "12px",
|
|
1255
|
+
color: row.trendType === "up" ? "#22C55E" : "#EF4444",
|
|
1256
|
+
fontWeight: 700,
|
|
1257
|
+
whiteSpace: "nowrap"
|
|
1258
|
+
},
|
|
1259
|
+
children: isTablet ? row.trendType === "up" ? "Up" : "Down" : row.trendLabel
|
|
1260
|
+
})]
|
|
1261
|
+
}) : row.type === "comingSoon" ? /*#__PURE__*/jsx(Typography, {
|
|
1262
|
+
sx: {
|
|
1263
|
+
fontSize: "12px",
|
|
1264
|
+
color: "#9CA3AF",
|
|
1265
|
+
fontWeight: 500,
|
|
1266
|
+
textAlign: "center"
|
|
1267
|
+
},
|
|
1268
|
+
children: "\u2014"
|
|
1269
|
+
}) : /*#__PURE__*/jsx(Box, {
|
|
1270
|
+
sx: {
|
|
1271
|
+
display: "inline-block",
|
|
1272
|
+
px: 1.5,
|
|
1273
|
+
py: 0.5,
|
|
1274
|
+
borderRadius: "100px",
|
|
1275
|
+
bgcolor: row.statusBg,
|
|
1276
|
+
color: row.statusColor,
|
|
1277
|
+
fontSize: "11px",
|
|
1278
|
+
fontWeight: 700
|
|
1279
|
+
},
|
|
1280
|
+
children: row.status
|
|
1281
|
+
})
|
|
1282
|
+
})]
|
|
1283
|
+
}, idx);
|
|
1284
|
+
})
|
|
1285
|
+
})]
|
|
1286
|
+
})
|
|
1081
1287
|
})]
|
|
1082
|
-
})
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1288
|
+
});
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
/* ─── Mobile: Stacked Card Layout ─── */
|
|
1292
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
1293
|
+
sx: {
|
|
1294
|
+
bgcolor: "#fff",
|
|
1295
|
+
borderRadius: 4,
|
|
1296
|
+
border: "1px solid #f0f0f0",
|
|
1297
|
+
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
1298
|
+
p: 2
|
|
1299
|
+
},
|
|
1300
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
1301
|
+
sx: {
|
|
1302
|
+
mb: 2
|
|
1303
|
+
},
|
|
1304
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1087
1305
|
sx: {
|
|
1088
|
-
|
|
1306
|
+
fontWeight: 700,
|
|
1307
|
+
fontSize: "16px",
|
|
1308
|
+
color: "#000"
|
|
1089
1309
|
},
|
|
1090
|
-
children:
|
|
1310
|
+
children: title
|
|
1311
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
1312
|
+
sx: {
|
|
1313
|
+
fontSize: "11px",
|
|
1314
|
+
color: "rgba(0,0,0,0.4)",
|
|
1315
|
+
mt: 0.2
|
|
1316
|
+
},
|
|
1317
|
+
children: subtitle
|
|
1318
|
+
})]
|
|
1319
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
1320
|
+
sx: {
|
|
1321
|
+
display: "flex",
|
|
1322
|
+
flexDirection: "column",
|
|
1323
|
+
gap: 1.5
|
|
1324
|
+
},
|
|
1325
|
+
children: rows.map(function (row, idx) {
|
|
1326
|
+
var isDisabled = row.comingSoon;
|
|
1327
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
1091
1328
|
sx: {
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1329
|
+
p: 2,
|
|
1330
|
+
borderRadius: 3,
|
|
1331
|
+
border: isDisabled ? "1px dashed #E5E7EB" : "1px solid #F3F4F6",
|
|
1332
|
+
bgcolor: isDisabled ? "#FAFAFA" : "#fff",
|
|
1333
|
+
opacity: isDisabled ? 0.7 : 1,
|
|
1334
|
+
transition: "opacity 0.2s ease"
|
|
1097
1335
|
},
|
|
1098
|
-
children:
|
|
1099
|
-
|
|
1336
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
1337
|
+
sx: {
|
|
1338
|
+
display: "flex",
|
|
1339
|
+
alignItems: "center",
|
|
1340
|
+
gap: 1.5,
|
|
1341
|
+
mb: isDisabled ? 0 : 1.5
|
|
1342
|
+
},
|
|
1343
|
+
children: [row.id && /*#__PURE__*/jsx(Avatar, {
|
|
1100
1344
|
sx: {
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1345
|
+
width: 32,
|
|
1346
|
+
height: 32,
|
|
1347
|
+
fontSize: "11px",
|
|
1348
|
+
fontWeight: 700,
|
|
1349
|
+
bgcolor: row.avatarBg || "#F3F4F6",
|
|
1350
|
+
color: row.avatarColor || "#fff",
|
|
1351
|
+
flexShrink: 0
|
|
1105
1352
|
},
|
|
1106
|
-
children:
|
|
1107
|
-
},
|
|
1108
|
-
})
|
|
1109
|
-
}), /*#__PURE__*/jsx(Box, {
|
|
1110
|
-
sx: {
|
|
1111
|
-
mt: 1
|
|
1112
|
-
},
|
|
1113
|
-
children: rows.map(function (row, idx) {
|
|
1114
|
-
var _row$progress;
|
|
1115
|
-
return /*#__PURE__*/jsxs(Box, {
|
|
1353
|
+
children: row.id
|
|
1354
|
+
}), /*#__PURE__*/jsxs(Box, {
|
|
1116
1355
|
sx: {
|
|
1117
|
-
display: "
|
|
1118
|
-
gridTemplateColumns: gridTemplateColumns,
|
|
1119
|
-
gap: compact ? 1 : 2,
|
|
1120
|
-
py: compact ? 0.5 : 1.2,
|
|
1356
|
+
display: "flex",
|
|
1121
1357
|
alignItems: "center",
|
|
1122
|
-
|
|
1358
|
+
gap: 1,
|
|
1359
|
+
flex: 1,
|
|
1360
|
+
flexWrap: "nowrap"
|
|
1123
1361
|
},
|
|
1124
|
-
children: [/*#__PURE__*/
|
|
1362
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1125
1363
|
sx: {
|
|
1126
|
-
|
|
1364
|
+
fontSize: "14px",
|
|
1365
|
+
fontWeight: 700,
|
|
1366
|
+
color: "#000"
|
|
1367
|
+
},
|
|
1368
|
+
children: row.name
|
|
1369
|
+
}), isDisabled && /*#__PURE__*/jsx(Box, {
|
|
1370
|
+
sx: {
|
|
1371
|
+
display: "inline-flex",
|
|
1127
1372
|
alignItems: "center",
|
|
1128
|
-
|
|
1373
|
+
px: 1,
|
|
1374
|
+
py: 0.3,
|
|
1375
|
+
borderRadius: "100px",
|
|
1376
|
+
bgcolor: "#F3F4F6",
|
|
1377
|
+
border: "1px solid #E5E7EB",
|
|
1378
|
+
flexShrink: 0
|
|
1129
1379
|
},
|
|
1130
|
-
children:
|
|
1131
|
-
sx: {
|
|
1132
|
-
width: compact ? 22 : 28,
|
|
1133
|
-
height: compact ? 22 : 28,
|
|
1134
|
-
fontSize: compact ? "8px" : "10px",
|
|
1135
|
-
fontWeight: 700,
|
|
1136
|
-
bgcolor: row.avatarBg || "#F3F4F6",
|
|
1137
|
-
color: "rgb(99, 99, 230)"
|
|
1138
|
-
},
|
|
1139
|
-
children: row.id
|
|
1140
|
-
}), row.icon && /*#__PURE__*/jsx(Box, {
|
|
1141
|
-
sx: {
|
|
1142
|
-
color: row.iconColor || "inherit",
|
|
1143
|
-
display: "flex",
|
|
1144
|
-
alignItems: "center"
|
|
1145
|
-
},
|
|
1146
|
-
children: /*#__PURE__*/jsx(row.icon, {
|
|
1147
|
-
sx: {
|
|
1148
|
-
fontSize: "18px"
|
|
1149
|
-
}
|
|
1150
|
-
})
|
|
1151
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
1380
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
1152
1381
|
sx: {
|
|
1153
|
-
fontSize:
|
|
1382
|
+
fontSize: "8px",
|
|
1154
1383
|
fontWeight: 700,
|
|
1155
|
-
color: "#
|
|
1384
|
+
color: "#6B7280",
|
|
1385
|
+
letterSpacing: "0.3px",
|
|
1386
|
+
textTransform: "uppercase"
|
|
1156
1387
|
},
|
|
1157
|
-
children:
|
|
1158
|
-
})
|
|
1388
|
+
children: "Coming Soon"
|
|
1389
|
+
})
|
|
1390
|
+
})]
|
|
1391
|
+
}), row.type === "trend" && /*#__PURE__*/jsxs(Box, {
|
|
1392
|
+
sx: {
|
|
1393
|
+
display: "flex",
|
|
1394
|
+
alignItems: "center",
|
|
1395
|
+
gap: 0.3,
|
|
1396
|
+
flexShrink: 0
|
|
1397
|
+
},
|
|
1398
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1399
|
+
sx: {
|
|
1400
|
+
fontSize: "12px",
|
|
1401
|
+
color: row.trendType === "up" ? "#22C55E" : "#EF4444"
|
|
1402
|
+
},
|
|
1403
|
+
children: row.trendType === "up" ? "▲" : "▼"
|
|
1159
1404
|
}), /*#__PURE__*/jsx(Typography, {
|
|
1160
1405
|
sx: {
|
|
1161
|
-
fontSize:
|
|
1406
|
+
fontSize: "11px",
|
|
1407
|
+
color: row.trendType === "up" ? "#22C55E" : "#EF4444",
|
|
1408
|
+
fontWeight: 700
|
|
1409
|
+
},
|
|
1410
|
+
children: row.trendType === "up" ? "Up" : "Down"
|
|
1411
|
+
})]
|
|
1412
|
+
})]
|
|
1413
|
+
}), !isDisabled && /*#__PURE__*/jsxs(Box, {
|
|
1414
|
+
sx: {
|
|
1415
|
+
display: "grid",
|
|
1416
|
+
gridTemplateColumns: "1fr 1fr 1fr 1fr",
|
|
1417
|
+
gap: 1
|
|
1418
|
+
},
|
|
1419
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
1420
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1421
|
+
sx: {
|
|
1422
|
+
fontSize: "9px",
|
|
1423
|
+
color: "#9CA3AF",
|
|
1162
1424
|
fontWeight: 600,
|
|
1425
|
+
textTransform: "uppercase",
|
|
1426
|
+
letterSpacing: "0.3px"
|
|
1427
|
+
},
|
|
1428
|
+
children: "Spend"
|
|
1429
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
1430
|
+
sx: {
|
|
1431
|
+
fontSize: "13px",
|
|
1432
|
+
fontWeight: 700,
|
|
1163
1433
|
color: "#000",
|
|
1164
|
-
|
|
1434
|
+
mt: 0.3
|
|
1165
1435
|
},
|
|
1166
1436
|
children: row.val1
|
|
1167
|
-
})
|
|
1437
|
+
})]
|
|
1438
|
+
}), /*#__PURE__*/jsxs(Box, {
|
|
1439
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1168
1440
|
sx: {
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1441
|
+
fontSize: "9px",
|
|
1442
|
+
color: "#9CA3AF",
|
|
1443
|
+
fontWeight: 600,
|
|
1444
|
+
textTransform: "uppercase",
|
|
1445
|
+
letterSpacing: "0.3px"
|
|
1172
1446
|
},
|
|
1173
|
-
children:
|
|
1174
|
-
|
|
1175
|
-
flexGrow: 1
|
|
1176
|
-
},
|
|
1177
|
-
children: /*#__PURE__*/jsx(LinearProgress, {
|
|
1178
|
-
variant: "determinate",
|
|
1179
|
-
value: Math.min(100, Math.max(0, (_row$progress = row.progress) !== null && _row$progress !== void 0 ? _row$progress : 0)),
|
|
1180
|
-
sx: {
|
|
1181
|
-
height: compact ? 6 : 8,
|
|
1182
|
-
borderRadius: 4,
|
|
1183
|
-
bgcolor: "#F3F4F6",
|
|
1184
|
-
"& .MuiLinearProgress-bar": {
|
|
1185
|
-
borderRadius: 4,
|
|
1186
|
-
bgcolor: row.progressColor || "rgb(99, 99, 230)"
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
})
|
|
1190
|
-
}), /*#__PURE__*/jsxs(Typography, {
|
|
1191
|
-
sx: {
|
|
1192
|
-
fontSize: compact ? "9px" : "11px",
|
|
1193
|
-
color: "rgba(0, 0, 0, 0.4)",
|
|
1194
|
-
minWidth: "30px"
|
|
1195
|
-
},
|
|
1196
|
-
children: [row.progress, "%"]
|
|
1197
|
-
})]
|
|
1198
|
-
}) : /*#__PURE__*/jsx(Typography, {
|
|
1447
|
+
children: "Revenue"
|
|
1448
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
1199
1449
|
sx: {
|
|
1200
1450
|
fontSize: "13px",
|
|
1201
|
-
fontWeight:
|
|
1451
|
+
fontWeight: 700,
|
|
1202
1452
|
color: "#000",
|
|
1203
|
-
|
|
1453
|
+
mt: 0.3
|
|
1204
1454
|
},
|
|
1205
1455
|
children: row.val2
|
|
1456
|
+
})]
|
|
1457
|
+
}), /*#__PURE__*/jsxs(Box, {
|
|
1458
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1459
|
+
sx: {
|
|
1460
|
+
fontSize: "9px",
|
|
1461
|
+
color: "#9CA3AF",
|
|
1462
|
+
fontWeight: 600,
|
|
1463
|
+
textTransform: "uppercase",
|
|
1464
|
+
letterSpacing: "0.3px"
|
|
1465
|
+
},
|
|
1466
|
+
children: "ROAS"
|
|
1206
1467
|
}), /*#__PURE__*/jsx(Typography, {
|
|
1207
1468
|
sx: {
|
|
1208
|
-
fontSize:
|
|
1209
|
-
fontWeight:
|
|
1210
|
-
color: row.
|
|
1211
|
-
|
|
1469
|
+
fontSize: "13px",
|
|
1470
|
+
fontWeight: 700,
|
|
1471
|
+
color: row.val3Color || "#22C55E",
|
|
1472
|
+
mt: 0.3
|
|
1212
1473
|
},
|
|
1213
1474
|
children: row.val3
|
|
1475
|
+
})]
|
|
1476
|
+
}), /*#__PURE__*/jsxs(Box, {
|
|
1477
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1478
|
+
sx: {
|
|
1479
|
+
fontSize: "9px",
|
|
1480
|
+
color: "#9CA3AF",
|
|
1481
|
+
fontWeight: 600,
|
|
1482
|
+
textTransform: "uppercase",
|
|
1483
|
+
letterSpacing: "0.3px"
|
|
1484
|
+
},
|
|
1485
|
+
children: "CPA"
|
|
1214
1486
|
}), /*#__PURE__*/jsx(Typography, {
|
|
1215
1487
|
sx: {
|
|
1216
1488
|
fontSize: "13px",
|
|
1217
|
-
fontWeight:
|
|
1489
|
+
fontWeight: 700,
|
|
1218
1490
|
color: "#000",
|
|
1219
|
-
|
|
1491
|
+
mt: 0.3
|
|
1220
1492
|
},
|
|
1221
1493
|
children: row.val4
|
|
1222
|
-
}), columns.length > 5 && /*#__PURE__*/jsx(Box, {
|
|
1223
|
-
children: row.type === "trend" ? /*#__PURE__*/jsx(Box, {
|
|
1224
|
-
sx: {
|
|
1225
|
-
display: "flex",
|
|
1226
|
-
alignItems: "center",
|
|
1227
|
-
gap: 0.5
|
|
1228
|
-
},
|
|
1229
|
-
children: row.trendType === "up" ? /*#__PURE__*/jsxs(Fragment, {
|
|
1230
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
1231
|
-
sx: {
|
|
1232
|
-
fontSize: "14px",
|
|
1233
|
-
color: "#22C55E"
|
|
1234
|
-
},
|
|
1235
|
-
children: "\u25B2"
|
|
1236
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
1237
|
-
sx: {
|
|
1238
|
-
fontSize: "12px",
|
|
1239
|
-
color: "#22C55E",
|
|
1240
|
-
fontWeight: 700
|
|
1241
|
-
},
|
|
1242
|
-
children: row.trendLabel
|
|
1243
|
-
})]
|
|
1244
|
-
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
1245
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
1246
|
-
sx: {
|
|
1247
|
-
fontSize: "14px",
|
|
1248
|
-
color: "#EF4444"
|
|
1249
|
-
},
|
|
1250
|
-
children: "\u25BC"
|
|
1251
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
1252
|
-
sx: {
|
|
1253
|
-
fontSize: "12px",
|
|
1254
|
-
color: "#EF4444",
|
|
1255
|
-
fontWeight: 700
|
|
1256
|
-
},
|
|
1257
|
-
children: row.trendLabel
|
|
1258
|
-
})]
|
|
1259
|
-
})
|
|
1260
|
-
}) : /*#__PURE__*/jsx(Box, {
|
|
1261
|
-
sx: {
|
|
1262
|
-
display: "inline-block",
|
|
1263
|
-
px: compact ? 1 : 1.5,
|
|
1264
|
-
py: compact ? 0.25 : 0.5,
|
|
1265
|
-
borderRadius: "100px",
|
|
1266
|
-
bgcolor: row.statusBg,
|
|
1267
|
-
color: row.statusColor,
|
|
1268
|
-
fontSize: compact ? "9px" : "11px",
|
|
1269
|
-
fontWeight: 700,
|
|
1270
|
-
textAlign: "center"
|
|
1271
|
-
},
|
|
1272
|
-
children: row.status
|
|
1273
|
-
})
|
|
1274
1494
|
})]
|
|
1275
|
-
}
|
|
1276
|
-
})
|
|
1277
|
-
})
|
|
1495
|
+
})]
|
|
1496
|
+
})]
|
|
1497
|
+
}, idx);
|
|
1278
1498
|
})
|
|
1279
1499
|
})]
|
|
1280
1500
|
});
|
|
@@ -1368,6 +1588,99 @@ var MetricCard$1 = function MetricCard(_ref) {
|
|
|
1368
1588
|
});
|
|
1369
1589
|
};
|
|
1370
1590
|
|
|
1591
|
+
var DisplayCard = function DisplayCard(_ref) {
|
|
1592
|
+
var title = _ref.title,
|
|
1593
|
+
value = _ref.value,
|
|
1594
|
+
subValue = _ref.subValue,
|
|
1595
|
+
Icon = _ref.icon,
|
|
1596
|
+
onClick = _ref.onClick,
|
|
1597
|
+
_ref$sx = _ref.sx,
|
|
1598
|
+
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
1599
|
+
_ref$isActive = _ref.isActive,
|
|
1600
|
+
isActive = _ref$isActive === void 0 ? false : _ref$isActive;
|
|
1601
|
+
return /*#__PURE__*/jsxs(Box, {
|
|
1602
|
+
onClick: onClick,
|
|
1603
|
+
sx: _objectSpread2({
|
|
1604
|
+
height: "100px",
|
|
1605
|
+
borderRadius: "24px",
|
|
1606
|
+
display: "flex",
|
|
1607
|
+
justifyContent: "space-between",
|
|
1608
|
+
alignItems: "center",
|
|
1609
|
+
boxShadow: "rgba(0, 0, 0, 0.06) 0px 4px 15px 0px",
|
|
1610
|
+
// boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
1611
|
+
// padding: "16px 16px 16px 18px",
|
|
1612
|
+
py: "10px",
|
|
1613
|
+
px: "16px",
|
|
1614
|
+
cursor: "pointer",
|
|
1615
|
+
bgcolor: "#fff",
|
|
1616
|
+
border: isActive ? "1px solid rgb(99, 99, 230)" : "none",
|
|
1617
|
+
// border: "2px solid #f0f0f0",
|
|
1618
|
+
transition: "all 0.3s ease"
|
|
1619
|
+
}, sx),
|
|
1620
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
1621
|
+
sx: {
|
|
1622
|
+
display: "flex",
|
|
1623
|
+
flexDirection: "column",
|
|
1624
|
+
gap: 0.5
|
|
1625
|
+
},
|
|
1626
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1627
|
+
sx: {
|
|
1628
|
+
fontWeight: "400",
|
|
1629
|
+
color: isActive ? "#c1c1f5" : "#a1a1a8",
|
|
1630
|
+
fontSize: "14px",
|
|
1631
|
+
lineHeight: "16px",
|
|
1632
|
+
textAlign: "left"
|
|
1633
|
+
},
|
|
1634
|
+
children: title
|
|
1635
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
1636
|
+
sx: {
|
|
1637
|
+
lineHeight: "1.2",
|
|
1638
|
+
textAlign: "left",
|
|
1639
|
+
color: isActive ? "#6363e6" : "#000",
|
|
1640
|
+
fontSize: "20px",
|
|
1641
|
+
fontWeight: "700",
|
|
1642
|
+
mb: 0.5
|
|
1643
|
+
},
|
|
1644
|
+
children: statusValue(value)
|
|
1645
|
+
}), subValue && /*#__PURE__*/jsxs(Typography, {
|
|
1646
|
+
sx: {
|
|
1647
|
+
fontSize: "11px",
|
|
1648
|
+
color: typeof subValue === "string" && (subValue.includes("%") || subValue.includes("new") || subValue.includes("x")) && !subValue.includes("/") && !subValue.includes("pass-through") ? "#22C55E" : "rgba(0, 0, 0, 0.4)",
|
|
1649
|
+
fontWeight: "500",
|
|
1650
|
+
display: "flex",
|
|
1651
|
+
alignItems: "center",
|
|
1652
|
+
gap: 0.5
|
|
1653
|
+
},
|
|
1654
|
+
children: [typeof subValue === "string" && (subValue.includes("%") || subValue.includes("new") || subValue.includes("x")) && !subValue.includes("/") && !subValue.includes("pass-through") && /*#__PURE__*/jsx("span", {
|
|
1655
|
+
style: {
|
|
1656
|
+
fontSize: "14px"
|
|
1657
|
+
},
|
|
1658
|
+
children: "\u25B2"
|
|
1659
|
+
}), subValue]
|
|
1660
|
+
})]
|
|
1661
|
+
}), Icon && /*#__PURE__*/jsx(Box, {
|
|
1662
|
+
sx: {
|
|
1663
|
+
width: "44px",
|
|
1664
|
+
height: "44px",
|
|
1665
|
+
borderRadius: "50%",
|
|
1666
|
+
backgroundColor: "#f7f7ff",
|
|
1667
|
+
display: "flex",
|
|
1668
|
+
alignItems: "center",
|
|
1669
|
+
justifyContent: "center",
|
|
1670
|
+
color: "rgb(99, 99, 230)"
|
|
1671
|
+
},
|
|
1672
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
1673
|
+
sx: {
|
|
1674
|
+
fontSize: "20px"
|
|
1675
|
+
}
|
|
1676
|
+
})
|
|
1677
|
+
})]
|
|
1678
|
+
});
|
|
1679
|
+
};
|
|
1680
|
+
var statusValue = function statusValue(value) {
|
|
1681
|
+
return _typeof(value) === "object" && value !== null ? value.value !== undefined ? value.value : JSON.stringify(value) : value;
|
|
1682
|
+
};
|
|
1683
|
+
|
|
1371
1684
|
var PURPLE = "#6363E6";
|
|
1372
1685
|
var REPORT_COLORS = {
|
|
1373
1686
|
purple: PURPLE};
|
|
@@ -1745,8 +2058,8 @@ var kpiRoas = function kpiRoas(v) {
|
|
|
1745
2058
|
};
|
|
1746
2059
|
var d$Compact = function d$Compact(v) {
|
|
1747
2060
|
var n = Number(v !== null && v !== void 0 ? v : 0);
|
|
1748
|
-
if (n >= 1000000) return "$".concat((n / 1000000).toFixed(
|
|
1749
|
-
if (n >= 1000) return "$".concat((n / 1000).toFixed(
|
|
2061
|
+
if (n >= 1000000) return "$".concat((n / 1000000).toFixed(2), "M");
|
|
2062
|
+
if (n >= 1000) return "$".concat((n / 1000).toFixed(2), "K");
|
|
1750
2063
|
return d$(n);
|
|
1751
2064
|
};
|
|
1752
2065
|
var pct = function pct(v) {
|
|
@@ -3756,9 +4069,9 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref34, ref) {
|
|
|
3756
4069
|
});
|
|
3757
4070
|
ExportPdfLayout.displayName = "ExportPdfLayout";
|
|
3758
4071
|
|
|
3759
|
-
/**
|
|
3760
|
-
* Captures [data-export-page] elements and saves a multi-page PDF.
|
|
3761
|
-
* Each page uses a custom size matching the captured content so nothing is cropped.
|
|
4072
|
+
/**
|
|
4073
|
+
* Captures [data-export-page] elements and saves a multi-page PDF.
|
|
4074
|
+
* Each page uses a custom size matching the captured content so nothing is cropped.
|
|
3762
4075
|
*/
|
|
3763
4076
|
function exportReportPdf(_x, _x2) {
|
|
3764
4077
|
return _exportReportPdf.apply(this, arguments);
|
|
@@ -4601,8 +4914,6 @@ var DonorMixCard = function DonorMixCard(_ref) {
|
|
|
4601
4914
|
border: "1px solid #f0f0f0",
|
|
4602
4915
|
boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
|
|
4603
4916
|
p: compact ? 1.5 : 3,
|
|
4604
|
-
// height: "100%",
|
|
4605
|
-
// width: "100%",
|
|
4606
4917
|
display: "flex",
|
|
4607
4918
|
flexDirection: "column"
|
|
4608
4919
|
}, sx),
|
|
@@ -4632,7 +4943,6 @@ var DonorMixCard = function DonorMixCard(_ref) {
|
|
|
4632
4943
|
sx: {
|
|
4633
4944
|
position: "relative",
|
|
4634
4945
|
height: compact ? "110px" : "180px",
|
|
4635
|
-
// mb: 1,
|
|
4636
4946
|
display: "flex",
|
|
4637
4947
|
justifyContent: "center"
|
|
4638
4948
|
},
|
|
@@ -4643,13 +4953,16 @@ var DonorMixCard = function DonorMixCard(_ref) {
|
|
|
4643
4953
|
width: compact ? "140" : "210"
|
|
4644
4954
|
})
|
|
4645
4955
|
}), /*#__PURE__*/jsxs(Box, {
|
|
4646
|
-
sx: {},
|
|
4647
4956
|
children: [items.map(function (item, idx) {
|
|
4957
|
+
var isComingSoon = item.comingSoon;
|
|
4648
4958
|
return /*#__PURE__*/jsxs(Box, {
|
|
4649
4959
|
sx: {
|
|
4650
4960
|
display: "flex",
|
|
4651
4961
|
justifyContent: "space-between",
|
|
4652
|
-
|
|
4962
|
+
alignItems: "center",
|
|
4963
|
+
mb: idx === items.length - 1 ? showBottomSummary ? compact ? 0.5 : 0 : 0 : compact ? 0.5 : 0,
|
|
4964
|
+
opacity: isComingSoon ? 0.55 : 1,
|
|
4965
|
+
transition: "opacity 0.2s ease"
|
|
4653
4966
|
},
|
|
4654
4967
|
children: [/*#__PURE__*/jsxs(Box, {
|
|
4655
4968
|
sx: {
|
|
@@ -4668,11 +4981,32 @@ var DonorMixCard = function DonorMixCard(_ref) {
|
|
|
4668
4981
|
sx: {
|
|
4669
4982
|
fontSize: compact ? "10px" : "13px",
|
|
4670
4983
|
fontWeight: 500,
|
|
4671
|
-
color: "rgba(0, 0, 0, 0.4)"
|
|
4984
|
+
color: isComingSoon ? "#9CA3AF" : "rgba(0, 0, 0, 0.4)"
|
|
4672
4985
|
},
|
|
4673
4986
|
children: item.label
|
|
4674
4987
|
})]
|
|
4675
|
-
}), /*#__PURE__*/jsx(
|
|
4988
|
+
}), isComingSoon ? /*#__PURE__*/jsx(Box, {
|
|
4989
|
+
sx: {
|
|
4990
|
+
display: "inline-flex",
|
|
4991
|
+
alignItems: "center",
|
|
4992
|
+
px: 1,
|
|
4993
|
+
py: 0.3,
|
|
4994
|
+
borderRadius: "100px",
|
|
4995
|
+
bgcolor: "#F3F4F6",
|
|
4996
|
+
border: "1px solid #E5E7EB"
|
|
4997
|
+
},
|
|
4998
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
4999
|
+
sx: {
|
|
5000
|
+
fontSize: "9px",
|
|
5001
|
+
fontWeight: 700,
|
|
5002
|
+
color: "#6B7280",
|
|
5003
|
+
letterSpacing: "0.3px",
|
|
5004
|
+
textTransform: "uppercase",
|
|
5005
|
+
lineHeight: 1
|
|
5006
|
+
},
|
|
5007
|
+
children: "Coming Soon"
|
|
5008
|
+
})
|
|
5009
|
+
}) : /*#__PURE__*/jsx(Typography, {
|
|
4676
5010
|
sx: {
|
|
4677
5011
|
fontSize: compact ? "10px" : "13px",
|
|
4678
5012
|
fontWeight: 700,
|
|
@@ -4683,9 +5017,6 @@ var DonorMixCard = function DonorMixCard(_ref) {
|
|
|
4683
5017
|
}, idx);
|
|
4684
5018
|
}), showBottomSummary && /*#__PURE__*/jsxs(Box, {
|
|
4685
5019
|
sx: {
|
|
4686
|
-
// display: "flex",
|
|
4687
|
-
// justifyContent: "space-between",
|
|
4688
|
-
// alignItems: "center",
|
|
4689
5020
|
pt: compact ? 1 : 2,
|
|
4690
5021
|
borderTop: "1px solid #f0f0f0",
|
|
4691
5022
|
textAlign: "left"
|
|
@@ -6461,13 +6792,16 @@ var TopCampaignsConvRateCard = function TopCampaignsConvRateCard(_ref7) {
|
|
|
6461
6792
|
})]
|
|
6462
6793
|
});
|
|
6463
6794
|
};
|
|
6464
|
-
var getCampaignInitials$
|
|
6795
|
+
var getCampaignInitials$1 = function getCampaignInitials() {
|
|
6465
6796
|
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
6466
|
-
var words = name.
|
|
6797
|
+
var words = name.match(/[A-Za-z]+/g) || [];
|
|
6467
6798
|
if (words.length >= 2) {
|
|
6468
6799
|
return (words[0][0] + words[1][0]).toUpperCase();
|
|
6469
6800
|
}
|
|
6470
|
-
|
|
6801
|
+
if (words.length === 1) {
|
|
6802
|
+
return words[0].slice(0, 2).toUpperCase();
|
|
6803
|
+
}
|
|
6804
|
+
return "—";
|
|
6471
6805
|
};
|
|
6472
6806
|
var TopPerformingCampaignsCard = function TopPerformingCampaignsCard(_ref8) {
|
|
6473
6807
|
var _ref8$data = _ref8.data,
|
|
@@ -6561,20 +6895,27 @@ var TopPerformingCampaignsCard = function TopPerformingCampaignsCard(_ref8) {
|
|
|
6561
6895
|
alignItems: "center",
|
|
6562
6896
|
gap: 1.5
|
|
6563
6897
|
},
|
|
6564
|
-
children: [/*#__PURE__*/jsx(
|
|
6898
|
+
children: [/*#__PURE__*/jsx(Avatar, {
|
|
6899
|
+
src: item.image || item.avatar || item.logo || item.thumbnail || item.campaignImage || undefined,
|
|
6900
|
+
alt: item.name,
|
|
6901
|
+
imgProps: {
|
|
6902
|
+
style: {
|
|
6903
|
+
width: "100%",
|
|
6904
|
+
height: "100%",
|
|
6905
|
+
objectFit: "cover"
|
|
6906
|
+
}
|
|
6907
|
+
},
|
|
6565
6908
|
sx: {
|
|
6566
6909
|
width: 24,
|
|
6567
6910
|
height: 24,
|
|
6911
|
+
flexShrink: 0,
|
|
6568
6912
|
borderRadius: "50%",
|
|
6569
6913
|
bgcolor: "#c1cfde71",
|
|
6570
6914
|
color: "#3431e4ff",
|
|
6571
|
-
display: "flex",
|
|
6572
|
-
alignItems: "center",
|
|
6573
|
-
justifyContent: "center",
|
|
6574
6915
|
fontSize: "10px",
|
|
6575
6916
|
fontWeight: 700
|
|
6576
6917
|
},
|
|
6577
|
-
children: item.id || getCampaignInitials$
|
|
6918
|
+
children: item.id || getCampaignInitials$1(item.name)
|
|
6578
6919
|
}), /*#__PURE__*/jsx(Typography, {
|
|
6579
6920
|
sx: {
|
|
6580
6921
|
fontSize: "13px",
|
|
@@ -6921,7 +7262,7 @@ var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
|
|
|
6921
7262
|
}];
|
|
6922
7263
|
var fmt = function fmt(n) {
|
|
6923
7264
|
var _n$toFixed;
|
|
6924
|
-
return n >= 1000 ? "".concat((n / 1000).toFixed(
|
|
7265
|
+
return n >= 1000 ? "".concat((n / 1000).toFixed(2), "k") : parseFloat((_n$toFixed = n === null || n === void 0 ? void 0 : n.toFixed(2)) !== null && _n$toFixed !== void 0 ? _n$toFixed : 0).toString();
|
|
6925
7266
|
};
|
|
6926
7267
|
var growthColor = growthPercentage > 0 ? "#EF4444" : growthPercentage < 0 ? "#22C55E" : "rgba(0,0,0,0.4)";
|
|
6927
7268
|
var growthLabel = growthPercentage > 0 ? "\u25B2 ".concat(growthPercentage.toFixed(1), "%") : growthPercentage < 0 ? "\u25BC ".concat(Math.abs(growthPercentage).toFixed(1), "%") : "stable";
|
|
@@ -9090,14 +9431,14 @@ var AbandonedDonationRecovery = function AbandonedDonationRecovery() {
|
|
|
9090
9431
|
});
|
|
9091
9432
|
};
|
|
9092
9433
|
|
|
9093
|
-
/**
|
|
9094
|
-
* Theme colors for server components
|
|
9095
|
-
*
|
|
9096
|
-
* These are plain JavaScript objects that can be safely imported
|
|
9097
|
-
* in both server and client components without triggering
|
|
9098
|
-
* client-only code in server components.
|
|
9099
|
-
*
|
|
9100
|
-
* For client components, use the full theme from @/config/customTheme
|
|
9434
|
+
/**
|
|
9435
|
+
* Theme colors for server components
|
|
9436
|
+
*
|
|
9437
|
+
* These are plain JavaScript objects that can be safely imported
|
|
9438
|
+
* in both server and client components without triggering
|
|
9439
|
+
* client-only code in server components.
|
|
9440
|
+
*
|
|
9441
|
+
* For client components, use the full theme from @/config/customTheme
|
|
9101
9442
|
*/
|
|
9102
9443
|
|
|
9103
9444
|
var themeColors = {
|
|
@@ -17437,98 +17778,15 @@ var OverallSectionSkeleton = function OverallSectionSkeleton() {
|
|
|
17437
17778
|
height: 280
|
|
17438
17779
|
}, index);
|
|
17439
17780
|
})
|
|
17440
|
-
}), /*#__PURE__*/jsx(Box, {
|
|
17441
|
-
sx: fourColGridSx,
|
|
17442
|
-
children: Array.from({
|
|
17443
|
-
length: 4
|
|
17444
|
-
}).map(function (_, index) {
|
|
17445
|
-
return /*#__PURE__*/jsx(PanelCardSkeleton, {
|
|
17446
|
-
height: 280
|
|
17447
|
-
}, index);
|
|
17448
|
-
})
|
|
17449
|
-
})]
|
|
17450
|
-
})]
|
|
17451
|
-
});
|
|
17452
|
-
};
|
|
17453
|
-
var PaidSectionSkeleton = function PaidSectionSkeleton() {
|
|
17454
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
17455
|
-
children: [/*#__PURE__*/jsx(MetricCardsSkeleton, {
|
|
17456
|
-
count: 6,
|
|
17457
|
-
gridTemplateColumns: {
|
|
17458
|
-
xs: "1fr",
|
|
17459
|
-
sm: "1fr 1fr",
|
|
17460
|
-
md: "1fr 1fr 1fr",
|
|
17461
|
-
lg: "repeat(6, 1fr)"
|
|
17462
|
-
},
|
|
17463
|
-
gap: 2
|
|
17464
|
-
}), /*#__PURE__*/jsx(Grid, {
|
|
17465
|
-
container: true,
|
|
17466
|
-
spacing: 3,
|
|
17467
|
-
sx: {
|
|
17468
|
-
mt: 2.75
|
|
17469
|
-
},
|
|
17470
|
-
children: /*#__PURE__*/jsx(Grid, {
|
|
17471
|
-
item: true,
|
|
17472
|
-
xs: 12,
|
|
17473
|
-
sx: {
|
|
17474
|
-
paddingTop: "0px !important"
|
|
17475
|
-
},
|
|
17476
|
-
children: /*#__PURE__*/jsx(ChartCardSkeleton, {
|
|
17477
|
-
height: 400
|
|
17478
|
-
})
|
|
17479
|
-
})
|
|
17480
|
-
}), /*#__PURE__*/jsxs(Grid, {
|
|
17481
|
-
container: true,
|
|
17482
|
-
spacing: 3,
|
|
17483
|
-
sx: {
|
|
17484
|
-
mt: 2.25
|
|
17485
|
-
},
|
|
17486
|
-
children: [/*#__PURE__*/jsx(Grid, {
|
|
17487
|
-
item: true,
|
|
17488
|
-
xs: 12,
|
|
17489
|
-
md: 6,
|
|
17490
|
-
sx: {
|
|
17491
|
-
paddingTop: "0px !important",
|
|
17492
|
-
minHeight: 430
|
|
17493
|
-
},
|
|
17494
|
-
children: /*#__PURE__*/jsx(TableCardSkeleton, {})
|
|
17495
|
-
}), /*#__PURE__*/jsx(Grid, {
|
|
17496
|
-
item: true,
|
|
17497
|
-
xs: 12,
|
|
17498
|
-
md: 6,
|
|
17499
|
-
sx: {
|
|
17500
|
-
paddingTop: "0px !important",
|
|
17501
|
-
minHeight: 430
|
|
17502
|
-
},
|
|
17503
|
-
children: /*#__PURE__*/jsx(DonutCardSkeleton, {})
|
|
17504
|
-
})]
|
|
17505
|
-
}), /*#__PURE__*/jsxs(Grid, {
|
|
17506
|
-
container: true,
|
|
17507
|
-
spacing: 3,
|
|
17508
|
-
sx: {
|
|
17509
|
-
mt: 2.25
|
|
17510
|
-
},
|
|
17511
|
-
children: [/*#__PURE__*/jsx(Grid, {
|
|
17512
|
-
item: true,
|
|
17513
|
-
xs: 12,
|
|
17514
|
-
md: 6,
|
|
17515
|
-
sx: {
|
|
17516
|
-
paddingTop: "0px !important"
|
|
17517
|
-
},
|
|
17518
|
-
children: /*#__PURE__*/jsx(TableCardSkeleton, {
|
|
17519
|
-
height: 360,
|
|
17520
|
-
rowCount: 4
|
|
17521
|
-
})
|
|
17522
|
-
}), /*#__PURE__*/jsx(Grid, {
|
|
17523
|
-
item: true,
|
|
17524
|
-
xs: 12,
|
|
17525
|
-
md: 6,
|
|
17526
|
-
sx: {
|
|
17527
|
-
paddingTop: "0px !important"
|
|
17528
|
-
},
|
|
17529
|
-
children: /*#__PURE__*/jsx(PanelCardSkeleton, {
|
|
17530
|
-
height: 360
|
|
17531
|
-
})
|
|
17781
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
17782
|
+
sx: fourColGridSx,
|
|
17783
|
+
children: Array.from({
|
|
17784
|
+
length: 4
|
|
17785
|
+
}).map(function (_, index) {
|
|
17786
|
+
return /*#__PURE__*/jsx(PanelCardSkeleton, {
|
|
17787
|
+
height: 280
|
|
17788
|
+
}, index);
|
|
17789
|
+
})
|
|
17532
17790
|
})]
|
|
17533
17791
|
})]
|
|
17534
17792
|
});
|
|
@@ -17673,7 +17931,7 @@ var EmailSectionSkeleton = function EmailSectionSkeleton() {
|
|
|
17673
17931
|
});
|
|
17674
17932
|
};
|
|
17675
17933
|
|
|
17676
|
-
var formatKpi$
|
|
17934
|
+
var formatKpi$2 = function formatKpi(value) {
|
|
17677
17935
|
return Number(value !== null && value !== void 0 ? value : 0).toLocaleString("en-US", {
|
|
17678
17936
|
minimumFractionDigits: 2,
|
|
17679
17937
|
maximumFractionDigits: 2
|
|
@@ -17751,7 +18009,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
17751
18009
|
};
|
|
17752
18010
|
var metricInfo = {
|
|
17753
18011
|
"Total Raised": {
|
|
17754
|
-
value: "$".concat(formatKpi$
|
|
18012
|
+
value: "$".concat(formatKpi$2((_apiData$overviewStat = apiData === null || apiData === void 0 || (_apiData$overviewStat2 = apiData.overviewStats) === null || _apiData$overviewStat2 === void 0 || (_apiData$overviewStat2 = _apiData$overviewStat2.overview) === null || _apiData$overviewStat2 === void 0 ? void 0 : _apiData$overviewStat2.totalRevenue) !== null && _apiData$overviewStat !== void 0 ? _apiData$overviewStat : 0)) || "$0",
|
|
17755
18013
|
subValue: "".concat(Number((_apiData$overviewStat3 = apiData === null || apiData === void 0 || (_apiData$overviewStat4 = apiData.overviewStats) === null || _apiData$overviewStat4 === void 0 || (_apiData$overviewStat4 = _apiData$overviewStat4.overview) === null || _apiData$overviewStat4 === void 0 || (_apiData$overviewStat4 = _apiData$overviewStat4.growthPercentage) === null || _apiData$overviewStat4 === void 0 ? void 0 : _apiData$overviewStat4.totalRevenue) !== null && _apiData$overviewStat3 !== void 0 ? _apiData$overviewStat3 : 0).toFixed(2), "% vs pp"),
|
|
17756
18014
|
label: "Total Raised",
|
|
17757
18015
|
icon: /*#__PURE__*/jsx(PaidOutlined, {}),
|
|
@@ -17760,7 +18018,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
17760
18018
|
warning: false
|
|
17761
18019
|
},
|
|
17762
18020
|
"Net Raised": {
|
|
17763
|
-
value: "$".concat(formatKpi$
|
|
18021
|
+
value: "$".concat(formatKpi$2((_apiData$overviewStat5 = apiData === null || apiData === void 0 || (_apiData$overviewStat6 = apiData.overviewStats) === null || _apiData$overviewStat6 === void 0 || (_apiData$overviewStat6 = _apiData$overviewStat6.overview) === null || _apiData$overviewStat6 === void 0 ? void 0 : _apiData$overviewStat6.netRevenue) !== null && _apiData$overviewStat5 !== void 0 ? _apiData$overviewStat5 : 0)),
|
|
17764
18022
|
subValue: "".concat(Number((_apiData$overviewStat7 = apiData === null || apiData === void 0 || (_apiData$overviewStat8 = apiData.overviewStats) === null || _apiData$overviewStat8 === void 0 || (_apiData$overviewStat8 = _apiData$overviewStat8.overview.growthPercentage) === null || _apiData$overviewStat8 === void 0 ? void 0 : _apiData$overviewStat8.netRevenue) !== null && _apiData$overviewStat7 !== void 0 ? _apiData$overviewStat7 : 0).toFixed(2), "% vs pp\n "),
|
|
17765
18023
|
label: "Net Raised",
|
|
17766
18024
|
icon: /*#__PURE__*/jsx(RequestQuoteOutlined, {}),
|
|
@@ -17769,7 +18027,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
17769
18027
|
warning: false
|
|
17770
18028
|
},
|
|
17771
18029
|
"Total Donors": {
|
|
17772
|
-
value: formatKpi$
|
|
18030
|
+
value: formatKpi$2((_apiData$overviewStat9 = apiData === null || apiData === void 0 || (_apiData$overviewStat0 = apiData.overviewStats) === null || _apiData$overviewStat0 === void 0 || (_apiData$overviewStat0 = _apiData$overviewStat0.overview) === null || _apiData$overviewStat0 === void 0 ? void 0 : _apiData$overviewStat0.totalDonations) !== null && _apiData$overviewStat9 !== void 0 ? _apiData$overviewStat9 : 0),
|
|
17773
18031
|
subValue: "".concat(Number((_apiData$overviewStat1 = apiData === null || apiData === void 0 || (_apiData$overviewStat10 = apiData.overviewStats) === null || _apiData$overviewStat10 === void 0 || (_apiData$overviewStat10 = _apiData$overviewStat10.overview.growthPercentage) === null || _apiData$overviewStat10 === void 0 ? void 0 : _apiData$overviewStat10.totalDonations) !== null && _apiData$overviewStat1 !== void 0 ? _apiData$overviewStat1 : 0).toFixed(2), "%") || "0 new",
|
|
17774
18032
|
label: "Total Donors",
|
|
17775
18033
|
icon: /*#__PURE__*/jsx(PeopleAltOutlined, {}),
|
|
@@ -17778,7 +18036,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
17778
18036
|
warning: false
|
|
17779
18037
|
},
|
|
17780
18038
|
"Avg Donation": {
|
|
17781
|
-
value: "$".concat(formatKpi$
|
|
18039
|
+
value: "$".concat(formatKpi$2((_apiData$overviewStat11 = apiData === null || apiData === void 0 || (_apiData$overviewStat12 = apiData.overviewStats) === null || _apiData$overviewStat12 === void 0 || (_apiData$overviewStat12 = _apiData$overviewStat12.overview) === null || _apiData$overviewStat12 === void 0 ? void 0 : _apiData$overviewStat12.overallAVGDonations) !== null && _apiData$overviewStat11 !== void 0 ? _apiData$overviewStat11 : 0)),
|
|
17782
18040
|
subValue: "".concat(Number((_apiData$overviewStat13 = apiData === null || apiData === void 0 || (_apiData$overviewStat14 = apiData.overviewStats) === null || _apiData$overviewStat14 === void 0 || (_apiData$overviewStat14 = _apiData$overviewStat14.overview.growthPercentage) === null || _apiData$overviewStat14 === void 0 ? void 0 : _apiData$overviewStat14.overallAVGDonations) !== null && _apiData$overviewStat13 !== void 0 ? _apiData$overviewStat13 : 0).toFixed(2), "% vs pp\n "),
|
|
17783
18041
|
label: "Average Donation Amount",
|
|
17784
18042
|
icon: /*#__PURE__*/jsx(AverageDonationIcon, {}),
|
|
@@ -17787,7 +18045,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
17787
18045
|
warning: false
|
|
17788
18046
|
},
|
|
17789
18047
|
"ROAS": {
|
|
17790
|
-
value: "".concat(formatKpi$
|
|
18048
|
+
value: "".concat(formatKpi$2((_apiData$overviewStat15 = apiData === null || apiData === void 0 || (_apiData$overviewStat16 = apiData.overviewStats) === null || _apiData$overviewStat16 === void 0 || (_apiData$overviewStat16 = _apiData$overviewStat16.overview) === null || _apiData$overviewStat16 === void 0 ? void 0 : _apiData$overviewStat16.roas) !== null && _apiData$overviewStat15 !== void 0 ? _apiData$overviewStat15 : 0), "x"),
|
|
17791
18049
|
subValue: "".concat(Number((_apiData$overviewStat17 = apiData === null || apiData === void 0 || (_apiData$overviewStat18 = apiData.overviewStats) === null || _apiData$overviewStat18 === void 0 || (_apiData$overviewStat18 = _apiData$overviewStat18.overview) === null || _apiData$overviewStat18 === void 0 || (_apiData$overviewStat18 = _apiData$overviewStat18.growthPercentage) === null || _apiData$overviewStat18 === void 0 ? void 0 : _apiData$overviewStat18.roas) !== null && _apiData$overviewStat17 !== void 0 ? _apiData$overviewStat17 : 0).toFixed(2), "x vs pp"),
|
|
17792
18050
|
label: "ROAS",
|
|
17793
18051
|
icon: /*#__PURE__*/jsx(TrendingUp, {}),
|
|
@@ -17796,7 +18054,7 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
17796
18054
|
warning: false
|
|
17797
18055
|
},
|
|
17798
18056
|
"Conversion": {
|
|
17799
|
-
value: "".concat(formatKpi$
|
|
18057
|
+
value: "".concat(formatKpi$2((_apiData$overviewStat19 = apiData === null || apiData === void 0 || (_apiData$overviewStat20 = apiData.overviewStats) === null || _apiData$overviewStat20 === void 0 || (_apiData$overviewStat20 = _apiData$overviewStat20.overview) === null || _apiData$overviewStat20 === void 0 ? void 0 : _apiData$overviewStat20.conversionRate) !== null && _apiData$overviewStat19 !== void 0 ? _apiData$overviewStat19 : 0), "%"),
|
|
17800
18058
|
subValue: "".concat(((_apiData$overviewStat21 = apiData === null || apiData === void 0 || (_apiData$overviewStat22 = apiData.overviewStats) === null || _apiData$overviewStat22 === void 0 || (_apiData$overviewStat22 = _apiData$overviewStat22.overview) === null || _apiData$overviewStat22 === void 0 || (_apiData$overviewStat22 = _apiData$overviewStat22.growthPercentage) === null || _apiData$overviewStat22 === void 0 ? void 0 : _apiData$overviewStat22.conversionRate) !== null && _apiData$overviewStat21 !== void 0 ? _apiData$overviewStat21 : 0).toFixed(2), "%") || "0%",
|
|
17801
18059
|
label: "Conversion Rate",
|
|
17802
18060
|
icon: /*#__PURE__*/jsx(ConversionRateIcon, {}),
|
|
@@ -18182,448 +18440,93 @@ var OverallSection$1 = /*#__PURE__*/Object.freeze({
|
|
|
18182
18440
|
default: OverallSection
|
|
18183
18441
|
});
|
|
18184
18442
|
|
|
18185
|
-
var
|
|
18186
|
-
return Number(value !== null && value !== void 0 ? value : 0).toLocaleString("en-US", {
|
|
18187
|
-
minimumFractionDigits: 2,
|
|
18188
|
-
maximumFractionDigits: 2
|
|
18189
|
-
});
|
|
18190
|
-
};
|
|
18191
|
-
var CHANNEL_STYLES = {
|
|
18192
|
-
"Meta Ads": {
|
|
18193
|
-
id: "M",
|
|
18194
|
-
avatarBg: "#4267B2",
|
|
18195
|
-
color: "#4267B2"
|
|
18196
|
-
},
|
|
18197
|
-
"Google Ads": {
|
|
18198
|
-
id: "G",
|
|
18199
|
-
avatarBg: "#4285F4",
|
|
18200
|
-
color: "#4285F4"
|
|
18201
|
-
},
|
|
18202
|
-
"TikTok Ads": {
|
|
18203
|
-
id: "T",
|
|
18204
|
-
avatarBg: "#000000",
|
|
18205
|
-
color: "#cd249dff"
|
|
18206
|
-
},
|
|
18207
|
-
YouTube: {
|
|
18208
|
-
id: "Y",
|
|
18209
|
-
avatarBg: "#FF0000",
|
|
18210
|
-
color: "#FF0000"
|
|
18211
|
-
},
|
|
18212
|
-
Snapchat: {
|
|
18213
|
-
id: "S",
|
|
18214
|
-
avatarBg: "#FFFC00",
|
|
18215
|
-
color: "#FFFC00"
|
|
18216
|
-
}
|
|
18217
|
-
};
|
|
18218
|
-
var formatGrowth$2 = function formatGrowth(value) {
|
|
18219
|
-
return "".concat(Number(value !== null && value !== void 0 ? value : 0).toFixed(2), "% vs pp");
|
|
18220
|
-
};
|
|
18221
|
-
var mapTimeSeries$2 = function mapTimeSeries(series) {
|
|
18222
|
-
if (!Array.isArray(series) || series.length === 0) {
|
|
18223
|
-
return {
|
|
18224
|
-
categories: [],
|
|
18225
|
-
data: []
|
|
18226
|
-
};
|
|
18227
|
-
}
|
|
18228
|
-
return {
|
|
18229
|
-
categories: series.map(function (item) {
|
|
18230
|
-
return item.date;
|
|
18231
|
-
}),
|
|
18232
|
-
data: series.map(function (item) {
|
|
18233
|
-
var _item$value;
|
|
18234
|
-
return (_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : 0;
|
|
18235
|
-
})
|
|
18236
|
-
};
|
|
18237
|
-
};
|
|
18238
|
-
var getChannelStyle = function getChannelStyle() {
|
|
18239
|
-
var channel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
18240
|
-
return CHANNEL_STYLES[channel] || {
|
|
18241
|
-
id: channel.slice(0, 1).toUpperCase() || "?",
|
|
18242
|
-
avatarBg: "#F3F4F6",
|
|
18243
|
-
color: "#6366F1"
|
|
18244
|
-
};
|
|
18245
|
-
};
|
|
18246
|
-
var mapChannelTrend = function mapChannelTrend(trend) {
|
|
18247
|
-
var normalized = (trend || "stable").toLowerCase();
|
|
18248
|
-
if (normalized === "down" || normalized === "declining") {
|
|
18249
|
-
return {
|
|
18250
|
-
type: "trend",
|
|
18251
|
-
trendType: "down",
|
|
18252
|
-
trendLabel: "Declining"
|
|
18253
|
-
};
|
|
18254
|
-
}
|
|
18255
|
-
if (normalized === "up" || normalized === "improving") {
|
|
18256
|
-
return {
|
|
18257
|
-
type: "trend",
|
|
18258
|
-
trendType: "up",
|
|
18259
|
-
trendLabel: "Improving"
|
|
18260
|
-
};
|
|
18261
|
-
}
|
|
18262
|
-
return {
|
|
18263
|
-
type: "status",
|
|
18264
|
-
status: "Stable",
|
|
18265
|
-
statusBg: "#F3F4F6",
|
|
18266
|
-
statusColor: "#6B7280"
|
|
18267
|
-
};
|
|
18268
|
-
};
|
|
18269
|
-
var getRoasColor = function getRoasColor(roas) {
|
|
18270
|
-
return Number(roas !== null && roas !== void 0 ? roas : 0) >= 2.5 ? "#22C55E" : "#EF4444";
|
|
18271
|
-
};
|
|
18272
|
-
var getCampaignInitials$1 = function getCampaignInitials() {
|
|
18273
|
-
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
18274
|
-
var words = name.trim().split(/\s+/).filter(Boolean);
|
|
18275
|
-
if (words.length >= 2) {
|
|
18276
|
-
return (words[0][0] + words[1][0]).toUpperCase();
|
|
18277
|
-
}
|
|
18278
|
-
return name.slice(0, 2).toUpperCase() || "—";
|
|
18279
|
-
};
|
|
18280
|
-
var buildEmptySpendAllocation = function buildEmptySpendAllocation() {
|
|
18281
|
-
var channels = Object.keys(CHANNEL_STYLES);
|
|
18282
|
-
return {
|
|
18283
|
-
series: channels.map(function () {
|
|
18284
|
-
return 0;
|
|
18285
|
-
}),
|
|
18286
|
-
labels: channels,
|
|
18287
|
-
colors: channels.map(function (channel) {
|
|
18288
|
-
return CHANNEL_STYLES[channel].color;
|
|
18289
|
-
}),
|
|
18290
|
-
centerLabel: "total spend",
|
|
18291
|
-
centerValue: "$".concat(formatNumber(0)),
|
|
18292
|
-
subtitle: "Where $".concat(formatNumber(0), " went"),
|
|
18293
|
-
items: channels.map(function (channel) {
|
|
18294
|
-
return {
|
|
18295
|
-
label: channel,
|
|
18296
|
-
val: "0.0%",
|
|
18297
|
-
color: CHANNEL_STYLES[channel].color
|
|
18298
|
-
};
|
|
18299
|
-
})
|
|
18300
|
-
};
|
|
18301
|
-
};
|
|
18302
|
-
var PaidSection = function PaidSection(_ref) {
|
|
18303
|
-
var _ref2, _rawOverview$totalSpe, _ref3, _rawOverview$totalRev, _ref4, _rawOverview$roas, _ref5, _rawOverview$costPerD, _rawOverview$conversi, _ref6, _rawOverview$averageD, _ref7, _rawOverview$totalDon, _ref8, _rawOverview$growthPe, _rawOverview$growthPe2, _ref9, _rawOverview$growthPe3, _rawOverview$growthPe4, _ref0, _rawOverview$growthPe5, _rawOverview$growthPe6, _rawOverview$growthPe7, _rawOverview$growthPe8, _rawOverview$growthPe9, _rawOverview$growthPe0, _rawOverview$growthPe1, _rawOverview$growthPe10, _apiData$spendVsReven, _apiData$spendVsReven2, _selectedInfo$categor, _spendAllocation$subt, _spendAllocation$seri, _spendAllocation$labe, _spendAllocation$colo, _spendAllocation$cent, _spendAllocation$cent2, _spendAllocation$item;
|
|
18304
|
-
var _ref$apiData = _ref.apiData,
|
|
18305
|
-
apiData = _ref$apiData === void 0 ? {} : _ref$apiData;
|
|
18306
|
-
_ref.dateName;
|
|
18307
|
-
var _ref$apiLoading = _ref.apiLoading,
|
|
18308
|
-
apiLoading = _ref$apiLoading === void 0 ? false : _ref$apiLoading,
|
|
18309
|
-
_ref$numberOfDays = _ref.numberOfDays,
|
|
18310
|
-
numberOfDays = _ref$numberOfDays === void 0 ? 30 : _ref$numberOfDays;
|
|
18443
|
+
var PaidSection = function PaidSection() {
|
|
18311
18444
|
var _useState = useState("Total Spent"),
|
|
18312
18445
|
_useState2 = _slicedToArray(_useState, 2),
|
|
18313
18446
|
activeMetric = _useState2[0],
|
|
18314
18447
|
setActiveMetric = _useState2[1];
|
|
18315
|
-
var
|
|
18316
|
-
var
|
|
18317
|
-
|
|
18318
|
-
|
|
18319
|
-
|
|
18320
|
-
|
|
18321
|
-
|
|
18322
|
-
|
|
18323
|
-
|
|
18324
|
-
|
|
18325
|
-
|
|
18326
|
-
|
|
18327
|
-
|
|
18328
|
-
|
|
18329
|
-
|
|
18330
|
-
|
|
18331
|
-
|
|
18332
|
-
|
|
18333
|
-
|
|
18334
|
-
|
|
18335
|
-
|
|
18336
|
-
|
|
18337
|
-
|
|
18338
|
-
|
|
18339
|
-
|
|
18448
|
+
var categories = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
18449
|
+
var metricInfo = {
|
|
18450
|
+
"Total Spent": {
|
|
18451
|
+
value: "$80,313",
|
|
18452
|
+
subValue: "12% vs last month",
|
|
18453
|
+
chartLabel: "Daily Spend",
|
|
18454
|
+
data: [800, 950, 700, 1100, 900, 1200, 1300],
|
|
18455
|
+
icon: IndeterminateCheckBoxOutlined
|
|
18456
|
+
},
|
|
18457
|
+
"Revinue Raised": {
|
|
18458
|
+
value: "$240,398",
|
|
18459
|
+
subValue: "12% vs last month",
|
|
18460
|
+
chartLabel: "Daily Revenue",
|
|
18461
|
+
data: [3200, 4100, 2800, 5600, 4200, 6100, 7500],
|
|
18462
|
+
icon: PaidOutlined
|
|
18463
|
+
},
|
|
18464
|
+
ROAS: {
|
|
18465
|
+
value: "3.0",
|
|
18466
|
+
subValue: "12% vs last month",
|
|
18467
|
+
chartLabel: "ROAS Trend",
|
|
18468
|
+
data: [2.5, 3.1, 2.8, 4.2, 3.8, 4.5, 5.2],
|
|
18469
|
+
icon: TrendingUp
|
|
18470
|
+
},
|
|
18471
|
+
"Cost per donor": {
|
|
18472
|
+
value: "$373",
|
|
18473
|
+
subValue: "12% vs last month",
|
|
18474
|
+
chartLabel: "CPA Trend",
|
|
18475
|
+
data: [350, 380, 360, 410, 390, 370, 373],
|
|
18476
|
+
icon: PersonOutlined
|
|
18477
|
+
},
|
|
18478
|
+
"Conversion rate": {
|
|
18479
|
+
value: "3.1%",
|
|
18480
|
+
subValue: "12% vs last month",
|
|
18481
|
+
chartLabel: "Conversion Rate",
|
|
18482
|
+
data: [2.8, 3.0, 2.9, 3.4, 3.2, 3.1, 3.1],
|
|
18483
|
+
icon: Adjust
|
|
18484
|
+
},
|
|
18485
|
+
"Avg donation": {
|
|
18486
|
+
value: "$130.58",
|
|
18487
|
+
subValue: "12% vs last month",
|
|
18488
|
+
chartLabel: "Average Donation",
|
|
18489
|
+
data: [120, 135, 125, 140, 130, 128, 130.58],
|
|
18490
|
+
icon: PaidOutlined
|
|
18340
18491
|
}
|
|
18341
|
-
var length = Math.min(spendSeries.data.length, revenueSeries.data.length);
|
|
18342
|
-
return Array.from({
|
|
18343
|
-
length: length
|
|
18344
|
-
}, function (_, index) {
|
|
18345
|
-
var _spendSeries$data$ind, _revenueSeries$data$i;
|
|
18346
|
-
var spend = (_spendSeries$data$ind = spendSeries.data[index]) !== null && _spendSeries$data$ind !== void 0 ? _spendSeries$data$ind : 0;
|
|
18347
|
-
var revenue = (_revenueSeries$data$i = revenueSeries.data[index]) !== null && _revenueSeries$data$i !== void 0 ? _revenueSeries$data$i : 0;
|
|
18348
|
-
return spend > 0 ? revenue / spend : 0;
|
|
18349
|
-
});
|
|
18350
|
-
}, [spendSeries.data, revenueSeries.data]);
|
|
18351
|
-
var fallbackCategories = spendSeries.categories.length ? spendSeries.categories : revenueSeries.categories.length ? revenueSeries.categories : ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
18352
|
-
var flatSeries = function flatSeries(value) {
|
|
18353
|
-
return fallbackCategories.length > 0 ? fallbackCategories.map(function () {
|
|
18354
|
-
return Number(value !== null && value !== void 0 ? value : 0);
|
|
18355
|
-
}) : [Number(value !== null && value !== void 0 ? value : 0)];
|
|
18356
18492
|
};
|
|
18357
|
-
var metricInfo = useMemo(function () {
|
|
18358
|
-
if (!hasPaidOverview) {
|
|
18359
|
-
return {
|
|
18360
|
-
"Total Spent": {
|
|
18361
|
-
value: "$".concat(formatKpi$2(0)),
|
|
18362
|
-
subValue: formatGrowth$2(0),
|
|
18363
|
-
data: flatSeries(0),
|
|
18364
|
-
categories: fallbackCategories,
|
|
18365
|
-
icon: /*#__PURE__*/jsx(IndeterminateCheckBoxOutlined, {}),
|
|
18366
|
-
money: true,
|
|
18367
|
-
error: false,
|
|
18368
|
-
warning: false
|
|
18369
|
-
},
|
|
18370
|
-
"Revenue Raised": {
|
|
18371
|
-
value: "$".concat(formatKpi$2(0)),
|
|
18372
|
-
subValue: formatGrowth$2(0),
|
|
18373
|
-
data: flatSeries(0),
|
|
18374
|
-
categories: fallbackCategories,
|
|
18375
|
-
icon: /*#__PURE__*/jsx(PaidOutlined, {}),
|
|
18376
|
-
money: true,
|
|
18377
|
-
error: false,
|
|
18378
|
-
warning: false
|
|
18379
|
-
},
|
|
18380
|
-
ROAS: {
|
|
18381
|
-
value: "".concat(formatKpi$2(0), "x"),
|
|
18382
|
-
subValue: formatGrowth$2(0),
|
|
18383
|
-
data: flatSeries(0),
|
|
18384
|
-
categories: fallbackCategories,
|
|
18385
|
-
icon: /*#__PURE__*/jsx(TrendingUp, {}),
|
|
18386
|
-
money: false,
|
|
18387
|
-
error: false,
|
|
18388
|
-
warning: false
|
|
18389
|
-
},
|
|
18390
|
-
"Cost Per Donor": {
|
|
18391
|
-
value: "$".concat(formatKpi$2(0)),
|
|
18392
|
-
subValue: formatGrowth$2(0),
|
|
18393
|
-
data: flatSeries(0),
|
|
18394
|
-
categories: fallbackCategories,
|
|
18395
|
-
icon: /*#__PURE__*/jsx(PersonOutlined, {}),
|
|
18396
|
-
money: true,
|
|
18397
|
-
error: false,
|
|
18398
|
-
warning: false
|
|
18399
|
-
},
|
|
18400
|
-
"Conversion Rate": {
|
|
18401
|
-
value: "".concat(formatKpi$2(0), "%"),
|
|
18402
|
-
subValue: formatGrowth$2(0),
|
|
18403
|
-
data: flatSeries(0),
|
|
18404
|
-
categories: fallbackCategories,
|
|
18405
|
-
icon: /*#__PURE__*/jsx(ConversionRateIcon, {}),
|
|
18406
|
-
money: false,
|
|
18407
|
-
error: false,
|
|
18408
|
-
warning: false
|
|
18409
|
-
},
|
|
18410
|
-
"Avg Donation": {
|
|
18411
|
-
value: "$".concat(formatKpi$2(0)),
|
|
18412
|
-
subValue: formatGrowth$2(0),
|
|
18413
|
-
data: flatSeries(0),
|
|
18414
|
-
categories: fallbackCategories,
|
|
18415
|
-
icon: /*#__PURE__*/jsx(AverageDonationIcon, {}),
|
|
18416
|
-
money: true,
|
|
18417
|
-
error: false,
|
|
18418
|
-
warning: false
|
|
18419
|
-
}
|
|
18420
|
-
};
|
|
18421
|
-
}
|
|
18422
|
-
var chartCategories = spendSeries.categories.length > 0 ? spendSeries.categories : revenueSeries.categories.length > 0 ? revenueSeries.categories : fallbackCategories;
|
|
18423
|
-
return {
|
|
18424
|
-
"Total Spent": {
|
|
18425
|
-
value: "$".concat(formatKpi$2(overview.totalSpent)),
|
|
18426
|
-
subValue: formatGrowth$2(growth.totalSpent),
|
|
18427
|
-
data: spendSeries.data.length > 0 ? spendSeries.data : flatSeries(0),
|
|
18428
|
-
categories: chartCategories,
|
|
18429
|
-
icon: /*#__PURE__*/jsx(IndeterminateCheckBoxOutlined, {}),
|
|
18430
|
-
money: true,
|
|
18431
|
-
error: false,
|
|
18432
|
-
warning: false
|
|
18433
|
-
},
|
|
18434
|
-
"Revenue Raised": {
|
|
18435
|
-
value: "$".concat(formatKpi$2(overview.totalRevenue)),
|
|
18436
|
-
subValue: formatGrowth$2(growth.totalRevenue),
|
|
18437
|
-
data: revenueSeries.data.length > 0 ? revenueSeries.data : flatSeries(0),
|
|
18438
|
-
categories: chartCategories,
|
|
18439
|
-
icon: /*#__PURE__*/jsx(PaidOutlined, {}),
|
|
18440
|
-
money: true,
|
|
18441
|
-
error: false,
|
|
18442
|
-
warning: false
|
|
18443
|
-
},
|
|
18444
|
-
ROAS: {
|
|
18445
|
-
value: "".concat(formatKpi$2(overview.roas), "x"),
|
|
18446
|
-
subValue: formatGrowth$2(growth.roas),
|
|
18447
|
-
data: roasChartData.length > 0 ? roasChartData : flatSeries(0),
|
|
18448
|
-
categories: chartCategories,
|
|
18449
|
-
icon: /*#__PURE__*/jsx(TrendingUp, {}),
|
|
18450
|
-
money: false,
|
|
18451
|
-
error: false,
|
|
18452
|
-
warning: false
|
|
18453
|
-
},
|
|
18454
|
-
"Cost Per Donor": {
|
|
18455
|
-
value: "$".concat(formatKpi$2(overview.costPerDonor)),
|
|
18456
|
-
subValue: formatGrowth$2(growth.costPerDonor),
|
|
18457
|
-
data: flatSeries(overview.costPerDonor),
|
|
18458
|
-
categories: chartCategories,
|
|
18459
|
-
icon: /*#__PURE__*/jsx(PersonOutlined, {}),
|
|
18460
|
-
money: true,
|
|
18461
|
-
error: false,
|
|
18462
|
-
warning: false
|
|
18463
|
-
},
|
|
18464
|
-
"Conversion Rate": {
|
|
18465
|
-
value: "".concat(formatKpi$2(overview.conversionRate), "%"),
|
|
18466
|
-
subValue: formatGrowth$2(growth.conversionRate),
|
|
18467
|
-
data: flatSeries(overview.conversionRate),
|
|
18468
|
-
categories: chartCategories,
|
|
18469
|
-
icon: /*#__PURE__*/jsx(ConversionRateIcon, {}),
|
|
18470
|
-
money: false,
|
|
18471
|
-
error: false,
|
|
18472
|
-
warning: false
|
|
18473
|
-
},
|
|
18474
|
-
"Avg Donation": {
|
|
18475
|
-
value: "$".concat(formatKpi$2(overview.averageDonation)),
|
|
18476
|
-
subValue: formatGrowth$2(growth.averageDonation),
|
|
18477
|
-
data: flatSeries(overview.averageDonation),
|
|
18478
|
-
categories: chartCategories,
|
|
18479
|
-
icon: /*#__PURE__*/jsx(AverageDonationIcon, {}),
|
|
18480
|
-
money: true,
|
|
18481
|
-
error: false,
|
|
18482
|
-
warning: false
|
|
18483
|
-
}
|
|
18484
|
-
};
|
|
18485
|
-
}, [fallbackCategories, growth, hasPaidOverview, overview, revenueSeries, roasChartData, spendSeries]);
|
|
18486
|
-
var channelRows = useMemo(function () {
|
|
18487
|
-
var channels = apiData === null || apiData === void 0 ? void 0 : apiData.channelPerformance;
|
|
18488
|
-
if (!hasPaidOverview) return [];
|
|
18489
|
-
if (!Array.isArray(channels) || channels.length === 0) return [];
|
|
18490
|
-
return channels.map(function (item) {
|
|
18491
|
-
var _item$roas, _item$spend, _item$revenue, _item$cpa;
|
|
18492
|
-
var style = getChannelStyle(item.channel);
|
|
18493
|
-
var roas = Number((_item$roas = item.roas) !== null && _item$roas !== void 0 ? _item$roas : 0);
|
|
18494
|
-
return _objectSpread2({
|
|
18495
|
-
id: style.id,
|
|
18496
|
-
avatarBg: style.avatarBg,
|
|
18497
|
-
name: item.channel,
|
|
18498
|
-
val1: "$".concat(formatNumber((_item$spend = item.spend) !== null && _item$spend !== void 0 ? _item$spend : 0)),
|
|
18499
|
-
val2: "$".concat(formatNumber((_item$revenue = item.revenue) !== null && _item$revenue !== void 0 ? _item$revenue : 0)),
|
|
18500
|
-
val3: "".concat(roas.toFixed(1), "x"),
|
|
18501
|
-
val4: "$".concat(formatNumber((_item$cpa = item.cpa) !== null && _item$cpa !== void 0 ? _item$cpa : 0)),
|
|
18502
|
-
highlightVal3: true,
|
|
18503
|
-
val3Color: getRoasColor(roas)
|
|
18504
|
-
}, mapChannelTrend(item.trend));
|
|
18505
|
-
});
|
|
18506
|
-
}, [apiData === null || apiData === void 0 ? void 0 : apiData.channelPerformance, hasPaidOverview]);
|
|
18507
|
-
var spendAllocation = useMemo(function () {
|
|
18508
|
-
var _allocation$totalSpen, _allocation$totalSpen2;
|
|
18509
|
-
var allocation = apiData === null || apiData === void 0 ? void 0 : apiData.spendAllocation;
|
|
18510
|
-
if (!hasPaidOverview) return [];
|
|
18511
|
-
if (!allocation || !Array.isArray(allocation.data) || allocation.data.length === 0) {
|
|
18512
|
-
return buildEmptySpendAllocation();
|
|
18513
|
-
}
|
|
18514
|
-
var items = allocation.data.map(function (item) {
|
|
18515
|
-
var _item$percentage, _item$spend2, _item$percentage2;
|
|
18516
|
-
var style = getChannelStyle(item.channel);
|
|
18517
|
-
return {
|
|
18518
|
-
label: item.channel,
|
|
18519
|
-
val: "".concat(Number((_item$percentage = item.percentage) !== null && _item$percentage !== void 0 ? _item$percentage : 0).toFixed(1), "%"),
|
|
18520
|
-
color: style.color,
|
|
18521
|
-
spend: (_item$spend2 = item.spend) !== null && _item$spend2 !== void 0 ? _item$spend2 : 0,
|
|
18522
|
-
percentage: (_item$percentage2 = item.percentage) !== null && _item$percentage2 !== void 0 ? _item$percentage2 : 0
|
|
18523
|
-
};
|
|
18524
|
-
});
|
|
18525
|
-
return {
|
|
18526
|
-
series: items.map(function (item) {
|
|
18527
|
-
return item.percentage;
|
|
18528
|
-
}),
|
|
18529
|
-
labels: items.map(function (item) {
|
|
18530
|
-
return item.label;
|
|
18531
|
-
}),
|
|
18532
|
-
colors: items.map(function (item) {
|
|
18533
|
-
return item.color;
|
|
18534
|
-
}),
|
|
18535
|
-
centerLabel: "total spend",
|
|
18536
|
-
centerValue: "$".concat(formatNumber((_allocation$totalSpen = allocation.totalSpend) !== null && _allocation$totalSpen !== void 0 ? _allocation$totalSpen : 0)),
|
|
18537
|
-
subtitle: "Where $".concat(formatNumber((_allocation$totalSpen2 = allocation.totalSpend) !== null && _allocation$totalSpen2 !== void 0 ? _allocation$totalSpen2 : 0), " went"),
|
|
18538
|
-
items: items.map(function (_ref1) {
|
|
18539
|
-
var label = _ref1.label,
|
|
18540
|
-
val = _ref1.val,
|
|
18541
|
-
color = _ref1.color;
|
|
18542
|
-
return {
|
|
18543
|
-
label: label,
|
|
18544
|
-
val: val,
|
|
18545
|
-
color: color
|
|
18546
|
-
};
|
|
18547
|
-
})
|
|
18548
|
-
};
|
|
18549
|
-
}, [apiData === null || apiData === void 0 ? void 0 : apiData.spendAllocation, hasPaidOverview]);
|
|
18550
|
-
var topCampaignsData = useMemo(function () {
|
|
18551
|
-
var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaigns;
|
|
18552
|
-
if (!hasPaidOverview) return [];
|
|
18553
|
-
if (!Array.isArray(campaigns)) return [];
|
|
18554
|
-
if (campaigns.length === 0) return [];
|
|
18555
|
-
return campaigns.map(function (item) {
|
|
18556
|
-
var _item$spend3, _item$revenue2, _item$roas2;
|
|
18557
|
-
var name = item.campaignName || item.campaign || item.name || "Unknown";
|
|
18558
|
-
return {
|
|
18559
|
-
id: getCampaignInitials$1(name),
|
|
18560
|
-
name: name,
|
|
18561
|
-
spend: "$".concat(formatNumber((_item$spend3 = item.spend) !== null && _item$spend3 !== void 0 ? _item$spend3 : 0)),
|
|
18562
|
-
revenue: "$".concat(formatNumber((_item$revenue2 = item.revenue) !== null && _item$revenue2 !== void 0 ? _item$revenue2 : 0)),
|
|
18563
|
-
roas: "".concat(Number((_item$roas2 = item.roas) !== null && _item$roas2 !== void 0 ? _item$roas2 : 0).toFixed(1), "x")
|
|
18564
|
-
};
|
|
18565
|
-
});
|
|
18566
|
-
}, [apiData === null || apiData === void 0 ? void 0 : apiData.topCampaigns, hasPaidOverview]);
|
|
18567
|
-
var donorGeographyData = useMemo(function () {
|
|
18568
|
-
var geography = apiData === null || apiData === void 0 ? void 0 : apiData.donorGeography;
|
|
18569
|
-
if (!hasPaidOverview) return [];
|
|
18570
|
-
var rawCountries = Array.isArray(geography) ? geography : (geography === null || geography === void 0 ? void 0 : geography.countries) || (geography === null || geography === void 0 ? void 0 : geography.data) || [];
|
|
18571
|
-
return Array.isArray(rawCountries) ? rawCountries : [];
|
|
18572
|
-
}, [apiData === null || apiData === void 0 ? void 0 : apiData.donorGeography, hasPaidOverview]);
|
|
18573
18493
|
var renderCard = function renderCard(title) {
|
|
18574
|
-
return /*#__PURE__*/jsx(
|
|
18494
|
+
return /*#__PURE__*/jsx(DisplayCard, {
|
|
18575
18495
|
title: title,
|
|
18576
18496
|
value: metricInfo[title].value,
|
|
18577
|
-
|
|
18497
|
+
subValue: metricInfo[title].subValue,
|
|
18578
18498
|
icon: metricInfo[title].icon,
|
|
18579
|
-
error: metricInfo[title].error,
|
|
18580
|
-
active: activeMetric === title,
|
|
18581
18499
|
onClick: function onClick() {
|
|
18582
18500
|
return setActiveMetric(title);
|
|
18583
18501
|
},
|
|
18584
|
-
|
|
18585
|
-
|
|
18586
|
-
|
|
18587
|
-
cursor: "pointer"
|
|
18588
|
-
} : {
|
|
18589
|
-
cursor: "pointer"
|
|
18502
|
+
isActive: activeMetric === title,
|
|
18503
|
+
sx: {
|
|
18504
|
+
flex: 1
|
|
18590
18505
|
}
|
|
18591
|
-
});
|
|
18506
|
+
}, title);
|
|
18592
18507
|
};
|
|
18593
|
-
var selectedInfo = metricInfo[activeMetric]
|
|
18594
|
-
var emptySpendAllocation = buildEmptySpendAllocation();
|
|
18595
|
-
var chartCategories = ((_selectedInfo$categor = selectedInfo.categories) === null || _selectedInfo$categor === void 0 ? void 0 : _selectedInfo$categor.length) > 0 ? selectedInfo.categories : fallbackCategories;
|
|
18508
|
+
var selectedInfo = metricInfo[activeMetric];
|
|
18596
18509
|
var mainChart = {
|
|
18597
18510
|
label: activeMetric,
|
|
18598
18511
|
value: selectedInfo.value,
|
|
18599
18512
|
trend: selectedInfo.subValue,
|
|
18600
18513
|
data: selectedInfo.data,
|
|
18601
|
-
categories:
|
|
18602
|
-
hideControls: true,
|
|
18603
|
-
isAmount: selectedInfo.money
|
|
18514
|
+
categories: categories
|
|
18604
18515
|
};
|
|
18605
|
-
if (apiLoading) {
|
|
18606
|
-
return /*#__PURE__*/jsx(PaidSectionSkeleton, {});
|
|
18607
|
-
}
|
|
18608
18516
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
18609
18517
|
children: [/*#__PURE__*/jsx(Box, {
|
|
18610
18518
|
sx: {
|
|
18611
|
-
display: "
|
|
18612
|
-
|
|
18613
|
-
|
|
18614
|
-
|
|
18615
|
-
md: "1fr 1fr 1fr",
|
|
18616
|
-
lg: "repeat(6, 1fr)"
|
|
18617
|
-
},
|
|
18618
|
-
gap: "6px",
|
|
18619
|
-
mb: 0
|
|
18519
|
+
display: "flex",
|
|
18520
|
+
gap: 2,
|
|
18521
|
+
mb: 1,
|
|
18522
|
+
flexWrap: "wrap"
|
|
18620
18523
|
},
|
|
18621
18524
|
children: Object.keys(metricInfo).map(renderCard)
|
|
18622
18525
|
}), /*#__PURE__*/jsx(Grid, {
|
|
18623
18526
|
container: true,
|
|
18624
18527
|
spacing: 3,
|
|
18625
18528
|
sx: {
|
|
18626
|
-
mt:
|
|
18529
|
+
mt: 1
|
|
18627
18530
|
},
|
|
18628
18531
|
children: /*#__PURE__*/jsx(RenderChartCard, {
|
|
18629
18532
|
item: mainChart,
|
|
@@ -18631,61 +18534,125 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18631
18534
|
md: 12,
|
|
18632
18535
|
type: "area",
|
|
18633
18536
|
isPrimary: true,
|
|
18634
|
-
isPremium: true
|
|
18635
|
-
numberOfDays: numberOfDays,
|
|
18636
|
-
metric: activeMetric === "Conversion Rate" ? "Percent" : activeMetric === "ROAS" ? "ROAS" : selectedInfo.money ? "Revenue" : "Donors"
|
|
18537
|
+
isPremium: true
|
|
18637
18538
|
})
|
|
18638
18539
|
}), /*#__PURE__*/jsxs(Grid, {
|
|
18639
18540
|
container: true,
|
|
18640
18541
|
spacing: 3,
|
|
18641
18542
|
sx: {
|
|
18642
|
-
mt:
|
|
18543
|
+
mt: 3
|
|
18643
18544
|
},
|
|
18644
18545
|
children: [/*#__PURE__*/jsx(Grid, {
|
|
18645
18546
|
item: true,
|
|
18646
18547
|
xs: 12,
|
|
18647
18548
|
md: 6,
|
|
18648
|
-
sx: {
|
|
18649
|
-
paddingTop: "0px !important",
|
|
18650
|
-
minHeight: "430px"
|
|
18651
|
-
},
|
|
18652
18549
|
children: /*#__PURE__*/jsx(ActiveCampaignsCard, {
|
|
18653
|
-
title: "Channel
|
|
18550
|
+
title: "Channel performance",
|
|
18654
18551
|
subtitle: "Ad platforms ranked by ROAS",
|
|
18655
|
-
columns: ["
|
|
18552
|
+
columns: ["channel", "spend", "revenue", "ROAS", "CPA", "trend"],
|
|
18656
18553
|
gridTemplateColumns: "2.2fr 1fr 1fr 0.8fr 0.8fr 1.2fr",
|
|
18657
|
-
|
|
18658
|
-
|
|
18554
|
+
rows: [{
|
|
18555
|
+
id: "M",
|
|
18556
|
+
avatarBg: "#4267B2",
|
|
18557
|
+
avatarColor: "#fff",
|
|
18558
|
+
name: "Meta Ads",
|
|
18559
|
+
val1: "$32,800",
|
|
18560
|
+
val2: "$112,400",
|
|
18561
|
+
val3: "3.4x",
|
|
18562
|
+
val4: "$340",
|
|
18563
|
+
type: "trend",
|
|
18564
|
+
trendType: "up",
|
|
18565
|
+
trendLabel: "Improving",
|
|
18566
|
+
highlightVal3: true,
|
|
18567
|
+
val3Color: "#22C55E",
|
|
18568
|
+
comingSoon: false
|
|
18569
|
+
}, {
|
|
18570
|
+
id: "G",
|
|
18571
|
+
avatarBg: "#C4C4C4",
|
|
18572
|
+
avatarColor: "#fff",
|
|
18573
|
+
name: "Google Ads",
|
|
18574
|
+
val1: "—",
|
|
18575
|
+
val2: "—",
|
|
18576
|
+
val3: "—",
|
|
18577
|
+
val4: "—",
|
|
18578
|
+
type: "comingSoon",
|
|
18579
|
+
comingSoon: true
|
|
18580
|
+
}, {
|
|
18581
|
+
id: "T",
|
|
18582
|
+
avatarBg: "#C4C4C4",
|
|
18583
|
+
avatarColor: "#fff",
|
|
18584
|
+
name: "TikTok Ads",
|
|
18585
|
+
val1: "—",
|
|
18586
|
+
val2: "—",
|
|
18587
|
+
val3: "—",
|
|
18588
|
+
val4: "—",
|
|
18589
|
+
type: "comingSoon",
|
|
18590
|
+
comingSoon: true
|
|
18591
|
+
}, {
|
|
18592
|
+
id: "Y",
|
|
18593
|
+
avatarBg: "#C4C4C4",
|
|
18594
|
+
avatarColor: "#fff",
|
|
18595
|
+
name: "YouTube",
|
|
18596
|
+
val1: "—",
|
|
18597
|
+
val2: "—",
|
|
18598
|
+
val3: "—",
|
|
18599
|
+
val4: "—",
|
|
18600
|
+
type: "comingSoon",
|
|
18601
|
+
comingSoon: true
|
|
18602
|
+
}, {
|
|
18603
|
+
id: "S",
|
|
18604
|
+
avatarBg: "#C4C4C4",
|
|
18605
|
+
avatarColor: "#fff",
|
|
18606
|
+
name: "Snapchat",
|
|
18607
|
+
val1: "—",
|
|
18608
|
+
val2: "—",
|
|
18609
|
+
val3: "—",
|
|
18610
|
+
val4: "—",
|
|
18611
|
+
type: "comingSoon",
|
|
18612
|
+
comingSoon: true
|
|
18613
|
+
}]
|
|
18659
18614
|
})
|
|
18660
18615
|
}), /*#__PURE__*/jsx(Grid, {
|
|
18661
18616
|
item: true,
|
|
18662
18617
|
xs: 12,
|
|
18663
18618
|
md: 6,
|
|
18664
|
-
sx: {
|
|
18665
|
-
paddingTop: "0px !important",
|
|
18666
|
-
minHeight: "430px",
|
|
18667
|
-
paddingLeft: {
|
|
18668
|
-
xs: "24px !important",
|
|
18669
|
-
md: "6px !important"
|
|
18670
|
-
},
|
|
18671
|
-
marginTop: {
|
|
18672
|
-
xs: "6px",
|
|
18673
|
-
md: "0px"
|
|
18674
|
-
}
|
|
18675
|
-
},
|
|
18676
18619
|
children: /*#__PURE__*/jsx(DonorMixCard, {
|
|
18677
|
-
title: "Spend
|
|
18678
|
-
subtitle:
|
|
18679
|
-
series:
|
|
18680
|
-
labels:
|
|
18681
|
-
colors:
|
|
18682
|
-
centerLabel:
|
|
18683
|
-
centerValue:
|
|
18684
|
-
items:
|
|
18620
|
+
title: "Spend allocation",
|
|
18621
|
+
subtitle: "Where $80.3K went this month",
|
|
18622
|
+
series: [100],
|
|
18623
|
+
labels: ["Meta Ads"],
|
|
18624
|
+
colors: ["#4267B2"],
|
|
18625
|
+
centerLabel: "total spend",
|
|
18626
|
+
centerValue: "$80.3K",
|
|
18627
|
+
items: [{
|
|
18628
|
+
label: "Meta Ads",
|
|
18629
|
+
val: "100%",
|
|
18630
|
+
color: "#4267B2",
|
|
18631
|
+
comingSoon: false
|
|
18632
|
+
}, {
|
|
18633
|
+
label: "Google Ads",
|
|
18634
|
+
val: "Coming Soon",
|
|
18635
|
+
color: "#C4C4C4",
|
|
18636
|
+
comingSoon: true
|
|
18637
|
+
}, {
|
|
18638
|
+
label: "TikTok",
|
|
18639
|
+
val: "Coming Soon",
|
|
18640
|
+
color: "#C4C4C4",
|
|
18641
|
+
comingSoon: true
|
|
18642
|
+
}, {
|
|
18643
|
+
label: "YouTube",
|
|
18644
|
+
val: "Coming Soon",
|
|
18645
|
+
color: "#C4C4C4",
|
|
18646
|
+
comingSoon: true
|
|
18647
|
+
}, {
|
|
18648
|
+
label: "Snapchat",
|
|
18649
|
+
val: "Coming Soon",
|
|
18650
|
+
color: "#C4C4C4",
|
|
18651
|
+
comingSoon: true
|
|
18652
|
+
}],
|
|
18685
18653
|
showBottomSummary: false,
|
|
18686
18654
|
sx: {
|
|
18687
|
-
pb: 3.5
|
|
18688
|
-
height: "100%"
|
|
18655
|
+
pb: 3.5
|
|
18689
18656
|
}
|
|
18690
18657
|
})
|
|
18691
18658
|
})]
|
|
@@ -18693,44 +18660,18 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18693
18660
|
container: true,
|
|
18694
18661
|
spacing: 3,
|
|
18695
18662
|
sx: {
|
|
18696
|
-
mt:
|
|
18697
|
-
alignItems: "stretch"
|
|
18663
|
+
mt: 3
|
|
18698
18664
|
},
|
|
18699
18665
|
children: [/*#__PURE__*/jsx(Grid, {
|
|
18700
18666
|
item: true,
|
|
18701
18667
|
xs: 12,
|
|
18702
18668
|
md: 6,
|
|
18703
|
-
|
|
18704
|
-
paddingTop: "0px !important",
|
|
18705
|
-
display: "flex"
|
|
18706
|
-
},
|
|
18707
|
-
children: /*#__PURE__*/jsx(Box, {
|
|
18708
|
-
sx: {
|
|
18709
|
-
width: "100%"
|
|
18710
|
-
},
|
|
18711
|
-
children: /*#__PURE__*/jsx(TopPerformingCampaignsCard, {
|
|
18712
|
-
data: topCampaignsData !== null && topCampaignsData !== void 0 ? topCampaignsData : []
|
|
18713
|
-
})
|
|
18714
|
-
})
|
|
18669
|
+
children: /*#__PURE__*/jsx(TopPerformingCampaignsCard, {})
|
|
18715
18670
|
}), /*#__PURE__*/jsx(Grid, {
|
|
18716
18671
|
item: true,
|
|
18717
18672
|
xs: 12,
|
|
18718
18673
|
md: 6,
|
|
18719
|
-
|
|
18720
|
-
paddingTop: "0px !important",
|
|
18721
|
-
paddingLeft: {
|
|
18722
|
-
xs: "24px !important",
|
|
18723
|
-
md: "6px !important"
|
|
18724
|
-
},
|
|
18725
|
-
marginTop: {
|
|
18726
|
-
xs: "6px",
|
|
18727
|
-
md: "0px"
|
|
18728
|
-
},
|
|
18729
|
-
display: "flex"
|
|
18730
|
-
},
|
|
18731
|
-
children: /*#__PURE__*/jsx(PaidDonorGeographyCard, {
|
|
18732
|
-
donorGeographyData: donorGeographyData
|
|
18733
|
-
})
|
|
18674
|
+
children: /*#__PURE__*/jsx(PaidDonorGeographyCard, {})
|
|
18734
18675
|
})]
|
|
18735
18676
|
})]
|
|
18736
18677
|
});
|