@ammarkhalidfarooq/dashboard-package 0.6.112 → 0.6.114

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