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