@ammarkhalidfarooq/dashboard-package 0.6.95 → 0.6.97

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.es.js CHANGED
@@ -1482,7 +1482,7 @@ var parseDonationTypeChartData = function parseDonationTypeChartData(donationTyp
1482
1482
 
1483
1483
  /** Normalizes refundAndChargeBacks from API for PDF + report cards. */
1484
1484
  var parseRefundsChargebacks = function parseRefundsChargebacks(refundsData) {
1485
- var _raw$refundRate, _raw$chargebackRate, _raw$totalRefundedAmo, _raw$totalRefunds, _raw$totalChargebacks, _raw$wonChargebacks, _raw$lostChargebacks, _raw$growthPercentage, _raw$totalRevenue;
1485
+ var _raw$refundRate, _raw$chargebackRate, _raw$totalRefundedAmo, _raw$totalRefunds, _raw$totalChargebacks, _raw$wonChargebacks, _raw$lostChargebacks, _raw$growthPercentage, _ref, _raw$disputedAmount, _raw$totalRevenue;
1486
1486
  var raw = refundsData && _typeof(refundsData) === "object" ? refundsData : {};
1487
1487
  return {
1488
1488
  refundRate: Number((_raw$refundRate = raw.refundRate) !== null && _raw$refundRate !== void 0 ? _raw$refundRate : 0),
@@ -1493,6 +1493,7 @@ var parseRefundsChargebacks = function parseRefundsChargebacks(refundsData) {
1493
1493
  wonChargebacks: Number((_raw$wonChargebacks = raw.wonChargebacks) !== null && _raw$wonChargebacks !== void 0 ? _raw$wonChargebacks : 0),
1494
1494
  lostChargebacks: Number((_raw$lostChargebacks = raw.lostChargebacks) !== null && _raw$lostChargebacks !== void 0 ? _raw$lostChargebacks : 0),
1495
1495
  growthPercentage: Number((_raw$growthPercentage = raw.growthPercentage) !== null && _raw$growthPercentage !== void 0 ? _raw$growthPercentage : 0),
1496
+ disputedAmount: Number((_ref = (_raw$disputedAmount = raw.disputedAmount) !== null && _raw$disputedAmount !== void 0 ? _raw$disputedAmount : raw.totalDisputed) !== null && _ref !== void 0 ? _ref : 0),
1496
1497
  chartData: Array.isArray(raw.chartData) ? raw.chartData : [],
1497
1498
  totalRevenue: Number((_raw$totalRevenue = raw.totalRevenue) !== null && _raw$totalRevenue !== void 0 ? _raw$totalRevenue : 0)
1498
1499
  };
@@ -1500,11 +1501,11 @@ var parseRefundsChargebacks = function parseRefundsChargebacks(refundsData) {
1500
1501
 
1501
1502
  /** Median / top-decile for avg donation KPI (not shown in Overall section UI). */
1502
1503
  var parseAvgDonationDetail = function parseAvgDonationDetail() {
1503
- var _apiData$overviewStat, _ref, _ref2, _ref3, _ref4, _ref5, _overview$medianDonat, _ref6, _ref7, _ref8, _ref9, _ref0, _overview$topDecileDo;
1504
+ var _apiData$overviewStat, _ref2, _ref3, _ref4, _ref5, _ref6, _overview$medianDonat, _ref7, _ref8, _ref9, _ref0, _ref1, _overview$topDecileDo;
1504
1505
  var apiData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1505
1506
  var overview = (apiData === null || apiData === void 0 || (_apiData$overviewStat = apiData.overviewStats) === null || _apiData$overviewStat === void 0 ? void 0 : _apiData$overviewStat.overview) || {};
1506
- var median = Number((_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_overview$medianDonat = overview === null || overview === void 0 ? void 0 : overview.medianDonation) !== null && _overview$medianDonat !== void 0 ? _overview$medianDonat : overview === null || overview === void 0 ? void 0 : overview.medianGift) !== null && _ref5 !== void 0 ? _ref5 : overview === null || overview === void 0 ? void 0 : overview.median) !== null && _ref4 !== void 0 ? _ref4 : apiData === null || apiData === void 0 ? void 0 : apiData.medianGift) !== null && _ref3 !== void 0 ? _ref3 : apiData === null || apiData === void 0 ? void 0 : apiData.medianDonation) !== null && _ref2 !== void 0 ? _ref2 : apiData === null || apiData === void 0 ? void 0 : apiData.median) !== null && _ref !== void 0 ? _ref : 0);
1507
- var topDecile = Number((_ref6 = (_ref7 = (_ref8 = (_ref9 = (_ref0 = (_overview$topDecileDo = overview === null || overview === void 0 ? void 0 : overview.topDecileDonation) !== null && _overview$topDecileDo !== void 0 ? _overview$topDecileDo : overview === null || overview === void 0 ? void 0 : overview.topDecileGift) !== null && _ref0 !== void 0 ? _ref0 : overview === null || overview === void 0 ? void 0 : overview.topDecile) !== null && _ref9 !== void 0 ? _ref9 : apiData === null || apiData === void 0 ? void 0 : apiData.topDecileGift) !== null && _ref8 !== void 0 ? _ref8 : apiData === null || apiData === void 0 ? void 0 : apiData.topDecileDonation) !== null && _ref7 !== void 0 ? _ref7 : apiData === null || apiData === void 0 ? void 0 : apiData.topDecile) !== null && _ref6 !== void 0 ? _ref6 : 0);
1507
+ var median = Number((_ref2 = (_ref3 = (_ref4 = (_ref5 = (_ref6 = (_overview$medianDonat = overview === null || overview === void 0 ? void 0 : overview.medianDonation) !== null && _overview$medianDonat !== void 0 ? _overview$medianDonat : overview === null || overview === void 0 ? void 0 : overview.medianGift) !== null && _ref6 !== void 0 ? _ref6 : overview === null || overview === void 0 ? void 0 : overview.median) !== null && _ref5 !== void 0 ? _ref5 : apiData === null || apiData === void 0 ? void 0 : apiData.medianGift) !== null && _ref4 !== void 0 ? _ref4 : apiData === null || apiData === void 0 ? void 0 : apiData.medianDonation) !== null && _ref3 !== void 0 ? _ref3 : apiData === null || apiData === void 0 ? void 0 : apiData.median) !== null && _ref2 !== void 0 ? _ref2 : 0);
1508
+ var topDecile = Number((_ref7 = (_ref8 = (_ref9 = (_ref0 = (_ref1 = (_overview$topDecileDo = overview === null || overview === void 0 ? void 0 : overview.topDecileDonation) !== null && _overview$topDecileDo !== void 0 ? _overview$topDecileDo : overview === null || overview === void 0 ? void 0 : overview.topDecileGift) !== null && _ref1 !== void 0 ? _ref1 : overview === null || overview === void 0 ? void 0 : overview.topDecile) !== null && _ref0 !== void 0 ? _ref0 : apiData === null || apiData === void 0 ? void 0 : apiData.topDecileGift) !== null && _ref9 !== void 0 ? _ref9 : apiData === null || apiData === void 0 ? void 0 : apiData.topDecileDonation) !== null && _ref8 !== void 0 ? _ref8 : apiData === null || apiData === void 0 ? void 0 : apiData.topDecile) !== null && _ref7 !== void 0 ? _ref7 : 0);
1508
1509
  return {
1509
1510
  median: median,
1510
1511
  topDecile: topDecile
@@ -1516,11 +1517,11 @@ var parseAvgDonationDetail = function parseAvgDonationDetail() {
1516
1517
  var parseDonorGeographyList = function parseDonorGeographyList(donorGeographyData) {
1517
1518
  var rawCountries = Array.isArray(donorGeographyData) ? donorGeographyData : (donorGeographyData === null || donorGeographyData === void 0 ? void 0 : donorGeographyData.countries) || (donorGeographyData === null || donorGeographyData === void 0 ? void 0 : donorGeographyData.data) || [];
1518
1519
  return rawCountries.map(function (item) {
1519
- var _item$percentage, _ref1, _ref10, _item$value;
1520
+ var _item$percentage, _ref10, _ref11, _item$value;
1520
1521
  return {
1521
1522
  country: item.countryName || item.country || item.name || "Unknown",
1522
1523
  percentage: typeof item.percentage === "number" ? item.percentage : Number((_item$percentage = item.percentage) !== null && _item$percentage !== void 0 ? _item$percentage : 0),
1523
- value: item.donations !== undefined ? item.donations : (_ref1 = (_ref10 = (_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : item.totalDonors) !== null && _ref10 !== void 0 ? _ref10 : item.donors) !== null && _ref1 !== void 0 ? _ref1 : 0
1524
+ value: item.donations !== undefined ? item.donations : (_ref10 = (_ref11 = (_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : item.totalDonors) !== null && _ref11 !== void 0 ? _ref11 : item.donors) !== null && _ref10 !== void 0 ? _ref10 : 0
1524
1525
  };
1525
1526
  });
1526
1527
  };
@@ -1672,7 +1673,8 @@ var buildReportData = function buildReportData() {
1672
1673
  type: "progress",
1673
1674
  progress: Math.round((campaign.collectedAmount || 0) / (campaign.usdTargetAmount || 1) * 100),
1674
1675
  val3: formatNumber(campaign.uniqueDonationsCount || 0),
1675
- val4: "$".concat(formatNumber(campaign.avgGift || 0))
1676
+ val4: "$".concat(formatNumber(campaign.avgGift || campaign.averageDonation || 0)),
1677
+ status: campaign.status || ""
1676
1678
  };
1677
1679
  });
1678
1680
  return {
@@ -1709,12 +1711,9 @@ var MIN_H = 1123;
1709
1711
  var MX = 32; // horizontal margin
1710
1712
  var THEME = {
1711
1713
  pageBg: "#F9FAFB",
1712
- panelBg: "#FFFFFF",
1713
1714
  panelBorder: "#E5E7EB",
1714
1715
  brand: "#6366F1",
1715
1716
  kpiBorderPrimary: "#C7D2FE",
1716
- tableHeadBg: "#EEF2FF",
1717
- tableAltBg: "#F8FAFF",
1718
1717
  muted: "#9CA3AF",
1719
1718
  text: "#111827",
1720
1719
  trendUpBg: "#D1FAE5",
@@ -1745,56 +1744,6 @@ var pct = function pct(v) {
1745
1744
  var dp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
1746
1745
  return "".concat(Number(v !== null && v !== void 0 ? v : 0).toFixed(dp), "%");
1747
1746
  };
1748
- var TREND_UP = "#0B8F61";
1749
- var TREND_DOWN = "#ef4444";
1750
- var resolveTrendColor = function resolveTrendColor(trendText) {
1751
- var trendPositiveWhenNegative = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1752
- return getTrendColor(trendText, trendPositiveWhenNegative ? {
1753
- up: TREND_DOWN,
1754
- down: TREND_UP,
1755
- neutral: TREND_UP
1756
- } : {
1757
- up: TREND_UP,
1758
- down: TREND_DOWN,
1759
- neutral: TREND_UP
1760
- });
1761
- };
1762
- var withTrendArrow = function withTrendArrow(text) {
1763
- var str = String(text !== null && text !== void 0 ? text : "").trim();
1764
- if (!str || str.includes("▼") || str.includes("▲")) return str;
1765
- var arrow = getTrendArrow(str);
1766
- return arrow ? "".concat(arrow, " ").concat(str) : str;
1767
- };
1768
- var formatArrowTrend = function formatArrowTrend(value) {
1769
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
1770
- _ref$suffix = _ref.suffix,
1771
- suffix = _ref$suffix === void 0 ? "%" : _ref$suffix,
1772
- _ref$decimals = _ref.decimals,
1773
- decimals = _ref$decimals === void 0 ? 1 : _ref$decimals,
1774
- _ref$label = _ref.label,
1775
- label = _ref$label === void 0 ? "" : _ref$label;
1776
- var n = Number(value !== null && value !== void 0 ? value : 0);
1777
- var arrow = n >= 0 ? "▲" : "▼";
1778
- var labelSuffix = label ? " ".concat(label) : "";
1779
- if (suffix === "pp") return "".concat(arrow, " ").concat(Math.abs(n).toFixed(2), "pp").concat(labelSuffix);
1780
- if (suffix === "x") return "".concat(arrow, " ").concat(Math.abs(n).toFixed(1), "x").concat(labelSuffix);
1781
- return "".concat(arrow, " ").concat(Math.abs(n).toFixed(decimals), "%").concat(labelSuffix);
1782
- };
1783
- var TrendText = function TrendText(_ref2) {
1784
- var children = _ref2.children,
1785
- _ref2$invert = _ref2.invert,
1786
- invert = _ref2$invert === void 0 ? false : _ref2$invert,
1787
- _ref2$style = _ref2.style,
1788
- style = _ref2$style === void 0 ? {} : _ref2$style;
1789
- var text = withTrendArrow(children);
1790
- return /*#__PURE__*/jsx("span", {
1791
- style: _objectSpread2({
1792
- fontWeight: 600,
1793
- color: resolveTrendColor(text, invert)
1794
- }, style),
1795
- children: text
1796
- });
1797
- };
1798
1747
 
1799
1748
  // ─── SVG path helpers ─────────────────────────────────────────────────────────
1800
1749
  var buildSmoothPath = function buildSmoothPath(points) {
@@ -1956,119 +1905,6 @@ var Divider = function Divider(_ref5) {
1956
1905
  }
1957
1906
  });
1958
1907
  };
1959
- var Panel = function Panel(_ref6) {
1960
- var children = _ref6.children,
1961
- title = _ref6.title,
1962
- subtitle = _ref6.subtitle,
1963
- action = _ref6.action,
1964
- _ref6$style = _ref6.style,
1965
- style = _ref6$style === void 0 ? {} : _ref6$style;
1966
- return /*#__PURE__*/jsxs("div", {
1967
- style: _objectSpread2({
1968
- border: "1px solid ".concat(THEME.panelBorder),
1969
- borderRadius: 8,
1970
- background: THEME.panelBg,
1971
- padding: 12,
1972
- display: "flex",
1973
- flexDirection: "column",
1974
- boxSizing: "border-box",
1975
- boxShadow: "0 1px 0 rgba(15,23,42,0.03)"
1976
- }, style),
1977
- children: [(title || subtitle || action) && /*#__PURE__*/jsxs("div", {
1978
- style: {
1979
- display: "flex",
1980
- justifyContent: "space-between",
1981
- alignItems: "flex-start",
1982
- marginBottom: 8,
1983
- flexShrink: 0
1984
- },
1985
- children: [/*#__PURE__*/jsxs("div", {
1986
- children: [title && /*#__PURE__*/jsx("div", {
1987
- style: {
1988
- fontSize: 12,
1989
- fontWeight: 700,
1990
- color: THEME.text,
1991
- lineHeight: 1.15
1992
- },
1993
- children: title
1994
- }), subtitle && /*#__PURE__*/jsx("div", {
1995
- style: {
1996
- fontSize: 9.5,
1997
- color: THEME.muted,
1998
- lineHeight: 1.15
1999
- },
2000
- children: subtitle
2001
- })]
2002
- }), action && /*#__PURE__*/jsx("div", {
2003
- style: {
2004
- fontSize: 9.5,
2005
- color: "#6366F1",
2006
- fontWeight: 500,
2007
- flexShrink: 0
2008
- },
2009
- children: action
2010
- })]
2011
- }), children]
2012
- });
2013
- };
2014
- var MiniTable = function MiniTable(_ref7) {
2015
- var _ref7$head = _ref7.head,
2016
- head = _ref7$head === void 0 ? [] : _ref7$head,
2017
- _ref7$rows = _ref7.rows,
2018
- rows = _ref7$rows === void 0 ? [] : _ref7$rows,
2019
- _ref7$colAlign = _ref7.colAlign,
2020
- colAlign = _ref7$colAlign === void 0 ? [] : _ref7$colAlign;
2021
- return /*#__PURE__*/jsxs("table", {
2022
- style: {
2023
- width: "100%",
2024
- borderCollapse: "collapse",
2025
- fontSize: 9.5,
2026
- tableLayout: "fixed",
2027
- background: "#fff"
2028
- },
2029
- children: [/*#__PURE__*/jsx("thead", {
2030
- children: /*#__PURE__*/jsx("tr", {
2031
- style: {
2032
- background: THEME.tableHeadBg
2033
- },
2034
- children: head.map(function (h, i) {
2035
- return /*#__PURE__*/jsx("th", {
2036
- style: {
2037
- padding: "4px 6px",
2038
- textAlign: colAlign[i] || (i === 0 ? "left" : "right"),
2039
- fontWeight: 700,
2040
- fontSize: 8.5,
2041
- letterSpacing: "0.3px",
2042
- color: "#64748B",
2043
- borderBottom: "1px solid #DDE3EA"
2044
- },
2045
- children: h
2046
- }, i);
2047
- })
2048
- })
2049
- }), /*#__PURE__*/jsx("tbody", {
2050
- children: rows.map(function (row, ri) {
2051
- return /*#__PURE__*/jsx("tr", {
2052
- style: {
2053
- background: ri % 2 === 1 ? THEME.tableAltBg : "#fff"
2054
- },
2055
- children: row.map(function (cell, ci) {
2056
- return /*#__PURE__*/jsx("td", {
2057
- style: {
2058
- padding: "4px 6px",
2059
- textAlign: colAlign[ci] || (ci === 0 ? "left" : "right"),
2060
- color: "#334155",
2061
- borderBottom: ri < rows.length - 1 ? "1px solid #EEF2F7" : "none",
2062
- verticalAlign: "middle"
2063
- },
2064
- children: cell
2065
- }, ci);
2066
- })
2067
- }, ri);
2068
- })
2069
- })]
2070
- });
2071
- };
2072
1908
  var ProgressBar = function ProgressBar(_ref8) {
2073
1909
  var value = _ref8.value,
2074
1910
  _ref8$color = _ref8.color,
@@ -2117,71 +1953,6 @@ var ProgressBar = function ProgressBar(_ref8) {
2117
1953
  })]
2118
1954
  });
2119
1955
  };
2120
- var DonorGeographyPanel = function DonorGeographyPanel(_ref9) {
2121
- var _ref9$geoList = _ref9.geoList,
2122
- geoList = _ref9$geoList === void 0 ? [] : _ref9$geoList,
2123
- _ref9$totalDonors = _ref9.totalDonors,
2124
- totalDonors = _ref9$totalDonors === void 0 ? 0 : _ref9$totalDonors,
2125
- _ref9$barColor = _ref9.barColor,
2126
- barColor = _ref9$barColor === void 0 ? "#6366F1" : _ref9$barColor;
2127
- return /*#__PURE__*/jsx(Panel, {
2128
- title: "Donor geography",
2129
- subtitle: "Top countries - ".concat(formatNumber(totalDonors), " total"),
2130
- children: (geoList.length ? geoList.slice(0, 6) : []).map(function (g, i) {
2131
- var _g$percentage;
2132
- return /*#__PURE__*/jsxs("div", {
2133
- style: {
2134
- padding: i < 5 ? "0 0 5px" : 0,
2135
- marginBottom: i < 5 ? 5 : 0,
2136
- borderBottom: i < 5 ? "1px solid #F3F4F6" : "none"
2137
- },
2138
- children: [/*#__PURE__*/jsxs("div", {
2139
- style: {
2140
- display: "flex",
2141
- justifyContent: "space-between",
2142
- alignItems: "center",
2143
- gap: 6,
2144
- marginBottom: 3
2145
- },
2146
- children: [/*#__PURE__*/jsx("span", {
2147
- style: {
2148
- fontSize: 9,
2149
- color: "#374151",
2150
- overflow: "hidden",
2151
- textOverflow: "ellipsis",
2152
- whiteSpace: "nowrap",
2153
- minWidth: 0
2154
- },
2155
- children: g.country
2156
- }), /*#__PURE__*/jsxs("span", {
2157
- style: {
2158
- fontSize: 9,
2159
- fontWeight: 700,
2160
- color: "#111827",
2161
- flexShrink: 0
2162
- },
2163
- children: [formatNumber(g.value), " - ", formatNumber(g.percentage), "%"]
2164
- })]
2165
- }), /*#__PURE__*/jsx("div", {
2166
- style: {
2167
- height: 5,
2168
- background: "#F3F4F6",
2169
- borderRadius: 3,
2170
- overflow: "hidden"
2171
- },
2172
- children: /*#__PURE__*/jsx("div", {
2173
- style: {
2174
- width: "".concat(Math.min(100, Math.max(0, Number((_g$percentage = g.percentage) !== null && _g$percentage !== void 0 ? _g$percentage : 0))), "%"),
2175
- height: "100%",
2176
- background: barColor,
2177
- borderRadius: 3
2178
- }
2179
- })
2180
- })]
2181
- }, i);
2182
- })
2183
- });
2184
- };
2185
1956
  var formatDonationTypeCategory = function formatDonationTypeCategory(label, slotWidth) {
2186
1957
  var str = String(label !== null && label !== void 0 ? label : "").trim();
2187
1958
  if (!str) return "";
@@ -2197,401 +1968,46 @@ var formatDonationTypeCategory = function formatDonationTypeCategory(label, slot
2197
1968
  if (noYear.length <= maxChars) return noYear;
2198
1969
  return "".concat(noYear.slice(0, Math.max(1, maxChars - 1)), "\u2026");
2199
1970
  };
2200
- var DonationTypeBarSvg = function DonationTypeBarSvg(_ref0) {
2201
- var _ref0$categories = _ref0.categories,
2202
- categories = _ref0$categories === void 0 ? [] : _ref0$categories,
2203
- _ref0$recurring = _ref0.recurring,
2204
- recurring = _ref0$recurring === void 0 ? [] : _ref0$recurring,
2205
- _ref0$oneTime = _ref0.oneTime,
2206
- oneTime = _ref0$oneTime === void 0 ? [] : _ref0$oneTime,
2207
- _ref0$recurringColor = _ref0.recurringColor,
2208
- recurringColor = _ref0$recurringColor === void 0 ? "#6366F1" : _ref0$recurringColor,
2209
- _ref0$oneTimeColor = _ref0.oneTimeColor,
2210
- oneTimeColor = _ref0$oneTimeColor === void 0 ? "#10B981" : _ref0$oneTimeColor;
2211
- var width = 158;
2212
- var height = 96;
2213
- var padL = 30;
2214
- var padR = 2;
2215
- var padT = 14;
2216
- var padB = 20;
2217
- var chartW = width - padL - padR;
2218
- var chartH = height - padT - padB;
2219
- var allVals = [].concat(_toConsumableArray(recurring), _toConsumableArray(oneTime));
2220
- var maxVal = Math.max.apply(Math, _toConsumableArray(allVals).concat([0])) || 1;
2221
- var n = categories.length;
2222
- var yTicks = [0, maxVal / 2, maxVal];
2223
- var groupW = n > 0 ? chartW / n : chartW;
2224
- var labelFontSize = n > 3 ? 5 : 5.5;
2225
- if (!n) {
2226
- return /*#__PURE__*/jsxs("svg", {
2227
- width: "100%",
2228
- height: height,
2229
- viewBox: "0 0 ".concat(width, " ").concat(height),
2230
- style: {
2231
- display: "block"
2232
- },
2233
- children: [/*#__PURE__*/jsx("line", {
2234
- x1: padL,
2235
- y1: padT + chartH,
2236
- x2: width - padR,
2237
- y2: padT + chartH,
2238
- stroke: "#f1f1f1"
2239
- }), /*#__PURE__*/jsx("text", {
2240
- x: padL - 4,
2241
- y: padT + chartH + 3,
2242
- textAnchor: "end",
2243
- fontSize: 7,
2244
- fill: "rgba(0,0,0,0.4)",
2245
- children: "$0"
2246
- })]
2247
- });
2248
- }
2249
- var barW = Math.min(groupW * 0.3, 12);
2250
- var baseY = padT + chartH;
2251
- return /*#__PURE__*/jsxs("svg", {
2252
- width: "100%",
2253
- height: height,
2254
- viewBox: "0 0 ".concat(width, " ").concat(height),
1971
+ var TrendPill$1 = function TrendPill(_ref12) {
1972
+ var children = _ref12.children,
1973
+ _ref12$positive = _ref12.positive,
1974
+ positive = _ref12$positive === void 0 ? true : _ref12$positive;
1975
+ return /*#__PURE__*/jsx("span", {
2255
1976
  style: {
2256
- display: "block"
1977
+ display: "inline-flex",
1978
+ alignItems: "center",
1979
+ background: positive ? THEME.trendUpBg : "#FEE2E2",
1980
+ color: positive ? THEME.trendUpText : "#DC2626",
1981
+ padding: "3px 10px",
1982
+ borderRadius: 100,
1983
+ fontSize: 9,
1984
+ fontWeight: 600,
1985
+ whiteSpace: "nowrap",
1986
+ lineHeight: 1.35
2257
1987
  },
2258
- children: [/*#__PURE__*/jsx("defs", {
2259
- children: categories.map(function (_, i) {
2260
- return /*#__PURE__*/jsx("clipPath", {
2261
- id: "donation-type-cat-clip-".concat(i),
2262
- children: /*#__PURE__*/jsx("rect", {
2263
- x: padL + i * groupW,
2264
- y: baseY + 2,
2265
- width: groupW,
2266
- height: padB - 2
2267
- })
2268
- }, "clip-".concat(i));
2269
- })
2270
- }), yTicks.map(function (tick, i) {
2271
- var y = padT + chartH - tick / maxVal * chartH;
2272
- return /*#__PURE__*/jsxs("g", {
2273
- children: [/*#__PURE__*/jsx("line", {
2274
- x1: padL,
2275
- y1: y,
2276
- x2: width - padR,
2277
- y2: y,
2278
- stroke: "#f1f1f1",
2279
- strokeDasharray: "4"
2280
- }), /*#__PURE__*/jsx("text", {
2281
- x: padL - 4,
2282
- y: y + 3,
2283
- textAnchor: "end",
2284
- fontSize: 7,
2285
- fill: "rgba(0,0,0,0.4)",
2286
- children: d$Compact(tick)
2287
- })]
2288
- }, "y-".concat(i));
2289
- }), categories.map(function (cat, i) {
2290
- var groupX = padL + i * groupW + groupW / 2;
2291
- var rVal = recurring[i] || 0;
2292
- var oVal = oneTime[i] || 0;
2293
- var rH = rVal / maxVal * chartH;
2294
- var oH = oVal / maxVal * chartH;
2295
- var rX = groupX - barW - 1;
2296
- var oX = groupX + 1;
2297
- return /*#__PURE__*/jsxs("g", {
2298
- children: [rVal > 0 && /*#__PURE__*/jsxs(Fragment, {
2299
- children: [/*#__PURE__*/jsx("rect", {
2300
- x: rX,
2301
- y: baseY - rH,
2302
- width: barW,
2303
- height: Math.max(rH, 1),
2304
- fill: recurringColor,
2305
- rx: 2
2306
- }), /*#__PURE__*/jsx("text", {
2307
- x: rX + barW / 2,
2308
- y: baseY - rH - 3,
2309
- textAnchor: "middle",
2310
- fontSize: 6.5,
2311
- fontWeight: 600,
2312
- fill: "#111827",
2313
- children: d$Compact(rVal)
2314
- })]
2315
- }), oVal > 0 && /*#__PURE__*/jsxs(Fragment, {
2316
- children: [/*#__PURE__*/jsx("rect", {
2317
- x: oX,
2318
- y: baseY - oH,
2319
- width: barW,
2320
- height: Math.max(oH, 1),
2321
- fill: oneTimeColor,
2322
- rx: 2
2323
- }), /*#__PURE__*/jsx("text", {
2324
- x: oX + barW / 2,
2325
- y: baseY - oH - 3,
2326
- textAnchor: "middle",
2327
- fontSize: 6.5,
2328
- fontWeight: 600,
2329
- fill: "#111827",
2330
- children: d$Compact(oVal)
2331
- })]
2332
- }), /*#__PURE__*/jsx("text", {
2333
- x: groupX,
2334
- y: height - 5,
2335
- textAnchor: "middle",
2336
- fontSize: labelFontSize,
2337
- fill: "rgba(0,0,0,0.4)",
2338
- clipPath: "url(#donation-type-cat-clip-".concat(i, ")"),
2339
- children: formatDonationTypeCategory(cat, groupW)
2340
- })]
2341
- }, "bar-".concat(i));
2342
- })]
1988
+ children: children
2343
1989
  });
2344
1990
  };
2345
- var DonationTypePanel = function DonationTypePanel(_ref1) {
2346
- var donationTypeData = _ref1.donationTypeData,
2347
- _ref1$recurringColor = _ref1.recurringColor,
2348
- recurringColor = _ref1$recurringColor === void 0 ? "#6366F1" : _ref1$recurringColor,
2349
- _ref1$oneTimeColor = _ref1.oneTimeColor,
2350
- oneTimeColor = _ref1$oneTimeColor === void 0 ? "#10B981" : _ref1$oneTimeColor;
2351
- var _parseDonationTypeCha = parseDonationTypeChartData(donationTypeData),
2352
- categories = _parseDonationTypeCha.categories,
2353
- recurring = _parseDonationTypeCha.recurring,
2354
- oneTime = _parseDonationTypeCha.oneTime,
2355
- recurringTotal = _parseDonationTypeCha.recurringTotal,
2356
- oneTimeTotal = _parseDonationTypeCha.oneTimeTotal;
2357
- return /*#__PURE__*/jsxs(Panel, {
2358
- title: "Recurring vs one-time",
2359
- subtitle: "Donation type - weekly",
2360
- children: [/*#__PURE__*/jsx("div", {
2361
- style: {
2362
- display: "flex",
2363
- flexWrap: "wrap",
2364
- gap: "6px 10px",
2365
- marginBottom: 4
2366
- },
2367
- children: [{
2368
- label: "Recurring",
2369
- total: recurringTotal,
2370
- color: recurringColor
2371
- }, {
2372
- label: "One-time",
2373
- total: oneTimeTotal,
2374
- color: oneTimeColor
2375
- }].map(function (item) {
2376
- return /*#__PURE__*/jsxs("div", {
2377
- style: {
2378
- display: "flex",
2379
- alignItems: "center",
2380
- gap: 4
2381
- },
2382
- children: [/*#__PURE__*/jsx("div", {
2383
- style: {
2384
- width: 6,
2385
- height: 6,
2386
- borderRadius: "50%",
2387
- background: item.color,
2388
- flexShrink: 0
2389
- }
2390
- }), /*#__PURE__*/jsx("span", {
2391
- style: {
2392
- fontSize: 9.5,
2393
- color: "#374151"
2394
- },
2395
- children: item.label
2396
- }), /*#__PURE__*/jsx("span", {
2397
- style: {
2398
- fontSize: 9.5,
2399
- fontWeight: 700,
2400
- color: "#111827"
2401
- },
2402
- children: d$(item.total)
2403
- })]
2404
- }, item.label);
2405
- })
2406
- }), /*#__PURE__*/jsx(DonationTypeBarSvg, {
2407
- categories: categories,
2408
- recurring: recurring,
2409
- oneTime: oneTime,
2410
- recurringColor: recurringColor,
2411
- oneTimeColor: oneTimeColor
2412
- })]
2413
- });
1991
+ var isTrendPositive = function isTrendPositive(trendText) {
1992
+ var invert = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1993
+ var n = Number(String(trendText !== null && trendText !== void 0 ? trendText : "").replace(/[^0-9.\-+]/g, ""));
1994
+ if (Number.isNaN(n)) return true;
1995
+ return invert ? n <= 0 : n >= 0;
2414
1996
  };
2415
- var AcceptanceRaisedPanel = function AcceptanceRaisedPanel(_ref10) {
2416
- var title = _ref10.title,
2417
- subtitle = _ref10.subtitle,
2418
- _ref10$acceptanceRate = _ref10.acceptanceRate,
2419
- acceptanceRate = _ref10$acceptanceRate === void 0 ? 0 : _ref10$acceptanceRate,
2420
- _ref10$acceptanceGrow = _ref10.acceptanceGrowth,
2421
- acceptanceGrowth = _ref10$acceptanceGrow === void 0 ? 0 : _ref10$acceptanceGrow,
2422
- _ref10$raised = _ref10.raised,
2423
- raised = _ref10$raised === void 0 ? 0 : _ref10$raised,
2424
- _ref10$raisedGrowth = _ref10.raisedGrowth,
2425
- raisedGrowth = _ref10$raisedGrowth === void 0 ? 0 : _ref10$raisedGrowth,
2426
- _ref10$primaryColor = _ref10.primaryColor,
2427
- primaryColor = _ref10$primaryColor === void 0 ? "#6366F1" : _ref10$primaryColor,
2428
- _ref10$secondaryColor = _ref10.secondaryColor,
2429
- secondaryColor = _ref10$secondaryColor === void 0 ? "#88bfd290" : _ref10$secondaryColor;
2430
- return /*#__PURE__*/jsx(Panel, {
2431
- title: title,
2432
- subtitle: subtitle,
1997
+ var PageOneHeader = function PageOneHeader(_ref13) {
1998
+ var dateLabel = _ref13.dateLabel,
1999
+ generatedLabel = _ref13.generatedLabel,
2000
+ windowLabel = _ref13.windowLabel;
2001
+ return /*#__PURE__*/jsx("div", {
2002
+ style: {
2003
+ padding: "36px ".concat(MX, "px 0"),
2004
+ flexShrink: 0
2005
+ },
2433
2006
  children: /*#__PURE__*/jsxs("div", {
2434
2007
  style: {
2435
2008
  display: "flex",
2436
- flexDirection: "column",
2437
- alignItems: "center"
2438
- },
2439
- children: [/*#__PURE__*/jsx(Donut, {
2440
- segments: [{
2441
- value: acceptanceRate,
2442
- color: primaryColor
2443
- }, {
2444
- value: Math.max(0, 100 - acceptanceRate),
2445
- color: "#E5E7EB"
2446
- }],
2447
- size: 88,
2448
- centerVal: "".concat(formatNumber(acceptanceRate), "%"),
2449
- centerLabel: "accepted"
2450
- }), /*#__PURE__*/jsxs("div", {
2451
- style: {
2452
- width: "100%",
2453
- marginTop: 6
2454
- },
2455
- children: [/*#__PURE__*/jsxs("div", {
2456
- style: {
2457
- display: "flex",
2458
- justifyContent: "space-between",
2459
- alignItems: "center",
2460
- marginBottom: 5
2461
- },
2462
- children: [/*#__PURE__*/jsxs("div", {
2463
- style: {
2464
- display: "flex",
2465
- alignItems: "center",
2466
- gap: 5
2467
- },
2468
- children: [/*#__PURE__*/jsx("div", {
2469
- style: {
2470
- width: 8,
2471
- height: 8,
2472
- borderRadius: 2,
2473
- background: primaryColor,
2474
- flexShrink: 0
2475
- }
2476
- }), /*#__PURE__*/jsx("span", {
2477
- style: {
2478
- fontSize: 9.5,
2479
- color: "#6B7280"
2480
- },
2481
- children: "Acceptance"
2482
- })]
2483
- }), /*#__PURE__*/jsxs("div", {
2484
- style: {
2485
- display: "flex",
2486
- alignItems: "baseline",
2487
- gap: 4
2488
- },
2489
- children: [/*#__PURE__*/jsxs("span", {
2490
- style: {
2491
- fontSize: 9.5,
2492
- fontWeight: 700,
2493
- color: "#111827"
2494
- },
2495
- children: [formatNumber(acceptanceRate), "%"]
2496
- }), /*#__PURE__*/jsx(TrendText, {
2497
- style: {
2498
- fontSize: 9
2499
- },
2500
- children: formatArrowTrend(acceptanceGrowth)
2501
- })]
2502
- })]
2503
- }), /*#__PURE__*/jsxs("div", {
2504
- style: {
2505
- display: "flex",
2506
- justifyContent: "space-between",
2507
- alignItems: "center"
2508
- },
2509
- children: [/*#__PURE__*/jsxs("div", {
2510
- style: {
2511
- display: "flex",
2512
- alignItems: "center",
2513
- gap: 5
2514
- },
2515
- children: [/*#__PURE__*/jsx("div", {
2516
- style: {
2517
- width: 8,
2518
- height: 8,
2519
- borderRadius: 2,
2520
- background: secondaryColor,
2521
- flexShrink: 0
2522
- }
2523
- }), /*#__PURE__*/jsx("span", {
2524
- style: {
2525
- fontSize: 9.5,
2526
- color: "#6B7280"
2527
- },
2528
- children: "Raised"
2529
- })]
2530
- }), /*#__PURE__*/jsxs("div", {
2531
- style: {
2532
- display: "flex",
2533
- alignItems: "baseline",
2534
- gap: 4
2535
- },
2536
- children: [/*#__PURE__*/jsx("span", {
2537
- style: {
2538
- fontSize: 9.5,
2539
- fontWeight: 700,
2540
- color: "#111827"
2541
- },
2542
- children: d$(raised)
2543
- }), /*#__PURE__*/jsx(TrendText, {
2544
- style: {
2545
- fontSize: 9
2546
- },
2547
- children: formatArrowTrend(raisedGrowth)
2548
- })]
2549
- })]
2550
- })]
2551
- })]
2552
- })
2553
- });
2554
- };
2555
- var TrendPill$1 = function TrendPill(_ref12) {
2556
- var children = _ref12.children,
2557
- _ref12$positive = _ref12.positive,
2558
- positive = _ref12$positive === void 0 ? true : _ref12$positive;
2559
- return /*#__PURE__*/jsx("span", {
2560
- style: {
2561
- display: "inline-flex",
2562
- alignItems: "center",
2563
- background: positive ? THEME.trendUpBg : "#FEE2E2",
2564
- color: positive ? THEME.trendUpText : "#DC2626",
2565
- padding: "3px 10px",
2566
- borderRadius: 100,
2567
- fontSize: 9,
2568
- fontWeight: 600,
2569
- whiteSpace: "nowrap",
2570
- lineHeight: 1.35
2571
- },
2572
- children: children
2573
- });
2574
- };
2575
- var isTrendPositive = function isTrendPositive(trendText) {
2576
- var invert = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2577
- var n = Number(String(trendText !== null && trendText !== void 0 ? trendText : "").replace(/[^0-9.\-+]/g, ""));
2578
- if (Number.isNaN(n)) return true;
2579
- return invert ? n <= 0 : n >= 0;
2580
- };
2581
- var PageOneHeader = function PageOneHeader(_ref13) {
2582
- var dateLabel = _ref13.dateLabel,
2583
- generatedLabel = _ref13.generatedLabel,
2584
- windowLabel = _ref13.windowLabel;
2585
- return /*#__PURE__*/jsx("div", {
2586
- style: {
2587
- padding: "36px ".concat(MX, "px 0"),
2588
- flexShrink: 0
2589
- },
2590
- children: /*#__PURE__*/jsxs("div", {
2591
- style: {
2592
- display: "flex",
2593
- justifyContent: "space-between",
2594
- alignItems: "flex-start"
2009
+ justifyContent: "space-between",
2010
+ alignItems: "flex-start"
2595
2011
  },
2596
2012
  children: [/*#__PURE__*/jsxs("div", {
2597
2013
  children: [/*#__PURE__*/jsx("div", {
@@ -2815,13 +2231,14 @@ var MetricGridCard = function MetricGridCard(_ref16) {
2815
2231
  })]
2816
2232
  });
2817
2233
  };
2818
- var PageOneFooter = function PageOneFooter(_ref17) {
2234
+ var PdfPageFooter = function PdfPageFooter(_ref17) {
2819
2235
  var generatedBy = _ref17.generatedBy,
2820
- generatedLabel = _ref17.generatedLabel;
2236
+ generatedDate = _ref17.generatedDate,
2237
+ generatedTime = _ref17.generatedTime,
2238
+ page = _ref17.page;
2821
2239
  return /*#__PURE__*/jsx("div", {
2822
2240
  style: {
2823
- padding: "14px ".concat(MX, "px 28px"),
2824
- borderTop: "1px solid ".concat(THEME.panelBorder),
2241
+ padding: "24px ".concat(MX, "px 36px"),
2825
2242
  marginTop: "auto",
2826
2243
  flexShrink: 0
2827
2244
  },
@@ -2830,223 +2247,1049 @@ var PageOneFooter = function PageOneFooter(_ref17) {
2830
2247
  display: "flex",
2831
2248
  justifyContent: "space-between",
2832
2249
  alignItems: "center",
2833
- fontSize: 8,
2834
- color: THEME.muted,
2835
- lineHeight: 1.4
2250
+ gap: 12,
2251
+ fontSize: 9,
2252
+ fontWeight: 400,
2253
+ color: "#9CA3AF",
2254
+ lineHeight: 1.35
2836
2255
  },
2837
2256
  children: [/*#__PURE__*/jsxs("span", {
2838
- children: ["Confidential", BULLET, "Generated by ", generatedBy, BULLET, generatedLabel]
2257
+ style: {
2258
+ flex: 1,
2259
+ minWidth: 0
2260
+ },
2261
+ children: ["Confidential", BULLET, "Generated by ", generatedBy, BULLET, generatedDate, BULLET, generatedTime]
2839
2262
  }), /*#__PURE__*/jsxs("span", {
2840
- children: ["Page 1 of 2", BULLET, "madinah.com"]
2263
+ style: {
2264
+ flexShrink: 0,
2265
+ textAlign: "right"
2266
+ },
2267
+ children: ["Page ", page, " of 2", BULLET, "madinah.com"]
2841
2268
  })]
2842
2269
  })
2843
2270
  });
2844
2271
  };
2845
- var PageHeader = function PageHeader(_ref18) {
2846
- var dateLabel = _ref18.dateLabel,
2847
- generatedLabel = _ref18.generatedLabel,
2848
- activeFilters = _ref18.activeFilters,
2849
- page = _ref18.page,
2850
- windowLabel = _ref18.windowLabel;
2272
+ var P2Card = function P2Card(_ref18) {
2273
+ var children = _ref18.children,
2274
+ title = _ref18.title,
2275
+ subtitle = _ref18.subtitle,
2276
+ action = _ref18.action,
2277
+ _ref18$style = _ref18.style,
2278
+ style = _ref18$style === void 0 ? {} : _ref18$style;
2851
2279
  return /*#__PURE__*/jsxs("div", {
2852
- style: {
2853
- padding: "22px ".concat(MX, "px 12px"),
2854
- borderBottom: "1px solid #DEE5EF",
2280
+ style: _objectSpread2({
2281
+ border: "1px solid ".concat(THEME.panelBorder),
2282
+ borderRadius: 12,
2855
2283
  background: "#FFFFFF",
2856
- flexShrink: 0
2857
- },
2858
- children: [/*#__PURE__*/jsx("div", {
2284
+ padding: "13px 14px 12px",
2285
+ display: "flex",
2286
+ flexDirection: "column",
2287
+ boxSizing: "border-box",
2288
+ minWidth: 0
2289
+ }, style),
2290
+ children: [(title || subtitle || action) && /*#__PURE__*/jsxs("div", {
2859
2291
  style: {
2860
2292
  display: "flex",
2861
2293
  justifyContent: "space-between",
2862
- alignItems: "center"
2294
+ alignItems: "flex-start",
2295
+ marginBottom: 10,
2296
+ flexShrink: 0,
2297
+ gap: 8
2863
2298
  },
2864
- children: /*#__PURE__*/jsxs("div", {
2299
+ children: [/*#__PURE__*/jsxs("div", {
2865
2300
  style: {
2866
- display: "flex",
2867
- alignItems: "baseline",
2868
- gap: 10
2301
+ minWidth: 0
2869
2302
  },
2870
- children: [/*#__PURE__*/jsx("span", {
2303
+ children: [title && /*#__PURE__*/jsx("div", {
2871
2304
  style: {
2872
- fontSize: 20,
2873
- fontWeight: 800,
2305
+ fontSize: 12,
2306
+ fontWeight: 700,
2874
2307
  color: THEME.text,
2875
- letterSpacing: "-0.5px"
2308
+ lineHeight: 1.15
2876
2309
  },
2877
- children: "Madinah"
2878
- }), /*#__PURE__*/jsx("span", {
2310
+ children: title
2311
+ }), subtitle && /*#__PURE__*/jsx("div", {
2879
2312
  style: {
2880
- fontSize: 8.5,
2881
- fontWeight: 700,
2882
- letterSpacing: "1.5px",
2883
- color: "#94A3B8",
2884
- textTransform: "uppercase"
2313
+ fontSize: 9,
2314
+ color: THEME.muted,
2315
+ marginTop: 2,
2316
+ lineHeight: 1.2
2885
2317
  },
2886
- children: "PERFORMANCE REPORT"
2318
+ children: subtitle
2887
2319
  })]
2888
- })
2889
- }), /*#__PURE__*/jsx("div", {
2890
- style: {
2891
- marginTop: 8,
2892
- fontSize: 13.5,
2893
- fontWeight: 700,
2894
- color: THEME.text
2895
- },
2896
- children: "Dashboard overview \u2014 Overall"
2897
- }), /*#__PURE__*/jsxs("div", {
2320
+ }), action]
2321
+ }), children]
2322
+ });
2323
+ };
2324
+ var campaignBarColor = function campaignBarColor() {
2325
+ var status = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
2326
+ var s = String(status).toLowerCase();
2327
+ if (s.includes("slow")) return "#F59E0B";
2328
+ if (s.includes("closing")) return "#14B8A6";
2329
+ return THEME.brand;
2330
+ };
2331
+ var StatusPill = function StatusPill(_ref19) {
2332
+ var _ref19$status = _ref19.status,
2333
+ status = _ref19$status === void 0 ? "" : _ref19$status;
2334
+ if (!String(status).trim()) {
2335
+ return /*#__PURE__*/jsx("span", {
2898
2336
  style: {
2899
- display: "flex",
2900
- justifyContent: "space-between",
2901
- marginTop: 2
2337
+ fontSize: 8,
2338
+ color: THEME.muted
2902
2339
  },
2903
- children: [/*#__PURE__*/jsxs("div", {
2904
- children: [/*#__PURE__*/jsx("div", {
2905
- style: {
2906
- fontSize: 10.5,
2907
- color: "#334155"
2908
- },
2909
- children: dateLabel
2910
- }), /*#__PURE__*/jsxs("div", {
2340
+ children: "\u2014"
2341
+ });
2342
+ }
2343
+ var s = String(status).toLowerCase();
2344
+ var styles = s.includes("slow") ? {
2345
+ bg: "#FEF3C7",
2346
+ color: "#D97706",
2347
+ label: String(status).includes("$") ? status : "$ ".concat(status)
2348
+ } : s.includes("closing") ? {
2349
+ bg: "#DBEAFE",
2350
+ color: "#2563EB",
2351
+ label: status || "Closing"
2352
+ } : {
2353
+ bg: "#D1FAE5",
2354
+ color: "#059669",
2355
+ label: status || "Active"
2356
+ };
2357
+ return /*#__PURE__*/jsx("span", {
2358
+ style: {
2359
+ display: "inline-flex",
2360
+ alignItems: "center",
2361
+ background: styles.bg,
2362
+ color: styles.color,
2363
+ padding: "2px 8px",
2364
+ borderRadius: 100,
2365
+ fontSize: 8,
2366
+ fontWeight: 600,
2367
+ whiteSpace: "nowrap",
2368
+ lineHeight: 1.3
2369
+ },
2370
+ children: styles.label
2371
+ });
2372
+ };
2373
+ var P2CampaignTable = function P2CampaignTable(_ref20) {
2374
+ var _ref20$rows = _ref20.rows,
2375
+ rows = _ref20$rows === void 0 ? [] : _ref20$rows;
2376
+ return /*#__PURE__*/jsxs("table", {
2377
+ style: {
2378
+ width: "100%",
2379
+ borderCollapse: "collapse",
2380
+ fontSize: 9,
2381
+ tableLayout: "fixed"
2382
+ },
2383
+ children: [/*#__PURE__*/jsx("thead", {
2384
+ children: /*#__PURE__*/jsx("tr", {
2385
+ children: ["Campaign", "Raised", "Progress", "Donors", "Status"].map(function (h, i) {
2386
+ return /*#__PURE__*/jsx("th", {
2387
+ style: {
2388
+ padding: "5px 4px",
2389
+ textAlign: i === 0 || i === 2 ? "left" : "right",
2390
+ fontWeight: 700,
2391
+ fontSize: 7.5,
2392
+ letterSpacing: "0.5px",
2393
+ color: THEME.muted,
2394
+ textTransform: "uppercase",
2395
+ borderBottom: "1px solid ".concat(THEME.panelBorder)
2396
+ },
2397
+ children: h
2398
+ }, h);
2399
+ })
2400
+ })
2401
+ }), /*#__PURE__*/jsx("tbody", {
2402
+ children: rows.length === 0 ? /*#__PURE__*/jsx("tr", {
2403
+ children: /*#__PURE__*/jsx("td", {
2404
+ colSpan: 5,
2911
2405
  style: {
2912
- fontSize: 9.5,
2406
+ padding: "10px 4px",
2407
+ fontSize: 9,
2913
2408
  color: THEME.muted,
2914
- marginTop: 1
2409
+ textAlign: "center"
2915
2410
  },
2916
- children: [windowLabel, " - Generated ", generatedLabel]
2917
- })]
2411
+ children: "No active campaigns"
2412
+ })
2413
+ }) : rows.map(function (row, ri) {
2414
+ return /*#__PURE__*/jsxs("tr", {
2415
+ children: [/*#__PURE__*/jsx("td", {
2416
+ style: {
2417
+ padding: "6px 4px",
2418
+ color: "#374151",
2419
+ fontSize: 8.5,
2420
+ borderBottom: ri < rows.length - 1 ? "1px solid #F3F4F6" : "none",
2421
+ overflow: "hidden",
2422
+ textOverflow: "ellipsis",
2423
+ whiteSpace: "nowrap"
2424
+ },
2425
+ children: row.name
2426
+ }), /*#__PURE__*/jsx("td", {
2427
+ style: {
2428
+ padding: "6px 4px",
2429
+ textAlign: "right",
2430
+ fontWeight: 700,
2431
+ color: THEME.text,
2432
+ fontSize: 8.5,
2433
+ borderBottom: ri < rows.length - 1 ? "1px solid #F3F4F6" : "none"
2434
+ },
2435
+ children: row.raised
2436
+ }), /*#__PURE__*/jsx("td", {
2437
+ style: {
2438
+ padding: "6px 4px",
2439
+ borderBottom: ri < rows.length - 1 ? "1px solid #F3F4F6" : "none"
2440
+ },
2441
+ children: /*#__PURE__*/jsx(ProgressBar, {
2442
+ value: row.progress,
2443
+ color: campaignBarColor(row.status),
2444
+ height: 5
2445
+ })
2446
+ }), /*#__PURE__*/jsx("td", {
2447
+ style: {
2448
+ padding: "6px 4px",
2449
+ textAlign: "right",
2450
+ fontWeight: 700,
2451
+ color: THEME.text,
2452
+ fontSize: 8.5,
2453
+ borderBottom: ri < rows.length - 1 ? "1px solid #F3F4F6" : "none"
2454
+ },
2455
+ children: row.donors
2456
+ }), /*#__PURE__*/jsx("td", {
2457
+ style: {
2458
+ padding: "6px 4px",
2459
+ textAlign: "right",
2460
+ borderBottom: ri < rows.length - 1 ? "1px solid #F3F4F6" : "none"
2461
+ },
2462
+ children: /*#__PURE__*/jsx(StatusPill, {
2463
+ status: row.status
2464
+ })
2465
+ })]
2466
+ }, ri);
2467
+ })
2468
+ })]
2469
+ });
2470
+ };
2471
+ var P2DonorMixCard = function P2DonorMixCard(_ref21) {
2472
+ var newDonors = _ref21.newDonors,
2473
+ returningDonors = _ref21.returningDonors,
2474
+ totalMix = _ref21.totalMix,
2475
+ newPct = _ref21.newPct,
2476
+ retPct = _ref21.retPct,
2477
+ avgGift = _ref21.avgGift,
2478
+ avgGiftTrend = _ref21.avgGiftTrend;
2479
+ return /*#__PURE__*/jsx(P2Card, {
2480
+ title: "Donor mix",
2481
+ subtitle: "Acquisition vs retention",
2482
+ children: /*#__PURE__*/jsxs("div", {
2483
+ style: {
2484
+ display: "flex",
2485
+ flexDirection: "column",
2486
+ alignItems: "center"
2487
+ },
2488
+ children: [/*#__PURE__*/jsx(Donut, {
2489
+ segments: [{
2490
+ value: newDonors,
2491
+ color: "#10B981"
2492
+ }, {
2493
+ value: returningDonors,
2494
+ color: THEME.brand
2495
+ }],
2496
+ size: 84,
2497
+ centerVal: formatNumber(totalMix),
2498
+ centerLabel: "donors"
2918
2499
  }), /*#__PURE__*/jsxs("div", {
2919
2500
  style: {
2920
- fontSize: 9,
2921
- color: THEME.muted,
2922
- textAlign: "right",
2923
- alignSelf: "flex-end"
2501
+ width: "100%",
2502
+ marginTop: 8
2924
2503
  },
2925
- children: ["Page ", page, " of 2"]
2926
- })]
2927
- }), !!"".concat(activeFilters || "").trim() && /*#__PURE__*/jsxs("div", {
2504
+ children: [[{
2505
+ label: "New donors",
2506
+ color: "#10B981",
2507
+ count: newDonors,
2508
+ pct: newPct
2509
+ }, {
2510
+ label: "Returning",
2511
+ color: THEME.brand,
2512
+ count: returningDonors,
2513
+ pct: retPct
2514
+ }].map(function (item, i) {
2515
+ return /*#__PURE__*/jsxs("div", {
2516
+ style: {
2517
+ display: "flex",
2518
+ justifyContent: "space-between",
2519
+ alignItems: "center",
2520
+ marginBottom: i === 0 ? 6 : 10
2521
+ },
2522
+ children: [/*#__PURE__*/jsxs("div", {
2523
+ style: {
2524
+ display: "flex",
2525
+ alignItems: "center",
2526
+ gap: 5
2527
+ },
2528
+ children: [/*#__PURE__*/jsx("div", {
2529
+ style: {
2530
+ width: 7,
2531
+ height: 7,
2532
+ borderRadius: "50%",
2533
+ background: item.color,
2534
+ flexShrink: 0
2535
+ }
2536
+ }), /*#__PURE__*/jsx("span", {
2537
+ style: {
2538
+ fontSize: 9,
2539
+ color: "#6B7280"
2540
+ },
2541
+ children: item.label
2542
+ })]
2543
+ }), /*#__PURE__*/jsxs("span", {
2544
+ style: {
2545
+ fontSize: 9,
2546
+ fontWeight: 700,
2547
+ color: THEME.text
2548
+ },
2549
+ children: [formatNumber(item.count), BULLET, item.pct, "%"]
2550
+ })]
2551
+ }, item.label);
2552
+ }), /*#__PURE__*/jsx(Divider, {
2553
+ mb: 8
2554
+ }), /*#__PURE__*/jsx("div", {
2555
+ style: {
2556
+ fontSize: 9,
2557
+ color: THEME.muted,
2558
+ marginBottom: 3
2559
+ },
2560
+ children: "Avg gift"
2561
+ }), /*#__PURE__*/jsx("div", {
2562
+ style: {
2563
+ fontSize: 16,
2564
+ fontWeight: 700,
2565
+ color: THEME.text,
2566
+ marginBottom: 6
2567
+ },
2568
+ children: d$(avgGift)
2569
+ }), /*#__PURE__*/jsx(TrendPill$1, {
2570
+ positive: isTrendPositive(avgGiftTrend),
2571
+ children: avgGiftTrend
2572
+ })]
2573
+ })]
2574
+ })
2575
+ });
2576
+ };
2577
+ var StackedDonationTypeBarSvg = function StackedDonationTypeBarSvg(_ref22) {
2578
+ var _ref22$categories = _ref22.categories,
2579
+ categories = _ref22$categories === void 0 ? [] : _ref22$categories,
2580
+ _ref22$recurring = _ref22.recurring,
2581
+ recurring = _ref22$recurring === void 0 ? [] : _ref22$recurring,
2582
+ _ref22$oneTime = _ref22.oneTime,
2583
+ oneTime = _ref22$oneTime === void 0 ? [] : _ref22$oneTime,
2584
+ _ref22$recurringColor = _ref22.recurringColor,
2585
+ recurringColor = _ref22$recurringColor === void 0 ? "#10B981" : _ref22$recurringColor,
2586
+ _ref22$oneTimeColor = _ref22.oneTimeColor,
2587
+ oneTimeColor = _ref22$oneTimeColor === void 0 ? "#6366F1" : _ref22$oneTimeColor;
2588
+ var width = 158;
2589
+ var height = 88;
2590
+ var padL = 22;
2591
+ var padR = 4;
2592
+ var padT = 8;
2593
+ var padB = 18;
2594
+ var chartW = width - padL - padR;
2595
+ var chartH = height - padT - padB;
2596
+ var totals = categories.map(function (_, i) {
2597
+ return (recurring[i] || 0) + (oneTime[i] || 0);
2598
+ });
2599
+ var maxVal = Math.max.apply(Math, _toConsumableArray(totals).concat([0])) || 1;
2600
+ var n = categories.length;
2601
+ var groupW = n > 0 ? chartW / n : chartW;
2602
+ var barW = Math.min(groupW * 0.42, 18);
2603
+ var baseY = padT + chartH;
2604
+ if (!n) {
2605
+ return /*#__PURE__*/jsx("svg", {
2606
+ width: "100%",
2607
+ height: height,
2608
+ viewBox: "0 0 ".concat(width, " ").concat(height),
2609
+ style: {
2610
+ display: "block"
2611
+ },
2612
+ children: /*#__PURE__*/jsx("line", {
2613
+ x1: padL,
2614
+ y1: baseY,
2615
+ x2: width - padR,
2616
+ y2: baseY,
2617
+ stroke: "#F3F4F6"
2618
+ })
2619
+ });
2620
+ }
2621
+ return /*#__PURE__*/jsx("svg", {
2622
+ width: "100%",
2623
+ height: height,
2624
+ viewBox: "0 0 ".concat(width, " ").concat(height),
2625
+ style: {
2626
+ display: "block"
2627
+ },
2628
+ children: categories.map(function (cat, i) {
2629
+ var groupX = padL + i * groupW + groupW / 2;
2630
+ var rVal = recurring[i] || 0;
2631
+ var oVal = oneTime[i] || 0;
2632
+ var total = rVal + oVal || 1;
2633
+ var oH = oVal / maxVal * chartH;
2634
+ var rH = rVal / maxVal * chartH;
2635
+ var x = groupX - barW / 2;
2636
+ return /*#__PURE__*/jsxs("g", {
2637
+ children: [oVal > 0 && /*#__PURE__*/jsx("rect", {
2638
+ x: x,
2639
+ y: baseY - oH,
2640
+ width: barW,
2641
+ height: Math.max(oH, total > 0 ? 1 : 0),
2642
+ fill: oneTimeColor,
2643
+ rx: 2
2644
+ }), rVal > 0 && /*#__PURE__*/jsx("rect", {
2645
+ x: x,
2646
+ y: baseY - oH - rH,
2647
+ width: barW,
2648
+ height: Math.max(rH, total > 0 ? 1 : 0),
2649
+ fill: recurringColor,
2650
+ rx: 2
2651
+ }), /*#__PURE__*/jsx("text", {
2652
+ x: groupX,
2653
+ y: height - 4,
2654
+ textAnchor: "middle",
2655
+ fontSize: 6.5,
2656
+ fill: THEME.muted,
2657
+ children: formatDonationTypeCategory(cat, groupW)
2658
+ })]
2659
+ }, "stack-".concat(i));
2660
+ })
2661
+ });
2662
+ };
2663
+ var P2DonationTypeCard = function P2DonationTypeCard(_ref23) {
2664
+ var donationTypeData = _ref23.donationTypeData;
2665
+ var _parseDonationTypeCha2 = parseDonationTypeChartData(donationTypeData),
2666
+ categories = _parseDonationTypeCha2.categories,
2667
+ recurring = _parseDonationTypeCha2.recurring,
2668
+ oneTime = _parseDonationTypeCha2.oneTime,
2669
+ recurringTotal = _parseDonationTypeCha2.recurringTotal,
2670
+ oneTimeTotal = _parseDonationTypeCha2.oneTimeTotal;
2671
+ return /*#__PURE__*/jsxs(P2Card, {
2672
+ title: "Recurring vs one-time",
2673
+ subtitle: "Donation type".concat(BULLET, "weekly"),
2674
+ children: [/*#__PURE__*/jsx("div", {
2675
+ style: {
2676
+ display: "flex",
2677
+ flexDirection: "column",
2678
+ gap: 4,
2679
+ marginBottom: 6
2680
+ },
2681
+ children: [{
2682
+ label: "Recurring",
2683
+ total: recurringTotal,
2684
+ color: "#10B981"
2685
+ }, {
2686
+ label: "One-time",
2687
+ total: oneTimeTotal,
2688
+ color: THEME.brand
2689
+ }].map(function (item) {
2690
+ return /*#__PURE__*/jsxs("div", {
2691
+ style: {
2692
+ display: "flex",
2693
+ alignItems: "center",
2694
+ gap: 5
2695
+ },
2696
+ children: [/*#__PURE__*/jsx("div", {
2697
+ style: {
2698
+ width: 6,
2699
+ height: 6,
2700
+ borderRadius: "50%",
2701
+ background: item.color,
2702
+ flexShrink: 0
2703
+ }
2704
+ }), /*#__PURE__*/jsx("span", {
2705
+ style: {
2706
+ fontSize: 9,
2707
+ color: "#6B7280"
2708
+ },
2709
+ children: item.label
2710
+ }), /*#__PURE__*/jsx("span", {
2711
+ style: {
2712
+ fontSize: 9,
2713
+ fontWeight: 700,
2714
+ color: THEME.text
2715
+ },
2716
+ children: d$(item.total)
2717
+ })]
2718
+ }, item.label);
2719
+ })
2720
+ }), /*#__PURE__*/jsx(StackedDonationTypeBarSvg, {
2721
+ categories: categories,
2722
+ recurring: recurring,
2723
+ oneTime: oneTime
2724
+ })]
2725
+ });
2726
+ };
2727
+ var P2DonorGeographyCard = function P2DonorGeographyCard(_ref24) {
2728
+ var _ref24$geoList = _ref24.geoList,
2729
+ geoList = _ref24$geoList === void 0 ? [] : _ref24$geoList,
2730
+ _ref24$totalDonors = _ref24.totalDonors,
2731
+ totalDonors = _ref24$totalDonors === void 0 ? 0 : _ref24$totalDonors;
2732
+ return /*#__PURE__*/jsxs(P2Card, {
2733
+ title: "Donor geography",
2734
+ subtitle: "Top countries".concat(BULLET).concat(formatNumber(totalDonors), " total"),
2735
+ children: [(geoList.length ? geoList.slice(0, 6) : []).map(function (g, i) {
2736
+ var _g$percentage2;
2737
+ return /*#__PURE__*/jsxs("div", {
2738
+ style: {
2739
+ marginBottom: i < 5 ? 7 : 0
2740
+ },
2741
+ children: [/*#__PURE__*/jsxs("div", {
2742
+ style: {
2743
+ display: "flex",
2744
+ justifyContent: "space-between",
2745
+ alignItems: "center",
2746
+ gap: 6,
2747
+ marginBottom: 3
2748
+ },
2749
+ children: [/*#__PURE__*/jsx("span", {
2750
+ style: {
2751
+ fontSize: 8.5,
2752
+ color: "#374151",
2753
+ overflow: "hidden",
2754
+ textOverflow: "ellipsis",
2755
+ whiteSpace: "nowrap",
2756
+ minWidth: 0
2757
+ },
2758
+ children: g.country
2759
+ }), /*#__PURE__*/jsxs("span", {
2760
+ style: {
2761
+ fontSize: 8.5,
2762
+ fontWeight: 700,
2763
+ color: THEME.text,
2764
+ flexShrink: 0
2765
+ },
2766
+ children: [formatNumber(g.value), BULLET, formatNumber(g.percentage), "%"]
2767
+ })]
2768
+ }), /*#__PURE__*/jsx("div", {
2769
+ style: {
2770
+ height: 4,
2771
+ background: "#F3F4F6",
2772
+ borderRadius: 3,
2773
+ overflow: "hidden"
2774
+ },
2775
+ children: /*#__PURE__*/jsx("div", {
2776
+ style: {
2777
+ width: "".concat(Math.min(100, Math.max(0, Number((_g$percentage2 = g.percentage) !== null && _g$percentage2 !== void 0 ? _g$percentage2 : 0))), "%"),
2778
+ height: "100%",
2779
+ background: THEME.brand,
2780
+ borderRadius: 3
2781
+ }
2782
+ })
2783
+ })]
2784
+ }, i);
2785
+ }), !geoList.length && /*#__PURE__*/jsx("div", {
2786
+ style: {
2787
+ fontSize: 9,
2788
+ color: THEME.muted,
2789
+ textAlign: "center",
2790
+ padding: "8px 0"
2791
+ },
2792
+ children: "No geography data"
2793
+ })]
2794
+ });
2795
+ };
2796
+ var SparklineWithLabels = function SparklineWithLabels(_ref25) {
2797
+ var _ref25$data = _ref25.data,
2798
+ data = _ref25$data === void 0 ? [] : _ref25$data,
2799
+ _ref25$color = _ref25.color,
2800
+ color = _ref25$color === void 0 ? "#6366F1" : _ref25$color,
2801
+ _ref25$startLabel = _ref25.startLabel,
2802
+ startLabel = _ref25$startLabel === void 0 ? "" : _ref25$startLabel,
2803
+ _ref25$endLabel = _ref25.endLabel,
2804
+ endLabel = _ref25$endLabel === void 0 ? "" : _ref25$endLabel,
2805
+ _ref25$width = _ref25.width,
2806
+ width = _ref25$width === void 0 ? 150 : _ref25$width,
2807
+ _ref25$height = _ref25.height,
2808
+ height = _ref25$height === void 0 ? 42 : _ref25$height;
2809
+ return /*#__PURE__*/jsxs("div", {
2810
+ children: [/*#__PURE__*/jsx(Sparkline, {
2811
+ data: data,
2812
+ color: color,
2813
+ width: width,
2814
+ height: height
2815
+ }), (startLabel || endLabel) && /*#__PURE__*/jsxs("div", {
2816
+ style: {
2817
+ display: "flex",
2818
+ justifyContent: "space-between",
2819
+ marginTop: 2,
2820
+ fontSize: 7,
2821
+ color: THEME.muted
2822
+ },
2823
+ children: [/*#__PURE__*/jsx("span", {
2824
+ children: startLabel
2825
+ }), /*#__PURE__*/jsx("span", {
2826
+ children: endLabel
2827
+ })]
2828
+ })]
2829
+ });
2830
+ };
2831
+ var getTrafficSourceColor = function getTrafficSourceColor() {
2832
+ var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
2833
+ var s = String(source).toLowerCase();
2834
+ if (s.includes("paid")) return THEME.brand;
2835
+ if (s.includes("organic")) return "#10B981";
2836
+ if (s.includes("email")) return "#3B82F6";
2837
+ if (s.includes("direct")) return "#9CA3AF";
2838
+ return "#CBD5E1";
2839
+ };
2840
+ var P2TrafficSourceCard = function P2TrafficSourceCard(_ref26) {
2841
+ var _ref26$items = _ref26.items,
2842
+ items = _ref26$items === void 0 ? [] : _ref26$items,
2843
+ _ref26$total = _ref26.total,
2844
+ total = _ref26$total === void 0 ? 0 : _ref26$total,
2845
+ daysLabel = _ref26.daysLabel;
2846
+ return /*#__PURE__*/jsxs(P2Card, {
2847
+ title: "Traffic source",
2848
+ subtitle: "Revenue by channel".concat(BULLET).concat(daysLabel),
2849
+ children: [items.length === 0 ? /*#__PURE__*/jsx("div", {
2850
+ style: {
2851
+ fontSize: 9,
2852
+ color: THEME.muted,
2853
+ textAlign: "center",
2854
+ padding: "8px 0"
2855
+ },
2856
+ children: "No traffic data"
2857
+ }) : items.map(function (item, i) {
2858
+ var source = item.source || item.name || "-";
2859
+ var revenue = Number(item.revenue || item.raised || 0);
2860
+ var share = Number(item.share || item.percentage || 0);
2861
+ var color = getTrafficSourceColor(source);
2862
+ return /*#__PURE__*/jsxs("div", {
2863
+ style: {
2864
+ marginBottom: i < items.length - 1 ? 8 : 0
2865
+ },
2866
+ children: [/*#__PURE__*/jsxs("div", {
2867
+ style: {
2868
+ display: "flex",
2869
+ alignItems: "center",
2870
+ gap: 5,
2871
+ marginBottom: 3
2872
+ },
2873
+ children: [/*#__PURE__*/jsx("div", {
2874
+ style: {
2875
+ width: 6,
2876
+ height: 6,
2877
+ borderRadius: "50%",
2878
+ background: color,
2879
+ flexShrink: 0
2880
+ }
2881
+ }), /*#__PURE__*/jsx("span", {
2882
+ style: {
2883
+ fontSize: 8.5,
2884
+ color: "#374151",
2885
+ flex: 1,
2886
+ overflow: "hidden",
2887
+ textOverflow: "ellipsis",
2888
+ whiteSpace: "nowrap"
2889
+ },
2890
+ children: source
2891
+ }), /*#__PURE__*/jsx("span", {
2892
+ style: {
2893
+ fontSize: 8.5,
2894
+ fontWeight: 700,
2895
+ color: THEME.text,
2896
+ flexShrink: 0
2897
+ },
2898
+ children: d$Compact(revenue)
2899
+ })]
2900
+ }), /*#__PURE__*/jsxs("div", {
2901
+ style: {
2902
+ display: "flex",
2903
+ alignItems: "center",
2904
+ gap: 6
2905
+ },
2906
+ children: [/*#__PURE__*/jsx("div", {
2907
+ style: {
2908
+ flex: 1,
2909
+ height: 4,
2910
+ background: "#F3F4F6",
2911
+ borderRadius: 3,
2912
+ overflow: "hidden"
2913
+ },
2914
+ children: /*#__PURE__*/jsx("div", {
2915
+ style: {
2916
+ width: "".concat(Math.min(100, share), "%"),
2917
+ height: "100%",
2918
+ background: color,
2919
+ borderRadius: 3
2920
+ }
2921
+ })
2922
+ }), /*#__PURE__*/jsxs("span", {
2923
+ style: {
2924
+ fontSize: 8,
2925
+ color: THEME.muted,
2926
+ minWidth: 24,
2927
+ textAlign: "right"
2928
+ },
2929
+ children: [formatNumber(share), "%"]
2930
+ })]
2931
+ })]
2932
+ }, i);
2933
+ }), /*#__PURE__*/jsx(Divider, {
2934
+ mt: 8,
2935
+ mb: 0
2936
+ }), /*#__PURE__*/jsxs("div", {
2937
+ style: {
2938
+ display: "flex",
2939
+ justifyContent: "space-between",
2940
+ alignItems: "center",
2941
+ marginTop: 8
2942
+ },
2943
+ children: [/*#__PURE__*/jsx("span", {
2944
+ style: {
2945
+ fontSize: 9,
2946
+ color: THEME.muted
2947
+ },
2948
+ children: "Total"
2949
+ }), /*#__PURE__*/jsx("span", {
2950
+ style: {
2951
+ fontSize: 10,
2952
+ fontWeight: 700,
2953
+ color: THEME.text
2954
+ },
2955
+ children: d$Compact(total)
2956
+ })]
2957
+ })]
2958
+ });
2959
+ };
2960
+ var P2RefundsCard = function P2RefundsCard(_ref27) {
2961
+ var refundRate = _ref27.refundRate,
2962
+ chargebackRate = _ref27.chargebackRate,
2963
+ refundGrowth = _ref27.refundGrowth,
2964
+ totalRefundedAmount = _ref27.totalRefundedAmount,
2965
+ disputedAmount = _ref27.disputedAmount,
2966
+ lostCases = _ref27.lostCases,
2967
+ _ref27$chartData = _ref27.chartData,
2968
+ chartData = _ref27$chartData === void 0 ? [] : _ref27$chartData,
2969
+ windowLabel = _ref27.windowLabel;
2970
+ var refundChart = chartData.map(function (d) {
2971
+ var _ref28, _ref29, _d$value;
2972
+ return Number((_ref28 = (_ref29 = (_d$value = d === null || d === void 0 ? void 0 : d.value) !== null && _d$value !== void 0 ? _d$value : d === null || d === void 0 ? void 0 : d.amount) !== null && _ref29 !== void 0 ? _ref29 : d) !== null && _ref28 !== void 0 ? _ref28 : 0);
2973
+ });
2974
+ return /*#__PURE__*/jsxs(P2Card, {
2975
+ title: "Refunds & chargebacks",
2976
+ subtitle: "Trust health".concat(BULLET).concat(windowLabel),
2977
+ children: [/*#__PURE__*/jsxs("div", {
2978
+ style: {
2979
+ display: "flex",
2980
+ gap: 16,
2981
+ marginBottom: 8
2982
+ },
2983
+ children: [/*#__PURE__*/jsxs("div", {
2984
+ children: [/*#__PURE__*/jsx("div", {
2985
+ style: {
2986
+ fontSize: 7.5,
2987
+ fontWeight: 700,
2988
+ letterSpacing: "0.5px",
2989
+ color: THEME.muted,
2990
+ textTransform: "uppercase",
2991
+ marginBottom: 3
2992
+ },
2993
+ children: "Refunds"
2994
+ }), /*#__PURE__*/jsx("div", {
2995
+ style: {
2996
+ fontSize: 16,
2997
+ fontWeight: 700,
2998
+ color: THEME.text,
2999
+ lineHeight: 1.1
3000
+ },
3001
+ children: pct(refundRate, 1)
3002
+ }), /*#__PURE__*/jsx("div", {
3003
+ style: {
3004
+ marginTop: 3
3005
+ },
3006
+ children: refundGrowth === 0 ? /*#__PURE__*/jsx("span", {
3007
+ style: {
3008
+ fontSize: 8.5,
3009
+ color: THEME.muted
3010
+ },
3011
+ children: "stable"
3012
+ }) : /*#__PURE__*/jsx(TrendPill$1, {
3013
+ positive: refundGrowth <= 0,
3014
+ children: formatTrend(refundGrowth, "pp")
3015
+ })
3016
+ })]
3017
+ }), /*#__PURE__*/jsxs("div", {
3018
+ children: [/*#__PURE__*/jsx("div", {
3019
+ style: {
3020
+ fontSize: 7.5,
3021
+ fontWeight: 700,
3022
+ letterSpacing: "0.5px",
3023
+ color: THEME.muted,
3024
+ textTransform: "uppercase",
3025
+ marginBottom: 3
3026
+ },
3027
+ children: "Chargebacks"
3028
+ }), /*#__PURE__*/jsx("div", {
3029
+ style: {
3030
+ fontSize: 16,
3031
+ fontWeight: 700,
3032
+ color: THEME.text,
3033
+ lineHeight: 1.1
3034
+ },
3035
+ children: pct(chargebackRate, 1)
3036
+ }), /*#__PURE__*/jsx("div", {
3037
+ style: {
3038
+ fontSize: 8.5,
3039
+ color: THEME.muted,
3040
+ marginTop: 3
3041
+ },
3042
+ children: "stable"
3043
+ })]
3044
+ })]
3045
+ }), /*#__PURE__*/jsxs("div", {
3046
+ style: {
3047
+ fontSize: 8,
3048
+ color: THEME.muted,
3049
+ lineHeight: 1.45,
3050
+ marginBottom: 8
3051
+ },
3052
+ children: [d$(totalRefundedAmount), " refunded", BULLET, d$(disputedAmount), " disputed", BULLET, formatNumber(lostCases), " ", lostCases === 1 ? "case" : "cases"]
3053
+ }), /*#__PURE__*/jsx(Sparkline, {
3054
+ data: refundChart.length ? refundChart : [0, 0],
3055
+ color: "#F97316",
3056
+ width: 150,
3057
+ height: 36
3058
+ }), /*#__PURE__*/jsx("div", {
3059
+ style: {
3060
+ display: "flex",
3061
+ gap: 10,
3062
+ marginTop: 6
3063
+ },
3064
+ children: [{
3065
+ label: "Refunds",
3066
+ color: "#F97316"
3067
+ }, {
3068
+ label: "Chargebacks",
3069
+ color: "#EF4444"
3070
+ }].map(function (leg) {
3071
+ return /*#__PURE__*/jsxs("div", {
3072
+ style: {
3073
+ display: "flex",
3074
+ alignItems: "center",
3075
+ gap: 4
3076
+ },
3077
+ children: [/*#__PURE__*/jsx("div", {
3078
+ style: {
3079
+ width: 6,
3080
+ height: 6,
3081
+ borderRadius: "50%",
3082
+ background: leg.color
3083
+ }
3084
+ }), /*#__PURE__*/jsx("span", {
3085
+ style: {
3086
+ fontSize: 8,
3087
+ color: "#6B7280"
3088
+ },
3089
+ children: leg.label
3090
+ })]
3091
+ }, leg.label);
3092
+ })
3093
+ })]
3094
+ });
3095
+ };
3096
+ var P2RevenueTrendCard = function P2RevenueTrendCard(_ref30) {
3097
+ var title = _ref30.title,
3098
+ subtitle = _ref30.subtitle,
3099
+ value = _ref30.value,
3100
+ trend = _ref30.trend,
3101
+ chartData = _ref30.chartData,
3102
+ chartColor = _ref30.chartColor,
3103
+ startLabel = _ref30.startLabel,
3104
+ endLabel = _ref30.endLabel,
3105
+ _ref30$footerStats = _ref30.footerStats,
3106
+ footerStats = _ref30$footerStats === void 0 ? [] : _ref30$footerStats;
3107
+ return /*#__PURE__*/jsxs(P2Card, {
3108
+ title: title,
3109
+ subtitle: subtitle,
3110
+ children: [/*#__PURE__*/jsx("div", {
3111
+ style: {
3112
+ fontSize: 17,
3113
+ fontWeight: 700,
3114
+ color: THEME.text,
3115
+ lineHeight: 1.1
3116
+ },
3117
+ children: d$Compact(value)
3118
+ }), /*#__PURE__*/jsx("div", {
2928
3119
  style: {
2929
- marginTop: 7,
2930
- display: "inline-block",
2931
- background: "#EEF2FF",
2932
- border: "1px solid #D7DEFF",
2933
- borderRadius: 4,
2934
- padding: "4px 9px",
2935
- fontSize: 9,
2936
- lineHeight: 1.35,
2937
- color: "#374151",
2938
- maxWidth: "100%"
3120
+ marginTop: 4,
3121
+ marginBottom: 6
2939
3122
  },
2940
- children: [/*#__PURE__*/jsx("span", {
2941
- style: {
2942
- fontWeight: 700,
2943
- letterSpacing: "0.3px"
2944
- },
2945
- children: "Active Filters:"
2946
- }), " ", /*#__PURE__*/jsx("span", {
2947
- style: {
2948
- fontWeight: 500,
2949
- color: "#334155"
2950
- },
2951
- children: activeFilters
2952
- })]
3123
+ children: /*#__PURE__*/jsx(TrendPill$1, {
3124
+ positive: isTrendPositive(trend),
3125
+ children: trend
3126
+ })
3127
+ }), /*#__PURE__*/jsx(SparklineWithLabels, {
3128
+ data: chartData,
3129
+ color: chartColor,
3130
+ startLabel: startLabel,
3131
+ endLabel: endLabel,
3132
+ width: 150,
3133
+ height: 40
3134
+ }), /*#__PURE__*/jsx(Divider, {
3135
+ mt: 8,
3136
+ mb: 0
3137
+ }), /*#__PURE__*/jsx("div", {
3138
+ style: {
3139
+ display: "flex",
3140
+ gap: 10,
3141
+ marginTop: 8,
3142
+ flexWrap: "wrap"
3143
+ },
3144
+ children: footerStats.map(function (_ref31) {
3145
+ var _ref32 = _slicedToArray(_ref31, 2),
3146
+ label = _ref32[0],
3147
+ val = _ref32[1];
3148
+ return /*#__PURE__*/jsxs("div", {
3149
+ children: [/*#__PURE__*/jsx("div", {
3150
+ style: {
3151
+ fontSize: 7.5,
3152
+ color: THEME.muted,
3153
+ marginBottom: 3
3154
+ },
3155
+ children: label
3156
+ }), /*#__PURE__*/jsx("div", {
3157
+ style: {
3158
+ fontSize: 10,
3159
+ fontWeight: 700,
3160
+ color: THEME.text
3161
+ },
3162
+ children: val
3163
+ })]
3164
+ }, label);
3165
+ })
2953
3166
  })]
2954
3167
  });
2955
3168
  };
2956
- var PageFooter = function PageFooter(_ref19) {
2957
- var generatedBy = _ref19.generatedBy,
2958
- generatedLabel = _ref19.generatedLabel,
2959
- page = _ref19.page;
2960
- return /*#__PURE__*/jsx("div", {
2961
- style: {
2962
- padding: "9px ".concat(MX, "px 54px"),
2963
- borderTop: "1px solid #DEE5EF",
2964
- background: "#FFFFFF",
2965
- marginTop: "auto",
2966
- flexShrink: 0
2967
- },
3169
+ var P2AcceptanceCard = function P2AcceptanceCard(_ref33) {
3170
+ var title = _ref33.title,
3171
+ acceptanceRate = _ref33.acceptanceRate,
3172
+ acceptanceGrowth = _ref33.acceptanceGrowth,
3173
+ raised = _ref33.raised,
3174
+ raisedGrowth = _ref33.raisedGrowth;
3175
+ return /*#__PURE__*/jsx(P2Card, {
3176
+ title: title,
3177
+ subtitle: "Acceptance & raised",
2968
3178
  children: /*#__PURE__*/jsxs("div", {
2969
3179
  style: {
2970
3180
  display: "flex",
2971
- justifyContent: "space-between",
2972
- alignItems: "center",
2973
- fontSize: 8,
2974
- color: THEME.muted
3181
+ flexDirection: "column",
3182
+ alignItems: "center"
2975
3183
  },
2976
- children: [/*#__PURE__*/jsxs("span", {
2977
- children: ["Confidential - Generated by ", generatedBy, " - ", generatedLabel]
2978
- }), /*#__PURE__*/jsxs("span", {
2979
- children: ["Page ", page, " of 2 - madinah.com"]
3184
+ children: [/*#__PURE__*/jsx(Donut, {
3185
+ segments: [{
3186
+ value: acceptanceRate,
3187
+ color: THEME.brand
3188
+ }, {
3189
+ value: Math.max(0, 100 - acceptanceRate),
3190
+ color: "#E5E7EB"
3191
+ }],
3192
+ size: 76,
3193
+ centerVal: "".concat(formatNumber(acceptanceRate), "%"),
3194
+ centerLabel: "accepted"
3195
+ }), /*#__PURE__*/jsx("div", {
3196
+ style: {
3197
+ width: "100%",
3198
+ marginTop: 8
3199
+ },
3200
+ children: [{
3201
+ label: "Acceptance",
3202
+ value: "".concat(formatNumber(acceptanceRate), "%"),
3203
+ trend: formatTrend(acceptanceGrowth)
3204
+ }, {
3205
+ label: "Raised",
3206
+ value: d$Compact(raised),
3207
+ trend: formatTrend(raisedGrowth)
3208
+ }].map(function (row, i) {
3209
+ return /*#__PURE__*/jsxs("div", {
3210
+ style: {
3211
+ display: "flex",
3212
+ justifyContent: "space-between",
3213
+ alignItems: "center",
3214
+ marginBottom: i === 0 ? 6 : 0
3215
+ },
3216
+ children: [/*#__PURE__*/jsxs("div", {
3217
+ style: {
3218
+ display: "flex",
3219
+ alignItems: "center",
3220
+ gap: 5
3221
+ },
3222
+ children: [/*#__PURE__*/jsx("div", {
3223
+ style: {
3224
+ width: 7,
3225
+ height: 7,
3226
+ borderRadius: 2,
3227
+ background: THEME.brand,
3228
+ flexShrink: 0
3229
+ }
3230
+ }), /*#__PURE__*/jsx("span", {
3231
+ style: {
3232
+ fontSize: 9,
3233
+ color: "#6B7280"
3234
+ },
3235
+ children: row.label
3236
+ })]
3237
+ }), /*#__PURE__*/jsxs("div", {
3238
+ style: {
3239
+ display: "flex",
3240
+ alignItems: "center",
3241
+ gap: 5
3242
+ },
3243
+ children: [/*#__PURE__*/jsx("span", {
3244
+ style: {
3245
+ fontSize: 9,
3246
+ fontWeight: 700,
3247
+ color: THEME.text
3248
+ },
3249
+ children: row.value
3250
+ }), /*#__PURE__*/jsx(TrendPill$1, {
3251
+ positive: isTrendPositive(row.trend),
3252
+ children: row.trend
3253
+ })]
3254
+ })]
3255
+ }, row.label);
3256
+ })
2980
3257
  })]
2981
3258
  })
2982
3259
  });
2983
3260
  };
2984
3261
 
2985
3262
  // ─── Main component ───────────────────────────────────────────────────────────
2986
- var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
2987
- var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _apiData$trafficSourc, _apiData$trafficSourc2, _apiData$trafficSourc3, _growth$totalRevenue, _metricByTitle$AvgDo, _metricByTitle$NetRa, _growth$netRevenue, _metricByTitle$Total, _metricByTitle$Total2, _growth$totalDonation, _metricByTitle$Total3, _metricByTitle$AvgDo2, _growth$overallAVGDon, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _growth$conversionRat, _metricByTitle$Conver2, _metricByTitle$Refund, _refunds$growthPercen, _metricByTitle$Refund2, _mainChart$stacked, _ob$growthPercentage, _ob$peakDay, _up$acceptanceGrowth, _up$raisedGrowth, _dn$acceptanceGrowth, _dn$raisedGrowth, _refCard$growthPercen;
2988
- var _ref20$name = _ref20.name,
2989
- name = _ref20$name === void 0 ? "" : _ref20$name,
2990
- _ref20$apiData = _ref20.apiData,
2991
- apiData = _ref20$apiData === void 0 ? {} : _ref20$apiData,
2992
- _ref20$dateName = _ref20.dateName,
2993
- dateName = _ref20$dateName === void 0 ? "Last Period" : _ref20$dateName,
2994
- _ref20$numberOfDays = _ref20.numberOfDays,
2995
- numberOfDays = _ref20$numberOfDays === void 0 ? 30 : _ref20$numberOfDays,
2996
- _ref20$activeFilters = _ref20.activeFilters,
2997
- activeFilters = _ref20$activeFilters === void 0 ? [] : _ref20$activeFilters;
3263
+ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref34, ref) {
3264
+ var _apiData$overviewStat, _overview$totalRevenu, _overview$netRevenue, _overview$overallAVGD, _overview$conversionR, _apiData$totalVisits, _apiData$trafficSourc, _apiData$trafficSourc2, _growth$totalRevenue, _metricByTitle$AvgDo, _apiData$trafficSourc3, _metricByTitle$NetRa, _growth$netRevenue, _metricByTitle$Total, _metricByTitle$Total2, _growth$totalDonation, _metricByTitle$Total3, _metricByTitle$AvgDo2, _growth$overallAVGDon, _apiData$roasCard, _metricByTitle$ROAS, _apiData$roasCardPrev, _metricByTitle$ROAS2, _apiData$adSpend, _apiData$attributedRe, _metricByTitle$Conver, _growth$conversionRat, _metricByTitle$Conver2, _metricByTitle$Refund, _refunds$growthPercen, _metricByTitle$Refund2, _mainChart$stacked, _ob$totalRevenue, _ob$growthPercentage, _ob$averagePerDay, _ob$peakDay$amount, _ob$peakDay, _ob$totalOrders, _up$acceptanceRate, _up$acceptanceGrowth, _up$raised, _up$raisedGrowth, _dn$acceptanceRate, _dn$acceptanceGrowth, _dn$raised, _dn$raisedGrowth, _refCard$totalRevenue, _refCard$growthPercen, _refCard$totalReferre, _refCard$averageGift, _refCard$conversionRa;
3265
+ var _ref34$name = _ref34.name,
3266
+ name = _ref34$name === void 0 ? "" : _ref34$name,
3267
+ _ref34$apiData = _ref34.apiData,
3268
+ apiData = _ref34$apiData === void 0 ? {} : _ref34$apiData,
3269
+ _ref34$dateName = _ref34.dateName,
3270
+ dateName = _ref34$dateName === void 0 ? "Last Period" : _ref34$dateName,
3271
+ _ref34$numberOfDays = _ref34.numberOfDays,
3272
+ numberOfDays = _ref34$numberOfDays === void 0 ? 30 : _ref34$numberOfDays,
3273
+ _ref34$activeFilters = _ref34.activeFilters,
3274
+ activeFilters = _ref34$activeFilters === void 0 ? [] : _ref34$activeFilters;
2998
3275
  var now = new Date();
2999
3276
  var daysLabel = "".concat(numberOfDays, " day").concat(numberOfDays === 1 ? "" : "s");
3000
3277
  var windowLabel = "".concat(numberOfDays, "-day window");
3001
3278
  var gmtOptions = {
3002
3279
  timeZone: "UTC"
3003
3280
  };
3004
- var generatedLabel = now.toLocaleDateString("en-US", _objectSpread2({
3281
+ var generatedDate = now.toLocaleDateString("en-US", _objectSpread2({
3005
3282
  month: "short",
3006
3283
  day: "numeric",
3007
3284
  year: "numeric"
3008
- }, gmtOptions)) + BULLET + now.toLocaleTimeString("en-US", _objectSpread2({
3285
+ }, gmtOptions));
3286
+ var generatedTime = "".concat(now.toLocaleTimeString("en-US", _objectSpread2({
3009
3287
  hour: "2-digit",
3010
3288
  minute: "2-digit",
3011
3289
  hour12: false
3012
- }, gmtOptions)) + " GMT";
3290
+ }, gmtOptions)), " GMT");
3291
+ var generatedLabel = "".concat(generatedDate).concat(BULLET).concat(generatedTime);
3013
3292
  var dateLabel = dateName;
3014
- var _normalizeFiltersText = function normalizeFiltersText(filtersInput) {
3015
- if (typeof filtersInput === "string") {
3016
- var str = filtersInput.trim();
3017
- if (!str) return "";
3018
- if (str.startsWith("[") || str.startsWith("{")) {
3019
- try {
3020
- return _normalizeFiltersText(JSON.parse(str));
3021
- } catch (_) {
3022
- // Keep raw text if not valid JSON.
3023
- }
3024
- }
3025
- return str;
3026
- }
3027
- if (Array.isArray(filtersInput)) {
3028
- var fromObjects = filtersInput.filter(function (item) {
3029
- return item && _typeof(item) === "object" && item.value !== undefined && item.value !== null && "".concat(item.value).trim();
3030
- }).map(function (item) {
3031
- return "".concat(item.label || item.id || "Filter", ": ").concat(item.value);
3032
- }).join(" | ").trim();
3033
- if (fromObjects) return fromObjects;
3034
- var fromStrings = filtersInput.map(function (item) {
3035
- return typeof item === "string" ? item.trim() : "";
3036
- }).filter(Boolean).join(" | ").trim();
3037
- if (fromStrings) return fromStrings;
3038
- }
3039
- if (filtersInput && _typeof(filtersInput) === "object") {
3040
- if (Array.isArray(filtersInput.activeFilters) || typeof filtersInput.activeFilters === "string") {
3041
- return _normalizeFiltersText(filtersInput.activeFilters);
3042
- }
3043
- if (filtersInput.value !== undefined && filtersInput.value !== null && "".concat(filtersInput.value).trim()) {
3044
- return "".concat(filtersInput.label || filtersInput.id || "Filter", ": ").concat(filtersInput.value).trim();
3045
- }
3046
- }
3047
- return "";
3048
- };
3049
- var formattedActiveFilters = _normalizeFiltersText(activeFilters);
3050
3293
  var parseFilterPills = function parseFilterPills(filtersInput) {
3051
3294
  if (Array.isArray(filtersInput)) {
3052
3295
  var fromObjects = filtersInput.filter(function (item) {
@@ -3093,9 +3336,9 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3093
3336
  chargebackRate = refunds.chargebackRate,
3094
3337
  growthPercentage = refunds.growthPercentage,
3095
3338
  totalRefundedAmount = refunds.totalRefundedAmount,
3096
- totalRefunds = refunds.totalRefunds,
3097
- totalChargebacks = refunds.totalChargebacks,
3098
- lostChargebacks = refunds.lostChargebacks;
3339
+ totalRefunds = refunds.totalRefunds;
3340
+ refunds.totalChargebacks;
3341
+ var lostChargebacks = refunds.lostChargebacks;
3099
3342
  var newDonors = donorMix.newDonors,
3100
3343
  returningDonors = donorMix.returningDonors,
3101
3344
  totalMix = donorMix.totalMix,
@@ -3104,8 +3347,7 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3104
3347
  mixAvgGift = donorMix.avgGift,
3105
3348
  donorMixPrev = donorMix.donorMixPrev;
3106
3349
  var geoList = report.donorGeographyList;
3107
- var trafficItems = Array.isArray(apiData === null || apiData === void 0 || (_apiData$trafficSourc = apiData.trafficSourceData) === null || _apiData$trafficSourc === void 0 ? void 0 : _apiData$trafficSourc.data) ? apiData.trafficSourceData.data : [];
3108
- var trafficTotal = Number((_apiData$trafficSourc2 = apiData === null || apiData === void 0 || (_apiData$trafficSourc3 = apiData.trafficSourceData) === null || _apiData$trafficSourc3 === void 0 ? void 0 : _apiData$trafficSourc3.totalRevenue) !== null && _apiData$trafficSourc2 !== void 0 ? _apiData$trafficSourc2 : 0);
3350
+ var trafficTotal = Number((_apiData$trafficSourc = apiData === null || apiData === void 0 || (_apiData$trafficSourc2 = apiData.trafficSourceData) === null || _apiData$trafficSourc2 === void 0 ? void 0 : _apiData$trafficSourc2.totalRevenue) !== null && _apiData$trafficSourc !== void 0 ? _apiData$trafficSourc : 0);
3109
3351
  var revSeries = mainChart.series || [{
3110
3352
  name: "Paid Ads",
3111
3353
  data: []
@@ -3155,12 +3397,30 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3155
3397
  return String(trend !== null && trend !== void 0 ? trend : "").replace(/x$/, "×");
3156
3398
  };
3157
3399
  var avgDonationDetailText = formatMetricDetail(((_metricByTitle$AvgDo = metricByTitle["Avg Donation"]) === null || _metricByTitle$AvgDo === void 0 ? void 0 : _metricByTitle$AvgDo.detail) || avgDonationDetail.detail);
3158
- var headerProps = {
3159
- dateLabel: dateLabel,
3160
- generatedLabel: generatedLabel,
3161
- activeFilters: formattedActiveFilters,
3162
- windowLabel: windowLabel
3400
+ var campaignRows = activeCampaigns.map(function (c) {
3401
+ return {
3402
+ name: c.name,
3403
+ raised: c.val1,
3404
+ progress: c.progress,
3405
+ donors: c.val3,
3406
+ status: c.status
3407
+ };
3408
+ });
3409
+ var donorMixTrend = "".concat(formatTrend(donorMixPrev !== null && donorMixPrev !== void 0 ? donorMixPrev : 0), " vs last month");
3410
+ var trafficList = Array.isArray(apiData === null || apiData === void 0 || (_apiData$trafficSourc3 = apiData.trafficSourceData) === null || _apiData$trafficSourc3 === void 0 ? void 0 : _apiData$trafficSourc3.data) ? apiData.trafficSourceData.data : Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.trafficSourceData) ? apiData.trafficSourceData : [];
3411
+ var chartLabelAt = function chartLabelAt(chart, index) {
3412
+ var item = chart === null || chart === void 0 ? void 0 : chart[index];
3413
+ if (!item) return "";
3414
+ return item.date || item.label || item.category || "";
3163
3415
  };
3416
+ var obChart = (ob === null || ob === void 0 ? void 0 : ob.chart) || [];
3417
+ var refChart = (refCard === null || refCard === void 0 ? void 0 : refCard.chartData) || [];
3418
+ var chartStartLabel = chartLabelAt(obChart, 0) || revCats[0] || "";
3419
+ var chartEndLabel = chartLabelAt(obChart, obChart.length - 1) || revCats[revCats.length - 1] || "";
3420
+ var refStartLabel = chartLabelAt(refChart, 0) || revCats[0] || "";
3421
+ var refEndLabel = chartLabelAt(refChart, refChart.length - 1) || revCats[revCats.length - 1] || "";
3422
+ var disputedAmount = refunds.disputedAmount;
3423
+ var refundChartData = refunds.chartData || [];
3164
3424
  return /*#__PURE__*/jsxs("div", {
3165
3425
  ref: ref,
3166
3426
  style: {
@@ -3355,9 +3615,11 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3355
3615
  })]
3356
3616
  })]
3357
3617
  })]
3358
- }), /*#__PURE__*/jsx(PageOneFooter, {
3618
+ }), /*#__PURE__*/jsx(PdfPageFooter, {
3359
3619
  generatedBy: name,
3360
- generatedLabel: generatedLabel
3620
+ generatedDate: generatedDate,
3621
+ generatedTime: generatedTime,
3622
+ page: 1
3361
3623
  })]
3362
3624
  }), /*#__PURE__*/jsxs("div", {
3363
3625
  "data-export-page": "2",
@@ -3367,418 +3629,119 @@ var ExportPdfLayout = /*#__PURE__*/React.forwardRef(function (_ref20, ref) {
3367
3629
  background: THEME.pageBg,
3368
3630
  display: "flex",
3369
3631
  flexDirection: "column",
3370
- fontFamily: "'Helvetica Neue', Helvetica, Arial, sans-serif",
3632
+ fontFamily: "'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif",
3371
3633
  boxSizing: "border-box"
3372
3634
  },
3373
- children: [/*#__PURE__*/jsx(PageHeader, _objectSpread2(_objectSpread2({}, headerProps), {}, {
3374
- page: 2
3375
- })), /*#__PURE__*/jsxs("div", {
3635
+ children: [/*#__PURE__*/jsx(PageOneHeader, {
3636
+ dateLabel: dateLabel,
3637
+ generatedLabel: generatedLabel,
3638
+ windowLabel: windowLabel
3639
+ }), /*#__PURE__*/jsxs("div", {
3376
3640
  style: {
3377
3641
  flex: 1,
3378
- padding: "10px ".concat(MX, "px 8px"),
3642
+ padding: "14px ".concat(MX, "px 0"),
3379
3643
  display: "flex",
3380
3644
  flexDirection: "column",
3381
- gap: 8
3645
+ gap: 10
3382
3646
  },
3383
3647
  children: [/*#__PURE__*/jsxs("div", {
3384
3648
  style: {
3385
3649
  display: "grid",
3386
- gridTemplateColumns: "2.2fr 1fr",
3387
- gap: 8
3650
+ gridTemplateColumns: "2.15fr 1fr",
3651
+ gap: 10
3388
3652
  },
3389
- children: [/*#__PURE__*/jsx(Panel, {
3653
+ children: [/*#__PURE__*/jsx(P2Card, {
3390
3654
  title: "Active campaigns",
3391
3655
  subtitle: "Live fundraisers ranked by velocity",
3392
- children: /*#__PURE__*/jsx(MiniTable, {
3393
- head: ["Campaign", "Raised", "Progress", "Donors", "Avg Gift"],
3394
- colAlign: ["left", "right", "left", "right", "right"],
3395
- rows: activeCampaigns.map(function (c, i) {
3396
- return [c.name, c.val1, /*#__PURE__*/jsx(ProgressBar, {
3397
- value: c.progress
3398
- }, "campaign-progress-".concat(i)), c.val3, c.val4];
3399
- })
3400
- })
3401
- }), /*#__PURE__*/jsx(Panel, {
3402
- title: "Donor mix",
3403
- subtitle: "Acquisition vs retention",
3404
- children: /*#__PURE__*/jsxs("div", {
3656
+ action: /*#__PURE__*/jsx("span", {
3405
3657
  style: {
3406
- display: "flex",
3407
- flexDirection: "column",
3408
- alignItems: "center"
3658
+ fontSize: 9,
3659
+ color: THEME.brand,
3660
+ fontWeight: 500
3409
3661
  },
3410
- children: [/*#__PURE__*/jsx(Donut, {
3411
- segments: [{
3412
- value: newDonors,
3413
- color: C.indigo
3414
- }, {
3415
- value: returningDonors,
3416
- color: C.emerald
3417
- }],
3418
- size: 88,
3419
- centerVal: "".concat(formatNumber(totalMix)),
3420
- centerLabel: "donors"
3421
- }), /*#__PURE__*/jsxs("div", {
3422
- style: {
3423
- width: "100%",
3424
- marginTop: 6
3425
- },
3426
- children: [/*#__PURE__*/jsxs("div", {
3427
- style: {
3428
- display: "flex",
3429
- justifyContent: "space-between",
3430
- alignItems: "center",
3431
- marginBottom: 5
3432
- },
3433
- children: [/*#__PURE__*/jsxs("div", {
3434
- style: {
3435
- display: "flex",
3436
- alignItems: "center",
3437
- gap: 5
3438
- },
3439
- children: [/*#__PURE__*/jsx("div", {
3440
- style: {
3441
- width: 8,
3442
- height: 8,
3443
- borderRadius: 2,
3444
- background: C.indigo,
3445
- flexShrink: 0
3446
- }
3447
- }), /*#__PURE__*/jsx("span", {
3448
- style: {
3449
- fontSize: 9.5,
3450
- color: "#6B7280"
3451
- },
3452
- children: "New donors"
3453
- })]
3454
- }), /*#__PURE__*/jsxs("span", {
3455
- style: {
3456
- fontSize: 9.5,
3457
- fontWeight: 700,
3458
- color: "#111827"
3459
- },
3460
- children: [formatNumber(newDonors), " - ", newPct, "%"]
3461
- })]
3462
- }), /*#__PURE__*/jsxs("div", {
3463
- style: {
3464
- display: "flex",
3465
- justifyContent: "space-between",
3466
- alignItems: "center",
3467
- marginBottom: 8
3468
- },
3469
- children: [/*#__PURE__*/jsxs("div", {
3470
- style: {
3471
- display: "flex",
3472
- alignItems: "center",
3473
- gap: 5
3474
- },
3475
- children: [/*#__PURE__*/jsx("div", {
3476
- style: {
3477
- width: 8,
3478
- height: 8,
3479
- borderRadius: 2,
3480
- background: C.emerald,
3481
- flexShrink: 0
3482
- }
3483
- }), /*#__PURE__*/jsx("span", {
3484
- style: {
3485
- fontSize: 9.5,
3486
- color: "#6B7280"
3487
- },
3488
- children: "Returning"
3489
- })]
3490
- }), /*#__PURE__*/jsxs("span", {
3491
- style: {
3492
- fontSize: 9.5,
3493
- fontWeight: 700,
3494
- color: "#111827"
3495
- },
3496
- children: [formatNumber(returningDonors), " - ", retPct, "%"]
3497
- })]
3498
- }), /*#__PURE__*/jsx(Divider, {
3499
- mb: 6
3500
- }), /*#__PURE__*/jsx("div", {
3501
- style: {
3502
- fontSize: 9.5,
3503
- color: "#9CA3AF",
3504
- marginBottom: 2
3505
- },
3506
- children: "Avg gift"
3507
- }), /*#__PURE__*/jsx("div", {
3508
- style: {
3509
- fontSize: 14,
3510
- fontWeight: 800,
3511
- color: "#111827",
3512
- marginBottom: 2
3513
- },
3514
- children: d$(mixAvgGift)
3515
- }), /*#__PURE__*/jsx("div", {
3516
- style: {
3517
- fontSize: 9
3518
- },
3519
- children: /*#__PURE__*/jsx(TrendText, {
3520
- style: {
3521
- fontSize: 9
3522
- },
3523
- children: formatArrowTrend(donorMixPrev, {
3524
- label: "vs last month"
3525
- })
3526
- })
3527
- })]
3528
- })]
3662
+ children: "View all"
3663
+ }),
3664
+ children: /*#__PURE__*/jsx(P2CampaignTable, {
3665
+ rows: campaignRows
3529
3666
  })
3667
+ }), /*#__PURE__*/jsx(P2DonorMixCard, {
3668
+ newDonors: newDonors,
3669
+ returningDonors: returningDonors,
3670
+ totalMix: totalMix,
3671
+ newPct: newPct,
3672
+ retPct: retPct,
3673
+ avgGift: mixAvgGift,
3674
+ avgGiftTrend: donorMixTrend
3530
3675
  })]
3531
3676
  }), /*#__PURE__*/jsxs("div", {
3532
3677
  style: {
3533
3678
  display: "grid",
3534
3679
  gridTemplateColumns: "repeat(4, 1fr)",
3535
- gap: 8
3680
+ gap: 10
3536
3681
  },
3537
- children: [/*#__PURE__*/jsx(DonationTypePanel, {
3538
- donationTypeData: report.donationTypeData,
3539
- recurringColor: C.indigo,
3540
- oneTimeColor: C.emerald
3541
- }), /*#__PURE__*/jsx(DonorGeographyPanel, {
3682
+ children: [/*#__PURE__*/jsx(P2DonationTypeCard, {
3683
+ donationTypeData: report.donationTypeData
3684
+ }), /*#__PURE__*/jsx(P2DonorGeographyCard, {
3542
3685
  geoList: geoList,
3543
- totalDonors: totalDonors,
3544
- barColor: C.indigo
3545
- }), /*#__PURE__*/jsxs(Panel, {
3546
- title: "Refunds & chargebacks",
3547
- subtitle: "Trust health - ".concat(numberOfDays, "-day window"),
3548
- children: [/*#__PURE__*/jsxs("div", {
3549
- style: {
3550
- display: "flex",
3551
- gap: 12,
3552
- marginBottom: 7
3553
- },
3554
- children: [/*#__PURE__*/jsxs("div", {
3555
- children: [/*#__PURE__*/jsx("div", {
3556
- style: {
3557
- fontSize: 8,
3558
- fontWeight: 700,
3559
- letterSpacing: "0.5px",
3560
- color: "#6B7280",
3561
- marginBottom: 2
3562
- },
3563
- children: "Refunds"
3564
- }), /*#__PURE__*/jsx("div", {
3565
- style: {
3566
- fontSize: 15,
3567
- fontWeight: 800,
3568
- color: "#111827"
3569
- },
3570
- children: pct(refundRate, 1)
3571
- }), /*#__PURE__*/jsx("div", {
3572
- style: {
3573
- fontSize: 9,
3574
- fontWeight: 600
3575
- },
3576
- children: /*#__PURE__*/jsx(TrendText, {
3577
- invert: true,
3578
- style: {
3579
- fontSize: 9
3580
- },
3581
- children: growthPercentage === 0 ? "stable" : formatArrowTrend(growthPercentage)
3582
- })
3583
- })]
3584
- }), /*#__PURE__*/jsxs("div", {
3585
- children: [/*#__PURE__*/jsx("div", {
3586
- style: {
3587
- fontSize: 8,
3588
- fontWeight: 700,
3589
- letterSpacing: "0.5px",
3590
- color: "#6B7280",
3591
- marginBottom: 2
3592
- },
3593
- children: "Chargebacks"
3594
- }), /*#__PURE__*/jsx("div", {
3595
- style: {
3596
- fontSize: 15,
3597
- fontWeight: 800,
3598
- color: "#111827"
3599
- },
3600
- children: pct(chargebackRate, 1)
3601
- }), /*#__PURE__*/jsx("div", {
3602
- style: {
3603
- fontSize: 9,
3604
- color: "#9CA3AF"
3605
- },
3606
- children: growthPercentage === 0 ? "stable" : /*#__PURE__*/jsx(TrendText, {
3607
- invert: true,
3608
- style: {
3609
- fontSize: 9
3610
- },
3611
- children: formatArrowTrend(growthPercentage)
3612
- })
3613
- })]
3614
- })]
3615
- }), /*#__PURE__*/jsx(Divider, {
3616
- mb: 5
3617
- }), /*#__PURE__*/jsxs("div", {
3618
- style: {
3619
- fontSize: 8,
3620
- color: "#6B7280",
3621
- lineHeight: 1.45
3622
- },
3623
- children: [d$(totalRefundedAmount), " refunded - ", formatNumber(totalChargebacks), " chargebacks - ", formatNumber(lostChargebacks), " cases lost"]
3624
- })]
3625
- }), /*#__PURE__*/jsx(Panel, {
3626
- title: "Traffic source",
3627
- subtitle: "Revenue by channel - ".concat(daysLabel),
3628
- children: /*#__PURE__*/jsx(MiniTable, {
3629
- head: ["Source", "Revenue", "Share"],
3630
- rows: [].concat(_toConsumableArray(trafficItems.map(function (t) {
3631
- return [t.source || t.name || "-", d$(t.revenue || t.raised || 0), "".concat(formatNumber(t.share || t.percentage || 0), "%")];
3632
- })), [["Total", d$(trafficTotal), ""]])
3633
- })
3686
+ totalDonors: totalDonors
3687
+ }), /*#__PURE__*/jsx(P2RefundsCard, {
3688
+ refundRate: refundRate,
3689
+ chargebackRate: chargebackRate,
3690
+ refundGrowth: growthPercentage !== null && growthPercentage !== void 0 ? growthPercentage : 0,
3691
+ totalRefundedAmount: totalRefundedAmount,
3692
+ disputedAmount: disputedAmount !== null && disputedAmount !== void 0 ? disputedAmount : 0,
3693
+ lostCases: lostChargebacks !== null && lostChargebacks !== void 0 ? lostChargebacks : 0,
3694
+ chartData: refundChartData,
3695
+ windowLabel: windowLabel
3696
+ }), /*#__PURE__*/jsx(P2TrafficSourceCard, {
3697
+ items: trafficList,
3698
+ total: trafficTotal,
3699
+ daysLabel: daysLabel
3634
3700
  })]
3635
3701
  }), /*#__PURE__*/jsxs("div", {
3636
3702
  style: {
3637
3703
  display: "grid",
3638
3704
  gridTemplateColumns: "repeat(4, 1fr)",
3639
- gap: 8
3705
+ gap: 10
3640
3706
  },
3641
- children: [/*#__PURE__*/jsxs(Panel, {
3707
+ children: [/*#__PURE__*/jsx(P2RevenueTrendCard, {
3642
3708
  title: "Order Bump",
3643
- subtitle: "Revenue trend - last ".concat(daysLabel),
3644
- children: [/*#__PURE__*/jsx("div", {
3645
- style: {
3646
- fontSize: 17,
3647
- fontWeight: 800,
3648
- color: "#111827"
3649
- },
3650
- children: d$((ob === null || ob === void 0 ? void 0 : ob.totalRevenue) || 0)
3651
- }), /*#__PURE__*/jsx("div", {
3652
- style: {
3653
- fontSize: 10,
3654
- fontWeight: 600,
3655
- marginBottom: 5
3656
- },
3657
- children: /*#__PURE__*/jsx(TrendText, {
3658
- style: {
3659
- fontSize: 10
3660
- },
3661
- children: formatArrowTrend((_ob$growthPercentage = ob === null || ob === void 0 ? void 0 : ob.growthPercentage) !== null && _ob$growthPercentage !== void 0 ? _ob$growthPercentage : 0, {
3662
- label: "vs pp"
3663
- })
3664
- })
3665
- }), /*#__PURE__*/jsx(Sparkline, {
3666
- data: obData.length ? obData : [0, 0],
3667
- color: C.indigo,
3668
- width: 110,
3669
- height: 34
3670
- }), /*#__PURE__*/jsx(Divider, {
3671
- mt: 8,
3672
- mb: 7
3673
- }), /*#__PURE__*/jsx("div", {
3674
- style: {
3675
- display: "flex",
3676
- gap: 12
3677
- },
3678
- children: [["Avg/day", d$((ob === null || ob === void 0 ? void 0 : ob.averagePerDay) || 0)], ["Peak day", d$((ob === null || ob === void 0 || (_ob$peakDay = ob.peakDay) === null || _ob$peakDay === void 0 ? void 0 : _ob$peakDay.amount) || 0)], ["Orders", formatNumber((ob === null || ob === void 0 ? void 0 : ob.totalOrders) || 0)]].map(function (_ref21) {
3679
- var _ref22 = _slicedToArray(_ref21, 2),
3680
- l = _ref22[0],
3681
- v = _ref22[1];
3682
- return /*#__PURE__*/jsxs("div", {
3683
- children: [/*#__PURE__*/jsx("div", {
3684
- style: {
3685
- fontSize: 8,
3686
- color: "#9CA3AF",
3687
- marginBottom: 4
3688
- },
3689
- children: l
3690
- }), /*#__PURE__*/jsx("div", {
3691
- style: {
3692
- fontSize: 11.5,
3693
- fontWeight: 700,
3694
- color: "#111827"
3695
- },
3696
- children: v
3697
- })]
3698
- }, l);
3699
- })
3700
- })]
3701
- }), /*#__PURE__*/jsx(AcceptanceRaisedPanel, {
3709
+ subtitle: "Revenue trend".concat(BULLET, "last ").concat(daysLabel),
3710
+ value: (_ob$totalRevenue = ob === null || ob === void 0 ? void 0 : ob.totalRevenue) !== null && _ob$totalRevenue !== void 0 ? _ob$totalRevenue : 0,
3711
+ trend: "".concat(formatTrend((_ob$growthPercentage = ob === null || ob === void 0 ? void 0 : ob.growthPercentage) !== null && _ob$growthPercentage !== void 0 ? _ob$growthPercentage : 0), " vs last month"),
3712
+ chartData: obData.length ? obData : [0, 0],
3713
+ chartColor: THEME.brand,
3714
+ startLabel: chartStartLabel,
3715
+ endLabel: chartEndLabel,
3716
+ footerStats: [["Avg/day", d$Compact((_ob$averagePerDay = ob === null || ob === void 0 ? void 0 : ob.averagePerDay) !== null && _ob$averagePerDay !== void 0 ? _ob$averagePerDay : 0)], ["Peak day", d$Compact((_ob$peakDay$amount = ob === null || ob === void 0 || (_ob$peakDay = ob.peakDay) === null || _ob$peakDay === void 0 ? void 0 : _ob$peakDay.amount) !== null && _ob$peakDay$amount !== void 0 ? _ob$peakDay$amount : 0)], ["Orders", formatNumber((_ob$totalOrders = ob === null || ob === void 0 ? void 0 : ob.totalOrders) !== null && _ob$totalOrders !== void 0 ? _ob$totalOrders : 0)]]
3717
+ }), /*#__PURE__*/jsx(P2AcceptanceCard, {
3702
3718
  title: "Upsell",
3703
- subtitle: "Acceptance & raised",
3704
- acceptanceRate: (up === null || up === void 0 ? void 0 : up.acceptanceRate) || 0,
3719
+ acceptanceRate: (_up$acceptanceRate = up === null || up === void 0 ? void 0 : up.acceptanceRate) !== null && _up$acceptanceRate !== void 0 ? _up$acceptanceRate : 0,
3705
3720
  acceptanceGrowth: (_up$acceptanceGrowth = up === null || up === void 0 ? void 0 : up.acceptanceGrowth) !== null && _up$acceptanceGrowth !== void 0 ? _up$acceptanceGrowth : 0,
3706
- raised: (up === null || up === void 0 ? void 0 : up.raised) || 0,
3707
- raisedGrowth: (_up$raisedGrowth = up === null || up === void 0 ? void 0 : up.raisedGrowth) !== null && _up$raisedGrowth !== void 0 ? _up$raisedGrowth : 0,
3708
- primaryColor: C.indigo
3709
- }), /*#__PURE__*/jsx(AcceptanceRaisedPanel, {
3721
+ raised: (_up$raised = up === null || up === void 0 ? void 0 : up.raised) !== null && _up$raised !== void 0 ? _up$raised : 0,
3722
+ raisedGrowth: (_up$raisedGrowth = up === null || up === void 0 ? void 0 : up.raisedGrowth) !== null && _up$raisedGrowth !== void 0 ? _up$raisedGrowth : 0
3723
+ }), /*#__PURE__*/jsx(P2AcceptanceCard, {
3710
3724
  title: "Downsell",
3711
- subtitle: "Acceptance & raised",
3712
- acceptanceRate: (dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) || 0,
3725
+ acceptanceRate: (_dn$acceptanceRate = dn === null || dn === void 0 ? void 0 : dn.acceptanceRate) !== null && _dn$acceptanceRate !== void 0 ? _dn$acceptanceRate : 0,
3713
3726
  acceptanceGrowth: (_dn$acceptanceGrowth = dn === null || dn === void 0 ? void 0 : dn.acceptanceGrowth) !== null && _dn$acceptanceGrowth !== void 0 ? _dn$acceptanceGrowth : 0,
3714
- raised: (dn === null || dn === void 0 ? void 0 : dn.raised) || 0,
3715
- raisedGrowth: (_dn$raisedGrowth = dn === null || dn === void 0 ? void 0 : dn.raisedGrowth) !== null && _dn$raisedGrowth !== void 0 ? _dn$raisedGrowth : 0,
3716
- primaryColor: C.cyan
3717
- }), /*#__PURE__*/jsxs(Panel, {
3727
+ raised: (_dn$raised = dn === null || dn === void 0 ? void 0 : dn.raised) !== null && _dn$raised !== void 0 ? _dn$raised : 0,
3728
+ raisedGrowth: (_dn$raisedGrowth = dn === null || dn === void 0 ? void 0 : dn.raisedGrowth) !== null && _dn$raisedGrowth !== void 0 ? _dn$raisedGrowth : 0
3729
+ }), /*#__PURE__*/jsx(P2RevenueTrendCard, {
3718
3730
  title: "Referrals",
3719
- subtitle: "Revenue trend - last ".concat(daysLabel),
3720
- children: [/*#__PURE__*/jsx("div", {
3721
- style: {
3722
- fontSize: 17,
3723
- fontWeight: 800,
3724
- color: "#111827"
3725
- },
3726
- children: d$((refCard === null || refCard === void 0 ? void 0 : refCard.totalRevenue) || 0)
3727
- }), /*#__PURE__*/jsx("div", {
3728
- style: {
3729
- fontSize: 10,
3730
- fontWeight: 600,
3731
- marginBottom: 5
3732
- },
3733
- children: /*#__PURE__*/jsx(TrendText, {
3734
- style: {
3735
- fontSize: 10
3736
- },
3737
- children: formatArrowTrend((_refCard$growthPercen = refCard === null || refCard === void 0 ? void 0 : refCard.growthPercentage) !== null && _refCard$growthPercen !== void 0 ? _refCard$growthPercen : 0, {
3738
- label: "vs pp"
3739
- })
3740
- })
3741
- }), /*#__PURE__*/jsx(Sparkline, {
3742
- data: refData.length ? refData : [0, 0],
3743
- color: C.emerald,
3744
- width: 110,
3745
- height: 34
3746
- }), /*#__PURE__*/jsx(Divider, {
3747
- mt: 8,
3748
- mb: 7
3749
- }), /*#__PURE__*/jsx("div", {
3750
- style: {
3751
- display: "flex",
3752
- gap: 12
3753
- },
3754
- children: [["Referrers", formatNumber((refCard === null || refCard === void 0 ? void 0 : refCard.totalReferrers) || 0)], ["Avg gift", d$((refCard === null || refCard === void 0 ? void 0 : refCard.averageGift) || 0)], ["Conv. rate", pct((refCard === null || refCard === void 0 ? void 0 : refCard.conversionRate) || 0, 1)]].map(function (_ref23) {
3755
- var _ref24 = _slicedToArray(_ref23, 2),
3756
- l = _ref24[0],
3757
- v = _ref24[1];
3758
- return /*#__PURE__*/jsxs("div", {
3759
- children: [/*#__PURE__*/jsx("div", {
3760
- style: {
3761
- fontSize: 8,
3762
- color: "#9CA3AF",
3763
- marginBottom: 4
3764
- },
3765
- children: l
3766
- }), /*#__PURE__*/jsx("div", {
3767
- style: {
3768
- fontSize: 11.5,
3769
- fontWeight: 700,
3770
- color: "#111827"
3771
- },
3772
- children: v
3773
- })]
3774
- }, l);
3775
- })
3776
- })]
3731
+ subtitle: "Revenue trend".concat(BULLET, "last ").concat(daysLabel),
3732
+ value: (_refCard$totalRevenue = refCard === null || refCard === void 0 ? void 0 : refCard.totalRevenue) !== null && _refCard$totalRevenue !== void 0 ? _refCard$totalRevenue : 0,
3733
+ trend: "".concat(formatTrend((_refCard$growthPercen = refCard === null || refCard === void 0 ? void 0 : refCard.growthPercentage) !== null && _refCard$growthPercen !== void 0 ? _refCard$growthPercen : 0), " vs last month"),
3734
+ chartData: refData.length ? refData : [0, 0],
3735
+ chartColor: "#10B981",
3736
+ startLabel: refStartLabel,
3737
+ endLabel: refEndLabel,
3738
+ footerStats: [["Referrers", formatNumber((_refCard$totalReferre = refCard === null || refCard === void 0 ? void 0 : refCard.totalReferrers) !== null && _refCard$totalReferre !== void 0 ? _refCard$totalReferre : 0)], ["Avg gift", d$Compact((_refCard$averageGift = refCard === null || refCard === void 0 ? void 0 : refCard.averageGift) !== null && _refCard$averageGift !== void 0 ? _refCard$averageGift : 0)], ["Conv. rate", pct((_refCard$conversionRa = refCard === null || refCard === void 0 ? void 0 : refCard.conversionRate) !== null && _refCard$conversionRa !== void 0 ? _refCard$conversionRa : 0, 1)]]
3777
3739
  })]
3778
3740
  })]
3779
- }), /*#__PURE__*/jsx(PageFooter, {
3741
+ }), /*#__PURE__*/jsx(PdfPageFooter, {
3780
3742
  generatedBy: name,
3781
- generatedLabel: generatedLabel,
3743
+ generatedDate: generatedDate,
3744
+ generatedTime: generatedTime,
3782
3745
  page: 2
3783
3746
  })]
3784
3747
  })]