@ammarkhalidfarooq/dashboard-package 0.6.112 → 0.6.114
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 +186 -601
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +187 -602
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Suspense, lazy, useState, useRef, useEffect, useMemo } from 'react';
|
|
2
|
-
import { Box, Button, Menu, MenuItem, Grid, Card, CardContent, Typography, IconButton, ThemeProvider, CircularProgress, Avatar, LinearProgress, Stack,
|
|
2
|
+
import { Box, Button, Menu, MenuItem, Grid, Card, CardContent, Typography, IconButton, ThemeProvider, CircularProgress, Avatar, LinearProgress, Stack, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Skeleton } from '@mui/material';
|
|
3
3
|
import { MoreHoriz, TrendingDown, TrendingUp, MoreVert, Check, InfoOutlined, Settings, PeopleAltOutlined, PaidOutlined, PersonOutlined, IndeterminateCheckBoxOutlined, FavoriteOutlined, SearchOutlined, HighlightOff, Email } from '@mui/icons-material';
|
|
4
4
|
import { createTheme, useTheme } from '@mui/material/styles';
|
|
5
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -7,7 +7,6 @@ import Grid$1 from '@mui/material/Grid';
|
|
|
7
7
|
import Box$1 from '@mui/material/Box';
|
|
8
8
|
import Typography$1 from '@mui/material/Typography';
|
|
9
9
|
import ReactApexChart from 'react-apexcharts';
|
|
10
|
-
import CloseIcon from '@mui/icons-material/Close';
|
|
11
10
|
|
|
12
11
|
var theme = createTheme({
|
|
13
12
|
cssVariables: true,
|
|
@@ -3870,9 +3869,9 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
3870
3869
|
activeFilters = _ref$activeFilters === void 0 ? [] : _ref$activeFilters,
|
|
3871
3870
|
setExportLoading = _ref.setExportLoading;
|
|
3872
3871
|
var initialMetric = "Revenue";
|
|
3873
|
-
var revenueData = (apiData === null || apiData === void 0 ? void 0 : apiData.revenueData) || [
|
|
3874
|
-
var donationsData = (apiData === null || apiData === void 0 ? void 0 : apiData.donationsData) || [
|
|
3875
|
-
var categories = (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || [
|
|
3872
|
+
var revenueData = (apiData === null || apiData === void 0 ? void 0 : apiData.revenueData) || [0];
|
|
3873
|
+
var donationsData = (apiData === null || apiData === void 0 ? void 0 : apiData.donationsData) || [0];
|
|
3874
|
+
var categories = (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || [];
|
|
3876
3875
|
var _useState = useState(initialMetric),
|
|
3877
3876
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3878
3877
|
metric = _useState2[0];
|
|
@@ -3988,7 +3987,7 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
3988
3987
|
}) : categories;
|
|
3989
3988
|
var oneTimeTotal = oneTimeData.length > 0 ? oneTimeValues.reduce(function (sum, val) {
|
|
3990
3989
|
return sum + val;
|
|
3991
|
-
}, 0) :
|
|
3990
|
+
}, 0) : 0;
|
|
3992
3991
|
var firstInstData = (apiData === null || apiData === void 0 ? void 0 : apiData.firstInstallmentRevenue) || [];
|
|
3993
3992
|
var firstInstValues = firstInstData.length > 0 ? firstInstData.map(function (item) {
|
|
3994
3993
|
return item.value;
|
|
@@ -3998,7 +3997,7 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
3998
3997
|
}) : categories.slice(-7);
|
|
3999
3998
|
var firstInstTotal = firstInstData.length > 0 ? firstInstValues.reduce(function (sum, val) {
|
|
4000
3999
|
return sum + val;
|
|
4001
|
-
}, 0) :
|
|
4000
|
+
}, 0) : 0;
|
|
4002
4001
|
var totalRevData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) ? apiData.totalRevenue : [];
|
|
4003
4002
|
var totalRevValues = totalRevData.length > 0 ? totalRevData.map(function (item) {
|
|
4004
4003
|
return item.value;
|
|
@@ -4008,67 +4007,67 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
4008
4007
|
}) : categories;
|
|
4009
4008
|
var totalRevTotal = totalRevData.length > 0 ? totalRevValues.reduce(function (sum, val) {
|
|
4010
4009
|
return sum + val;
|
|
4011
|
-
}, 0) :
|
|
4010
|
+
}, 0) : 0;
|
|
4012
4011
|
var avgDonData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.averageDonation) ? apiData.averageDonation : [];
|
|
4013
4012
|
var avgDonValues = avgDonData.length > 0 ? avgDonData.map(function (item) {
|
|
4014
4013
|
return item.value;
|
|
4015
|
-
}) : currentData.map(function (
|
|
4016
|
-
return
|
|
4014
|
+
}) : currentData.map(function () {
|
|
4015
|
+
return 0;
|
|
4017
4016
|
});
|
|
4018
4017
|
var avgDonCategories = avgDonData.length > 0 ? avgDonData.map(function (item) {
|
|
4019
4018
|
return item.date;
|
|
4020
4019
|
}) : categories;
|
|
4021
4020
|
var avgDonOverall = avgDonData.length > 0 ? avgDonValues.reduce(function (sum, val) {
|
|
4022
4021
|
return sum + val;
|
|
4023
|
-
}, 0) / avgDonValues.length :
|
|
4022
|
+
}, 0) / avgDonValues.length : 0;
|
|
4024
4023
|
var tipData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.tipAmount) ? apiData.tipAmount : [];
|
|
4025
4024
|
var tipValues = tipData.length > 0 ? tipData.map(function (item) {
|
|
4026
4025
|
return item.value;
|
|
4027
|
-
}) : currentData.map(function (
|
|
4028
|
-
return
|
|
4026
|
+
}) : currentData.map(function () {
|
|
4027
|
+
return 0;
|
|
4029
4028
|
});
|
|
4030
4029
|
var tipCategories = tipData.length > 0 ? tipData.map(function (item) {
|
|
4031
4030
|
return item.date;
|
|
4032
4031
|
}) : categories;
|
|
4033
4032
|
var tipTotal = tipData.length > 0 ? tipValues.reduce(function (sum, val) {
|
|
4034
4033
|
return sum + val;
|
|
4035
|
-
}, 0) :
|
|
4034
|
+
}, 0) : 0;
|
|
4036
4035
|
var convRateData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.conversionRate) ? apiData.conversionRate : [];
|
|
4037
4036
|
var convRateValues = convRateData.length > 0 ? convRateData.map(function (item) {
|
|
4038
4037
|
return item.value;
|
|
4039
|
-
}) : [
|
|
4038
|
+
}) : [0];
|
|
4040
4039
|
var convRateCategories = convRateData.length > 0 ? convRateData.map(function (item) {
|
|
4041
4040
|
return item.date;
|
|
4042
4041
|
}) : categories;
|
|
4043
4042
|
var convRateAvg = convRateData.length > 0 ? convRateValues.reduce(function (sum, val) {
|
|
4044
4043
|
return sum + val;
|
|
4045
|
-
}, 0) / convRateValues.length :
|
|
4044
|
+
}, 0) / convRateValues.length : 0;
|
|
4046
4045
|
var organicVisData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.organicVisits) ? apiData.organicVisits : [];
|
|
4047
4046
|
var paidVisData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.paidVisits) ? apiData.paidVisits : [];
|
|
4048
4047
|
var organicVisValues = organicVisData.length > 0 ? organicVisData.map(function (item) {
|
|
4049
4048
|
return item.value;
|
|
4050
|
-
}) : [
|
|
4049
|
+
}) : [0];
|
|
4051
4050
|
var paidVisValues = paidVisData.length > 0 ? paidVisData.map(function (item) {
|
|
4052
4051
|
return item.value;
|
|
4053
|
-
}) : [
|
|
4052
|
+
}) : [0];
|
|
4054
4053
|
var trafficCategories = organicVisData.length > 0 ? organicVisData.map(function (item) {
|
|
4055
4054
|
return item.date;
|
|
4056
4055
|
}) : categories;
|
|
4057
4056
|
var primaryCharts = [{
|
|
4058
4057
|
label: "Total Raised",
|
|
4059
|
-
value: totalRevData.length > 0 ? "$".concat(totalRevTotal.toLocaleString()) : typeof (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) === "string" ? apiData.totalRevenue : "$
|
|
4058
|
+
value: totalRevData.length > 0 ? "$".concat(totalRevTotal.toLocaleString()) : typeof (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) === "string" ? apiData.totalRevenue : "$0.00",
|
|
4060
4059
|
subValue: "Total Donations: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalDonations) || 0),
|
|
4061
4060
|
data: totalRevValues,
|
|
4062
4061
|
categories: totalRevCategories,
|
|
4063
4062
|
showSelector: true
|
|
4064
4063
|
}, {
|
|
4065
4064
|
label: "First installments",
|
|
4066
|
-
value: apiData !== null && apiData !== void 0 && apiData.firstInstallmentRevenue ? "$".concat(firstInstTotal.toLocaleString()) : "$
|
|
4065
|
+
value: apiData !== null && apiData !== void 0 && apiData.firstInstallmentRevenue ? "$".concat(firstInstTotal.toLocaleString()) : "$0.00",
|
|
4067
4066
|
data: firstInstValues,
|
|
4068
4067
|
categories: firstInstCategories
|
|
4069
4068
|
}, {
|
|
4070
4069
|
label: "One-time donations",
|
|
4071
|
-
value: apiData !== null && apiData !== void 0 && apiData.oneTimeDonations ? "$".concat(oneTimeTotal.toLocaleString()) : "$
|
|
4070
|
+
value: apiData !== null && apiData !== void 0 && apiData.oneTimeDonations ? "$".concat(oneTimeTotal.toLocaleString()) : "$0.00",
|
|
4072
4071
|
data: oneTimeValues,
|
|
4073
4072
|
categories: oneTimeCategories
|
|
4074
4073
|
}];
|
|
@@ -4076,32 +4075,36 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
4076
4075
|
label: "New vs Returning Donors",
|
|
4077
4076
|
series: [{
|
|
4078
4077
|
name: "New Donors",
|
|
4079
|
-
data:
|
|
4078
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4079
|
+
return 0;
|
|
4080
|
+
}) : [0]
|
|
4080
4081
|
}, {
|
|
4081
4082
|
name: "Returning",
|
|
4082
|
-
data:
|
|
4083
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4084
|
+
return 0;
|
|
4085
|
+
}) : [0]
|
|
4083
4086
|
}],
|
|
4084
4087
|
categories: categories,
|
|
4085
4088
|
stacked: true,
|
|
4086
4089
|
footer: {
|
|
4087
|
-
left: "New donors:
|
|
4088
|
-
right: "Returning donors:
|
|
4090
|
+
left: "New donors: 0",
|
|
4091
|
+
right: "Returning donors: 0"
|
|
4089
4092
|
}
|
|
4090
4093
|
}, {
|
|
4091
4094
|
label: "Average Donation Amount",
|
|
4092
|
-
value: apiData !== null && apiData !== void 0 && apiData.averageDonation ? "$".concat(avgDonOverall.toFixed(2)) : "$
|
|
4095
|
+
value: apiData !== null && apiData !== void 0 && apiData.averageDonation ? "$".concat(avgDonOverall.toFixed(2)) : "$0.00",
|
|
4093
4096
|
data: avgDonValues,
|
|
4094
4097
|
categories: avgDonCategories
|
|
4095
4098
|
}, {
|
|
4096
4099
|
label: "Tip Amount",
|
|
4097
|
-
value: apiData !== null && apiData !== void 0 && apiData.tipAmount ? "$".concat(tipTotal.toLocaleString()) : "$
|
|
4098
|
-
subValue: "Number of Tips: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalTips) ||
|
|
4100
|
+
value: apiData !== null && apiData !== void 0 && apiData.tipAmount ? "$".concat(tipTotal.toLocaleString()) : "$0.00",
|
|
4101
|
+
subValue: "Number of Tips: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalTips) || 0),
|
|
4099
4102
|
data: tipValues,
|
|
4100
4103
|
categories: tipCategories
|
|
4101
4104
|
}];
|
|
4102
4105
|
var tertiaryCharts = [{
|
|
4103
4106
|
label: "Conversion Rate",
|
|
4104
|
-
value: apiData !== null && apiData !== void 0 && apiData.conversionRate ? "".concat(convRateAvg.toFixed(1), "%") : "
|
|
4107
|
+
value: apiData !== null && apiData !== void 0 && apiData.conversionRate ? "".concat(convRateAvg.toFixed(1), "%") : "0%",
|
|
4105
4108
|
data: convRateValues,
|
|
4106
4109
|
categories: convRateCategories
|
|
4107
4110
|
}, {
|
|
@@ -4117,24 +4120,32 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
4117
4120
|
stacked: true
|
|
4118
4121
|
}, {
|
|
4119
4122
|
label: "Organic Donations",
|
|
4120
|
-
value: "
|
|
4121
|
-
data:
|
|
4123
|
+
value: "0",
|
|
4124
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4125
|
+
return 0;
|
|
4126
|
+
}) : [0],
|
|
4122
4127
|
categories: categories
|
|
4123
4128
|
}];
|
|
4124
4129
|
var quaternaryCharts = [{
|
|
4125
4130
|
label: "Email Marketing",
|
|
4126
|
-
value: "
|
|
4127
|
-
data:
|
|
4131
|
+
value: "0",
|
|
4132
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4133
|
+
return 0;
|
|
4134
|
+
}) : [0],
|
|
4128
4135
|
categories: categories
|
|
4129
4136
|
}, {
|
|
4130
4137
|
label: "Traffic source",
|
|
4131
|
-
value: "
|
|
4132
|
-
data:
|
|
4138
|
+
value: "0%",
|
|
4139
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4140
|
+
return 0;
|
|
4141
|
+
}) : [0],
|
|
4133
4142
|
categories: categories
|
|
4134
4143
|
}, {
|
|
4135
4144
|
label: "URL",
|
|
4136
|
-
value: "
|
|
4137
|
-
data:
|
|
4145
|
+
value: "0%",
|
|
4146
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4147
|
+
return 0;
|
|
4148
|
+
}) : [0],
|
|
4138
4149
|
categories: categories
|
|
4139
4150
|
}];
|
|
4140
4151
|
return /*#__PURE__*/jsxs(Box, {
|
|
@@ -7042,316 +7053,6 @@ var RefundsChargebacksCard = function RefundsChargebacksCard(_ref) {
|
|
|
7042
7053
|
});
|
|
7043
7054
|
};
|
|
7044
7055
|
|
|
7045
|
-
var BORDER$1 = "1px solid #e0e0e0";
|
|
7046
|
-
var ROWS_PER_PAGE = 10;
|
|
7047
|
-
var headerCellSx$1 = {
|
|
7048
|
-
fontWeight: 700,
|
|
7049
|
-
fontSize: "0.78rem",
|
|
7050
|
-
color: "#111",
|
|
7051
|
-
bgcolor: "#f3f3f3",
|
|
7052
|
-
borderBottom: BORDER$1,
|
|
7053
|
-
borderRight: BORDER$1,
|
|
7054
|
-
py: "12px",
|
|
7055
|
-
px: "16px",
|
|
7056
|
-
lineHeight: 1.4,
|
|
7057
|
-
textAlign: "left",
|
|
7058
|
-
"&:last-child": {
|
|
7059
|
-
borderRight: 0
|
|
7060
|
-
}
|
|
7061
|
-
};
|
|
7062
|
-
var cellSx$1 = {
|
|
7063
|
-
fontSize: "0.85rem",
|
|
7064
|
-
color: "#333",
|
|
7065
|
-
borderBottom: BORDER$1,
|
|
7066
|
-
borderRight: BORDER$1,
|
|
7067
|
-
py: "12px",
|
|
7068
|
-
px: "16px",
|
|
7069
|
-
verticalAlign: "middle",
|
|
7070
|
-
textAlign: "left",
|
|
7071
|
-
"&:last-child": {
|
|
7072
|
-
borderRight: 0
|
|
7073
|
-
}
|
|
7074
|
-
};
|
|
7075
|
-
var MOCK_ROWS = [{
|
|
7076
|
-
date: "Jun 1, 2026",
|
|
7077
|
-
campaignName: "Ramadan 2024 - Global Feed",
|
|
7078
|
-
donorType: "New Donor",
|
|
7079
|
-
raised: "$4,520.00"
|
|
7080
|
-
}, {
|
|
7081
|
-
date: "Jun 2, 2026",
|
|
7082
|
-
campaignName: "Water for Life - East Africa",
|
|
7083
|
-
donorType: "Returning",
|
|
7084
|
-
raised: "$1,280.00"
|
|
7085
|
-
}, {
|
|
7086
|
-
date: "Jun 3, 2026",
|
|
7087
|
-
campaignName: "Orphan Care - Palestine",
|
|
7088
|
-
donorType: "New Donor",
|
|
7089
|
-
raised: "$2,850.00"
|
|
7090
|
-
}, {
|
|
7091
|
-
date: "Jun 4, 2026",
|
|
7092
|
-
campaignName: "Emergency Relief - Yemen",
|
|
7093
|
-
donorType: "Returning",
|
|
7094
|
-
raised: "$1,540.00"
|
|
7095
|
-
}, {
|
|
7096
|
-
date: "Jun 5, 2026",
|
|
7097
|
-
campaignName: "Education Fund - Syria",
|
|
7098
|
-
donorType: "New Donor",
|
|
7099
|
-
raised: "$980.00"
|
|
7100
|
-
}, {
|
|
7101
|
-
date: "Jun 6, 2026",
|
|
7102
|
-
campaignName: "Medical Aid - Gaza",
|
|
7103
|
-
donorType: "Returning",
|
|
7104
|
-
raised: "$3,120.00"
|
|
7105
|
-
}, {
|
|
7106
|
-
date: "Jun 7, 2026",
|
|
7107
|
-
campaignName: "Food Security - Sudan",
|
|
7108
|
-
donorType: "New Donor",
|
|
7109
|
-
raised: "$760.00"
|
|
7110
|
-
}, {
|
|
7111
|
-
date: "Jun 8, 2026",
|
|
7112
|
-
campaignName: "Winter Relief - Afghanistan",
|
|
7113
|
-
donorType: "Returning",
|
|
7114
|
-
raised: "$2,140.00"
|
|
7115
|
-
}, {
|
|
7116
|
-
date: "Jun 9, 2026",
|
|
7117
|
-
campaignName: "Clean Water - Bangladesh",
|
|
7118
|
-
donorType: "New Donor",
|
|
7119
|
-
raised: "$890.00"
|
|
7120
|
-
}, {
|
|
7121
|
-
date: "Jun 10, 2026",
|
|
7122
|
-
campaignName: "Shelter Fund - Lebanon",
|
|
7123
|
-
donorType: "Returning",
|
|
7124
|
-
raised: "$1,675.00"
|
|
7125
|
-
}, {
|
|
7126
|
-
date: "Jun 11, 2026",
|
|
7127
|
-
campaignName: "Qurbani 2026 - Global",
|
|
7128
|
-
donorType: "New Donor",
|
|
7129
|
-
raised: "$5,230.00"
|
|
7130
|
-
}, {
|
|
7131
|
-
date: "Jun 12, 2026",
|
|
7132
|
-
campaignName: "Maternal Health - Somalia",
|
|
7133
|
-
donorType: "Returning",
|
|
7134
|
-
raised: "$1,120.00"
|
|
7135
|
-
}, {
|
|
7136
|
-
date: "Jun 13, 2026",
|
|
7137
|
-
campaignName: "School Supplies - Pakistan",
|
|
7138
|
-
donorType: "New Donor",
|
|
7139
|
-
raised: "$640.00"
|
|
7140
|
-
}, {
|
|
7141
|
-
date: "Jun 14, 2026",
|
|
7142
|
-
campaignName: "Disaster Response - Turkey",
|
|
7143
|
-
donorType: "Returning",
|
|
7144
|
-
raised: "$3,890.00"
|
|
7145
|
-
}, {
|
|
7146
|
-
date: "Jun 15, 2026",
|
|
7147
|
-
campaignName: "Zakat Distribution - UK",
|
|
7148
|
-
donorType: "New Donor",
|
|
7149
|
-
raised: "$2,450.00"
|
|
7150
|
-
}, {
|
|
7151
|
-
date: "Jun 16, 2026",
|
|
7152
|
-
campaignName: "Eye Care - Morocco",
|
|
7153
|
-
donorType: "Returning",
|
|
7154
|
-
raised: "$780.00"
|
|
7155
|
-
}, {
|
|
7156
|
-
date: "Jun 17, 2026",
|
|
7157
|
-
campaignName: "Livelihood Support - Iraq",
|
|
7158
|
-
donorType: "New Donor",
|
|
7159
|
-
raised: "$1,960.00"
|
|
7160
|
-
}, {
|
|
7161
|
-
date: "Jun 18, 2026",
|
|
7162
|
-
campaignName: "Ramadan Iftar - Jordan",
|
|
7163
|
-
donorType: "Returning",
|
|
7164
|
-
raised: "$2,310.00"
|
|
7165
|
-
}, {
|
|
7166
|
-
date: "Jun 19, 2026",
|
|
7167
|
-
campaignName: "Children's Fund - Nigeria",
|
|
7168
|
-
donorType: "New Donor",
|
|
7169
|
-
raised: "$1,430.00"
|
|
7170
|
-
}, {
|
|
7171
|
-
date: "Jun 20, 2026",
|
|
7172
|
-
campaignName: "Housing Rebuild - Libya",
|
|
7173
|
-
donorType: "Returning",
|
|
7174
|
-
raised: "$3,050.00"
|
|
7175
|
-
}];
|
|
7176
|
-
var OverallDetailModal = function OverallDetailModal(_ref) {
|
|
7177
|
-
var open = _ref.open,
|
|
7178
|
-
title = _ref.title,
|
|
7179
|
-
onClose = _ref.onClose;
|
|
7180
|
-
var _useState = useState(1),
|
|
7181
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
7182
|
-
page = _useState2[0],
|
|
7183
|
-
setPage = _useState2[1];
|
|
7184
|
-
var totalPages = Math.ceil(MOCK_ROWS.length / ROWS_PER_PAGE);
|
|
7185
|
-
useEffect(function () {
|
|
7186
|
-
if (open) {
|
|
7187
|
-
setPage(1);
|
|
7188
|
-
}
|
|
7189
|
-
}, [open, title]);
|
|
7190
|
-
var paginatedRows = MOCK_ROWS.slice((page - 1) * ROWS_PER_PAGE, page * ROWS_PER_PAGE);
|
|
7191
|
-
return /*#__PURE__*/jsxs(Dialog, {
|
|
7192
|
-
open: open,
|
|
7193
|
-
onClose: onClose,
|
|
7194
|
-
maxWidth: "md",
|
|
7195
|
-
fullWidth: true,
|
|
7196
|
-
children: [/*#__PURE__*/jsxs(DialogTitle, {
|
|
7197
|
-
sx: {
|
|
7198
|
-
display: "flex",
|
|
7199
|
-
alignItems: "center",
|
|
7200
|
-
justifyContent: "space-between",
|
|
7201
|
-
pr: 1,
|
|
7202
|
-
pb: 1
|
|
7203
|
-
},
|
|
7204
|
-
children: [/*#__PURE__*/jsxs(Box, {
|
|
7205
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
7206
|
-
sx: {
|
|
7207
|
-
fontWeight: 700,
|
|
7208
|
-
fontSize: "18px",
|
|
7209
|
-
color: "#000"
|
|
7210
|
-
},
|
|
7211
|
-
children: title
|
|
7212
|
-
}), /*#__PURE__*/jsx(Typography, {
|
|
7213
|
-
sx: {
|
|
7214
|
-
fontSize: "13px",
|
|
7215
|
-
color: "rgba(0, 0, 0, 0.45)",
|
|
7216
|
-
mt: 0.25
|
|
7217
|
-
},
|
|
7218
|
-
children: "Campaign breakdown"
|
|
7219
|
-
})]
|
|
7220
|
-
}), /*#__PURE__*/jsx(IconButton, {
|
|
7221
|
-
"aria-label": "Close",
|
|
7222
|
-
onClick: onClose,
|
|
7223
|
-
size: "small",
|
|
7224
|
-
children: /*#__PURE__*/jsx(CloseIcon, {})
|
|
7225
|
-
})]
|
|
7226
|
-
}), /*#__PURE__*/jsx(DialogContent, {
|
|
7227
|
-
sx: {
|
|
7228
|
-
pt: 0
|
|
7229
|
-
},
|
|
7230
|
-
children: /*#__PURE__*/jsxs(Box, {
|
|
7231
|
-
sx: {
|
|
7232
|
-
border: BORDER$1,
|
|
7233
|
-
borderRadius: "12px",
|
|
7234
|
-
overflow: "hidden"
|
|
7235
|
-
},
|
|
7236
|
-
children: [/*#__PURE__*/jsx(TableContainer, {
|
|
7237
|
-
children: /*#__PURE__*/jsxs(Table, {
|
|
7238
|
-
children: [/*#__PURE__*/jsx(TableHead, {
|
|
7239
|
-
children: /*#__PURE__*/jsxs(TableRow, {
|
|
7240
|
-
children: [/*#__PURE__*/jsx(TableCell, {
|
|
7241
|
-
sx: headerCellSx$1,
|
|
7242
|
-
children: "Date"
|
|
7243
|
-
}), /*#__PURE__*/jsx(TableCell, {
|
|
7244
|
-
sx: headerCellSx$1,
|
|
7245
|
-
children: "Campaign Name"
|
|
7246
|
-
}), /*#__PURE__*/jsx(TableCell, {
|
|
7247
|
-
sx: headerCellSx$1,
|
|
7248
|
-
children: "Donor Type"
|
|
7249
|
-
}), /*#__PURE__*/jsx(TableCell, {
|
|
7250
|
-
sx: _objectSpread2(_objectSpread2({}, headerCellSx$1), {}, {
|
|
7251
|
-
textAlign: "right"
|
|
7252
|
-
}),
|
|
7253
|
-
children: "Raised"
|
|
7254
|
-
})]
|
|
7255
|
-
})
|
|
7256
|
-
}), /*#__PURE__*/jsx(TableBody, {
|
|
7257
|
-
children: paginatedRows.map(function (row) {
|
|
7258
|
-
return /*#__PURE__*/jsxs(TableRow, {
|
|
7259
|
-
children: [/*#__PURE__*/jsx(TableCell, {
|
|
7260
|
-
sx: cellSx$1,
|
|
7261
|
-
children: row.date
|
|
7262
|
-
}), /*#__PURE__*/jsx(TableCell, {
|
|
7263
|
-
sx: cellSx$1,
|
|
7264
|
-
children: row.campaignName
|
|
7265
|
-
}), /*#__PURE__*/jsx(TableCell, {
|
|
7266
|
-
sx: cellSx$1,
|
|
7267
|
-
children: row.donorType
|
|
7268
|
-
}), /*#__PURE__*/jsx(TableCell, {
|
|
7269
|
-
sx: _objectSpread2(_objectSpread2({}, cellSx$1), {}, {
|
|
7270
|
-
textAlign: "right",
|
|
7271
|
-
fontWeight: 600
|
|
7272
|
-
}),
|
|
7273
|
-
children: row.raised
|
|
7274
|
-
})]
|
|
7275
|
-
}, "".concat(row.date, "-").concat(row.campaignName));
|
|
7276
|
-
})
|
|
7277
|
-
})]
|
|
7278
|
-
})
|
|
7279
|
-
}), /*#__PURE__*/jsxs(Box, {
|
|
7280
|
-
sx: {
|
|
7281
|
-
display: "flex",
|
|
7282
|
-
alignItems: "center",
|
|
7283
|
-
justifyContent: "space-between",
|
|
7284
|
-
px: 2,
|
|
7285
|
-
py: 1.5,
|
|
7286
|
-
borderTop: BORDER$1
|
|
7287
|
-
},
|
|
7288
|
-
children: [/*#__PURE__*/jsxs(Box, {
|
|
7289
|
-
sx: {
|
|
7290
|
-
display: "flex",
|
|
7291
|
-
gap: 0.5
|
|
7292
|
-
},
|
|
7293
|
-
children: [Array.from({
|
|
7294
|
-
length: totalPages
|
|
7295
|
-
}, function (_, index) {
|
|
7296
|
-
return index + 1;
|
|
7297
|
-
}).map(function (pageNumber) {
|
|
7298
|
-
return /*#__PURE__*/jsx(Box, {
|
|
7299
|
-
onClick: function onClick() {
|
|
7300
|
-
return setPage(pageNumber);
|
|
7301
|
-
},
|
|
7302
|
-
sx: {
|
|
7303
|
-
width: 32,
|
|
7304
|
-
height: 32,
|
|
7305
|
-
display: "flex",
|
|
7306
|
-
alignItems: "center",
|
|
7307
|
-
justifyContent: "center",
|
|
7308
|
-
borderRadius: "6px",
|
|
7309
|
-
cursor: "pointer",
|
|
7310
|
-
fontSize: "13px",
|
|
7311
|
-
fontWeight: page === pageNumber ? 700 : 400,
|
|
7312
|
-
bgcolor: page === pageNumber ? "primary.main" : "transparent",
|
|
7313
|
-
color: page === pageNumber ? "#fff" : "#333",
|
|
7314
|
-
border: page === pageNumber ? "none" : "1px solid ".concat(BORDER$1),
|
|
7315
|
-
"&:hover": {
|
|
7316
|
-
bgcolor: page === pageNumber ? "primary.main" : "#f5f5f5"
|
|
7317
|
-
}
|
|
7318
|
-
},
|
|
7319
|
-
children: pageNumber
|
|
7320
|
-
}, pageNumber);
|
|
7321
|
-
}), page < totalPages && /*#__PURE__*/jsx(Box, {
|
|
7322
|
-
onClick: function onClick() {
|
|
7323
|
-
return setPage(function (current) {
|
|
7324
|
-
return Math.min(current + 1, totalPages);
|
|
7325
|
-
});
|
|
7326
|
-
},
|
|
7327
|
-
sx: {
|
|
7328
|
-
px: 1.5,
|
|
7329
|
-
height: 32,
|
|
7330
|
-
display: "flex",
|
|
7331
|
-
alignItems: "center",
|
|
7332
|
-
gap: 0.5,
|
|
7333
|
-
borderRadius: "6px",
|
|
7334
|
-
cursor: "pointer",
|
|
7335
|
-
fontSize: "13px",
|
|
7336
|
-
color: "#333",
|
|
7337
|
-
border: "1px solid ".concat(BORDER$1),
|
|
7338
|
-
"&:hover": {
|
|
7339
|
-
bgcolor: "#f5f5f5"
|
|
7340
|
-
}
|
|
7341
|
-
},
|
|
7342
|
-
children: "Next \u203A"
|
|
7343
|
-
})]
|
|
7344
|
-
}), /*#__PURE__*/jsxs(Typography, {
|
|
7345
|
-
variant: "caption",
|
|
7346
|
-
color: "text.secondary",
|
|
7347
|
-
children: [MOCK_ROWS.length, " records"]
|
|
7348
|
-
})]
|
|
7349
|
-
})]
|
|
7350
|
-
})
|
|
7351
|
-
})]
|
|
7352
|
-
});
|
|
7353
|
-
};
|
|
7354
|
-
|
|
7355
7056
|
var CARD_SX = {
|
|
7356
7057
|
maxHeight: 280
|
|
7357
7058
|
};
|
|
@@ -7399,30 +7100,7 @@ var OverallDetailsGrid = function OverallDetailsGrid(_ref) {
|
|
|
7399
7100
|
_ref.dateName;
|
|
7400
7101
|
var _ref$numberOfDays = _ref.numberOfDays,
|
|
7401
7102
|
numberOfDays = _ref$numberOfDays === void 0 ? 30 : _ref$numberOfDays;
|
|
7402
|
-
var _useState = useState(null),
|
|
7403
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
7404
|
-
modalTitle = _useState2[0],
|
|
7405
|
-
setModalTitle = _useState2[1];
|
|
7406
7103
|
var daysLabel = "".concat(numberOfDays, " day").concat(numberOfDays === 1 ? "" : "s");
|
|
7407
|
-
var openDetailModal = function openDetailModal(title) {
|
|
7408
|
-
if (!exportMode) {
|
|
7409
|
-
setModalTitle(title);
|
|
7410
|
-
}
|
|
7411
|
-
};
|
|
7412
|
-
var closeDetailModal = function closeDetailModal() {
|
|
7413
|
-
return setModalTitle(null);
|
|
7414
|
-
};
|
|
7415
|
-
var withCardClick = function withCardClick(title, card) {
|
|
7416
|
-
return exportMode ? card : /*#__PURE__*/jsx(Box, {
|
|
7417
|
-
onClick: function onClick() {
|
|
7418
|
-
return openDetailModal(title);
|
|
7419
|
-
},
|
|
7420
|
-
sx: {
|
|
7421
|
-
display: "contents"
|
|
7422
|
-
},
|
|
7423
|
-
children: card
|
|
7424
|
-
});
|
|
7425
|
-
};
|
|
7426
7104
|
var _donorMix$newDonors = donorMix.newDonors,
|
|
7427
7105
|
newDonors = _donorMix$newDonors === void 0 ? 0 : _donorMix$newDonors,
|
|
7428
7106
|
_donorMix$returningDo = donorMix.returningDonors,
|
|
@@ -7485,12 +7163,12 @@ var OverallDetailsGrid = function OverallDetailsGrid(_ref) {
|
|
|
7485
7163
|
sx: {
|
|
7486
7164
|
paddingTop: "0px !important"
|
|
7487
7165
|
},
|
|
7488
|
-
children:
|
|
7166
|
+
children: /*#__PURE__*/jsx(ActiveCampaignsCard, {
|
|
7489
7167
|
title: "Active Campaigns",
|
|
7490
7168
|
subtitle: "Live fundraisers ranked by velocity",
|
|
7491
7169
|
columns: ["Campaign", "Raised", "Progress", "Donors", "Avg gift"],
|
|
7492
7170
|
rows: activeCampaignsRows
|
|
7493
|
-
})
|
|
7171
|
+
})
|
|
7494
7172
|
}), /*#__PURE__*/jsx(Grid, {
|
|
7495
7173
|
item: true,
|
|
7496
7174
|
xs: 12,
|
|
@@ -7503,7 +7181,7 @@ var OverallDetailsGrid = function OverallDetailsGrid(_ref) {
|
|
|
7503
7181
|
md: 0
|
|
7504
7182
|
}
|
|
7505
7183
|
},
|
|
7506
|
-
children:
|
|
7184
|
+
children: /*#__PURE__*/jsx(DonorMixCard, {
|
|
7507
7185
|
title: "Donor Mix",
|
|
7508
7186
|
subtitle: "Acquisition vs retention",
|
|
7509
7187
|
series: [newDonors, returningDonors],
|
|
@@ -7525,29 +7203,29 @@ var OverallDetailsGrid = function OverallDetailsGrid(_ref) {
|
|
|
7525
7203
|
sx: {
|
|
7526
7204
|
width: "100%"
|
|
7527
7205
|
}
|
|
7528
|
-
})
|
|
7206
|
+
})
|
|
7529
7207
|
})]
|
|
7530
7208
|
});
|
|
7531
7209
|
var middleCards = /*#__PURE__*/jsxs(Fragment, {
|
|
7532
|
-
children: [
|
|
7210
|
+
children: [/*#__PURE__*/jsx(DonationTypeBarChart, {
|
|
7533
7211
|
sx: CARD_SX,
|
|
7534
7212
|
donationTypeData: donationTypeData
|
|
7535
|
-
})
|
|
7213
|
+
}), /*#__PURE__*/jsx(PaidDonorGeographyCard, {
|
|
7536
7214
|
sx: CARD_SX,
|
|
7537
7215
|
donorGeographyData: donorGeographyData
|
|
7538
|
-
})
|
|
7216
|
+
}), /*#__PURE__*/jsx(RefundsChargebacksCard, {
|
|
7539
7217
|
sx: CARD_SX,
|
|
7540
7218
|
refundsChargebacksData: refundsChargebacksData,
|
|
7541
7219
|
numberOfDays: numberOfDays
|
|
7542
|
-
})
|
|
7220
|
+
}), /*#__PURE__*/jsx(TrafficSourceCard, {
|
|
7543
7221
|
sx: CARD_SX,
|
|
7544
7222
|
trafficSourceData: (trafficSourceData === null || trafficSourceData === void 0 ? void 0 : trafficSourceData.data) || [],
|
|
7545
7223
|
total: "$".concat(formatNumber((trafficSourceData === null || trafficSourceData === void 0 ? void 0 : trafficSourceData.totalRevenue) || 0)),
|
|
7546
7224
|
numberOfDays: numberOfDays
|
|
7547
|
-
})
|
|
7225
|
+
})]
|
|
7548
7226
|
});
|
|
7549
7227
|
var bottomCards = /*#__PURE__*/jsxs(Fragment, {
|
|
7550
|
-
children: [
|
|
7228
|
+
children: [/*#__PURE__*/jsx(MetricSparklineCard, {
|
|
7551
7229
|
title: "Order Bump",
|
|
7552
7230
|
subtitle: "Revenue trend - last ".concat(daysLabel),
|
|
7553
7231
|
value: "$".concat(formatNumber((orderBumpData === null || orderBumpData === void 0 ? void 0 : orderBumpData.totalRevenue) || 0)),
|
|
@@ -7572,7 +7250,7 @@ var OverallDetailsGrid = function OverallDetailsGrid(_ref) {
|
|
|
7572
7250
|
}],
|
|
7573
7251
|
sx: CARD_SX,
|
|
7574
7252
|
bottomSection: true
|
|
7575
|
-
})
|
|
7253
|
+
}), /*#__PURE__*/jsx(MetricDonutCard, {
|
|
7576
7254
|
title: "Upsell",
|
|
7577
7255
|
subtitle: "Acceptance & raised",
|
|
7578
7256
|
acceptanceRate: (upsellData === null || upsellData === void 0 ? void 0 : upsellData.acceptanceRate) || 0,
|
|
@@ -7581,7 +7259,7 @@ var OverallDetailsGrid = function OverallDetailsGrid(_ref) {
|
|
|
7581
7259
|
raisedVal: "$".concat(formatNumber((upsellData === null || upsellData === void 0 ? void 0 : upsellData.raised) || 0)),
|
|
7582
7260
|
raisedTrend: "".concat((upsellData === null || upsellData === void 0 ? void 0 : upsellData.raisedGrowth) >= 0 ? "▲" : "▼", " ").concat(Math.abs((upsellData === null || upsellData === void 0 ? void 0 : upsellData.raisedGrowth) || 0).toFixed(1), "%"),
|
|
7583
7261
|
sx: CARD_SX
|
|
7584
|
-
})
|
|
7262
|
+
}), /*#__PURE__*/jsx(MetricDonutCard, {
|
|
7585
7263
|
title: "Downsell",
|
|
7586
7264
|
subtitle: "Acceptance & raised",
|
|
7587
7265
|
acceptanceRate: (downsellData === null || downsellData === void 0 ? void 0 : downsellData.acceptanceRate) || 0,
|
|
@@ -7590,7 +7268,7 @@ var OverallDetailsGrid = function OverallDetailsGrid(_ref) {
|
|
|
7590
7268
|
raisedVal: "$".concat(formatNumber((downsellData === null || downsellData === void 0 ? void 0 : downsellData.raised) || 0)),
|
|
7591
7269
|
raisedTrend: "".concat((downsellData === null || downsellData === void 0 ? void 0 : downsellData.raisedGrowth) >= 0 ? "▲" : "▼", " ").concat(Math.abs((downsellData === null || downsellData === void 0 ? void 0 : downsellData.raisedGrowth) || 0).toFixed(1), "%"),
|
|
7592
7270
|
sx: CARD_SX
|
|
7593
|
-
})
|
|
7271
|
+
}), /*#__PURE__*/jsx(MetricSparklineCard, {
|
|
7594
7272
|
title: "Referrals",
|
|
7595
7273
|
subtitle: "Revenue trend - last ".concat(daysLabel),
|
|
7596
7274
|
value: "$".concat(formatNumber((referralData === null || referralData === void 0 ? void 0 : referralData.totalRevenue) || 0)),
|
|
@@ -7614,32 +7292,27 @@ var OverallDetailsGrid = function OverallDetailsGrid(_ref) {
|
|
|
7614
7292
|
}],
|
|
7615
7293
|
sx: CARD_SX,
|
|
7616
7294
|
bottomSection: true
|
|
7617
|
-
})
|
|
7618
|
-
});
|
|
7619
|
-
var detailModal = /*#__PURE__*/jsx(OverallDetailModal, {
|
|
7620
|
-
open: Boolean(modalTitle),
|
|
7621
|
-
title: modalTitle || "",
|
|
7622
|
-
onClose: closeDetailModal
|
|
7295
|
+
})]
|
|
7623
7296
|
});
|
|
7624
7297
|
if (section === "campaigns") {
|
|
7625
|
-
return /*#__PURE__*/
|
|
7626
|
-
children:
|
|
7298
|
+
return /*#__PURE__*/jsx(Box, {
|
|
7299
|
+
children: campaignsRow
|
|
7627
7300
|
});
|
|
7628
7301
|
}
|
|
7629
7302
|
if (section === "middle") {
|
|
7630
|
-
return /*#__PURE__*/
|
|
7631
|
-
children:
|
|
7303
|
+
return /*#__PURE__*/jsx(Box, {
|
|
7304
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
7632
7305
|
sx: fourColGridSx$1(exportMode),
|
|
7633
7306
|
children: middleCards
|
|
7634
|
-
})
|
|
7307
|
+
})
|
|
7635
7308
|
});
|
|
7636
7309
|
}
|
|
7637
7310
|
if (section === "bottom") {
|
|
7638
|
-
return /*#__PURE__*/
|
|
7639
|
-
children:
|
|
7311
|
+
return /*#__PURE__*/jsx(Box, {
|
|
7312
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
7640
7313
|
sx: fourColGridSx$1(exportMode),
|
|
7641
7314
|
children: bottomCards
|
|
7642
|
-
})
|
|
7315
|
+
})
|
|
7643
7316
|
});
|
|
7644
7317
|
}
|
|
7645
7318
|
return /*#__PURE__*/jsxs(Box, {
|
|
@@ -7649,7 +7322,7 @@ var OverallDetailsGrid = function OverallDetailsGrid(_ref) {
|
|
|
7649
7322
|
}), /*#__PURE__*/jsx(Box, {
|
|
7650
7323
|
sx: fourColGridSx$1(exportMode),
|
|
7651
7324
|
children: bottomCards
|
|
7652
|
-
})
|
|
7325
|
+
})]
|
|
7653
7326
|
});
|
|
7654
7327
|
};
|
|
7655
7328
|
|
|
@@ -17997,34 +17670,38 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
17997
17670
|
var getExtendedCharts = function getExtendedCharts() {
|
|
17998
17671
|
var charts = _toConsumableArray(allCharts);
|
|
17999
17672
|
var categories = (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || [];
|
|
17673
|
+
var zeroData = categories.length > 0 ? categories.map(function () {
|
|
17674
|
+
return 0;
|
|
17675
|
+
}) : [0];
|
|
18000
17676
|
if (!charts.find(function (c) {
|
|
18001
17677
|
return c.label === "Net Raised";
|
|
18002
17678
|
})) {
|
|
17679
|
+
var _apiData$netRaised;
|
|
18003
17680
|
charts.push({
|
|
18004
17681
|
label: "Net Raised",
|
|
18005
|
-
value: (apiData === null || apiData === void 0 ? void 0 : apiData.netRaised)
|
|
18006
|
-
data:
|
|
18007
|
-
return v * 0.92;
|
|
18008
|
-
}),
|
|
17682
|
+
value: (_apiData$netRaised = apiData === null || apiData === void 0 ? void 0 : apiData.netRaised) !== null && _apiData$netRaised !== void 0 ? _apiData$netRaised : "$0",
|
|
17683
|
+
data: zeroData,
|
|
18009
17684
|
categories: categories
|
|
18010
17685
|
});
|
|
18011
17686
|
}
|
|
18012
17687
|
if (!charts.find(function (c) {
|
|
18013
17688
|
return c.label === "Total Donors";
|
|
18014
17689
|
})) {
|
|
17690
|
+
var _apiData$totalDonors;
|
|
18015
17691
|
charts.push({
|
|
18016
17692
|
label: "Total Donors",
|
|
18017
|
-
value: (apiData === null || apiData === void 0 ? void 0 : apiData.totalDonors)
|
|
18018
|
-
data:
|
|
17693
|
+
value: (_apiData$totalDonors = apiData === null || apiData === void 0 ? void 0 : apiData.totalDonors) !== null && _apiData$totalDonors !== void 0 ? _apiData$totalDonors : "0",
|
|
17694
|
+
data: zeroData,
|
|
18019
17695
|
categories: categories
|
|
18020
17696
|
});
|
|
18021
17697
|
}
|
|
18022
17698
|
if (!charts.find(function (c) {
|
|
18023
17699
|
return c.label === "ROAS";
|
|
18024
17700
|
})) {
|
|
17701
|
+
var _apiData$roas;
|
|
18025
17702
|
charts.push({
|
|
18026
17703
|
label: "ROAS",
|
|
18027
|
-
value: (apiData === null || apiData === void 0 ? void 0 : apiData.roas)
|
|
17704
|
+
value: (_apiData$roas = apiData === null || apiData === void 0 ? void 0 : apiData.roas) !== null && _apiData$roas !== void 0 ? _apiData$roas : "0.0x",
|
|
18028
17705
|
data: [],
|
|
18029
17706
|
categories: categories
|
|
18030
17707
|
});
|
|
@@ -18634,9 +18311,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18634
18311
|
if (!hasPaidOverview) {
|
|
18635
18312
|
return {
|
|
18636
18313
|
"Total Spent": {
|
|
18637
|
-
value: "$".concat(formatNumber(
|
|
18638
|
-
subValue:
|
|
18639
|
-
data:
|
|
18314
|
+
value: "$".concat(formatNumber(0)),
|
|
18315
|
+
subValue: formatGrowth$2(0),
|
|
18316
|
+
data: flatSeries(0),
|
|
18640
18317
|
categories: fallbackCategories,
|
|
18641
18318
|
icon: /*#__PURE__*/jsx(IndeterminateCheckBoxOutlined, {}),
|
|
18642
18319
|
money: true,
|
|
@@ -18644,9 +18321,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18644
18321
|
warning: false
|
|
18645
18322
|
},
|
|
18646
18323
|
"Revinue Raised": {
|
|
18647
|
-
value: "$".concat(formatNumber(
|
|
18648
|
-
subValue:
|
|
18649
|
-
data:
|
|
18324
|
+
value: "$".concat(formatNumber(0)),
|
|
18325
|
+
subValue: formatGrowth$2(0),
|
|
18326
|
+
data: flatSeries(0),
|
|
18650
18327
|
categories: fallbackCategories,
|
|
18651
18328
|
icon: /*#__PURE__*/jsx(PaidOutlined, {}),
|
|
18652
18329
|
money: true,
|
|
@@ -18654,9 +18331,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18654
18331
|
warning: false
|
|
18655
18332
|
},
|
|
18656
18333
|
ROAS: {
|
|
18657
|
-
value: "
|
|
18658
|
-
subValue:
|
|
18659
|
-
data:
|
|
18334
|
+
value: "0.0x",
|
|
18335
|
+
subValue: formatGrowth$2(0),
|
|
18336
|
+
data: flatSeries(0),
|
|
18660
18337
|
categories: fallbackCategories,
|
|
18661
18338
|
icon: /*#__PURE__*/jsx(TrendingUp, {}),
|
|
18662
18339
|
money: false,
|
|
@@ -18664,9 +18341,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18664
18341
|
warning: false
|
|
18665
18342
|
},
|
|
18666
18343
|
"Cost Per Donor": {
|
|
18667
|
-
value: "$".concat(formatNumber(
|
|
18668
|
-
subValue:
|
|
18669
|
-
data:
|
|
18344
|
+
value: "$".concat(formatNumber(0)),
|
|
18345
|
+
subValue: formatGrowth$2(0),
|
|
18346
|
+
data: flatSeries(0),
|
|
18670
18347
|
categories: fallbackCategories,
|
|
18671
18348
|
icon: /*#__PURE__*/jsx(PersonOutlined, {}),
|
|
18672
18349
|
money: true,
|
|
@@ -18674,9 +18351,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18674
18351
|
warning: false
|
|
18675
18352
|
},
|
|
18676
18353
|
"Conversion Rate": {
|
|
18677
|
-
value: "
|
|
18678
|
-
subValue:
|
|
18679
|
-
data:
|
|
18354
|
+
value: "0.00%",
|
|
18355
|
+
subValue: formatGrowth$2(0),
|
|
18356
|
+
data: flatSeries(0),
|
|
18680
18357
|
categories: fallbackCategories,
|
|
18681
18358
|
icon: /*#__PURE__*/jsx(ConversionRateIcon, {}),
|
|
18682
18359
|
money: false,
|
|
@@ -18684,9 +18361,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18684
18361
|
warning: false
|
|
18685
18362
|
},
|
|
18686
18363
|
"Avg Donation": {
|
|
18687
|
-
value: "$".concat(formatNumber(
|
|
18688
|
-
subValue:
|
|
18689
|
-
data:
|
|
18364
|
+
value: "$".concat(formatNumber(0)),
|
|
18365
|
+
subValue: formatGrowth$2(0),
|
|
18366
|
+
data: flatSeries(0),
|
|
18690
18367
|
categories: fallbackCategories,
|
|
18691
18368
|
icon: /*#__PURE__*/jsx(AverageDonationIcon, {}),
|
|
18692
18369
|
money: true,
|
|
@@ -18761,7 +18438,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18761
18438
|
}, [fallbackCategories, growth, hasPaidOverview, overview, revenueSeries, roasChartData, spendSeries]);
|
|
18762
18439
|
var channelRows = useMemo(function () {
|
|
18763
18440
|
var channels = apiData === null || apiData === void 0 ? void 0 : apiData.channelPerformance;
|
|
18764
|
-
if (!hasPaidOverview) return
|
|
18441
|
+
if (!hasPaidOverview) return [];
|
|
18765
18442
|
if (!Array.isArray(channels) || channels.length === 0) return [];
|
|
18766
18443
|
return channels.map(function (item) {
|
|
18767
18444
|
var _item$roas, _item$spend, _item$revenue, _item$cpa;
|
|
@@ -18783,7 +18460,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18783
18460
|
var spendAllocation = useMemo(function () {
|
|
18784
18461
|
var _allocation$totalSpen, _allocation$totalSpen2;
|
|
18785
18462
|
var allocation = apiData === null || apiData === void 0 ? void 0 : apiData.spendAllocation;
|
|
18786
|
-
if (!hasPaidOverview) return
|
|
18463
|
+
if (!hasPaidOverview) return [];
|
|
18787
18464
|
if (!allocation || !Array.isArray(allocation.data) || allocation.data.length === 0) {
|
|
18788
18465
|
return buildEmptySpendAllocation();
|
|
18789
18466
|
}
|
|
@@ -18825,7 +18502,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18825
18502
|
}, [apiData === null || apiData === void 0 ? void 0 : apiData.spendAllocation, hasPaidOverview]);
|
|
18826
18503
|
var topCampaignsData = useMemo(function () {
|
|
18827
18504
|
var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaigns;
|
|
18828
|
-
if (!hasPaidOverview) return
|
|
18505
|
+
if (!hasPaidOverview) return [];
|
|
18829
18506
|
if (!Array.isArray(campaigns)) return [];
|
|
18830
18507
|
if (campaigns.length === 0) return [];
|
|
18831
18508
|
return campaigns.map(function (item) {
|
|
@@ -18859,8 +18536,11 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18859
18536
|
},
|
|
18860
18537
|
sx: metricInfo[title].error ? {
|
|
18861
18538
|
border: "2px solid #ef4444",
|
|
18862
|
-
bgcolor: "#fffafa"
|
|
18863
|
-
|
|
18539
|
+
bgcolor: "#fffafa",
|
|
18540
|
+
cursor: "pointer"
|
|
18541
|
+
} : {
|
|
18542
|
+
cursor: "pointer"
|
|
18543
|
+
}
|
|
18864
18544
|
});
|
|
18865
18545
|
};
|
|
18866
18546
|
var selectedInfo = metricInfo[activeMetric] || metricInfo["Total Spent"];
|
|
@@ -18928,72 +18608,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18928
18608
|
columns: ["Channel", "Ppend", "Revenue", "ROAS", "CPA", "Trend"],
|
|
18929
18609
|
gridTemplateColumns: "2.2fr 1fr 1fr 0.8fr 0.8fr 1.2fr",
|
|
18930
18610
|
height: "100%",
|
|
18931
|
-
rows: channelRows !== null && channelRows !== void 0 ? channelRows :
|
|
18932
|
-
id: "M",
|
|
18933
|
-
avatarBg: "#4267B2",
|
|
18934
|
-
name: "Meta Ads",
|
|
18935
|
-
val1: "$32,800",
|
|
18936
|
-
val2: "$112,400",
|
|
18937
|
-
val3: "3.4x",
|
|
18938
|
-
val4: "$340",
|
|
18939
|
-
type: "trend",
|
|
18940
|
-
trendType: "up",
|
|
18941
|
-
trendLabel: "Improving",
|
|
18942
|
-
highlightVal3: true,
|
|
18943
|
-
val3Color: "#22C55E"
|
|
18944
|
-
}, {
|
|
18945
|
-
id: "G",
|
|
18946
|
-
avatarBg: "#4285F4",
|
|
18947
|
-
name: "Google Ads",
|
|
18948
|
-
val1: "$28,200",
|
|
18949
|
-
val2: "$78,300",
|
|
18950
|
-
val3: "2.8x",
|
|
18951
|
-
val4: "$385",
|
|
18952
|
-
type: "trend",
|
|
18953
|
-
trendType: "up",
|
|
18954
|
-
trendLabel: "Improving",
|
|
18955
|
-
highlightVal3: true,
|
|
18956
|
-
val3Color: "#22C55E"
|
|
18957
|
-
}, {
|
|
18958
|
-
id: "T",
|
|
18959
|
-
avatarBg: "#000000",
|
|
18960
|
-
name: "TikTok Ads",
|
|
18961
|
-
val1: "$11,400",
|
|
18962
|
-
val2: "$31,200",
|
|
18963
|
-
val3: "2.7x",
|
|
18964
|
-
val4: "$402",
|
|
18965
|
-
type: "trend",
|
|
18966
|
-
trendType: "up",
|
|
18967
|
-
trendLabel: "Improving",
|
|
18968
|
-
highlightVal3: true,
|
|
18969
|
-
val3Color: "#22C55E"
|
|
18970
|
-
}, {
|
|
18971
|
-
id: "Y",
|
|
18972
|
-
avatarBg: "#FF0000",
|
|
18973
|
-
name: "YouTube",
|
|
18974
|
-
val1: "$5,313",
|
|
18975
|
-
val2: "$12,600",
|
|
18976
|
-
val3: "2.4x",
|
|
18977
|
-
val4: "$443",
|
|
18978
|
-
type: "trend",
|
|
18979
|
-
trendType: "down",
|
|
18980
|
-
trendLabel: "Declining",
|
|
18981
|
-
highlightVal3: true,
|
|
18982
|
-
val3Color: "#EF4444"
|
|
18983
|
-
}, {
|
|
18984
|
-
id: "S",
|
|
18985
|
-
avatarBg: "#FFFC00",
|
|
18986
|
-
name: "Snapchat",
|
|
18987
|
-
val1: "$2,600",
|
|
18988
|
-
val2: "$6,438",
|
|
18989
|
-
val3: "2.5x",
|
|
18990
|
-
val4: "$418",
|
|
18991
|
-
type: "trend",
|
|
18992
|
-
trendType: "up",
|
|
18993
|
-
trendLabel: "Improving",
|
|
18994
|
-
highlightVal3: true,
|
|
18995
|
-
val3Color: "#22C55E"
|
|
18996
|
-
}]
|
|
18611
|
+
rows: channelRows !== null && channelRows !== void 0 ? channelRows : []
|
|
18997
18612
|
})
|
|
18998
18613
|
}), /*#__PURE__*/jsx(Grid, {
|
|
18999
18614
|
item: true,
|
|
@@ -19013,33 +18628,13 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
19013
18628
|
},
|
|
19014
18629
|
children: /*#__PURE__*/jsx(DonorMixCard, {
|
|
19015
18630
|
title: "Spend Allocation",
|
|
19016
|
-
subtitle: (_spendAllocation$subt = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.subtitle) !== null && _spendAllocation$subt !== void 0 ? _spendAllocation$subt :
|
|
19017
|
-
series: (_spendAllocation$seri = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.series) !== null && _spendAllocation$seri !== void 0 ? _spendAllocation$seri :
|
|
19018
|
-
labels: (_spendAllocation$labe = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.labels) !== null && _spendAllocation$labe !== void 0 ? _spendAllocation$labe :
|
|
19019
|
-
colors: (_spendAllocation$colo = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.colors) !== null && _spendAllocation$colo !== void 0 ? _spendAllocation$colo :
|
|
18631
|
+
subtitle: (_spendAllocation$subt = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.subtitle) !== null && _spendAllocation$subt !== void 0 ? _spendAllocation$subt : emptySpendAllocation.subtitle,
|
|
18632
|
+
series: (_spendAllocation$seri = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.series) !== null && _spendAllocation$seri !== void 0 ? _spendAllocation$seri : emptySpendAllocation.series,
|
|
18633
|
+
labels: (_spendAllocation$labe = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.labels) !== null && _spendAllocation$labe !== void 0 ? _spendAllocation$labe : emptySpendAllocation.labels,
|
|
18634
|
+
colors: (_spendAllocation$colo = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.colors) !== null && _spendAllocation$colo !== void 0 ? _spendAllocation$colo : emptySpendAllocation.colors,
|
|
19020
18635
|
centerLabel: (_spendAllocation$cent = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.centerLabel) !== null && _spendAllocation$cent !== void 0 ? _spendAllocation$cent : "total spend",
|
|
19021
|
-
centerValue: (_spendAllocation$cent2 = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.centerValue) !== null && _spendAllocation$cent2 !== void 0 ? _spendAllocation$cent2 :
|
|
19022
|
-
items: (_spendAllocation$item = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.items) !== null && _spendAllocation$item !== void 0 ? _spendAllocation$item :
|
|
19023
|
-
label: "Meta Ads",
|
|
19024
|
-
val: "40.8%",
|
|
19025
|
-
color: "#4267B2"
|
|
19026
|
-
}, {
|
|
19027
|
-
label: "Google Ads",
|
|
19028
|
-
val: "35.1%",
|
|
19029
|
-
color: "#4285F4"
|
|
19030
|
-
}, {
|
|
19031
|
-
label: "TikTok",
|
|
19032
|
-
val: "14.2%",
|
|
19033
|
-
color: "#cd249dff"
|
|
19034
|
-
}, {
|
|
19035
|
-
label: "YouTube",
|
|
19036
|
-
val: "6.6%",
|
|
19037
|
-
color: "#FF0000"
|
|
19038
|
-
}, {
|
|
19039
|
-
label: "Snapchat",
|
|
19040
|
-
val: "3.3%",
|
|
19041
|
-
color: "#FFFC00"
|
|
19042
|
-
}],
|
|
18636
|
+
centerValue: (_spendAllocation$cent2 = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.centerValue) !== null && _spendAllocation$cent2 !== void 0 ? _spendAllocation$cent2 : emptySpendAllocation.centerValue,
|
|
18637
|
+
items: (_spendAllocation$item = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.items) !== null && _spendAllocation$item !== void 0 ? _spendAllocation$item : emptySpendAllocation.items,
|
|
19043
18638
|
showBottomSummary: false,
|
|
19044
18639
|
sx: {
|
|
19045
18640
|
pb: 3.5,
|
|
@@ -19067,7 +18662,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
19067
18662
|
width: "100%"
|
|
19068
18663
|
},
|
|
19069
18664
|
children: /*#__PURE__*/jsx(TopPerformingCampaignsCard, {
|
|
19070
|
-
data: topCampaignsData !== null && topCampaignsData !== void 0 ? topCampaignsData :
|
|
18665
|
+
data: topCampaignsData !== null && topCampaignsData !== void 0 ? topCampaignsData : []
|
|
19071
18666
|
})
|
|
19072
18667
|
})
|
|
19073
18668
|
}), /*#__PURE__*/jsx(Grid, {
|
|
@@ -19142,6 +18737,12 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19142
18737
|
var revenueSeries = mapTimeSeries$1(apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue);
|
|
19143
18738
|
var avgDonationSeries = mapTimeSeries$1(apiData === null || apiData === void 0 ? void 0 : apiData.avgDonations);
|
|
19144
18739
|
var fallbackCategories = organicUsersSeries.categories.length ? organicUsersSeries.categories : ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
18740
|
+
var flatZeroData = function flatZeroData() {
|
|
18741
|
+
var categories = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : fallbackCategories;
|
|
18742
|
+
return categories.length > 0 ? categories.map(function () {
|
|
18743
|
+
return 0;
|
|
18744
|
+
}) : [0];
|
|
18745
|
+
};
|
|
19145
18746
|
var growthCaption = function growthCaption(key) {
|
|
19146
18747
|
return formatGrowth$1(growth[key]);
|
|
19147
18748
|
};
|
|
@@ -19150,9 +18751,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19150
18751
|
if (!hasOrganicOverview) {
|
|
19151
18752
|
return {
|
|
19152
18753
|
"Organic Users": {
|
|
19153
|
-
value:
|
|
19154
|
-
subValue:
|
|
19155
|
-
data:
|
|
18754
|
+
value: formatNumber(0),
|
|
18755
|
+
subValue: formatGrowth$1(0),
|
|
18756
|
+
data: flatZeroData(),
|
|
19156
18757
|
categories: fallbackCategories,
|
|
19157
18758
|
icon: /*#__PURE__*/jsx(PeopleAltOutlined, {}),
|
|
19158
18759
|
money: false,
|
|
@@ -19160,9 +18761,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19160
18761
|
error: false
|
|
19161
18762
|
},
|
|
19162
18763
|
"Search Clicks": {
|
|
19163
|
-
value:
|
|
19164
|
-
subValue:
|
|
19165
|
-
data:
|
|
18764
|
+
value: formatNumber(0),
|
|
18765
|
+
subValue: formatGrowth$1(0),
|
|
18766
|
+
data: flatZeroData(),
|
|
19166
18767
|
categories: fallbackCategories,
|
|
19167
18768
|
icon: /*#__PURE__*/jsx(SearchOutlined, {}),
|
|
19168
18769
|
money: false,
|
|
@@ -19170,9 +18771,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19170
18771
|
error: false
|
|
19171
18772
|
},
|
|
19172
18773
|
Donations: {
|
|
19173
|
-
value:
|
|
19174
|
-
subValue:
|
|
19175
|
-
data:
|
|
18774
|
+
value: formatNumber(0),
|
|
18775
|
+
subValue: formatGrowth$1(0),
|
|
18776
|
+
data: flatZeroData(),
|
|
19176
18777
|
categories: fallbackCategories,
|
|
19177
18778
|
icon: /*#__PURE__*/jsx(FavoriteOutlined, {}),
|
|
19178
18779
|
money: false,
|
|
@@ -19180,9 +18781,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19180
18781
|
error: false
|
|
19181
18782
|
},
|
|
19182
18783
|
"Conversion Rate": {
|
|
19183
|
-
value: "
|
|
19184
|
-
subValue:
|
|
19185
|
-
data:
|
|
18784
|
+
value: "0.00%",
|
|
18785
|
+
subValue: formatGrowth$1(0),
|
|
18786
|
+
data: flatZeroData(),
|
|
19186
18787
|
categories: fallbackCategories,
|
|
19187
18788
|
icon: /*#__PURE__*/jsx(ConversionRateIcon, {}),
|
|
19188
18789
|
money: false,
|
|
@@ -19190,9 +18791,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19190
18791
|
error: false
|
|
19191
18792
|
},
|
|
19192
18793
|
"Revenue Raised": {
|
|
19193
|
-
value: "$".concat(formatNumber(
|
|
19194
|
-
subValue:
|
|
19195
|
-
data:
|
|
18794
|
+
value: "$".concat(formatNumber(0)),
|
|
18795
|
+
subValue: formatGrowth$1(0),
|
|
18796
|
+
data: flatZeroData(),
|
|
19196
18797
|
categories: fallbackCategories,
|
|
19197
18798
|
icon: /*#__PURE__*/jsx(PaidOutlined, {}),
|
|
19198
18799
|
money: true,
|
|
@@ -19200,9 +18801,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19200
18801
|
error: false
|
|
19201
18802
|
},
|
|
19202
18803
|
"Avg Donation": {
|
|
19203
|
-
value: "$".concat(formatNumber(
|
|
19204
|
-
subValue:
|
|
19205
|
-
data:
|
|
18804
|
+
value: "$".concat(formatNumber(0)),
|
|
18805
|
+
subValue: formatGrowth$1(0),
|
|
18806
|
+
data: flatZeroData(),
|
|
19206
18807
|
categories: fallbackCategories,
|
|
19207
18808
|
icon: /*#__PURE__*/jsx(AverageDonationIcon, {}),
|
|
19208
18809
|
money: true,
|
|
@@ -19286,7 +18887,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19286
18887
|
}, [apiData === null || apiData === void 0 || (_apiData$topOrganicKe2 = apiData.topOrganicKeywords) === null || _apiData$topOrganicKe2 === void 0 ? void 0 : _apiData$topOrganicKe2.available, conversionSeries, donationsSeries, fallbackCategories, growth, hasOrganicOverview, organicUsersSeries, overview, dateName]);
|
|
19287
18888
|
var landingPagesData = useMemo(function () {
|
|
19288
18889
|
var pages = apiData === null || apiData === void 0 ? void 0 : apiData.topLandingPages;
|
|
19289
|
-
if (!hasOrganicOverview) return
|
|
18890
|
+
if (!hasOrganicOverview) return [];
|
|
19290
18891
|
if (!Array.isArray(pages) || pages.length === 0) return [];
|
|
19291
18892
|
return pages.map(function (item) {
|
|
19292
18893
|
var _item$visitors, _item$donations, _item$revenue, _item$conversionRate;
|
|
@@ -19301,7 +18902,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19301
18902
|
}, [apiData === null || apiData === void 0 ? void 0 : apiData.topLandingPages, hasOrganicOverview]);
|
|
19302
18903
|
var keywordsData = useMemo(function () {
|
|
19303
18904
|
var keywords = apiData === null || apiData === void 0 ? void 0 : apiData.topOrganicKeywords;
|
|
19304
|
-
if (!hasOrganicOverview) return
|
|
18905
|
+
if (!hasOrganicOverview) return [];
|
|
19305
18906
|
if (!(keywords !== null && keywords !== void 0 && keywords.available) || !Array.isArray(keywords.data) || keywords.data.length === 0) {
|
|
19306
18907
|
return [];
|
|
19307
18908
|
}
|
|
@@ -19319,7 +18920,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19319
18920
|
var geographyData = useMemo(function () {
|
|
19320
18921
|
var _apiData$geographyIns;
|
|
19321
18922
|
var countries = apiData === null || apiData === void 0 || (_apiData$geographyIns = apiData.geographyInsights) === null || _apiData$geographyIns === void 0 ? void 0 : _apiData$geographyIns.countries;
|
|
19322
|
-
if (!hasOrganicOverview) return
|
|
18923
|
+
if (!hasOrganicOverview) return [];
|
|
19323
18924
|
if (!Array.isArray(countries) || countries.length === 0) return [];
|
|
19324
18925
|
return countries.map(function (item) {
|
|
19325
18926
|
var _item$visitors2, _item$percentage, _item$percentage2;
|
|
@@ -19334,7 +18935,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19334
18935
|
var _breakdown$totalVisit;
|
|
19335
18936
|
var breakdown = apiData === null || apiData === void 0 ? void 0 : apiData.sourceBreakdown;
|
|
19336
18937
|
var sources = breakdown === null || breakdown === void 0 ? void 0 : breakdown.data;
|
|
19337
|
-
if (!hasOrganicOverview) return
|
|
18938
|
+
if (!hasOrganicOverview) return [];
|
|
19338
18939
|
if (!Array.isArray(sources) || sources.length === 0) return null;
|
|
19339
18940
|
var colors = sources.map(function (_, index) {
|
|
19340
18941
|
return SOURCE_COLORS[index % SOURCE_COLORS.length];
|
|
@@ -19449,28 +19050,12 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19449
19050
|
children: /*#__PURE__*/jsx(DonorMixCard, {
|
|
19450
19051
|
title: "Source Breakdown",
|
|
19451
19052
|
subtitle: "Where organic visitors come from",
|
|
19452
|
-
series: (_sourceBreakdown$seri = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.series) !== null && _sourceBreakdown$seri !== void 0 ? _sourceBreakdown$seri : [
|
|
19453
|
-
labels: (_sourceBreakdown$labe = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.labels) !== null && _sourceBreakdown$labe !== void 0 ? _sourceBreakdown$labe : ["
|
|
19454
|
-
colors: (_sourceBreakdown$colo = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.colors) !== null && _sourceBreakdown$colo !== void 0 ? _sourceBreakdown$colo : ["#
|
|
19455
|
-
centerLabel: (_sourceBreakdown$cent = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.centerLabel) !== null && _sourceBreakdown$cent !== void 0 ? _sourceBreakdown$cent : "
|
|
19456
|
-
centerValue: (_sourceBreakdown$cent2 = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.centerValue) !== null && _sourceBreakdown$cent2 !== void 0 ? _sourceBreakdown$cent2 : "
|
|
19457
|
-
items: (_sourceBreakdown$item = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.items) !== null && _sourceBreakdown$item !== void 0 ? _sourceBreakdown$item : [
|
|
19458
|
-
label: "Google Search",
|
|
19459
|
-
val: "40.8%",
|
|
19460
|
-
color: "#4267B2"
|
|
19461
|
-
}, {
|
|
19462
|
-
label: "Direct",
|
|
19463
|
-
val: "35.1%",
|
|
19464
|
-
color: "#4285F4"
|
|
19465
|
-
}, {
|
|
19466
|
-
label: "Bing / Other",
|
|
19467
|
-
val: "14.2%",
|
|
19468
|
-
color: "#06510bff"
|
|
19469
|
-
}, {
|
|
19470
|
-
label: "Referalls",
|
|
19471
|
-
val: "3.3%",
|
|
19472
|
-
color: "#f2b61dff"
|
|
19473
|
-
}],
|
|
19053
|
+
series: (_sourceBreakdown$seri = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.series) !== null && _sourceBreakdown$seri !== void 0 ? _sourceBreakdown$seri : [0],
|
|
19054
|
+
labels: (_sourceBreakdown$labe = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.labels) !== null && _sourceBreakdown$labe !== void 0 ? _sourceBreakdown$labe : ["—"],
|
|
19055
|
+
colors: (_sourceBreakdown$colo = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.colors) !== null && _sourceBreakdown$colo !== void 0 ? _sourceBreakdown$colo : ["#E5E7EB"],
|
|
19056
|
+
centerLabel: (_sourceBreakdown$cent = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.centerLabel) !== null && _sourceBreakdown$cent !== void 0 ? _sourceBreakdown$cent : "visitors",
|
|
19057
|
+
centerValue: (_sourceBreakdown$cent2 = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.centerValue) !== null && _sourceBreakdown$cent2 !== void 0 ? _sourceBreakdown$cent2 : "0",
|
|
19058
|
+
items: (_sourceBreakdown$item = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.items) !== null && _sourceBreakdown$item !== void 0 ? _sourceBreakdown$item : [],
|
|
19474
19059
|
showBottomSummary: false,
|
|
19475
19060
|
sx: {
|
|
19476
19061
|
pb: 2
|
|
@@ -19486,7 +19071,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19486
19071
|
},
|
|
19487
19072
|
children: /*#__PURE__*/jsx(KeywordsCard, {
|
|
19488
19073
|
data: keywordsData,
|
|
19489
|
-
available: hasOrganicOverview ? (apiData === null || apiData === void 0 || (_apiData$topOrganicKe3 = apiData.topOrganicKeywords) === null || _apiData$topOrganicKe3 === void 0 ? void 0 : _apiData$topOrganicKe3.available) !== false :
|
|
19074
|
+
available: hasOrganicOverview ? (apiData === null || apiData === void 0 || (_apiData$topOrganicKe3 = apiData.topOrganicKeywords) === null || _apiData$topOrganicKe3 === void 0 ? void 0 : _apiData$topOrganicKe3.available) !== false : false,
|
|
19490
19075
|
numberOfDays: numberOfDays
|
|
19491
19076
|
})
|
|
19492
19077
|
}), /*#__PURE__*/jsx(Grid, {
|
|
@@ -20005,80 +19590,80 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20005
19590
|
if (!hasEmailOverview) {
|
|
20006
19591
|
return {
|
|
20007
19592
|
"Total Raised": {
|
|
20008
|
-
value: "$".concat(formatNumber(
|
|
20009
|
-
subValue:
|
|
19593
|
+
value: "$".concat(formatNumber(0)),
|
|
19594
|
+
subValue: formatGrowth(0),
|
|
20010
19595
|
icon: /*#__PURE__*/jsx(PaidOutlined, {}),
|
|
20011
19596
|
money: true,
|
|
20012
19597
|
error: false,
|
|
20013
19598
|
warning: false
|
|
20014
19599
|
},
|
|
20015
19600
|
Donations: {
|
|
20016
|
-
value:
|
|
20017
|
-
subValue:
|
|
19601
|
+
value: formatNumber(0),
|
|
19602
|
+
subValue: formatGrowth(0),
|
|
20018
19603
|
icon: /*#__PURE__*/jsx(FavoriteOutlined, {}),
|
|
20019
19604
|
money: false,
|
|
20020
19605
|
error: false,
|
|
20021
19606
|
warning: false
|
|
20022
19607
|
},
|
|
20023
19608
|
"Conversion Rate": {
|
|
20024
|
-
value: "
|
|
20025
|
-
subValue:
|
|
19609
|
+
value: "0.00%",
|
|
19610
|
+
subValue: formatGrowth(0),
|
|
20026
19611
|
icon: /*#__PURE__*/jsx(ConversionRateIcon, {}),
|
|
20027
19612
|
money: false,
|
|
20028
19613
|
error: false,
|
|
20029
19614
|
warning: false
|
|
20030
19615
|
},
|
|
20031
19616
|
CTR: {
|
|
20032
|
-
value: "
|
|
20033
|
-
subValue:
|
|
19617
|
+
value: "0.00%",
|
|
19618
|
+
subValue: formatGrowth(0),
|
|
20034
19619
|
icon: /*#__PURE__*/jsx(CtrIcon, {}),
|
|
20035
19620
|
money: false,
|
|
20036
19621
|
error: false,
|
|
20037
19622
|
warning: false
|
|
20038
19623
|
},
|
|
20039
19624
|
"Revenue Per Email": {
|
|
20040
|
-
value: "$".concat(formatNumber(
|
|
20041
|
-
subValue:
|
|
19625
|
+
value: "$".concat(formatNumber(0)),
|
|
19626
|
+
subValue: formatGrowth(0),
|
|
20042
19627
|
icon: /*#__PURE__*/jsx(RevenuePerEmailIcon, {}),
|
|
20043
19628
|
money: true,
|
|
20044
19629
|
error: false,
|
|
20045
19630
|
warning: false
|
|
20046
19631
|
},
|
|
20047
19632
|
"Open Rate": {
|
|
20048
|
-
value: "
|
|
20049
|
-
subValue:
|
|
19633
|
+
value: "0.00%",
|
|
19634
|
+
subValue: formatGrowth(0),
|
|
20050
19635
|
icon: /*#__PURE__*/jsx(Email, {}),
|
|
20051
19636
|
money: false,
|
|
20052
19637
|
error: false,
|
|
20053
19638
|
warning: false
|
|
20054
19639
|
},
|
|
20055
19640
|
Clicks: {
|
|
20056
|
-
value:
|
|
20057
|
-
subValue:
|
|
19641
|
+
value: formatNumber(0),
|
|
19642
|
+
subValue: formatGrowth(0),
|
|
20058
19643
|
icon: /*#__PURE__*/jsx(ClicksIcon, {}),
|
|
20059
19644
|
money: false,
|
|
20060
19645
|
error: false,
|
|
20061
19646
|
warning: false
|
|
20062
19647
|
},
|
|
20063
19648
|
"Unique Clicks": {
|
|
20064
|
-
value: formatNumber(
|
|
20065
|
-
subValue:
|
|
19649
|
+
value: formatNumber(0),
|
|
19650
|
+
subValue: formatGrowth(0),
|
|
20066
19651
|
icon: /*#__PURE__*/jsx(UniqueClicksIcon, {}),
|
|
20067
19652
|
money: false,
|
|
20068
19653
|
error: false,
|
|
20069
19654
|
warning: false
|
|
20070
19655
|
},
|
|
20071
19656
|
"Bounce Rate": {
|
|
20072
|
-
value: "
|
|
20073
|
-
subValue:
|
|
19657
|
+
value: "0.00%",
|
|
19658
|
+
subValue: formatGrowth(0),
|
|
20074
19659
|
icon: /*#__PURE__*/jsx(HighlightOff, {}),
|
|
20075
19660
|
money: false,
|
|
20076
19661
|
error: false,
|
|
20077
19662
|
warning: false
|
|
20078
19663
|
},
|
|
20079
19664
|
"Revenue Per Click": {
|
|
20080
|
-
value: "$".concat(formatNumber(
|
|
20081
|
-
subValue:
|
|
19665
|
+
value: "$".concat(formatNumber(0)),
|
|
19666
|
+
subValue: formatGrowth(0),
|
|
20082
19667
|
icon: /*#__PURE__*/jsx(RevenuePerClickIcon, {}),
|
|
20083
19668
|
money: true,
|
|
20084
19669
|
error: false,
|
|
@@ -20171,7 +19756,7 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20171
19756
|
}, [deliverability, deliverabilityGrowth, hasEmailOverview, overview, overviewGrowth, dateName]);
|
|
20172
19757
|
var campaignsRaisedData = useMemo(function () {
|
|
20173
19758
|
var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByRaised;
|
|
20174
|
-
if (!hasEmailOverview) return
|
|
19759
|
+
if (!hasEmailOverview) return [];
|
|
20175
19760
|
if (!Array.isArray(campaigns) || campaigns.length === 0) return [];
|
|
20176
19761
|
return campaigns.map(function (item) {
|
|
20177
19762
|
var _item$value2;
|
|
@@ -20184,7 +19769,7 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20184
19769
|
}, [apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByRaised, hasEmailOverview]);
|
|
20185
19770
|
var campaignsCtrData = useMemo(function () {
|
|
20186
19771
|
var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByCtr;
|
|
20187
|
-
if (!hasEmailOverview) return
|
|
19772
|
+
if (!hasEmailOverview) return [];
|
|
20188
19773
|
if (!Array.isArray(campaigns) || campaigns.length === 0) return [];
|
|
20189
19774
|
return campaigns.map(function (item) {
|
|
20190
19775
|
var _item$value3;
|
|
@@ -20197,7 +19782,7 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20197
19782
|
}, [apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByCtr, hasEmailOverview]);
|
|
20198
19783
|
var campaignsConversionData = useMemo(function () {
|
|
20199
19784
|
var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByConversion;
|
|
20200
|
-
if (!hasEmailOverview) return
|
|
19785
|
+
if (!hasEmailOverview) return [];
|
|
20201
19786
|
if (!Array.isArray(campaigns) || campaigns.length === 0) return [];
|
|
20202
19787
|
return campaigns.map(function (item) {
|
|
20203
19788
|
var _item$value4;
|
|
@@ -20258,14 +19843,14 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20258
19843
|
children: /*#__PURE__*/jsx(EmailTrendCard, {
|
|
20259
19844
|
title: "Open Rate Trend",
|
|
20260
19845
|
subtitle: "Daily - ".concat(daysLabel),
|
|
20261
|
-
value: hasEmailOverview ? "".concat(Number((_deliverability$openR2 = deliverability.openRate) !== null && _deliverability$openR2 !== void 0 ? _deliverability$openR2 : 0).toFixed(2), "%") : "
|
|
20262
|
-
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.openRate, true) :
|
|
19846
|
+
value: hasEmailOverview ? "".concat(Number((_deliverability$openR2 = deliverability.openRate) !== null && _deliverability$openR2 !== void 0 ? _deliverability$openR2 : 0).toFixed(2), "%") : "0.00%",
|
|
19847
|
+
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.openRate, true) : formatTrendBadge(0, true),
|
|
20263
19848
|
trendData: hasEmailOverview ? apiData === null || apiData === void 0 ? void 0 : apiData.openRateTrend : undefined,
|
|
20264
19849
|
series: [{
|
|
20265
19850
|
name: "Open Rate",
|
|
20266
|
-
data:
|
|
19851
|
+
data: hasEmailOverview && openRateTrend.data.length > 0 ? openRateTrend.data : [0]
|
|
20267
19852
|
}],
|
|
20268
|
-
categories:
|
|
19853
|
+
categories: hasEmailOverview && openRateTrend.categories.length > 0 ? openRateTrend.categories : ["—"],
|
|
20269
19854
|
colors: ["rgb(99, 99, 230)"],
|
|
20270
19855
|
yAxisMax: computeYAxisMax(openRateTrend.data, 5),
|
|
20271
19856
|
yAxisTickAmount: 3
|
|
@@ -20288,8 +19873,8 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20288
19873
|
children: /*#__PURE__*/jsx(EmailTrendCard, {
|
|
20289
19874
|
title: "Clicks Trend",
|
|
20290
19875
|
subtitle: "Total + unique - ".concat(daysLabel),
|
|
20291
|
-
value: hasEmailOverview ? formatNumber((_deliverability$total2 = deliverability.totalClicks) !== null && _deliverability$total2 !== void 0 ? _deliverability$total2 : 0) :
|
|
20292
|
-
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.totalClicks) :
|
|
19876
|
+
value: hasEmailOverview ? formatNumber((_deliverability$total2 = deliverability.totalClicks) !== null && _deliverability$total2 !== void 0 ? _deliverability$total2 : 0) : formatNumber(0),
|
|
19877
|
+
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.totalClicks) : formatTrendBadge(0),
|
|
20293
19878
|
trendSeries: hasEmailOverview ? [{
|
|
20294
19879
|
name: "Total Clicks",
|
|
20295
19880
|
data: apiData === null || apiData === void 0 ? void 0 : apiData.totalClicksTrend
|
|
@@ -20300,13 +19885,13 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20300
19885
|
}] : undefined,
|
|
20301
19886
|
series: [{
|
|
20302
19887
|
name: "Total Clicks",
|
|
20303
|
-
data:
|
|
19888
|
+
data: hasEmailOverview && totalClicksTrend.data.length > 0 ? totalClicksTrend.data : [0]
|
|
20304
19889
|
}, {
|
|
20305
19890
|
name: "Unique Clicks",
|
|
20306
|
-
data:
|
|
19891
|
+
data: hasEmailOverview && uniqueClicksTrend.data.length > 0 ? uniqueClicksTrend.data : [0],
|
|
20307
19892
|
dashed: true
|
|
20308
19893
|
}],
|
|
20309
|
-
categories:
|
|
19894
|
+
categories: hasEmailOverview && totalClicksTrend.categories.length > 0 ? totalClicksTrend.categories : ["—"],
|
|
20310
19895
|
colors: ["#10B981", "#10B981"],
|
|
20311
19896
|
yAxisMax: computeYAxisMax([].concat(_toConsumableArray(totalClicksTrend.data), _toConsumableArray(uniqueClicksTrend.data)), 10),
|
|
20312
19897
|
yAxisTickAmount: 3,
|
|
@@ -20332,14 +19917,14 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20332
19917
|
children: /*#__PURE__*/jsx(EmailTrendCard, {
|
|
20333
19918
|
title: "Bounce Rate Trend",
|
|
20334
19919
|
subtitle: "Daily - lower is better",
|
|
20335
|
-
value: hasEmailOverview ? "".concat(Number((_deliverability$bounc2 = deliverability.bounceRate) !== null && _deliverability$bounc2 !== void 0 ? _deliverability$bounc2 : 0).toFixed(2), "%") : "
|
|
20336
|
-
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.bounceRate, true) :
|
|
19920
|
+
value: hasEmailOverview ? "".concat(Number((_deliverability$bounc2 = deliverability.bounceRate) !== null && _deliverability$bounc2 !== void 0 ? _deliverability$bounc2 : 0).toFixed(2), "%") : "0.00%",
|
|
19921
|
+
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.bounceRate, true) : formatTrendBadge(0, true),
|
|
20337
19922
|
trendData: hasEmailOverview ? apiData === null || apiData === void 0 ? void 0 : apiData.bounceRateTrend : undefined,
|
|
20338
19923
|
series: [{
|
|
20339
19924
|
name: "Bounce Rate",
|
|
20340
|
-
data:
|
|
19925
|
+
data: hasEmailOverview && bounceRateTrend.data.length > 0 ? bounceRateTrend.data : [0]
|
|
20341
19926
|
}],
|
|
20342
|
-
categories:
|
|
19927
|
+
categories: hasEmailOverview && bounceRateTrend.categories.length > 0 ? bounceRateTrend.categories : ["—"],
|
|
20343
19928
|
colors: ["#f2994a"],
|
|
20344
19929
|
yAxisMax: computeYAxisMax(bounceRateTrend.data, 2.5),
|
|
20345
19930
|
yAxisTickAmount: 3
|