@ammarkhalidfarooq/dashboard-package 0.6.128 → 0.6.129

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.cjs.js CHANGED
@@ -9,6 +9,7 @@ var Grid = require('@mui/material/Grid');
9
9
  var Box = require('@mui/material/Box');
10
10
  var Typography = require('@mui/material/Typography');
11
11
  var ReactApexChart = require('react-apexcharts');
12
+ var si = require('react-icons/si');
12
13
 
13
14
  var theme = styles.createTheme({
14
15
  cssVariables: true,
@@ -1021,482 +1022,281 @@ var ActiveCampaignsCard = function ActiveCampaignsCard(_ref) {
1021
1022
  title = _ref$title === void 0 ? "Active campaigns" : _ref$title,
1022
1023
  _ref$subtitle = _ref.subtitle,
1023
1024
  subtitle = _ref$subtitle === void 0 ? "Live fundraisers ranked by velocity" : _ref$subtitle,
1025
+ actionLabel = _ref.actionLabel,
1024
1026
  _ref$columns = _ref.columns,
1025
- columns = _ref$columns === void 0 ? ["Campaign", "Raised", "Progress", "Donors", "Avg gift"] : _ref$columns,
1027
+ columns = _ref$columns === void 0 ? ["Campaign", "Raised", "Progress", "Donors", "Avg Gift"] : _ref$columns,
1026
1028
  _ref$rows = _ref.rows,
1027
1029
  rows = _ref$rows === void 0 ? [] : _ref$rows,
1028
1030
  _ref$gridTemplateColu = _ref.gridTemplateColumns,
1029
- gridTemplateColumns = _ref$gridTemplateColu === void 0 ? "3fr 1fr 1.5fr 0.8fr 1fr" : _ref$gridTemplateColu;
1030
- var theme = material.useTheme();
1031
- var isMobile = material.useMediaQuery(theme.breakpoints.down("sm"));
1032
- var isTablet = material.useMediaQuery(theme.breakpoints.between("sm", "md"));
1033
-
1034
- /* ─── Desktop / Tablet: Grid Table ─── */
1035
- if (!isMobile) {
1036
- return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1037
- sx: {
1038
- bgcolor: "#fff",
1039
- borderRadius: 4,
1040
- border: "1px solid #f0f0f0",
1041
- boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
1042
- p: 3
1043
- },
1031
+ gridTemplateColumns = _ref$gridTemplateColu === void 0 ? "3fr 1fr 1.5fr 0.8fr 1fr " : _ref$gridTemplateColu,
1032
+ height = _ref.height,
1033
+ _ref$compact = _ref.compact,
1034
+ compact = _ref$compact === void 0 ? false : _ref$compact,
1035
+ _ref$sx = _ref.sx,
1036
+ sx = _ref$sx === void 0 ? {} : _ref$sx,
1037
+ _ref$headerSx = _ref.headerSx,
1038
+ headerSx = _ref$headerSx === void 0 ? {} : _ref$headerSx,
1039
+ _ref$tableSx = _ref.tableSx,
1040
+ tableSx = _ref$tableSx === void 0 ? {} : _ref$tableSx;
1041
+ return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1042
+ sx: _objectSpread2({
1043
+ bgcolor: "#fff",
1044
+ borderRadius: compact ? 3 : 4,
1045
+ border: "1px solid #f0f0f0",
1046
+ boxShadow: compact ? "0 2px 12px rgba(0,0,0,0.05)" : "0 4px 24px rgba(0,0,0,0.06)",
1047
+ p: compact ? 1.5 : 3,
1048
+ height: height
1049
+ }, sx),
1050
+ children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1051
+ sx: _objectSpread2({
1052
+ display: "flex",
1053
+ justifyContent: "space-between",
1054
+ alignItems: "flex-start",
1055
+ mb: compact ? 1.25 : 3
1056
+ }, headerSx),
1044
1057
  children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1045
- sx: {
1046
- mb: 3
1047
- },
1048
1058
  children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1049
1059
  sx: {
1050
1060
  fontWeight: 700,
1051
- fontSize: "18px",
1052
- color: "#000"
1061
+ fontSize: compact ? "14px" : "18px",
1062
+ color: "#000",
1063
+ textAlign: "left",
1064
+ lineHeight: 1.15
1053
1065
  },
1054
1066
  children: title
1055
1067
  }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1056
1068
  sx: {
1057
- fontSize: "13px",
1058
- color: "rgba(0,0,0,0.4)",
1059
- mt: 0.2
1069
+ fontSize: compact ? "10px" : "13px",
1070
+ color: "rgba(0, 0, 0, 0.4)",
1071
+ textAlign: "left",
1072
+ lineHeight: 1.15
1060
1073
  },
1061
1074
  children: subtitle
1062
1075
  })]
1063
- }), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1076
+ }), actionLabel && /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1064
1077
  sx: {
1065
- overflowX: "auto"
1078
+ fontSize: compact ? "10px" : "13px",
1079
+ fontWeight: 600,
1080
+ color: "rgb(99, 99, 230)",
1081
+ cursor: "pointer"
1066
1082
  },
1067
- children: /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1083
+ children: actionLabel
1084
+ })]
1085
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1086
+ sx: _objectSpread2({
1087
+ overflowX: compact ? "hidden" : "auto"
1088
+ }, tableSx),
1089
+ children: /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1090
+ sx: {
1091
+ minWidth: compact ? 0 : "600px"
1092
+ },
1093
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
1068
1094
  sx: {
1069
- minWidth: "600px"
1095
+ display: "grid",
1096
+ gridTemplateColumns: gridTemplateColumns,
1097
+ gap: compact ? 1 : 2,
1098
+ pb: compact ? 1 : 2.5,
1099
+ borderBottom: "1px solid #f0f0f0"
1070
1100
  },
1071
- children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
1072
- sx: {
1073
- display: "grid",
1074
- gridTemplateColumns: gridTemplateColumns,
1075
- gap: 2,
1076
- pb: 2.5,
1077
- borderBottom: "1px solid #f0f0f0"
1078
- },
1079
- children: columns.map(function (header, colIdx) {
1080
- return /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1081
- sx: {
1082
- fontSize: "12px",
1083
- color: "rgba(0,0,0,0.4)",
1084
- fontWeight: 500,
1085
- whiteSpace: "nowrap",
1086
- textAlign: colIdx === 0 ? "left" : "center"
1087
- },
1088
- children: header
1089
- }, header);
1090
- })
1091
- }), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1092
- sx: {
1093
- mt: 1
1094
- },
1095
- children: rows.map(function (row, idx) {
1096
- var isDisabled = row.comingSoon;
1097
- return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1101
+ children: columns.map(function (header) {
1102
+ return /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1103
+ sx: {
1104
+ fontSize: compact ? "9px" : "12px",
1105
+ color: "rgba(0, 0, 0, 0.4)",
1106
+ fontWeight: 500,
1107
+ textAlign: "left"
1108
+ },
1109
+ children: header
1110
+ }, header);
1111
+ })
1112
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1113
+ sx: {
1114
+ mt: 1
1115
+ },
1116
+ children: rows.map(function (row, idx) {
1117
+ var _row$progress;
1118
+ return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1119
+ sx: {
1120
+ display: "grid",
1121
+ gridTemplateColumns: gridTemplateColumns,
1122
+ gap: compact ? 1 : 2,
1123
+ py: compact ? 0.5 : 1.2,
1124
+ alignItems: "center",
1125
+ borderBottom: idx === rows.length - 1 ? "none" : "1px solid #f5f5f5"
1126
+ },
1127
+ children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1098
1128
  sx: {
1099
- display: "grid",
1100
- gridTemplateColumns: gridTemplateColumns,
1101
- gap: 2,
1102
- py: 1.2,
1129
+ display: "flex",
1103
1130
  alignItems: "center",
1104
- borderBottom: idx === rows.length - 1 ? "none" : "1px solid #f5f5f5",
1105
- opacity: isDisabled ? 0.55 : 1,
1106
- transition: "opacity 0.2s ease"
1131
+ gap: 1.5
1107
1132
  },
1108
- children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1133
+ children: [(row.icon || row.id) && /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1109
1134
  sx: {
1135
+ width: compact ? 22 : 32,
1136
+ height: compact ? 22 : 32,
1137
+ borderRadius: "50%",
1138
+ bgcolor: "#fff",
1139
+ border: "2px solid ".concat(row.avatarBorder || row.avatarBg || "#E5E7EB"),
1110
1140
  display: "flex",
1111
1141
  alignItems: "center",
1112
- gap: 1.5,
1113
- minWidth: 0
1142
+ justifyContent: "center",
1143
+ flexShrink: 0,
1144
+ boxSizing: "border-box",
1145
+ filter: row.comingSoon ? "grayscale(1)" : "none",
1146
+ opacity: row.comingSoon ? 0.55 : 1
1114
1147
  },
1115
- children: [row.id && /*#__PURE__*/jsxRuntime.jsx(material.Avatar, {
1148
+ children: row.icon ? /*#__PURE__*/jsxRuntime.jsx(row.icon, {
1149
+ size: compact ? 12 : 16,
1150
+ color: row.iconColor || row.avatarBorder || row.avatarBg
1151
+ }) : /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1116
1152
  sx: {
1117
- width: 28,
1118
- height: 28,
1119
- fontSize: "10px",
1153
+ fontSize: compact ? "8px" : "10px",
1120
1154
  fontWeight: 700,
1121
- bgcolor: row.avatarBg || "#F3F4F6",
1122
- color: row.avatarColor || "#fff",
1123
- flexShrink: 0
1155
+ color: row.avatarColor || "#111"
1124
1156
  },
1125
1157
  children: row.id
1126
- }), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1127
- sx: {
1128
- display: "flex",
1129
- alignItems: "center",
1130
- gap: 0.8,
1131
- flexWrap: "nowrap",
1132
- minWidth: 0
1133
- },
1134
- children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1135
- sx: {
1136
- fontSize: "12px",
1137
- fontWeight: 700,
1138
- color: "#000",
1139
- whiteSpace: "nowrap"
1140
- },
1141
- children: row.name
1142
- }), isDisabled && /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1143
- sx: {
1144
- display: "inline-flex",
1145
- alignItems: "center",
1146
- px: 0.8,
1147
- py: 0.2,
1148
- borderRadius: "100px",
1149
- bgcolor: "#F3F4F6",
1150
- border: "1px solid #E5E7EB",
1151
- flexShrink: 0,
1152
- whiteSpace: "nowrap"
1153
- },
1154
- children: /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1155
- sx: {
1156
- fontSize: "8px",
1157
- fontWeight: 700,
1158
- color: "#6B7280",
1159
- letterSpacing: "0.3px",
1160
- textTransform: "uppercase",
1161
- whiteSpace: "nowrap"
1162
- },
1163
- children: "Coming Soon"
1164
- })
1165
- })]
1166
- })]
1158
+ })
1167
1159
  }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1168
1160
  sx: {
1169
- fontSize: "13px",
1170
- fontWeight: 600,
1171
- color: isDisabled ? "#9CA3AF" : "#000",
1172
- whiteSpace: "nowrap",
1173
- textAlign: "center"
1161
+ fontSize: compact ? "10px" : "12px",
1162
+ fontWeight: 700,
1163
+ color: row.comingSoon ? "#9CA3AF" : "#000"
1174
1164
  },
1175
- children: row.val1
1176
- }), row.type === "progress" ? /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1165
+ children: row.name
1166
+ })]
1167
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1168
+ sx: {
1169
+ fontSize: compact ? "10px" : "13px",
1170
+ fontWeight: 600,
1171
+ color: row.comingSoon ? "#9CA3AF" : "#000",
1172
+ textAlign: "left"
1173
+ },
1174
+ children: row.val1
1175
+ }), row.type === "progress" ? /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1176
+ sx: {
1177
+ display: "flex",
1178
+ alignItems: "center",
1179
+ gap: 1.5
1180
+ },
1181
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
1177
1182
  sx: {
1178
- display: "flex",
1179
- alignItems: "center",
1180
- gap: 1.5,
1181
- justifyContent: "center"
1183
+ flexGrow: 1
1182
1184
  },
1183
- children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
1185
+ children: /*#__PURE__*/jsxRuntime.jsx(material.LinearProgress, {
1186
+ variant: "determinate",
1187
+ value: Math.min(100, Math.max(0, (_row$progress = row.progress) !== null && _row$progress !== void 0 ? _row$progress : 0)),
1184
1188
  sx: {
1185
- flexGrow: 1,
1186
- maxWidth: "80px"
1187
- },
1188
- children: /*#__PURE__*/jsxRuntime.jsx(material.LinearProgress, {
1189
- variant: "determinate",
1190
- value: row.progress,
1191
- sx: {
1192
- height: 8,
1189
+ height: compact ? 6 : 8,
1190
+ borderRadius: 4,
1191
+ bgcolor: "#F3F4F6",
1192
+ "& .MuiLinearProgress-bar": {
1193
1193
  borderRadius: 4,
1194
- bgcolor: "#F3F4F6",
1195
- "& .MuiLinearProgress-bar": {
1196
- borderRadius: 4,
1197
- bgcolor: row.progressColor || "rgb(99,99,230)"
1198
- }
1194
+ bgcolor: row.progressColor || "rgb(99, 99, 230)"
1199
1195
  }
1200
- })
1201
- }), /*#__PURE__*/jsxRuntime.jsxs(material.Typography, {
1202
- sx: {
1203
- fontSize: "11px",
1204
- color: "rgba(0,0,0,0.4)",
1205
- minWidth: "30px",
1206
- textAlign: "center"
1207
- },
1208
- children: [row.progress, "%"]
1209
- })]
1210
- }) : /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1211
- sx: {
1212
- fontSize: "13px",
1213
- fontWeight: 600,
1214
- color: isDisabled ? "#9CA3AF" : "#000",
1215
- whiteSpace: "nowrap",
1216
- textAlign: "center"
1217
- },
1218
- children: row.val2
1219
- }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1196
+ }
1197
+ })
1198
+ }), /*#__PURE__*/jsxRuntime.jsxs(material.Typography, {
1220
1199
  sx: {
1221
- fontSize: "13px",
1222
- fontWeight: row.highlightVal3 ? 700 : 500,
1223
- color: isDisabled ? "#9CA3AF" : row.highlightVal3 ? row.val3Color || "#22C55E" : "#000",
1224
- whiteSpace: "nowrap",
1225
- textAlign: "center"
1200
+ fontSize: compact ? "9px" : "11px",
1201
+ color: "rgba(0, 0, 0, 0.4)",
1202
+ minWidth: "30px"
1226
1203
  },
1227
- children: row.val3
1228
- }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1204
+ children: [row.progress, "%"]
1205
+ })]
1206
+ }) : /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1207
+ sx: {
1208
+ fontSize: "13px",
1209
+ fontWeight: 600,
1210
+ color: row.comingSoon ? "#9CA3AF" : "#000",
1211
+ textAlign: "left"
1212
+ },
1213
+ children: row.val2
1214
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1215
+ sx: {
1216
+ fontSize: compact ? "10px" : "13px",
1217
+ fontWeight: row.highlightVal3 ? 700 : 500,
1218
+ color: row.comingSoon ? "#9CA3AF" : row.highlightVal3 ? row.val3Color || "#22C55E" : "#000",
1219
+ textAlign: "left"
1220
+ },
1221
+ children: row.val3
1222
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1223
+ sx: {
1224
+ fontSize: "13px",
1225
+ fontWeight: 500,
1226
+ color: row.comingSoon ? "#9CA3AF" : "#000",
1227
+ textAlign: "left"
1228
+ },
1229
+ children: row.val4
1230
+ }), columns.length > 5 && /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1231
+ children: row.comingSoon ? /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1229
1232
  sx: {
1230
- fontSize: "13px",
1231
- fontWeight: 500,
1232
- color: isDisabled ? "#9CA3AF" : "#000",
1233
- whiteSpace: "nowrap",
1234
- textAlign: "center"
1233
+ display: "inline-block",
1234
+ px: compact ? 1 : 1.5,
1235
+ py: compact ? 0.25 : 0.5,
1236
+ borderRadius: "100px",
1237
+ bgcolor: "#F3F4F6",
1238
+ color: "#9CA3AF",
1239
+ fontSize: compact ? "9px" : "11px",
1240
+ fontWeight: 700,
1241
+ textAlign: "center",
1242
+ whiteSpace: "nowrap"
1235
1243
  },
1236
- children: row.val4
1237
- }), columns.length > 5 && /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1244
+ children: "Coming Soon"
1245
+ }) : row.type === "trend" ? /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1238
1246
  sx: {
1239
1247
  display: "flex",
1240
- justifyContent: "center"
1248
+ alignItems: "center",
1249
+ gap: 0.5
1241
1250
  },
1242
- children: row.type === "trend" ? /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1243
- sx: {
1244
- display: "flex",
1245
- alignItems: "center",
1246
- gap: 0.5
1247
- },
1251
+ children: row.trendType === "up" ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1248
1252
  children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1249
1253
  sx: {
1250
1254
  fontSize: "14px",
1251
- color: row.trendType === "up" ? "#22C55E" : "#EF4444"
1255
+ color: "#22C55E"
1252
1256
  },
1253
- children: row.trendType === "up" ? "▲" : "▼"
1257
+ children: "\u25B2"
1254
1258
  }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1255
1259
  sx: {
1256
1260
  fontSize: "12px",
1257
- color: row.trendType === "up" ? "#22C55E" : "#EF4444",
1258
- fontWeight: 700,
1259
- whiteSpace: "nowrap"
1261
+ color: "#22C55E",
1262
+ fontWeight: 700
1260
1263
  },
1261
- children: isTablet ? row.trendType === "up" ? "Up" : "Down" : row.trendLabel
1264
+ children: row.trendLabel
1265
+ })]
1266
+ }) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1267
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1268
+ sx: {
1269
+ fontSize: "14px",
1270
+ color: "#EF4444"
1271
+ },
1272
+ children: "\u25BC"
1273
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1274
+ sx: {
1275
+ fontSize: "12px",
1276
+ color: "#EF4444",
1277
+ fontWeight: 700
1278
+ },
1279
+ children: row.trendLabel
1262
1280
  })]
1263
- }) : row.type === "comingSoon" ? /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1264
- sx: {
1265
- fontSize: "12px",
1266
- color: "#9CA3AF",
1267
- fontWeight: 500,
1268
- textAlign: "center"
1269
- },
1270
- children: "\u2014"
1271
- }) : /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1272
- sx: {
1273
- display: "inline-block",
1274
- px: 1.5,
1275
- py: 0.5,
1276
- borderRadius: "100px",
1277
- bgcolor: row.statusBg,
1278
- color: row.statusColor,
1279
- fontSize: "11px",
1280
- fontWeight: 700
1281
- },
1282
- children: row.status
1283
1281
  })
1284
- })]
1285
- }, idx);
1286
- })
1287
- })]
1288
- })
1289
- })]
1290
- });
1291
- }
1292
-
1293
- /* ─── Mobile: Stacked Card Layout ─── */
1294
- return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1295
- sx: {
1296
- bgcolor: "#fff",
1297
- borderRadius: 4,
1298
- border: "1px solid #f0f0f0",
1299
- boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
1300
- p: 2
1301
- },
1302
- children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1303
- sx: {
1304
- mb: 2
1305
- },
1306
- children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1307
- sx: {
1308
- fontWeight: 700,
1309
- fontSize: "16px",
1310
- color: "#000"
1311
- },
1312
- children: title
1313
- }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1314
- sx: {
1315
- fontSize: "11px",
1316
- color: "rgba(0,0,0,0.4)",
1317
- mt: 0.2
1318
- },
1319
- children: subtitle
1320
- })]
1321
- }), /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1322
- sx: {
1323
- display: "flex",
1324
- flexDirection: "column",
1325
- gap: 1.5
1326
- },
1327
- children: rows.map(function (row, idx) {
1328
- var isDisabled = row.comingSoon;
1329
- return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1330
- sx: {
1331
- p: 2,
1332
- borderRadius: 3,
1333
- border: isDisabled ? "1px dashed #E5E7EB" : "1px solid #F3F4F6",
1334
- bgcolor: isDisabled ? "#FAFAFA" : "#fff",
1335
- opacity: isDisabled ? 0.7 : 1,
1336
- transition: "opacity 0.2s ease"
1337
- },
1338
- children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1339
- sx: {
1340
- display: "flex",
1341
- alignItems: "center",
1342
- gap: 1.5,
1343
- mb: isDisabled ? 0 : 1.5
1344
- },
1345
- children: [row.id && /*#__PURE__*/jsxRuntime.jsx(material.Avatar, {
1346
- sx: {
1347
- width: 32,
1348
- height: 32,
1349
- fontSize: "11px",
1350
- fontWeight: 700,
1351
- bgcolor: row.avatarBg || "#F3F4F6",
1352
- color: row.avatarColor || "#fff",
1353
- flexShrink: 0
1354
- },
1355
- children: row.id
1356
- }), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1357
- sx: {
1358
- display: "flex",
1359
- alignItems: "center",
1360
- gap: 1,
1361
- flex: 1,
1362
- flexWrap: "nowrap"
1363
- },
1364
- children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1365
- sx: {
1366
- fontSize: "14px",
1367
- fontWeight: 700,
1368
- color: "#000"
1369
- },
1370
- children: row.name
1371
- }), isDisabled && /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1372
- sx: {
1373
- display: "inline-flex",
1374
- alignItems: "center",
1375
- px: 1,
1376
- py: 0.3,
1377
- borderRadius: "100px",
1378
- bgcolor: "#F3F4F6",
1379
- border: "1px solid #E5E7EB",
1380
- flexShrink: 0
1381
- },
1382
- children: /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1282
+ }) : /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1383
1283
  sx: {
1384
- fontSize: "8px",
1284
+ display: "inline-block",
1285
+ px: compact ? 1 : 1.5,
1286
+ py: compact ? 0.25 : 0.5,
1287
+ borderRadius: "100px",
1288
+ bgcolor: row.statusBg,
1289
+ color: row.statusColor,
1290
+ fontSize: compact ? "9px" : "11px",
1385
1291
  fontWeight: 700,
1386
- color: "#6B7280",
1387
- letterSpacing: "0.3px",
1388
- textTransform: "uppercase"
1292
+ textAlign: "center"
1389
1293
  },
1390
- children: "Coming Soon"
1294
+ children: row.status
1391
1295
  })
1392
1296
  })]
1393
- }), row.type === "trend" && /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1394
- sx: {
1395
- display: "flex",
1396
- alignItems: "center",
1397
- gap: 0.3,
1398
- flexShrink: 0
1399
- },
1400
- children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1401
- sx: {
1402
- fontSize: "12px",
1403
- color: row.trendType === "up" ? "#22C55E" : "#EF4444"
1404
- },
1405
- children: row.trendType === "up" ? "▲" : "▼"
1406
- }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1407
- sx: {
1408
- fontSize: "11px",
1409
- color: row.trendType === "up" ? "#22C55E" : "#EF4444",
1410
- fontWeight: 700
1411
- },
1412
- children: row.trendType === "up" ? "Up" : "Down"
1413
- })]
1414
- })]
1415
- }), !isDisabled && /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1416
- sx: {
1417
- display: "grid",
1418
- gridTemplateColumns: "1fr 1fr 1fr 1fr",
1419
- gap: 1
1420
- },
1421
- children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1422
- children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1423
- sx: {
1424
- fontSize: "9px",
1425
- color: "#9CA3AF",
1426
- fontWeight: 600,
1427
- textTransform: "uppercase",
1428
- letterSpacing: "0.3px"
1429
- },
1430
- children: "Spend"
1431
- }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1432
- sx: {
1433
- fontSize: "13px",
1434
- fontWeight: 700,
1435
- color: "#000",
1436
- mt: 0.3
1437
- },
1438
- children: row.val1
1439
- })]
1440
- }), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1441
- children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1442
- sx: {
1443
- fontSize: "9px",
1444
- color: "#9CA3AF",
1445
- fontWeight: 600,
1446
- textTransform: "uppercase",
1447
- letterSpacing: "0.3px"
1448
- },
1449
- children: "Revenue"
1450
- }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1451
- sx: {
1452
- fontSize: "13px",
1453
- fontWeight: 700,
1454
- color: "#000",
1455
- mt: 0.3
1456
- },
1457
- children: row.val2
1458
- })]
1459
- }), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1460
- children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1461
- sx: {
1462
- fontSize: "9px",
1463
- color: "#9CA3AF",
1464
- fontWeight: 600,
1465
- textTransform: "uppercase",
1466
- letterSpacing: "0.3px"
1467
- },
1468
- children: "ROAS"
1469
- }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1470
- sx: {
1471
- fontSize: "13px",
1472
- fontWeight: 700,
1473
- color: row.val3Color || "#22C55E",
1474
- mt: 0.3
1475
- },
1476
- children: row.val3
1477
- })]
1478
- }), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1479
- children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1480
- sx: {
1481
- fontSize: "9px",
1482
- color: "#9CA3AF",
1483
- fontWeight: 600,
1484
- textTransform: "uppercase",
1485
- letterSpacing: "0.3px"
1486
- },
1487
- children: "CPA"
1488
- }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1489
- sx: {
1490
- fontSize: "13px",
1491
- fontWeight: 700,
1492
- color: "#000",
1493
- mt: 0.3
1494
- },
1495
- children: row.val4
1496
- })]
1497
- })]
1498
- })]
1499
- }, idx);
1297
+ }, idx);
1298
+ })
1299
+ })]
1500
1300
  })
1501
1301
  })]
1502
1302
  });
@@ -1590,99 +1390,6 @@ var MetricCard$1 = function MetricCard(_ref) {
1590
1390
  });
1591
1391
  };
1592
1392
 
1593
- var DisplayCard = function DisplayCard(_ref) {
1594
- var title = _ref.title,
1595
- value = _ref.value,
1596
- subValue = _ref.subValue,
1597
- Icon = _ref.icon,
1598
- onClick = _ref.onClick,
1599
- _ref$sx = _ref.sx,
1600
- sx = _ref$sx === void 0 ? {} : _ref$sx,
1601
- _ref$isActive = _ref.isActive,
1602
- isActive = _ref$isActive === void 0 ? false : _ref$isActive;
1603
- return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1604
- onClick: onClick,
1605
- sx: _objectSpread2({
1606
- height: "100px",
1607
- borderRadius: "24px",
1608
- display: "flex",
1609
- justifyContent: "space-between",
1610
- alignItems: "center",
1611
- boxShadow: "rgba(0, 0, 0, 0.06) 0px 4px 15px 0px",
1612
- // boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
1613
- // padding: "16px 16px 16px 18px",
1614
- py: "10px",
1615
- px: "16px",
1616
- cursor: "pointer",
1617
- bgcolor: "#fff",
1618
- border: isActive ? "1px solid rgb(99, 99, 230)" : "none",
1619
- // border: "2px solid #f0f0f0",
1620
- transition: "all 0.3s ease"
1621
- }, sx),
1622
- children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
1623
- sx: {
1624
- display: "flex",
1625
- flexDirection: "column",
1626
- gap: 0.5
1627
- },
1628
- children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1629
- sx: {
1630
- fontWeight: "400",
1631
- color: isActive ? "#c1c1f5" : "#a1a1a8",
1632
- fontSize: "14px",
1633
- lineHeight: "16px",
1634
- textAlign: "left"
1635
- },
1636
- children: title
1637
- }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
1638
- sx: {
1639
- lineHeight: "1.2",
1640
- textAlign: "left",
1641
- color: isActive ? "#6363e6" : "#000",
1642
- fontSize: "20px",
1643
- fontWeight: "700",
1644
- mb: 0.5
1645
- },
1646
- children: statusValue(value)
1647
- }), subValue && /*#__PURE__*/jsxRuntime.jsxs(material.Typography, {
1648
- sx: {
1649
- fontSize: "11px",
1650
- 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)",
1651
- fontWeight: "500",
1652
- display: "flex",
1653
- alignItems: "center",
1654
- gap: 0.5
1655
- },
1656
- children: [typeof subValue === "string" && (subValue.includes("%") || subValue.includes("new") || subValue.includes("x")) && !subValue.includes("/") && !subValue.includes("pass-through") && /*#__PURE__*/jsxRuntime.jsx("span", {
1657
- style: {
1658
- fontSize: "14px"
1659
- },
1660
- children: "\u25B2"
1661
- }), subValue]
1662
- })]
1663
- }), Icon && /*#__PURE__*/jsxRuntime.jsx(material.Box, {
1664
- sx: {
1665
- width: "44px",
1666
- height: "44px",
1667
- borderRadius: "50%",
1668
- backgroundColor: "#f7f7ff",
1669
- display: "flex",
1670
- alignItems: "center",
1671
- justifyContent: "center",
1672
- color: "rgb(99, 99, 230)"
1673
- },
1674
- children: /*#__PURE__*/jsxRuntime.jsx(Icon, {
1675
- sx: {
1676
- fontSize: "20px"
1677
- }
1678
- })
1679
- })]
1680
- });
1681
- };
1682
- var statusValue = function statusValue(value) {
1683
- return _typeof(value) === "object" && value !== null ? value.value !== undefined ? value.value : JSON.stringify(value) : value;
1684
- };
1685
-
1686
1393
  var PURPLE = "#6363E6";
1687
1394
  var REPORT_COLORS = {
1688
1395
  purple: PURPLE};
@@ -4916,6 +4623,8 @@ var DonorMixCard = function DonorMixCard(_ref) {
4916
4623
  border: "1px solid #f0f0f0",
4917
4624
  boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
4918
4625
  p: compact ? 1.5 : 3,
4626
+ // height: "100%",
4627
+ // width: "100%",
4919
4628
  display: "flex",
4920
4629
  flexDirection: "column"
4921
4630
  }, sx),
@@ -4945,6 +4654,7 @@ var DonorMixCard = function DonorMixCard(_ref) {
4945
4654
  sx: {
4946
4655
  position: "relative",
4947
4656
  height: compact ? "110px" : "180px",
4657
+ // mb: 1,
4948
4658
  display: "flex",
4949
4659
  justifyContent: "center"
4950
4660
  },
@@ -4955,16 +4665,14 @@ var DonorMixCard = function DonorMixCard(_ref) {
4955
4665
  width: compact ? "140" : "210"
4956
4666
  })
4957
4667
  }), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4668
+ sx: {},
4958
4669
  children: [items.map(function (item, idx) {
4959
- var isComingSoon = item.comingSoon;
4960
4670
  return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4961
4671
  sx: {
4962
4672
  display: "flex",
4963
4673
  justifyContent: "space-between",
4964
4674
  alignItems: "center",
4965
- mb: idx === items.length - 1 ? showBottomSummary ? compact ? 0.5 : 0 : 0 : compact ? 0.5 : 0,
4966
- opacity: isComingSoon ? 0.55 : 1,
4967
- transition: "opacity 0.2s ease"
4675
+ mb: idx === items.length - 1 ? showBottomSummary ? compact ? 0.5 : 0 : 0 : compact ? 0.5 : 0
4968
4676
  },
4969
4677
  children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4970
4678
  sx: {
@@ -4976,38 +4684,31 @@ var DonorMixCard = function DonorMixCard(_ref) {
4976
4684
  sx: {
4977
4685
  width: 10,
4978
4686
  height: 10,
4979
- bgcolor: item.color,
4687
+ bgcolor: item.comingSoon ? "#D1D5DB" : item.color,
4980
4688
  borderRadius: "2px"
4981
4689
  }
4982
4690
  }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
4983
4691
  sx: {
4984
4692
  fontSize: compact ? "10px" : "13px",
4985
4693
  fontWeight: 500,
4986
- color: isComingSoon ? "#9CA3AF" : "rgba(0, 0, 0, 0.4)"
4694
+ color: item.comingSoon ? "#9CA3AF" : "rgba(0, 0, 0, 0.4)"
4987
4695
  },
4988
4696
  children: item.label
4989
4697
  })]
4990
- }), isComingSoon ? /*#__PURE__*/jsxRuntime.jsx(material.Box, {
4698
+ }), item.comingSoon ? /*#__PURE__*/jsxRuntime.jsx(material.Box, {
4991
4699
  sx: {
4992
4700
  display: "inline-flex",
4993
4701
  alignItems: "center",
4994
4702
  px: 1,
4995
- py: 0.3,
4703
+ py: 0.2,
4996
4704
  borderRadius: "100px",
4997
4705
  bgcolor: "#F3F4F6",
4998
- border: "1px solid #E5E7EB"
4706
+ color: "#9CA3AF",
4707
+ fontSize: "10px",
4708
+ fontWeight: 700,
4709
+ whiteSpace: "nowrap"
4999
4710
  },
5000
- children: /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
5001
- sx: {
5002
- fontSize: "9px",
5003
- fontWeight: 700,
5004
- color: "#6B7280",
5005
- letterSpacing: "0.3px",
5006
- textTransform: "uppercase",
5007
- lineHeight: 1
5008
- },
5009
- children: "Coming Soon"
5010
- })
4711
+ children: "Coming Soon"
5011
4712
  }) : /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
5012
4713
  sx: {
5013
4714
  fontSize: compact ? "10px" : "13px",
@@ -5019,6 +4720,9 @@ var DonorMixCard = function DonorMixCard(_ref) {
5019
4720
  }, idx);
5020
4721
  }), showBottomSummary && /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
5021
4722
  sx: {
4723
+ // display: "flex",
4724
+ // justifyContent: "space-between",
4725
+ // alignItems: "center",
5022
4726
  pt: compact ? 1 : 2,
5023
4727
  borderTop: "1px solid #f0f0f0",
5024
4728
  textAlign: "left"
@@ -6794,7 +6498,7 @@ var TopCampaignsConvRateCard = function TopCampaignsConvRateCard(_ref7) {
6794
6498
  })]
6795
6499
  });
6796
6500
  };
6797
- var getCampaignInitials$1 = function getCampaignInitials() {
6501
+ var getCampaignInitials$2 = function getCampaignInitials() {
6798
6502
  var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
6799
6503
  var words = name.match(/[A-Za-z]+/g) || [];
6800
6504
  if (words.length >= 2) {
@@ -6917,7 +6621,7 @@ var TopPerformingCampaignsCard = function TopPerformingCampaignsCard(_ref8) {
6917
6621
  fontSize: "10px",
6918
6622
  fontWeight: 700
6919
6623
  },
6920
- children: item.id || getCampaignInitials$1(item.name)
6624
+ children: item.id || getCampaignInitials$2(item.name)
6921
6625
  }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
6922
6626
  sx: {
6923
6627
  fontSize: "13px",
@@ -17793,6 +17497,89 @@ var OverallSectionSkeleton = function OverallSectionSkeleton() {
17793
17497
  })]
17794
17498
  });
17795
17499
  };
17500
+ var PaidSectionSkeleton = function PaidSectionSkeleton() {
17501
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
17502
+ children: [/*#__PURE__*/jsxRuntime.jsx(MetricCardsSkeleton, {
17503
+ count: 6,
17504
+ gridTemplateColumns: {
17505
+ xs: "1fr",
17506
+ sm: "1fr 1fr",
17507
+ md: "1fr 1fr 1fr",
17508
+ lg: "repeat(6, 1fr)"
17509
+ },
17510
+ gap: 2
17511
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
17512
+ container: true,
17513
+ spacing: 3,
17514
+ sx: {
17515
+ mt: 2.75
17516
+ },
17517
+ children: /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
17518
+ item: true,
17519
+ xs: 12,
17520
+ sx: {
17521
+ paddingTop: "0px !important"
17522
+ },
17523
+ children: /*#__PURE__*/jsxRuntime.jsx(ChartCardSkeleton, {
17524
+ height: 400
17525
+ })
17526
+ })
17527
+ }), /*#__PURE__*/jsxRuntime.jsxs(material.Grid, {
17528
+ container: true,
17529
+ spacing: 3,
17530
+ sx: {
17531
+ mt: 2.25
17532
+ },
17533
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.Grid, {
17534
+ item: true,
17535
+ xs: 12,
17536
+ md: 6,
17537
+ sx: {
17538
+ paddingTop: "0px !important",
17539
+ minHeight: 430
17540
+ },
17541
+ children: /*#__PURE__*/jsxRuntime.jsx(TableCardSkeleton, {})
17542
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
17543
+ item: true,
17544
+ xs: 12,
17545
+ md: 6,
17546
+ sx: {
17547
+ paddingTop: "0px !important",
17548
+ minHeight: 430
17549
+ },
17550
+ children: /*#__PURE__*/jsxRuntime.jsx(DonutCardSkeleton, {})
17551
+ })]
17552
+ }), /*#__PURE__*/jsxRuntime.jsxs(material.Grid, {
17553
+ container: true,
17554
+ spacing: 3,
17555
+ sx: {
17556
+ mt: 2.25
17557
+ },
17558
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.Grid, {
17559
+ item: true,
17560
+ xs: 12,
17561
+ md: 6,
17562
+ sx: {
17563
+ paddingTop: "0px !important"
17564
+ },
17565
+ children: /*#__PURE__*/jsxRuntime.jsx(TableCardSkeleton, {
17566
+ height: 360,
17567
+ rowCount: 4
17568
+ })
17569
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
17570
+ item: true,
17571
+ xs: 12,
17572
+ md: 6,
17573
+ sx: {
17574
+ paddingTop: "0px !important"
17575
+ },
17576
+ children: /*#__PURE__*/jsxRuntime.jsx(PanelCardSkeleton, {
17577
+ height: 360
17578
+ })
17579
+ })]
17580
+ })]
17581
+ });
17582
+ };
17796
17583
  var OrganicSectionSkeleton = function OrganicSectionSkeleton() {
17797
17584
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
17798
17585
  children: [/*#__PURE__*/jsxRuntime.jsx(MetricCardsSkeleton, {
@@ -17933,7 +17720,7 @@ var EmailSectionSkeleton = function EmailSectionSkeleton() {
17933
17720
  });
17934
17721
  };
17935
17722
 
17936
- var formatKpi$2 = function formatKpi(value) {
17723
+ var formatKpi$3 = function formatKpi(value) {
17937
17724
  return Number(value !== null && value !== void 0 ? value : 0).toLocaleString("en-US", {
17938
17725
  minimumFractionDigits: 2,
17939
17726
  maximumFractionDigits: 2
@@ -18011,7 +17798,7 @@ var OverallSection = function OverallSection(_ref) {
18011
17798
  };
18012
17799
  var metricInfo = {
18013
17800
  "Total Raised": {
18014
- 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",
17801
+ value: "$".concat(formatKpi$3((_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",
18015
17802
  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"),
18016
17803
  label: "Total Raised",
18017
17804
  icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PaidOutlined, {}),
@@ -18020,7 +17807,7 @@ var OverallSection = function OverallSection(_ref) {
18020
17807
  warning: false
18021
17808
  },
18022
17809
  "Net Raised": {
18023
- 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)),
17810
+ value: "$".concat(formatKpi$3((_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)),
18024
17811
  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 "),
18025
17812
  label: "Net Raised",
18026
17813
  icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.RequestQuoteOutlined, {}),
@@ -18029,7 +17816,7 @@ var OverallSection = function OverallSection(_ref) {
18029
17816
  warning: false
18030
17817
  },
18031
17818
  "Total Donors": {
18032
- 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),
17819
+ value: formatKpi$3((_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),
18033
17820
  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",
18034
17821
  label: "Total Donors",
18035
17822
  icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PeopleAltOutlined, {}),
@@ -18038,7 +17825,7 @@ var OverallSection = function OverallSection(_ref) {
18038
17825
  warning: false
18039
17826
  },
18040
17827
  "Avg Donation": {
18041
- 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)),
17828
+ value: "$".concat(formatKpi$3((_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)),
18042
17829
  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 "),
18043
17830
  label: "Average Donation Amount",
18044
17831
  icon: /*#__PURE__*/jsxRuntime.jsx(AverageDonationIcon, {}),
@@ -18047,7 +17834,7 @@ var OverallSection = function OverallSection(_ref) {
18047
17834
  warning: false
18048
17835
  },
18049
17836
  "ROAS": {
18050
- 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"),
17837
+ value: "".concat(formatKpi$3((_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"),
18051
17838
  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"),
18052
17839
  label: "ROAS",
18053
17840
  icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.TrendingUp, {}),
@@ -18056,7 +17843,7 @@ var OverallSection = function OverallSection(_ref) {
18056
17843
  warning: false
18057
17844
  },
18058
17845
  "Conversion": {
18059
- 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), "%"),
17846
+ value: "".concat(formatKpi$3((_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), "%"),
18060
17847
  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%",
18061
17848
  label: "Conversion Rate",
18062
17849
  icon: /*#__PURE__*/jsxRuntime.jsx(ConversionRateIcon, {}),
@@ -18442,93 +18229,473 @@ var OverallSection$1 = /*#__PURE__*/Object.freeze({
18442
18229
  default: OverallSection
18443
18230
  });
18444
18231
 
18445
- var PaidSection = function PaidSection() {
18232
+ var formatKpi$2 = function formatKpi(value) {
18233
+ return Number(value !== null && value !== void 0 ? value : 0).toLocaleString("en-US", {
18234
+ minimumFractionDigits: 2,
18235
+ maximumFractionDigits: 2
18236
+ });
18237
+ };
18238
+ var CHANNEL_STYLES = {
18239
+ "Meta Ads": {
18240
+ id: "M",
18241
+ icon: si.SiMeta,
18242
+ avatarBg: "#1877F2",
18243
+ avatarBorder: "#1877F2",
18244
+ color: "#1877F2",
18245
+ comingSoon: false
18246
+ },
18247
+ "Google Ads": {
18248
+ id: "G",
18249
+ icon: si.SiGoogleads,
18250
+ avatarBg: "#4285F4",
18251
+ avatarBorder: "#4285F4",
18252
+ color: "#4285F4",
18253
+ comingSoon: true
18254
+ },
18255
+ "TikTok Ads": {
18256
+ id: "T",
18257
+ icon: si.SiTiktok,
18258
+ avatarBg: "#000000",
18259
+ avatarBorder: "#000000",
18260
+ color: "#000000",
18261
+ comingSoon: true
18262
+ },
18263
+ YouTube: {
18264
+ id: "Y",
18265
+ icon: si.SiYoutube,
18266
+ avatarBg: "#FF0000",
18267
+ avatarBorder: "#FF0000",
18268
+ color: "#FF0000",
18269
+ comingSoon: true
18270
+ },
18271
+ Snapchat: {
18272
+ id: "S",
18273
+ icon: si.SiSnapchat,
18274
+ avatarBg: "#FFFC00",
18275
+ avatarBorder: "#FFFC00",
18276
+ iconColor: "#8A6D00",
18277
+ color: "#FFFC00",
18278
+ comingSoon: true
18279
+ }
18280
+ };
18281
+ var formatGrowth$2 = function formatGrowth(value) {
18282
+ return "".concat(Number(value !== null && value !== void 0 ? value : 0).toFixed(2), "% vs pp");
18283
+ };
18284
+ var mapTimeSeries$2 = function mapTimeSeries(series) {
18285
+ if (!Array.isArray(series) || series.length === 0) {
18286
+ return {
18287
+ categories: [],
18288
+ data: []
18289
+ };
18290
+ }
18291
+ return {
18292
+ categories: series.map(function (item) {
18293
+ return item.date;
18294
+ }),
18295
+ data: series.map(function (item) {
18296
+ var _item$value;
18297
+ return (_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : 0;
18298
+ })
18299
+ };
18300
+ };
18301
+ var getChannelStyle = function getChannelStyle() {
18302
+ var channel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
18303
+ return CHANNEL_STYLES[channel] || {
18304
+ id: channel.slice(0, 1).toUpperCase() || "?",
18305
+ avatarBg: "#F3F4F6",
18306
+ color: "#6366F1",
18307
+ comingSoon: true
18308
+ };
18309
+ };
18310
+ var mapChannelTrend = function mapChannelTrend(trend) {
18311
+ var normalized = (trend || "stable").toLowerCase();
18312
+ if (normalized === "down" || normalized === "declining") {
18313
+ return {
18314
+ type: "trend",
18315
+ trendType: "down",
18316
+ trendLabel: "Declining"
18317
+ };
18318
+ }
18319
+ if (normalized === "up" || normalized === "improving") {
18320
+ return {
18321
+ type: "trend",
18322
+ trendType: "up",
18323
+ trendLabel: "Improving"
18324
+ };
18325
+ }
18326
+ return {
18327
+ type: "status",
18328
+ status: "Stable",
18329
+ statusBg: "#F3F4F6",
18330
+ statusColor: "#6B7280"
18331
+ };
18332
+ };
18333
+ var getRoasColor = function getRoasColor(roas) {
18334
+ return Number(roas !== null && roas !== void 0 ? roas : 0) >= 2.5 ? "#22C55E" : "#EF4444";
18335
+ };
18336
+ var getCampaignInitials$1 = function getCampaignInitials() {
18337
+ var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
18338
+ var words = name.trim().split(/\s+/).filter(Boolean);
18339
+ if (words.length >= 2) {
18340
+ return (words[0][0] + words[1][0]).toUpperCase();
18341
+ }
18342
+ return name.slice(0, 2).toUpperCase() || "—";
18343
+ };
18344
+ var buildEmptySpendAllocation = function buildEmptySpendAllocation() {
18345
+ var channels = Object.keys(CHANNEL_STYLES);
18346
+ return {
18347
+ series: channels.map(function () {
18348
+ return 0;
18349
+ }),
18350
+ labels: channels,
18351
+ colors: channels.map(function (channel) {
18352
+ return CHANNEL_STYLES[channel].color;
18353
+ }),
18354
+ centerLabel: "total spend",
18355
+ centerValue: "$".concat(formatNumber(0)),
18356
+ subtitle: "Where $".concat(formatNumber(0), " went"),
18357
+ items: channels.map(function (channel) {
18358
+ return {
18359
+ label: channel,
18360
+ val: "0.0%",
18361
+ color: CHANNEL_STYLES[channel].color,
18362
+ comingSoon: CHANNEL_STYLES[channel].comingSoon
18363
+ };
18364
+ })
18365
+ };
18366
+ };
18367
+ var PaidSection = function PaidSection(_ref) {
18368
+ 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;
18369
+ var _ref$apiData = _ref.apiData,
18370
+ apiData = _ref$apiData === void 0 ? {} : _ref$apiData;
18371
+ _ref.dateName;
18372
+ var _ref$apiLoading = _ref.apiLoading,
18373
+ apiLoading = _ref$apiLoading === void 0 ? false : _ref$apiLoading,
18374
+ _ref$numberOfDays = _ref.numberOfDays,
18375
+ numberOfDays = _ref$numberOfDays === void 0 ? 30 : _ref$numberOfDays;
18446
18376
  var _useState = React.useState("Total Spent"),
18447
18377
  _useState2 = _slicedToArray(_useState, 2),
18448
18378
  activeMetric = _useState2[0],
18449
18379
  setActiveMetric = _useState2[1];
18450
- var categories = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
18451
- var metricInfo = {
18452
- "Total Spent": {
18453
- value: "$80,313",
18454
- subValue: "12% vs last month",
18455
- chartLabel: "Daily Spend",
18456
- data: [800, 950, 700, 1100, 900, 1200, 1300],
18457
- icon: iconsMaterial.IndeterminateCheckBoxOutlined
18458
- },
18459
- "Revinue Raised": {
18460
- value: "$240,398",
18461
- subValue: "12% vs last month",
18462
- chartLabel: "Daily Revenue",
18463
- data: [3200, 4100, 2800, 5600, 4200, 6100, 7500],
18464
- icon: iconsMaterial.PaidOutlined
18465
- },
18466
- ROAS: {
18467
- value: "3.0",
18468
- subValue: "12% vs last month",
18469
- chartLabel: "ROAS Trend",
18470
- data: [2.5, 3.1, 2.8, 4.2, 3.8, 4.5, 5.2],
18471
- icon: iconsMaterial.TrendingUp
18472
- },
18473
- "Cost per donor": {
18474
- value: "$373",
18475
- subValue: "12% vs last month",
18476
- chartLabel: "CPA Trend",
18477
- data: [350, 380, 360, 410, 390, 370, 373],
18478
- icon: iconsMaterial.PersonOutlined
18479
- },
18480
- "Conversion rate": {
18481
- value: "3.1%",
18482
- subValue: "12% vs last month",
18483
- chartLabel: "Conversion Rate",
18484
- data: [2.8, 3.0, 2.9, 3.4, 3.2, 3.1, 3.1],
18485
- icon: iconsMaterial.Adjust
18486
- },
18487
- "Avg donation": {
18488
- value: "$130.58",
18489
- subValue: "12% vs last month",
18490
- chartLabel: "Average Donation",
18491
- data: [120, 135, 125, 140, 130, 128, 130.58],
18492
- icon: iconsMaterial.PaidOutlined
18380
+ var rawOverview = (apiData === null || apiData === void 0 ? void 0 : apiData.overview) || {};
18381
+ var metaSummary = (apiData === null || apiData === void 0 ? void 0 : apiData.metaSummary) || {};
18382
+ var overview = {
18383
+ totalSpent: (_ref2 = (_rawOverview$totalSpe = rawOverview.totalSpent) !== null && _rawOverview$totalSpe !== void 0 ? _rawOverview$totalSpe : metaSummary.metaSpend) !== null && _ref2 !== void 0 ? _ref2 : 0,
18384
+ totalRevenue: (_ref3 = (_rawOverview$totalRev = rawOverview.totalRevenue) !== null && _rawOverview$totalRev !== void 0 ? _rawOverview$totalRev : metaSummary.attributedAmount) !== null && _ref3 !== void 0 ? _ref3 : 0,
18385
+ roas: (_ref4 = (_rawOverview$roas = rawOverview.roas) !== null && _rawOverview$roas !== void 0 ? _rawOverview$roas : metaSummary.roas) !== null && _ref4 !== void 0 ? _ref4 : 0,
18386
+ costPerDonor: (_ref5 = (_rawOverview$costPerD = rawOverview.costPerDonor) !== null && _rawOverview$costPerD !== void 0 ? _rawOverview$costPerD : metaSummary.cpa) !== null && _ref5 !== void 0 ? _ref5 : 0,
18387
+ conversionRate: (_rawOverview$conversi = rawOverview.conversionRate) !== null && _rawOverview$conversi !== void 0 ? _rawOverview$conversi : 0,
18388
+ averageDonation: (_ref6 = (_rawOverview$averageD = rawOverview.averageDonation) !== null && _rawOverview$averageD !== void 0 ? _rawOverview$averageD : metaSummary.averageGift) !== null && _ref6 !== void 0 ? _ref6 : 0,
18389
+ totalDonations: (_ref7 = (_rawOverview$totalDon = rawOverview.totalDonations) !== null && _rawOverview$totalDon !== void 0 ? _rawOverview$totalDon : metaSummary.donationsCount) !== null && _ref7 !== void 0 ? _ref7 : 0
18390
+ };
18391
+ var growth = {
18392
+ totalSpent: (_ref8 = (_rawOverview$growthPe = (_rawOverview$growthPe2 = rawOverview.growthPercentage) === null || _rawOverview$growthPe2 === void 0 ? void 0 : _rawOverview$growthPe2.totalSpent) !== null && _rawOverview$growthPe !== void 0 ? _rawOverview$growthPe : metaSummary.metaSpendChangePercent) !== null && _ref8 !== void 0 ? _ref8 : 0,
18393
+ totalRevenue: (_ref9 = (_rawOverview$growthPe3 = (_rawOverview$growthPe4 = rawOverview.growthPercentage) === null || _rawOverview$growthPe4 === void 0 ? void 0 : _rawOverview$growthPe4.totalRevenue) !== null && _rawOverview$growthPe3 !== void 0 ? _rawOverview$growthPe3 : metaSummary.attributedChangePercent) !== null && _ref9 !== void 0 ? _ref9 : 0,
18394
+ roas: (_ref0 = (_rawOverview$growthPe5 = (_rawOverview$growthPe6 = rawOverview.growthPercentage) === null || _rawOverview$growthPe6 === void 0 ? void 0 : _rawOverview$growthPe6.roas) !== null && _rawOverview$growthPe5 !== void 0 ? _rawOverview$growthPe5 : metaSummary.roasChange) !== null && _ref0 !== void 0 ? _ref0 : 0,
18395
+ costPerDonor: (_rawOverview$growthPe7 = (_rawOverview$growthPe8 = rawOverview.growthPercentage) === null || _rawOverview$growthPe8 === void 0 ? void 0 : _rawOverview$growthPe8.costPerDonor) !== null && _rawOverview$growthPe7 !== void 0 ? _rawOverview$growthPe7 : 0,
18396
+ conversionRate: (_rawOverview$growthPe9 = (_rawOverview$growthPe0 = rawOverview.growthPercentage) === null || _rawOverview$growthPe0 === void 0 ? void 0 : _rawOverview$growthPe0.conversionRate) !== null && _rawOverview$growthPe9 !== void 0 ? _rawOverview$growthPe9 : 0,
18397
+ averageDonation: (_rawOverview$growthPe1 = (_rawOverview$growthPe10 = rawOverview.growthPercentage) === null || _rawOverview$growthPe10 === void 0 ? void 0 : _rawOverview$growthPe10.averageDonation) !== null && _rawOverview$growthPe1 !== void 0 ? _rawOverview$growthPe1 : 0
18398
+ };
18399
+ var hasPaidOverview = Boolean(apiData === null || apiData === void 0 ? void 0 : apiData.overview);
18400
+ var spendSeries = mapTimeSeries$2(apiData === null || apiData === void 0 || (_apiData$spendVsReven = apiData.spendVsRevenue) === null || _apiData$spendVsReven === void 0 ? void 0 : _apiData$spendVsReven.spend);
18401
+ var revenueSeries = mapTimeSeries$2(apiData === null || apiData === void 0 || (_apiData$spendVsReven2 = apiData.spendVsRevenue) === null || _apiData$spendVsReven2 === void 0 ? void 0 : _apiData$spendVsReven2.revenue);
18402
+ var roasChartData = React.useMemo(function () {
18403
+ if (spendSeries.data.length === 0 || revenueSeries.data.length === 0) {
18404
+ return [];
18493
18405
  }
18406
+ var length = Math.min(spendSeries.data.length, revenueSeries.data.length);
18407
+ return Array.from({
18408
+ length: length
18409
+ }, function (_, index) {
18410
+ var _spendSeries$data$ind, _revenueSeries$data$i;
18411
+ var spend = (_spendSeries$data$ind = spendSeries.data[index]) !== null && _spendSeries$data$ind !== void 0 ? _spendSeries$data$ind : 0;
18412
+ var revenue = (_revenueSeries$data$i = revenueSeries.data[index]) !== null && _revenueSeries$data$i !== void 0 ? _revenueSeries$data$i : 0;
18413
+ return spend > 0 ? revenue / spend : 0;
18414
+ });
18415
+ }, [spendSeries.data, revenueSeries.data]);
18416
+ var fallbackCategories = spendSeries.categories.length ? spendSeries.categories : revenueSeries.categories.length ? revenueSeries.categories : ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
18417
+ var flatSeries = function flatSeries(value) {
18418
+ return fallbackCategories.length > 0 ? fallbackCategories.map(function () {
18419
+ return Number(value !== null && value !== void 0 ? value : 0);
18420
+ }) : [Number(value !== null && value !== void 0 ? value : 0)];
18494
18421
  };
18422
+ var metricInfo = React.useMemo(function () {
18423
+ if (!hasPaidOverview) {
18424
+ return {
18425
+ "Total Spent": {
18426
+ value: "$".concat(formatKpi$2(0)),
18427
+ subValue: formatGrowth$2(0),
18428
+ data: flatSeries(0),
18429
+ categories: fallbackCategories,
18430
+ icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.IndeterminateCheckBoxOutlined, {}),
18431
+ money: true,
18432
+ error: false,
18433
+ warning: false
18434
+ },
18435
+ "Revenue Raised": {
18436
+ value: "$".concat(formatKpi$2(0)),
18437
+ subValue: formatGrowth$2(0),
18438
+ data: flatSeries(0),
18439
+ categories: fallbackCategories,
18440
+ icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PaidOutlined, {}),
18441
+ money: true,
18442
+ error: false,
18443
+ warning: false
18444
+ },
18445
+ ROAS: {
18446
+ value: "".concat(formatKpi$2(0), "x"),
18447
+ subValue: formatGrowth$2(0),
18448
+ data: flatSeries(0),
18449
+ categories: fallbackCategories,
18450
+ icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.TrendingUp, {}),
18451
+ money: false,
18452
+ error: false,
18453
+ warning: false
18454
+ },
18455
+ "Cost Per Donor": {
18456
+ value: "$".concat(formatKpi$2(0)),
18457
+ subValue: formatGrowth$2(0),
18458
+ data: flatSeries(0),
18459
+ categories: fallbackCategories,
18460
+ icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PersonOutlined, {}),
18461
+ money: true,
18462
+ error: false,
18463
+ warning: false
18464
+ },
18465
+ "Conversion Rate": {
18466
+ value: "".concat(formatKpi$2(0), "%"),
18467
+ subValue: formatGrowth$2(0),
18468
+ data: flatSeries(0),
18469
+ categories: fallbackCategories,
18470
+ icon: /*#__PURE__*/jsxRuntime.jsx(ConversionRateIcon, {}),
18471
+ money: false,
18472
+ error: false,
18473
+ warning: false
18474
+ },
18475
+ "Avg Donation": {
18476
+ value: "$".concat(formatKpi$2(0)),
18477
+ subValue: formatGrowth$2(0),
18478
+ data: flatSeries(0),
18479
+ categories: fallbackCategories,
18480
+ icon: /*#__PURE__*/jsxRuntime.jsx(AverageDonationIcon, {}),
18481
+ money: true,
18482
+ error: false,
18483
+ warning: false
18484
+ }
18485
+ };
18486
+ }
18487
+ var chartCategories = spendSeries.categories.length > 0 ? spendSeries.categories : revenueSeries.categories.length > 0 ? revenueSeries.categories : fallbackCategories;
18488
+ return {
18489
+ "Total Spent": {
18490
+ value: "$".concat(formatKpi$2(overview.totalSpent)),
18491
+ subValue: formatGrowth$2(growth.totalSpent),
18492
+ data: spendSeries.data.length > 0 ? spendSeries.data : flatSeries(0),
18493
+ categories: chartCategories,
18494
+ icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.IndeterminateCheckBoxOutlined, {}),
18495
+ money: true,
18496
+ error: false,
18497
+ warning: false
18498
+ },
18499
+ "Revenue Raised": {
18500
+ value: "$".concat(formatKpi$2(overview.totalRevenue)),
18501
+ subValue: formatGrowth$2(growth.totalRevenue),
18502
+ data: revenueSeries.data.length > 0 ? revenueSeries.data : flatSeries(0),
18503
+ categories: chartCategories,
18504
+ icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PaidOutlined, {}),
18505
+ money: true,
18506
+ error: false,
18507
+ warning: false
18508
+ },
18509
+ ROAS: {
18510
+ value: "".concat(formatKpi$2(overview.roas), "x"),
18511
+ subValue: formatGrowth$2(growth.roas),
18512
+ data: roasChartData.length > 0 ? roasChartData : flatSeries(0),
18513
+ categories: chartCategories,
18514
+ icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.TrendingUp, {}),
18515
+ money: false,
18516
+ error: false,
18517
+ warning: false
18518
+ },
18519
+ "Cost Per Donor": {
18520
+ value: "$".concat(formatKpi$2(overview.costPerDonor)),
18521
+ subValue: formatGrowth$2(growth.costPerDonor),
18522
+ data: flatSeries(overview.costPerDonor),
18523
+ categories: chartCategories,
18524
+ icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PersonOutlined, {}),
18525
+ money: true,
18526
+ error: false,
18527
+ warning: false
18528
+ },
18529
+ "Conversion Rate": {
18530
+ value: "".concat(formatKpi$2(overview.conversionRate), "%"),
18531
+ subValue: formatGrowth$2(growth.conversionRate),
18532
+ data: flatSeries(overview.conversionRate),
18533
+ categories: chartCategories,
18534
+ icon: /*#__PURE__*/jsxRuntime.jsx(ConversionRateIcon, {}),
18535
+ money: false,
18536
+ error: false,
18537
+ warning: false
18538
+ },
18539
+ "Avg Donation": {
18540
+ value: "$".concat(formatKpi$2(overview.averageDonation)),
18541
+ subValue: formatGrowth$2(growth.averageDonation),
18542
+ data: flatSeries(overview.averageDonation),
18543
+ categories: chartCategories,
18544
+ icon: /*#__PURE__*/jsxRuntime.jsx(AverageDonationIcon, {}),
18545
+ money: true,
18546
+ error: false,
18547
+ warning: false
18548
+ }
18549
+ };
18550
+ }, [fallbackCategories, growth, hasPaidOverview, overview, revenueSeries, roasChartData, spendSeries]);
18551
+ var channelRows = React.useMemo(function () {
18552
+ var channels = apiData === null || apiData === void 0 ? void 0 : apiData.channelPerformance;
18553
+ if (!hasPaidOverview) return [];
18554
+ if (!Array.isArray(channels) || channels.length === 0) return [];
18555
+ return channels.map(function (item) {
18556
+ var _item$roas, _item$spend, _item$revenue, _item$cpa;
18557
+ var style = getChannelStyle(item.channel);
18558
+ var roas = Number((_item$roas = item.roas) !== null && _item$roas !== void 0 ? _item$roas : 0);
18559
+ return _objectSpread2({
18560
+ id: style.id,
18561
+ icon: style.icon,
18562
+ avatarBg: style.avatarBg,
18563
+ avatarBorder: style.avatarBorder,
18564
+ iconColor: style.iconColor || style.avatarBorder,
18565
+ comingSoon: style.comingSoon,
18566
+ name: item.channel,
18567
+ val1: "$".concat(formatNumber((_item$spend = item.spend) !== null && _item$spend !== void 0 ? _item$spend : 0)),
18568
+ val2: "$".concat(formatNumber((_item$revenue = item.revenue) !== null && _item$revenue !== void 0 ? _item$revenue : 0)),
18569
+ val3: "".concat(roas.toFixed(1), "x"),
18570
+ val4: "$".concat(formatNumber((_item$cpa = item.cpa) !== null && _item$cpa !== void 0 ? _item$cpa : 0)),
18571
+ highlightVal3: true,
18572
+ val3Color: getRoasColor(roas)
18573
+ }, mapChannelTrend(item.trend));
18574
+ });
18575
+ }, [apiData === null || apiData === void 0 ? void 0 : apiData.channelPerformance, hasPaidOverview]);
18576
+ var spendAllocation = React.useMemo(function () {
18577
+ var _allocation$totalSpen, _allocation$totalSpen2;
18578
+ var allocation = apiData === null || apiData === void 0 ? void 0 : apiData.spendAllocation;
18579
+ if (!hasPaidOverview) return [];
18580
+ if (!allocation || !Array.isArray(allocation.data) || allocation.data.length === 0) {
18581
+ return buildEmptySpendAllocation();
18582
+ }
18583
+ var items = allocation.data.map(function (item) {
18584
+ var _item$percentage, _item$spend2, _item$percentage2;
18585
+ var style = getChannelStyle(item.channel);
18586
+ return {
18587
+ label: item.channel,
18588
+ val: "".concat(Number((_item$percentage = item.percentage) !== null && _item$percentage !== void 0 ? _item$percentage : 0).toFixed(1), "%"),
18589
+ color: style.color,
18590
+ spend: (_item$spend2 = item.spend) !== null && _item$spend2 !== void 0 ? _item$spend2 : 0,
18591
+ percentage: (_item$percentage2 = item.percentage) !== null && _item$percentage2 !== void 0 ? _item$percentage2 : 0,
18592
+ comingSoon: style.comingSoon
18593
+ };
18594
+ });
18595
+ return {
18596
+ series: items.map(function (item) {
18597
+ return item.percentage;
18598
+ }),
18599
+ labels: items.map(function (item) {
18600
+ return item.label;
18601
+ }),
18602
+ colors: items.map(function (item) {
18603
+ return item.color;
18604
+ }),
18605
+ centerLabel: "total spend",
18606
+ centerValue: "$".concat(formatNumber((_allocation$totalSpen = allocation.totalSpend) !== null && _allocation$totalSpen !== void 0 ? _allocation$totalSpen : 0)),
18607
+ subtitle: "Where $".concat(formatNumber((_allocation$totalSpen2 = allocation.totalSpend) !== null && _allocation$totalSpen2 !== void 0 ? _allocation$totalSpen2 : 0), " went"),
18608
+ items: items.map(function (_ref1) {
18609
+ var label = _ref1.label,
18610
+ val = _ref1.val,
18611
+ color = _ref1.color,
18612
+ comingSoon = _ref1.comingSoon;
18613
+ return {
18614
+ label: label,
18615
+ val: val,
18616
+ color: color,
18617
+ comingSoon: comingSoon
18618
+ };
18619
+ })
18620
+ };
18621
+ }, [apiData === null || apiData === void 0 ? void 0 : apiData.spendAllocation, hasPaidOverview]);
18622
+ var topCampaignsData = React.useMemo(function () {
18623
+ var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaigns;
18624
+ if (!hasPaidOverview) return [];
18625
+ if (!Array.isArray(campaigns)) return [];
18626
+ if (campaigns.length === 0) return [];
18627
+ return campaigns.map(function (item) {
18628
+ var _item$spend3, _item$revenue2, _item$roas2;
18629
+ var name = item.campaignName || item.campaign || item.name || "Unknown";
18630
+ return {
18631
+ id: getCampaignInitials$1(name),
18632
+ name: name,
18633
+ spend: "$".concat(formatNumber((_item$spend3 = item.spend) !== null && _item$spend3 !== void 0 ? _item$spend3 : 0)),
18634
+ revenue: "$".concat(formatNumber((_item$revenue2 = item.revenue) !== null && _item$revenue2 !== void 0 ? _item$revenue2 : 0)),
18635
+ roas: "".concat(Number((_item$roas2 = item.roas) !== null && _item$roas2 !== void 0 ? _item$roas2 : 0).toFixed(1), "x")
18636
+ };
18637
+ });
18638
+ }, [apiData === null || apiData === void 0 ? void 0 : apiData.topCampaigns, hasPaidOverview]);
18639
+ var donorGeographyData = React.useMemo(function () {
18640
+ var geography = apiData === null || apiData === void 0 ? void 0 : apiData.donorGeography;
18641
+ if (!hasPaidOverview) return [];
18642
+ var rawCountries = Array.isArray(geography) ? geography : (geography === null || geography === void 0 ? void 0 : geography.countries) || (geography === null || geography === void 0 ? void 0 : geography.data) || [];
18643
+ return Array.isArray(rawCountries) ? rawCountries : [];
18644
+ }, [apiData === null || apiData === void 0 ? void 0 : apiData.donorGeography, hasPaidOverview]);
18495
18645
  var renderCard = function renderCard(title) {
18496
- return /*#__PURE__*/jsxRuntime.jsx(DisplayCard, {
18646
+ return /*#__PURE__*/jsxRuntime.jsx(MetricCard$1, {
18497
18647
  title: title,
18498
18648
  value: metricInfo[title].value,
18499
- subValue: metricInfo[title].subValue,
18649
+ caption: metricInfo[title].subValue,
18500
18650
  icon: metricInfo[title].icon,
18651
+ error: metricInfo[title].error,
18652
+ active: activeMetric === title,
18501
18653
  onClick: function onClick() {
18502
18654
  return setActiveMetric(title);
18503
18655
  },
18504
- isActive: activeMetric === title,
18505
- sx: {
18506
- flex: 1
18656
+ sx: metricInfo[title].error ? {
18657
+ border: "2px solid #ef4444",
18658
+ bgcolor: "#fffafa",
18659
+ cursor: "pointer"
18660
+ } : {
18661
+ cursor: "pointer"
18507
18662
  }
18508
- }, title);
18663
+ });
18509
18664
  };
18510
- var selectedInfo = metricInfo[activeMetric];
18665
+ var selectedInfo = metricInfo[activeMetric] || metricInfo["Total Spent"];
18666
+ var emptySpendAllocation = buildEmptySpendAllocation();
18667
+ var chartCategories = ((_selectedInfo$categor = selectedInfo.categories) === null || _selectedInfo$categor === void 0 ? void 0 : _selectedInfo$categor.length) > 0 ? selectedInfo.categories : fallbackCategories;
18511
18668
  var mainChart = {
18512
18669
  label: activeMetric,
18513
18670
  value: selectedInfo.value,
18514
18671
  trend: selectedInfo.subValue,
18515
18672
  data: selectedInfo.data,
18516
- categories: categories
18673
+ categories: chartCategories,
18674
+ hideControls: true,
18675
+ isAmount: selectedInfo.money
18517
18676
  };
18677
+ if (apiLoading) {
18678
+ return /*#__PURE__*/jsxRuntime.jsx(PaidSectionSkeleton, {});
18679
+ }
18518
18680
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
18519
18681
  children: [/*#__PURE__*/jsxRuntime.jsx(material.Box, {
18520
18682
  sx: {
18521
- display: "flex",
18522
- gap: 2,
18523
- mb: 1,
18524
- flexWrap: "wrap"
18683
+ display: "grid",
18684
+ gridTemplateColumns: {
18685
+ xs: "1fr",
18686
+ sm: "1fr 1fr",
18687
+ md: "1fr 1fr 1fr",
18688
+ lg: "repeat(6, 1fr)"
18689
+ },
18690
+ gap: "6px",
18691
+ mb: 0
18525
18692
  },
18526
18693
  children: Object.keys(metricInfo).map(renderCard)
18527
18694
  }), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
18528
18695
  container: true,
18529
18696
  spacing: 3,
18530
18697
  sx: {
18531
- mt: 1
18698
+ mt: "12px"
18532
18699
  },
18533
18700
  children: /*#__PURE__*/jsxRuntime.jsx(RenderChartCard, {
18534
18701
  item: mainChart,
@@ -18536,125 +18703,61 @@ var PaidSection = function PaidSection() {
18536
18703
  md: 12,
18537
18704
  type: "area",
18538
18705
  isPrimary: true,
18539
- isPremium: true
18706
+ isPremium: true,
18707
+ numberOfDays: numberOfDays,
18708
+ metric: activeMetric === "Conversion Rate" ? "Percent" : activeMetric === "ROAS" ? "ROAS" : selectedInfo.money ? "Revenue" : "Donors"
18540
18709
  })
18541
18710
  }), /*#__PURE__*/jsxRuntime.jsxs(material.Grid, {
18542
18711
  container: true,
18543
18712
  spacing: 3,
18544
18713
  sx: {
18545
- mt: 3
18714
+ mt: "6px"
18546
18715
  },
18547
18716
  children: [/*#__PURE__*/jsxRuntime.jsx(material.Grid, {
18548
18717
  item: true,
18549
18718
  xs: 12,
18550
18719
  md: 6,
18720
+ sx: {
18721
+ paddingTop: "0px !important",
18722
+ minHeight: "430px"
18723
+ },
18551
18724
  children: /*#__PURE__*/jsxRuntime.jsx(ActiveCampaignsCard, {
18552
- title: "Channel performance",
18725
+ title: "Channel Performance",
18553
18726
  subtitle: "Ad platforms ranked by ROAS",
18554
- columns: ["channel", "spend", "revenue", "ROAS", "CPA", "trend"],
18727
+ columns: ["Channel", "Ppend", "Revenue", "ROAS", "CPA", "Trend"],
18555
18728
  gridTemplateColumns: "2.2fr 1fr 1fr 0.8fr 0.8fr 1.2fr",
18556
- rows: [{
18557
- id: "M",
18558
- avatarBg: "#4267B2",
18559
- avatarColor: "#fff",
18560
- name: "Meta Ads",
18561
- val1: "$32,800",
18562
- val2: "$112,400",
18563
- val3: "3.4x",
18564
- val4: "$340",
18565
- type: "trend",
18566
- trendType: "up",
18567
- trendLabel: "Improving",
18568
- highlightVal3: true,
18569
- val3Color: "#22C55E",
18570
- comingSoon: false
18571
- }, {
18572
- id: "G",
18573
- avatarBg: "#C4C4C4",
18574
- avatarColor: "#fff",
18575
- name: "Google Ads",
18576
- val1: "—",
18577
- val2: "—",
18578
- val3: "—",
18579
- val4: "—",
18580
- type: "comingSoon",
18581
- comingSoon: true
18582
- }, {
18583
- id: "T",
18584
- avatarBg: "#C4C4C4",
18585
- avatarColor: "#fff",
18586
- name: "TikTok Ads",
18587
- val1: "—",
18588
- val2: "—",
18589
- val3: "—",
18590
- val4: "—",
18591
- type: "comingSoon",
18592
- comingSoon: true
18593
- }, {
18594
- id: "Y",
18595
- avatarBg: "#C4C4C4",
18596
- avatarColor: "#fff",
18597
- name: "YouTube",
18598
- val1: "—",
18599
- val2: "—",
18600
- val3: "—",
18601
- val4: "—",
18602
- type: "comingSoon",
18603
- comingSoon: true
18604
- }, {
18605
- id: "S",
18606
- avatarBg: "#C4C4C4",
18607
- avatarColor: "#fff",
18608
- name: "Snapchat",
18609
- val1: "—",
18610
- val2: "—",
18611
- val3: "—",
18612
- val4: "—",
18613
- type: "comingSoon",
18614
- comingSoon: true
18615
- }]
18729
+ height: "100%",
18730
+ rows: channelRows !== null && channelRows !== void 0 ? channelRows : []
18616
18731
  })
18617
18732
  }), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
18618
18733
  item: true,
18619
18734
  xs: 12,
18620
18735
  md: 6,
18736
+ sx: {
18737
+ paddingTop: "0px !important",
18738
+ minHeight: "430px",
18739
+ paddingLeft: {
18740
+ xs: "24px !important",
18741
+ md: "6px !important"
18742
+ },
18743
+ marginTop: {
18744
+ xs: "6px",
18745
+ md: "0px"
18746
+ }
18747
+ },
18621
18748
  children: /*#__PURE__*/jsxRuntime.jsx(DonorMixCard, {
18622
- title: "Spend allocation",
18623
- subtitle: "Where $80.3K went this month",
18624
- series: [100],
18625
- labels: ["Meta Ads"],
18626
- colors: ["#4267B2"],
18627
- centerLabel: "total spend",
18628
- centerValue: "$80.3K",
18629
- items: [{
18630
- label: "Meta Ads",
18631
- val: "100%",
18632
- color: "#4267B2",
18633
- comingSoon: false
18634
- }, {
18635
- label: "Google Ads",
18636
- val: "Coming Soon",
18637
- color: "#C4C4C4",
18638
- comingSoon: true
18639
- }, {
18640
- label: "TikTok",
18641
- val: "Coming Soon",
18642
- color: "#C4C4C4",
18643
- comingSoon: true
18644
- }, {
18645
- label: "YouTube",
18646
- val: "Coming Soon",
18647
- color: "#C4C4C4",
18648
- comingSoon: true
18649
- }, {
18650
- label: "Snapchat",
18651
- val: "Coming Soon",
18652
- color: "#C4C4C4",
18653
- comingSoon: true
18654
- }],
18749
+ title: "Spend Allocation",
18750
+ subtitle: (_spendAllocation$subt = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.subtitle) !== null && _spendAllocation$subt !== void 0 ? _spendAllocation$subt : emptySpendAllocation.subtitle,
18751
+ series: (_spendAllocation$seri = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.series) !== null && _spendAllocation$seri !== void 0 ? _spendAllocation$seri : emptySpendAllocation.series,
18752
+ labels: (_spendAllocation$labe = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.labels) !== null && _spendAllocation$labe !== void 0 ? _spendAllocation$labe : emptySpendAllocation.labels,
18753
+ colors: (_spendAllocation$colo = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.colors) !== null && _spendAllocation$colo !== void 0 ? _spendAllocation$colo : emptySpendAllocation.colors,
18754
+ centerLabel: (_spendAllocation$cent = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.centerLabel) !== null && _spendAllocation$cent !== void 0 ? _spendAllocation$cent : "total spend",
18755
+ centerValue: (_spendAllocation$cent2 = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.centerValue) !== null && _spendAllocation$cent2 !== void 0 ? _spendAllocation$cent2 : emptySpendAllocation.centerValue,
18756
+ items: (_spendAllocation$item = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.items) !== null && _spendAllocation$item !== void 0 ? _spendAllocation$item : emptySpendAllocation.items,
18655
18757
  showBottomSummary: false,
18656
18758
  sx: {
18657
- pb: 3.5
18759
+ pb: 3.5,
18760
+ height: "100%"
18658
18761
  }
18659
18762
  })
18660
18763
  })]
@@ -18662,18 +18765,44 @@ var PaidSection = function PaidSection() {
18662
18765
  container: true,
18663
18766
  spacing: 3,
18664
18767
  sx: {
18665
- mt: 3
18768
+ mt: "6px",
18769
+ alignItems: "stretch"
18666
18770
  },
18667
18771
  children: [/*#__PURE__*/jsxRuntime.jsx(material.Grid, {
18668
18772
  item: true,
18669
18773
  xs: 12,
18670
18774
  md: 6,
18671
- children: /*#__PURE__*/jsxRuntime.jsx(TopPerformingCampaignsCard, {})
18775
+ sx: {
18776
+ paddingTop: "0px !important",
18777
+ display: "flex"
18778
+ },
18779
+ children: /*#__PURE__*/jsxRuntime.jsx(material.Box, {
18780
+ sx: {
18781
+ width: "100%"
18782
+ },
18783
+ children: /*#__PURE__*/jsxRuntime.jsx(TopPerformingCampaignsCard, {
18784
+ data: topCampaignsData !== null && topCampaignsData !== void 0 ? topCampaignsData : []
18785
+ })
18786
+ })
18672
18787
  }), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
18673
18788
  item: true,
18674
18789
  xs: 12,
18675
18790
  md: 6,
18676
- children: /*#__PURE__*/jsxRuntime.jsx(PaidDonorGeographyCard, {})
18791
+ sx: {
18792
+ paddingTop: "0px !important",
18793
+ paddingLeft: {
18794
+ xs: "24px !important",
18795
+ md: "6px !important"
18796
+ },
18797
+ marginTop: {
18798
+ xs: "6px",
18799
+ md: "0px"
18800
+ },
18801
+ display: "flex"
18802
+ },
18803
+ children: /*#__PURE__*/jsxRuntime.jsx(PaidDonorGeographyCard, {
18804
+ donorGeographyData: donorGeographyData
18805
+ })
18677
18806
  })]
18678
18807
  })]
18679
18808
  });