@ammarkhalidfarooq/dashboard-package 0.6.111 → 0.6.113
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 +177 -246
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +177 -246
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3872,9 +3872,9 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
3872
3872
|
activeFilters = _ref$activeFilters === void 0 ? [] : _ref$activeFilters,
|
|
3873
3873
|
setExportLoading = _ref.setExportLoading;
|
|
3874
3874
|
var initialMetric = "Revenue";
|
|
3875
|
-
var revenueData = (apiData === null || apiData === void 0 ? void 0 : apiData.revenueData) || [
|
|
3876
|
-
var donationsData = (apiData === null || apiData === void 0 ? void 0 : apiData.donationsData) || [
|
|
3877
|
-
var categories = (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || [
|
|
3875
|
+
var revenueData = (apiData === null || apiData === void 0 ? void 0 : apiData.revenueData) || [0];
|
|
3876
|
+
var donationsData = (apiData === null || apiData === void 0 ? void 0 : apiData.donationsData) || [0];
|
|
3877
|
+
var categories = (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || [];
|
|
3878
3878
|
var _useState = React.useState(initialMetric),
|
|
3879
3879
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3880
3880
|
metric = _useState2[0];
|
|
@@ -3990,7 +3990,7 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
3990
3990
|
}) : categories;
|
|
3991
3991
|
var oneTimeTotal = oneTimeData.length > 0 ? oneTimeValues.reduce(function (sum, val) {
|
|
3992
3992
|
return sum + val;
|
|
3993
|
-
}, 0) :
|
|
3993
|
+
}, 0) : 0;
|
|
3994
3994
|
var firstInstData = (apiData === null || apiData === void 0 ? void 0 : apiData.firstInstallmentRevenue) || [];
|
|
3995
3995
|
var firstInstValues = firstInstData.length > 0 ? firstInstData.map(function (item) {
|
|
3996
3996
|
return item.value;
|
|
@@ -4000,7 +4000,7 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
4000
4000
|
}) : categories.slice(-7);
|
|
4001
4001
|
var firstInstTotal = firstInstData.length > 0 ? firstInstValues.reduce(function (sum, val) {
|
|
4002
4002
|
return sum + val;
|
|
4003
|
-
}, 0) :
|
|
4003
|
+
}, 0) : 0;
|
|
4004
4004
|
var totalRevData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) ? apiData.totalRevenue : [];
|
|
4005
4005
|
var totalRevValues = totalRevData.length > 0 ? totalRevData.map(function (item) {
|
|
4006
4006
|
return item.value;
|
|
@@ -4010,67 +4010,67 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
4010
4010
|
}) : categories;
|
|
4011
4011
|
var totalRevTotal = totalRevData.length > 0 ? totalRevValues.reduce(function (sum, val) {
|
|
4012
4012
|
return sum + val;
|
|
4013
|
-
}, 0) :
|
|
4013
|
+
}, 0) : 0;
|
|
4014
4014
|
var avgDonData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.averageDonation) ? apiData.averageDonation : [];
|
|
4015
4015
|
var avgDonValues = avgDonData.length > 0 ? avgDonData.map(function (item) {
|
|
4016
4016
|
return item.value;
|
|
4017
|
-
}) : currentData.map(function (
|
|
4018
|
-
return
|
|
4017
|
+
}) : currentData.map(function () {
|
|
4018
|
+
return 0;
|
|
4019
4019
|
});
|
|
4020
4020
|
var avgDonCategories = avgDonData.length > 0 ? avgDonData.map(function (item) {
|
|
4021
4021
|
return item.date;
|
|
4022
4022
|
}) : categories;
|
|
4023
4023
|
var avgDonOverall = avgDonData.length > 0 ? avgDonValues.reduce(function (sum, val) {
|
|
4024
4024
|
return sum + val;
|
|
4025
|
-
}, 0) / avgDonValues.length :
|
|
4025
|
+
}, 0) / avgDonValues.length : 0;
|
|
4026
4026
|
var tipData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.tipAmount) ? apiData.tipAmount : [];
|
|
4027
4027
|
var tipValues = tipData.length > 0 ? tipData.map(function (item) {
|
|
4028
4028
|
return item.value;
|
|
4029
|
-
}) : currentData.map(function (
|
|
4030
|
-
return
|
|
4029
|
+
}) : currentData.map(function () {
|
|
4030
|
+
return 0;
|
|
4031
4031
|
});
|
|
4032
4032
|
var tipCategories = tipData.length > 0 ? tipData.map(function (item) {
|
|
4033
4033
|
return item.date;
|
|
4034
4034
|
}) : categories;
|
|
4035
4035
|
var tipTotal = tipData.length > 0 ? tipValues.reduce(function (sum, val) {
|
|
4036
4036
|
return sum + val;
|
|
4037
|
-
}, 0) :
|
|
4037
|
+
}, 0) : 0;
|
|
4038
4038
|
var convRateData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.conversionRate) ? apiData.conversionRate : [];
|
|
4039
4039
|
var convRateValues = convRateData.length > 0 ? convRateData.map(function (item) {
|
|
4040
4040
|
return item.value;
|
|
4041
|
-
}) : [
|
|
4041
|
+
}) : [0];
|
|
4042
4042
|
var convRateCategories = convRateData.length > 0 ? convRateData.map(function (item) {
|
|
4043
4043
|
return item.date;
|
|
4044
4044
|
}) : categories;
|
|
4045
4045
|
var convRateAvg = convRateData.length > 0 ? convRateValues.reduce(function (sum, val) {
|
|
4046
4046
|
return sum + val;
|
|
4047
|
-
}, 0) / convRateValues.length :
|
|
4047
|
+
}, 0) / convRateValues.length : 0;
|
|
4048
4048
|
var organicVisData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.organicVisits) ? apiData.organicVisits : [];
|
|
4049
4049
|
var paidVisData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.paidVisits) ? apiData.paidVisits : [];
|
|
4050
4050
|
var organicVisValues = organicVisData.length > 0 ? organicVisData.map(function (item) {
|
|
4051
4051
|
return item.value;
|
|
4052
|
-
}) : [
|
|
4052
|
+
}) : [0];
|
|
4053
4053
|
var paidVisValues = paidVisData.length > 0 ? paidVisData.map(function (item) {
|
|
4054
4054
|
return item.value;
|
|
4055
|
-
}) : [
|
|
4055
|
+
}) : [0];
|
|
4056
4056
|
var trafficCategories = organicVisData.length > 0 ? organicVisData.map(function (item) {
|
|
4057
4057
|
return item.date;
|
|
4058
4058
|
}) : categories;
|
|
4059
4059
|
var primaryCharts = [{
|
|
4060
4060
|
label: "Total Raised",
|
|
4061
|
-
value: totalRevData.length > 0 ? "$".concat(totalRevTotal.toLocaleString()) : typeof (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) === "string" ? apiData.totalRevenue : "$
|
|
4061
|
+
value: totalRevData.length > 0 ? "$".concat(totalRevTotal.toLocaleString()) : typeof (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) === "string" ? apiData.totalRevenue : "$0.00",
|
|
4062
4062
|
subValue: "Total Donations: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalDonations) || 0),
|
|
4063
4063
|
data: totalRevValues,
|
|
4064
4064
|
categories: totalRevCategories,
|
|
4065
4065
|
showSelector: true
|
|
4066
4066
|
}, {
|
|
4067
4067
|
label: "First installments",
|
|
4068
|
-
value: apiData !== null && apiData !== void 0 && apiData.firstInstallmentRevenue ? "$".concat(firstInstTotal.toLocaleString()) : "$
|
|
4068
|
+
value: apiData !== null && apiData !== void 0 && apiData.firstInstallmentRevenue ? "$".concat(firstInstTotal.toLocaleString()) : "$0.00",
|
|
4069
4069
|
data: firstInstValues,
|
|
4070
4070
|
categories: firstInstCategories
|
|
4071
4071
|
}, {
|
|
4072
4072
|
label: "One-time donations",
|
|
4073
|
-
value: apiData !== null && apiData !== void 0 && apiData.oneTimeDonations ? "$".concat(oneTimeTotal.toLocaleString()) : "$
|
|
4073
|
+
value: apiData !== null && apiData !== void 0 && apiData.oneTimeDonations ? "$".concat(oneTimeTotal.toLocaleString()) : "$0.00",
|
|
4074
4074
|
data: oneTimeValues,
|
|
4075
4075
|
categories: oneTimeCategories
|
|
4076
4076
|
}];
|
|
@@ -4078,32 +4078,36 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
4078
4078
|
label: "New vs Returning Donors",
|
|
4079
4079
|
series: [{
|
|
4080
4080
|
name: "New Donors",
|
|
4081
|
-
data:
|
|
4081
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4082
|
+
return 0;
|
|
4083
|
+
}) : [0]
|
|
4082
4084
|
}, {
|
|
4083
4085
|
name: "Returning",
|
|
4084
|
-
data:
|
|
4086
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4087
|
+
return 0;
|
|
4088
|
+
}) : [0]
|
|
4085
4089
|
}],
|
|
4086
4090
|
categories: categories,
|
|
4087
4091
|
stacked: true,
|
|
4088
4092
|
footer: {
|
|
4089
|
-
left: "New donors:
|
|
4090
|
-
right: "Returning donors:
|
|
4093
|
+
left: "New donors: 0",
|
|
4094
|
+
right: "Returning donors: 0"
|
|
4091
4095
|
}
|
|
4092
4096
|
}, {
|
|
4093
4097
|
label: "Average Donation Amount",
|
|
4094
|
-
value: apiData !== null && apiData !== void 0 && apiData.averageDonation ? "$".concat(avgDonOverall.toFixed(2)) : "$
|
|
4098
|
+
value: apiData !== null && apiData !== void 0 && apiData.averageDonation ? "$".concat(avgDonOverall.toFixed(2)) : "$0.00",
|
|
4095
4099
|
data: avgDonValues,
|
|
4096
4100
|
categories: avgDonCategories
|
|
4097
4101
|
}, {
|
|
4098
4102
|
label: "Tip Amount",
|
|
4099
|
-
value: apiData !== null && apiData !== void 0 && apiData.tipAmount ? "$".concat(tipTotal.toLocaleString()) : "$
|
|
4100
|
-
subValue: "Number of Tips: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalTips) ||
|
|
4103
|
+
value: apiData !== null && apiData !== void 0 && apiData.tipAmount ? "$".concat(tipTotal.toLocaleString()) : "$0.00",
|
|
4104
|
+
subValue: "Number of Tips: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalTips) || 0),
|
|
4101
4105
|
data: tipValues,
|
|
4102
4106
|
categories: tipCategories
|
|
4103
4107
|
}];
|
|
4104
4108
|
var tertiaryCharts = [{
|
|
4105
4109
|
label: "Conversion Rate",
|
|
4106
|
-
value: apiData !== null && apiData !== void 0 && apiData.conversionRate ? "".concat(convRateAvg.toFixed(1), "%") : "
|
|
4110
|
+
value: apiData !== null && apiData !== void 0 && apiData.conversionRate ? "".concat(convRateAvg.toFixed(1), "%") : "0%",
|
|
4107
4111
|
data: convRateValues,
|
|
4108
4112
|
categories: convRateCategories
|
|
4109
4113
|
}, {
|
|
@@ -4119,24 +4123,32 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
4119
4123
|
stacked: true
|
|
4120
4124
|
}, {
|
|
4121
4125
|
label: "Organic Donations",
|
|
4122
|
-
value: "
|
|
4123
|
-
data:
|
|
4126
|
+
value: "0",
|
|
4127
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4128
|
+
return 0;
|
|
4129
|
+
}) : [0],
|
|
4124
4130
|
categories: categories
|
|
4125
4131
|
}];
|
|
4126
4132
|
var quaternaryCharts = [{
|
|
4127
4133
|
label: "Email Marketing",
|
|
4128
|
-
value: "
|
|
4129
|
-
data:
|
|
4134
|
+
value: "0",
|
|
4135
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4136
|
+
return 0;
|
|
4137
|
+
}) : [0],
|
|
4130
4138
|
categories: categories
|
|
4131
4139
|
}, {
|
|
4132
4140
|
label: "Traffic source",
|
|
4133
|
-
value: "
|
|
4134
|
-
data:
|
|
4141
|
+
value: "0%",
|
|
4142
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4143
|
+
return 0;
|
|
4144
|
+
}) : [0],
|
|
4135
4145
|
categories: categories
|
|
4136
4146
|
}, {
|
|
4137
4147
|
label: "URL",
|
|
4138
|
-
value: "
|
|
4139
|
-
data:
|
|
4148
|
+
value: "0%",
|
|
4149
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4150
|
+
return 0;
|
|
4151
|
+
}) : [0],
|
|
4140
4152
|
categories: categories
|
|
4141
4153
|
}];
|
|
4142
4154
|
return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
|
|
@@ -17304,15 +17316,19 @@ var NetRaisedIcon = function NetRaisedIcon(_ref) {
|
|
|
17304
17316
|
children: /*#__PURE__*/jsxRuntime.jsxs("g", {
|
|
17305
17317
|
fill: "#4e47e5",
|
|
17306
17318
|
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
17307
|
-
d: "
|
|
17319
|
+
d: "M19.06,8.58s-.05.06-.05.09c-.08.3-.12.64-.19.94-.51,2.31-1.24,4.58-2.76,6.43-2.99,3.66-7.63,3.71-11.68,1.85-.4-.19-1.44-.67-1.73-.95-.51-.5-.15-1.34.53-1.34.3,0,1.3.63,1.65.8,1.88.89,4.06,1.43,6.14,1.02,4.28-.84,5.87-5.18,6.51-9.01l-1.92,2.29c-.63.55-1.57-.08-1.23-.88,1.23-1.46,2.4-3.02,3.67-4.45.26-.29.41-.51.85-.47.34.03.53.27.66.57l2.05,5.4c.28.93-.99,1.44-1.43.56l-1.06-2.85Z"
|
|
17308
17320
|
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
17309
|
-
d: "
|
|
17321
|
+
d: "M13.64,11.93c.01.07-.03.14-.03.21,0,.22.03.46.03.68.01,1.06,0,2.13,0,3.19-.38.34-.83.57-1.28.8v-4.87h1.29Z"
|
|
17310
17322
|
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
17311
|
-
d: "
|
|
17323
|
+
d: "M11.74,12.74v4.29c-.33.09-.66.2-.99.25-.08.01-.27.07-.29-.01v-4.52s1.28,0,1.28,0Z"
|
|
17312
17324
|
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
17313
|
-
d: "
|
|
17325
|
+
d: "M9.87,13.55v3.8c-.42.07-.86,0-1.29-.03v-3.77h1.29Z"
|
|
17314
17326
|
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
17315
|
-
d: "
|
|
17327
|
+
d: "M15.51,11.13v2.69c-.39.58-.76,1.19-1.29,1.66v-4.35h1.29Z"
|
|
17328
|
+
}), /*#__PURE__*/jsxRuntime.jsx("polygon", {
|
|
17329
|
+
points: "7.97 14.35 7.97 17.25 6.71 16.91 6.71 14.35"
|
|
17330
|
+
}), /*#__PURE__*/jsxRuntime.jsx("polygon", {
|
|
17331
|
+
points: "6.1 15.16 6.1 16.74 4.81 16.19 4.81 15.16"
|
|
17316
17332
|
})]
|
|
17317
17333
|
})
|
|
17318
17334
|
}));
|
|
@@ -17995,34 +18011,38 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
17995
18011
|
var getExtendedCharts = function getExtendedCharts() {
|
|
17996
18012
|
var charts = _toConsumableArray(allCharts);
|
|
17997
18013
|
var categories = (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || [];
|
|
18014
|
+
var zeroData = categories.length > 0 ? categories.map(function () {
|
|
18015
|
+
return 0;
|
|
18016
|
+
}) : [0];
|
|
17998
18017
|
if (!charts.find(function (c) {
|
|
17999
18018
|
return c.label === "Net Raised";
|
|
18000
18019
|
})) {
|
|
18020
|
+
var _apiData$netRaised;
|
|
18001
18021
|
charts.push({
|
|
18002
18022
|
label: "Net Raised",
|
|
18003
|
-
value: (apiData === null || apiData === void 0 ? void 0 : apiData.netRaised)
|
|
18004
|
-
data:
|
|
18005
|
-
return v * 0.92;
|
|
18006
|
-
}),
|
|
18023
|
+
value: (_apiData$netRaised = apiData === null || apiData === void 0 ? void 0 : apiData.netRaised) !== null && _apiData$netRaised !== void 0 ? _apiData$netRaised : "$0",
|
|
18024
|
+
data: zeroData,
|
|
18007
18025
|
categories: categories
|
|
18008
18026
|
});
|
|
18009
18027
|
}
|
|
18010
18028
|
if (!charts.find(function (c) {
|
|
18011
18029
|
return c.label === "Total Donors";
|
|
18012
18030
|
})) {
|
|
18031
|
+
var _apiData$totalDonors;
|
|
18013
18032
|
charts.push({
|
|
18014
18033
|
label: "Total Donors",
|
|
18015
|
-
value: (apiData === null || apiData === void 0 ? void 0 : apiData.totalDonors)
|
|
18016
|
-
data:
|
|
18034
|
+
value: (_apiData$totalDonors = apiData === null || apiData === void 0 ? void 0 : apiData.totalDonors) !== null && _apiData$totalDonors !== void 0 ? _apiData$totalDonors : "0",
|
|
18035
|
+
data: zeroData,
|
|
18017
18036
|
categories: categories
|
|
18018
18037
|
});
|
|
18019
18038
|
}
|
|
18020
18039
|
if (!charts.find(function (c) {
|
|
18021
18040
|
return c.label === "ROAS";
|
|
18022
18041
|
})) {
|
|
18042
|
+
var _apiData$roas;
|
|
18023
18043
|
charts.push({
|
|
18024
18044
|
label: "ROAS",
|
|
18025
|
-
value: (apiData === null || apiData === void 0 ? void 0 : apiData.roas)
|
|
18045
|
+
value: (_apiData$roas = apiData === null || apiData === void 0 ? void 0 : apiData.roas) !== null && _apiData$roas !== void 0 ? _apiData$roas : "0.0x",
|
|
18026
18046
|
data: [],
|
|
18027
18047
|
categories: categories
|
|
18028
18048
|
});
|
|
@@ -18632,9 +18652,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18632
18652
|
if (!hasPaidOverview) {
|
|
18633
18653
|
return {
|
|
18634
18654
|
"Total Spent": {
|
|
18635
|
-
value: "$".concat(formatNumber(
|
|
18636
|
-
subValue:
|
|
18637
|
-
data:
|
|
18655
|
+
value: "$".concat(formatNumber(0)),
|
|
18656
|
+
subValue: formatGrowth$2(0),
|
|
18657
|
+
data: flatSeries(0),
|
|
18638
18658
|
categories: fallbackCategories,
|
|
18639
18659
|
icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.IndeterminateCheckBoxOutlined, {}),
|
|
18640
18660
|
money: true,
|
|
@@ -18642,9 +18662,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18642
18662
|
warning: false
|
|
18643
18663
|
},
|
|
18644
18664
|
"Revinue Raised": {
|
|
18645
|
-
value: "$".concat(formatNumber(
|
|
18646
|
-
subValue:
|
|
18647
|
-
data:
|
|
18665
|
+
value: "$".concat(formatNumber(0)),
|
|
18666
|
+
subValue: formatGrowth$2(0),
|
|
18667
|
+
data: flatSeries(0),
|
|
18648
18668
|
categories: fallbackCategories,
|
|
18649
18669
|
icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PaidOutlined, {}),
|
|
18650
18670
|
money: true,
|
|
@@ -18652,9 +18672,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18652
18672
|
warning: false
|
|
18653
18673
|
},
|
|
18654
18674
|
ROAS: {
|
|
18655
|
-
value: "
|
|
18656
|
-
subValue:
|
|
18657
|
-
data:
|
|
18675
|
+
value: "0.0x",
|
|
18676
|
+
subValue: formatGrowth$2(0),
|
|
18677
|
+
data: flatSeries(0),
|
|
18658
18678
|
categories: fallbackCategories,
|
|
18659
18679
|
icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.TrendingUp, {}),
|
|
18660
18680
|
money: false,
|
|
@@ -18662,9 +18682,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18662
18682
|
warning: false
|
|
18663
18683
|
},
|
|
18664
18684
|
"Cost Per Donor": {
|
|
18665
|
-
value: "$".concat(formatNumber(
|
|
18666
|
-
subValue:
|
|
18667
|
-
data:
|
|
18685
|
+
value: "$".concat(formatNumber(0)),
|
|
18686
|
+
subValue: formatGrowth$2(0),
|
|
18687
|
+
data: flatSeries(0),
|
|
18668
18688
|
categories: fallbackCategories,
|
|
18669
18689
|
icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PersonOutlined, {}),
|
|
18670
18690
|
money: true,
|
|
@@ -18672,9 +18692,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18672
18692
|
warning: false
|
|
18673
18693
|
},
|
|
18674
18694
|
"Conversion Rate": {
|
|
18675
|
-
value: "
|
|
18676
|
-
subValue:
|
|
18677
|
-
data:
|
|
18695
|
+
value: "0.00%",
|
|
18696
|
+
subValue: formatGrowth$2(0),
|
|
18697
|
+
data: flatSeries(0),
|
|
18678
18698
|
categories: fallbackCategories,
|
|
18679
18699
|
icon: /*#__PURE__*/jsxRuntime.jsx(ConversionRateIcon, {}),
|
|
18680
18700
|
money: false,
|
|
@@ -18682,9 +18702,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18682
18702
|
warning: false
|
|
18683
18703
|
},
|
|
18684
18704
|
"Avg Donation": {
|
|
18685
|
-
value: "$".concat(formatNumber(
|
|
18686
|
-
subValue:
|
|
18687
|
-
data:
|
|
18705
|
+
value: "$".concat(formatNumber(0)),
|
|
18706
|
+
subValue: formatGrowth$2(0),
|
|
18707
|
+
data: flatSeries(0),
|
|
18688
18708
|
categories: fallbackCategories,
|
|
18689
18709
|
icon: /*#__PURE__*/jsxRuntime.jsx(AverageDonationIcon, {}),
|
|
18690
18710
|
money: true,
|
|
@@ -18759,7 +18779,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18759
18779
|
}, [fallbackCategories, growth, hasPaidOverview, overview, revenueSeries, roasChartData, spendSeries]);
|
|
18760
18780
|
var channelRows = React.useMemo(function () {
|
|
18761
18781
|
var channels = apiData === null || apiData === void 0 ? void 0 : apiData.channelPerformance;
|
|
18762
|
-
if (!hasPaidOverview) return
|
|
18782
|
+
if (!hasPaidOverview) return [];
|
|
18763
18783
|
if (!Array.isArray(channels) || channels.length === 0) return [];
|
|
18764
18784
|
return channels.map(function (item) {
|
|
18765
18785
|
var _item$roas, _item$spend, _item$revenue, _item$cpa;
|
|
@@ -18781,7 +18801,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18781
18801
|
var spendAllocation = React.useMemo(function () {
|
|
18782
18802
|
var _allocation$totalSpen, _allocation$totalSpen2;
|
|
18783
18803
|
var allocation = apiData === null || apiData === void 0 ? void 0 : apiData.spendAllocation;
|
|
18784
|
-
if (!hasPaidOverview) return
|
|
18804
|
+
if (!hasPaidOverview) return [];
|
|
18785
18805
|
if (!allocation || !Array.isArray(allocation.data) || allocation.data.length === 0) {
|
|
18786
18806
|
return buildEmptySpendAllocation();
|
|
18787
18807
|
}
|
|
@@ -18823,7 +18843,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18823
18843
|
}, [apiData === null || apiData === void 0 ? void 0 : apiData.spendAllocation, hasPaidOverview]);
|
|
18824
18844
|
var topCampaignsData = React.useMemo(function () {
|
|
18825
18845
|
var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaigns;
|
|
18826
|
-
if (!hasPaidOverview) return
|
|
18846
|
+
if (!hasPaidOverview) return [];
|
|
18827
18847
|
if (!Array.isArray(campaigns)) return [];
|
|
18828
18848
|
if (campaigns.length === 0) return [];
|
|
18829
18849
|
return campaigns.map(function (item) {
|
|
@@ -18857,8 +18877,11 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18857
18877
|
},
|
|
18858
18878
|
sx: metricInfo[title].error ? {
|
|
18859
18879
|
border: "2px solid #ef4444",
|
|
18860
|
-
bgcolor: "#fffafa"
|
|
18861
|
-
|
|
18880
|
+
bgcolor: "#fffafa",
|
|
18881
|
+
cursor: "pointer"
|
|
18882
|
+
} : {
|
|
18883
|
+
cursor: "pointer"
|
|
18884
|
+
}
|
|
18862
18885
|
});
|
|
18863
18886
|
};
|
|
18864
18887
|
var selectedInfo = metricInfo[activeMetric] || metricInfo["Total Spent"];
|
|
@@ -18926,72 +18949,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18926
18949
|
columns: ["Channel", "Ppend", "Revenue", "ROAS", "CPA", "Trend"],
|
|
18927
18950
|
gridTemplateColumns: "2.2fr 1fr 1fr 0.8fr 0.8fr 1.2fr",
|
|
18928
18951
|
height: "100%",
|
|
18929
|
-
rows: channelRows !== null && channelRows !== void 0 ? channelRows :
|
|
18930
|
-
id: "M",
|
|
18931
|
-
avatarBg: "#4267B2",
|
|
18932
|
-
name: "Meta Ads",
|
|
18933
|
-
val1: "$32,800",
|
|
18934
|
-
val2: "$112,400",
|
|
18935
|
-
val3: "3.4x",
|
|
18936
|
-
val4: "$340",
|
|
18937
|
-
type: "trend",
|
|
18938
|
-
trendType: "up",
|
|
18939
|
-
trendLabel: "Improving",
|
|
18940
|
-
highlightVal3: true,
|
|
18941
|
-
val3Color: "#22C55E"
|
|
18942
|
-
}, {
|
|
18943
|
-
id: "G",
|
|
18944
|
-
avatarBg: "#4285F4",
|
|
18945
|
-
name: "Google Ads",
|
|
18946
|
-
val1: "$28,200",
|
|
18947
|
-
val2: "$78,300",
|
|
18948
|
-
val3: "2.8x",
|
|
18949
|
-
val4: "$385",
|
|
18950
|
-
type: "trend",
|
|
18951
|
-
trendType: "up",
|
|
18952
|
-
trendLabel: "Improving",
|
|
18953
|
-
highlightVal3: true,
|
|
18954
|
-
val3Color: "#22C55E"
|
|
18955
|
-
}, {
|
|
18956
|
-
id: "T",
|
|
18957
|
-
avatarBg: "#000000",
|
|
18958
|
-
name: "TikTok Ads",
|
|
18959
|
-
val1: "$11,400",
|
|
18960
|
-
val2: "$31,200",
|
|
18961
|
-
val3: "2.7x",
|
|
18962
|
-
val4: "$402",
|
|
18963
|
-
type: "trend",
|
|
18964
|
-
trendType: "up",
|
|
18965
|
-
trendLabel: "Improving",
|
|
18966
|
-
highlightVal3: true,
|
|
18967
|
-
val3Color: "#22C55E"
|
|
18968
|
-
}, {
|
|
18969
|
-
id: "Y",
|
|
18970
|
-
avatarBg: "#FF0000",
|
|
18971
|
-
name: "YouTube",
|
|
18972
|
-
val1: "$5,313",
|
|
18973
|
-
val2: "$12,600",
|
|
18974
|
-
val3: "2.4x",
|
|
18975
|
-
val4: "$443",
|
|
18976
|
-
type: "trend",
|
|
18977
|
-
trendType: "down",
|
|
18978
|
-
trendLabel: "Declining",
|
|
18979
|
-
highlightVal3: true,
|
|
18980
|
-
val3Color: "#EF4444"
|
|
18981
|
-
}, {
|
|
18982
|
-
id: "S",
|
|
18983
|
-
avatarBg: "#FFFC00",
|
|
18984
|
-
name: "Snapchat",
|
|
18985
|
-
val1: "$2,600",
|
|
18986
|
-
val2: "$6,438",
|
|
18987
|
-
val3: "2.5x",
|
|
18988
|
-
val4: "$418",
|
|
18989
|
-
type: "trend",
|
|
18990
|
-
trendType: "up",
|
|
18991
|
-
trendLabel: "Improving",
|
|
18992
|
-
highlightVal3: true,
|
|
18993
|
-
val3Color: "#22C55E"
|
|
18994
|
-
}]
|
|
18952
|
+
rows: channelRows !== null && channelRows !== void 0 ? channelRows : []
|
|
18995
18953
|
})
|
|
18996
18954
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
18997
18955
|
item: true,
|
|
@@ -19011,33 +18969,13 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
19011
18969
|
},
|
|
19012
18970
|
children: /*#__PURE__*/jsxRuntime.jsx(DonorMixCard, {
|
|
19013
18971
|
title: "Spend Allocation",
|
|
19014
|
-
subtitle: (_spendAllocation$subt = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.subtitle) !== null && _spendAllocation$subt !== void 0 ? _spendAllocation$subt :
|
|
19015
|
-
series: (_spendAllocation$seri = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.series) !== null && _spendAllocation$seri !== void 0 ? _spendAllocation$seri :
|
|
19016
|
-
labels: (_spendAllocation$labe = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.labels) !== null && _spendAllocation$labe !== void 0 ? _spendAllocation$labe :
|
|
19017
|
-
colors: (_spendAllocation$colo = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.colors) !== null && _spendAllocation$colo !== void 0 ? _spendAllocation$colo :
|
|
18972
|
+
subtitle: (_spendAllocation$subt = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.subtitle) !== null && _spendAllocation$subt !== void 0 ? _spendAllocation$subt : emptySpendAllocation.subtitle,
|
|
18973
|
+
series: (_spendAllocation$seri = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.series) !== null && _spendAllocation$seri !== void 0 ? _spendAllocation$seri : emptySpendAllocation.series,
|
|
18974
|
+
labels: (_spendAllocation$labe = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.labels) !== null && _spendAllocation$labe !== void 0 ? _spendAllocation$labe : emptySpendAllocation.labels,
|
|
18975
|
+
colors: (_spendAllocation$colo = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.colors) !== null && _spendAllocation$colo !== void 0 ? _spendAllocation$colo : emptySpendAllocation.colors,
|
|
19018
18976
|
centerLabel: (_spendAllocation$cent = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.centerLabel) !== null && _spendAllocation$cent !== void 0 ? _spendAllocation$cent : "total spend",
|
|
19019
|
-
centerValue: (_spendAllocation$cent2 = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.centerValue) !== null && _spendAllocation$cent2 !== void 0 ? _spendAllocation$cent2 :
|
|
19020
|
-
items: (_spendAllocation$item = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.items) !== null && _spendAllocation$item !== void 0 ? _spendAllocation$item :
|
|
19021
|
-
label: "Meta Ads",
|
|
19022
|
-
val: "40.8%",
|
|
19023
|
-
color: "#4267B2"
|
|
19024
|
-
}, {
|
|
19025
|
-
label: "Google Ads",
|
|
19026
|
-
val: "35.1%",
|
|
19027
|
-
color: "#4285F4"
|
|
19028
|
-
}, {
|
|
19029
|
-
label: "TikTok",
|
|
19030
|
-
val: "14.2%",
|
|
19031
|
-
color: "#cd249dff"
|
|
19032
|
-
}, {
|
|
19033
|
-
label: "YouTube",
|
|
19034
|
-
val: "6.6%",
|
|
19035
|
-
color: "#FF0000"
|
|
19036
|
-
}, {
|
|
19037
|
-
label: "Snapchat",
|
|
19038
|
-
val: "3.3%",
|
|
19039
|
-
color: "#FFFC00"
|
|
19040
|
-
}],
|
|
18977
|
+
centerValue: (_spendAllocation$cent2 = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.centerValue) !== null && _spendAllocation$cent2 !== void 0 ? _spendAllocation$cent2 : emptySpendAllocation.centerValue,
|
|
18978
|
+
items: (_spendAllocation$item = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.items) !== null && _spendAllocation$item !== void 0 ? _spendAllocation$item : emptySpendAllocation.items,
|
|
19041
18979
|
showBottomSummary: false,
|
|
19042
18980
|
sx: {
|
|
19043
18981
|
pb: 3.5,
|
|
@@ -19065,7 +19003,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
19065
19003
|
width: "100%"
|
|
19066
19004
|
},
|
|
19067
19005
|
children: /*#__PURE__*/jsxRuntime.jsx(TopPerformingCampaignsCard, {
|
|
19068
|
-
data: topCampaignsData !== null && topCampaignsData !== void 0 ? topCampaignsData :
|
|
19006
|
+
data: topCampaignsData !== null && topCampaignsData !== void 0 ? topCampaignsData : []
|
|
19069
19007
|
})
|
|
19070
19008
|
})
|
|
19071
19009
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
@@ -19140,6 +19078,12 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19140
19078
|
var revenueSeries = mapTimeSeries$1(apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue);
|
|
19141
19079
|
var avgDonationSeries = mapTimeSeries$1(apiData === null || apiData === void 0 ? void 0 : apiData.avgDonations);
|
|
19142
19080
|
var fallbackCategories = organicUsersSeries.categories.length ? organicUsersSeries.categories : ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
19081
|
+
var flatZeroData = function flatZeroData() {
|
|
19082
|
+
var categories = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : fallbackCategories;
|
|
19083
|
+
return categories.length > 0 ? categories.map(function () {
|
|
19084
|
+
return 0;
|
|
19085
|
+
}) : [0];
|
|
19086
|
+
};
|
|
19143
19087
|
var growthCaption = function growthCaption(key) {
|
|
19144
19088
|
return formatGrowth$1(growth[key]);
|
|
19145
19089
|
};
|
|
@@ -19148,9 +19092,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19148
19092
|
if (!hasOrganicOverview) {
|
|
19149
19093
|
return {
|
|
19150
19094
|
"Organic Users": {
|
|
19151
|
-
value:
|
|
19152
|
-
subValue:
|
|
19153
|
-
data:
|
|
19095
|
+
value: formatNumber(0),
|
|
19096
|
+
subValue: formatGrowth$1(0),
|
|
19097
|
+
data: flatZeroData(),
|
|
19154
19098
|
categories: fallbackCategories,
|
|
19155
19099
|
icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PeopleAltOutlined, {}),
|
|
19156
19100
|
money: false,
|
|
@@ -19158,9 +19102,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19158
19102
|
error: false
|
|
19159
19103
|
},
|
|
19160
19104
|
"Search Clicks": {
|
|
19161
|
-
value:
|
|
19162
|
-
subValue:
|
|
19163
|
-
data:
|
|
19105
|
+
value: formatNumber(0),
|
|
19106
|
+
subValue: formatGrowth$1(0),
|
|
19107
|
+
data: flatZeroData(),
|
|
19164
19108
|
categories: fallbackCategories,
|
|
19165
19109
|
icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.SearchOutlined, {}),
|
|
19166
19110
|
money: false,
|
|
@@ -19168,9 +19112,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19168
19112
|
error: false
|
|
19169
19113
|
},
|
|
19170
19114
|
Donations: {
|
|
19171
|
-
value:
|
|
19172
|
-
subValue:
|
|
19173
|
-
data:
|
|
19115
|
+
value: formatNumber(0),
|
|
19116
|
+
subValue: formatGrowth$1(0),
|
|
19117
|
+
data: flatZeroData(),
|
|
19174
19118
|
categories: fallbackCategories,
|
|
19175
19119
|
icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.FavoriteOutlined, {}),
|
|
19176
19120
|
money: false,
|
|
@@ -19178,9 +19122,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19178
19122
|
error: false
|
|
19179
19123
|
},
|
|
19180
19124
|
"Conversion Rate": {
|
|
19181
|
-
value: "
|
|
19182
|
-
subValue:
|
|
19183
|
-
data:
|
|
19125
|
+
value: "0.00%",
|
|
19126
|
+
subValue: formatGrowth$1(0),
|
|
19127
|
+
data: flatZeroData(),
|
|
19184
19128
|
categories: fallbackCategories,
|
|
19185
19129
|
icon: /*#__PURE__*/jsxRuntime.jsx(ConversionRateIcon, {}),
|
|
19186
19130
|
money: false,
|
|
@@ -19188,9 +19132,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19188
19132
|
error: false
|
|
19189
19133
|
},
|
|
19190
19134
|
"Revenue Raised": {
|
|
19191
|
-
value: "$".concat(formatNumber(
|
|
19192
|
-
subValue:
|
|
19193
|
-
data:
|
|
19135
|
+
value: "$".concat(formatNumber(0)),
|
|
19136
|
+
subValue: formatGrowth$1(0),
|
|
19137
|
+
data: flatZeroData(),
|
|
19194
19138
|
categories: fallbackCategories,
|
|
19195
19139
|
icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PaidOutlined, {}),
|
|
19196
19140
|
money: true,
|
|
@@ -19198,9 +19142,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19198
19142
|
error: false
|
|
19199
19143
|
},
|
|
19200
19144
|
"Avg Donation": {
|
|
19201
|
-
value: "$".concat(formatNumber(
|
|
19202
|
-
subValue:
|
|
19203
|
-
data:
|
|
19145
|
+
value: "$".concat(formatNumber(0)),
|
|
19146
|
+
subValue: formatGrowth$1(0),
|
|
19147
|
+
data: flatZeroData(),
|
|
19204
19148
|
categories: fallbackCategories,
|
|
19205
19149
|
icon: /*#__PURE__*/jsxRuntime.jsx(AverageDonationIcon, {}),
|
|
19206
19150
|
money: true,
|
|
@@ -19284,7 +19228,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19284
19228
|
}, [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]);
|
|
19285
19229
|
var landingPagesData = React.useMemo(function () {
|
|
19286
19230
|
var pages = apiData === null || apiData === void 0 ? void 0 : apiData.topLandingPages;
|
|
19287
|
-
if (!hasOrganicOverview) return
|
|
19231
|
+
if (!hasOrganicOverview) return [];
|
|
19288
19232
|
if (!Array.isArray(pages) || pages.length === 0) return [];
|
|
19289
19233
|
return pages.map(function (item) {
|
|
19290
19234
|
var _item$visitors, _item$donations, _item$revenue, _item$conversionRate;
|
|
@@ -19299,7 +19243,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19299
19243
|
}, [apiData === null || apiData === void 0 ? void 0 : apiData.topLandingPages, hasOrganicOverview]);
|
|
19300
19244
|
var keywordsData = React.useMemo(function () {
|
|
19301
19245
|
var keywords = apiData === null || apiData === void 0 ? void 0 : apiData.topOrganicKeywords;
|
|
19302
|
-
if (!hasOrganicOverview) return
|
|
19246
|
+
if (!hasOrganicOverview) return [];
|
|
19303
19247
|
if (!(keywords !== null && keywords !== void 0 && keywords.available) || !Array.isArray(keywords.data) || keywords.data.length === 0) {
|
|
19304
19248
|
return [];
|
|
19305
19249
|
}
|
|
@@ -19317,7 +19261,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19317
19261
|
var geographyData = React.useMemo(function () {
|
|
19318
19262
|
var _apiData$geographyIns;
|
|
19319
19263
|
var countries = apiData === null || apiData === void 0 || (_apiData$geographyIns = apiData.geographyInsights) === null || _apiData$geographyIns === void 0 ? void 0 : _apiData$geographyIns.countries;
|
|
19320
|
-
if (!hasOrganicOverview) return
|
|
19264
|
+
if (!hasOrganicOverview) return [];
|
|
19321
19265
|
if (!Array.isArray(countries) || countries.length === 0) return [];
|
|
19322
19266
|
return countries.map(function (item) {
|
|
19323
19267
|
var _item$visitors2, _item$percentage, _item$percentage2;
|
|
@@ -19332,7 +19276,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19332
19276
|
var _breakdown$totalVisit;
|
|
19333
19277
|
var breakdown = apiData === null || apiData === void 0 ? void 0 : apiData.sourceBreakdown;
|
|
19334
19278
|
var sources = breakdown === null || breakdown === void 0 ? void 0 : breakdown.data;
|
|
19335
|
-
if (!hasOrganicOverview) return
|
|
19279
|
+
if (!hasOrganicOverview) return [];
|
|
19336
19280
|
if (!Array.isArray(sources) || sources.length === 0) return null;
|
|
19337
19281
|
var colors = sources.map(function (_, index) {
|
|
19338
19282
|
return SOURCE_COLORS[index % SOURCE_COLORS.length];
|
|
@@ -19371,8 +19315,11 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19371
19315
|
},
|
|
19372
19316
|
sx: metricInfo[title].error ? {
|
|
19373
19317
|
border: "2px solid #ef4444",
|
|
19374
|
-
bgcolor: "#fffafa"
|
|
19375
|
-
|
|
19318
|
+
bgcolor: "#fffafa",
|
|
19319
|
+
cursor: "pointer"
|
|
19320
|
+
} : {
|
|
19321
|
+
cursor: "pointer"
|
|
19322
|
+
}
|
|
19376
19323
|
});
|
|
19377
19324
|
};
|
|
19378
19325
|
var selectedInfo = metricInfo[activeMetric] || metricInfo["Organic Users"];
|
|
@@ -19444,28 +19391,12 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19444
19391
|
children: /*#__PURE__*/jsxRuntime.jsx(DonorMixCard, {
|
|
19445
19392
|
title: "Source Breakdown",
|
|
19446
19393
|
subtitle: "Where organic visitors come from",
|
|
19447
|
-
series: (_sourceBreakdown$seri = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.series) !== null && _sourceBreakdown$seri !== void 0 ? _sourceBreakdown$seri : [
|
|
19448
|
-
labels: (_sourceBreakdown$labe = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.labels) !== null && _sourceBreakdown$labe !== void 0 ? _sourceBreakdown$labe : ["
|
|
19449
|
-
colors: (_sourceBreakdown$colo = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.colors) !== null && _sourceBreakdown$colo !== void 0 ? _sourceBreakdown$colo : ["#
|
|
19450
|
-
centerLabel: (_sourceBreakdown$cent = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.centerLabel) !== null && _sourceBreakdown$cent !== void 0 ? _sourceBreakdown$cent : "
|
|
19451
|
-
centerValue: (_sourceBreakdown$cent2 = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.centerValue) !== null && _sourceBreakdown$cent2 !== void 0 ? _sourceBreakdown$cent2 : "
|
|
19452
|
-
items: (_sourceBreakdown$item = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.items) !== null && _sourceBreakdown$item !== void 0 ? _sourceBreakdown$item : [
|
|
19453
|
-
label: "Google Search",
|
|
19454
|
-
val: "40.8%",
|
|
19455
|
-
color: "#4267B2"
|
|
19456
|
-
}, {
|
|
19457
|
-
label: "Direct",
|
|
19458
|
-
val: "35.1%",
|
|
19459
|
-
color: "#4285F4"
|
|
19460
|
-
}, {
|
|
19461
|
-
label: "Bing / Other",
|
|
19462
|
-
val: "14.2%",
|
|
19463
|
-
color: "#06510bff"
|
|
19464
|
-
}, {
|
|
19465
|
-
label: "Referalls",
|
|
19466
|
-
val: "3.3%",
|
|
19467
|
-
color: "#f2b61dff"
|
|
19468
|
-
}],
|
|
19394
|
+
series: (_sourceBreakdown$seri = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.series) !== null && _sourceBreakdown$seri !== void 0 ? _sourceBreakdown$seri : [0],
|
|
19395
|
+
labels: (_sourceBreakdown$labe = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.labels) !== null && _sourceBreakdown$labe !== void 0 ? _sourceBreakdown$labe : ["—"],
|
|
19396
|
+
colors: (_sourceBreakdown$colo = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.colors) !== null && _sourceBreakdown$colo !== void 0 ? _sourceBreakdown$colo : ["#E5E7EB"],
|
|
19397
|
+
centerLabel: (_sourceBreakdown$cent = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.centerLabel) !== null && _sourceBreakdown$cent !== void 0 ? _sourceBreakdown$cent : "visitors",
|
|
19398
|
+
centerValue: (_sourceBreakdown$cent2 = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.centerValue) !== null && _sourceBreakdown$cent2 !== void 0 ? _sourceBreakdown$cent2 : "0",
|
|
19399
|
+
items: (_sourceBreakdown$item = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.items) !== null && _sourceBreakdown$item !== void 0 ? _sourceBreakdown$item : [],
|
|
19469
19400
|
showBottomSummary: false,
|
|
19470
19401
|
sx: {
|
|
19471
19402
|
pb: 2
|
|
@@ -19481,7 +19412,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19481
19412
|
},
|
|
19482
19413
|
children: /*#__PURE__*/jsxRuntime.jsx(KeywordsCard, {
|
|
19483
19414
|
data: keywordsData,
|
|
19484
|
-
available: hasOrganicOverview ? (apiData === null || apiData === void 0 || (_apiData$topOrganicKe3 = apiData.topOrganicKeywords) === null || _apiData$topOrganicKe3 === void 0 ? void 0 : _apiData$topOrganicKe3.available) !== false :
|
|
19415
|
+
available: hasOrganicOverview ? (apiData === null || apiData === void 0 || (_apiData$topOrganicKe3 = apiData.topOrganicKeywords) === null || _apiData$topOrganicKe3 === void 0 ? void 0 : _apiData$topOrganicKe3.available) !== false : false,
|
|
19485
19416
|
numberOfDays: numberOfDays
|
|
19486
19417
|
})
|
|
19487
19418
|
}), /*#__PURE__*/jsxRuntime.jsx(material.Grid, {
|
|
@@ -20000,80 +19931,80 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20000
19931
|
if (!hasEmailOverview) {
|
|
20001
19932
|
return {
|
|
20002
19933
|
"Total Raised": {
|
|
20003
|
-
value: "$".concat(formatNumber(
|
|
20004
|
-
subValue:
|
|
19934
|
+
value: "$".concat(formatNumber(0)),
|
|
19935
|
+
subValue: formatGrowth(0),
|
|
20005
19936
|
icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.PaidOutlined, {}),
|
|
20006
19937
|
money: true,
|
|
20007
19938
|
error: false,
|
|
20008
19939
|
warning: false
|
|
20009
19940
|
},
|
|
20010
19941
|
Donations: {
|
|
20011
|
-
value:
|
|
20012
|
-
subValue:
|
|
19942
|
+
value: formatNumber(0),
|
|
19943
|
+
subValue: formatGrowth(0),
|
|
20013
19944
|
icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.FavoriteOutlined, {}),
|
|
20014
19945
|
money: false,
|
|
20015
19946
|
error: false,
|
|
20016
19947
|
warning: false
|
|
20017
19948
|
},
|
|
20018
19949
|
"Conversion Rate": {
|
|
20019
|
-
value: "
|
|
20020
|
-
subValue:
|
|
19950
|
+
value: "0.00%",
|
|
19951
|
+
subValue: formatGrowth(0),
|
|
20021
19952
|
icon: /*#__PURE__*/jsxRuntime.jsx(ConversionRateIcon, {}),
|
|
20022
19953
|
money: false,
|
|
20023
19954
|
error: false,
|
|
20024
19955
|
warning: false
|
|
20025
19956
|
},
|
|
20026
19957
|
CTR: {
|
|
20027
|
-
value: "
|
|
20028
|
-
subValue:
|
|
19958
|
+
value: "0.00%",
|
|
19959
|
+
subValue: formatGrowth(0),
|
|
20029
19960
|
icon: /*#__PURE__*/jsxRuntime.jsx(CtrIcon, {}),
|
|
20030
19961
|
money: false,
|
|
20031
19962
|
error: false,
|
|
20032
19963
|
warning: false
|
|
20033
19964
|
},
|
|
20034
19965
|
"Revenue Per Email": {
|
|
20035
|
-
value: "$".concat(formatNumber(
|
|
20036
|
-
subValue:
|
|
19966
|
+
value: "$".concat(formatNumber(0)),
|
|
19967
|
+
subValue: formatGrowth(0),
|
|
20037
19968
|
icon: /*#__PURE__*/jsxRuntime.jsx(RevenuePerEmailIcon, {}),
|
|
20038
19969
|
money: true,
|
|
20039
19970
|
error: false,
|
|
20040
19971
|
warning: false
|
|
20041
19972
|
},
|
|
20042
19973
|
"Open Rate": {
|
|
20043
|
-
value: "
|
|
20044
|
-
subValue:
|
|
19974
|
+
value: "0.00%",
|
|
19975
|
+
subValue: formatGrowth(0),
|
|
20045
19976
|
icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.Email, {}),
|
|
20046
19977
|
money: false,
|
|
20047
19978
|
error: false,
|
|
20048
19979
|
warning: false
|
|
20049
19980
|
},
|
|
20050
19981
|
Clicks: {
|
|
20051
|
-
value:
|
|
20052
|
-
subValue:
|
|
19982
|
+
value: formatNumber(0),
|
|
19983
|
+
subValue: formatGrowth(0),
|
|
20053
19984
|
icon: /*#__PURE__*/jsxRuntime.jsx(ClicksIcon, {}),
|
|
20054
19985
|
money: false,
|
|
20055
19986
|
error: false,
|
|
20056
19987
|
warning: false
|
|
20057
19988
|
},
|
|
20058
19989
|
"Unique Clicks": {
|
|
20059
|
-
value: formatNumber(
|
|
20060
|
-
subValue:
|
|
19990
|
+
value: formatNumber(0),
|
|
19991
|
+
subValue: formatGrowth(0),
|
|
20061
19992
|
icon: /*#__PURE__*/jsxRuntime.jsx(UniqueClicksIcon, {}),
|
|
20062
19993
|
money: false,
|
|
20063
19994
|
error: false,
|
|
20064
19995
|
warning: false
|
|
20065
19996
|
},
|
|
20066
19997
|
"Bounce Rate": {
|
|
20067
|
-
value: "
|
|
20068
|
-
subValue:
|
|
19998
|
+
value: "0.00%",
|
|
19999
|
+
subValue: formatGrowth(0),
|
|
20069
20000
|
icon: /*#__PURE__*/jsxRuntime.jsx(iconsMaterial.HighlightOff, {}),
|
|
20070
20001
|
money: false,
|
|
20071
20002
|
error: false,
|
|
20072
20003
|
warning: false
|
|
20073
20004
|
},
|
|
20074
20005
|
"Revenue Per Click": {
|
|
20075
|
-
value: "$".concat(formatNumber(
|
|
20076
|
-
subValue:
|
|
20006
|
+
value: "$".concat(formatNumber(0)),
|
|
20007
|
+
subValue: formatGrowth(0),
|
|
20077
20008
|
icon: /*#__PURE__*/jsxRuntime.jsx(RevenuePerClickIcon, {}),
|
|
20078
20009
|
money: true,
|
|
20079
20010
|
error: false,
|
|
@@ -20166,7 +20097,7 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20166
20097
|
}, [deliverability, deliverabilityGrowth, hasEmailOverview, overview, overviewGrowth, dateName]);
|
|
20167
20098
|
var campaignsRaisedData = React.useMemo(function () {
|
|
20168
20099
|
var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByRaised;
|
|
20169
|
-
if (!hasEmailOverview) return
|
|
20100
|
+
if (!hasEmailOverview) return [];
|
|
20170
20101
|
if (!Array.isArray(campaigns) || campaigns.length === 0) return [];
|
|
20171
20102
|
return campaigns.map(function (item) {
|
|
20172
20103
|
var _item$value2;
|
|
@@ -20179,7 +20110,7 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20179
20110
|
}, [apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByRaised, hasEmailOverview]);
|
|
20180
20111
|
var campaignsCtrData = React.useMemo(function () {
|
|
20181
20112
|
var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByCtr;
|
|
20182
|
-
if (!hasEmailOverview) return
|
|
20113
|
+
if (!hasEmailOverview) return [];
|
|
20183
20114
|
if (!Array.isArray(campaigns) || campaigns.length === 0) return [];
|
|
20184
20115
|
return campaigns.map(function (item) {
|
|
20185
20116
|
var _item$value3;
|
|
@@ -20192,7 +20123,7 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20192
20123
|
}, [apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByCtr, hasEmailOverview]);
|
|
20193
20124
|
var campaignsConversionData = React.useMemo(function () {
|
|
20194
20125
|
var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByConversion;
|
|
20195
|
-
if (!hasEmailOverview) return
|
|
20126
|
+
if (!hasEmailOverview) return [];
|
|
20196
20127
|
if (!Array.isArray(campaigns) || campaigns.length === 0) return [];
|
|
20197
20128
|
return campaigns.map(function (item) {
|
|
20198
20129
|
var _item$value4;
|
|
@@ -20253,14 +20184,14 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20253
20184
|
children: /*#__PURE__*/jsxRuntime.jsx(EmailTrendCard, {
|
|
20254
20185
|
title: "Open Rate Trend",
|
|
20255
20186
|
subtitle: "Daily - ".concat(daysLabel),
|
|
20256
|
-
value: hasEmailOverview ? "".concat(Number((_deliverability$openR2 = deliverability.openRate) !== null && _deliverability$openR2 !== void 0 ? _deliverability$openR2 : 0).toFixed(2), "%") : "
|
|
20257
|
-
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.openRate, true) :
|
|
20187
|
+
value: hasEmailOverview ? "".concat(Number((_deliverability$openR2 = deliverability.openRate) !== null && _deliverability$openR2 !== void 0 ? _deliverability$openR2 : 0).toFixed(2), "%") : "0.00%",
|
|
20188
|
+
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.openRate, true) : formatTrendBadge(0, true),
|
|
20258
20189
|
trendData: hasEmailOverview ? apiData === null || apiData === void 0 ? void 0 : apiData.openRateTrend : undefined,
|
|
20259
20190
|
series: [{
|
|
20260
20191
|
name: "Open Rate",
|
|
20261
|
-
data:
|
|
20192
|
+
data: hasEmailOverview && openRateTrend.data.length > 0 ? openRateTrend.data : [0]
|
|
20262
20193
|
}],
|
|
20263
|
-
categories:
|
|
20194
|
+
categories: hasEmailOverview && openRateTrend.categories.length > 0 ? openRateTrend.categories : ["—"],
|
|
20264
20195
|
colors: ["rgb(99, 99, 230)"],
|
|
20265
20196
|
yAxisMax: computeYAxisMax(openRateTrend.data, 5),
|
|
20266
20197
|
yAxisTickAmount: 3
|
|
@@ -20283,8 +20214,8 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20283
20214
|
children: /*#__PURE__*/jsxRuntime.jsx(EmailTrendCard, {
|
|
20284
20215
|
title: "Clicks Trend",
|
|
20285
20216
|
subtitle: "Total + unique - ".concat(daysLabel),
|
|
20286
|
-
value: hasEmailOverview ? formatNumber((_deliverability$total2 = deliverability.totalClicks) !== null && _deliverability$total2 !== void 0 ? _deliverability$total2 : 0) :
|
|
20287
|
-
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.totalClicks) :
|
|
20217
|
+
value: hasEmailOverview ? formatNumber((_deliverability$total2 = deliverability.totalClicks) !== null && _deliverability$total2 !== void 0 ? _deliverability$total2 : 0) : formatNumber(0),
|
|
20218
|
+
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.totalClicks) : formatTrendBadge(0),
|
|
20288
20219
|
trendSeries: hasEmailOverview ? [{
|
|
20289
20220
|
name: "Total Clicks",
|
|
20290
20221
|
data: apiData === null || apiData === void 0 ? void 0 : apiData.totalClicksTrend
|
|
@@ -20295,13 +20226,13 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20295
20226
|
}] : undefined,
|
|
20296
20227
|
series: [{
|
|
20297
20228
|
name: "Total Clicks",
|
|
20298
|
-
data:
|
|
20229
|
+
data: hasEmailOverview && totalClicksTrend.data.length > 0 ? totalClicksTrend.data : [0]
|
|
20299
20230
|
}, {
|
|
20300
20231
|
name: "Unique Clicks",
|
|
20301
|
-
data:
|
|
20232
|
+
data: hasEmailOverview && uniqueClicksTrend.data.length > 0 ? uniqueClicksTrend.data : [0],
|
|
20302
20233
|
dashed: true
|
|
20303
20234
|
}],
|
|
20304
|
-
categories:
|
|
20235
|
+
categories: hasEmailOverview && totalClicksTrend.categories.length > 0 ? totalClicksTrend.categories : ["—"],
|
|
20305
20236
|
colors: ["#10B981", "#10B981"],
|
|
20306
20237
|
yAxisMax: computeYAxisMax([].concat(_toConsumableArray(totalClicksTrend.data), _toConsumableArray(uniqueClicksTrend.data)), 10),
|
|
20307
20238
|
yAxisTickAmount: 3,
|
|
@@ -20327,14 +20258,14 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20327
20258
|
children: /*#__PURE__*/jsxRuntime.jsx(EmailTrendCard, {
|
|
20328
20259
|
title: "Bounce Rate Trend",
|
|
20329
20260
|
subtitle: "Daily - lower is better",
|
|
20330
|
-
value: hasEmailOverview ? "".concat(Number((_deliverability$bounc2 = deliverability.bounceRate) !== null && _deliverability$bounc2 !== void 0 ? _deliverability$bounc2 : 0).toFixed(2), "%") : "
|
|
20331
|
-
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.bounceRate, true) :
|
|
20261
|
+
value: hasEmailOverview ? "".concat(Number((_deliverability$bounc2 = deliverability.bounceRate) !== null && _deliverability$bounc2 !== void 0 ? _deliverability$bounc2 : 0).toFixed(2), "%") : "0.00%",
|
|
20262
|
+
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.bounceRate, true) : formatTrendBadge(0, true),
|
|
20332
20263
|
trendData: hasEmailOverview ? apiData === null || apiData === void 0 ? void 0 : apiData.bounceRateTrend : undefined,
|
|
20333
20264
|
series: [{
|
|
20334
20265
|
name: "Bounce Rate",
|
|
20335
|
-
data:
|
|
20266
|
+
data: hasEmailOverview && bounceRateTrend.data.length > 0 ? bounceRateTrend.data : [0]
|
|
20336
20267
|
}],
|
|
20337
|
-
categories:
|
|
20268
|
+
categories: hasEmailOverview && bounceRateTrend.categories.length > 0 ? bounceRateTrend.categories : ["—"],
|
|
20338
20269
|
colors: ["#f2994a"],
|
|
20339
20270
|
yAxisMax: computeYAxisMax(bounceRateTrend.data, 2.5),
|
|
20340
20271
|
yAxisTickAmount: 3
|